+source +destination in payments

This commit is contained in:
Stephan D
2026-03-10 19:15:20 +01:00
parent 9c2b3bf8bd
commit e5b4de5d48
16 changed files with 716 additions and 56 deletions

View File

@@ -64,8 +64,9 @@ void main() {
test('isPending and isTerminal are derived from typed state', () {
const created = Payment(
paymentRef: 'p-1',
idempotencyKey: 'idem-1',
state: 'orchestration_state_created',
source: null,
destination: null,
orchestrationState: PaymentOrchestrationState.created,
failureCode: null,
failureReason: null,
@@ -76,8 +77,9 @@ void main() {
);
const settled = Payment(
paymentRef: 'p-2',
idempotencyKey: 'idem-2',
state: 'orchestration_state_settled',
source: null,
destination: null,
orchestrationState: PaymentOrchestrationState.settled,
failureCode: null,
failureReason: null,
@@ -96,8 +98,9 @@ void main() {
test('isFailure handles both explicit code and failed state', () {
const withFailureCode = Payment(
paymentRef: 'p-3',
idempotencyKey: 'idem-3',
state: 'orchestration_state_executing',
source: null,
destination: null,
orchestrationState: PaymentOrchestrationState.executing,
failureCode: 'failure_ledger',
failureReason: 'ledger failed',
@@ -108,8 +111,9 @@ void main() {
);
const failedState = Payment(
paymentRef: 'p-4',
idempotencyKey: 'idem-4',
state: 'orchestration_state_failed',
source: null,
destination: null,
orchestrationState: PaymentOrchestrationState.failed,
failureCode: null,
failureReason: null,