-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.ts
68 lines (63 loc) · 1.43 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
// Import the Stripe module
import Stripe from "stripe";
export interface Song {
id: string;
uer_id: string;
author: string;
title: string;
song_path: string;
image_path: string;
}
// Interface for user details
export interface UserDetails {
id: string;
first_name: string;
last_name: string;
full_name?: string;
avatar_url?: string;
billing_address?: Stripe.Address;
payment_method?: Stripe.PaymentMethod[Stripe.PaymentMethod.Type];
}
// Interface for a product
export interface Product {
id: string;
active?: boolean;
name?: string;
description?: string;
image?: string;
metadata?: Stripe.Metadata;
}
// Interface for a price
export interface Price {
id: string;
product_id?: string;
active?: boolean;
description?: string;
unit_amount?: number;
currency?: string;
type?: Stripe.Price.Type;
interval?: Stripe.Price.Recurring.Interval;
interval_count?: number;
trial_period_days?: number | null;
metadata?: Stripe.Metadata;
product?: Product;
}
// Interface for a subscription
export interface Subscription {
id: string;
user_id: string;
status?: Stripe.Subscription.Status;
metadata?: Stripe.Metadata;
price_id?: string;
quantity?: number;
cancel_at_period_end?: boolean;
created: string;
current_period_start: string;
current_period_end: string;
ended_at?: string;
cancel_at?: string;
cancled_at?: string;
trial_start?: string;
trial_end?: string;
prices?: Price;
}