UNPKG

@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.

59 lines (58 loc) 2.32 kB
import { MongoCollectionClass } from '../../mongo-collection.js'; import { CreateRideDto, Ride, 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<Ride>[]>; /** * 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: string): Promise<import("mongodb").WithId<Ride>[]>; /** * 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<Ride>[]>; /** * 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<Ride>[]>; /** * 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<Ride>[]>; /** * 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<Ride>[]>; protected getCollectionIndexes(): IndexDescription[]; protected getCollectionName(): string; protected getEnvName(): string; } export declare const rides: RidesClass; export {};