aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/app/api
diff options
context:
space:
mode:
authorAriel Costas Guerrero <ariel@costas.dev>2025-12-23 21:33:17 +0100
committerAriel Costas Guerrero <ariel@costas.dev>2025-12-23 21:33:17 +0100
commit4a866f5352a51916ddb9849b2d68213856196c9c (patch)
tree3ba01ba01d5f6931adaf708b76ffccdd798fc78b /src/frontend/app/api
parent87417c313b455ba0dee19708528cc8d0b830a276 (diff)
Full real-time page, coruña real time
Diffstat (limited to 'src/frontend/app/api')
-rw-r--r--src/frontend/app/api/schema.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/frontend/app/api/schema.ts b/src/frontend/app/api/schema.ts
index bb1e96c..9cc5bd4 100644
--- a/src/frontend/app/api/schema.ts
+++ b/src/frontend/app/api/schema.ts
@@ -33,17 +33,30 @@ export const ShiftBadgeSchema = z.object({
shiftTrip: z.string(),
});
+export const PositionSchema = z.object({
+ latitude: z.number(),
+ longitude: z.number(),
+ orientationDegrees: z.number(),
+ shapeIndex: z.number(),
+});
+
export const ArrivalSchema = z.object({
+ tripId: z.string(),
route: RouteInfoSchema,
headsign: HeadsignInfoSchema,
estimate: ArrivalDetailsSchema,
delay: DelayBadgeSchema.optional().nullable(),
shift: ShiftBadgeSchema.optional().nullable(),
+ shape: z.any().optional().nullable(),
+ currentPosition: PositionSchema.optional().nullable(),
+ stopShapeIndex: z.number().optional().nullable(),
});
export const StopArrivalsResponseSchema = z.object({
stopCode: z.string(),
stopName: z.string(),
+ stopLocation: PositionSchema.optional().nullable(),
+ routes: z.array(RouteInfoSchema),
arrivals: z.array(ArrivalSchema),
});
@@ -53,6 +66,7 @@ export type ArrivalPrecision = z.infer<typeof ArrivalPrecisionSchema>;
export type ArrivalDetails = z.infer<typeof ArrivalDetailsSchema>;
export type DelayBadge = z.infer<typeof DelayBadgeSchema>;
export type ShiftBadge = z.infer<typeof ShiftBadgeSchema>;
+export type Position = z.infer<typeof PositionSchema>;
export type Arrival = z.infer<typeof ArrivalSchema>;
export type StopArrivalsResponse = z.infer<typeof StopArrivalsResponseSchema>;