@7365admin1/layer-common 4.185.3 → 4.186.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,12 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 4.186.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 03688ea: Property Management role catalogue: view-only Daily Occurrence Book keys for the managing agent (Services at this site > Security).
8
+ - ea351d5: Vehicle QR stickers: blank stickers print only the QR code and sticker number by default (no long code, no words, blank strip); new "QR + serial number only" button for vehicle stickers too.
9
+
3
10
  ## 4.185.3
4
11
 
5
12
  ### Patch Changes
@@ -4047,11 +4054,11 @@ Monthly report: a month that had patrols opens the list of that month's patrol r
4047
4054
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
4048
4055
  own rule from two endpoints the console already calls, unprojected:
4049
4056
 
4050
- GET /api/members/user/:user/app/admin the Seven365 staff membership
4051
- GET /api/roles/id/:role that membership's role document
4057
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
4058
+ GET /api/roles/id/:role that membership's role document
4052
4059
 
4053
- owner = member.type === "admin" && role.type === "admin" && role.default === true
4054
- staff = member.type === "admin" && role.type === "admin"
4060
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
4061
+ staff = member.type === "admin" && role.type === "admin"
4055
4062
 
4056
4063
  `role.default` is the marker because it is the only property of a platform
4057
4064
  staff role no API caller can set - `role.controller.ts` validates create and
@@ -20,8 +20,8 @@
20
20
  </v-btn-toggle>
21
21
  <div v-if="mode === 'blank'" data-test="vehicle-qr-blank">
22
22
  <p class="text-body-2 mb-3">
23
- Make QR stickers before you know which car each is for. Each sticker has its own code printed on it. Paste it
24
- on a car, then link it to that vehicle in Vehicles &gt; Link QR sticker - or scan it with iMA365 / iSecure365
23
+ Make QR stickers before you know which car each is for. Each sticker has its own QR code and sticker number. Paste
24
+ it on a car, then link it to that vehicle by its number in Vehicles &gt; Link QR sticker - or scan it with iMA365 / iSecure365
25
25
  and pick the vehicle there. Until it is linked, scanning it shows "not linked yet".
26
26
  </p>
27
27
  <p v-if="blankSummary" class="text-body-2 font-weight-medium mb-3" data-test="vehicle-qr-blank-summary">
@@ -115,7 +115,7 @@
115
115
  </tr>
116
116
  </tbody>
117
117
  </v-table>
118
- <v-alert v-if="isBlank && design.shape !== 'square' && design.text === 'none'" type="warning" variant="tonal"
118
+ <v-alert v-if="isBlank && design.blankCode !== 'hide' && design.shape !== 'square' && design.text === 'none'" type="warning" variant="tonal"
119
119
  density="compact" class="my-2" data-test="vehicle-qr-blank-notext">
120
120
  With "No text" nothing is printed under the shape - neither the sticker's code nor its number - so these stickers
121
121
  can only be linked by scanning them with iMA365 / iSecure365. Pick another Text option to print it.
@@ -125,9 +125,8 @@
125
125
  {{ blankWithoutNumber }} sticker(s) have no sticker number, so their long code is still printed on them.
126
126
  </v-alert>
127
127
  <p v-if="isBlank && design.blankCode === 'hide'" class="text-caption text-medium-emphasis my-2">
128
- Each sticker has a cut-off strip under the dashed line saying it is not linked yet - cut it off before pasting
129
- the sticker on the car. To link one, pick its sticker number in Vehicles &gt; Link QR sticker, or scan it with
130
- iMA365 / iSecure365.
128
+ Each sticker prints only the QR code and its sticker number. To link one, pick its sticker number in
129
+ Vehicles &gt; Link QR sticker (or when adding a vehicle), or scan it with iMA365 / iSecure365.
131
130
  </p>
132
131
  <p v-else-if="isBlank" class="text-caption text-medium-emphasis my-2">
133
132
  Each sticker has a cut-off strip under the dashed line saying it is not linked yet - cut it off before pasting
@@ -174,16 +173,16 @@
174
173
  <v-select v-model="design.theme" :items="STICKER_THEMES" item-value="id" label="Colours" density="compact"
175
174
  hide-details />
176
175
  </v-col>
177
- <v-col v-if="design.shape !== 'square'" cols="12" sm="6" md="4">
176
+ <v-col v-if="design.shape !== 'square' && !blankQrSerialOnly" cols="12" sm="6" md="4">
178
177
  <v-select v-model="design.text" :items="TEXT_OPTIONS" label="Text" density="compact" hide-details
179
178
  data-test="vehicle-qr-text" />
180
179
  </v-col>
181
- <v-col v-if="design.shape === 'square' || design.text !== 'none'" cols="12" sm="6" md="4">
180
+ <v-col v-if="(design.shape === 'square' || design.text !== 'none') && !blankQrSerialOnly" cols="12" sm="6" md="4">
182
181
  <v-select v-model="design.label" :items="LABEL_OPTIONS"
183
182
  :label="design.plate === 'hide' ? 'Words on the sticker' : 'Words under the plate'" density="compact"
184
183
  hide-details />
185
184
  </v-col>
186
- <v-col cols="12" sm="6" md="4">
185
+ <v-col v-if="!blankQrSerialOnly" cols="12" sm="6" md="4">
187
186
  <v-select v-model="design.serial" :items="SERIAL_OPTIONS" label="Serial number" density="compact"
188
187
  hide-details data-test="vehicle-qr-serial" />
189
188
  </v-col>
@@ -203,6 +202,8 @@
203
202
  <div class="d-flex align-center flex-wrap">
204
203
  <v-switch v-model="design.cutLines" label="Show cut lines" color="primary" density="compact" hide-details
205
204
  inset class="mt-1 mr-4" data-test="vehicle-qr-cut-lines" />
205
+ <v-btn variant="tonal" color="primary" size="small" class="text-none mr-2" data-test="vehicle-qr-qr-serial-only"
206
+ @click="qrSerialOnly">QR + serial number only</v-btn>
206
207
  <v-btn variant="text" size="small" class="text-none" @click="resetDesign">Back to the standard look</v-btn>
207
208
  </div>
208
209
  <v-alert type="warning" variant="tonal" density="compact" class="mt-2" data-test="vehicle-qr-size-info">
@@ -218,7 +219,7 @@
218
219
  <v-alert type="info" variant="tonal" density="compact" class="mt-2" data-test="vehicle-qr-cut-guide">
219
220
  How to cut: first cut the sheet into pieces through the middle of the gaps (the small + marks show where),
220
221
  then cut round each sticker {{ design.cutLines ? "on the light-grey line" : "along its edge" }} - with scissors
221
- or a cutting machine. Cut off the strip with the unit and owner before pasting.
222
+ or a cutting machine.{{ blankQrSerialOnly ? "" : " Cut off the strip under each sticker before pasting." }}
222
223
  </v-alert>
223
224
  <v-alert type="info" variant="tonal" density="compact" class="mt-2" data-test="vehicle-qr-save-guide">
224
225
  To print the same stickers again later: <b>Save sheet file</b> keeps this exact sheet on your computer - open
@@ -371,9 +372,15 @@ const siteName = ref("");
371
372
  const DESIGN_KEY = "vehicleQrStickerDesign";
372
373
  // The serial choice is kept on its own, only when the person picks it.
373
374
  const SERIAL_KEY = "vehicleQrStickerSerial";
375
+ // Likewise the long-code choice (its default changed to "hide" on 17 Nov 2026).
376
+ const BLANK_CODE_KEY = "vehicleQrStickerBlankCode";
374
377
  function loadDesign(): StickerDesign {
375
378
  try {
376
- return rememberedDesign(JSON.parse(localStorage.getItem(DESIGN_KEY) || "null"), localStorage.getItem(SERIAL_KEY));
379
+ return rememberedDesign(
380
+ JSON.parse(localStorage.getItem(DESIGN_KEY) || "null"),
381
+ localStorage.getItem(SERIAL_KEY),
382
+ localStorage.getItem(BLANK_CODE_KEY),
383
+ );
377
384
  } catch {
378
385
  return { ...DEFAULT_STICKER_DESIGN };
379
386
  }
@@ -396,9 +403,25 @@ watch(
396
403
  }
397
404
  },
398
405
  );
406
+ watch(
407
+ () => design.blankCode,
408
+ (b) => {
409
+ try {
410
+ localStorage.setItem(BLANK_CODE_KEY, String(b));
411
+ } catch {
412
+ /* not saved - nothing else to do */
413
+ }
414
+ },
415
+ );
399
416
  function resetDesign() {
400
417
  Object.assign(design, DEFAULT_STICKER_DESIGN);
401
418
  }
419
+ // Blank stickers printing only the QR and the number: text, words and serial place do not apply.
420
+ const blankQrSerialOnly = computed(() => isBlank.value && design.blankCode === "hide");
421
+ /** One click: the QR code and the serial number, nothing else (blank and vehicle stickers alike). */
422
+ function qrSerialOnly() {
423
+ Object.assign(design, { blankCode: "hide", plate: "hide", serial: "sticker", label: "none", text: "below" });
424
+ }
402
425
 
403
426
  // A small live picture of every QR shape in the current dots / corners / colours.
404
427
  const SAMPLE = "HTTPS://APP.ISERVICE365.ORG/Q/SamplePreviewToken0000";
@@ -689,6 +689,25 @@ export default function usePropertyPermission() {
689
689
  "Allows the user to view the service providers' daily checklists at the site (areas, units and history). View only.",
690
690
  },
691
691
  },
692
+ // The managing agent's VIEW of the security company's Daily Occurrence Book at the site (owner, 17 Nov 2026):
693
+ // "Services at this site" > Security > Daily Occurrence Book. View only - the Security catalogue's own keys,
694
+ // which API-core checks on the book list, one book and its entries (dob / dobEntry gates).
695
+ "daily-occurrence-books": {
696
+ "see-all-daily-occurrence": {
697
+ check: true,
698
+ description: "Allows the user to view the security company's Daily Occurrence Books at the site. View only.",
699
+ },
700
+ "see-daily-occurrence-details": {
701
+ check: true,
702
+ description: "Allows the user to open a Daily Occurrence Book and download it. View only.",
703
+ },
704
+ },
705
+ "daily-occurrence-entries": {
706
+ "see-daily-occurrence-entries-details": {
707
+ check: true,
708
+ description: "Allows the user to read the entries in a Daily Occurrence Book. View only.",
709
+ },
710
+ },
692
711
  "attendance-mgmt": {
693
712
  "see-all-attendance": {
694
713
  check: true,
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.185.3",
5
+ "version": "4.186.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.",
@@ -158,8 +158,8 @@ export const PLATE_OPTIONS: { value: PlateChoice; title: string }[] = [
158
158
  ];
159
159
 
160
160
  export const BLANK_CODE_OPTIONS: { value: BlankCodeChoice; title: string }[] = [
161
- { value: "print", title: "Print (default)" },
162
- { value: "hide", title: "Hide - QR code and sticker number only" },
161
+ { value: "hide", title: "Hide - QR code and sticker number only (default)" },
162
+ { value: "print", title: "Print the long code too" },
163
163
  ];
164
164
 
165
165
  export const LABEL_OPTIONS: { value: LabelChoice; title: string }[] = [
@@ -193,7 +193,8 @@ export const DEFAULT_STICKER_DESIGN: StickerDesign = {
193
193
  cutLines: true,
194
194
  serial: "sticker",
195
195
  plate: "show",
196
- blankCode: "print",
196
+ // Client ask (TLR, 17 Nov 2026): blank stickers print the QR and the sticker number only.
197
+ blankCode: "hide",
197
198
  };
198
199
 
199
200
  /** A saved or typed-in design with anything unknown replaced by the default. */
@@ -227,9 +228,10 @@ export function normalizeDesign(raw: unknown): StickerDesign {
227
228
  * change, so a saved serial of "off" may only be the old default; the serial
228
229
  * choice counts only when it was saved on its own (the person picked it).
229
230
  */
230
- export function rememberedDesign(saved: unknown, savedSerial: unknown): StickerDesign {
231
+ export function rememberedDesign(saved: unknown, savedSerial: unknown, savedBlankCode?: unknown): StickerDesign {
231
232
  const r = saved && typeof saved === "object" ? (saved as Record<string, unknown>) : {};
232
- return normalizeDesign({ ...r, serial: savedSerial });
233
+ // Same for the long code: a saved "print" may only be the old default.
234
+ return normalizeDesign({ ...r, serial: savedSerial, blankCode: savedBlankCode });
233
235
  }
234
236
 
235
237
  /**
@@ -237,9 +239,12 @@ export function rememberedDesign(saved: unknown, savedSerial: unknown): StickerD
237
239
  * code whose tab under the shape would be left empty (no serial or words on
238
240
  * it) is printed with no tab, so no bare paper tab hangs under the shape.
239
241
  * Blank stickers always print their code or sticker number in the tab, so they keep it.
242
+ * Blank stickers with the long code hidden print the QR and the sticker number
243
+ * only: no extra words, and a shaped code always gets its tab for the number.
240
244
  */
241
245
  export function printedDesign(design: unknown, blank = false, siteName = ""): StickerDesign {
242
246
  const d = normalizeDesign(design);
247
+ if (blank && d.blankCode === "hide") return { ...d, label: "none", text: "below" };
243
248
  const tabEmpty = d.serial !== "sticker" && d.serial !== "both" && !stickerLabel(d, siteName);
244
249
  return !blank && d.plate === "hide" && isSilhouette(d.shape) && d.text === "below" && tabEmpty ? { ...d, text: "none" } : d;
245
250
  }
@@ -211,14 +211,15 @@ export function stickerSerial(item: Pick<StickerItem, "serialNo" | "serialLabel"
211
211
  /**
212
212
  * A blank sticker printed with its sticker number in place of the long code
213
213
  * (design "Sticker code: Hide"). Only when it HAS a number - a sticker never
214
- * goes out with neither the code nor a number on it.
214
+ * goes out with neither the code nor a number on it. Also a vehicle's sticker
215
+ * that came from a blank one (its "plate" is that blank code) when reprinted.
215
216
  */
216
- export function blankCodeHidden(item: Pick<StickerItem, "blank" | "serialNo" | "serialLabel">, design: Pick<StickerDesign, "blankCode">): boolean {
217
- return !!item.blank && design.blankCode === "hide" && !!stickerSerial(item);
217
+ export function blankCodeHidden(item: Pick<StickerItem, "blank" | "serialNo" | "serialLabel" | "plateNumber">, design: Pick<StickerDesign, "blankCode">): boolean {
218
+ return (!!item.blank || isBlankCode(text(item.plateNumber))) && design.blankCode === "hide" && !!stickerSerial(item);
218
219
  }
219
220
 
220
221
  /** The strip under a blank sticker: link by number when the code is not on it. */
221
- export function blankStripNote(item: Pick<StickerItem, "blank" | "serialNo" | "serialLabel">, design: Pick<StickerDesign, "blankCode">): string {
222
+ export function blankStripNote(item: Pick<StickerItem, "blank" | "serialNo" | "serialLabel" | "plateNumber">, design: Pick<StickerDesign, "blankCode">): string {
222
223
  return blankCodeHidden(item, design) ? BLANK_STRIP_NOTE_NUMBER : BLANK_STRIP_NOTE;
223
224
  }
224
225
 
@@ -449,6 +450,11 @@ function cardContext(design: StickerDesign, siteName: string | undefined, n: num
449
450
  };
450
451
  }
451
452
 
453
+ /** "QR + serial number only": nothing but the number under the code (no words, no Seven365 line). */
454
+ function qrAndSerialOnly(item: StickerItem, c: CardContext): boolean {
455
+ return !c.label && (blankCodeHidden(item, c) || (!item.blank && c.hidePlate));
456
+ }
457
+
452
458
  /** The sticker itself (frame + QR + plate words) - what goes on the car. */
453
459
  function cardHtml(item: StickerItem, face: string, c: CardContext): string {
454
460
  const { lines, serialText } = headLines(item, c);
@@ -470,7 +476,7 @@ function cardHtml(item: StickerItem, face: string, c: CardContext): string {
470
476
  (lines.length ? `<div class="plate"${lines.length > 1 || blankCodeHidden(item, c) ? ` style="font-size:${plateSizeMm(longest, c.cardW - 6, 4.6)}mm"` : ""}>${plate}</div>` : "") +
471
477
  serial +
472
478
  label +
473
- `<div class="brand"><span class="mark" style="background:${c.ink}">7</span>Powered by Seven365</div>` +
479
+ (qrAndSerialOnly(item, c) ? "" : `<div class="brand"><span class="mark" style="background:${c.ink}">7</span>Powered by Seven365</div>`) +
474
480
  `</div>`;
475
481
  return `<div class="card" style="color:${c.ink}"><div class="face">${face}</div>${words}</div>`;
476
482
  }
@@ -495,7 +501,10 @@ export function buildStickerDocument(
495
501
  const { place, owner } = installerLine(item);
496
502
  const [noteHead, noteRest] = blankStripNote(item, design).split(" - ");
497
503
  const sn = stripSerial(item) ? `<span class="sn">${escapeHtml(stickerSerial(item))}</span>` : "";
498
- const strip = item.blank
504
+ // QR + number only: the strip stays blank (the number is on the sticker; link it by that number)
505
+ const strip = item.blank && blankCodeHidden(item, design)
506
+ ? `<div class="cut${c.bare ? " free" : ""} blank"></div>`
507
+ : item.blank
499
508
  ? `<div class="cut${c.bare ? " free" : ""} blank"><div>${sn}<b>${escapeHtml(noteHead)}</b></div><div>${escapeHtml(noteRest)}</div></div>`
500
509
  : `<div class="cut${c.bare ? " free" : ""}"><div>${sn}<b>${escapeHtml(place || "-")}</b></div><div class="owner">Owner: ${escapeHtml(owner || "-")}</div></div>`;
501
510
  return (
@@ -554,6 +563,8 @@ function cardWordsSvg(item: StickerItem, c: CardContext): string {
554
563
  } else {
555
564
  if (serialText) rows.push(word(serialText, true));
556
565
  if (label) rows.push(word(label, false));
566
+ }
567
+ if (!c.tag && !qrAndSerialOnly(item, c)) {
557
568
  // the Seven365 line: grey rule, the ink "7" mark and the words, centred together
558
569
  const textW = 10.061 * 6 * PT;
559
570
  const groupW = 3.2 + 1 + textW;