From 30b3949d2bd9da6bceddb40f3d1921b95fa80316 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 20 Feb 2023 00:36:02 +0100 Subject: wallet-core: pending operation for peer push credit, save withdrawalGroupId --- packages/taler-wallet-core/src/db.ts | 41 +++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (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 f8fbe2f07..5f7a6a4c4 100644 --- a/packages/taler-wallet-core/src/db.ts +++ b/packages/taler-wallet-core/src/db.ts @@ -1818,6 +1818,18 @@ export interface PeerPullPaymentInitiationRecord { * Status of the peer pull payment initiation. */ status: OperationStatus; + + withdrawalGroupId: string | undefined; +} + +export enum PeerPushPaymentIncomingStatus { + Proposed = 30 /* USER_ATTENTION_START */, + Accepted = 10 /* ACTIVE_START */, + /** + * Merge was successful and withdrawal group has been created, now + * everything is in the hand of the withdrawal group. + */ + WithdrawalCreated = 50 /* DORMANT_START */, } /** @@ -1847,7 +1859,12 @@ export interface PeerPushPaymentIncomingRecord { /** * Status of the peer push payment incoming initiation. */ - status: OperationStatus; + status: PeerPushPaymentIncomingStatus; + + /** + * Associated withdrawal group. + */ + withdrawalGroupId: string | undefined; } export enum PeerPullPaymentIncomingStatus { @@ -2260,6 +2277,21 @@ export const WalletStoresV1 = { "exchangeBaseUrl", "pursePub", ]), + byExchangeAndContractPriv: describeIndex( + "byExchangeAndContractPriv", + ["exchangeBaseUrl", "contractPriv"], + { + versionAdded: 4, + unique: true, + }, + ), + byWithdrawalGroupId: describeIndex( + "byWithdrawalGroupId", + "withdrawalGroupId", + { + versionAdded: 4, + }, + ), byStatus: describeIndex("byStatus", "status"), }, ), @@ -2291,6 +2323,13 @@ export const WalletStoresV1 = { }), { byStatus: describeIndex("byStatus", "status"), + byWithdrawalGroupId: describeIndex( + "byWithdrawalGroupId", + "withdrawalGroupId", + { + versionAdded: 4, + }, + ), }, ), peerPushPaymentInitiations: describeStore( -- cgit v1.2.3