-
-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathCity.ts
82 lines (64 loc) · 2.04 KB
/
City.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
// @generated
// This file is automatically generated by Kanel. Do not modify manually.
import { countryId, type CountryId } from './Country';
import { z } from 'zod';
/** Identifier type for city */
export type CityId = number & { __flavor?: 'CityId' };
/** Represents the table public.city */
export default interface City {
/** Database type: pg_catalog.int4 */
city_id: CityId;
/** Database type: pg_catalog.varchar */
city: string;
/** Database type: pg_catalog.int2 */
country_id: CountryId;
/** Database type: pg_catalog.timestamp */
last_update: Date;
}
/** Represents the initializer for the table public.city */
export interface CityInitializer {
/**
* Database type: pg_catalog.int4
* Default value: nextval('city_city_id_seq'::regclass)
*/
city_id?: CityId;
/** Database type: pg_catalog.varchar */
city: string;
/** Database type: pg_catalog.int2 */
country_id: CountryId;
/**
* Database type: pg_catalog.timestamp
* Default value: now()
*/
last_update?: Date;
}
/** Represents the mutator for the table public.city */
export interface CityMutator {
/** Database type: pg_catalog.int4 */
city_id?: CityId;
/** Database type: pg_catalog.varchar */
city?: string;
/** Database type: pg_catalog.int2 */
country_id?: CountryId;
/** Database type: pg_catalog.timestamp */
last_update?: Date;
}
export const cityId = z.number() as unknown as z.Schema<CityId>;
export const city = z.object({
city_id: cityId,
city: z.string(),
country_id: countryId,
last_update: z.date(),
}) as unknown as z.Schema<City>;
export const cityInitializer = z.object({
city_id: cityId.optional(),
city: z.string(),
country_id: countryId,
last_update: z.date().optional(),
}) as unknown as z.Schema<CityInitializer>;
export const cityMutator = z.object({
city_id: cityId.optional(),
city: z.string().optional(),
country_id: countryId.optional(),
last_update: z.date().optional(),
}) as unknown as z.Schema<CityMutator>;