@tmlmobilidade/types 20260121.2332.6 → 20260128.2248.28

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.
Files changed (150) hide show
  1. package/dist/_common/comment.d.ts +24 -24
  2. package/dist/_common/document.d.ts +3 -3
  3. package/dist/_common/document.js +1 -1
  4. package/dist/_common/status.d.ts +2 -2
  5. package/dist/_common/status.js +1 -1
  6. package/dist/_common/unix-timestamp.js +1 -0
  7. package/dist/agency.d.ts +6 -6
  8. package/dist/alerts/alert.d.ts +262 -0
  9. package/dist/alerts/alert.js +34 -0
  10. package/dist/alerts/cause-effect-map.d.ts +106 -0
  11. package/dist/alerts/cause-effect-map.js +94 -0
  12. package/dist/alerts/cause.d.ts +17 -0
  13. package/dist/alerts/cause.js +45 -0
  14. package/dist/alerts/effect.d.ts +17 -0
  15. package/dist/alerts/effect.js +35 -0
  16. package/dist/alerts/index.d.ts +6 -0
  17. package/dist/alerts/index.js +6 -0
  18. package/dist/alerts/query.d.ts +9 -0
  19. package/dist/alerts/query.js +6 -0
  20. package/dist/alerts/reference-type.d.ts +4 -0
  21. package/dist/alerts/reference-type.js +10 -0
  22. package/dist/apex/simplified-apex-location.d.ts +2 -12
  23. package/dist/apex/simplified-apex-location.js +1 -1
  24. package/dist/apex/simplified-apex-on-board-refund.d.ts +2 -12
  25. package/dist/apex/simplified-apex-on-board-refund.js +1 -1
  26. package/dist/apex/simplified-apex-on-board-sale.d.ts +12 -19
  27. package/dist/apex/simplified-apex-on-board-sale.js +2 -2
  28. package/dist/apex/simplified-apex-validation.d.ts +6 -16
  29. package/dist/apex/simplified-apex-validation.js +1 -1
  30. package/dist/auth/role.d.ts +718 -130
  31. package/dist/auth/session.d.ts +6 -6
  32. package/dist/auth/user.d.ts +1182 -270
  33. package/dist/auth/verification-token.d.ts +4 -4
  34. package/dist/calendar/event.d.ts +43 -0
  35. package/dist/calendar/event.js +16 -0
  36. package/dist/calendar/index.d.ts +1 -0
  37. package/dist/calendar/index.js +2 -0
  38. package/dist/dates/annotation.d.ts +6 -6
  39. package/dist/dates/date.d.ts +32 -0
  40. package/dist/dates/date.js +18 -0
  41. package/dist/dates/index.d.ts +2 -0
  42. package/dist/dates/index.js +2 -0
  43. package/dist/dates/period.d.ts +94 -0
  44. package/dist/dates/period.js +14 -0
  45. package/dist/file-exports/base.d.ts +9 -9
  46. package/dist/file-exports/file-exports.d.ts +7 -7
  47. package/dist/file-exports/ride-export.d.ts +14 -14
  48. package/dist/file-exports/ride-export.js +2 -2
  49. package/dist/gtfs/cause.d.ts +10 -0
  50. package/dist/gtfs/cause.js +18 -0
  51. package/dist/gtfs/effect.d.ts +10 -0
  52. package/dist/gtfs/effect.js +17 -0
  53. package/dist/gtfs/index.d.ts +2 -1
  54. package/dist/gtfs/index.js +2 -1
  55. package/dist/index.d.ts +5 -2
  56. package/dist/index.js +5 -2
  57. package/dist/locations/queries.d.ts +2 -2
  58. package/dist/metrics/demand/demand_by_agency.d.ts +8 -8
  59. package/dist/metrics/demand/demand_by_category.d.ts +12 -12
  60. package/dist/metrics/demand/demand_by_line.d.ts +4 -4
  61. package/dist/metrics/demand/demand_by_pattern.d.ts +8 -8
  62. package/dist/metrics/demand/demand_by_product.d.ts +12 -12
  63. package/dist/metrics/index.d.ts +93 -48
  64. package/dist/metrics/index.js +4 -1
  65. package/dist/metrics/passenger-impact/index.d.ts +1 -0
  66. package/dist/metrics/passenger-impact/index.js +1 -0
  67. package/dist/metrics/passenger-impact/passenger-impact.d.ts +97 -0
  68. package/dist/metrics/passenger-impact/passenger-impact.js +22 -0
  69. package/dist/metrics/supply/supply_by_agency.d.ts +4 -4
  70. package/dist/notification.d.ts +18 -18
  71. package/dist/offer/index.d.ts +5 -0
  72. package/dist/offer/index.js +5 -0
  73. package/dist/offer/line.d.ts +296 -0
  74. package/dist/offer/line.js +60 -0
  75. package/dist/offer/pattern.d.ts +3608 -0
  76. package/dist/offer/pattern.js +75 -0
  77. package/dist/offer/route.d.ts +187 -0
  78. package/dist/offer/route.js +33 -0
  79. package/dist/offer/scheduleRule.d.ts +80 -0
  80. package/dist/offer/scheduleRule.js +50 -0
  81. package/dist/offer/typology.d.ts +124 -0
  82. package/dist/offer/typology.js +30 -0
  83. package/dist/organization.d.ts +20 -20
  84. package/dist/permissions/alerts.d.ts +13 -19
  85. package/dist/permissions/alerts.js +8 -13
  86. package/dist/permissions/annotations.d.ts +25 -0
  87. package/dist/permissions/annotations.js +16 -0
  88. package/dist/permissions/fares.d.ts +25 -0
  89. package/dist/permissions/fares.js +16 -0
  90. package/dist/permissions/index.d.ts +196 -21
  91. package/dist/permissions/index.js +142 -6
  92. package/dist/permissions/lines.d.ts +25 -0
  93. package/dist/permissions/lines.js +16 -0
  94. package/dist/permissions/periods.d.ts +25 -0
  95. package/dist/permissions/periods.js +16 -0
  96. package/dist/permissions/typologies.d.ts +25 -0
  97. package/dist/permissions/typologies.js +16 -0
  98. package/dist/permissions/vehicles.d.ts +25 -0
  99. package/dist/permissions/vehicles.js +16 -0
  100. package/dist/permissions/zones.d.ts +25 -0
  101. package/dist/permissions/zones.js +16 -0
  102. package/dist/plans/gtfs-validation.d.ts +30 -30
  103. package/dist/plans/plan.d.ts +6 -6
  104. package/dist/proposed-change.d.ts +12 -12
  105. package/dist/rides/batch-query.d.ts +52 -0
  106. package/dist/rides/batch-query.js +54 -0
  107. package/dist/rides/index.d.ts +1 -0
  108. package/dist/rides/index.js +1 -0
  109. package/dist/rides/ride-acceptance.d.ts +105 -105
  110. package/dist/rides/ride-acceptance.js +2 -2
  111. package/dist/rides/ride-audit.d.ts +21 -21
  112. package/dist/rides/ride-normalized.d.ts +808 -21
  113. package/dist/rides/ride-normalized.js +31 -1
  114. package/dist/rides/ride.d.ts +6 -6
  115. package/dist/sams/sam.d.ts +0 -15
  116. package/dist/sams/sam.js +2 -2
  117. package/dist/stops/connections.d.ts +1 -0
  118. package/dist/stops/connections.js +1 -1
  119. package/dist/stops/equipment.d.ts +1 -0
  120. package/dist/stops/equipment.js +1 -1
  121. package/dist/stops/parent-station.d.ts +6 -6
  122. package/dist/stops/stop-area.d.ts +6 -6
  123. package/dist/stops/stop.d.ts +69 -69
  124. package/dist/ticketing/fare.d.ts +137 -0
  125. package/dist/ticketing/fare.js +44 -0
  126. package/dist/ticketing/index.d.ts +2 -0
  127. package/dist/ticketing/index.js +2 -0
  128. package/dist/ticketing/zone.d.ts +220 -0
  129. package/dist/ticketing/zone.js +34 -0
  130. package/dist/vehicle/emission.d.ts +3 -0
  131. package/dist/vehicle/emission.js +12 -0
  132. package/dist/vehicle/index.d.ts +4 -0
  133. package/dist/vehicle/index.js +4 -0
  134. package/dist/vehicle/propulsion.d.ts +3 -0
  135. package/dist/vehicle/propulsion.js +14 -0
  136. package/dist/vehicle/vehicle.d.ts +189 -0
  137. package/dist/vehicle/vehicle.js +27 -0
  138. package/dist/vehicle/wheelchair.d.ts +3 -0
  139. package/dist/vehicle/wheelchair.js +10 -0
  140. package/dist/vehicle-events/clickhouse-vehicle-event.d.ts +2 -6
  141. package/dist/vehicle-events/simplified-vehicle-event.d.ts +2 -6
  142. package/dist/vehicle-events/simplified-vehicle-event.js +1 -1
  143. package/dist/zone.d.ts +6 -6
  144. package/package.json +2 -2
  145. package/dist/alert.d.ts +0 -265
  146. package/dist/alert.js +0 -42
  147. package/dist/gtfs/cause-effetcs.d.ts +0 -86
  148. package/dist/gtfs/cause-effetcs.js +0 -31
  149. package/dist/permissions/dates.d.ts +0 -25
  150. package/dist/permissions/dates.js +0 -16
@@ -1,29 +1,816 @@
1
- import { DelayStatusSchema, OperationalStatusSchema, SeenStatusSchema } from '../_common/status.js';
2
- import { RideAcceptanceStatusSchema } from './ride-acceptance.js';
3
- import { RideAnalysis } from './ride-analysis.js';
4
- import { Ride } from './ride.js';
5
- export interface RideNormalized extends Ride {
6
- acceptance_status: typeof RideAcceptanceStatusSchema.options[number];
7
- analysis_ended_at_last_stop_grade: 'none' | RideAnalysis['grade'];
8
- analysis_expected_apex_validation_interval: 'none' | RideAnalysis['grade'];
9
- analysis_simple_three_vehicle_events_grade: 'none' | RideAnalysis['grade'];
10
- analysis_transaction_sequentiality: 'none' | RideAnalysis['grade'];
1
+ import { z } from 'zod';
2
+ export declare const RideNormalizedSchema: z.ZodObject<Omit<{
3
+ _id: z.ZodString;
4
+ created_at: z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>;
5
+ created_by: z.ZodDefault<z.ZodNullable<z.ZodString>>;
6
+ is_locked: z.ZodDefault<z.ZodBoolean>;
7
+ updated_at: z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>;
8
+ updated_by: z.ZodOptional<z.ZodString>;
9
+ }, "is_locked"> & {
10
+ agency_id: z.ZodString;
11
+ analysis: z.ZodNullable<z.ZodObject<{
12
+ AT_LEAST_ONE_VEHICLE_EVENT_ON_FIRST_STOP: z.ZodObject<{
13
+ error_message: z.ZodOptional<z.ZodString>;
14
+ grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
15
+ } & {
16
+ reason: z.ZodEnum<["NO_PATH_DATA", "NO_VEHICLE_EVENTS", "NO_VEHICLE_EVENTS_ON_FIRST_STOP", "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP"]>;
17
+ value: z.ZodNullable<z.ZodNumber>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ value: number | null;
20
+ grade: "error" | "pass" | "fail" | "skip";
21
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "NO_VEHICLE_EVENTS_ON_FIRST_STOP" | "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP";
22
+ error_message?: string | undefined;
23
+ }, {
24
+ value: number | null;
25
+ grade: "error" | "pass" | "fail" | "skip";
26
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "NO_VEHICLE_EVENTS_ON_FIRST_STOP" | "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP";
27
+ error_message?: string | undefined;
28
+ }>;
29
+ ENDED_AT_LAST_STOP: z.ZodObject<{
30
+ error_message: z.ZodOptional<z.ZodString>;
31
+ grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
32
+ } & {
33
+ reason: z.ZodEnum<["NO_PATH_DATA", "NO_VEHICLE_EVENTS", "ENDED_AT_LAST_STOP", "ENDED_OUTSIDE_OF_LAST_STOP"]>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ grade: "error" | "pass" | "fail" | "skip";
36
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "ENDED_AT_LAST_STOP" | "ENDED_OUTSIDE_OF_LAST_STOP";
37
+ error_message?: string | undefined;
38
+ }, {
39
+ grade: "error" | "pass" | "fail" | "skip";
40
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "ENDED_AT_LAST_STOP" | "ENDED_OUTSIDE_OF_LAST_STOP";
41
+ error_message?: string | undefined;
42
+ }>;
43
+ EXPECTED_APEX_VALIDATION_INTERVAL: z.ZodObject<{
44
+ error_message: z.ZodOptional<z.ZodString>;
45
+ grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
46
+ } & {
47
+ reason: z.ZodEnum<["NO_APEX_VALIDATIONS", "NOT_ENOUGH_VALIDATIONS", "INTERVALS_TOO_SHORT", "NON_ORGANIC_INTERVALS", "EXPECTED_VALIDATION_INTERVALS"]>;
48
+ }, "strip", z.ZodTypeAny, {
49
+ grade: "error" | "pass" | "fail" | "skip";
50
+ reason: "NO_APEX_VALIDATIONS" | "NOT_ENOUGH_VALIDATIONS" | "INTERVALS_TOO_SHORT" | "NON_ORGANIC_INTERVALS" | "EXPECTED_VALIDATION_INTERVALS";
51
+ error_message?: string | undefined;
52
+ }, {
53
+ grade: "error" | "pass" | "fail" | "skip";
54
+ reason: "NO_APEX_VALIDATIONS" | "NOT_ENOUGH_VALIDATIONS" | "INTERVALS_TOO_SHORT" | "NON_ORGANIC_INTERVALS" | "EXPECTED_VALIDATION_INTERVALS";
55
+ error_message?: string | undefined;
56
+ }>;
57
+ EXPECTED_DRIVER_ID_QTY: z.ZodObject<{
58
+ error_message: z.ZodOptional<z.ZodString>;
59
+ grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
60
+ } & {
61
+ reason: z.ZodEnum<["NO_VEHICLE_EVENTS", "UNEXPECTED_DRIVER_ID_QTY", "EXPECTED_DRIVER_ID_QTY"]>;
62
+ value: z.ZodNullable<z.ZodNumber>;
63
+ }, "strip", z.ZodTypeAny, {
64
+ value: number | null;
65
+ grade: "error" | "pass" | "fail" | "skip";
66
+ reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
67
+ error_message?: string | undefined;
68
+ }, {
69
+ value: number | null;
70
+ grade: "error" | "pass" | "fail" | "skip";
71
+ reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
72
+ error_message?: string | undefined;
73
+ }>;
74
+ EXPECTED_START_TIME: z.ZodObject<{
75
+ error_message: z.ZodOptional<z.ZodString>;
76
+ grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
77
+ } & {
78
+ reason: z.ZodEnum<["NO_START_TIME_SCHEDULED", "NO_VEHICLE_EVENTS", "UNKNOWN_START", "EARLY_START", "LATE_START", "START_ON_TIME"]>;
79
+ value: z.ZodNullable<z.ZodNumber>;
80
+ }, "strip", z.ZodTypeAny, {
81
+ value: number | null;
82
+ grade: "error" | "pass" | "fail" | "skip";
83
+ reason: "NO_VEHICLE_EVENTS" | "NO_START_TIME_SCHEDULED" | "UNKNOWN_START" | "EARLY_START" | "LATE_START" | "START_ON_TIME";
84
+ error_message?: string | undefined;
85
+ }, {
86
+ value: number | null;
87
+ grade: "error" | "pass" | "fail" | "skip";
88
+ reason: "NO_VEHICLE_EVENTS" | "NO_START_TIME_SCHEDULED" | "UNKNOWN_START" | "EARLY_START" | "LATE_START" | "START_ON_TIME";
89
+ error_message?: string | undefined;
90
+ }>;
91
+ EXPECTED_VEHICLE_EVENT_DELAY: z.ZodObject<{
92
+ error_message: z.ZodOptional<z.ZodString>;
93
+ grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
94
+ } & {
95
+ reason: z.ZodEnum<["NO_VEHICLE_EVENTS", "UNEXPECTED_VEHICLE_EVENTS_DELAY", "EXPECTED_VEHICLE_EVENTS_DELAY"]>;
96
+ value: z.ZodNullable<z.ZodNumber>;
97
+ }, "strip", z.ZodTypeAny, {
98
+ value: number | null;
99
+ grade: "error" | "pass" | "fail" | "skip";
100
+ reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
101
+ error_message?: string | undefined;
102
+ }, {
103
+ value: number | null;
104
+ grade: "error" | "pass" | "fail" | "skip";
105
+ reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
106
+ error_message?: string | undefined;
107
+ }>;
108
+ EXPECTED_VEHICLE_EVENT_INTERVAL: z.ZodObject<{
109
+ error_message: z.ZodOptional<z.ZodString>;
110
+ grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
111
+ } & {
112
+ reason: z.ZodEnum<["NO_VEHICLE_EVENTS", "EXPECTED_VEHICLE_EVENT_INTERVAL", "UNEXPECTED_VEHICLE_EVENT_INTERVAL"]>;
113
+ value: z.ZodNullable<z.ZodNumber>;
114
+ }, "strip", z.ZodTypeAny, {
115
+ value: number | null;
116
+ grade: "error" | "pass" | "fail" | "skip";
117
+ reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
118
+ error_message?: string | undefined;
119
+ }, {
120
+ value: number | null;
121
+ grade: "error" | "pass" | "fail" | "skip";
122
+ reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
123
+ error_message?: string | undefined;
124
+ }>;
125
+ EXPECTED_VEHICLE_EVENT_QTY: z.ZodObject<{
126
+ error_message: z.ZodOptional<z.ZodString>;
127
+ grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
128
+ } & {
129
+ expected_qty: z.ZodNullable<z.ZodNumber>;
130
+ found_qty: z.ZodNullable<z.ZodNumber>;
131
+ reason: z.ZodEnum<["NO_PATH_DATA", "NO_VEHICLE_EVENTS", "EXPECTED_VEHICLE_EVENT_QTY", "UNEXPECTED_VEHICLE_EVENT_QTY"]>;
132
+ }, "strip", z.ZodTypeAny, {
133
+ grade: "error" | "pass" | "fail" | "skip";
134
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_QTY" | "UNEXPECTED_VEHICLE_EVENT_QTY";
135
+ expected_qty: number | null;
136
+ found_qty: number | null;
137
+ error_message?: string | undefined;
138
+ }, {
139
+ grade: "error" | "pass" | "fail" | "skip";
140
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_QTY" | "UNEXPECTED_VEHICLE_EVENT_QTY";
141
+ expected_qty: number | null;
142
+ found_qty: number | null;
143
+ error_message?: string | undefined;
144
+ }>;
145
+ EXPECTED_VEHICLE_ID_QTY: z.ZodObject<{
146
+ error_message: z.ZodOptional<z.ZodString>;
147
+ grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
148
+ } & {
149
+ reason: z.ZodEnum<["NO_VEHICLE_EVENTS", "NO_APEX_VALIDATIONS", "UNEXPECTED_VEHICLE_ID_QTY", "EXPECTED_VEHICLE_ID_QTY"]>;
150
+ value: z.ZodNullable<z.ZodNumber>;
151
+ }, "strip", z.ZodTypeAny, {
152
+ value: number | null;
153
+ grade: "error" | "pass" | "fail" | "skip";
154
+ reason: "NO_VEHICLE_EVENTS" | "NO_APEX_VALIDATIONS" | "UNEXPECTED_VEHICLE_ID_QTY" | "EXPECTED_VEHICLE_ID_QTY";
155
+ error_message?: string | undefined;
156
+ }, {
157
+ value: number | null;
158
+ grade: "error" | "pass" | "fail" | "skip";
159
+ reason: "NO_VEHICLE_EVENTS" | "NO_APEX_VALIDATIONS" | "UNEXPECTED_VEHICLE_ID_QTY" | "EXPECTED_VEHICLE_ID_QTY";
160
+ error_message?: string | undefined;
161
+ }>;
162
+ MATCHING_APEX_LOCATIONS: z.ZodObject<{
163
+ error_message: z.ZodOptional<z.ZodString>;
164
+ grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
165
+ } & {
166
+ reason: z.ZodEnum<["NO_PATH_DATA", "NO_APEX_LOCATIONS", "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP", "MATCHING_APEX_LOCATIONS"]>;
167
+ }, "strip", z.ZodTypeAny, {
168
+ grade: "error" | "pass" | "fail" | "skip";
169
+ reason: "NO_PATH_DATA" | "NO_APEX_LOCATIONS" | "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP" | "MATCHING_APEX_LOCATIONS";
170
+ error_message?: string | undefined;
171
+ }, {
172
+ grade: "error" | "pass" | "fail" | "skip";
173
+ reason: "NO_PATH_DATA" | "NO_APEX_LOCATIONS" | "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP" | "MATCHING_APEX_LOCATIONS";
174
+ error_message?: string | undefined;
175
+ }>;
176
+ MATCHING_VEHICLE_IDS: z.ZodObject<{
177
+ error_message: z.ZodOptional<z.ZodString>;
178
+ grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
179
+ } & {
180
+ reason: z.ZodEnum<["MATCHING_VEHICLE_IDS", "VEHICLE_ID_MISMATCH", "NO_VEHICLE_EVENTS", "NO_APEX_TRANSACTIONS"]>;
181
+ }, "strip", z.ZodTypeAny, {
182
+ grade: "error" | "pass" | "fail" | "skip";
183
+ reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
184
+ error_message?: string | undefined;
185
+ }, {
186
+ grade: "error" | "pass" | "fail" | "skip";
187
+ reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
188
+ error_message?: string | undefined;
189
+ }>;
190
+ SIMPLE_ONE_APEX_VALIDATION: z.ZodObject<{
191
+ error_message: z.ZodOptional<z.ZodString>;
192
+ grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
193
+ } & {
194
+ reason: z.ZodEnum<["NO_APEX_VALIDATIONS", "ONE_OR_MORE_APEX_VALIDATIONS"]>;
195
+ value: z.ZodNullable<z.ZodNumber>;
196
+ }, "strip", z.ZodTypeAny, {
197
+ value: number | null;
198
+ grade: "error" | "pass" | "fail" | "skip";
199
+ reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
200
+ error_message?: string | undefined;
201
+ }, {
202
+ value: number | null;
203
+ grade: "error" | "pass" | "fail" | "skip";
204
+ reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
205
+ error_message?: string | undefined;
206
+ }>;
207
+ SIMPLE_ONE_VEHICLE_EVENT_OR_APEX_VALIDATION: z.ZodObject<{
208
+ error_message: z.ZodOptional<z.ZodString>;
209
+ grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
210
+ } & {
211
+ reason: z.ZodEnum<["NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS", "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION"]>;
212
+ }, "strip", z.ZodTypeAny, {
213
+ grade: "error" | "pass" | "fail" | "skip";
214
+ reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
215
+ error_message?: string | undefined;
216
+ }, {
217
+ grade: "error" | "pass" | "fail" | "skip";
218
+ reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
219
+ error_message?: string | undefined;
220
+ }>;
221
+ SIMPLE_THREE_VEHICLE_EVENTS: z.ZodObject<{
222
+ error_message: z.ZodOptional<z.ZodString>;
223
+ grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
224
+ } & {
225
+ reason: z.ZodEnum<["NO_PATH_DATA", "NO_VEHICLE_EVENTS", "MISSING_FIRST_STOPS", "MISSING_MIDDLE_STOPS", "MISSING_LAST_STOPS", "ALL_STOPS_FOUND"]>;
226
+ stop_ids_first: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
227
+ stop_ids_last: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
228
+ stop_ids_middle: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
229
+ }, "strip", z.ZodTypeAny, {
230
+ grade: "error" | "pass" | "fail" | "skip";
231
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "MISSING_FIRST_STOPS" | "MISSING_MIDDLE_STOPS" | "MISSING_LAST_STOPS" | "ALL_STOPS_FOUND";
232
+ stop_ids_first: string[] | null;
233
+ stop_ids_last: string[] | null;
234
+ stop_ids_middle: string[] | null;
235
+ error_message?: string | undefined;
236
+ }, {
237
+ grade: "error" | "pass" | "fail" | "skip";
238
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "MISSING_FIRST_STOPS" | "MISSING_MIDDLE_STOPS" | "MISSING_LAST_STOPS" | "ALL_STOPS_FOUND";
239
+ stop_ids_first: string[] | null;
240
+ stop_ids_last: string[] | null;
241
+ stop_ids_middle: string[] | null;
242
+ error_message?: string | undefined;
243
+ }>;
244
+ TRANSACTION_SEQUENTIALITY: z.ZodObject<{
245
+ error_message: z.ZodOptional<z.ZodString>;
246
+ grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
247
+ } & {
248
+ expected_qty: z.ZodNullable<z.ZodNumber>;
249
+ found_qty: z.ZodNullable<z.ZodNumber>;
250
+ missing_qty: z.ZodNullable<z.ZodNumber>;
251
+ reason: z.ZodEnum<["NO_TRANSACTIONS", "MISSING_TRANSACTIONS", "ALL_TRANSACTIONS_RECEIVED"]>;
252
+ }, "strip", z.ZodTypeAny, {
253
+ grade: "error" | "pass" | "fail" | "skip";
254
+ reason: "NO_TRANSACTIONS" | "MISSING_TRANSACTIONS" | "ALL_TRANSACTIONS_RECEIVED";
255
+ expected_qty: number | null;
256
+ found_qty: number | null;
257
+ missing_qty: number | null;
258
+ error_message?: string | undefined;
259
+ }, {
260
+ grade: "error" | "pass" | "fail" | "skip";
261
+ reason: "NO_TRANSACTIONS" | "MISSING_TRANSACTIONS" | "ALL_TRANSACTIONS_RECEIVED";
262
+ expected_qty: number | null;
263
+ found_qty: number | null;
264
+ missing_qty: number | null;
265
+ error_message?: string | undefined;
266
+ }>;
267
+ }, "strip", z.ZodTypeAny, {
268
+ EXPECTED_DRIVER_ID_QTY: {
269
+ value: number | null;
270
+ grade: "error" | "pass" | "fail" | "skip";
271
+ reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
272
+ error_message?: string | undefined;
273
+ };
274
+ EXPECTED_VEHICLE_ID_QTY: {
275
+ value: number | null;
276
+ grade: "error" | "pass" | "fail" | "skip";
277
+ reason: "NO_VEHICLE_EVENTS" | "NO_APEX_VALIDATIONS" | "UNEXPECTED_VEHICLE_ID_QTY" | "EXPECTED_VEHICLE_ID_QTY";
278
+ error_message?: string | undefined;
279
+ };
280
+ EXPECTED_VEHICLE_EVENT_INTERVAL: {
281
+ value: number | null;
282
+ grade: "error" | "pass" | "fail" | "skip";
283
+ reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
284
+ error_message?: string | undefined;
285
+ };
286
+ ENDED_AT_LAST_STOP: {
287
+ grade: "error" | "pass" | "fail" | "skip";
288
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "ENDED_AT_LAST_STOP" | "ENDED_OUTSIDE_OF_LAST_STOP";
289
+ error_message?: string | undefined;
290
+ };
291
+ EXPECTED_VEHICLE_EVENT_QTY: {
292
+ grade: "error" | "pass" | "fail" | "skip";
293
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_QTY" | "UNEXPECTED_VEHICLE_EVENT_QTY";
294
+ expected_qty: number | null;
295
+ found_qty: number | null;
296
+ error_message?: string | undefined;
297
+ };
298
+ MATCHING_APEX_LOCATIONS: {
299
+ grade: "error" | "pass" | "fail" | "skip";
300
+ reason: "NO_PATH_DATA" | "NO_APEX_LOCATIONS" | "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP" | "MATCHING_APEX_LOCATIONS";
301
+ error_message?: string | undefined;
302
+ };
303
+ MATCHING_VEHICLE_IDS: {
304
+ grade: "error" | "pass" | "fail" | "skip";
305
+ reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
306
+ error_message?: string | undefined;
307
+ };
308
+ AT_LEAST_ONE_VEHICLE_EVENT_ON_FIRST_STOP: {
309
+ value: number | null;
310
+ grade: "error" | "pass" | "fail" | "skip";
311
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "NO_VEHICLE_EVENTS_ON_FIRST_STOP" | "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP";
312
+ error_message?: string | undefined;
313
+ };
314
+ EXPECTED_APEX_VALIDATION_INTERVAL: {
315
+ grade: "error" | "pass" | "fail" | "skip";
316
+ reason: "NO_APEX_VALIDATIONS" | "NOT_ENOUGH_VALIDATIONS" | "INTERVALS_TOO_SHORT" | "NON_ORGANIC_INTERVALS" | "EXPECTED_VALIDATION_INTERVALS";
317
+ error_message?: string | undefined;
318
+ };
319
+ EXPECTED_START_TIME: {
320
+ value: number | null;
321
+ grade: "error" | "pass" | "fail" | "skip";
322
+ reason: "NO_VEHICLE_EVENTS" | "NO_START_TIME_SCHEDULED" | "UNKNOWN_START" | "EARLY_START" | "LATE_START" | "START_ON_TIME";
323
+ error_message?: string | undefined;
324
+ };
325
+ EXPECTED_VEHICLE_EVENT_DELAY: {
326
+ value: number | null;
327
+ grade: "error" | "pass" | "fail" | "skip";
328
+ reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
329
+ error_message?: string | undefined;
330
+ };
331
+ SIMPLE_ONE_APEX_VALIDATION: {
332
+ value: number | null;
333
+ grade: "error" | "pass" | "fail" | "skip";
334
+ reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
335
+ error_message?: string | undefined;
336
+ };
337
+ SIMPLE_ONE_VEHICLE_EVENT_OR_APEX_VALIDATION: {
338
+ grade: "error" | "pass" | "fail" | "skip";
339
+ reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
340
+ error_message?: string | undefined;
341
+ };
342
+ SIMPLE_THREE_VEHICLE_EVENTS: {
343
+ grade: "error" | "pass" | "fail" | "skip";
344
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "MISSING_FIRST_STOPS" | "MISSING_MIDDLE_STOPS" | "MISSING_LAST_STOPS" | "ALL_STOPS_FOUND";
345
+ stop_ids_first: string[] | null;
346
+ stop_ids_last: string[] | null;
347
+ stop_ids_middle: string[] | null;
348
+ error_message?: string | undefined;
349
+ };
350
+ TRANSACTION_SEQUENTIALITY: {
351
+ grade: "error" | "pass" | "fail" | "skip";
352
+ reason: "NO_TRANSACTIONS" | "MISSING_TRANSACTIONS" | "ALL_TRANSACTIONS_RECEIVED";
353
+ expected_qty: number | null;
354
+ found_qty: number | null;
355
+ missing_qty: number | null;
356
+ error_message?: string | undefined;
357
+ };
358
+ }, {
359
+ EXPECTED_DRIVER_ID_QTY: {
360
+ value: number | null;
361
+ grade: "error" | "pass" | "fail" | "skip";
362
+ reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
363
+ error_message?: string | undefined;
364
+ };
365
+ EXPECTED_VEHICLE_ID_QTY: {
366
+ value: number | null;
367
+ grade: "error" | "pass" | "fail" | "skip";
368
+ reason: "NO_VEHICLE_EVENTS" | "NO_APEX_VALIDATIONS" | "UNEXPECTED_VEHICLE_ID_QTY" | "EXPECTED_VEHICLE_ID_QTY";
369
+ error_message?: string | undefined;
370
+ };
371
+ EXPECTED_VEHICLE_EVENT_INTERVAL: {
372
+ value: number | null;
373
+ grade: "error" | "pass" | "fail" | "skip";
374
+ reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
375
+ error_message?: string | undefined;
376
+ };
377
+ ENDED_AT_LAST_STOP: {
378
+ grade: "error" | "pass" | "fail" | "skip";
379
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "ENDED_AT_LAST_STOP" | "ENDED_OUTSIDE_OF_LAST_STOP";
380
+ error_message?: string | undefined;
381
+ };
382
+ EXPECTED_VEHICLE_EVENT_QTY: {
383
+ grade: "error" | "pass" | "fail" | "skip";
384
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_QTY" | "UNEXPECTED_VEHICLE_EVENT_QTY";
385
+ expected_qty: number | null;
386
+ found_qty: number | null;
387
+ error_message?: string | undefined;
388
+ };
389
+ MATCHING_APEX_LOCATIONS: {
390
+ grade: "error" | "pass" | "fail" | "skip";
391
+ reason: "NO_PATH_DATA" | "NO_APEX_LOCATIONS" | "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP" | "MATCHING_APEX_LOCATIONS";
392
+ error_message?: string | undefined;
393
+ };
394
+ MATCHING_VEHICLE_IDS: {
395
+ grade: "error" | "pass" | "fail" | "skip";
396
+ reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
397
+ error_message?: string | undefined;
398
+ };
399
+ AT_LEAST_ONE_VEHICLE_EVENT_ON_FIRST_STOP: {
400
+ value: number | null;
401
+ grade: "error" | "pass" | "fail" | "skip";
402
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "NO_VEHICLE_EVENTS_ON_FIRST_STOP" | "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP";
403
+ error_message?: string | undefined;
404
+ };
405
+ EXPECTED_APEX_VALIDATION_INTERVAL: {
406
+ grade: "error" | "pass" | "fail" | "skip";
407
+ reason: "NO_APEX_VALIDATIONS" | "NOT_ENOUGH_VALIDATIONS" | "INTERVALS_TOO_SHORT" | "NON_ORGANIC_INTERVALS" | "EXPECTED_VALIDATION_INTERVALS";
408
+ error_message?: string | undefined;
409
+ };
410
+ EXPECTED_START_TIME: {
411
+ value: number | null;
412
+ grade: "error" | "pass" | "fail" | "skip";
413
+ reason: "NO_VEHICLE_EVENTS" | "NO_START_TIME_SCHEDULED" | "UNKNOWN_START" | "EARLY_START" | "LATE_START" | "START_ON_TIME";
414
+ error_message?: string | undefined;
415
+ };
416
+ EXPECTED_VEHICLE_EVENT_DELAY: {
417
+ value: number | null;
418
+ grade: "error" | "pass" | "fail" | "skip";
419
+ reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
420
+ error_message?: string | undefined;
421
+ };
422
+ SIMPLE_ONE_APEX_VALIDATION: {
423
+ value: number | null;
424
+ grade: "error" | "pass" | "fail" | "skip";
425
+ reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
426
+ error_message?: string | undefined;
427
+ };
428
+ SIMPLE_ONE_VEHICLE_EVENT_OR_APEX_VALIDATION: {
429
+ grade: "error" | "pass" | "fail" | "skip";
430
+ reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
431
+ error_message?: string | undefined;
432
+ };
433
+ SIMPLE_THREE_VEHICLE_EVENTS: {
434
+ grade: "error" | "pass" | "fail" | "skip";
435
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "MISSING_FIRST_STOPS" | "MISSING_MIDDLE_STOPS" | "MISSING_LAST_STOPS" | "ALL_STOPS_FOUND";
436
+ stop_ids_first: string[] | null;
437
+ stop_ids_last: string[] | null;
438
+ stop_ids_middle: string[] | null;
439
+ error_message?: string | undefined;
440
+ };
441
+ TRANSACTION_SEQUENTIALITY: {
442
+ grade: "error" | "pass" | "fail" | "skip";
443
+ reason: "NO_TRANSACTIONS" | "MISSING_TRANSACTIONS" | "ALL_TRANSACTIONS_RECEIVED";
444
+ expected_qty: number | null;
445
+ found_qty: number | null;
446
+ missing_qty: number | null;
447
+ error_message?: string | undefined;
448
+ };
449
+ }>>;
450
+ apex_locations_qty: z.ZodNullable<z.ZodNumber>;
451
+ apex_on_board_refunds_amount: z.ZodNullable<z.ZodNumber>;
452
+ apex_on_board_refunds_qty: z.ZodNullable<z.ZodNumber>;
453
+ apex_on_board_sales_amount: z.ZodNullable<z.ZodNumber>;
454
+ apex_on_board_sales_qty: z.ZodNullable<z.ZodNumber>;
455
+ apex_validations_qty: z.ZodNullable<z.ZodNumber>;
456
+ driver_ids: z.ZodArray<z.ZodString, "many">;
457
+ end_time_observed: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>>;
458
+ end_time_scheduled: z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>;
459
+ extension_observed: z.ZodNullable<z.ZodNumber>;
460
+ extension_scheduled: z.ZodNumber;
461
+ hashed_shape_id: z.ZodString;
462
+ hashed_trip_id: z.ZodString;
463
+ headsign: z.ZodString;
464
+ line_id: z.ZodNumber;
465
+ operational_date: z.ZodEffects<z.ZodString, import("../index.js").OperationalDate, string>;
466
+ passengers_estimated: z.ZodNullable<z.ZodNumber>;
467
+ passengers_observed: z.ZodNullable<z.ZodNumber>;
468
+ passengers_observed_on_board_sales_amount: z.ZodNullable<z.ZodNumber>;
469
+ passengers_observed_on_board_sales_qty: z.ZodNullable<z.ZodNumber>;
470
+ passengers_observed_prepaid_amount: z.ZodNullable<z.ZodNumber>;
471
+ passengers_observed_prepaid_qty: z.ZodNullable<z.ZodNumber>;
472
+ passengers_observed_subscription_qty: z.ZodNullable<z.ZodNumber>;
473
+ pattern_id: z.ZodString;
474
+ plan_id: z.ZodString;
475
+ route_id: z.ZodString;
476
+ seen_first_at: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>>;
477
+ seen_last_at: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>>;
478
+ start_time_observed: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>>;
479
+ start_time_scheduled: z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>;
480
+ system_status: z.ZodDefault<z.ZodEnum<["waiting", "processing", "complete", "error", "skipped"]>>;
481
+ trip_id: z.ZodString;
482
+ vehicle_ids: z.ZodArray<z.ZodNumber, "many">;
483
+ } & {
484
+ acceptance_status: z.ZodEnum<["justification_required", "under_review", "accepted", "rejected"]>;
485
+ analysis_ended_at_last_stop_grade: z.ZodUnion<[z.ZodEnum<["pass", "fail", "skip", "error"]>, z.ZodLiteral<"none">]>;
486
+ analysis_expected_apex_validation_interval: z.ZodUnion<[z.ZodEnum<["pass", "fail", "skip", "error"]>, z.ZodLiteral<"none">]>;
487
+ analysis_simple_three_vehicle_events_grade: z.ZodUnion<[z.ZodEnum<["pass", "fail", "skip", "error"]>, z.ZodLiteral<"none">]>;
488
+ analysis_transaction_sequentiality: z.ZodUnion<[z.ZodEnum<["pass", "fail", "skip", "error"]>, z.ZodLiteral<"none">]>;
11
489
  /**
12
490
  * @deprecated use `start_time_observed_display` instead
13
491
  */
14
- delay_status: typeof DelayStatusSchema.options[number];
492
+ delay_status: z.ZodEnum<["delayed", "early", "ontime", "none"]>;
15
493
  /**
16
494
  * @deprecated use `start_time_observed_display` instead
17
495
  */
18
- delay_value_display: null | string;
19
- end_delay_status: typeof DelayStatusSchema.options[number];
20
- end_delay_value_display: null | string;
21
- end_time_observed_display: null | string;
496
+ delay_value_display: z.ZodNullable<z.ZodString>;
497
+ end_delay_status: z.ZodEnum<["delayed", "early", "ontime", "none"]>;
498
+ end_delay_value_display: z.ZodNullable<z.ZodString>;
499
+ end_time_observed_display: z.ZodNullable<z.ZodString>;
500
+ end_time_scheduled_display: z.ZodString;
501
+ operational_status: z.ZodEnum<["ended", "missed", "running", "scheduled"]>;
502
+ seen_status: z.ZodEnum<["unseen", "seen", "gone"]>;
503
+ start_delay_status: z.ZodEnum<["delayed", "early", "ontime", "none"]>;
504
+ start_delay_value_display: z.ZodNullable<z.ZodString>;
505
+ start_time_observed_display: z.ZodNullable<z.ZodString>;
506
+ start_time_scheduled_display: z.ZodString;
507
+ }, "strip", z.ZodTypeAny, {
508
+ _id: string;
509
+ created_at: number & {
510
+ __brand: "UnixTimestamp";
511
+ };
512
+ created_by: string | null;
513
+ updated_at: number & {
514
+ __brand: "UnixTimestamp";
515
+ };
516
+ agency_id: string;
517
+ line_id: number;
518
+ pattern_id: string;
519
+ trip_id: string;
520
+ seen_last_at: import("../index.js").UnixTimestamp | null;
521
+ acceptance_status: "rejected" | "justification_required" | "under_review" | "accepted";
522
+ driver_ids: string[];
523
+ headsign: string;
524
+ plan_id: string;
525
+ route_id: string;
526
+ vehicle_ids: number[];
527
+ operational_date: string & {
528
+ __brand: "OperationalDate";
529
+ };
530
+ operational_status: "ended" | "missed" | "running" | "scheduled";
531
+ start_delay_status: "delayed" | "early" | "ontime" | "none";
532
+ start_time_observed: import("../index.js").UnixTimestamp | null;
533
+ start_time_scheduled: number & {
534
+ __brand: "UnixTimestamp";
535
+ };
536
+ end_delay_status: "delayed" | "early" | "ontime" | "none";
537
+ end_time_observed: import("../index.js").UnixTimestamp | null;
538
+ end_time_scheduled: number & {
539
+ __brand: "UnixTimestamp";
540
+ };
541
+ extension_observed: number | null;
542
+ extension_scheduled: number;
543
+ seen_first_at: import("../index.js").UnixTimestamp | null;
544
+ seen_status: "unseen" | "seen" | "gone";
545
+ passengers_estimated: number | null;
546
+ passengers_observed: number | null;
547
+ passengers_observed_on_board_sales_amount: number | null;
548
+ passengers_observed_on_board_sales_qty: number | null;
549
+ passengers_observed_prepaid_amount: number | null;
550
+ passengers_observed_prepaid_qty: number | null;
551
+ passengers_observed_subscription_qty: number | null;
552
+ apex_locations_qty: number | null;
553
+ apex_on_board_refunds_amount: number | null;
554
+ apex_on_board_refunds_qty: number | null;
555
+ apex_on_board_sales_amount: number | null;
556
+ apex_on_board_sales_qty: number | null;
557
+ apex_validations_qty: number | null;
558
+ analysis_expected_apex_validation_interval: "error" | "none" | "pass" | "fail" | "skip";
559
+ analysis_transaction_sequentiality: "error" | "none" | "pass" | "fail" | "skip";
560
+ analysis_ended_at_last_stop_grade: "error" | "none" | "pass" | "fail" | "skip";
561
+ analysis_simple_three_vehicle_events_grade: "error" | "none" | "pass" | "fail" | "skip";
562
+ analysis: {
563
+ EXPECTED_DRIVER_ID_QTY: {
564
+ value: number | null;
565
+ grade: "error" | "pass" | "fail" | "skip";
566
+ reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
567
+ error_message?: string | undefined;
568
+ };
569
+ EXPECTED_VEHICLE_ID_QTY: {
570
+ value: number | null;
571
+ grade: "error" | "pass" | "fail" | "skip";
572
+ reason: "NO_VEHICLE_EVENTS" | "NO_APEX_VALIDATIONS" | "UNEXPECTED_VEHICLE_ID_QTY" | "EXPECTED_VEHICLE_ID_QTY";
573
+ error_message?: string | undefined;
574
+ };
575
+ EXPECTED_VEHICLE_EVENT_INTERVAL: {
576
+ value: number | null;
577
+ grade: "error" | "pass" | "fail" | "skip";
578
+ reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
579
+ error_message?: string | undefined;
580
+ };
581
+ ENDED_AT_LAST_STOP: {
582
+ grade: "error" | "pass" | "fail" | "skip";
583
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "ENDED_AT_LAST_STOP" | "ENDED_OUTSIDE_OF_LAST_STOP";
584
+ error_message?: string | undefined;
585
+ };
586
+ EXPECTED_VEHICLE_EVENT_QTY: {
587
+ grade: "error" | "pass" | "fail" | "skip";
588
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_QTY" | "UNEXPECTED_VEHICLE_EVENT_QTY";
589
+ expected_qty: number | null;
590
+ found_qty: number | null;
591
+ error_message?: string | undefined;
592
+ };
593
+ MATCHING_APEX_LOCATIONS: {
594
+ grade: "error" | "pass" | "fail" | "skip";
595
+ reason: "NO_PATH_DATA" | "NO_APEX_LOCATIONS" | "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP" | "MATCHING_APEX_LOCATIONS";
596
+ error_message?: string | undefined;
597
+ };
598
+ MATCHING_VEHICLE_IDS: {
599
+ grade: "error" | "pass" | "fail" | "skip";
600
+ reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
601
+ error_message?: string | undefined;
602
+ };
603
+ AT_LEAST_ONE_VEHICLE_EVENT_ON_FIRST_STOP: {
604
+ value: number | null;
605
+ grade: "error" | "pass" | "fail" | "skip";
606
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "NO_VEHICLE_EVENTS_ON_FIRST_STOP" | "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP";
607
+ error_message?: string | undefined;
608
+ };
609
+ EXPECTED_APEX_VALIDATION_INTERVAL: {
610
+ grade: "error" | "pass" | "fail" | "skip";
611
+ reason: "NO_APEX_VALIDATIONS" | "NOT_ENOUGH_VALIDATIONS" | "INTERVALS_TOO_SHORT" | "NON_ORGANIC_INTERVALS" | "EXPECTED_VALIDATION_INTERVALS";
612
+ error_message?: string | undefined;
613
+ };
614
+ EXPECTED_START_TIME: {
615
+ value: number | null;
616
+ grade: "error" | "pass" | "fail" | "skip";
617
+ reason: "NO_VEHICLE_EVENTS" | "NO_START_TIME_SCHEDULED" | "UNKNOWN_START" | "EARLY_START" | "LATE_START" | "START_ON_TIME";
618
+ error_message?: string | undefined;
619
+ };
620
+ EXPECTED_VEHICLE_EVENT_DELAY: {
621
+ value: number | null;
622
+ grade: "error" | "pass" | "fail" | "skip";
623
+ reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
624
+ error_message?: string | undefined;
625
+ };
626
+ SIMPLE_ONE_APEX_VALIDATION: {
627
+ value: number | null;
628
+ grade: "error" | "pass" | "fail" | "skip";
629
+ reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
630
+ error_message?: string | undefined;
631
+ };
632
+ SIMPLE_ONE_VEHICLE_EVENT_OR_APEX_VALIDATION: {
633
+ grade: "error" | "pass" | "fail" | "skip";
634
+ reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
635
+ error_message?: string | undefined;
636
+ };
637
+ SIMPLE_THREE_VEHICLE_EVENTS: {
638
+ grade: "error" | "pass" | "fail" | "skip";
639
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "MISSING_FIRST_STOPS" | "MISSING_MIDDLE_STOPS" | "MISSING_LAST_STOPS" | "ALL_STOPS_FOUND";
640
+ stop_ids_first: string[] | null;
641
+ stop_ids_last: string[] | null;
642
+ stop_ids_middle: string[] | null;
643
+ error_message?: string | undefined;
644
+ };
645
+ TRANSACTION_SEQUENTIALITY: {
646
+ grade: "error" | "pass" | "fail" | "skip";
647
+ reason: "NO_TRANSACTIONS" | "MISSING_TRANSACTIONS" | "ALL_TRANSACTIONS_RECEIVED";
648
+ expected_qty: number | null;
649
+ found_qty: number | null;
650
+ missing_qty: number | null;
651
+ error_message?: string | undefined;
652
+ };
653
+ } | null;
654
+ hashed_shape_id: string;
655
+ hashed_trip_id: string;
656
+ system_status: "waiting" | "processing" | "complete" | "error" | "skipped";
657
+ delay_status: "delayed" | "early" | "ontime" | "none";
658
+ delay_value_display: string | null;
659
+ end_delay_value_display: string | null;
660
+ end_time_observed_display: string | null;
22
661
  end_time_scheduled_display: string;
23
- operational_status: typeof OperationalStatusSchema.options[number];
24
- seen_status: typeof SeenStatusSchema.options[number];
25
- start_delay_status: typeof DelayStatusSchema.options[number];
26
- start_delay_value_display: null | string;
27
- start_time_observed_display: null | string;
662
+ start_delay_value_display: string | null;
663
+ start_time_observed_display: string | null;
28
664
  start_time_scheduled_display: string;
29
- }
665
+ updated_by?: string | undefined;
666
+ }, {
667
+ _id: string;
668
+ created_at: number;
669
+ updated_at: number;
670
+ agency_id: string;
671
+ line_id: number;
672
+ pattern_id: string;
673
+ trip_id: string;
674
+ seen_last_at: number | null;
675
+ acceptance_status: "rejected" | "justification_required" | "under_review" | "accepted";
676
+ driver_ids: string[];
677
+ headsign: string;
678
+ plan_id: string;
679
+ route_id: string;
680
+ vehicle_ids: number[];
681
+ operational_date: string;
682
+ operational_status: "ended" | "missed" | "running" | "scheduled";
683
+ start_delay_status: "delayed" | "early" | "ontime" | "none";
684
+ start_time_observed: number | null;
685
+ start_time_scheduled: number;
686
+ end_delay_status: "delayed" | "early" | "ontime" | "none";
687
+ end_time_observed: number | null;
688
+ end_time_scheduled: number;
689
+ extension_observed: number | null;
690
+ extension_scheduled: number;
691
+ seen_first_at: number | null;
692
+ seen_status: "unseen" | "seen" | "gone";
693
+ passengers_estimated: number | null;
694
+ passengers_observed: number | null;
695
+ passengers_observed_on_board_sales_amount: number | null;
696
+ passengers_observed_on_board_sales_qty: number | null;
697
+ passengers_observed_prepaid_amount: number | null;
698
+ passengers_observed_prepaid_qty: number | null;
699
+ passengers_observed_subscription_qty: number | null;
700
+ apex_locations_qty: number | null;
701
+ apex_on_board_refunds_amount: number | null;
702
+ apex_on_board_refunds_qty: number | null;
703
+ apex_on_board_sales_amount: number | null;
704
+ apex_on_board_sales_qty: number | null;
705
+ apex_validations_qty: number | null;
706
+ analysis_expected_apex_validation_interval: "error" | "none" | "pass" | "fail" | "skip";
707
+ analysis_transaction_sequentiality: "error" | "none" | "pass" | "fail" | "skip";
708
+ analysis_ended_at_last_stop_grade: "error" | "none" | "pass" | "fail" | "skip";
709
+ analysis_simple_three_vehicle_events_grade: "error" | "none" | "pass" | "fail" | "skip";
710
+ analysis: {
711
+ EXPECTED_DRIVER_ID_QTY: {
712
+ value: number | null;
713
+ grade: "error" | "pass" | "fail" | "skip";
714
+ reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
715
+ error_message?: string | undefined;
716
+ };
717
+ EXPECTED_VEHICLE_ID_QTY: {
718
+ value: number | null;
719
+ grade: "error" | "pass" | "fail" | "skip";
720
+ reason: "NO_VEHICLE_EVENTS" | "NO_APEX_VALIDATIONS" | "UNEXPECTED_VEHICLE_ID_QTY" | "EXPECTED_VEHICLE_ID_QTY";
721
+ error_message?: string | undefined;
722
+ };
723
+ EXPECTED_VEHICLE_EVENT_INTERVAL: {
724
+ value: number | null;
725
+ grade: "error" | "pass" | "fail" | "skip";
726
+ reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
727
+ error_message?: string | undefined;
728
+ };
729
+ ENDED_AT_LAST_STOP: {
730
+ grade: "error" | "pass" | "fail" | "skip";
731
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "ENDED_AT_LAST_STOP" | "ENDED_OUTSIDE_OF_LAST_STOP";
732
+ error_message?: string | undefined;
733
+ };
734
+ EXPECTED_VEHICLE_EVENT_QTY: {
735
+ grade: "error" | "pass" | "fail" | "skip";
736
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_QTY" | "UNEXPECTED_VEHICLE_EVENT_QTY";
737
+ expected_qty: number | null;
738
+ found_qty: number | null;
739
+ error_message?: string | undefined;
740
+ };
741
+ MATCHING_APEX_LOCATIONS: {
742
+ grade: "error" | "pass" | "fail" | "skip";
743
+ reason: "NO_PATH_DATA" | "NO_APEX_LOCATIONS" | "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP" | "MATCHING_APEX_LOCATIONS";
744
+ error_message?: string | undefined;
745
+ };
746
+ MATCHING_VEHICLE_IDS: {
747
+ grade: "error" | "pass" | "fail" | "skip";
748
+ reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
749
+ error_message?: string | undefined;
750
+ };
751
+ AT_LEAST_ONE_VEHICLE_EVENT_ON_FIRST_STOP: {
752
+ value: number | null;
753
+ grade: "error" | "pass" | "fail" | "skip";
754
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "NO_VEHICLE_EVENTS_ON_FIRST_STOP" | "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP";
755
+ error_message?: string | undefined;
756
+ };
757
+ EXPECTED_APEX_VALIDATION_INTERVAL: {
758
+ grade: "error" | "pass" | "fail" | "skip";
759
+ reason: "NO_APEX_VALIDATIONS" | "NOT_ENOUGH_VALIDATIONS" | "INTERVALS_TOO_SHORT" | "NON_ORGANIC_INTERVALS" | "EXPECTED_VALIDATION_INTERVALS";
760
+ error_message?: string | undefined;
761
+ };
762
+ EXPECTED_START_TIME: {
763
+ value: number | null;
764
+ grade: "error" | "pass" | "fail" | "skip";
765
+ reason: "NO_VEHICLE_EVENTS" | "NO_START_TIME_SCHEDULED" | "UNKNOWN_START" | "EARLY_START" | "LATE_START" | "START_ON_TIME";
766
+ error_message?: string | undefined;
767
+ };
768
+ EXPECTED_VEHICLE_EVENT_DELAY: {
769
+ value: number | null;
770
+ grade: "error" | "pass" | "fail" | "skip";
771
+ reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
772
+ error_message?: string | undefined;
773
+ };
774
+ SIMPLE_ONE_APEX_VALIDATION: {
775
+ value: number | null;
776
+ grade: "error" | "pass" | "fail" | "skip";
777
+ reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
778
+ error_message?: string | undefined;
779
+ };
780
+ SIMPLE_ONE_VEHICLE_EVENT_OR_APEX_VALIDATION: {
781
+ grade: "error" | "pass" | "fail" | "skip";
782
+ reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
783
+ error_message?: string | undefined;
784
+ };
785
+ SIMPLE_THREE_VEHICLE_EVENTS: {
786
+ grade: "error" | "pass" | "fail" | "skip";
787
+ reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "MISSING_FIRST_STOPS" | "MISSING_MIDDLE_STOPS" | "MISSING_LAST_STOPS" | "ALL_STOPS_FOUND";
788
+ stop_ids_first: string[] | null;
789
+ stop_ids_last: string[] | null;
790
+ stop_ids_middle: string[] | null;
791
+ error_message?: string | undefined;
792
+ };
793
+ TRANSACTION_SEQUENTIALITY: {
794
+ grade: "error" | "pass" | "fail" | "skip";
795
+ reason: "NO_TRANSACTIONS" | "MISSING_TRANSACTIONS" | "ALL_TRANSACTIONS_RECEIVED";
796
+ expected_qty: number | null;
797
+ found_qty: number | null;
798
+ missing_qty: number | null;
799
+ error_message?: string | undefined;
800
+ };
801
+ } | null;
802
+ hashed_shape_id: string;
803
+ hashed_trip_id: string;
804
+ delay_status: "delayed" | "early" | "ontime" | "none";
805
+ delay_value_display: string | null;
806
+ end_delay_value_display: string | null;
807
+ end_time_observed_display: string | null;
808
+ end_time_scheduled_display: string;
809
+ start_delay_value_display: string | null;
810
+ start_time_observed_display: string | null;
811
+ start_time_scheduled_display: string;
812
+ created_by?: string | null | undefined;
813
+ updated_by?: string | undefined;
814
+ system_status?: "waiting" | "processing" | "complete" | "error" | "skipped" | undefined;
815
+ }>;
816
+ export type RideNormalized = z.infer<typeof RideNormalizedSchema>;