@7365admin1/module-hygiene 4.23.1 → 4.24.0
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/CHANGELOG.md +6 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +22 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -287,6 +287,7 @@ type TAreaChecklistUnits = {
|
|
|
287
287
|
reject?: boolean;
|
|
288
288
|
status?: (typeof allowedChecklistStatus)[number];
|
|
289
289
|
remarks?: string;
|
|
290
|
+
attachment?: string[];
|
|
290
291
|
completedBy?: string | ObjectId;
|
|
291
292
|
timestamp?: Date | string;
|
|
292
293
|
};
|
|
@@ -302,7 +303,7 @@ type TCleaningScheduleAreaGetQuery = {
|
|
|
302
303
|
status?: (typeof allowedStatus)[number] | "all";
|
|
303
304
|
} & Pick<TCleaningScheduleArea, "schedule" | "serviceType">;
|
|
304
305
|
type TAreaChecklistUpdate = Pick<TCleaningScheduleArea, "checklist">;
|
|
305
|
-
type TAreaChecklistUnitsUpdate = Pick<TAreaChecklistUnits, "approve" | "reject" | "remarks" | "
|
|
306
|
+
type TAreaChecklistUnitsUpdate = Pick<TAreaChecklistUnits, "approve" | "reject" | "remarks" | "attachment" | "completedBy">;
|
|
306
307
|
declare const areaChecklistSchema: Joi.ObjectSchema<any>;
|
|
307
308
|
declare function MAreaChecklist(value: TAreaChecklistCreate): {
|
|
308
309
|
schedule: string | ObjectId;
|
package/dist/index.js
CHANGED
|
@@ -3119,6 +3119,7 @@ function MAreaChecklist(value) {
|
|
|
3119
3119
|
reject: false,
|
|
3120
3120
|
status: "open",
|
|
3121
3121
|
remarks: "",
|
|
3122
|
+
attachment: [],
|
|
3122
3123
|
completedBy: "",
|
|
3123
3124
|
timestamp: ""
|
|
3124
3125
|
}))
|
|
@@ -3544,7 +3545,12 @@ function useAreaChecklistRepo() {
|
|
|
3544
3545
|
},
|
|
3545
3546
|
unit: "$checklist.units.unit",
|
|
3546
3547
|
name: "$checklist.units.name",
|
|
3548
|
+
approve: "$checklist.units.approve",
|
|
3549
|
+
reject: "$checklist.units.reject",
|
|
3547
3550
|
remarks: "$checklist.units.remarks",
|
|
3551
|
+
attachment: {
|
|
3552
|
+
$ifNull: ["$checklist.units.attachment", []]
|
|
3553
|
+
},
|
|
3548
3554
|
status: {
|
|
3549
3555
|
$switch: {
|
|
3550
3556
|
branches: [
|
|
@@ -3577,8 +3583,11 @@ function useAreaChecklistRepo() {
|
|
|
3577
3583
|
$push: {
|
|
3578
3584
|
unit: "$unit",
|
|
3579
3585
|
name: "$name",
|
|
3586
|
+
approve: "$approve",
|
|
3587
|
+
reject: "$reject",
|
|
3580
3588
|
status: "$status",
|
|
3581
3589
|
remarks: "$remarks",
|
|
3590
|
+
attachment: "$attachment",
|
|
3582
3591
|
completedByName: "$completedByName",
|
|
3583
3592
|
timestamp: "$timestamp"
|
|
3584
3593
|
}
|
|
@@ -3730,6 +3739,10 @@ function useAreaChecklistRepo() {
|
|
|
3730
3739
|
name: "$checklist.units.name",
|
|
3731
3740
|
approve: "$checklist.units.approve",
|
|
3732
3741
|
reject: "$checklist.units.reject",
|
|
3742
|
+
unitRemarks: "$checklist.units.remarks",
|
|
3743
|
+
unitAttachment: {
|
|
3744
|
+
$ifNull: ["$checklist.units.attachment", []]
|
|
3745
|
+
},
|
|
3733
3746
|
timestamp: "$checklist.units.timestamp",
|
|
3734
3747
|
status: {
|
|
3735
3748
|
$switch: {
|
|
@@ -3769,7 +3782,8 @@ function useAreaChecklistRepo() {
|
|
|
3769
3782
|
reject: "$reject",
|
|
3770
3783
|
timestamp: "$timestamp",
|
|
3771
3784
|
status: "$status",
|
|
3772
|
-
remarks: "$
|
|
3785
|
+
remarks: "$unitRemarks",
|
|
3786
|
+
attachment: "$unitAttachment",
|
|
3773
3787
|
completedByName: "$completedByName"
|
|
3774
3788
|
}
|
|
3775
3789
|
}
|
|
@@ -3917,16 +3931,13 @@ function useAreaChecklistRepo() {
|
|
|
3917
3931
|
} else if (value.reject === true) {
|
|
3918
3932
|
updateValue["checklist.$[checklist].units.$[unit].approve"] = false;
|
|
3919
3933
|
updateValue["checklist.$[checklist].units.$[unit].reject"] = true;
|
|
3920
|
-
updateValue["checklist.$[checklist].units.$[unit].status"] = "
|
|
3934
|
+
updateValue["checklist.$[checklist].units.$[unit].status"] = "completed";
|
|
3921
3935
|
}
|
|
3922
|
-
if (value.remarks) {
|
|
3923
|
-
updateValue["checklist.$[checklist].units.$[unit].remarks"] = value.remarks;
|
|
3936
|
+
if (value.remarks !== void 0) {
|
|
3937
|
+
updateValue["checklist.$[checklist].units.$[unit].remarks"] = value.remarks ?? "";
|
|
3924
3938
|
}
|
|
3925
|
-
if (value.attachment) {
|
|
3926
|
-
updateValue["checklist.$[checklist].attachment"] = value.attachment;
|
|
3927
|
-
if (value.remarks) {
|
|
3928
|
-
updateValue["checklist.$[checklist].remarks"] = value.remarks;
|
|
3929
|
-
}
|
|
3939
|
+
if (value.attachment !== void 0) {
|
|
3940
|
+
updateValue["checklist.$[checklist].units.$[unit].attachment"] = value.attachment ?? [];
|
|
3930
3941
|
}
|
|
3931
3942
|
if (value.completedBy) {
|
|
3932
3943
|
updateValue["checklist.$[checklist].units.$[unit].completedBy"] = new import_mongodb9.ObjectId(value.completedBy);
|
|
@@ -4354,6 +4365,7 @@ function useAreaChecklistService() {
|
|
|
4354
4365
|
reject: false,
|
|
4355
4366
|
status: "open",
|
|
4356
4367
|
remarks: "",
|
|
4368
|
+
attachment: [],
|
|
4357
4369
|
completedBy: "",
|
|
4358
4370
|
timestamp: ""
|
|
4359
4371
|
}))
|
|
@@ -6784,6 +6796,7 @@ function useScheduleTaskService() {
|
|
|
6784
6796
|
reject: false,
|
|
6785
6797
|
status: "open",
|
|
6786
6798
|
remarks: "",
|
|
6799
|
+
attachment: [],
|
|
6787
6800
|
completedBy: "",
|
|
6788
6801
|
timestamp: ""
|
|
6789
6802
|
}));
|