@tmlmobilidade/interfaces 20250918.1816.45 → 20250919.1454.47
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.
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* * */
|
|
2
2
|
import { MongoCollectionClass } from '../../mongo-collection.js';
|
|
3
|
-
import {
|
|
3
|
+
import { OrganizationSchema, UpdateOrganizationSchema } from '@tmlmobilidade/types';
|
|
4
4
|
import { AsyncSingletonProxy } from '@tmlmobilidade/utils';
|
|
5
5
|
/* * */
|
|
6
6
|
class OrganizationsClass extends MongoCollectionClass {
|
|
7
7
|
static _instance;
|
|
8
|
-
createSchema =
|
|
8
|
+
createSchema = OrganizationSchema;
|
|
9
9
|
updateSchema = UpdateOrganizationSchema;
|
|
10
10
|
constructor() {
|
|
11
11
|
super();
|
|
@@ -50,6 +50,7 @@ class RideAcceptanceClass extends MongoCollectionClass {
|
|
|
50
50
|
prev_value: prevAcceptance[key],
|
|
51
51
|
type: 'field_changed',
|
|
52
52
|
updated_at: Dates.now('utc').unix_timestamp,
|
|
53
|
+
updated_by: data.updated_by || 'system',
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
56
|
if (key === 'acceptance_status') {
|
|
@@ -61,28 +62,19 @@ class RideAcceptanceClass extends MongoCollectionClass {
|
|
|
61
62
|
prev_value: prevAcceptance[key],
|
|
62
63
|
type: 'field_changed',
|
|
63
64
|
updated_at: Dates.now('utc').unix_timestamp,
|
|
65
|
+
updated_by: data.updated_by || 'system',
|
|
64
66
|
});
|
|
65
67
|
}
|
|
66
|
-
if (key === 'justification
|
|
68
|
+
if (key === 'justification' && data.justification) {
|
|
67
69
|
data.comments.push({
|
|
68
70
|
created_at: Dates.now('utc').unix_timestamp,
|
|
69
|
-
created_by: data.updated_by || 'system',
|
|
70
|
-
curr_value: data.justification
|
|
71
|
-
field: key,
|
|
72
|
-
prev_value: prevAcceptance.justification?.pto_message,
|
|
73
|
-
type: 'field_changed',
|
|
74
|
-
updated_at: Dates.now('utc').unix_timestamp,
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
if (key === 'justification.justification_cause' && data.justification?.justification_cause) {
|
|
78
|
-
data.comments.push({
|
|
79
|
-
created_at: Dates.now('utc').unix_timestamp,
|
|
80
|
-
created_by: data.updated_by || 'system',
|
|
81
|
-
curr_value: data.justification.justification_cause,
|
|
71
|
+
created_by: data.justification.updated_by || 'system',
|
|
72
|
+
curr_value: data.justification,
|
|
82
73
|
field: key,
|
|
83
|
-
prev_value: prevAcceptance.justification
|
|
74
|
+
prev_value: prevAcceptance.justification,
|
|
84
75
|
type: 'field_changed',
|
|
85
76
|
updated_at: Dates.now('utc').unix_timestamp,
|
|
77
|
+
updated_by: data.justification.updated_by || 'system',
|
|
86
78
|
});
|
|
87
79
|
}
|
|
88
80
|
}
|
package/package.json
CHANGED