@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.
34 lines (33 loc) • 1.52 kB
TypeScript
import { MongoCollectionClass } from '../../mongo-collection.js';
import { CreateStopDto, Stop, UpdateStopDto } from '@tmlmobilidade/types';
import { IndexDescription, Sort } from 'mongodb';
import { z } from 'zod';
declare class StopsClass extends MongoCollectionClass<Stop, CreateStopDto, UpdateStopDto> {
private static _instance;
protected createSchema: z.ZodSchema;
protected updateSchema: z.ZodSchema;
private constructor();
static getInstance(): Promise<StopsClass>;
/**
* Finds stop documents by municipality ID with optional pagination and sorting.
*
* @param id - The municipality ID to search for
* @param perPage - Optional number of documents per page for pagination
* @param page - Optional page number for pagination
* @param sort - Optional sort specification
* @returns A promise that resolves to an array of matching stop documents
*/
findByMunicipalityId(id: string, perPage?: number, page?: number, sort?: Sort): Promise<import("mongodb").WithId<Stop>[]>;
/**
* Finds multiple stop documents by their IDs.
*
* @param ids - Array of stop IDs to search for
* @returns A promise that resolves to an array of matching stop documents
*/
findManyByIds(ids: string[]): Promise<import("mongodb").WithId<Stop>[]>;
protected getCollectionIndexes(): IndexDescription[];
protected getCollectionName(): string;
protected getEnvName(): string;
}
export declare const stops: StopsClass;
export {};