@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.
187 lines (186 loc) • 7.91 kB
TypeScript
import { type UnixTimestamp } from '../_common/unix-timestamp.js';
import { z } from 'zod';
export declare const SimplifiedApexOnBoardSaleSchema: 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;
block_id: z.ZodNullable<z.ZodString>;
card_physical_type: z.ZodNumber;
card_serial_number: z.ZodString;
device_id: z.ZodString;
duty_id: z.ZodNullable<z.ZodString>;
is_passenger: z.ZodBoolean;
line_id: z.ZodNullable<z.ZodString>;
mac_ase_counter_value: z.ZodNumber;
mac_sam_serial_number: z.ZodNumber;
on_board_refund_id: z.ZodNullable<z.ZodString>;
pattern_id: z.ZodNullable<z.ZodString>;
payment_method: z.ZodNumber;
price: z.ZodNumber;
product_long_id: z.ZodString;
product_quantity: z.ZodNumber;
received_at: z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">;
stop_id: z.ZodNullable<z.ZodString>;
trip_id: z.ZodNullable<z.ZodString>;
validation_id: z.ZodNullable<z.ZodString>;
vehicle_id: z.ZodNullable<z.ZodString>;
}, "strict", z.ZodTypeAny, {
_id: string;
agency_id: string;
validation_id: string | null;
stop_id: string | null;
line_id: string | null;
pattern_id: string | null;
trip_id: string | null;
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 | null;
block_id: string | null;
card_physical_type: number;
card_serial_number: string;
duty_id: string | null;
payment_method: number;
price: number;
product_long_id: string;
product_quantity: number;
is_passenger: boolean;
on_board_refund_id: string | null;
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;
validation_id: string | null;
stop_id: string | null;
line_id: string | null;
pattern_id: string | null;
trip_id: string | null;
apex_version: string;
device_id: string;
mac_ase_counter_value: number;
mac_sam_serial_number: number;
received_at: number;
vehicle_id: string | null;
block_id: string | null;
card_physical_type: number;
card_serial_number: string;
duty_id: string | null;
payment_method: number;
price: number;
product_long_id: string;
product_quantity: number;
is_passenger: boolean;
on_board_refund_id: string | null;
created_at?: number | null | undefined;
updated_at?: number | null | undefined;
}>;
export declare const UpdateSimplifiedApexOnBoardSaleSchema: 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>;
block_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
card_physical_type: z.ZodOptional<z.ZodNumber>;
card_serial_number: z.ZodOptional<z.ZodString>;
device_id: z.ZodOptional<z.ZodString>;
duty_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
is_passenger: z.ZodOptional<z.ZodBoolean>;
line_id: z.ZodOptional<z.ZodNullable<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>>;
pattern_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
payment_method: z.ZodOptional<z.ZodNumber>;
price: z.ZodOptional<z.ZodNumber>;
product_long_id: z.ZodOptional<z.ZodString>;
product_quantity: z.ZodOptional<z.ZodNumber>;
received_at: z.ZodOptional<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>;
stop_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
trip_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
validation_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
vehicle_id: z.ZodOptional<z.ZodNullable<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;
validation_id?: string | null | undefined;
stop_id?: string | null | undefined;
line_id?: string | null | undefined;
pattern_id?: string | null | undefined;
trip_id?: string | null | 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 | null | undefined;
block_id?: string | null | undefined;
card_physical_type?: number | undefined;
card_serial_number?: string | undefined;
duty_id?: string | null | undefined;
payment_method?: number | undefined;
price?: number | undefined;
product_long_id?: string | undefined;
product_quantity?: number | undefined;
is_passenger?: boolean | undefined;
on_board_refund_id?: string | null | undefined;
}, {
_id?: string | undefined;
created_at?: number | null | undefined;
updated_at?: number | null | undefined;
agency_id?: string | undefined;
validation_id?: string | null | undefined;
stop_id?: string | null | undefined;
line_id?: string | null | undefined;
pattern_id?: string | null | undefined;
trip_id?: string | null | 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 | null | undefined;
block_id?: string | null | undefined;
card_physical_type?: number | undefined;
card_serial_number?: string | undefined;
duty_id?: string | null | undefined;
payment_method?: number | undefined;
price?: number | undefined;
product_long_id?: string | undefined;
product_quantity?: number | undefined;
is_passenger?: boolean | undefined;
on_board_refund_id?: string | null | undefined;
}>;
/**
* APEX OnBoard Sales are APEX transactions of type 3 that are generated whenever a sale
* of an on-board ticket occurs. Even though sales can be of anything (tickets, cards, contracts, merchandising items)
* and anywhere (inside vehicles, at vending machines, at ticket offices or online), here they are already filtered
* for on-board ticket sales inside vehicles only. Sales of tickets when inside vehicles also generate a validation transaction.
* Sales can be refunded, and refunds are also APEX transactions of type 3.
*/
export interface SimplifiedApexOnBoardSale extends Omit<z.infer<typeof SimplifiedApexOnBoardSaleSchema>, 'created_at' | 'received_at' | 'updated_at'> {
created_at: UnixTimestamp;
received_at: UnixTimestamp;
updated_at: UnixTimestamp;
}
export type UpdateSimplifiedApexOnBoardSaleDto = Partial<SimplifiedApexOnBoardSale>;