forked from vercel/nextjs-subscription-payments
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.ts
75 lines (67 loc) · 1.77 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import Stripe from 'stripe'
export interface PageMeta {
title: string
description: string
cardImage: string
}
export interface Customer {
id: string /* primary key */
stripe_customer_id?: string
}
export interface Product {
id: string /* primary key */
active?: boolean
name?: string
description?: string
image?: string
metadata?: Record<string, string> // type unknown;
}
export interface ProductWithPrice extends Product {
prices?: Price[]
}
export interface UserDetails {
id: string /* primary key */
full_name?: string
avatar_url?: string
billing_address?: any // type unknown;
payment_method?: any // type unknown;
}
export interface Price {
id: string /* primary key */
product_id?: string /* foreign key to products.id */
active?: boolean
description?: string
unit_amount?: number
currency?: string
type?: string
interval?: Stripe.Price.Recurring.Interval
interval_count?: number
trial_period_days?: number | null
metadata?: Record<string, string> // type unknown;
products?: Product[]
}
export interface PriceWithProduct extends Price {}
export interface Subscription {
id: string /* primary key */
user_id: string
status?: any // type unknown;
metadata?: any // type unknown;
price_id?: string /* foreign key to prices.id */
quantity?: any // type unknown;
cancel_at_period_end?: boolean
created: string
current_period_start: string
current_period_end: string
ended_at?: string
cancel_at?: string
canceled_at?: string
trial_start?: string
trial_end?: string
prices?: Price
}
declare module '@featureboard/js-sdk' {
interface Features {
'user-limit': number
'limit-icon-access': boolean
}
}