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.

42 lines (41 loc) 1.71 kB
/* * */ import { MongoCollectionClass } from '../../mongo-collection.js'; import { AsyncSingletonProxy } from '@tmlmobilidade/utils'; /* * */ class SimplifiedApexOnBoardSalesClass extends MongoCollectionClass { static _instance; constructor() { super(); } static async getInstance() { if (!SimplifiedApexOnBoardSalesClass._instance) { const instance = new SimplifiedApexOnBoardSalesClass(); await instance.connect(); SimplifiedApexOnBoardSalesClass._instance = instance; } return SimplifiedApexOnBoardSalesClass._instance; } getCollectionIndexes() { return [ { background: true, key: { created_at: 1 } }, { background: true, key: { received_at: 1 } }, { background: true, key: { card_serial_number: 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 } }, { background: true, key: { validation_id: 1 } }, { background: true, key: { agency_id: 1, device_id: 1, mac_sam_serial_number: 1 } }, // eslint-disable-next-line perfectionist/sort-objects { background: true, key: { mac_sam_serial_number: 1, created_at: 1 } }, ]; } getCollectionName() { return 'simplified_apex_on_board_sales'; } getEnvName() { return 'TML_INTERFACE_SIMPLIFIED_APEX_ON_BOARD_SALES'; } } /* * */ export const simplifiedApexOnBoardSales = AsyncSingletonProxy(SimplifiedApexOnBoardSalesClass);