@tmlmobilidade/interfaces 20250915.948.54 → 20250915.1015.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,16 @@
1
+ import { MongoCollectionClass } from '../../mongo-collection.js';
2
+ import { CreateRideJustificationDto, RideJustification, UpdateRideJustificationDto } from '@tmlmobilidade/types';
3
+ import { IndexDescription } from 'mongodb';
4
+ import { z } from 'zod';
5
+ declare class RideJustificationClass extends MongoCollectionClass<RideJustification, CreateRideJustificationDto, UpdateRideJustificationDto> {
6
+ private static _instance;
7
+ protected createSchema: z.ZodSchema;
8
+ protected updateSchema: z.ZodSchema;
9
+ private constructor();
10
+ static getInstance(): Promise<RideJustificationClass>;
11
+ protected getCollectionIndexes(): IndexDescription[];
12
+ protected getCollectionName(): string;
13
+ protected getEnvName(): string;
14
+ }
15
+ export declare const rideJustifications: RideJustificationClass;
16
+ export {};
@@ -0,0 +1,35 @@
1
+ /* * */
2
+ import { MongoCollectionClass } from '../../mongo-collection.js';
3
+ import { RideJustificationSchema, UpdateRideJustificationSchema } from '@tmlmobilidade/types';
4
+ import { AsyncSingletonProxy } from '@tmlmobilidade/utils';
5
+ /* * */
6
+ class RideJustificationClass extends MongoCollectionClass {
7
+ static _instance;
8
+ createSchema = RideJustificationSchema;
9
+ updateSchema = UpdateRideJustificationSchema;
10
+ constructor() {
11
+ super();
12
+ }
13
+ static async getInstance() {
14
+ if (!RideJustificationClass._instance) {
15
+ const instance = new RideJustificationClass();
16
+ await instance.connect();
17
+ RideJustificationClass._instance = instance;
18
+ }
19
+ return RideJustificationClass._instance;
20
+ }
21
+ getCollectionIndexes() {
22
+ return [
23
+ { background: true, key: { trip_id: 1 } },
24
+ { background: true, key: { acceptance_status: 1 } },
25
+ ];
26
+ }
27
+ getCollectionName() {
28
+ return 'ride_justifications';
29
+ }
30
+ getEnvName() {
31
+ return 'DATABASE_URI';
32
+ }
33
+ }
34
+ /* * */
35
+ export const rideJustifications = AsyncSingletonProxy(RideJustificationClass);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/interfaces",
3
- "version": "20250915.948.54",
3
+ "version": "20250915.1015.3",
4
4
  "author": "João de Vasconcelos & Jusi Monteiro",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "homepage": "https://github.com/tmlmobilidade/services#readme",