Skip to content

Commit 960c118

Browse files
committed
feat(payment): add createdAt field to FormAdapterPayment and update related functions
1 parent 87adc2d commit 960c118

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/server/plugins/engine/outputFormatters/machine/v2.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ export function format(
8282
* paymentId: 'abc123',
8383
* reference: 'REF-123',
8484
* amount: 10.00,
85-
* description: 'Application fee'
85+
* description: 'Application fee',
86+
* createdAt: '2025-01-23T10:30:00.000Z'
8687
* }
8788
* }
8889
* }
@@ -102,6 +103,7 @@ export function categoriseData(items: DetailItem[]) {
102103
reference: string
103104
amount: number
104105
description: string
106+
createdAt: string
105107
}
106108
>
107109
} = { main: {}, repeaters: {}, files: {}, payments: {} }
@@ -200,6 +202,7 @@ function extractPayment(
200202
paymentId: paymentState.paymentId,
201203
reference: paymentState.reference,
202204
amount: paymentState.amount,
203-
description: paymentState.description
205+
description: paymentState.description,
206+
createdAt: paymentState.preAuth?.createdAt ?? ''
204207
}
205208
}

src/server/plugins/engine/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ export interface FormAdapterPayment {
466466
reference: string
467467
amount: number
468468
description: string
469+
createdAt: string
469470
}
470471

471472
export interface FormAdapterSubmissionMessageResult {

0 commit comments

Comments
 (0)