Skip to content

Commit b44ea86

Browse files
committed
feat: add pix automatic types
1 parent e3a3336 commit b44ea86

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/types/payments/paymentRequest.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,25 @@ export type CustomSchedule = {
8383
additionalInformation?: string
8484
}
8585

86+
export const AUTOMATIC_PIX_INTERVALS = ["WEEKLY", "MONTHLY", "QUARTERLY", "SEMESTER", "YEARLY"] as const;
87+
export type AutomaticPixInterval = typeof AUTOMATIC_PIX_INTERVALS[number];
88+
89+
export type AutomaticPixFirstPayment = {
90+
date?: string;
91+
amount: number;
92+
description?: string;
93+
};
94+
95+
export type PaymentRequestAutomaticPix = {
96+
interval: AutomaticPixInterval;
97+
startDate: string;
98+
minimumVariableAmount?: number;
99+
maximumVariableAmount?: number;
100+
expiresAt?: string;
101+
isRetryAccepted?: boolean;
102+
firstPayment?: AutomaticPixFirstPayment;
103+
}
104+
86105
export type PaymentRequest = {
87106
/**! primary identifier */
88107
id: string
@@ -106,6 +125,8 @@ export type PaymentRequest = {
106125
fees: number | null
107126
/**! schedule of the payment */
108127
schedule: PaymentRequestSchedule | null
128+
/**! automaticPix of the payment */
129+
automaticPix: PaymentRequestAutomaticPix | null
109130
/**! createdAt date */
110131
createdAt: Date
111132
/**! updatedAt date */

0 commit comments

Comments
 (0)