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.

37 lines (36 loc) 1.33 kB
/* * */ import { MongoCollectionClass } from '../../common/mongo-collection.js'; import { asyncSingletonProxy } from '@tmlmobilidade/utils'; /* * */ class SimplifiedApexInspectionsClass extends MongoCollectionClass { static _instance; constructor() { super(); } static async getInstance() { if (!SimplifiedApexInspectionsClass._instance) { const instance = new SimplifiedApexInspectionsClass(); await instance.connect(); SimplifiedApexInspectionsClass._instance = instance; } return SimplifiedApexInspectionsClass._instance; } getCollectionIndexes() { return [ { background: true, key: { created_at: 1 } }, { background: true, key: { received_at: 1 } }, { background: true, key: { agency_id: 1 } }, // eslint-disable-next-line perfectionist/sort-objects { background: true, key: { trip_id: 1, created_at: 1 } }, { background: true, key: { agency_id: 1, created_at: 1 } }, ]; } getCollectionName() { return 'simplified_apex_inspections'; } getEnvName() { return 'TML_INTERFACE_SIMPLIFIED_APEX_INSPECTIONS'; } } /* * */ export const simplifiedApexInspections = asyncSingletonProxy(SimplifiedApexInspectionsClass);