@7365admin1/layer-common 4.152.0 → 4.153.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/layer-common
2
2
 
3
+ ## 4.153.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 9a33c49: Vehicle Mgmt: the QR sticker column shows each vehicle's running sticker number (No. 1, 2, 3 ...), naming the plate when a row has several.
8
+
3
9
  ## 4.152.0
4
10
 
5
11
  ### Minor Changes
@@ -3590,11 +3596,11 @@ Monthly report: a month that had patrols opens the list of that month's patrol r
3590
3596
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
3591
3597
  own rule from two endpoints the console already calls, unprojected:
3592
3598
 
3593
- GET /api/members/user/:user/app/admin the Seven365 staff membership
3594
- GET /api/roles/id/:role that membership's role document
3599
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
3600
+ GET /api/roles/id/:role that membership's role document
3595
3601
 
3596
- owner = member.type === "admin" && role.type === "admin" && role.default === true
3597
- staff = member.type === "admin" && role.type === "admin"
3602
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
3603
+ staff = member.type === "admin" && role.type === "admin"
3598
3604
 
3599
3605
  `role.default` is the marker because it is the only property of a platform
3600
3606
  staff role no API caller can set - `role.controller.ts` validates create and
@@ -61,6 +61,7 @@
61
61
  <v-chip size="small" variant="tonal" :color="qrStickerSummary(rowPlates(item)).color" data-test="vehicle-qr-cell">
62
62
  {{ qrStickerSummary(rowPlates(item)).label }}
63
63
  </v-chip>
64
+ <div v-for="n in qrStickerNumbers(rowPlates(item))" :key="n" class="text-caption" data-test="vehicle-qr-number">{{ n }}</div>
64
65
  <div v-for="plate in rowPlates(item).filter((p: any) => p.qrCode)" :key="plate._id ?? plate.plateNumber">
65
66
  <VehicleStickerCode :code="plate.qrCode" :label="rowPlates(item).length > 1 ? plate.plateNumber : ''" />
66
67
  </div>
@@ -484,7 +485,7 @@ import {
484
485
  // `error.message` put ofetch's own developer string in the delete dialog:
485
486
  // `[PUT] "/api/vehicles/6a9691f25648d7633171c9e3": 502`.
486
487
  import { errorConverter } from '../utils/data';
487
- import { BLANK_LIST_NOTE, UNDO_REISSUE_NOTE, blankSummaryText, qrStickerSummary, stickerCodeHint, type BlankSummary } from '../utils/vehicle-qr-blank';
488
+ import { BLANK_LIST_NOTE, UNDO_REISSUE_NOTE, blankSummaryText, qrStickerNumbers, qrStickerSummary, stickerCodeHint, type BlankSummary } from '../utils/vehicle-qr-blank';
488
489
  import { isPermissionRefusalError } from '../utils/permission-refusal';
489
490
 
490
491
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "4.152.0",
5
+ "version": "4.153.0",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",
package/types/people.d.ts CHANGED
@@ -48,7 +48,7 @@ declare type TOccupancyRoleOption = {
48
48
  description: string;
49
49
  };
50
50
 
51
- declare type TPlateNumber = { plateNumber: string, recNo?: string, _id?: string, status: TVehicleStatus, type: TVehicleType, anprCameras?: TVehicleAnprCamera[], hasQrSticker?: boolean };
51
+ declare type TPlateNumber = { plateNumber: string, recNo?: string, _id?: string, status: TVehicleStatus, type: TVehicleType, anprCameras?: TVehicleAnprCamera[], hasQrSticker?: boolean, qrSerial?: number };
52
52
 
53
53
 
54
54
  // `""` is the FORM's "nothing picked yet" - it is stripped from the payload
@@ -94,6 +94,14 @@ export function qrStickerSummary(plates: Array<{ hasQrSticker?: boolean }>): { l
94
94
  return { label: `${linked} of ${total}`, color: "warning" };
95
95
  }
96
96
 
97
+ /** The list's sticker numbers for one row ("No. 5", or "SBA123A: No. 5" when the row has several plates). */
98
+ export function qrStickerNumbers(plates: Array<{ hasQrSticker?: boolean; qrSerial?: number; plateNumber?: string }>): string[] {
99
+ const many = plates.length > 1;
100
+ return plates
101
+ .filter((p) => p?.hasQrSticker === true && Number.isInteger(p.qrSerial) && Number(p.qrSerial) > 0)
102
+ .map((p) => (many ? `${p.plateNumber}: No. ${p.qrSerial}` : `No. ${p.qrSerial}`));
103
+ }
104
+
97
105
  export type BlankSummary = { printed: number; linked: number; available: number };
98
106
 
99
107
  /** "12 blank stickers available to link (20 printed, 8 linked)" - or what to do when none were printed yet. */