@tmlmobilidade/interfaces 20250416.8.13 → 20250417.1235.11
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.
|
@@ -13,6 +13,7 @@ export * from './localities/localities.interface.js';
|
|
|
13
13
|
export * from './municipalities/municipalities.interface.js';
|
|
14
14
|
export * from './organizations/organizations.interface.js';
|
|
15
15
|
export * from './plans/plans.interface.js';
|
|
16
|
+
export * from './proposedChanges/proposedChanges.interface.js';
|
|
16
17
|
export * from './rides/rides.interface.js';
|
|
17
18
|
export * from './stops/stops.interface.js';
|
|
18
19
|
export * from './vehicle-events/vehicle-events.interface.js';
|
|
@@ -14,6 +14,7 @@ export * from './localities/localities.interface.js';
|
|
|
14
14
|
export * from './municipalities/municipalities.interface.js';
|
|
15
15
|
export * from './organizations/organizations.interface.js';
|
|
16
16
|
export * from './plans/plans.interface.js';
|
|
17
|
+
export * from './proposedChanges/proposedChanges.interface.js';
|
|
17
18
|
export * from './rides/rides.interface.js';
|
|
18
19
|
export * from './stops/stops.interface.js';
|
|
19
20
|
export * from './vehicle-events/vehicle-events.interface.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// /* * */
|
|
2
|
+
export {};
|
|
3
|
+
// import { MongoCollectionClass } from '../../mongo-collection.js';
|
|
4
|
+
// import { CreateProposedChangeDto, ProposedChange, ProposedChangeSchema, UpdateProposedChangeDto, UpdateProposedChangeSchema } from '@tmlmobilidade/types';
|
|
5
|
+
// import { AsyncSingletonProxy } from '@tmlmobilidade/utils';
|
|
6
|
+
// // import { Filter, IndexDescription, Sort } from 'mongodb';
|
|
7
|
+
// import { z } from 'zod';
|
|
8
|
+
// /* * */
|
|
9
|
+
// class ProposedChangesClass extends MongoCollectionClass<ProposedChange, CreateProposedChangeDto, UpdateProposedChangeDto> {
|
|
10
|
+
// private static _instance: ProposedChangesClass;
|
|
11
|
+
// protected override createSchema: z.ZodSchema = ProposedChangeSchema;
|
|
12
|
+
// protected override updateSchema: z.ZodSchema = UpdateProposedChangeSchema;
|
|
13
|
+
// private constructor() {
|
|
14
|
+
// super();
|
|
15
|
+
// }
|
|
16
|
+
// public static async getInstance() {
|
|
17
|
+
// if (!ProposedChangesClass._instance) {
|
|
18
|
+
// const instance = new ProposedChangesClass();
|
|
19
|
+
// await instance.connect();
|
|
20
|
+
// ProposedChangesClass._instance = instance;
|
|
21
|
+
// }
|
|
22
|
+
// return ProposedChangesClass._instance;
|
|
23
|
+
// }
|
|
24
|
+
// // /**
|
|
25
|
+
// // * Finds stop documents by municipality ID with optional pagination and sorting.
|
|
26
|
+
// // *
|
|
27
|
+
// // * @param id - The municipality ID to search for
|
|
28
|
+
// // * @param perPage - Optional number of documents per page for pagination
|
|
29
|
+
// // * @param page - Optional page number for pagination
|
|
30
|
+
// // * @param sort - Optional sort specification
|
|
31
|
+
// // * @returns A promise that resolves to an array of matching stop documents
|
|
32
|
+
// // */
|
|
33
|
+
// // async findByMunicipalityId(id: string, perPage?: number, page?: number, sort?: Sort) {
|
|
34
|
+
// // const query = this.mongoCollection.find({ municipality_id: id } as Filter<Stop>);
|
|
35
|
+
// // if (perPage) query.limit(perPage);
|
|
36
|
+
// // if (page && perPage) query.skip(perPage * (page - 1));
|
|
37
|
+
// // if (sort) query.sort(sort);
|
|
38
|
+
// // return query.toArray();
|
|
39
|
+
// // }
|
|
40
|
+
// // /**
|
|
41
|
+
// // * Finds multiple stop documents by their IDs.
|
|
42
|
+
// // *
|
|
43
|
+
// // * @param ids - Array of stop IDs to search for
|
|
44
|
+
// // * @returns A promise that resolves to an array of matching stop documents
|
|
45
|
+
// // */
|
|
46
|
+
// // async findManyByIds(ids: string[]) {
|
|
47
|
+
// // return this.mongoCollection.find({ _id: { $in: ids } } as Filter<Stop>).toArray();
|
|
48
|
+
// // }
|
|
49
|
+
// // protected getCollectionIndexes(): IndexDescription[] {
|
|
50
|
+
// // return [
|
|
51
|
+
// // { background: true, key: { name: 1 } },
|
|
52
|
+
// // ];
|
|
53
|
+
// // }
|
|
54
|
+
// // protected getCollectionName(): string {
|
|
55
|
+
// // return 'stops';
|
|
56
|
+
// // }
|
|
57
|
+
// // protected getEnvName(): string {
|
|
58
|
+
// // return 'TML_INTERFACE_STOPS';
|
|
59
|
+
// // }
|
|
60
|
+
// }
|
|
61
|
+
// /* * */
|
|
62
|
+
// export const proposedChanges = AsyncSingletonProxy(ProposedChangesClass);
|
package/package.json
CHANGED