diff options
author | Florian Dold <florian@dold.me> | 2024-06-10 14:45:15 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-06-10 14:45:29 +0200 |
commit | 3e46e9c06a3846da827093833457dbda61e4d13a (patch) | |
tree | a8496907e6918ecd583778b320dbd667e9213340 /packages/taler-wallet-core/src | |
parent | ccdc69ac4941188eb3d63947f6031a7a1cc6c6af (diff) | |
download | wallet-core-3e46e9c06a3846da827093833457dbda61e4d13a.tar.xz |
wallet-core: fix duplicated transaction states, remove some dead code
Diffstat (limited to 'packages/taler-wallet-core/src')
-rw-r--r-- | packages/taler-wallet-core/src/db.ts | 105 |
1 files changed, 10 insertions, 95 deletions
diff --git a/packages/taler-wallet-core/src/db.ts b/packages/taler-wallet-core/src/db.ts index 4ec83a783..6bf212c6f 100644 --- a/packages/taler-wallet-core/src/db.ts +++ b/packages/taler-wallet-core/src/db.ts @@ -920,92 +920,6 @@ export interface CoinAllocation { amount: AmountString; } -/** - * Status of a reward we got from a merchant. - */ -export interface RewardRecord { - /** - * Has the user accepted the tip? Only after the tip has been accepted coins - * withdrawn from the tip may be used. - */ - acceptedTimestamp: DbPreciseTimestamp | undefined; - - /** - * The tipped amount. - */ - rewardAmountRaw: AmountString; - - /** - * Effect on the balance (including fees etc). - */ - rewardAmountEffective: AmountString; - - /** - * Timestamp, the tip can't be picked up anymore after this deadline. - */ - rewardExpiration: DbProtocolTimestamp; - - /** - * The exchange that will sign our coins, chosen by the merchant. - */ - exchangeBaseUrl: string; - - /** - * Base URL of the merchant that is giving us the tip. - */ - merchantBaseUrl: string; - - /** - * Denomination selection made by the wallet for picking up - * this tip. - * - * FIXME: Put this into some DenomSelectionCacheRecord instead of - * storing it here! - */ - denomsSel: DenomSelectionState; - - denomSelUid: string; - - /** - * Tip ID chosen by the wallet. - */ - walletRewardId: string; - - /** - * Secret seed used to derive planchets for this tip. - */ - secretSeed: string; - - /** - * The merchant's identifier for this reward. - */ - merchantRewardId: string; - - createdTimestamp: DbPreciseTimestamp; - - /** - * The url to be redirected after the tip is accepted. - */ - next_url: string | undefined; - - /** - * Timestamp for when the wallet finished picking up the tip - * from the merchant. - */ - pickedUpTimestamp: DbPreciseTimestamp | undefined; - - status: RewardRecordStatus; -} - -export enum RewardRecordStatus { - PendingPickup = 0x0100_0000, - SuspendedPickup = 0x0110_0000, - DialogAccept = 0x0101_0000, - Done = 0x0500_0000, - Aborted = 0x0500_0000, - Failed = 0x0501_000, -} - export enum RefreshCoinStatus { Pending = 0x0100_0000, Finished = 0x0500_0000, @@ -1199,11 +1113,6 @@ export enum PurchaseStatus { DialogShared = 0x0101_0001, /** - * The user has rejected the proposal. - */ - AbortedProposalRefused = 0x0503_0000, - - /** * Downloading or processing the proposal has failed permanently. */ FailedClaim = 0x0501_0000, @@ -1226,13 +1135,18 @@ export enum PurchaseStatus { DoneRepurchaseDetected = 0x0500_0001, /** - * The payment has been aborted. + * The user has rejected the proposal. */ - AbortedIncompletePayment = 0x0503_0000, + AbortedProposalRefused = 0x0503_0000, AbortedRefunded = 0x0503_0001, AbortedOrderDeleted = 0x0503_0002, + + /** + * The payment has been aborted. + */ + AbortedIncompletePayment = 0x0503_0003, } /** @@ -1979,7 +1893,7 @@ export enum PeerPullPaymentCreditStatus { SuspendedCreatePurse = 0x0110_0000, SuspendedReady = 0x0110_0001, SuspendedMergeKycRequired = 0x0110_0002, - SuspendedWithdrawing = 0x0110_0000, + SuspendedWithdrawing = 0x0110_0003, SuspendedAbortingDeletePurse = 0x0113_0000, @@ -2633,9 +2547,10 @@ export const WalletStoresV1 = { ]), }, ), + // Just a tombstone at this point. rewards: describeStore( "rewards", - describeContents<RewardRecord>({ keyPath: "walletRewardId" }), + describeContents<any>({ keyPath: "walletRewardId" }), { byMerchantTipIdAndBaseUrl: describeIndex("byMerchantRewardIdAndBaseUrl", [ "merchantRewardId", |