diff options
Diffstat (limited to 'packages/taler-wallet-core/src/operations/transactions.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/transactions.ts | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/packages/taler-wallet-core/src/operations/transactions.ts b/packages/taler-wallet-core/src/operations/transactions.ts index 89f756ae9..8fd7afae6 100644 --- a/packages/taler-wallet-core/src/operations/transactions.ts +++ b/packages/taler-wallet-core/src/operations/transactions.ts @@ -192,6 +192,7 @@ const txOrder: { [t in TransactionType]: number } = { [TransactionType.Refund]: 8, [TransactionType.Deposit]: 9, [TransactionType.Refresh]: 10, + [TransactionType.Recoup]: 11, [TransactionType.InternalWithdrawal]: 12, }; @@ -248,6 +249,9 @@ export async function getTransactionById( }); } + case TransactionType.Recoup: + throw new Error("not yet supported"); + case TransactionType.Payment: { const proposalId = parsedTx.proposalId; return await ws.db @@ -791,8 +795,7 @@ function buildTransactionForRefresh( ), refreshInputAmount: Amounts.stringify(inputAmount), refreshOutputAmount: Amounts.stringify(outputAmount), - originatingTransactionId: - refreshGroupRecord.reasonDetails?.originatingTransactionId, + originatingTransactionId: refreshGroupRecord.originatingTransactionId, timestamp: timestampPreciseFromDb(refreshGroupRecord.timestampCreated), transactionId: constructTransactionIdentifier({ tag: TransactionType.Refresh, @@ -1391,7 +1394,8 @@ export type ParsedTransactionIdentifier = | { tag: TransactionType.Refund; refundGroupId: string } | { tag: TransactionType.Reward; walletRewardId: string } | { tag: TransactionType.Withdrawal; withdrawalGroupId: string } - | { tag: TransactionType.InternalWithdrawal; withdrawalGroupId: string }; + | { tag: TransactionType.InternalWithdrawal; withdrawalGroupId: string } + | { tag: TransactionType.Recoup; recoupGroupId: string }; export function constructTransactionIdentifier( pTxId: ParsedTransactionIdentifier, @@ -1419,6 +1423,8 @@ export function constructTransactionIdentifier( return `txn:${pTxId.tag}:${pTxId.withdrawalGroupId}` as TransactionIdStr; case TransactionType.InternalWithdrawal: return `txn:${pTxId.tag}:${pTxId.withdrawalGroupId}` as TransactionIdStr; + case TransactionType.Recoup: + return `txn:${pTxId.tag}:${pTxId.recoupGroupId}` as TransactionIdStr; default: assertUnreachable(pTxId); } @@ -1597,6 +1603,9 @@ export async function retryTransaction( case TransactionType.Refund: // Nothing to do for a refund transaction. break; + case TransactionType.Recoup: + // FIXME! + throw Error("not implemented"); default: assertUnreachable(parsedTx); } @@ -1632,6 +1641,9 @@ async function getContextForTransaction( return new RefundTransactionContext(ws, tx.refundGroupId); case TransactionType.Reward: return new RewardTransactionContext(ws, tx.walletRewardId); + case TransactionType.Recoup: + throw new Error("not yet supported"); + //return new RecoupTransactionContext(ws, tx.recoupGroupId); default: assertUnreachable(tx); } |