@tmlmobilidade/interfaces 20260716.2128.43 → 20260717.1316.58
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.
- package/dist/common/enrich-user-refs.js +2 -2
- package/dist/interfaces/file-exports/file-exports.d.ts +1 -1
- package/dist/interfaces/file-exports/file-exports.js +1 -1
- package/dist/interfaces/notifications/notifications.js +3 -3
- package/dist/interfaces/rides/rides.d.ts +6 -0
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { goDb } from '@tmlmobilidade/go-interfaces-godb';
|
|
2
2
|
import { UserDisplayFields } from '@tmlmobilidade/types';
|
|
3
3
|
const isUserRefKey = (k) => k === 'created_by' || k === 'updated_by';
|
|
4
4
|
const isEligibleId = (v) => typeof v === 'string' && v && v !== 'system';
|
|
@@ -39,7 +39,7 @@ function replaceRefs(input, map) {
|
|
|
39
39
|
async function fetchUsersMap(ids) {
|
|
40
40
|
if (ids.size === 0)
|
|
41
41
|
return new Map();
|
|
42
|
-
const coll = await
|
|
42
|
+
const coll = await goDb.core.users.getCollection();
|
|
43
43
|
// Only fetch UserDisplay fields
|
|
44
44
|
const projection = Object.keys(UserDisplayFields).reduce((acc, field) => {
|
|
45
45
|
acc[field] = 1;
|
|
@@ -14,7 +14,7 @@ declare class FileExportsClass extends MongoCollectionClass<FileExport, CreateFi
|
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* @deprecated This class is deprecated and will be removed in the future.
|
|
17
|
-
* Use `@tmlmobilidade/go-interfaces-
|
|
17
|
+
* Use `@tmlmobilidade/go-interfaces-godb` instead.
|
|
18
18
|
*/
|
|
19
19
|
export declare const fileExports: FileExportsClass;
|
|
20
20
|
export {};
|
|
@@ -42,6 +42,6 @@ class FileExportsClass extends MongoCollectionClass {
|
|
|
42
42
|
/* * */
|
|
43
43
|
/**
|
|
44
44
|
* @deprecated This class is deprecated and will be removed in the future.
|
|
45
|
-
* Use `@tmlmobilidade/go-interfaces-
|
|
45
|
+
* Use `@tmlmobilidade/go-interfaces-godb` instead.
|
|
46
46
|
*/
|
|
47
47
|
export const fileExports = asyncSingletonProxy(FileExportsClass);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* * */
|
|
2
2
|
import { MongoCollectionClass } from '../../common/mongo-collection.js';
|
|
3
3
|
import { getModuleConfig } from '@tmlmobilidade/consts';
|
|
4
|
-
import {
|
|
4
|
+
import { goDb } from '@tmlmobilidade/go-interfaces-godb';
|
|
5
5
|
import { CreateNotificationSchema, UpdateNotificationSchema } from '@tmlmobilidade/types';
|
|
6
6
|
import { asyncSingletonProxy, mergeObjects } from '@tmlmobilidade/utils';
|
|
7
7
|
/* * */
|
|
@@ -22,9 +22,9 @@ class NotificationsClass extends MongoCollectionClass {
|
|
|
22
22
|
}
|
|
23
23
|
async sendNotification(scope, topic, user, id, title, description) {
|
|
24
24
|
// Fetch roles and users that have access to this topic
|
|
25
|
-
const rolesWithTopic = await
|
|
25
|
+
const rolesWithTopic = await goDb.core.roles.findMany({ 'permissions.action': topic });
|
|
26
26
|
const roleIdsWithTopic = rolesWithTopic.map(r => r._id);
|
|
27
|
-
const usersWithTopic = await
|
|
27
|
+
const usersWithTopic = await goDb.core.users.findMany({
|
|
28
28
|
$or: [
|
|
29
29
|
{ 'permissions.action': topic },
|
|
30
30
|
{ role_ids: { $in: roleIdsWithTopic } },
|
|
@@ -60,6 +60,7 @@ declare class RidesClass extends MongoCollectionClass<Ride, CreateRideDto, Updat
|
|
|
60
60
|
apex_on_board_sales_amount: number | null;
|
|
61
61
|
apex_on_board_sales_qty: number | null;
|
|
62
62
|
apex_validations_qty: number | null;
|
|
63
|
+
direction_id: number;
|
|
63
64
|
analysis: {
|
|
64
65
|
EXPECTED_DRIVER_ID_QTY: {
|
|
65
66
|
value: number | null;
|
|
@@ -210,6 +211,7 @@ declare class RidesClass extends MongoCollectionClass<Ride, CreateRideDto, Updat
|
|
|
210
211
|
apex_on_board_sales_amount: number | null;
|
|
211
212
|
apex_on_board_sales_qty: number | null;
|
|
212
213
|
apex_validations_qty: number | null;
|
|
214
|
+
direction_id: number;
|
|
213
215
|
analysis: {
|
|
214
216
|
EXPECTED_DRIVER_ID_QTY: {
|
|
215
217
|
value: number | null;
|
|
@@ -360,6 +362,7 @@ declare class RidesClass extends MongoCollectionClass<Ride, CreateRideDto, Updat
|
|
|
360
362
|
apex_on_board_sales_amount: number | null;
|
|
361
363
|
apex_on_board_sales_qty: number | null;
|
|
362
364
|
apex_validations_qty: number | null;
|
|
365
|
+
direction_id: number;
|
|
363
366
|
analysis: {
|
|
364
367
|
EXPECTED_DRIVER_ID_QTY: {
|
|
365
368
|
value: number | null;
|
|
@@ -510,6 +513,7 @@ declare class RidesClass extends MongoCollectionClass<Ride, CreateRideDto, Updat
|
|
|
510
513
|
apex_on_board_sales_amount: number | null;
|
|
511
514
|
apex_on_board_sales_qty: number | null;
|
|
512
515
|
apex_validations_qty: number | null;
|
|
516
|
+
direction_id: number;
|
|
513
517
|
analysis: {
|
|
514
518
|
EXPECTED_DRIVER_ID_QTY: {
|
|
515
519
|
value: number | null;
|
|
@@ -660,6 +664,7 @@ declare class RidesClass extends MongoCollectionClass<Ride, CreateRideDto, Updat
|
|
|
660
664
|
apex_on_board_sales_amount: number | null;
|
|
661
665
|
apex_on_board_sales_qty: number | null;
|
|
662
666
|
apex_validations_qty: number | null;
|
|
667
|
+
direction_id: number;
|
|
663
668
|
analysis: {
|
|
664
669
|
EXPECTED_DRIVER_ID_QTY: {
|
|
665
670
|
value: number | null;
|
|
@@ -810,6 +815,7 @@ declare class RidesClass extends MongoCollectionClass<Ride, CreateRideDto, Updat
|
|
|
810
815
|
apex_on_board_sales_amount: number | null;
|
|
811
816
|
apex_on_board_sales_qty: number | null;
|
|
812
817
|
apex_validations_qty: number | null;
|
|
818
|
+
direction_id: number;
|
|
813
819
|
analysis: {
|
|
814
820
|
EXPECTED_DRIVER_ID_QTY: {
|
|
815
821
|
value: number | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tmlmobilidade/interfaces",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20260717.1316.58",
|
|
4
4
|
"author": {
|
|
5
5
|
"email": "iso@tmlmobilidade.pt",
|
|
6
6
|
"name": "TML-ISO"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@tmlmobilidade/databases": "*",
|
|
41
41
|
"@tmlmobilidade/dates": "*",
|
|
42
42
|
"@tmlmobilidade/files": "*",
|
|
43
|
-
"@tmlmobilidade/go-interfaces-
|
|
43
|
+
"@tmlmobilidade/go-interfaces-godb": "*",
|
|
44
44
|
"@tmlmobilidade/logger": "*",
|
|
45
45
|
"@tmlmobilidade/mongo": "*",
|
|
46
46
|
"@tmlmobilidade/ssh": "*",
|