-
-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathPayment.ts
105 lines (81 loc) · 2.77 KB
/
Payment.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// @generated
// This file is automatically generated by Kanel. Do not modify manually.
import { customerId, type CustomerId } from './Customer';
import { staffId, type StaffId } from './Staff';
import { rentalId, type RentalId } from './Rental';
import { z } from 'zod';
/** Identifier type for payment */
export type PaymentId = number & { __flavor?: 'PaymentId' };
/** Represents the table public.payment */
export default interface Payment {
/** Database type: pg_catalog.int4 */
payment_id: PaymentId;
/** Database type: pg_catalog.int2 */
customer_id: CustomerId;
/** Database type: pg_catalog.int2 */
staff_id: StaffId;
/** Database type: pg_catalog.int4 */
rental_id: RentalId;
/** Database type: pg_catalog.numeric */
amount: string;
/** Database type: pg_catalog.timestamp */
payment_date: Date;
}
/** Represents the initializer for the table public.payment */
export interface PaymentInitializer {
/**
* Database type: pg_catalog.int4
* Default value: nextval('payment_payment_id_seq'::regclass)
*/
payment_id?: PaymentId;
/** Database type: pg_catalog.int2 */
customer_id: CustomerId;
/** Database type: pg_catalog.int2 */
staff_id: StaffId;
/** Database type: pg_catalog.int4 */
rental_id: RentalId;
/** Database type: pg_catalog.numeric */
amount: string;
/** Database type: pg_catalog.timestamp */
payment_date: Date;
}
/** Represents the mutator for the table public.payment */
export interface PaymentMutator {
/** Database type: pg_catalog.int4 */
payment_id?: PaymentId;
/** Database type: pg_catalog.int2 */
customer_id?: CustomerId;
/** Database type: pg_catalog.int2 */
staff_id?: StaffId;
/** Database type: pg_catalog.int4 */
rental_id?: RentalId;
/** Database type: pg_catalog.numeric */
amount?: string;
/** Database type: pg_catalog.timestamp */
payment_date?: Date;
}
export const paymentId = z.number() as unknown as z.Schema<PaymentId>;
export const payment = z.object({
payment_id: paymentId,
customer_id: customerId,
staff_id: staffId,
rental_id: rentalId,
amount: z.string(),
payment_date: z.date(),
}) as unknown as z.Schema<Payment>;
export const paymentInitializer = z.object({
payment_id: paymentId.optional(),
customer_id: customerId,
staff_id: staffId,
rental_id: rentalId,
amount: z.string(),
payment_date: z.date(),
}) as unknown as z.Schema<PaymentInitializer>;
export const paymentMutator = z.object({
payment_id: paymentId.optional(),
customer_id: customerId.optional(),
staff_id: staffId.optional(),
rental_id: rentalId.optional(),
amount: z.string().optional(),
payment_date: z.date().optional(),
}) as unknown as z.Schema<PaymentMutator>;