@7365admin1/module-hygiene 4.23.0 → 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/dist/index.mjs CHANGED
@@ -3077,6 +3077,7 @@ function MAreaChecklist(value) {
3077
3077
  reject: false,
3078
3078
  status: "open",
3079
3079
  remarks: "",
3080
+ attachment: [],
3080
3081
  completedBy: "",
3081
3082
  timestamp: ""
3082
3083
  }))
@@ -3514,7 +3515,12 @@ function useAreaChecklistRepo() {
3514
3515
  },
3515
3516
  unit: "$checklist.units.unit",
3516
3517
  name: "$checklist.units.name",
3518
+ approve: "$checklist.units.approve",
3519
+ reject: "$checklist.units.reject",
3517
3520
  remarks: "$checklist.units.remarks",
3521
+ attachment: {
3522
+ $ifNull: ["$checklist.units.attachment", []]
3523
+ },
3518
3524
  status: {
3519
3525
  $switch: {
3520
3526
  branches: [
@@ -3547,8 +3553,11 @@ function useAreaChecklistRepo() {
3547
3553
  $push: {
3548
3554
  unit: "$unit",
3549
3555
  name: "$name",
3556
+ approve: "$approve",
3557
+ reject: "$reject",
3550
3558
  status: "$status",
3551
3559
  remarks: "$remarks",
3560
+ attachment: "$attachment",
3552
3561
  completedByName: "$completedByName",
3553
3562
  timestamp: "$timestamp"
3554
3563
  }
@@ -3700,6 +3709,10 @@ function useAreaChecklistRepo() {
3700
3709
  name: "$checklist.units.name",
3701
3710
  approve: "$checklist.units.approve",
3702
3711
  reject: "$checklist.units.reject",
3712
+ unitRemarks: "$checklist.units.remarks",
3713
+ unitAttachment: {
3714
+ $ifNull: ["$checklist.units.attachment", []]
3715
+ },
3703
3716
  timestamp: "$checklist.units.timestamp",
3704
3717
  status: {
3705
3718
  $switch: {
@@ -3739,7 +3752,8 @@ function useAreaChecklistRepo() {
3739
3752
  reject: "$reject",
3740
3753
  timestamp: "$timestamp",
3741
3754
  status: "$status",
3742
- remarks: "$remarks",
3755
+ remarks: "$unitRemarks",
3756
+ attachment: "$unitAttachment",
3743
3757
  completedByName: "$completedByName"
3744
3758
  }
3745
3759
  }
@@ -3887,16 +3901,13 @@ function useAreaChecklistRepo() {
3887
3901
  } else if (value.reject === true) {
3888
3902
  updateValue["checklist.$[checklist].units.$[unit].approve"] = false;
3889
3903
  updateValue["checklist.$[checklist].units.$[unit].reject"] = true;
3890
- updateValue["checklist.$[checklist].units.$[unit].status"] = "open";
3904
+ updateValue["checklist.$[checklist].units.$[unit].status"] = "completed";
3891
3905
  }
3892
- if (value.remarks) {
3893
- updateValue["checklist.$[checklist].units.$[unit].remarks"] = value.remarks;
3906
+ if (value.remarks !== void 0) {
3907
+ updateValue["checklist.$[checklist].units.$[unit].remarks"] = value.remarks ?? "";
3894
3908
  }
3895
- if (value.attachment) {
3896
- updateValue["checklist.$[checklist].attachment"] = value.attachment;
3897
- if (value.remarks) {
3898
- updateValue["checklist.$[checklist].remarks"] = value.remarks;
3899
- }
3909
+ if (value.attachment !== void 0) {
3910
+ updateValue["checklist.$[checklist].units.$[unit].attachment"] = value.attachment ?? [];
3900
3911
  }
3901
3912
  if (value.completedBy) {
3902
3913
  updateValue["checklist.$[checklist].units.$[unit].completedBy"] = new ObjectId9(value.completedBy);
@@ -4324,6 +4335,7 @@ function useAreaChecklistService() {
4324
4335
  reject: false,
4325
4336
  status: "open",
4326
4337
  remarks: "",
4338
+ attachment: [],
4327
4339
  completedBy: "",
4328
4340
  timestamp: ""
4329
4341
  }))
@@ -6797,6 +6809,7 @@ function useScheduleTaskService() {
6797
6809
  reject: false,
6798
6810
  status: "open",
6799
6811
  remarks: "",
6812
+ attachment: [],
6800
6813
  completedBy: "",
6801
6814
  timestamp: ""
6802
6815
  }));