@tmlmobilidade/types 20250325.1729.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +21 -0
- package/dist/src/agency.d.ts +155 -0
- package/dist/src/agency.js +20 -0
- package/dist/src/alert.d.ts +289 -0
- package/dist/src/alert.js +81 -0
- package/dist/src/apex-t11.d.ts +152 -0
- package/dist/src/apex-t11.js +98 -0
- package/dist/src/apex-t19.d.ts +67 -0
- package/dist/src/apex-t19.js +17 -0
- package/dist/src/auth.d.ts +525 -0
- package/dist/src/auth.js +97 -0
- package/dist/src/common.d.ts +77 -0
- package/dist/src/common.js +50 -0
- package/dist/src/file.d.ts +121 -0
- package/dist/src/file.js +16 -0
- package/dist/src/hashed-shape.d.ts +186 -0
- package/dist/src/hashed-shape.js +19 -0
- package/dist/src/hashed-trip.d.ts +445 -0
- package/dist/src/hashed-trip.js +37 -0
- package/dist/src/locality.d.ts +145 -0
- package/dist/src/locality.js +20 -0
- package/dist/src/municipality.d.ts +145 -0
- package/dist/src/municipality.js +20 -0
- package/dist/src/organization.d.ts +52 -0
- package/dist/src/organization.js +8 -0
- package/dist/src/plan.d.ts +127 -0
- package/dist/src/plan.js +16 -0
- package/dist/src/ride.d.ts +498 -0
- package/dist/src/ride.js +44 -0
- package/dist/src/stop.d.ts +474 -0
- package/dist/src/stop.js +139 -0
- package/dist/src/vehicle-event.d.ts +76 -0
- package/dist/src/vehicle-event.js +20 -0
- package/dist/src/zone.d.ts +120 -0
- package/dist/src/zone.js +16 -0
- package/package.json +51 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { GeoJSON } from 'geojson';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const MunicipalitySchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
4
|
+
_id: z.ZodString;
|
|
5
|
+
created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("./common.js").UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
6
|
+
updated_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("./common.js").UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
7
|
+
}, {
|
|
8
|
+
border_color: z.ZodString;
|
|
9
|
+
border_opacity: z.ZodNumber;
|
|
10
|
+
border_width: z.ZodNumber;
|
|
11
|
+
code: z.ZodString;
|
|
12
|
+
district: z.ZodString;
|
|
13
|
+
fill_color: z.ZodString;
|
|
14
|
+
fill_opacity: z.ZodNumber;
|
|
15
|
+
geojson: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
16
|
+
is_locked: z.ZodBoolean;
|
|
17
|
+
name: z.ZodString;
|
|
18
|
+
prefix: z.ZodString;
|
|
19
|
+
region: z.ZodString;
|
|
20
|
+
}>, "strict", z.ZodTypeAny, {
|
|
21
|
+
_id: string;
|
|
22
|
+
code: string;
|
|
23
|
+
is_locked: boolean;
|
|
24
|
+
name: string;
|
|
25
|
+
border_color: string;
|
|
26
|
+
border_opacity: number;
|
|
27
|
+
border_width: number;
|
|
28
|
+
district: string;
|
|
29
|
+
fill_color: string;
|
|
30
|
+
fill_opacity: number;
|
|
31
|
+
geojson: Record<string, any>;
|
|
32
|
+
prefix: string;
|
|
33
|
+
region: string;
|
|
34
|
+
created_at?: (number & {
|
|
35
|
+
__brand: "UnixTimestamp";
|
|
36
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
37
|
+
updated_at?: (number & {
|
|
38
|
+
__brand: "UnixTimestamp";
|
|
39
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
40
|
+
}, {
|
|
41
|
+
_id: string;
|
|
42
|
+
code: string;
|
|
43
|
+
is_locked: boolean;
|
|
44
|
+
name: string;
|
|
45
|
+
border_color: string;
|
|
46
|
+
border_opacity: number;
|
|
47
|
+
border_width: number;
|
|
48
|
+
district: string;
|
|
49
|
+
fill_color: string;
|
|
50
|
+
fill_opacity: number;
|
|
51
|
+
geojson: Record<string, any>;
|
|
52
|
+
prefix: string;
|
|
53
|
+
region: string;
|
|
54
|
+
created_at?: number | null | undefined;
|
|
55
|
+
updated_at?: number | null | undefined;
|
|
56
|
+
}>;
|
|
57
|
+
export declare const CreateMunicipalitySchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
|
|
58
|
+
_id: z.ZodString;
|
|
59
|
+
created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("./common.js").UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
60
|
+
updated_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("./common.js").UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
61
|
+
}, {
|
|
62
|
+
border_color: z.ZodString;
|
|
63
|
+
border_opacity: z.ZodNumber;
|
|
64
|
+
border_width: z.ZodNumber;
|
|
65
|
+
code: z.ZodString;
|
|
66
|
+
district: z.ZodString;
|
|
67
|
+
fill_color: z.ZodString;
|
|
68
|
+
fill_opacity: z.ZodNumber;
|
|
69
|
+
geojson: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
70
|
+
is_locked: z.ZodBoolean;
|
|
71
|
+
name: z.ZodString;
|
|
72
|
+
prefix: z.ZodString;
|
|
73
|
+
region: z.ZodString;
|
|
74
|
+
}>, "_id" | "created_at" | "updated_at">, "strict", z.ZodTypeAny, {
|
|
75
|
+
code: string;
|
|
76
|
+
is_locked: boolean;
|
|
77
|
+
name: string;
|
|
78
|
+
border_color: string;
|
|
79
|
+
border_opacity: number;
|
|
80
|
+
border_width: number;
|
|
81
|
+
district: string;
|
|
82
|
+
fill_color: string;
|
|
83
|
+
fill_opacity: number;
|
|
84
|
+
geojson: Record<string, any>;
|
|
85
|
+
prefix: string;
|
|
86
|
+
region: string;
|
|
87
|
+
}, {
|
|
88
|
+
code: string;
|
|
89
|
+
is_locked: boolean;
|
|
90
|
+
name: string;
|
|
91
|
+
border_color: string;
|
|
92
|
+
border_opacity: number;
|
|
93
|
+
border_width: number;
|
|
94
|
+
district: string;
|
|
95
|
+
fill_color: string;
|
|
96
|
+
fill_opacity: number;
|
|
97
|
+
geojson: Record<string, any>;
|
|
98
|
+
prefix: string;
|
|
99
|
+
region: string;
|
|
100
|
+
}>;
|
|
101
|
+
export declare const UpdateMunicipalitySchema: z.ZodObject<{
|
|
102
|
+
code: z.ZodOptional<z.ZodString>;
|
|
103
|
+
is_locked: z.ZodOptional<z.ZodBoolean>;
|
|
104
|
+
name: z.ZodOptional<z.ZodString>;
|
|
105
|
+
border_color: z.ZodOptional<z.ZodString>;
|
|
106
|
+
border_opacity: z.ZodOptional<z.ZodNumber>;
|
|
107
|
+
border_width: z.ZodOptional<z.ZodNumber>;
|
|
108
|
+
district: z.ZodOptional<z.ZodString>;
|
|
109
|
+
fill_color: z.ZodOptional<z.ZodString>;
|
|
110
|
+
fill_opacity: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
geojson: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
112
|
+
prefix: z.ZodOptional<z.ZodString>;
|
|
113
|
+
region: z.ZodOptional<z.ZodString>;
|
|
114
|
+
}, "strict", z.ZodTypeAny, {
|
|
115
|
+
code?: string | undefined;
|
|
116
|
+
is_locked?: boolean | undefined;
|
|
117
|
+
name?: string | undefined;
|
|
118
|
+
border_color?: string | undefined;
|
|
119
|
+
border_opacity?: number | undefined;
|
|
120
|
+
border_width?: number | undefined;
|
|
121
|
+
district?: string | undefined;
|
|
122
|
+
fill_color?: string | undefined;
|
|
123
|
+
fill_opacity?: number | undefined;
|
|
124
|
+
geojson?: Record<string, any> | undefined;
|
|
125
|
+
prefix?: string | undefined;
|
|
126
|
+
region?: string | undefined;
|
|
127
|
+
}, {
|
|
128
|
+
code?: string | undefined;
|
|
129
|
+
is_locked?: boolean | undefined;
|
|
130
|
+
name?: string | undefined;
|
|
131
|
+
border_color?: string | undefined;
|
|
132
|
+
border_opacity?: number | undefined;
|
|
133
|
+
border_width?: number | undefined;
|
|
134
|
+
district?: string | undefined;
|
|
135
|
+
fill_color?: string | undefined;
|
|
136
|
+
fill_opacity?: number | undefined;
|
|
137
|
+
geojson?: Record<string, any> | undefined;
|
|
138
|
+
prefix?: string | undefined;
|
|
139
|
+
region?: string | undefined;
|
|
140
|
+
}>;
|
|
141
|
+
export interface Municipality extends z.infer<typeof MunicipalitySchema> {
|
|
142
|
+
geojson: GeoJSON;
|
|
143
|
+
}
|
|
144
|
+
export type CreateMunicipalityDto = z.infer<typeof CreateMunicipalitySchema>;
|
|
145
|
+
export type UpdateMunicipalityDto = Partial<CreateMunicipalityDto>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { DocumentSchema } from './common.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
/* * */
|
|
5
|
+
export const MunicipalitySchema = DocumentSchema.extend({
|
|
6
|
+
border_color: z.string(),
|
|
7
|
+
border_opacity: z.number(),
|
|
8
|
+
border_width: z.number(),
|
|
9
|
+
code: z.string(),
|
|
10
|
+
district: z.string(),
|
|
11
|
+
fill_color: z.string(),
|
|
12
|
+
fill_opacity: z.number(),
|
|
13
|
+
geojson: z.record(z.any()), // TODO: Validate GeoJSON
|
|
14
|
+
is_locked: z.boolean(),
|
|
15
|
+
name: z.string(),
|
|
16
|
+
prefix: z.string(),
|
|
17
|
+
region: z.string(),
|
|
18
|
+
}).strict();
|
|
19
|
+
export const CreateMunicipalitySchema = MunicipalitySchema.omit({ _id: true, created_at: true, updated_at: true });
|
|
20
|
+
export const UpdateMunicipalitySchema = CreateMunicipalitySchema.partial();
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const OrganizationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
3
|
+
_id: z.ZodString;
|
|
4
|
+
created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("./common.js").UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
5
|
+
updated_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("./common.js").UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
6
|
+
}, {
|
|
7
|
+
code: z.ZodString;
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
}>, "strict", z.ZodTypeAny, {
|
|
10
|
+
_id: string;
|
|
11
|
+
code: string;
|
|
12
|
+
name: string;
|
|
13
|
+
created_at?: (number & {
|
|
14
|
+
__brand: "UnixTimestamp";
|
|
15
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
16
|
+
updated_at?: (number & {
|
|
17
|
+
__brand: "UnixTimestamp";
|
|
18
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
_id: string;
|
|
21
|
+
code: string;
|
|
22
|
+
name: string;
|
|
23
|
+
created_at?: number | null | undefined;
|
|
24
|
+
updated_at?: number | null | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const CreateOrganizationSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
|
|
27
|
+
_id: z.ZodString;
|
|
28
|
+
created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("./common.js").UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
29
|
+
updated_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("./common.js").UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
30
|
+
}, {
|
|
31
|
+
code: z.ZodString;
|
|
32
|
+
name: z.ZodString;
|
|
33
|
+
}>, "_id" | "created_at" | "updated_at">, "strict", z.ZodTypeAny, {
|
|
34
|
+
code: string;
|
|
35
|
+
name: string;
|
|
36
|
+
}, {
|
|
37
|
+
code: string;
|
|
38
|
+
name: string;
|
|
39
|
+
}>;
|
|
40
|
+
export declare const UpdateOrganizationSchema: z.ZodObject<{
|
|
41
|
+
code: z.ZodOptional<z.ZodString>;
|
|
42
|
+
name: z.ZodOptional<z.ZodString>;
|
|
43
|
+
}, "strict", z.ZodTypeAny, {
|
|
44
|
+
code?: string | undefined;
|
|
45
|
+
name?: string | undefined;
|
|
46
|
+
}, {
|
|
47
|
+
code?: string | undefined;
|
|
48
|
+
name?: string | undefined;
|
|
49
|
+
}>;
|
|
50
|
+
export type Organization = z.infer<typeof OrganizationSchema>;
|
|
51
|
+
export type CreateOrganizationDto = z.infer<typeof CreateOrganizationSchema>;
|
|
52
|
+
export type UpdateOrganizationDto = Partial<CreateOrganizationDto>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DocumentSchema } from './common.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export const OrganizationSchema = DocumentSchema.extend({
|
|
4
|
+
code: z.string(),
|
|
5
|
+
name: z.string(),
|
|
6
|
+
}).strict();
|
|
7
|
+
export const CreateOrganizationSchema = OrganizationSchema.omit({ _id: true, created_at: true, updated_at: true });
|
|
8
|
+
export const UpdateOrganizationSchema = CreateOrganizationSchema.partial();
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { type OperationalDate, type UnixTimestamp } from './common.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const PlanSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
4
|
+
_id: z.ZodString;
|
|
5
|
+
created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
6
|
+
updated_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
7
|
+
}, {
|
|
8
|
+
agency_id: z.ZodString;
|
|
9
|
+
feeder_status: z.ZodEnum<["waiting", "processing", "success", "error"]>;
|
|
10
|
+
is_approved: z.ZodBoolean;
|
|
11
|
+
is_locked: z.ZodBoolean;
|
|
12
|
+
operation_file: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13
|
+
reference_file: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
14
|
+
valid_from: z.ZodBranded<z.ZodEffects<z.ZodString, OperationalDate, string>, "OperationalDate">;
|
|
15
|
+
valid_until: z.ZodBranded<z.ZodEffects<z.ZodString, OperationalDate, string>, "OperationalDate">;
|
|
16
|
+
}>, "strict", z.ZodTypeAny, {
|
|
17
|
+
_id: string;
|
|
18
|
+
is_locked: boolean;
|
|
19
|
+
agency_id: string;
|
|
20
|
+
feeder_status: "waiting" | "processing" | "success" | "error";
|
|
21
|
+
is_approved: boolean;
|
|
22
|
+
valid_from: string & {
|
|
23
|
+
__brand: "OperationalDate";
|
|
24
|
+
} & z.BRAND<"OperationalDate">;
|
|
25
|
+
valid_until: string & {
|
|
26
|
+
__brand: "OperationalDate";
|
|
27
|
+
} & z.BRAND<"OperationalDate">;
|
|
28
|
+
created_at?: (number & {
|
|
29
|
+
__brand: "UnixTimestamp";
|
|
30
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
31
|
+
updated_at?: (number & {
|
|
32
|
+
__brand: "UnixTimestamp";
|
|
33
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
34
|
+
operation_file?: string | null | undefined;
|
|
35
|
+
reference_file?: string | null | undefined;
|
|
36
|
+
}, {
|
|
37
|
+
_id: string;
|
|
38
|
+
is_locked: boolean;
|
|
39
|
+
agency_id: string;
|
|
40
|
+
feeder_status: "waiting" | "processing" | "success" | "error";
|
|
41
|
+
is_approved: boolean;
|
|
42
|
+
valid_from: string;
|
|
43
|
+
valid_until: string;
|
|
44
|
+
created_at?: number | null | undefined;
|
|
45
|
+
updated_at?: number | null | undefined;
|
|
46
|
+
operation_file?: string | null | undefined;
|
|
47
|
+
reference_file?: string | null | undefined;
|
|
48
|
+
}>;
|
|
49
|
+
export declare const CreatePlanSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
|
|
50
|
+
_id: z.ZodString;
|
|
51
|
+
created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
52
|
+
updated_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
53
|
+
}, {
|
|
54
|
+
agency_id: z.ZodString;
|
|
55
|
+
feeder_status: z.ZodEnum<["waiting", "processing", "success", "error"]>;
|
|
56
|
+
is_approved: z.ZodBoolean;
|
|
57
|
+
is_locked: z.ZodBoolean;
|
|
58
|
+
operation_file: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
59
|
+
reference_file: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
60
|
+
valid_from: z.ZodBranded<z.ZodEffects<z.ZodString, OperationalDate, string>, "OperationalDate">;
|
|
61
|
+
valid_until: z.ZodBranded<z.ZodEffects<z.ZodString, OperationalDate, string>, "OperationalDate">;
|
|
62
|
+
}>, "_id" | "created_at" | "updated_at">, "strict", z.ZodTypeAny, {
|
|
63
|
+
is_locked: boolean;
|
|
64
|
+
agency_id: string;
|
|
65
|
+
feeder_status: "waiting" | "processing" | "success" | "error";
|
|
66
|
+
is_approved: boolean;
|
|
67
|
+
valid_from: string & {
|
|
68
|
+
__brand: "OperationalDate";
|
|
69
|
+
} & z.BRAND<"OperationalDate">;
|
|
70
|
+
valid_until: string & {
|
|
71
|
+
__brand: "OperationalDate";
|
|
72
|
+
} & z.BRAND<"OperationalDate">;
|
|
73
|
+
operation_file?: string | null | undefined;
|
|
74
|
+
reference_file?: string | null | undefined;
|
|
75
|
+
}, {
|
|
76
|
+
is_locked: boolean;
|
|
77
|
+
agency_id: string;
|
|
78
|
+
feeder_status: "waiting" | "processing" | "success" | "error";
|
|
79
|
+
is_approved: boolean;
|
|
80
|
+
valid_from: string;
|
|
81
|
+
valid_until: string;
|
|
82
|
+
operation_file?: string | null | undefined;
|
|
83
|
+
reference_file?: string | null | undefined;
|
|
84
|
+
}>;
|
|
85
|
+
export declare const UpdatePlanSchema: z.ZodObject<{
|
|
86
|
+
is_locked: z.ZodOptional<z.ZodBoolean>;
|
|
87
|
+
agency_id: z.ZodOptional<z.ZodString>;
|
|
88
|
+
feeder_status: z.ZodOptional<z.ZodEnum<["waiting", "processing", "success", "error"]>>;
|
|
89
|
+
is_approved: z.ZodOptional<z.ZodBoolean>;
|
|
90
|
+
operation_file: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
91
|
+
reference_file: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
92
|
+
valid_from: z.ZodOptional<z.ZodBranded<z.ZodEffects<z.ZodString, OperationalDate, string>, "OperationalDate">>;
|
|
93
|
+
valid_until: z.ZodOptional<z.ZodBranded<z.ZodEffects<z.ZodString, OperationalDate, string>, "OperationalDate">>;
|
|
94
|
+
}, "strict", z.ZodTypeAny, {
|
|
95
|
+
is_locked?: boolean | undefined;
|
|
96
|
+
agency_id?: string | undefined;
|
|
97
|
+
feeder_status?: "waiting" | "processing" | "success" | "error" | undefined;
|
|
98
|
+
is_approved?: boolean | undefined;
|
|
99
|
+
operation_file?: string | null | undefined;
|
|
100
|
+
reference_file?: string | null | undefined;
|
|
101
|
+
valid_from?: (string & {
|
|
102
|
+
__brand: "OperationalDate";
|
|
103
|
+
} & z.BRAND<"OperationalDate">) | undefined;
|
|
104
|
+
valid_until?: (string & {
|
|
105
|
+
__brand: "OperationalDate";
|
|
106
|
+
} & z.BRAND<"OperationalDate">) | undefined;
|
|
107
|
+
}, {
|
|
108
|
+
is_locked?: boolean | undefined;
|
|
109
|
+
agency_id?: string | undefined;
|
|
110
|
+
feeder_status?: "waiting" | "processing" | "success" | "error" | undefined;
|
|
111
|
+
is_approved?: boolean | undefined;
|
|
112
|
+
operation_file?: string | null | undefined;
|
|
113
|
+
reference_file?: string | null | undefined;
|
|
114
|
+
valid_from?: string | undefined;
|
|
115
|
+
valid_until?: string | undefined;
|
|
116
|
+
}>;
|
|
117
|
+
export interface Plan extends Omit<z.infer<typeof PlanSchema>, 'created_at' | 'updated_at' | 'valid_from' | 'valid_until'> {
|
|
118
|
+
created_at: UnixTimestamp;
|
|
119
|
+
updated_at: UnixTimestamp;
|
|
120
|
+
valid_from: OperationalDate;
|
|
121
|
+
valid_until: OperationalDate;
|
|
122
|
+
}
|
|
123
|
+
export interface CreatePlanDto extends Omit<z.infer<typeof CreatePlanSchema>, 'valid_from' | 'valid_until'> {
|
|
124
|
+
valid_from: OperationalDate;
|
|
125
|
+
valid_until: OperationalDate;
|
|
126
|
+
}
|
|
127
|
+
export type UpdatePlanDto = Partial<CreatePlanDto>;
|
package/dist/src/plan.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { DocumentSchema, validateOperationalDate } from './common.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
/* * */
|
|
5
|
+
export const PlanSchema = DocumentSchema.extend({
|
|
6
|
+
agency_id: z.string(),
|
|
7
|
+
feeder_status: z.enum(['waiting', 'processing', 'success', 'error']),
|
|
8
|
+
is_approved: z.boolean(),
|
|
9
|
+
is_locked: z.boolean(),
|
|
10
|
+
operation_file: z.string().nullish(),
|
|
11
|
+
reference_file: z.string().nullish(),
|
|
12
|
+
valid_from: z.string().transform(validateOperationalDate).brand('OperationalDate'),
|
|
13
|
+
valid_until: z.string().transform(validateOperationalDate).brand('OperationalDate'),
|
|
14
|
+
}).strict();
|
|
15
|
+
export const CreatePlanSchema = PlanSchema.omit({ _id: true, created_at: true, updated_at: true });
|
|
16
|
+
export const UpdatePlanSchema = CreatePlanSchema.partial();
|