Skip to main content

Transaction

Defined in: domain/Transaction.ts:18

Represents a Transaction entity. Extends Deletable to support soft deletion.

Remarks​

Each transaction is associated with a wallet and an inventory item, and contains details such as amount, fee, type, status, and relevant dates.

Example​

const transaction = new Transaction(
1, 10, 100, "Deposit", "100.00", "1.00", 2, 1, null, new Date(), null, null, null, null
);
console.log(transaction.name, transaction.amount);

Extends​

Constructors​

Constructor​

new Transaction(
wallet_id,
inventory_item_id,
id?,
name?,
amount?,
fee?,
type_id?,
status_id?,
other_wallet_id?,
createdAt?,
dateClaimable?,
dateReady?,
deletedAt?,
image?): Transaction;

Defined in: domain/Transaction.ts:61

Creates a new Transaction instance.

Parameters​

wallet_id​

number

The wallet ID associated with this transaction.

inventory_item_id​

number

The inventory item ID associated with this transaction.

id?​

number

The unique identifier for the transaction.

name?​

string

The name of the transaction.

amount?​

string

The amount of the transaction.

fee?​

string

The fee for the transaction.

type_id?​

number

The type ID of the transaction.

status_id?​

number

The status ID of the transaction.

other_wallet_id?​

The other wallet ID involved in the transaction, if any.

null | number

createdAt?​

The creation date of the transaction.

null | Date

dateClaimable?​

The date when the transaction becomes claimable.

null | Date

dateReady?​

The date when the transaction is ready.

null | Date

deletedAt?​

The date the transaction was deleted (if applicable).

null | Date

image?​

An optional image associated with the transaction.

null | string

Returns​

Transaction

Overrides​

Deletable.constructor

Properties​

amount?​

optional amount: string;

Defined in: domain/Transaction.ts:26

The amount of the transaction.


createdAt?​

optional createdAt: null | Date;

Defined in: domain/Transaction.ts:36

The creation date of the transaction.


dateClaimable?​

optional dateClaimable: null | Date;

Defined in: domain/Transaction.ts:38

The date when the transaction becomes claimable.


dateReady?​

optional dateReady: null | Date;

Defined in: domain/Transaction.ts:40

The date when the transaction is ready.


deleted​

deleted: boolean;

Defined in: types/Deletable.ts:21

Indicates whether the entity is deleted.

Inherited from​

Deletable.deleted


deletedAt​

deletedAt: null | Date;

Defined in: types/Deletable.ts:23

The date the entity was deleted, or null if not deleted.

Inherited from​

Deletable.deletedAt


fee?​

optional fee: string;

Defined in: domain/Transaction.ts:28

The fee for the transaction.


id?​

optional id: number;

Defined in: types/Id.ts:15

The unique identifier for the entity.

Inherited from​

Deletable.id


image?​

optional image: null | string;

Defined in: domain/Transaction.ts:42

An optional image associated with the transaction.


inventory_item_id​

inventory_item_id: number;

Defined in: domain/Transaction.ts:22

The inventory item ID associated with this transaction.


name?​

optional name: string;

Defined in: domain/Transaction.ts:24

The name of the transaction.


other_wallet_id?​

optional other_wallet_id: null | number;

Defined in: domain/Transaction.ts:34

The other wallet ID involved in the transaction, if any.


status_id?​

optional status_id: number;

Defined in: domain/Transaction.ts:32

The status ID of the transaction.


type_id?​

optional type_id: number;

Defined in: domain/Transaction.ts:30

The type ID of the transaction.


wallet_id​

wallet_id: number;

Defined in: domain/Transaction.ts:20

The wallet ID associated with this transaction.