@7365admin1/core 2.52.0 → 2.53.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
@@ -19314,7 +19314,7 @@ function useBuildingRepo() {
19314
19314
  }
19315
19315
  }
19316
19316
  }
19317
- async function getBuildingLevel(site, block, isVMS) {
19317
+ async function getBuildingLevel(site, block) {
19318
19318
  try {
19319
19319
  site = new ObjectId49(site);
19320
19320
  } catch (error) {
@@ -19324,7 +19324,8 @@ function useBuildingRepo() {
19324
19324
  site,
19325
19325
  block
19326
19326
  };
19327
- const cacheKey = makeCacheKey26(buildings_namespace_collection, { ...query, isVMS });
19327
+ const cacheOptions = { ...query };
19328
+ const cacheKey = makeCacheKey26(buildings_namespace_collection, cacheOptions);
19328
19329
  try {
19329
19330
  const cached = await getCache(cacheKey);
19330
19331
  if (cached) {
@@ -19334,24 +19335,7 @@ function useBuildingRepo() {
19334
19335
  });
19335
19336
  return cached;
19336
19337
  }
19337
- const pipeline = [{ $match: { ...query } }];
19338
- if (isVMS) {
19339
- pipeline.push({
19340
- $lookup: {
19341
- from: "building-levels",
19342
- let: { id: "$_id" },
19343
- pipeline: [
19344
- {
19345
- $match: {
19346
- $expr: { $eq: ["$block", "$$id"] }
19347
- }
19348
- }
19349
- ],
19350
- as: "building_levels"
19351
- }
19352
- });
19353
- }
19354
- const result = await collection.aggregate(pipeline).toArray();
19338
+ const result = await collection.findOne(query);
19355
19339
  setCache(cacheKey, result, 300).then(() => {
19356
19340
  logger60.log({
19357
19341
  level: "info",
@@ -19691,7 +19675,6 @@ function useBuildingController() {
19691
19675
  async function getBuildingLevel(req, res, next) {
19692
19676
  const site = req.params.site ?? "";
19693
19677
  let block = req.query.block;
19694
- const isVMS = req.query.isVMS;
19695
19678
  const validation = Joi44.object({
19696
19679
  site: Joi44.string().hex().required(),
19697
19680
  block: Joi44.number().required()
@@ -19703,7 +19686,7 @@ function useBuildingController() {
19703
19686
  }
19704
19687
  block = parseInt(block) ?? 0;
19705
19688
  try {
19706
- const siteBlock = await _getBuildingLevel(site, block, isVMS);
19689
+ const siteBlock = await _getBuildingLevel(site, block);
19707
19690
  res.json(siteBlock);
19708
19691
  return;
19709
19692
  } catch (error2) {
@@ -20511,7 +20494,8 @@ function useVehicleController() {
20511
20494
  recNo: Joi46.string().optional().allow(null, ""),
20512
20495
  type: Joi46.string().optional().valid(...Object.values(VehicleType)).allow(null, ""),
20513
20496
  peopleId: Joi46.string().hex().length(24).optional().allow(null, ""),
20514
- seasonPassType: Joi46.string().optional().allow("", null)
20497
+ seasonPassType: Joi46.string().optional().allow("", null),
20498
+ remarks: Joi46.string().optional().allow("", null)
20515
20499
  });
20516
20500
  const { error, value } = schema2.validate(
20517
20501
  {