@7365admin1/module-hygiene 4.9.0 → 4.10.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @7365admin1/module-hygiene
2
2
 
3
+ ## 4.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Update Hygiene App Enhancements
8
+
3
9
  ## 4.9.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.js CHANGED
@@ -2843,6 +2843,22 @@ function useAreaChecklistRepo() {
2843
2843
  preserveNullAndEmptyArrays: true
2844
2844
  }
2845
2845
  },
2846
+ {
2847
+ $addFields: {
2848
+ statusOrder: {
2849
+ $switch: {
2850
+ branches: [
2851
+ { case: { $eq: ["$status", "open"] }, then: 0 },
2852
+ { case: { $eq: ["$status", "ongoing"] }, then: 1 },
2853
+ { case: { $eq: ["$status", "completed"] }, then: 3 },
2854
+ { case: { $eq: ["$status", "closed"] }, then: 4 }
2855
+ ],
2856
+ default: 2
2857
+ }
2858
+ }
2859
+ }
2860
+ },
2861
+ { $sort: { statusOrder: 1, _id: -1 } },
2846
2862
  {
2847
2863
  $project: {
2848
2864
  name: 1,
@@ -2882,7 +2898,6 @@ function useAreaChecklistRepo() {
2882
2898
  createdByName: "$createdByDoc.name"
2883
2899
  }
2884
2900
  },
2885
- { $sort: { _id: -1 } },
2886
2901
  { $skip: page * limit },
2887
2902
  { $limit: limit }
2888
2903
  ];
@@ -3252,6 +3267,7 @@ function useAreaChecklistRepo() {
3252
3267
  name: "$checklist.units.name",
3253
3268
  approve: "$checklist.units.approve",
3254
3269
  reject: "$checklist.units.reject",
3270
+ timestamp: "$checklist.units.timestamp",
3255
3271
  status: {
3256
3272
  $switch: {
3257
3273
  branches: [
@@ -3286,6 +3302,7 @@ function useAreaChecklistRepo() {
3286
3302
  name: "$name",
3287
3303
  approve: "$approve",
3288
3304
  reject: "$reject",
3305
+ timestamp: "$timestamp",
3289
3306
  status: "$status",
3290
3307
  remarks: "$remarks",
3291
3308
  completedByName: "$completedByName"