@7365admin1/core 3.52.19 → 3.53.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/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @iservice365/core
2
2
 
3
+ ## 3.53.1
4
+
5
+ ### Patch Changes
6
+
7
+ - bb5fb95: Scope the roles list to a site. `GET /api/roles` now accepts an optional `site`, and `role.repo.getRoles` filters on it: a role created on a site is listed only on that site, while roles with no site remain the organisation's own and stay visible on every site. `site` is part of the cache key. No stored document changes.
8
+
9
+ ## 3.53.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 525e85a: Add a guard invite path for visitors and contractors.
14
+
15
+ `POST /api/visitor-transactions/invite/:inviterId` is the resident app's
16
+ "invite to my unit" flow: it derives site, org, block, level and unit from the
17
+ inviter's `site.people` row. A guard has no such row, so the guard app's invite
18
+ screens could not use it — every request 400'd on the `site`/`org`/`nric` keys
19
+ they sent, and removing those keys would have written an invitation with no site
20
+ and no org.
21
+
22
+ Adds `schemaGuardInviteVisitor`, `inviteVisitorAsGuard` on the visitor
23
+ transaction service and controller, for a new `POST
24
+ /api/visitor-transactions/guard-invite` mount. The site comes from the request
25
+ and is checked with `requireSiteReach` before anything is written; `org` is read
26
+ off the resolved site; block/level/unit are null; the author is the session's
27
+ caller. The resident schema and flow are unchanged.
28
+
3
29
  ## 3.52.19
4
30
 
5
31
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -306,13 +306,14 @@ declare function useRoleRepo(): {
306
306
  getRoleByUserId: (value: string | ObjectId) => Promise<TRole | null>;
307
307
  getRoleById: (_id: string | ObjectId) => Promise<TRole | null>;
308
308
  getRoleByName: (name: string, type?: string) => Promise<TRole | null>;
309
- getRoles: ({ search, page, limit, sort, type, org, }: {
309
+ getRoles: ({ search, page, limit, sort, type, org, site, }: {
310
310
  search?: string | undefined;
311
311
  page?: number | undefined;
312
312
  limit?: number | undefined;
313
313
  sort?: any;
314
314
  type?: string | undefined;
315
315
  org: string | ObjectId;
316
+ site?: string | ObjectId | undefined;
316
317
  }) => Promise<{}>;
317
318
  getActiveByTypeOrg: (type: string, org: string | ObjectId) => Promise<TRole[]>;
318
319
  updateRole: (_id: string | ObjectId, value: TMiniRole, session?: ClientSession) => Promise<ObjectId>;
@@ -4909,7 +4910,7 @@ type TVisitorTransaction = {
4909
4910
  site?: string | ObjectId;
4910
4911
  plateNumber?: string;
4911
4912
  recNo?: string;
4912
- unitName?: string;
4913
+ unitName?: string | null;
4913
4914
  company?: string;
4914
4915
  deliveryType?: string;
4915
4916
  attachments?: string[];
@@ -4999,7 +5000,7 @@ declare function MVisitorTransaction(value: TVisitorTransaction): {
4999
5000
  passKeys: TKeyRef[];
5000
5001
  checkInRemarks: string | undefined;
5001
5002
  checkOutRemarks: string | undefined;
5002
- unitName: string | undefined;
5003
+ unitName: string | null | undefined;
5003
5004
  expiredAt: string | Date | null;
5004
5005
  createdAt: string | Date;
5005
5006
  updatedAt: string | Date;
@@ -5089,6 +5090,7 @@ declare function useVisitorTransactionService(): {
5089
5090
  updateVisitorTransactionById: (id: string | ObjectId, value: TVisitorTransaction) => Promise<string>;
5090
5091
  processTransactionDahuaStatus: () => Promise<void>;
5091
5092
  inviteVisitor: (value: TVisitorTransaction, userId: string) => Promise<ObjectId[]>;
5093
+ inviteVisitorAsGuard: (value: TVisitorTransaction, userId: string, siteId: string) => Promise<ObjectId[]>;
5092
5094
  createInvitedMemberDocuments: (leadId: string | ObjectId, status: VisitorStatus) => Promise<ObjectId[]>;
5093
5095
  deleteVisitorTransaction: (id: string) => Promise<void>;
5094
5096
  };
@@ -5102,6 +5104,7 @@ declare function useVisitorTransactionController(): {
5102
5104
  updateVisitorTansactionById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
5103
5105
  deleteVisitorTransaction: (req: Request, res: Response, next: NextFunction) => Promise<void>;
5104
5106
  inviteVisitor: (req: Request, res: Response, next: NextFunction) => Promise<void>;
5107
+ inviteVisitorAsGuard: (req: Request, res: Response, next: NextFunction) => Promise<void>;
5105
5108
  getVisitorTransactionById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
5106
5109
  };
5107
5110