Skip to content

Commit 05d9902

Browse files
committed
feat: add missing types for transations/created
1 parent bc3d821 commit 05d9902

File tree

2 files changed

+33
-16
lines changed

2 files changed

+33
-16
lines changed

src/types/transaction.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ export type TransactionFilters = PageFilters & {
101101
to?: string
102102
/** Filter greater than date. Format can be ISO Date, or 'YYYY-MM-dd' string. */
103103
from?: string
104+
/** Filter transactions created after date. Format is ISO Date. */
105+
createdAtFrom?: string
104106
}
105107

106108
export type Transaction = {
@@ -142,4 +144,8 @@ export type Transaction = {
142144
operationType: string | null
143145
/** Provider ID of the transaction. Only returned for Open Finance connectors */
144146
providerId: string | null
147+
/** Date when the transaction was created in Pluggy */
148+
createdAt: Date
149+
/** Date when the transaction was last updated in Pluggy */
150+
updatedAt: Date
145151
}

src/types/webhook.ts

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,20 @@ export type WebhookEventPayload = {
6969
/** Primary identifier of the event that was notified */
7070
eventId: string
7171
} & (
72-
| {
72+
| {
7373
/** Type of event subscribed */
7474
event:
75-
| 'item/created'
76-
| 'item/updated'
77-
| 'item/waiting_user_input'
78-
| 'item/login_succeeded'
79-
| 'item/deleted'
75+
| 'item/created'
76+
| 'item/updated'
77+
| 'item/waiting_user_input'
78+
| 'item/login_succeeded'
79+
| 'item/deleted'
8080
/** Primary identifier of the item related to the event */
8181
itemId: string
8282
/** Who trigger the event */
8383
triggeredBy?: TriggeredBy | null
8484
}
85-
| {
85+
| {
8686
/** Type of event subscribed */
8787
event: 'item/error'
8888
/** Primary identifier of the item related to the event */
@@ -95,15 +95,15 @@ export type WebhookEventPayload = {
9595
/** Who trigger the event */
9696
triggeredBy?: TriggeredBy | null
9797
}
98-
| {
98+
| {
9999
/** Type of event subscribed */
100100
event: 'connector/status_updated'
101101
/** Object with extra information of the connector updated */
102102
data: {
103103
status: string
104104
}
105105
}
106-
| {
106+
| {
107107
/** Type of event subscribed */
108108
event: 'transactions/deleted' | 'transactions/updated'
109109
/** Primary identifier of the item related to the event */
@@ -115,18 +115,29 @@ export type WebhookEventPayload = {
115115
/** Primary identifier of the transactions related to the event */
116116
transactionIds: string[]
117117
}
118-
| {
118+
| {
119+
event: 'transactions/created'
120+
/** Primary identifier of the item related to the event */
121+
itemId: string
122+
/** Primary identifier of the account related to the event */
123+
accountId: string
124+
/** Filter transactions created after date. Format is ISO Date. */
125+
transactionsCreatedAtFrom: string
126+
/** Link to get the created transactions of the sync */
127+
createdTransactionsLink: string
128+
}
129+
| {
119130
event: 'payment_intent/created' | 'payment_intent/completed' | 'payment_intent/error'
120131
paymentIntentId: string
121132
paymentRequestId: string
122133
}
123-
| {
134+
| {
124135
event:
125-
| 'scheduled_payment/created'
126-
| 'scheduled_payment/completed'
127-
| 'scheduled_payment/error'
128-
| 'scheduled_payment/canceled'
136+
| 'scheduled_payment/created'
137+
| 'scheduled_payment/completed'
138+
| 'scheduled_payment/error'
139+
| 'scheduled_payment/canceled'
129140
paymentRequestId: string
130141
scheduledPaymentId: string
131142
}
132-
)
143+
)

0 commit comments

Comments
 (0)