@7365admin1/core 3.127.2-staging.425 → 3.127.2-staging.426

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.
@@ -0,0 +1,9 @@
1
+ ---
2
+ "@7365admin1/core": minor
3
+ ---
4
+
5
+ NFC patrol tags: adding a tag works again, and tags can be deleted.
6
+
7
+ - `POST /api/nfc-patrol-tag` validates against the tag schema (`site`, `tagID`, `name`) again, and stores `createdBy`. Since 6b05b41 it validated against the patrol-log schema, so every add from the web apps' NFC Management panel was refused with a 400.
8
+ - New `useNfcPatrolTagController().deleteById` for `DELETE /api/nfc-patrol-tag/:id`, with the same site check as `GET /:id`. A tag that a route at the site still uses as a checkpoint is refused with a 400 naming those routes. A deleted tag's ID and name can be used again; patrol logs keep their own copy of the tag's name.
9
+ - New `useNfcPatrolRouteRepo().getNamesByCheckpointTag`.
package/dist/index.d.ts CHANGED
@@ -14380,6 +14380,7 @@ declare function MNfcPatrolTag(value: TNfcPatrolTag): {
14380
14380
  declare function useNfcPatrolTagService(): {
14381
14381
  add: (value: TNfcPatrolTag) => Promise<string>;
14382
14382
  updateNfcPatrolTagBySite: (updateType: "Configure" | "Reset" | "Edit", data: TNfcPatrolTagUpdateData) => Promise<string>;
14383
+ deleteById: (_id: string | ObjectId) => Promise<string>;
14383
14384
  };
14384
14385
 
14385
14386
  /**
@@ -14410,6 +14411,8 @@ declare function useNfcPatrolTagService(): {
14410
14411
  * three update types (`{ site, tagID }` for Configure and Reset, `{ _id,
14411
14412
  * site }` for Edit), so a caller cannot name their own site and reach
14412
14413
  * somebody else's row: checking the body's site is the whole of it.
14414
+ * - `DELETE /:id` names only a record, so, like `GET /:id`, the site is read
14415
+ * off the STORED tag.
14413
14416
  *
14414
14417
  * `GET /` and `PUT /` are ALSO mounted at `/public` behind
14415
14418
  * `requireSessionOrLegacyToken`, which is why they use
@@ -14422,6 +14425,7 @@ declare function useNfcPatrolTagController(): {
14422
14425
  getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
14423
14426
  updateNfcPatrolTagBySite: (req: Request, res: Response, next: NextFunction) => Promise<void>;
14424
14427
  getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
14428
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
14425
14429
  };
14426
14430
 
14427
14431
  declare function useNfcPatrolTagRepo(): {
@@ -14462,6 +14466,7 @@ declare function useNfcPatrolTagRepo(): {
14462
14466
  ClientSession?
14463
14467
  ]) => Promise<mongodb.UpdateResult<bson.Document>>;
14464
14468
  getById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.WithId<bson.Document>>;
14469
+ deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.DeleteResult>;
14465
14470
  };
14466
14471
 
14467
14472
  declare enum DOBStatus {
@@ -15086,6 +15091,10 @@ declare function useNfcPatrolRouteRepo(): {
15086
15091
  } | TNfcPatrolRoute>;
15087
15092
  getById: (_id: string | ObjectId, isStart?: boolean) => Promise<TNfcPatrolRoute | null>;
15088
15093
  updateById: (_id: ObjectId | string, value: TNfcPatrolRouteEdit, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
15094
+ getNamesByCheckpointTag: ({ site, tag }: {
15095
+ site: string | ObjectId;
15096
+ tag: string | ObjectId;
15097
+ }, session?: ClientSession) => Promise<string[]>;
15089
15098
  };
15090
15099
 
15091
15100
  type TActionStatus = {