@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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @iservice365/core
2
2
 
3
+ ## 2.53.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 77eff04: release new/latest core package version (hot fix issue)
8
+
3
9
  ## 2.52.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -1854,7 +1854,7 @@ declare function useBuildingRepo(): {
1854
1854
  getById: (_id: string | ObjectId) => Promise<TBuilding | null>;
1855
1855
  updateById: (_id: ObjectId | string, value: Pick<TBuilding, "name" | "block" | "levels" | "buildingFiles">, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
1856
1856
  deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
1857
- getBuildingLevel: (site: string | ObjectId, block: number, isVMS: boolean) => Promise<bson.Document[] | TBuilding>;
1857
+ getBuildingLevel: (site: string | ObjectId, block: number) => Promise<mongodb.WithId<bson.Document> | TBuilding | null>;
1858
1858
  };
1859
1859
 
1860
1860
  declare function useBuildingService(): {
package/dist/index.js CHANGED
@@ -19481,7 +19481,7 @@ function useBuildingRepo() {
19481
19481
  }
19482
19482
  }
19483
19483
  }
19484
- async function getBuildingLevel(site, block, isVMS) {
19484
+ async function getBuildingLevel(site, block) {
19485
19485
  try {
19486
19486
  site = new import_mongodb49.ObjectId(site);
19487
19487
  } catch (error) {
@@ -19491,7 +19491,8 @@ function useBuildingRepo() {
19491
19491
  site,
19492
19492
  block
19493
19493
  };
19494
- const cacheKey = (0, import_node_server_utils82.makeCacheKey)(buildings_namespace_collection, { ...query, isVMS });
19494
+ const cacheOptions = { ...query };
19495
+ const cacheKey = (0, import_node_server_utils82.makeCacheKey)(buildings_namespace_collection, cacheOptions);
19495
19496
  try {
19496
19497
  const cached = await getCache(cacheKey);
19497
19498
  if (cached) {
@@ -19501,24 +19502,7 @@ function useBuildingRepo() {
19501
19502
  });
19502
19503
  return cached;
19503
19504
  }
19504
- const pipeline = [{ $match: { ...query } }];
19505
- if (isVMS) {
19506
- pipeline.push({
19507
- $lookup: {
19508
- from: "building-levels",
19509
- let: { id: "$_id" },
19510
- pipeline: [
19511
- {
19512
- $match: {
19513
- $expr: { $eq: ["$block", "$$id"] }
19514
- }
19515
- }
19516
- ],
19517
- as: "building_levels"
19518
- }
19519
- });
19520
- }
19521
- const result = await collection.aggregate(pipeline).toArray();
19505
+ const result = await collection.findOne(query);
19522
19506
  setCache(cacheKey, result, 300).then(() => {
19523
19507
  import_node_server_utils82.logger.log({
19524
19508
  level: "info",
@@ -19853,7 +19837,6 @@ function useBuildingController() {
19853
19837
  async function getBuildingLevel(req, res, next) {
19854
19838
  const site = req.params.site ?? "";
19855
19839
  let block = req.query.block;
19856
- const isVMS = req.query.isVMS;
19857
19840
  const validation = import_joi44.default.object({
19858
19841
  site: import_joi44.default.string().hex().required(),
19859
19842
  block: import_joi44.default.number().required()
@@ -19865,7 +19848,7 @@ function useBuildingController() {
19865
19848
  }
19866
19849
  block = parseInt(block) ?? 0;
19867
19850
  try {
19868
- const siteBlock = await _getBuildingLevel(site, block, isVMS);
19851
+ const siteBlock = await _getBuildingLevel(site, block);
19869
19852
  res.json(siteBlock);
19870
19853
  return;
19871
19854
  } catch (error2) {
@@ -20668,7 +20651,8 @@ function useVehicleController() {
20668
20651
  recNo: import_joi46.default.string().optional().allow(null, ""),
20669
20652
  type: import_joi46.default.string().optional().valid(...Object.values(VehicleType)).allow(null, ""),
20670
20653
  peopleId: import_joi46.default.string().hex().length(24).optional().allow(null, ""),
20671
- seasonPassType: import_joi46.default.string().optional().allow("", null)
20654
+ seasonPassType: import_joi46.default.string().optional().allow("", null),
20655
+ remarks: import_joi46.default.string().optional().allow("", null)
20672
20656
  });
20673
20657
  const { error, value } = schema2.validate(
20674
20658
  {