From eff3920bd5a2bff58d66ac72ba8bd2c1577f452f Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 23 Apr 2023 22:49:42 +0200 Subject: wallet-core: further towards deposit DD37 --- packages/taler-wallet-core/src/db.ts | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'packages/taler-wallet-core/src/db.ts') 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. -- cgit v1.2.3