@tmlmobilidade/interfaces
Version:
This package provides SDK-style connectors for interacting with databases (e.g., stops, plans, rides, alerts) and external providers (e.g., authentication, storage). It simplifies data access and integration across projects.
917 lines (916 loc) • 44.8 kB
TypeScript
import { MongoCollectionClass } from '../../common/mongo-collection.js';
import { type CreateRideDto, type Ride, type UpdateRideDto } from '@tmlmobilidade/types';
import { IndexDescription } from 'mongodb';
import { z } from 'zod';
declare class RidesClass extends MongoCollectionClass<Ride, CreateRideDto, UpdateRideDto> {
private static _instance;
protected createSchema: z.ZodSchema;
protected updateSchema: z.ZodSchema;
private constructor();
static getInstance(): Promise<RidesClass>;
/**
* Finds ride documents by Agency ID.
*
* @param agencyId - The Agency ID to search for
* @returns A promise that resolves to an array of matching ride documents
*/
findByAgencyId(agencyId: string): Promise<import("mongodb").WithId<{
_id: string;
created_at: number & {
__brand: "UnixTimestamp";
};
created_by: string | null;
updated_at: number & {
__brand: "UnixTimestamp";
};
agency_id: string;
seen_last_at: import("@tmlmobilidade/types").UnixTimestamp | null;
headsign: string;
line_id: number;
route_id: string;
driver_ids: string[];
pattern_id: string;
plan_id: string;
trip_id: string;
vehicle_ids: number[];
operational_date: string & {
__brand: "OperationalDate";
};
start_time_observed: import("@tmlmobilidade/types").UnixTimestamp | null;
start_time_scheduled: number & {
__brand: "UnixTimestamp";
};
end_time_observed: import("@tmlmobilidade/types").UnixTimestamp | null;
end_time_scheduled: number & {
__brand: "UnixTimestamp";
};
extension_observed: number | null;
extension_scheduled: number;
seen_first_at: import("@tmlmobilidade/types").UnixTimestamp | null;
passengers_estimated: number | null;
passengers_observed: number | null;
passengers_observed_on_board_sales_amount: number | null;
passengers_observed_on_board_sales_qty: number | null;
passengers_observed_prepaid_amount: number | null;
passengers_observed_prepaid_qty: number | null;
passengers_observed_subscription_qty: number | null;
apex_locations_qty: number | null;
apex_on_board_refunds_amount: number | null;
apex_on_board_refunds_qty: number | null;
apex_on_board_sales_amount: number | null;
apex_on_board_sales_qty: number | null;
apex_validations_qty: number | null;
analysis: {
EXPECTED_DRIVER_ID_QTY: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
error_message?: string | undefined;
};
EXPECTED_VEHICLE_ID_QTY: {
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;
};
EXPECTED_VEHICLE_EVENT_INTERVAL: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
error_message?: string | undefined;
};
ENDED_AT_LAST_STOP: {
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;
};
EXPECTED_VEHICLE_EVENT_QTY: {
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;
};
MATCHING_APEX_LOCATIONS: {
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;
};
MATCHING_VEHICLE_IDS: {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
error_message?: string | undefined;
};
AT_LEAST_ONE_VEHICLE_EVENT_ON_FIRST_STOP: {
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;
};
EXPECTED_APEX_VALIDATION_INTERVAL: {
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;
};
EXPECTED_START_TIME: {
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;
};
EXPECTED_VEHICLE_EVENT_DELAY: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
error_message?: string | undefined;
};
SIMPLE_ONE_APEX_VALIDATION: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
error_message?: string | undefined;
};
SIMPLE_ONE_VEHICLE_EVENT_OR_APEX_VALIDATION: {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
error_message?: string | undefined;
};
SIMPLE_THREE_VEHICLE_EVENTS: {
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;
};
TRANSACTION_SEQUENTIALITY: {
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;
};
} | null;
hashed_pattern_id: string;
hashed_shape_id: string;
hashed_trip_id: string;
system_status: "error" | "waiting" | "processing" | "complete" | "skipped";
updated_by?: string | undefined;
}>[]>;
/**
* Finds ride documents by Line ID.
*
* @param lineId - The Line ID to search for
* @returns A promise that resolves to an array of matching ride documents
*/
findByLineId(lineId: number): Promise<import("mongodb").WithId<{
_id: string;
created_at: number & {
__brand: "UnixTimestamp";
};
created_by: string | null;
updated_at: number & {
__brand: "UnixTimestamp";
};
agency_id: string;
seen_last_at: import("@tmlmobilidade/types").UnixTimestamp | null;
headsign: string;
line_id: number;
route_id: string;
driver_ids: string[];
pattern_id: string;
plan_id: string;
trip_id: string;
vehicle_ids: number[];
operational_date: string & {
__brand: "OperationalDate";
};
start_time_observed: import("@tmlmobilidade/types").UnixTimestamp | null;
start_time_scheduled: number & {
__brand: "UnixTimestamp";
};
end_time_observed: import("@tmlmobilidade/types").UnixTimestamp | null;
end_time_scheduled: number & {
__brand: "UnixTimestamp";
};
extension_observed: number | null;
extension_scheduled: number;
seen_first_at: import("@tmlmobilidade/types").UnixTimestamp | null;
passengers_estimated: number | null;
passengers_observed: number | null;
passengers_observed_on_board_sales_amount: number | null;
passengers_observed_on_board_sales_qty: number | null;
passengers_observed_prepaid_amount: number | null;
passengers_observed_prepaid_qty: number | null;
passengers_observed_subscription_qty: number | null;
apex_locations_qty: number | null;
apex_on_board_refunds_amount: number | null;
apex_on_board_refunds_qty: number | null;
apex_on_board_sales_amount: number | null;
apex_on_board_sales_qty: number | null;
apex_validations_qty: number | null;
analysis: {
EXPECTED_DRIVER_ID_QTY: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
error_message?: string | undefined;
};
EXPECTED_VEHICLE_ID_QTY: {
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;
};
EXPECTED_VEHICLE_EVENT_INTERVAL: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
error_message?: string | undefined;
};
ENDED_AT_LAST_STOP: {
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;
};
EXPECTED_VEHICLE_EVENT_QTY: {
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;
};
MATCHING_APEX_LOCATIONS: {
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;
};
MATCHING_VEHICLE_IDS: {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
error_message?: string | undefined;
};
AT_LEAST_ONE_VEHICLE_EVENT_ON_FIRST_STOP: {
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;
};
EXPECTED_APEX_VALIDATION_INTERVAL: {
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;
};
EXPECTED_START_TIME: {
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;
};
EXPECTED_VEHICLE_EVENT_DELAY: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
error_message?: string | undefined;
};
SIMPLE_ONE_APEX_VALIDATION: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
error_message?: string | undefined;
};
SIMPLE_ONE_VEHICLE_EVENT_OR_APEX_VALIDATION: {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
error_message?: string | undefined;
};
SIMPLE_THREE_VEHICLE_EVENTS: {
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;
};
TRANSACTION_SEQUENTIALITY: {
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;
};
} | null;
hashed_pattern_id: string;
hashed_shape_id: string;
hashed_trip_id: string;
system_status: "error" | "waiting" | "processing" | "complete" | "skipped";
updated_by?: string | undefined;
}>[]>;
/**
* Finds ride documents by Pattern ID.
*
* @param patternId - The Pattern ID to search for
* @returns A promise that resolves to an array of matching ride documents
*/
findByPatternId(patternId: string): Promise<import("mongodb").WithId<{
_id: string;
created_at: number & {
__brand: "UnixTimestamp";
};
created_by: string | null;
updated_at: number & {
__brand: "UnixTimestamp";
};
agency_id: string;
seen_last_at: import("@tmlmobilidade/types").UnixTimestamp | null;
headsign: string;
line_id: number;
route_id: string;
driver_ids: string[];
pattern_id: string;
plan_id: string;
trip_id: string;
vehicle_ids: number[];
operational_date: string & {
__brand: "OperationalDate";
};
start_time_observed: import("@tmlmobilidade/types").UnixTimestamp | null;
start_time_scheduled: number & {
__brand: "UnixTimestamp";
};
end_time_observed: import("@tmlmobilidade/types").UnixTimestamp | null;
end_time_scheduled: number & {
__brand: "UnixTimestamp";
};
extension_observed: number | null;
extension_scheduled: number;
seen_first_at: import("@tmlmobilidade/types").UnixTimestamp | null;
passengers_estimated: number | null;
passengers_observed: number | null;
passengers_observed_on_board_sales_amount: number | null;
passengers_observed_on_board_sales_qty: number | null;
passengers_observed_prepaid_amount: number | null;
passengers_observed_prepaid_qty: number | null;
passengers_observed_subscription_qty: number | null;
apex_locations_qty: number | null;
apex_on_board_refunds_amount: number | null;
apex_on_board_refunds_qty: number | null;
apex_on_board_sales_amount: number | null;
apex_on_board_sales_qty: number | null;
apex_validations_qty: number | null;
analysis: {
EXPECTED_DRIVER_ID_QTY: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
error_message?: string | undefined;
};
EXPECTED_VEHICLE_ID_QTY: {
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;
};
EXPECTED_VEHICLE_EVENT_INTERVAL: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
error_message?: string | undefined;
};
ENDED_AT_LAST_STOP: {
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;
};
EXPECTED_VEHICLE_EVENT_QTY: {
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;
};
MATCHING_APEX_LOCATIONS: {
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;
};
MATCHING_VEHICLE_IDS: {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
error_message?: string | undefined;
};
AT_LEAST_ONE_VEHICLE_EVENT_ON_FIRST_STOP: {
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;
};
EXPECTED_APEX_VALIDATION_INTERVAL: {
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;
};
EXPECTED_START_TIME: {
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;
};
EXPECTED_VEHICLE_EVENT_DELAY: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
error_message?: string | undefined;
};
SIMPLE_ONE_APEX_VALIDATION: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
error_message?: string | undefined;
};
SIMPLE_ONE_VEHICLE_EVENT_OR_APEX_VALIDATION: {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
error_message?: string | undefined;
};
SIMPLE_THREE_VEHICLE_EVENTS: {
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;
};
TRANSACTION_SEQUENTIALITY: {
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;
};
} | null;
hashed_pattern_id: string;
hashed_shape_id: string;
hashed_trip_id: string;
system_status: "error" | "waiting" | "processing" | "complete" | "skipped";
updated_by?: string | undefined;
}>[]>;
/**
* Finds ride documents by Plan ID.
*
* @param planId - The Plan ID to search for
* @returns A promise that resolves to an array of matching ride documents
*/
findByPlanId(planId: string): Promise<import("mongodb").WithId<{
_id: string;
created_at: number & {
__brand: "UnixTimestamp";
};
created_by: string | null;
updated_at: number & {
__brand: "UnixTimestamp";
};
agency_id: string;
seen_last_at: import("@tmlmobilidade/types").UnixTimestamp | null;
headsign: string;
line_id: number;
route_id: string;
driver_ids: string[];
pattern_id: string;
plan_id: string;
trip_id: string;
vehicle_ids: number[];
operational_date: string & {
__brand: "OperationalDate";
};
start_time_observed: import("@tmlmobilidade/types").UnixTimestamp | null;
start_time_scheduled: number & {
__brand: "UnixTimestamp";
};
end_time_observed: import("@tmlmobilidade/types").UnixTimestamp | null;
end_time_scheduled: number & {
__brand: "UnixTimestamp";
};
extension_observed: number | null;
extension_scheduled: number;
seen_first_at: import("@tmlmobilidade/types").UnixTimestamp | null;
passengers_estimated: number | null;
passengers_observed: number | null;
passengers_observed_on_board_sales_amount: number | null;
passengers_observed_on_board_sales_qty: number | null;
passengers_observed_prepaid_amount: number | null;
passengers_observed_prepaid_qty: number | null;
passengers_observed_subscription_qty: number | null;
apex_locations_qty: number | null;
apex_on_board_refunds_amount: number | null;
apex_on_board_refunds_qty: number | null;
apex_on_board_sales_amount: number | null;
apex_on_board_sales_qty: number | null;
apex_validations_qty: number | null;
analysis: {
EXPECTED_DRIVER_ID_QTY: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
error_message?: string | undefined;
};
EXPECTED_VEHICLE_ID_QTY: {
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;
};
EXPECTED_VEHICLE_EVENT_INTERVAL: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
error_message?: string | undefined;
};
ENDED_AT_LAST_STOP: {
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;
};
EXPECTED_VEHICLE_EVENT_QTY: {
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;
};
MATCHING_APEX_LOCATIONS: {
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;
};
MATCHING_VEHICLE_IDS: {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
error_message?: string | undefined;
};
AT_LEAST_ONE_VEHICLE_EVENT_ON_FIRST_STOP: {
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;
};
EXPECTED_APEX_VALIDATION_INTERVAL: {
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;
};
EXPECTED_START_TIME: {
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;
};
EXPECTED_VEHICLE_EVENT_DELAY: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
error_message?: string | undefined;
};
SIMPLE_ONE_APEX_VALIDATION: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
error_message?: string | undefined;
};
SIMPLE_ONE_VEHICLE_EVENT_OR_APEX_VALIDATION: {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
error_message?: string | undefined;
};
SIMPLE_THREE_VEHICLE_EVENTS: {
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;
};
TRANSACTION_SEQUENTIALITY: {
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;
};
} | null;
hashed_pattern_id: string;
hashed_shape_id: string;
hashed_trip_id: string;
system_status: "error" | "waiting" | "processing" | "complete" | "skipped";
updated_by?: string | undefined;
}>[]>;
/**
* Finds ride documents by Route ID.
*
* @param routeId - The Route ID to search for
* @returns A promise that resolves to an array of matching ride documents
*/
findByRouteId(routeId: string): Promise<import("mongodb").WithId<{
_id: string;
created_at: number & {
__brand: "UnixTimestamp";
};
created_by: string | null;
updated_at: number & {
__brand: "UnixTimestamp";
};
agency_id: string;
seen_last_at: import("@tmlmobilidade/types").UnixTimestamp | null;
headsign: string;
line_id: number;
route_id: string;
driver_ids: string[];
pattern_id: string;
plan_id: string;
trip_id: string;
vehicle_ids: number[];
operational_date: string & {
__brand: "OperationalDate";
};
start_time_observed: import("@tmlmobilidade/types").UnixTimestamp | null;
start_time_scheduled: number & {
__brand: "UnixTimestamp";
};
end_time_observed: import("@tmlmobilidade/types").UnixTimestamp | null;
end_time_scheduled: number & {
__brand: "UnixTimestamp";
};
extension_observed: number | null;
extension_scheduled: number;
seen_first_at: import("@tmlmobilidade/types").UnixTimestamp | null;
passengers_estimated: number | null;
passengers_observed: number | null;
passengers_observed_on_board_sales_amount: number | null;
passengers_observed_on_board_sales_qty: number | null;
passengers_observed_prepaid_amount: number | null;
passengers_observed_prepaid_qty: number | null;
passengers_observed_subscription_qty: number | null;
apex_locations_qty: number | null;
apex_on_board_refunds_amount: number | null;
apex_on_board_refunds_qty: number | null;
apex_on_board_sales_amount: number | null;
apex_on_board_sales_qty: number | null;
apex_validations_qty: number | null;
analysis: {
EXPECTED_DRIVER_ID_QTY: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
error_message?: string | undefined;
};
EXPECTED_VEHICLE_ID_QTY: {
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;
};
EXPECTED_VEHICLE_EVENT_INTERVAL: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
error_message?: string | undefined;
};
ENDED_AT_LAST_STOP: {
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;
};
EXPECTED_VEHICLE_EVENT_QTY: {
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;
};
MATCHING_APEX_LOCATIONS: {
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;
};
MATCHING_VEHICLE_IDS: {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
error_message?: string | undefined;
};
AT_LEAST_ONE_VEHICLE_EVENT_ON_FIRST_STOP: {
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;
};
EXPECTED_APEX_VALIDATION_INTERVAL: {
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;
};
EXPECTED_START_TIME: {
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;
};
EXPECTED_VEHICLE_EVENT_DELAY: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
error_message?: string | undefined;
};
SIMPLE_ONE_APEX_VALIDATION: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
error_message?: string | undefined;
};
SIMPLE_ONE_VEHICLE_EVENT_OR_APEX_VALIDATION: {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
error_message?: string | undefined;
};
SIMPLE_THREE_VEHICLE_EVENTS: {
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;
};
TRANSACTION_SEQUENTIALITY: {
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;
};
} | null;
hashed_pattern_id: string;
hashed_shape_id: string;
hashed_trip_id: string;
system_status: "error" | "waiting" | "processing" | "complete" | "skipped";
updated_by?: string | undefined;
}>[]>;
/**
* Finds ride documents by Trip ID.
*
* @param tripId - The Trip ID to search for
* @returns A promise that resolves to an array of matching ride documents
*/
findByTripId(tripId: string): Promise<import("mongodb").WithId<{
_id: string;
created_at: number & {
__brand: "UnixTimestamp";
};
created_by: string | null;
updated_at: number & {
__brand: "UnixTimestamp";
};
agency_id: string;
seen_last_at: import("@tmlmobilidade/types").UnixTimestamp | null;
headsign: string;
line_id: number;
route_id: string;
driver_ids: string[];
pattern_id: string;
plan_id: string;
trip_id: string;
vehicle_ids: number[];
operational_date: string & {
__brand: "OperationalDate";
};
start_time_observed: import("@tmlmobilidade/types").UnixTimestamp | null;
start_time_scheduled: number & {
__brand: "UnixTimestamp";
};
end_time_observed: import("@tmlmobilidade/types").UnixTimestamp | null;
end_time_scheduled: number & {
__brand: "UnixTimestamp";
};
extension_observed: number | null;
extension_scheduled: number;
seen_first_at: import("@tmlmobilidade/types").UnixTimestamp | null;
passengers_estimated: number | null;
passengers_observed: number | null;
passengers_observed_on_board_sales_amount: number | null;
passengers_observed_on_board_sales_qty: number | null;
passengers_observed_prepaid_amount: number | null;
passengers_observed_prepaid_qty: number | null;
passengers_observed_subscription_qty: number | null;
apex_locations_qty: number | null;
apex_on_board_refunds_amount: number | null;
apex_on_board_refunds_qty: number | null;
apex_on_board_sales_amount: number | null;
apex_on_board_sales_qty: number | null;
apex_validations_qty: number | null;
analysis: {
EXPECTED_DRIVER_ID_QTY: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_DRIVER_ID_QTY" | "EXPECTED_DRIVER_ID_QTY";
error_message?: string | undefined;
};
EXPECTED_VEHICLE_ID_QTY: {
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;
};
EXPECTED_VEHICLE_EVENT_INTERVAL: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "EXPECTED_VEHICLE_EVENT_INTERVAL" | "UNEXPECTED_VEHICLE_EVENT_INTERVAL";
error_message?: string | undefined;
};
ENDED_AT_LAST_STOP: {
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;
};
EXPECTED_VEHICLE_EVENT_QTY: {
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;
};
MATCHING_APEX_LOCATIONS: {
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;
};
MATCHING_VEHICLE_IDS: {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "MATCHING_VEHICLE_IDS" | "VEHICLE_ID_MISMATCH" | "NO_APEX_TRANSACTIONS";
error_message?: string | undefined;
};
AT_LEAST_ONE_VEHICLE_EVENT_ON_FIRST_STOP: {
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;
};
EXPECTED_APEX_VALIDATION_INTERVAL: {
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;
};
EXPECTED_START_TIME: {
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;
};
EXPECTED_VEHICLE_EVENT_DELAY: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS" | "UNEXPECTED_VEHICLE_EVENTS_DELAY" | "EXPECTED_VEHICLE_EVENTS_DELAY";
error_message?: string | undefined;
};
SIMPLE_ONE_APEX_VALIDATION: {
value: number | null;
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_APEX_VALIDATIONS" | "ONE_OR_MORE_APEX_VALIDATIONS";
error_message?: string | undefined;
};
SIMPLE_ONE_VEHICLE_EVENT_OR_APEX_VALIDATION: {
grade: "error" | "pass" | "fail" | "skip";
reason: "NO_VEHICLE_EVENTS_OR_APEX_VALIDATIONS" | "FOUND_VEHICLE_EVENT_OR_APEX_VALIDATION";
error_message?: string | undefined;
};
SIMPLE_THREE_VEHICLE_EVENTS: {
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;
};
TRANSACTION_SEQUENTIALITY: {
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;
};
} | null;
hashed_pattern_id: string;
hashed_shape_id: string;
hashed_trip_id: string;
system_status: "error" | "waiting" | "processing" | "complete" | "skipped";
updated_by?: string | undefined;
}>[]>;
protected getCollectionIndexes(): IndexDescription[];
protected getCollectionName(): string;
protected getEnvName(): string;
}
export declare const rides: RidesClass;
export {};