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 payouts 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.4.0

Hierarchy

Index

Constructors

Properties

collectionName: string = "payouts"

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

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 represent a payout's actual date of creation of the signed transaction. This field does not represent the date of confirmation.

access

public

readonly
var

{Date}

payoutAssets?: ObjectLiteral[]

This is the payout's mosaics as defined by dHealth Network. It contains an array of ObjectLiteral objects that consist of both a mosaicId and amount field.

This field contains the actual tokens that have been paid out to the end-user with this document. It can hold only a single mosaic or up to 10 different mosaics that were sent to the end- user for completing an activity (or other operations).

This field is optional, indexed and defaults to an empty array.

example

[{ "mosaicId": "39E0C49FA322A459", amount: 1 }]

access

public

readonly
var

{string}

payoutState?: PayoutState

This property is a flag that determines whether the payout has been executed before or not. The execution of said payout happens in multiple stages, with following possible update flows:

```

Success flow

  1. Not_Started -> Prepared -> Broadcast -> Confirmed

Failure flows

  1. Not_Started -> Prepared -> Failed
  2. Not_Started -> Prepared -> Broadcast -> Failed
<br /><br />
Possible values for this field in the database are of type `number` and
listed in <a href="../enums/PayoutState.html">PayoutState</a>. Initially, the value will always be
`0` as this corresponds to "not-started".
<br /><br />
This field is **optional**, *indexed* and defaults to `0`.
example

0

access

public

readonly
var

{string}

signedBytes?: string

This field contains the signed transaction bytes. This represents the signed transaction in a binary payload expressed in hexadecimal format.

Note that this field will be emptied once the transaction has been broadcast and verified to be confirmed on dHealth Network.

access

public

readonly
var

{string}

subjectCollection: string

This is the subject collection name. This name corresponds to the origin database collection in which the above slug can be found to be linked to one unique entity.

This field is required and indexed.

access

public

readonly
var

{string}

subjectSlug: string

This is the subject slug. With the currently implemented payout module, the subject is always an activity but in future releases of the software, the subject may also be a profile, or a leaderboard update, etc.

This field is required and indexed.

access

public

readonly
var

{string}

transactionHash?: string

This is the transaction hash as defined by dHealth Network. It contains an immutable sha3-256 hash created from the transaction body.

Due to the usage of sha3-256, this hash is always a 32 bytes transaction hash (64 characters in hexadecimal notation).

This field is required, indexed and values are expected to be unique.

access

public

readonly
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.

access

public

readonly
var

{Date}

userAddress: string

This is the user's address. The user corresponds to the destination of said payout ("recipient").

This field is required and indexed.

access

public

readonly
var

{string}

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