From 4fdcaab6325289fd8525fc9e63c8c86b07131376 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 12 May 2021 14:16:01 +0200 Subject: model more backup provider errors --- packages/taler-wallet-core/src/db.ts | 39 +++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 10 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 22cbd16cc..946e71e10 100644 --- a/packages/taler-wallet-core/src/db.ts +++ b/packages/taler-wallet-core/src/db.ts @@ -13,7 +13,22 @@ import { IDBKeyPath, } from "@gnu-taler/idb-bridge"; import { Logger } from "./util/logging"; -import { AmountJson, AmountString, Auditor, CoinDepositPermission, ContractTerms, Duration, ExchangeSignKeyJson, InternationalizedString, MerchantInfo, Product, RefreshReason, ReserveTransaction, TalerErrorDetails, Timestamp } from "@gnu-taler/taler-util"; +import { + AmountJson, + AmountString, + Auditor, + CoinDepositPermission, + ContractTerms, + Duration, + ExchangeSignKeyJson, + InternationalizedString, + MerchantInfo, + Product, + RefreshReason, + ReserveTransaction, + TalerErrorDetails, + Timestamp, +} from "@gnu-taler/taler-util"; import { RetryInfo } from "./util/retries.js"; import { PayCoinSelection } from "./util/coinSelection.js"; @@ -170,7 +185,6 @@ export function deleteTalerDatabase(idbFactory: IDBFactory): void { Database.deleteDatabase(idbFactory, TALER_DB_NAME); } - export enum ReserveRecordStatus { /** * Reserve must be registered with the bank. @@ -1269,14 +1283,12 @@ export interface WalletContractData { maxDepositFee: AmountJson; } - export enum AbortStatus { None = "none", AbortRefund = "abort-refund", AbortFinished = "abort-finished", } - /** * Record that stores status information about one purchase, starting from when * the customer accepts a proposal. Includes refund status if applicable. @@ -1316,7 +1328,7 @@ export interface PurchaseRecord { /** * Pending removals from pay coin selection. - * + * * Used when a the pay coin selection needs to be changed * because a coin became known as double-spent or invalid, * but a new coin selection can't immediately be done, as @@ -1548,6 +1560,12 @@ export enum BackupProviderStatus { Ready = "ready", } +export interface BackupProviderTerms { + supportedProtocolVersion: string; + annualFee: AmountString; + storageLimitInMegabytes: number; +} + export interface BackupProviderRecord { baseUrl: string; @@ -1556,11 +1574,7 @@ export interface BackupProviderRecord { * Might be unavailable in the DB in certain situations * (such as loading a recovery document). */ - terms?: { - supportedProtocolVersion: string; - annualFee: AmountString; - storageLimitInMegabytes: number; - }; + terms?: BackupProviderTerms; active: boolean; @@ -1601,6 +1615,11 @@ export interface BackupProviderRecord { * Last error that occurred, if any. */ lastError: TalerErrorDetails | undefined; + + /** + * UIDs for the operation that added the backup provider. + */ + uids: string[]; } /** -- cgit v1.2.3