@tmlmobilidade/types
Version:
316 lines (315 loc) • 15.7 kB
TypeScript
import { z } from 'zod';
export declare const RIDE_ANALYSIS_GRADE_OPTIONS: readonly ["pass", "fail", "skip", "error"];
export declare const RideAnalysisGradeSchema: z.ZodEnum<["pass", "fail", "skip", "error"]>;
export type RideAnalysisGrade = z.infer<typeof RideAnalysisGradeSchema>;
export declare const RideAnalysisGradeWithNoneSchema: z.ZodUnion<[z.ZodEnum<["pass", "fail", "skip", "error"]>, z.ZodLiteral<"none">]>;
export type RideAnalysisGradeWithNone = z.infer<typeof RideAnalysisGradeWithNoneSchema>;
/**
* Schema for ride analysis summary.
*
* This schema represents a record where each key is a string and the value is an object
* containing:
* - grade: A value from the RideAnalysisGradeSchema, indicating the result of the analysis.
* - reason: A string providing the reason for the given grade.
*
* @example
* {
* TEST_1: { grade: 'failed', reason: 'TEST_REASON' },
* TEST_2: { grade: 'failed', reason: 'TEST_REASON' },
* }
*/
export declare const RideAnalysisSummarySchema: z.ZodRecord<z.ZodString, z.ZodObject<{
grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
reason: z.ZodString;
}, "strip", z.ZodTypeAny, {
grade: "error" | "pass" | "fail" | "skip";
reason: string;
}, {
grade: "error" | "pass" | "fail" | "skip";
reason: string;
}>>;
export type RideAnalysisSummary = z.infer<typeof RideAnalysisSummarySchema>;
export declare const RideAnalysisSchema: z.ZodObject<{
error_message: z.ZodOptional<z.ZodString>;
grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
reason: z.ZodString;
}, "strip", z.ZodTypeAny, {
grade: "error" | "pass" | "fail" | "skip";
reason: string;
error_message?: string | undefined;
}, {
grade: "error" | "pass" | "fail" | "skip";
reason: string;
error_message?: string | undefined;
}>;
export type RideAnalysis = z.infer<typeof RideAnalysisSchema>;
export declare const atLeastOneVehicleEventOnFirstStopSchema: z.ZodObject<{
error_message: z.ZodOptional<z.ZodString>;
grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
} & {
reason: z.ZodEnum<["NO_PATH_DATA", "NO_VEHICLE_EVENTS", "NO_VEHICLE_EVENTS_ON_FIRST_STOP", "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP"]>;
value: z.ZodNullable<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "NO_VEHICLE_EVENTS_ON_FIRST_STOP" | "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP";
error_message?: string | undefined;
}, {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "NO_VEHICLE_EVENTS_ON_FIRST_STOP" | "ONE_OR_MORE_VEHICLE_EVENTS_ON_FIRST_STOP";
error_message?: string | undefined;
}>;
export type AtLeastOneVehicleEventOnFirstStop = z.infer<typeof atLeastOneVehicleEventOnFirstStopSchema>;
export declare const expectedDriverIdQtySchema: z.ZodObject<{
error_message: z.ZodOptional<z.ZodString>;
grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
} & {
reason: z.ZodEnum<["NO_VEHICLE_EVENTS", "UNEXPECTED_DRIVER_ID_QTY", "EXPECTED_DRIVER_ID_QTY"]>;
value: z.ZodNullable<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
error_message?: string | undefined;
}, {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
error_message?: string | undefined;
}>;
export type ExpectedDriverIdQty = z.infer<typeof expectedDriverIdQtySchema>;
export declare const expectedVehicleIdQtySchema: z.ZodObject<{
error_message: z.ZodOptional<z.ZodString>;
grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
} & {
reason: z.ZodEnum<["NO_VEHICLE_EVENTS", "NO_APEX_VALIDATIONS", "UNEXPECTED_VEHICLE_ID_QTY", "EXPECTED_VEHICLE_ID_QTY"]>;
value: z.ZodNullable<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "NO_APEX_VALIDATIONS" | "UNEXPECTED_VEHICLE_ID_QTY" | "EXPECTED_VEHICLE_ID_QTY";
error_message?: string | undefined;
}, {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "NO_APEX_VALIDATIONS" | "UNEXPECTED_VEHICLE_ID_QTY" | "EXPECTED_VEHICLE_ID_QTY";
error_message?: string | undefined;
}>;
export type ExpectedVehicleIdQty = z.infer<typeof expectedVehicleIdQtySchema>;
export declare const expectedVehicleEventIntervalSchema: z.ZodObject<{
error_message: z.ZodOptional<z.ZodString>;
grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
} & {
reason: z.ZodEnum<["NO_VEHICLE_EVENTS", "EXPECTED_VEHICLE_EVENT_INTERVAL", "UNEXPECTED_VEHICLE_EVENT_INTERVAL"]>;
value: z.ZodNullable<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
error_message?: string | undefined;
}, {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
error_message?: string | undefined;
}>;
export type ExpectedVehicleEventInterval = z.infer<typeof expectedVehicleEventIntervalSchema>;
export declare const endedAtLastStopSchema: z.ZodObject<{
error_message: z.ZodOptional<z.ZodString>;
grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
} & {
reason: z.ZodEnum<["NO_PATH_DATA", "NO_VEHICLE_EVENTS", "ENDED_AT_LAST_STOP", "ENDED_OUTSIDE_OF_LAST_STOP"]>;
}, "strip", z.ZodTypeAny, {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "ENDED_AT_LAST_STOP" | "ENDED_OUTSIDE_OF_LAST_STOP";
error_message?: string | undefined;
}, {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "ENDED_AT_LAST_STOP" | "ENDED_OUTSIDE_OF_LAST_STOP";
error_message?: string | undefined;
}>;
export type EndedAtLastStop = z.infer<typeof endedAtLastStopSchema>;
export declare const expectedVehicleEventDelaySchema: z.ZodObject<{
error_message: z.ZodOptional<z.ZodString>;
grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
} & {
reason: z.ZodEnum<["NO_VEHICLE_EVENTS", "UNEXPECTED_VEHICLE_EVENTS_DELAY", "EXPECTED_VEHICLE_EVENTS_DELAY"]>;
value: z.ZodNullable<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
error_message?: string | undefined;
}, {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
error_message?: string | undefined;
}>;
export type ExpectedVehicleEventDelay = z.infer<typeof expectedVehicleEventDelaySchema>;
export declare const expectedVehicleEventQtySchema: z.ZodObject<{
error_message: z.ZodOptional<z.ZodString>;
grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
} & {
expected_qty: z.ZodNullable<z.ZodNumber>;
found_qty: z.ZodNullable<z.ZodNumber>;
reason: z.ZodEnum<["NO_PATH_DATA", "NO_VEHICLE_EVENTS", "EXPECTED_VEHICLE_EVENT_QTY", "UNEXPECTED_VEHICLE_EVENT_QTY"]>;
}, "strip", z.ZodTypeAny, {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_QTY" | "UNEXPECTED_VEHICLE_EVENT_QTY";
expected_qty: number | null;
found_qty: number | null;
error_message?: string | undefined;
}, {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_QTY" | "UNEXPECTED_VEHICLE_EVENT_QTY";
expected_qty: number | null;
found_qty: number | null;
error_message?: string | undefined;
}>;
export type ExpectedVehicleEventQty = z.infer<typeof expectedVehicleEventQtySchema>;
export declare const matchingApexLocationsSchema: z.ZodObject<{
error_message: z.ZodOptional<z.ZodString>;
grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
} & {
reason: z.ZodEnum<["NO_PATH_DATA", "NO_APEX_LOCATIONS", "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP", "MATCHING_APEX_LOCATIONS"]>;
}, "strip", z.ZodTypeAny, {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_PATH_DATA" | "NO_APEX_LOCATIONS" | "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP" | "MATCHING_APEX_LOCATIONS";
error_message?: string | undefined;
}, {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_PATH_DATA" | "NO_APEX_LOCATIONS" | "MISSING_APEX_LOCATION_FOR_AT_LEAST_ONE_STOP" | "MATCHING_APEX_LOCATIONS";
error_message?: string | undefined;
}>;
export type MatchingApexLocations = z.infer<typeof matchingApexLocationsSchema>;
export declare const expectedStartTimeSchema: z.ZodObject<{
error_message: z.ZodOptional<z.ZodString>;
grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
} & {
reason: z.ZodEnum<["NO_START_TIME_SCHEDULED", "NO_VEHICLE_EVENTS", "UNKNOWN_START", "EARLY_START", "LATE_START", "START_ON_TIME"]>;
value: z.ZodNullable<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "NO_START_TIME_SCHEDULED" | "UNKNOWN_START" | "EARLY_START" | "LATE_START" | "START_ON_TIME";
error_message?: string | undefined;
}, {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "NO_START_TIME_SCHEDULED" | "UNKNOWN_START" | "EARLY_START" | "LATE_START" | "START_ON_TIME";
error_message?: string | undefined;
}>;
export type ExpectedStartTime = z.infer<typeof expectedStartTimeSchema>;
export declare const simpleOneApexValidationSchema: z.ZodObject<{
error_message: z.ZodOptional<z.ZodString>;
grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
} & {
reason: z.ZodEnum<["NO_APEX_VALIDATIONS", "ONE_OR_MORE_APEX_VALIDATIONS"]>;
value: z.ZodNullable<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
error_message?: string | undefined;
}, {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
error_message?: string | undefined;
}>;
export type SimpleOneApexValidation = z.infer<typeof simpleOneApexValidationSchema>;
export declare const simpleOneVehicleEventOrApexValidationSchema: z.ZodObject<{
error_message: z.ZodOptional<z.ZodString>;
grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
} & {
reason: z.ZodEnum<["NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS", "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION"]>;
}, "strip", z.ZodTypeAny, {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
error_message?: string | undefined;
}, {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
error_message?: string | undefined;
}>;
export type SimpleOneVehicleEventOrApexValidation = z.infer<typeof simpleOneVehicleEventOrApexValidationSchema>;
export declare const simpleThreeVehicleEventsSchema: z.ZodObject<{
error_message: z.ZodOptional<z.ZodString>;
grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
} & {
reason: z.ZodEnum<["NO_PATH_DATA", "NO_VEHICLE_EVENTS", "MISSING_FIRST_STOPS", "MISSING_MIDDLE_STOPS", "MISSING_LAST_STOPS", "ALL_STOPS_FOUND"]>;
stop_ids_first: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
stop_ids_last: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
stop_ids_middle: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "MISSING_FIRST_STOPS" | "MISSING_MIDDLE_STOPS" | "MISSING_LAST_STOPS" | "ALL_STOPS_FOUND";
stop_ids_first: string[] | null;
stop_ids_last: string[] | null;
stop_ids_middle: string[] | null;
error_message?: string | undefined;
}, {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_PATH_DATA" | "NO_VEHICLE_EVENTS" | "MISSING_FIRST_STOPS" | "MISSING_MIDDLE_STOPS" | "MISSING_LAST_STOPS" | "ALL_STOPS_FOUND";
stop_ids_first: string[] | null;
stop_ids_last: string[] | null;
stop_ids_middle: string[] | null;
error_message?: string | undefined;
}>;
export type SimpleThreeVehicleEvents = z.infer<typeof simpleThreeVehicleEventsSchema>;
export declare const transactionSequentialitySchema: z.ZodObject<{
error_message: z.ZodOptional<z.ZodString>;
grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
} & {
expected_qty: z.ZodNullable<z.ZodNumber>;
found_qty: z.ZodNullable<z.ZodNumber>;
missing_qty: z.ZodNullable<z.ZodNumber>;
reason: z.ZodEnum<["NO_TRANSACTIONS", "MISSING_TRANSACTIONS", "ALL_TRANSACTIONS_RECEIVED"]>;
}, "strip", z.ZodTypeAny, {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_TRANSACTIONS" | "MISSING_TRANSACTIONS" | "ALL_TRANSACTIONS_RECEIVED";
expected_qty: number | null;
found_qty: number | null;
missing_qty: number | null;
error_message?: string | undefined;
}, {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_TRANSACTIONS" | "MISSING_TRANSACTIONS" | "ALL_TRANSACTIONS_RECEIVED";
expected_qty: number | null;
found_qty: number | null;
missing_qty: number | null;
error_message?: string | undefined;
}>;
export type TransactionSequentiality = z.infer<typeof transactionSequentialitySchema>;
export declare const matchingVehicleIdsSchema: z.ZodObject<{
error_message: z.ZodOptional<z.ZodString>;
grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
} & {
reason: z.ZodEnum<["MATCHING_VEHICLE_IDS", "VEHICLE_ID_MISMATCH", "NO_VEHICLE_EVENTS", "NO_APEX_TRANSACTIONS"]>;
}, "strip", z.ZodTypeAny, {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
error_message?: string | undefined;
}, {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
error_message?: string | undefined;
}>;
export type MatchingVehicleIds = z.infer<typeof matchingVehicleIdsSchema>;
export declare const expectedApexValidationIntervalSchema: z.ZodObject<{
error_message: z.ZodOptional<z.ZodString>;
grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
} & {
reason: z.ZodEnum<["NO_APEX_VALIDATIONS", "NOT_ENOUGH_VALIDATIONS", "INTERVALS_TOO_SHORT", "NON_ORGANIC_INTERVALS", "EXPECTED_VALIDATION_INTERVALS"]>;
}, "strip", z.ZodTypeAny, {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_APEX_VALIDATIONS" | "NOT_ENOUGH_VALIDATIONS" | "INTERVALS_TOO_SHORT" | "NON_ORGANIC_INTERVALS" | "EXPECTED_VALIDATION_INTERVALS";
error_message?: string | undefined;
}, {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_APEX_VALIDATIONS" | "NOT_ENOUGH_VALIDATIONS" | "INTERVALS_TOO_SHORT" | "NON_ORGANIC_INTERVALS" | "EXPECTED_VALIDATION_INTERVALS";
error_message?: string | undefined;
}>;
export type ExpectedApexValidationInterval = z.infer<typeof expectedApexValidationIntervalSchema>;