Skip to content

Commit 98b859b

Browse files
committed
Add saving billing_cycle to db.
1 parent fb230de commit 98b859b

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

packages/backend/src/utils/database.types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,10 @@ export type Database = {
337337
}
338338
subscriptions: {
339339
Row: {
340+
billing_cycle: string
340341
created_at: string
341342
customer_id: string
343+
next_billed_at: string
342344
price_id: string | null
343345
product_id: string | null
344346
scheduled_change: string | null
@@ -347,8 +349,10 @@ export type Database = {
347349
updated_at: string
348350
}
349351
Insert: {
352+
billing_cycle: string
350353
created_at?: string
351354
customer_id: string
355+
next_billed_at: string
352356
price_id?: string | null
353357
product_id?: string | null
354358
scheduled_change?: string | null
@@ -357,8 +361,10 @@ export type Database = {
357361
updated_at?: string
358362
}
359363
Update: {
364+
billing_cycle?: string
360365
created_at?: string
361366
customer_id?: string
367+
next_billed_at?: string
362368
price_id?: string | null
363369
product_id?: string | null
364370
scheduled_change?: string | null

packages/dashboard/src/utils/paddle/process-webhook.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export class ProcessWebhook {
3434
scheduled_change: eventData.data.scheduledChange?.effectiveAt,
3535
customer_id: eventData.data.customerId,
3636
next_billed_at: eventData.data.nextBilledAt,
37+
billing_cycle: eventData.data.billingCycle.interval
3738
})
3839
.select();
3940

packages/dashboard/src/utils/supabase/database.types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ export type Database = {
337337
}
338338
subscriptions: {
339339
Row: {
340+
billing_cycle: string
340341
created_at: string
341342
customer_id: string
342343
next_billed_at: string
@@ -348,6 +349,7 @@ export type Database = {
348349
updated_at: string
349350
}
350351
Insert: {
352+
billing_cycle: string
351353
created_at?: string
352354
customer_id: string
353355
next_billed_at: string
@@ -359,6 +361,7 @@ export type Database = {
359361
updated_at?: string
360362
}
361363
Update: {
364+
billing_cycle?: string
362365
created_at?: string
363366
customer_id?: string
364367
next_billed_at?: string

0 commit comments

Comments
 (0)