diff options
author | Florian Dold <florian@dold.me> | 2023-04-23 22:49:42 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-04-23 22:49:42 +0200 |
commit | eff3920bd5a2bff58d66ac72ba8bd2c1577f452f (patch) | |
tree | 1e7435da254b56bb9b8a543ce488aeb84f032ac9 /packages/taler-wallet-core/src/db.ts | |
parent | 321252040efdb0712a38b3488297a7a802c5cb59 (diff) | |
download | wallet-core-eff3920bd5a2bff58d66ac72ba8bd2c1577f452f.tar.xz |
wallet-core: further towards deposit DD37
Diffstat (limited to 'packages/taler-wallet-core/src/db.ts')
-rw-r--r-- | packages/taler-wallet-core/src/db.ts | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/packages/taler-wallet-core/src/db.ts b/packages/taler-wallet-core/src/db.ts index 0bfe11aaa..a8c103265 100644 --- a/packages/taler-wallet-core/src/db.ts +++ b/packages/taler-wallet-core/src/db.ts @@ -873,6 +873,8 @@ export enum DepositElementStatus { Accepted = 20, KycRequired = 30, Wired = 40, + RefundSuccess = 50, + RefundFailed = 51, } /** @@ -1639,6 +1641,14 @@ export interface BackupProviderRecord { uids: string[]; } +export enum DepositOperationStatus { + Finished = 50 /* OperationStatusRange.DORMANT_START */, + Suspended = 51 /* OperationStatusRange.DORMANT_START + 1 */, + Aborted = 52 /* OperationStatusRange.DORMANT_START + 2 */, + Pending = 10 /* OperationStatusRange.ACTIVE_START */, + Aborting = 11 /* OperationStatusRange.ACTIVE_START + 1 */, +} + /** * Group of deposits made by the wallet. */ @@ -1680,16 +1690,26 @@ export interface DepositGroupRecord { */ effectiveDepositAmount: AmountString; - depositedPerCoin: boolean[]; - timestampCreated: TalerProtocolTimestamp; timestampFinished: TalerProtocolTimestamp | undefined; - operationStatus: OperationStatus; + operationStatus: DepositOperationStatus; + // FIXME: Duplication between this and transactionPerCoin! + depositedPerCoin: boolean[]; + + // FIXME: Improve name! transactionPerCoin: DepositElementStatus[]; + /** + * When the deposit transaction was aborted and + * refreshes were tried, we create a refresh + * group and store the ID here. + */ + abortRefreshGroupId?: string; + + // FIXME: Do we need this and should it be in this object store? trackingState?: { [signature: string]: { // Raw wire transfer identifier of the deposit. |