@7365admin1/core 3.54.0 → 3.55.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,17 @@
1
1
  # @iservice365/core
2
2
 
3
+ ## 3.55.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 8cbae97: Notification settings: deliver the marketplace in-app messages, and stop offering a channel that cannot deliver.
8
+
9
+ `NotificationModule` was missing the two tags `iservice365-API-core` sends for marketplace orders, so every in-app marketplace notification failed validation and was dropped inside the `catch` around the persist — the push arrived, the message never reached the app, and the "In the app" switch governed something that never happened. Both tags are now accepted; no other tag changed.
10
+
11
+ `GET /notification-preferences` now sends only the channels a category can actually deliver on. Email has no sender anywhere in the estate, so the screen was drawing a switch that could not move beside a sentence apologising for it, and then counting the two that could as "on everywhere". Every client renders what the server sends, so the dead row disappears from the web screen and both mobile screens at once. Where the reason was something a person actually needs — a booking confirmation goes to the address on the form — it is now said in the category's own description.
12
+
13
+ No stored preference changes, and no notification that was being delivered stops.
14
+
3
15
  ## 3.54.0
4
16
 
5
17
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -12911,6 +12911,8 @@ declare enum NotificationModule {
12911
12911
  FACILITY_BOOKING = "facilityBooking",
12912
12912
  ONLINE_FORM = "onlineForm",
12913
12913
  PRELOVED_MARKETPLACE = "prelovedMarketplace",
12914
+ MARKETPLACE_ORDER = "marketplace-order",
12915
+ MARKETPLACE_VENDOR_ORDER = "marketplace-vendor-order",
12914
12916
  INCIDENT_REPORT = "incidentReport",
12915
12917
  EMERGENCY_CONTACT = "emergencyContact",
12916
12918
  VIRTUAL_PATROL = "virtualPatrol",
@@ -13477,10 +13479,16 @@ declare class NotificationService {
13477
13479
  *
13478
13480
  * ## Channels are declared per category, not assumed
13479
13481
  *
13480
- * `channels` says what this category can *physically* deliver on today. The
13481
- * screen draws every channel for every category and dims the ones that cannot
13482
- * deliver, with the reason in `channelNote` the house pattern is to show a
13483
- * control and explain why it is unavailable, never to hide it.
13482
+ * `channels` says what this category can *physically* deliver on today, and it
13483
+ * is what the settings screen is built from: `getForUser` sends only the
13484
+ * channels a category can actually use, so a person is never shown a switch
13485
+ * that will not move. `channelNote` is the reason a channel is off, kept here
13486
+ * for whoever reads this file and pinned by a test — it is not sent to a
13487
+ * client, because an apology beside a dead control is not a setting.
13488
+ *
13489
+ * Where the reason is something a person actually needs (a booking
13490
+ * confirmation goes to the address on the form), it is said in the category's
13491
+ * own `description`, which the screen does show.
13484
13492
  *
13485
13493
  * Email is `false` everywhere for a real reason: the module emails this system
13486
13494
  * sends are addressed to an email string stored on a record (a booking's
@@ -13671,10 +13679,12 @@ type NotificationPreferenceView = {
13671
13679
  channels: Array<{
13672
13680
  key: string;
13673
13681
  label: string;
13674
- /** false = drawn, dimmed, and not switchable */
13682
+ /**
13683
+ * Always true. Only channels this category can really deliver on are
13684
+ * sent at all; the field stays so a client written against the older
13685
+ * shape, which filtered on it, keeps working unchanged.
13686
+ */
13675
13687
  supported: boolean;
13676
- /** plain-English reason, present only when unsupported */
13677
- note?: string;
13678
13688
  enabled: boolean;
13679
13689
  }>;
13680
13690
  }>;
package/dist/index.js CHANGED
@@ -14316,6 +14316,8 @@ var NotificationModule = /* @__PURE__ */ ((NotificationModule2) => {
14316
14316
  NotificationModule2["FACILITY_BOOKING"] = "facilityBooking";
14317
14317
  NotificationModule2["ONLINE_FORM"] = "onlineForm";
14318
14318
  NotificationModule2["PRELOVED_MARKETPLACE"] = "prelovedMarketplace";
14319
+ NotificationModule2["MARKETPLACE_ORDER"] = "marketplace-order";
14320
+ NotificationModule2["MARKETPLACE_VENDOR_ORDER"] = "marketplace-vendor-order";
14319
14321
  NotificationModule2["INCIDENT_REPORT"] = "incidentReport";
14320
14322
  NotificationModule2["EMERGENCY_CONTACT"] = "emergencyContact";
14321
14323
  NotificationModule2["VIRTUAL_PATROL"] = "virtualPatrol";
@@ -14770,7 +14772,7 @@ var NOTIFICATION_CATEGORIES = [
14770
14772
  {
14771
14773
  key: "facilityBooking",
14772
14774
  label: "Facility Bookings",
14773
- description: "When a facility booking is made or its status changes.",
14775
+ description: "When a facility booking is made or its status changes. The confirmation email goes to the address entered on the booking form itself.",
14774
14776
  channels: { inApp: true, push: true, email: false },
14775
14777
  channelNote: {
14776
14778
  email: "Booking confirmations go to the email address entered on the booking form itself. To change where a confirmation lands, change that address when the booking is made."
@@ -14782,7 +14784,7 @@ var NOTIFICATION_CATEGORIES = [
14782
14784
  {
14783
14785
  key: "visitors",
14784
14786
  label: "Visitors",
14785
- description: "When a visitor you invited checks in or checks out.",
14787
+ description: "When a visitor you invited checks in or checks out. The invitation email goes to the address entered for the visitor.",
14786
14788
  channels: { inApp: true, push: true, email: false },
14787
14789
  channelNote: {
14788
14790
  email: "Visitor invitations go to the email address entered for the visitor when they are invited. To change where one lands, change that address on the invitation."
@@ -14856,7 +14858,7 @@ var NOTIFICATION_CATEGORIES = [
14856
14858
  {
14857
14859
  key: "serviceProviderInvite",
14858
14860
  label: "Service Provider Invitations",
14859
- description: "When a property manager invites your company to provide services at a site.",
14861
+ description: "When a property manager invites your company to provide services at a site. The invitation email is the invitation itself and is always sent to the address it was addressed to; these settings control the copy that reaches you inside the app.",
14860
14862
  channels: { inApp: true, push: true, email: false },
14861
14863
  channelNote: {
14862
14864
  email: "The invitation email is the invitation itself \u2014 for a company that has no account here yet it is the only copy, so it is always sent to the address the invitation was addressed to. The switches above control the copy that reaches you inside the app."
@@ -92003,8 +92005,10 @@ function useNotificationPreferenceService() {
92003
92005
  categoriesForUser(id)
92004
92006
  ]);
92005
92007
  const isOff = (category, channel) => off.some((o) => o.category === category && o.channel === channel);
92008
+ const supportedIn = (category) => NOTIFICATION_CHANNELS.filter((channel) => category.channels[channel]);
92009
+ const offered = new Set(categories.flatMap((c) => supportedIn(c)));
92006
92010
  return {
92007
- channels: NOTIFICATION_CHANNELS.map((c) => ({
92011
+ channels: NOTIFICATION_CHANNELS.filter((c) => offered.has(c)).map((c) => ({
92008
92012
  key: c,
92009
92013
  label: NOTIFICATION_CHANNEL_LABELS[c]
92010
92014
  })),
@@ -92013,16 +92017,14 @@ function useNotificationPreferenceService() {
92013
92017
  label: category.label,
92014
92018
  description: category.description,
92015
92019
  safety: Boolean(category.safety),
92016
- channels: NOTIFICATION_CHANNELS.map((channel) => {
92017
- const supported = category.channels[channel];
92018
- return {
92019
- key: channel,
92020
- label: NOTIFICATION_CHANNEL_LABELS[channel],
92021
- supported,
92022
- note: supported ? void 0 : category.channelNote?.[channel],
92023
- enabled: supported && !isOff(category.key, channel)
92024
- };
92025
- })
92020
+ channels: supportedIn(category).map((channel) => ({
92021
+ key: channel,
92022
+ label: NOTIFICATION_CHANNEL_LABELS[channel],
92023
+ // kept so a client written against the old shape still filters
92024
+ // correctly; every channel sent is now a supported one.
92025
+ supported: true,
92026
+ enabled: !isOff(category.key, channel)
92027
+ }))
92026
92028
  }))
92027
92029
  };
92028
92030
  }