@7365admin1/module-hygiene 4.22.0 → 4.23.1

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
@@ -2499,6 +2499,7 @@ function MParentChecklist(value) {
2499
2499
 
2500
2500
  // src/repositories/hygiene-parent-checklist.repository.ts
2501
2501
  import { ObjectId as ObjectId7 } from "mongodb";
2502
+ import moment2 from "moment-timezone";
2502
2503
  import {
2503
2504
  useAtlas as useAtlas5,
2504
2505
  InternalServerError as InternalServerError4,
@@ -2536,10 +2537,8 @@ function useParentChecklistRepo() {
2536
2537
  async function createParentChecklist(value, session) {
2537
2538
  try {
2538
2539
  const currentDate = value.createdAt ? new Date(value.createdAt) : /* @__PURE__ */ new Date();
2539
- const startOfDay = new Date(currentDate);
2540
- startOfDay.setUTCHours(0, 0, 0, 0);
2541
- const endOfDay = new Date(currentDate);
2542
- endOfDay.setUTCHours(23, 59, 59, 999);
2540
+ const startOfDay = moment2(currentDate).tz("Asia/Singapore").startOf("day").toDate();
2541
+ const endOfDay = moment2(currentDate).tz("Asia/Singapore").endOf("day").toDate();
2543
2542
  const allServiceTypes = Object.values(AppServiceType7);
2544
2543
  const dateStr = currentDate.toISOString().split("T")[0];
2545
2544
  if (value.site) {
@@ -2890,11 +2889,8 @@ function useParentChecklistRepo() {
2890
2889
  }
2891
2890
  }
2892
2891
  async function getTodayParentChecklists() {
2893
- const now = /* @__PURE__ */ new Date();
2894
- const start = new Date(now);
2895
- start.setUTCHours(0, 0, 0, 0);
2896
- const end = new Date(now);
2897
- end.setUTCHours(23, 59, 59, 999);
2892
+ const start = moment2().tz("Asia/Singapore").startOf("day").toDate();
2893
+ const end = moment2().tz("Asia/Singapore").endOf("day").toDate();
2898
2894
  try {
2899
2895
  const items = await collection.find(
2900
2896
  { createdAt: { $gte: start, $lte: end } },
@@ -2907,11 +2903,8 @@ function useParentChecklistRepo() {
2907
2903
  }
2908
2904
  }
2909
2905
  async function getTodayParentChecklistsForAreaGen() {
2910
- const now = /* @__PURE__ */ new Date();
2911
- const start = new Date(now);
2912
- start.setUTCHours(0, 0, 0, 0);
2913
- const end = new Date(now);
2914
- end.setUTCHours(23, 59, 59, 999);
2906
+ const start = moment2().tz("Asia/Singapore").startOf("day").toDate();
2907
+ const end = moment2().tz("Asia/Singapore").endOf("day").toDate();
2915
2908
  try {
2916
2909
  const items = await collection.find(
2917
2910
  {
@@ -4986,7 +4979,8 @@ var supplySchema = Joi10.object({
4986
4979
  site: Joi10.string().hex().required(),
4987
4980
  serviceType: Joi10.string().valid(...Object.values(AppServiceType11)).required(),
4988
4981
  name: Joi10.string().required(),
4989
- unitOfMeasurement: Joi10.string().required()
4982
+ unitOfMeasurement: Joi10.string().required(),
4983
+ attachment: Joi10.string().allow(null, "").optional()
4990
4984
  });
4991
4985
  function MSupply(value) {
4992
4986
  const { error } = supplySchema.validate(value);
@@ -5007,6 +5001,7 @@ function MSupply(value) {
5007
5001
  name: value.name,
5008
5002
  unitOfMeasurement: value.unitOfMeasurement,
5009
5003
  qty: 0,
5004
+ attachment: value.attachment,
5010
5005
  status: "active",
5011
5006
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
5012
5007
  updatedAt: "",
@@ -5127,6 +5122,7 @@ function useSupplyRepository() {
5127
5122
  { $match: query },
5128
5123
  {
5129
5124
  $project: {
5125
+ attachment: 1,
5130
5126
  name: 1,
5131
5127
  qty: 1,
5132
5128
  status: 1
@@ -5175,6 +5171,7 @@ function useSupplyRepository() {
5175
5171
  { $match: query },
5176
5172
  {
5177
5173
  $project: {
5174
+ attachment: 1,
5178
5175
  name: 1,
5179
5176
  unitOfMeasurement: 1,
5180
5177
  qty: 1
@@ -5363,7 +5360,8 @@ function useSupplyController() {
5363
5360
  id: Joi11.string().hex().required(),
5364
5361
  name: Joi11.string().optional().allow("", null),
5365
5362
  unitOfMeasurement: Joi11.string().optional().allow("", null),
5366
- qty: Joi11.number().min(0).optional().allow("", null)
5363
+ qty: Joi11.number().min(0).optional().allow("", null),
5364
+ attachment: Joi11.string().optional().allow("", null)
5367
5365
  });
5368
5366
  const { error } = validation.validate(payload);
5369
5367
  if (error) {