-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.ts
81 lines (78 loc) · 1.4 KB
/
index.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
76
77
78
79
80
81
import type {
Currency,
Interval,
PriceCurrency,
Tier,
TierId,
TierLimit,
} from "@prisma/client";
export type PriceByInterval<
I extends Interval = Interval,
C extends Currency = Currency,
> = {
[interval in I]: {
[currency in C]: PriceCurrency["amount"];
};
};
type PricingPlan<T extends TierId = TierId> = {
[tierId in T]: { tierId: tierId } & Pick<
Tier,
"name" | "description" | "featuresList"
> & {
price: PriceByInterval;
limits: Pick<TierLimit, "maxNumberOfNotes">;
};
};
export const pricingPlan = {
free: {
tierId: "free",
name: "Free Tier",
description: "Free forever",
featuresList: ["Up to 2 notes", "Limited support"],
limits: { maxNumberOfNotes: 2 },
price: {
month: {
usd: 0,
eur: 0,
},
year: {
usd: 0,
eur: 0,
},
},
},
tier_1: {
tierId: "tier_1",
name: "Pro Tier",
description: "For power users",
featuresList: ["Free Tier features", "Up to 4 notes"],
limits: { maxNumberOfNotes: 4 },
price: {
month: {
usd: 999,
eur: 999,
},
year: {
usd: 9990,
eur: 9990,
},
},
},
tier_2: {
tierId: "tier_2",
name: "Pro Plus Tier",
description: "For power power users",
featuresList: ["Pro Tier features", "Unlimited notes"],
limits: { maxNumberOfNotes: null },
price: {
month: {
usd: 1999,
eur: 1999,
},
year: {
usd: 19990,
eur: 19990,
},
},
},
} satisfies PricingPlan;