Skip to content

Commit 35b4e4f

Browse files
committed
PM-1148 - update event interface for recipient account
1 parent 45a9ea8 commit 35b4e4f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/api/webhooks/trolley/handlers/recipient-account.types.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export enum RecipientAccountWebhookEvent {
44
deleted = 'recipientAccount.deleted',
55
}
66

7-
export interface RecipientAccountEventData {
7+
export interface RecipientAccountEventDataFields {
88
status: string;
99
type: string;
1010
primary: boolean;
@@ -15,6 +15,10 @@ export interface RecipientAccountEventData {
1515
disabledAt: string | null;
1616
recipientReferenceId: string | null;
1717
deliveryBusinessDaysEstimate: number;
18+
}
19+
20+
export interface RecipientAccountEventDataWithBankDetails
21+
extends RecipientAccountEventDataFields {
1822
country: string;
1923
iban: string;
2024
accountNum: string;
@@ -33,6 +37,15 @@ export interface RecipientAccountEventData {
3337
recipientFees: string;
3438
}
3539

40+
export interface RecipientAccountEventDataWithPaypalDetails
41+
extends RecipientAccountEventDataFields {
42+
emailAddress: string;
43+
}
44+
45+
export type RecipientAccountEventData =
46+
| RecipientAccountEventDataWithBankDetails
47+
| RecipientAccountEventDataWithPaypalDetails;
48+
3649
export type RecipientAccountDeleteEventData = Pick<
3750
RecipientAccountEventData,
3851
'id'

0 commit comments

Comments
 (0)