UNPKG

@tmlmobilidade/types

Version:

This package provides shared Zod validation schemas and their corresponding TypeScript types for use across projects. All types are automatically inferred from the schemas to ensure full type safety and reduce maintenance overhead.

121 lines (120 loc) 4.91 kB
import { type UnixTimestamp } from '../_common/unix-timestamp.js'; import { z } from 'zod'; export declare const SimplifiedApexLocationSchema: z.ZodObject<{ _id: z.ZodString; created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>; updated_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>; } & { agency_id: z.ZodString; apex_version: z.ZodString; device_id: z.ZodString; line_id: z.ZodString; mac_ase_counter_value: z.ZodNumber; mac_sam_serial_number: z.ZodNumber; pattern_id: z.ZodString; received_at: z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">; stop_id: z.ZodString; trip_id: z.ZodString; vehicle_id: z.ZodString; }, "strict", z.ZodTypeAny, { _id: string; agency_id: string; stop_id: string; line_id: string; pattern_id: string; trip_id: string; apex_version: string; device_id: string; mac_ase_counter_value: number; mac_sam_serial_number: number; received_at: number & { __brand: "UnixTimestamp"; } & z.BRAND<"UnixTimestamp">; vehicle_id: string; created_at?: (number & { __brand: "UnixTimestamp"; } & z.BRAND<"UnixTimestamp">) | null | undefined; updated_at?: (number & { __brand: "UnixTimestamp"; } & z.BRAND<"UnixTimestamp">) | null | undefined; }, { _id: string; agency_id: string; stop_id: string; line_id: string; pattern_id: string; trip_id: string; apex_version: string; device_id: string; mac_ase_counter_value: number; mac_sam_serial_number: number; received_at: number; vehicle_id: string; created_at?: number | null | undefined; updated_at?: number | null | undefined; }>; export declare const UpdateSimplifiedApexLocationSchema: z.ZodObject<{ _id: z.ZodOptional<z.ZodString>; created_at: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>>; updated_at: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>>; agency_id: z.ZodOptional<z.ZodString>; apex_version: z.ZodOptional<z.ZodString>; device_id: z.ZodOptional<z.ZodString>; line_id: z.ZodOptional<z.ZodString>; mac_ase_counter_value: z.ZodOptional<z.ZodNumber>; mac_sam_serial_number: z.ZodOptional<z.ZodNumber>; pattern_id: z.ZodOptional<z.ZodString>; received_at: z.ZodOptional<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>; stop_id: z.ZodOptional<z.ZodString>; trip_id: z.ZodOptional<z.ZodString>; vehicle_id: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { _id?: string | undefined; created_at?: (number & { __brand: "UnixTimestamp"; } & z.BRAND<"UnixTimestamp">) | null | undefined; updated_at?: (number & { __brand: "UnixTimestamp"; } & z.BRAND<"UnixTimestamp">) | null | undefined; agency_id?: string | undefined; stop_id?: string | undefined; line_id?: string | undefined; pattern_id?: string | undefined; trip_id?: string | undefined; apex_version?: string | undefined; device_id?: string | undefined; mac_ase_counter_value?: number | undefined; mac_sam_serial_number?: number | undefined; received_at?: (number & { __brand: "UnixTimestamp"; } & z.BRAND<"UnixTimestamp">) | undefined; vehicle_id?: string | undefined; }, { _id?: string | undefined; created_at?: number | null | undefined; updated_at?: number | null | undefined; agency_id?: string | undefined; stop_id?: string | undefined; line_id?: string | undefined; pattern_id?: string | undefined; trip_id?: string | undefined; apex_version?: string | undefined; device_id?: string | undefined; mac_ase_counter_value?: number | undefined; mac_sam_serial_number?: number | undefined; received_at?: number | undefined; vehicle_id?: string | undefined; }>; /** * APEX Locations are APEX transactions of type 19 that are generated every time the * setContext or setLocation functions are called. These functions are used to set * the service context of the validator machine, allowing for the correct sale and validation * of products. In summary, these transactions are generated every time the vehicle has a change * in the current stop ID, trip ID, route ID, pattern ID, etc. */ export interface SimplifiedApexLocation extends Omit<z.infer<typeof SimplifiedApexLocationSchema>, 'created_at' | 'received_at' | 'updated_at'> { created_at: UnixTimestamp; received_at: UnixTimestamp; updated_at: UnixTimestamp; } export type UpdateSimplifiedApexLocationDto = Partial<SimplifiedApexLocation>;