-
Notifications
You must be signed in to change notification settings - Fork 111
/
Copy pathindex.ts
54 lines (46 loc) · 1.1 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
import { type User } from "@prisma/client";
import { z } from "zod";
export type CurrentUser = {
id: string;
name: string;
email: string;
picture: string;
};
export interface payload {
name: string;
email: string;
picture?: string;
}
export const settingsSchema = z.object({
picture: z.string().url(),
name: z
.string({
required_error: "Please type your name.",
})
.min(3, {
message: "Name must be at least 3 characters.",
})
.max(50, {
message: "Name must be at most 50 characters.",
}),
email: z.string().email(),
shortBio: z.string().optional(),
});
export type SettingsValues = z.infer<typeof settingsSchema>;
export type SubscriptionPlan = {
name: string;
description: string;
stripePriceId: string;
};
export type UserSubscriptionPlan = SubscriptionPlan &
Pick<User, "stripeCustomerId" | "stripeSubscriptionId"> & {
stripeCurrentPeriodEnd: number;
isPro: boolean;
};
export interface SendWelcomeEmailProps {
toMail: string;
userName: string;
}
export interface SendOTPProps extends SendWelcomeEmailProps {
code: string;
}