Options
All
  • Public
  • Public/Protected
  • All
Menu
description

This class defines the exact fields that are stored in the corresponding MongoDB documents. It should be used whenever database documents are being handled or read for the activities collection.

Note that this class uses the generic Transferable trait to enable a toDTO() method on the model.

todo

Timestamp fields should be numbers to avoid timezone issues.

since

v0.3.2

Hierarchy

Index

Constructors

Properties

address: string

The account's address. An address typically refers to a human-readable series of 39 characters, starting either with a T, for TESTNET addresses, or with a N, for MAINNET addresses.

This field is required and indexed.

access

public

readonly
var

{string}

amount?: number

The total amount of tokens that the address of this schema has received. Amount is in absolute format.

This field is required and not indexed.

example

123456

access

public

var{number}
collectionName: string = "statistics"

This field contains the mongo collection name for entries that are stored using AccountIntegrationDocument or the model AccountIntegrationModel.

Note that this field is not part of document properties and used only internally to perform queries that refer to an individual collection name, e.g. $unionWith.

access

public

var

{string}

createdAt?: Date

The document's creation timestamp. This field does not reflect the date of creation of an integration but rather the date of creation of the cached database entry.

This field is required and indexed.

access

public

readonly
var

{Date}

data?: any

The data attached to this statistics document. This can contain any object literal that is defined using one of:

  • UserStatisticsFields: Consists of a user statistic fields definition.
  • ObjectLiteral: e.g. { just: "a value" }.

    This field is optional and not indexed.
example

123456

access

public

var

{number}

period: string

The period string representation of this schema. Currently there are 3 types of periods:

name description example example explained
daily occurs daily "20220130" period occuring between 0:00 AM 30/01/2022 and 0:00 AM Jan 30 2022
weekly occurs weekly "202201-02" period occuring between monday and sunday the second week of Jan 2022
monthly occurs monthly "202201" period occuring between the 1st and 31st of Jan 2022


This field is required and indexed.
example

"20220130"

access

public

var

{string}

periodFormat: "D" | "W" | "M"

The period format of this statistics schema. Depends on the sub-statistics scheduler it would take a different specific value. Currently there are 3 types of periods:

value description
"D" occurs daily
"W" occurs weekly
"M" occurs monthly


This field is required and not indexed.
example

"M"

access

public

var

{string}

position?: number

The position of the user of this schema. This reflects the position in terms of total rewards (token) amount this user's address has received.

This field is required and indexed.

example

123456

access

public

var

{number}

type: string

The type of this statistics schema. Depends on the data type it would take a different specific value.

This field is required and not indexed.

example

"leaderboard"

access

public

var

{string}

updatedAt?: Date

The document's update timestamp. This field does not reflect the date of update of an integration but rather the date of update of the cached database entry.

This field is optional and not indexed.

access

public

readonly
var

{Date}

Accessors

  • get toQuery(): Record<string, unknown>
  • This method implements a specialized query format to query items individually, as documents, in the collection: account_integrations.

    access

    public

    Returns Record<string, unknown>

    The individual document data that is used in a query.

Methods

Generated using TypeDoc