@7365admin1/layer-common 4.97.1-staging.670 → 4.97.1-staging.672

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.
@@ -188,7 +188,8 @@ const {
188
188
  APP_MECHANICAL_ELECTRICAL,
189
189
  APP_PEST_CONTROL,
190
190
  APP_LANDSCAPING,
191
- APP_POOL_MAINTENANCE
191
+ APP_POOL_MAINTENANCE,
192
+ APP_IRANGER
192
193
  } = useRuntimeConfig().public
193
194
  const APP_CONFIG: Record<string, any> = {
194
195
  property_management_agency: {
@@ -232,6 +233,12 @@ const APP_CONFIG: Record<string, any> = {
232
233
  title: 'Pool Maintenance',
233
234
  icon: 'mdi-pool',
234
235
  link: APP_POOL_MAINTENANCE
236
+ },
237
+ estate_ranger_services: {
238
+ id: 'iranger',
239
+ title: 'iRanger365',
240
+ icon: 'mdi-shield-account-outline',
241
+ link: APP_IRANGER
235
242
  }
236
243
  }
237
244
  // A Real Estate Developer client is served by the Property Management app
@@ -419,6 +419,7 @@ const APP_LIST = [
419
419
  { title: 'Pest Control Services', value: 'pest_control_services' },
420
420
  { title: 'Landscaping Services', value: 'landscaping_services' },
421
421
  { title: 'Pool Maintenance Services', value: 'pool_maintenance_services' },
422
+ { title: 'iRanger365', value: 'estate_ranger_services' },
422
423
  ]
423
424
 
424
425
  /* ── STATE ── */
@@ -311,6 +311,7 @@ const APP_LIST = [
311
311
  { title: "Pest Control Services", value: "pest_control_services" },
312
312
  { title: "Landscaping Services", value: "landscaping_services" },
313
313
  { title: "Pool Maintenance Services", value: "pool_maintenance_services" },
314
+ { title: "iRanger365", value: "estate_ranger_services" },
314
315
  ]
315
316
 
316
317
  const { getByName } = useOrg()
@@ -75,6 +75,7 @@ const orgTypeConfig: Record<string, { label: string; url?: string }> = {
75
75
  pest_control_services: { label: "Pest Control" },
76
76
  landscaping_services: { label: "Landscape" },
77
77
  pool_maintenance_services: { label: "Pool Maintenance" },
78
+ estate_ranger_services: { label: "iRanger365" },
78
79
  };
79
80
 
80
81
  function getOrgTypeMeta(type = "") {
@@ -306,68 +306,40 @@
306
306
  />
307
307
  </v-col>
308
308
 
309
+ <!--
310
+ DV-1355: a season pass always shows its Start and Expiry dates. They
311
+ used to sit behind "Show Subscription Options", so a pass was often
312
+ saved with no dates at all. Both are required when adding; editing
313
+ an older pass saved without dates still only needs one with the other.
314
+ -->
309
315
  <v-col v-if="shouldShowField('start')" cols="12">
310
- <v-expand-transition v-if="showSubscriptionDateOptions">
311
- <v-row no-gutters>
312
- <!-- <v-row dense justify="space-between">
313
- <template v-for="option in subscriptionOptions" :key="option.value">
314
- <v-col cols="4">
315
- <v-btn :text="option.label" class="text-capitalize" min-width="120" :ripple="false"
316
- :class="[option.value === selectedSubscriptionDuration ? 'button-outline-class' : '']"
317
- @click="selectedSubscriptionDuration = option.value" />
318
- </v-col>
319
-
320
- </template>
321
- </v-row> -->
322
-
323
- <v-row no-gutters class="mt-5">
324
- <v-col cols="12">
325
- <InputLabel
326
- class="text-capitalize"
327
- title="Start Date"
328
- required
329
- />
330
- <InputDateTimePicker
331
- ref="startDateRef"
332
- v-model:utc="vehicle.start"
333
- :rules="[validStartDateRule]"
334
- />
335
- </v-col>
316
+ <v-row no-gutters>
317
+ <v-col cols="12">
318
+ <InputLabel
319
+ class="text-capitalize"
320
+ title="Start Date"
321
+ required
322
+ />
323
+ <InputDateTimePicker
324
+ ref="startDateRef"
325
+ v-model:utc="vehicle.start"
326
+ :rules="[validStartDateRule]"
327
+ />
328
+ </v-col>
336
329
 
337
- <v-col cols="12">
338
- <InputLabel
339
- class="text-capitalize"
340
- title="Expiry Date"
341
- required
342
- />
343
- <InputDateTimePicker
344
- ref="expiryDateRef"
345
- v-model:utc="vehicle.end"
346
- :rules="[validExpiryDateRule]"
347
- />
348
- </v-col>
349
- </v-row>
350
- </v-row>
351
- </v-expand-transition>
352
-
353
- <v-col cols="12" :class="[showSubscriptionDateOptions && 'mt-5']">
354
- <v-row justify="center">
355
- <v-col cols="6" class="d-flex justify-center">
356
- <AppButton
357
- variant="ghost"
358
- @click="
359
- showSubscriptionDateOptions = !showSubscriptionDateOptions
360
- "
361
- >
362
- {{
363
- showSubscriptionDateOptions
364
- ? "Hide Subscription Options"
365
- : "Show Subscription Options"
366
- }}
367
- </AppButton>
368
- </v-col>
369
- </v-row>
370
- </v-col>
330
+ <v-col cols="12">
331
+ <InputLabel
332
+ class="text-capitalize"
333
+ title="Expiry Date"
334
+ required
335
+ />
336
+ <InputDateTimePicker
337
+ ref="expiryDateRef"
338
+ v-model:utc="vehicle.end"
339
+ :rules="[validExpiryDateRule]"
340
+ />
341
+ </v-col>
342
+ </v-row>
371
343
  </v-col>
372
344
 
373
345
  <v-col cols="12">
@@ -894,7 +866,6 @@ const expiryDateRef = ref<HTMLInputElement | null>(null);
894
866
  const processing = ref(false);
895
867
  const message = ref("");
896
868
  const selectedSubscriptionDuration = ref<string | null>("custom");
897
- const showSubscriptionDateOptions = ref(false);
898
869
  const errorMessage = ref("");
899
870
 
900
871
  // fetch existing vehicle data if in edit mode
@@ -1073,14 +1044,12 @@ function removePlate(index: number) {
1073
1044
  function back() {
1074
1045
  emit("back");
1075
1046
  message.value = "";
1076
- showSubscriptionDateOptions.value = false;
1077
1047
  selectedSubscriptionDuration.value = null;
1078
1048
  }
1079
1049
 
1080
1050
  function close() {
1081
1051
  emit("close");
1082
1052
  message.value = "";
1083
- showSubscriptionDateOptions.value = false;
1084
1053
  selectedSubscriptionDuration.value = null;
1085
1054
  }
1086
1055
 
@@ -1404,9 +1373,15 @@ watch(selectedSubscriptionDuration, (duration) => {
1404
1373
  }
1405
1374
  });
1406
1375
 
1376
+ // DV-1355: both dates are required on a NEW season pass. On edit, an older
1377
+ // pass saved without dates can still be updated: there one needs the other.
1378
+ const datesRequired = computed(
1379
+ () => prop.type === "seasonpass" && prop.mode === "add"
1380
+ );
1381
+
1407
1382
  function validStartDateRule(value: string) {
1408
1383
  const expiryDateISO = vehicle.end;
1409
- if (!value && expiryDateISO) {
1384
+ if (!value && (expiryDateISO || datesRequired.value)) {
1410
1385
  return "Start Date is required";
1411
1386
  }
1412
1387
 
@@ -1417,7 +1392,7 @@ function validExpiryDateRule() {
1417
1392
  const startDateISO = vehicle.start;
1418
1393
  const endDateISO = vehicle.end;
1419
1394
 
1420
- if (!endDateISO && startDateISO) {
1395
+ if (!endDateISO && (startDateISO || datesRequired.value)) {
1421
1396
  return "Expiry Date is required";
1422
1397
  }
1423
1398
 
@@ -1558,10 +1533,6 @@ onMounted(() => {
1558
1533
  vehicle.plateNumber = prop.vehicleData.plateNumber;
1559
1534
  vehicle.peopleId = prop.vehicleData.peopleId || "";
1560
1535
  vehicle.block = prop.vehicleData.block || null;
1561
-
1562
- if (prop.type === "seasonpass") {
1563
- showSubscriptionDateOptions.value = true;
1564
- }
1565
1536
  }
1566
1537
  }, 300);
1567
1538
 
@@ -19,6 +19,7 @@ const APP_URL_KEY_BY_NATURE: Record<string, string> = {
19
19
  pest_control_services: "APP_PEST_CONTROL",
20
20
  landscaping_services: "APP_LANDSCAPING",
21
21
  pool_maintenance_services: "APP_POOL_MAINTENANCE",
22
+ estate_ranger_services: "APP_IRANGER",
22
23
  };
23
24
 
24
25
  export default function useAppLinks() {
@@ -48,6 +48,7 @@ export default function useLocal() {
48
48
  { title: "Pest Control Services", value: "pest_control_services" },
49
49
  { title: "Landscaping Services", value: "landscaping_services" },
50
50
  { title: "Pool Maintenance Services", value: "pool_maintenance_services" },
51
+ { title: "iRanger365", value: "estate_ranger_services" },
51
52
  ];
52
53
 
53
54
  const natureOfBusinessV2 = [
@@ -64,6 +65,7 @@ export default function useLocal() {
64
65
  { title: "Landscaping Services", value: "landscaping_services" },
65
66
  { title: "Pest Control Services", value: "pest_control_services" },
66
67
  { title: "Pool Maintenance Services", value: "pool_maintenance_services" },
68
+ { title: "iRanger365", value: "estate_ranger_services" },
67
69
  ];
68
70
  const natureOfBusinessV3 = [
69
71
  { title: "Security", value: "security_agency" },
@@ -75,6 +77,7 @@ export default function useLocal() {
75
77
  { title: "Landscaping", value: "landscaping_services" },
76
78
  { title: "Pest Control", value: "pest_control_services" },
77
79
  { title: "Pool Maintenance", value: "pool_maintenance_services" },
80
+ { title: "iRanger365", value: "estate_ranger_services" },
78
81
  ];
79
82
 
80
83
 
@@ -0,0 +1,112 @@
1
+ // Explicit import rather than Nuxt auto-import, like every other catalogue: it
2
+ // lets `utils/module-applications.ts` read this file outside a Nuxt context.
3
+ import { useCommonPermissions } from "./useCommonPermission";
4
+
5
+ /**
6
+ * THE iRANGER365 ROLE CATALOGUE (service nature `estate_ranger_services`).
7
+ *
8
+ * iRanger365 is a standard iService365 service (owner, 2026-11-11): the ranger
9
+ * company's staff hold `estate_ranger_services` memberships whose roles are
10
+ * built from this list in the iRanger web app's role editor, exactly like
11
+ * Security or M&E.
12
+ *
13
+ * Setup and field work only. The Command Centre (dispatch, staff map, safety,
14
+ * alerts, messages, tickets) is run by iSecure365, so its permissions are the
15
+ * `command-centre` resource of `useSecurityPermission`, not here.
16
+ *
17
+ * Three actions decide the person's iRanger365 role on the server (API-core
18
+ * `iranger-role-catalogue.ts`; keep the two in step):
19
+ * visits:work-as-ranger -> RANGER
20
+ * visits:work-as-ambassador -> AMBASSADOR
21
+ * staff:supervise-rangers -> SUPERVISOR
22
+ * Each `manage-*` action is the ranger company's set-up right for that area,
23
+ * for its own clusters only. The owner's `*` is all of the above inside the
24
+ * company.
25
+ */
26
+ const see = (what: string) => ({ check: true, description: `Allows the user to view ${what}.` });
27
+ const manage = (what: string) => ({ check: true, description: `Allows the user to add, change and remove ${what}.` });
28
+
29
+ export default function useRangerPermission() {
30
+ const { memberPermissions, invitationPermissions, rolePermissions } = useCommonPermissions();
31
+
32
+ const permissions: TPermissions = {
33
+ members: memberPermissions,
34
+ roles: rolePermissions,
35
+ invitations: invitationPermissions,
36
+ dashboard: {
37
+ "see-dashboard": see("the iRanger365 dashboard of their company's clusters"),
38
+ },
39
+ clusters: {
40
+ "see-clusters": see("the company's clusters of estates"),
41
+ "manage-clusters": manage("the company's clusters and which estates each one covers"),
42
+ },
43
+ estates: {
44
+ "see-estates": see("estate details: geofence, access instructions, site rules and providers"),
45
+ "manage-estates": manage("estate details: geofence, access instructions, site rules and providers"),
46
+ },
47
+ locations: {
48
+ "see-locations": see("the locations inside an estate"),
49
+ "manage-locations": manage("the locations inside an estate"),
50
+ },
51
+ "sop-cards": {
52
+ "see-sop-cards": see("the estates' SOP cards"),
53
+ "manage-sop-cards": manage("the estates' SOP cards"),
54
+ },
55
+ contractors: {
56
+ "see-contractors": see("the estates' contractors"),
57
+ "manage-contractors": manage("the estates' contractors"),
58
+ },
59
+ "qr-tags": {
60
+ "see-qr-tags": see("QR tags and sticker sheets"),
61
+ "manage-qr-tags": manage("QR tags, print sticker sheets and replace damaged stickers"),
62
+ },
63
+ rota: {
64
+ "see-rota": see("the rangers' rota"),
65
+ "manage-rota": manage("the rangers' rota"),
66
+ },
67
+ keys: {
68
+ "see-keys": see("the key register"),
69
+ "manage-keys": manage("entries in the key register"),
70
+ },
71
+ visits: {
72
+ "work-as-ranger": {
73
+ check: true,
74
+ description: "Works in the field as an iRanger: receives jobs, checks in on site and reports back (iRanger365 app).",
75
+ },
76
+ "work-as-ambassador": {
77
+ check: true,
78
+ description: "Works in the field as a Property Ambassador (iRanger365 app).",
79
+ },
80
+ "see-visits": see("visit plans and completed visits"),
81
+ "manage-visit-plans": manage("visit plans"),
82
+ },
83
+ staff: {
84
+ "see-staff": see("the company's rangers: clusters, skills and titles"),
85
+ "manage-staff": manage("which clusters each ranger covers, their skills and titles"),
86
+ "supervise-rangers": {
87
+ check: true,
88
+ description: "Supervises rangers: sees every job in the company's clusters and is not held to a shift.",
89
+ },
90
+ },
91
+ reports: {
92
+ "see-reports": see("iRanger365 reports"),
93
+ },
94
+ "scan-log": {
95
+ "see-scan-log": see("the QR scan log"),
96
+ },
97
+ "liz-documents": {
98
+ "see-liz-documents": see("the documents Liz (the AI assistant) answers from"),
99
+ "manage-liz-documents": manage("the documents Liz (the AI assistant) answers from"),
100
+ },
101
+ "site-settings": {
102
+ "see-site-settings": see("each estate's iRanger365 settings (Code Red ladder, SMS / WhatsApp, Liz, SOS, resident sticker reports)"),
103
+ "manage-site-settings": manage("each estate's iRanger365 settings (Code Red ladder, SMS / WhatsApp, Liz, SOS, resident sticker reports)"),
104
+ },
105
+ messages: {
106
+ "see-messages": see("iRanger365 messages"),
107
+ "send-messages": { check: true, description: "Allows the user to send iRanger365 messages." },
108
+ },
109
+ };
110
+
111
+ return { permissions };
112
+ }
@@ -903,6 +903,25 @@ export default function useSecurityPermission() {
903
903
  },
904
904
  },
905
905
 
906
+ // iRanger365 Command Centre (owner, 2026-11-11: "Command Centre was run by
907
+ // the iSecure365"). Dispatch board, staff map, safety panel, alerts,
908
+ // messages and tickets for the Rangers working on the sites this security
909
+ // company is engaged on. API-core `iranger-command-centre-access.ts` maps
910
+ // these two strings; the older `iranger-command-centre:*` strings keep
911
+ // working there until staging roles are moved.
912
+ "command-centre": {
913
+ view: {
914
+ check: true,
915
+ description:
916
+ "Allows the user to watch the iRanger365 Command Centre: dispatch board, staff map, safety panel, alerts, messages and tickets (read only).",
917
+ },
918
+ operate: {
919
+ check: true,
920
+ description:
921
+ "Allows the user to run the iRanger365 Command Centre: acknowledge and resolve alerts, assign jobs, send messages and record call-outs.",
922
+ },
923
+ },
924
+
906
925
  };
907
926
 
908
927
  return {
package/constants/app.ts CHANGED
@@ -6,7 +6,8 @@ export const APP_CONSTANTS = {
6
6
  RESIDENT: "resident",
7
7
  LANDSCAPING: "landscaping_services",
8
8
  PEST_CONTROL: "pest_control_services",
9
- POOL_MAINTENANCE: "pool_maintenance_services"
9
+ POOL_MAINTENANCE: "pool_maintenance_services",
10
+ IRANGER: "estate_ranger_services"
10
11
 
11
12
 
12
13
  }
package/nuxt.config.ts CHANGED
@@ -92,6 +92,7 @@ export default defineNuxtConfig({
92
92
  APP_PEST_CONTROL: (process.env.APP_PEST_CONTROL as string) ?? "",
93
93
  APP_LANDSCAPING: (process.env.APP_LANDSCAPING as string) ?? "",
94
94
  APP_POOL_MAINTENANCE: (process.env.APP_POOL_MAINTENANCE as string) ?? "",
95
+ APP_IRANGER: (process.env.APP_IRANGER as string) ?? "",
95
96
  ENTRYPASS_ACM_URL:
96
97
  (process.env.ENTRYPASS_ACM_URL as string) ??
97
98
  "https://entrypass-xsocket.iservice365.app/",
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.97.1-staging.670",
5
+ "version": "4.97.1-staging.672",
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.",
@@ -8,7 +8,8 @@ declare type TServiceType =
8
8
  | "mechanical_electrical_services"
9
9
  | "landscaping_services"
10
10
  | "pest_control_services"
11
- | "pool_maintenance_services";
11
+ | "pool_maintenance_services"
12
+ | "estate_ranger_services";
12
13
 
13
14
  declare type TDashboardCardValue = {
14
15
  key: string;
@@ -32,6 +32,7 @@ export const NATURE_APPLICATIONS: Readonly<Record<string, readonly string[]>> =
32
32
  pool_maintenance_services: ["pool"],
33
33
  property_management_agency: ["property-management"],
34
34
  real_estate_developer: ["property-management"],
35
+ estate_ranger_services: ["iranger"],
35
36
  });
36
37
 
37
38
  /**
@@ -5,6 +5,7 @@ import useMechanicalElectricalPermission from "../composables/useMechanicalElect
5
5
  import usePestControlPermission from "../composables/usePestControlPermission";
6
6
  import usePoolMaintenancePermission from "../composables/usePoolMaintenancePermission";
7
7
  import usePropertyPermission from "../composables/usePropertyPermission";
8
+ import useRangerPermission from "../composables/useRangerPermission";
8
9
 
9
10
  /**
10
11
  * WHICH APPLICATION EACH MODULE BELONGS TO.
@@ -69,6 +70,8 @@ export const APPLICATIONS = [
69
70
  label: "Property management",
70
71
  composable: usePropertyPermission,
71
72
  },
73
+ // iRanger365 as a standard service (owner, 2026-11-11), nature `estate_ranger_services`.
74
+ { key: "iranger", label: "iRanger365", composable: useRangerPermission },
72
75
  ] as const;
73
76
 
74
77
  export type ApplicationKey = (typeof APPLICATIONS)[number]["key"];
@@ -37,6 +37,7 @@ const ACRONYMS: Record<string, string> = {
37
37
  qr: "QR",
38
38
  hid: "HID",
39
39
  id: "ID",
40
+ sop: "SOP",
40
41
  };
41
42
 
42
43
  /** Only where the rule below still reads wrong. Keep it short. */
@@ -76,6 +77,8 @@ export const RESOURCE_LABELS_BY_TYPE: Record<string, Record<string, string>> = {
76
77
  pest_control_services: { "event-mgmt": "Task Calendar", "schedule-task-mgmt": "Extra checks" },
77
78
  pool_maintenance_services: { "event-mgmt": "Task Calendar", "schedule-task-mgmt": "Extra checks" },
78
79
  landscaping_services: { "event-mgmt": "Task Calendar", "schedule-task-mgmt": "Extra checks" },
80
+ // iRanger365: `visits` holds the field roles, `site-settings` is the per-estate iRanger settings.
81
+ estate_ranger_services: { visits: "Field work and visits", "site-settings": "Estate settings" },
79
82
  };
80
83
 
81
84
  /**
package/utils/role.ts CHANGED
@@ -174,6 +174,7 @@ const ROLE_APP_LABELS: Readonly<Record<string, string>> = Object.freeze({
174
174
  pest_control_services: "Pest Control",
175
175
  pool_maintenance_services: "Pool Maintenance",
176
176
  landscaping_services: "Landscape",
177
+ estate_ranger_services: "iRanger365",
177
178
  resident: "Resident",
178
179
  });
179
180
 
@@ -22,6 +22,7 @@ const SERVICE_TYPE_LABELS: Readonly<Record<string, string>> = Object.freeze({
22
22
  pest_control_services: "Pest Control",
23
23
  landscaping_services: "Landscape",
24
24
  mechanical_electrical_services: "Mechanical & Electrical",
25
+ estate_ranger_services: "iRanger365",
25
26
  });
26
27
 
27
28
  export function serviceTypeLabel(service: string | null | undefined): string {