UNPKG

@tmlmobilidade/types

Version:
467 lines (466 loc) • 15.7 kB
import { z } from 'zod'; export declare const ApexValidationStatus: { /** * VALID: * The card holder had a valid contract for the given context. */ readonly _0_ContractValid: 0; /** * INVALID: * The card holder already has a valid validation for the given context. */ readonly _1_Antipassback: 1; /** * INVALID: * The card holder's card is in the black list. */ readonly _2_CardInBlackList: 2; /** * INVALID: * The validator SAM is in the black list. */ readonly _3_SamInBlackList: 3; /** * VALID: * The card holder's card is in the white list. */ readonly _4_CardInWhiteList: 4; /** * VALID: * The card holder's profile is in the white list. */ readonly _5_ProfileInWhiteList: 5; /** * VALID: * The context allows for validation re-use. */ readonly _6_Interchange: 6; /** * INVALID: * The validation could not be written to the card. */ readonly _7_Interrupted: 7; /** * INVALID: * The card holder does not have a valid contract for the given context. */ readonly _8_NoValidContract: 8; /** * INVALID: * The card holder's card is invalidated. */ readonly _9_CardInvalidated: 9; /** * INVALID: * The card holder's card or the validator's SAM has no more space for events. */ readonly _10_EventsFull: 10; /** * INVALID: * The card holder's card does not have enough units for the given context. */ readonly _11_NotEnoughUnits: 11; /** * INVALID: * The card holder's contract has expired. */ readonly _12_ContractExpired: 12; /** * INVALID: * The maximum value for the validation status. This is used to validate the status. */ readonly _13_MaxValue: 13; }; export declare const ApexValidationStatusSchema: z.ZodNativeEnum<{ /** * VALID: * The card holder had a valid contract for the given context. */ readonly _0_ContractValid: 0; /** * INVALID: * The card holder already has a valid validation for the given context. */ readonly _1_Antipassback: 1; /** * INVALID: * The card holder's card is in the black list. */ readonly _2_CardInBlackList: 2; /** * INVALID: * The validator SAM is in the black list. */ readonly _3_SamInBlackList: 3; /** * VALID: * The card holder's card is in the white list. */ readonly _4_CardInWhiteList: 4; /** * VALID: * The card holder's profile is in the white list. */ readonly _5_ProfileInWhiteList: 5; /** * VALID: * The context allows for validation re-use. */ readonly _6_Interchange: 6; /** * INVALID: * The validation could not be written to the card. */ readonly _7_Interrupted: 7; /** * INVALID: * The card holder does not have a valid contract for the given context. */ readonly _8_NoValidContract: 8; /** * INVALID: * The card holder's card is invalidated. */ readonly _9_CardInvalidated: 9; /** * INVALID: * The card holder's card or the validator's SAM has no more space for events. */ readonly _10_EventsFull: 10; /** * INVALID: * The card holder's card does not have enough units for the given context. */ readonly _11_NotEnoughUnits: 11; /** * INVALID: * The card holder's contract has expired. */ readonly _12_ContractExpired: 12; /** * INVALID: * The maximum value for the validation status. This is used to validate the status. */ readonly _13_MaxValue: 13; }>; export declare const SimplifiedApexValidationSchema: z.ZodObject<Omit<{ _id: z.ZodString; created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>; created_by: z.ZodOptional<z.ZodString>; is_locked: z.ZodDefault<z.ZodBoolean>; updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>; updated_by: z.ZodOptional<z.ZodString>; }, "is_locked"> & { agency_id: z.ZodString; apex_version: z.ZodString; card_serial_number: z.ZodString; category: z.ZodEnum<["prepaid", "subscription", "on_board_sale"]>; device_id: z.ZodString; event_type: z.ZodNumber; is_passenger: z.ZodBoolean; line_id: z.ZodString; mac_ase_counter_value: z.ZodNumber; mac_sam_serial_number: z.ZodNumber; on_board_refund_id: z.ZodNullable<z.ZodString>; on_board_sale_id: z.ZodNullable<z.ZodString>; pattern_id: z.ZodString; product_id: z.ZodString; received_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>; stop_id: z.ZodString; trip_id: z.ZodString; units_qty: z.ZodNullable<z.ZodNumber>; validation_status: z.ZodNativeEnum<{ /** * VALID: * The card holder had a valid contract for the given context. */ readonly _0_ContractValid: 0; /** * INVALID: * The card holder already has a valid validation for the given context. */ readonly _1_Antipassback: 1; /** * INVALID: * The card holder's card is in the black list. */ readonly _2_CardInBlackList: 2; /** * INVALID: * The validator SAM is in the black list. */ readonly _3_SamInBlackList: 3; /** * VALID: * The card holder's card is in the white list. */ readonly _4_CardInWhiteList: 4; /** * VALID: * The card holder's profile is in the white list. */ readonly _5_ProfileInWhiteList: 5; /** * VALID: * The context allows for validation re-use. */ readonly _6_Interchange: 6; /** * INVALID: * The validation could not be written to the card. */ readonly _7_Interrupted: 7; /** * INVALID: * The card holder does not have a valid contract for the given context. */ readonly _8_NoValidContract: 8; /** * INVALID: * The card holder's card is invalidated. */ readonly _9_CardInvalidated: 9; /** * INVALID: * The card holder's card or the validator's SAM has no more space for events. */ readonly _10_EventsFull: 10; /** * INVALID: * The card holder's card does not have enough units for the given context. */ readonly _11_NotEnoughUnits: 11; /** * INVALID: * The card holder's contract has expired. */ readonly _12_ContractExpired: 12; /** * INVALID: * The maximum value for the validation status. This is used to validate the status. */ readonly _13_MaxValue: 13; }>; vehicle_id: z.ZodNumber; }, "strip", z.ZodTypeAny, { _id: string; created_at: number & { __brand: "UnixTimestamp"; }; updated_at: number & { __brand: "UnixTimestamp"; }; agency_id: string; apex_version: string; device_id: string; line_id: string; mac_ase_counter_value: number; mac_sam_serial_number: number; pattern_id: string; received_at: number & { __brand: "UnixTimestamp"; }; stop_id: string; trip_id: string; vehicle_id: number; card_serial_number: string; on_board_sale_id: string | null; is_passenger: boolean; on_board_refund_id: string | null; category: "on_board_sale" | "prepaid" | "subscription"; event_type: number; product_id: string; units_qty: number | null; validation_status: 0 | 1 | 2 | 12 | 5 | 4 | 3 | 6 | 11 | 7 | 8 | 9 | 10 | 13; created_by?: string | undefined; updated_by?: string | undefined; }, { _id: string; created_at: number; updated_at: number; agency_id: string; apex_version: string; device_id: string; line_id: string; mac_ase_counter_value: number; mac_sam_serial_number: number; pattern_id: string; received_at: number; stop_id: string; trip_id: string; vehicle_id: number; card_serial_number: string; on_board_sale_id: string | null; is_passenger: boolean; on_board_refund_id: string | null; category: "on_board_sale" | "prepaid" | "subscription"; event_type: number; product_id: string; units_qty: number | null; validation_status: 0 | 1 | 2 | 12 | 5 | 4 | 3 | 6 | 11 | 7 | 8 | 9 | 10 | 13; created_by?: string | undefined; updated_by?: string | undefined; }>; export declare const UpdateSimplifiedApexValidationSchema: z.ZodObject<{ _id: z.ZodOptional<z.ZodString>; created_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>; created_by: z.ZodOptional<z.ZodOptional<z.ZodString>>; updated_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>; updated_by: z.ZodOptional<z.ZodOptional<z.ZodString>>; agency_id: z.ZodOptional<z.ZodString>; apex_version: z.ZodOptional<z.ZodString>; card_serial_number: z.ZodOptional<z.ZodString>; category: z.ZodOptional<z.ZodEnum<["prepaid", "subscription", "on_board_sale"]>>; device_id: z.ZodOptional<z.ZodString>; event_type: z.ZodOptional<z.ZodNumber>; is_passenger: z.ZodOptional<z.ZodBoolean>; line_id: z.ZodOptional<z.ZodString>; mac_ase_counter_value: z.ZodOptional<z.ZodNumber>; mac_sam_serial_number: z.ZodOptional<z.ZodNumber>; on_board_refund_id: z.ZodOptional<z.ZodNullable<z.ZodString>>; on_board_sale_id: z.ZodOptional<z.ZodNullable<z.ZodString>>; pattern_id: z.ZodOptional<z.ZodString>; product_id: z.ZodOptional<z.ZodString>; received_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>; stop_id: z.ZodOptional<z.ZodString>; trip_id: z.ZodOptional<z.ZodString>; units_qty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>; validation_status: z.ZodOptional<z.ZodNativeEnum<{ /** * VALID: * The card holder had a valid contract for the given context. */ readonly _0_ContractValid: 0; /** * INVALID: * The card holder already has a valid validation for the given context. */ readonly _1_Antipassback: 1; /** * INVALID: * The card holder's card is in the black list. */ readonly _2_CardInBlackList: 2; /** * INVALID: * The validator SAM is in the black list. */ readonly _3_SamInBlackList: 3; /** * VALID: * The card holder's card is in the white list. */ readonly _4_CardInWhiteList: 4; /** * VALID: * The card holder's profile is in the white list. */ readonly _5_ProfileInWhiteList: 5; /** * VALID: * The context allows for validation re-use. */ readonly _6_Interchange: 6; /** * INVALID: * The validation could not be written to the card. */ readonly _7_Interrupted: 7; /** * INVALID: * The card holder does not have a valid contract for the given context. */ readonly _8_NoValidContract: 8; /** * INVALID: * The card holder's card is invalidated. */ readonly _9_CardInvalidated: 9; /** * INVALID: * The card holder's card or the validator's SAM has no more space for events. */ readonly _10_EventsFull: 10; /** * INVALID: * The card holder's card does not have enough units for the given context. */ readonly _11_NotEnoughUnits: 11; /** * INVALID: * The card holder's contract has expired. */ readonly _12_ContractExpired: 12; /** * INVALID: * The maximum value for the validation status. This is used to validate the status. */ readonly _13_MaxValue: 13; }>>; vehicle_id: z.ZodOptional<z.ZodNumber>; }, "strip", z.ZodTypeAny, { _id?: string | undefined; created_at?: import("../_common/unix-timestamp.js").UnixTimestamp | undefined; created_by?: string | undefined; updated_at?: import("../_common/unix-timestamp.js").UnixTimestamp | undefined; updated_by?: string | undefined; agency_id?: string | undefined; apex_version?: string | undefined; device_id?: string | undefined; line_id?: string | undefined; mac_ase_counter_value?: number | undefined; mac_sam_serial_number?: number | undefined; pattern_id?: string | undefined; received_at?: import("../_common/unix-timestamp.js").UnixTimestamp | undefined; stop_id?: string | undefined; trip_id?: string | undefined; vehicle_id?: number | undefined; card_serial_number?: string | undefined; on_board_sale_id?: string | null | undefined; is_passenger?: boolean | undefined; on_board_refund_id?: string | null | undefined; category?: "on_board_sale" | "prepaid" | "subscription" | undefined; event_type?: number | undefined; product_id?: string | undefined; units_qty?: number | null | undefined; validation_status?: 0 | 1 | 2 | 12 | 5 | 4 | 3 | 6 | 11 | 7 | 8 | 9 | 10 | 13 | undefined; }, { _id?: string | undefined; created_at?: number | undefined; created_by?: string | undefined; updated_at?: number | undefined; updated_by?: string | undefined; agency_id?: string | undefined; apex_version?: string | undefined; device_id?: string | undefined; line_id?: string | undefined; mac_ase_counter_value?: number | undefined; mac_sam_serial_number?: number | undefined; pattern_id?: string | undefined; received_at?: number | undefined; stop_id?: string | undefined; trip_id?: string | undefined; vehicle_id?: number | undefined; card_serial_number?: string | undefined; on_board_sale_id?: string | null | undefined; is_passenger?: boolean | undefined; on_board_refund_id?: string | null | undefined; category?: "on_board_sale" | "prepaid" | "subscription" | undefined; event_type?: number | undefined; product_id?: string | undefined; units_qty?: number | null | undefined; validation_status?: 0 | 1 | 2 | 12 | 5 | 4 | 3 | 6 | 11 | 7 | 8 | 9 | 10 | 13 | undefined; }>; /** * APEX Validations are APEX transactions of type 11 that are generated when a card holder touches a validator * reader (ex: bus validator, subway gate). These validation transactions represent the card holder's right to travel * on a given route, line, or vehicle. T11s have statuses that indicate if the card holder was allowed to travel * or not, and with which conditions. A validation also contains information about the card holder's card, the vehicle, * the validator machine, the route, and the time and location of the validation. */ export type SimplifiedApexValidation = z.infer<typeof SimplifiedApexValidationSchema>; export type UpdateSimplifiedApexValidationDto = z.infer<typeof UpdateSimplifiedApexValidationSchema>; /** * Validation statuses that are considered valid for the card holder to travel. */ export declare const ALLOWED_VALIDATION_STATUSES: (0 | 5 | 4 | 6)[];