@wix/himalaya-cli 0.1871.0 → 0.1872.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/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-module.d.ts +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/portfolio/src/index.d.ts +19 -0
- package/dist/cli.mjs +89 -39
- package/fixtures/wix-canned.json +8 -0
- package/guides/release-notes.md +18 -0
- package/guides/sdk-reference.json +8 -1
- package/package.json +2 -2
- package/template-icons/professional-services.png +0 -0
- package/templates/bare-fashion/config.ts +37 -2
- package/templates/bare-fashion/dev/index.ts +4006 -48
- package/templates/bare-fashion/himalaya.content.json +15 -0
- package/templates/bare-fashion/tier5-src/_shared/member-account-routes.ts +56 -0
- package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +295 -0
- package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/index.ts +58 -0
- package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/login-info.ts +274 -0
- package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/personal-info.ts +881 -0
- package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/privacy.ts +139 -0
- package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/shared.ts +136 -0
- package/templates/branded-lite/dev/index.ts +2 -1
- package/templates/branded-lite/tier5-src/_shared/portfolio-details.ts +70 -0
- package/templates/branded-lite/tier5-src/himi-branded-lite-coupons/index.ts +13 -2
- package/templates/branded-lite/tier5-src/himi-branded-lite-portfolio/index.ts +90 -9
- package/templates/branded-lite/tier5-src/himi-branded-lite-portfolio-project/index.ts +53 -4
- package/templates/branded-lite/tier5-src/himi-events-list/index.ts +5 -1
- package/templates/community-club/tier5-src/himi-events-list/index.ts +5 -1
- package/templates/conference/config.ts +43 -1
- package/templates/conference/dev/index.ts +4127 -0
- package/templates/conference/himalaya.content.json +18 -0
- package/templates/conference/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +295 -0
- package/templates/conference/tier5-src/himi-branded-lite-account-settings/index.ts +58 -0
- package/templates/conference/tier5-src/himi-branded-lite-account-settings/login-info.ts +274 -0
- package/templates/conference/tier5-src/himi-branded-lite-account-settings/personal-info.ts +881 -0
- package/templates/conference/tier5-src/himi-branded-lite-account-settings/privacy.ts +139 -0
- package/templates/conference/tier5-src/himi-branded-lite-account-settings/shared.ts +136 -0
- package/templates/conference/tier5-src/himi-events-list/index.ts +5 -1
- package/templates/conference/tier5-src/wix-spaces-delete-account/index.ts +59 -0
- package/templates/events-meetups/tier5-src/himi-events-list/index.ts +5 -1
- package/templates/gym-fitness/tier5-src/himi-events-list/index.ts +5 -1
- package/templates/medical-services/config.ts +42 -0
- package/templates/medical-services/dev/index.ts +4136 -0
- package/templates/medical-services/himalaya.content.json +18 -0
- package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +295 -0
- package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/index.ts +58 -0
- package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/login-info.ts +274 -0
- package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/personal-info.ts +881 -0
- package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/privacy.ts +139 -0
- package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/shared.ts +136 -0
- package/templates/medical-services/tier5-src/wix-spaces-delete-account/index.ts +59 -0
- package/templates/nonprofit-cause/tier5-src/himi-events-list/index.ts +5 -1
- package/templates/podcast-creator/tier5-src/himi-events-list/index.ts +5 -1
- package/templates/portfolio-creative/dev/index.ts +2 -1
- package/templates/portfolio-creative/tier5-src/_shared/portfolio-details.ts +70 -0
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-portfolio/index.ts +90 -9
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-portfolio-project/index.ts +53 -4
- package/templates/portfolio-creative/tier5-src/himi-events-list/index.ts +5 -1
- package/templates/professional-services/README.md +55 -0
- package/templates/professional-services/config.ts +436 -0
- package/templates/professional-services/dev/index.ts +44772 -0
- package/templates/professional-services/himalaya.content.json +100 -0
- package/templates/professional-services/himalaya.template.json +16 -0
- package/templates/professional-services/icon.png +0 -0
- package/templates/professional-services/platforms.json +1 -0
- package/templates/professional-services/tier5-src/_shared/app-locale.ts +70 -0
- package/templates/professional-services/tier5-src/_shared/booking-location.ts +147 -0
- package/templates/professional-services/tier5-src/_shared/booking-session.ts +224 -0
- package/templates/professional-services/tier5-src/_shared/branded-lite-hosted.ts +282 -0
- package/templates/professional-services/tier5-src/_shared/branded-load-state.ts +109 -0
- package/templates/professional-services/tier5-src/_shared/business-chat-copy.ts +40 -0
- package/templates/professional-services/tier5-src/_shared/business-chat-history.ts +51 -0
- package/templates/professional-services/tier5-src/_shared/business-chat-message-model.ts +177 -0
- package/templates/professional-services/tier5-src/_shared/business-chat-model.ts +56 -0
- package/templates/professional-services/tier5-src/_shared/business-chat-presenter.ts +587 -0
- package/templates/professional-services/tier5-src/_shared/business-chat-transport.ts +164 -0
- package/templates/professional-services/tier5-src/_shared/chat-live.ts +242 -0
- package/templates/professional-services/tier5-src/_shared/collection-contract.ts +232 -0
- package/templates/professional-services/tier5-src/_shared/collection-query.ts +201 -0
- package/templates/professional-services/tier5-src/_shared/collection-service.ts +429 -0
- package/templates/professional-services/tier5-src/_shared/detail-presence.ts +51 -0
- package/templates/professional-services/tier5-src/_shared/engine-intl.ts +538 -0
- package/templates/professional-services/tier5-src/_shared/event-registration.ts +86 -0
- package/templates/professional-services/tier5-src/_shared/events-inline-options.ts +77 -0
- package/templates/professional-services/tier5-src/_shared/faq-list.ts +405 -0
- package/templates/professional-services/tier5-src/_shared/featured-event.ts +63 -0
- package/templates/professional-services/tier5-src/_shared/group-member-count.ts +15 -0
- package/templates/professional-services/tier5-src/_shared/group-privacy.ts +14 -0
- package/templates/professional-services/tier5-src/_shared/guest-sign-in.ts +36 -0
- package/templates/professional-services/tier5-src/_shared/himi-account.ts +222 -0
- package/templates/professional-services/tier5-src/_shared/himi-blog-hidden.ts +66 -0
- package/templates/professional-services/tier5-src/_shared/himi-blog-post-row.ts +214 -0
- package/templates/professional-services/tier5-src/_shared/himi-blog-saved.ts +64 -0
- package/templates/professional-services/tier5-src/_shared/himi-booking-saved.ts +88 -0
- package/templates/professional-services/tier5-src/_shared/himi-bookings.ts +318 -0
- package/templates/professional-services/tier5-src/_shared/himi-copy.ts +123 -0
- package/templates/professional-services/tier5-src/_shared/himi-events.ts +92 -0
- package/templates/professional-services/tier5-src/_shared/himi-media.ts +33 -0
- package/templates/professional-services/tier5-src/_shared/himi-store.ts +7 -0
- package/templates/professional-services/tier5-src/_shared/himi-text.ts +24 -0
- package/templates/professional-services/tier5-src/_shared/host-events.ts +66 -0
- package/templates/professional-services/tier5-src/_shared/hosted-checkout.ts +70 -0
- package/templates/professional-services/tier5-src/_shared/iap-attendance-form.ts +106 -0
- package/templates/professional-services/tier5-src/_shared/iap-attendance-purchase.ts +235 -0
- package/templates/professional-services/tier5-src/_shared/iap-attendance.ts +38 -0
- package/templates/professional-services/tier5-src/_shared/iap-worker.ts +127 -0
- package/templates/professional-services/tier5-src/_shared/inbox-rooms.ts +163 -0
- package/templates/professional-services/tier5-src/_shared/local-preferences.ts +38 -0
- package/templates/professional-services/tier5-src/_shared/member-access.ts +63 -0
- package/templates/professional-services/tier5-src/_shared/member-account-routes.ts +56 -0
- package/templates/professional-services/tier5-src/_shared/member-avatar.ts +76 -0
- package/templates/professional-services/tier5-src/_shared/member-bookings.ts +107 -0
- package/templates/professional-services/tier5-src/_shared/member-read.ts +82 -0
- package/templates/professional-services/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/professional-services/tier5-src/_shared/notification-target.ts +141 -0
- package/templates/professional-services/tier5-src/_shared/offset-page.ts +10 -0
- package/templates/professional-services/tier5-src/_shared/online-actions.ts +76 -0
- package/templates/professional-services/tier5-src/_shared/owner-load-error.ts +348 -0
- package/templates/professional-services/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/professional-services/tier5-src/_shared/portfolio-details.ts +70 -0
- package/templates/professional-services/tier5-src/_shared/pricing-plan-display.ts +64 -0
- package/templates/professional-services/tier5-src/_shared/relative-time.ts +21 -0
- package/templates/professional-services/tier5-src/_shared/result-snackbar.ts +26 -0
- package/templates/professional-services/tier5-src/_shared/rich-body.ts +78 -0
- package/templates/professional-services/tier5-src/_shared/rich-content-link.ts +34 -0
- package/templates/professional-services/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/professional-services/tier5-src/_shared/staff-name.ts +18 -0
- package/templates/professional-services/tier5-src/_shared/weekly-goal.ts +111 -0
- package/templates/professional-services/tier5-src/_shared/wix-bi.ts +85 -0
- package/templates/professional-services/tier5-src/_shared/wix-member-links.ts +114 -0
- package/templates/professional-services/tier5-src/_shared/wix-service-price.ts +146 -0
- package/templates/professional-services/tier5-src/business-chat/index.ts +797 -0
- package/templates/professional-services/tier5-src/business-contact/index.ts +6 -0
- package/templates/professional-services/tier5-src/himi-blog-feed/index.ts +444 -0
- package/templates/professional-services/tier5-src/himi-blog-post/index.ts +1239 -0
- package/templates/professional-services/tier5-src/himi-booking-account/index.ts +278 -0
- package/templates/professional-services/tier5-src/himi-booking-bookings/index.ts +475 -0
- package/templates/professional-services/tier5-src/himi-booking-service/index.ts +1197 -0
- package/templates/professional-services/tier5-src/himi-booking-services/index.ts +795 -0
- package/templates/professional-services/tier5-src/himi-booking-time/index.ts +1840 -0
- package/templates/professional-services/tier5-src/himi-branded-lite-coupons/index.ts +96 -0
- package/templates/professional-services/tier5-src/himi-branded-lite-faq/index.ts +6 -0
- package/templates/professional-services/tier5-src/himi-branded-lite-file-share/index.ts +12 -0
- package/templates/professional-services/tier5-src/himi-branded-lite-group/index.ts +310 -0
- package/templates/professional-services/tier5-src/himi-branded-lite-group-about/index.ts +240 -0
- package/templates/professional-services/tier5-src/himi-branded-lite-my-groups/index.ts +237 -0
- package/templates/professional-services/tier5-src/himi-branded-lite-notifications/index.ts +263 -0
- package/templates/professional-services/tier5-src/himi-branded-lite-plans/index.ts +498 -0
- package/templates/professional-services/tier5-src/himi-branded-lite-portfolio/index.ts +136 -0
- package/templates/professional-services/tier5-src/himi-branded-lite-portfolio-project/index.ts +198 -0
- package/templates/professional-services/tier5-src/himi-events-detail/index.ts +1306 -0
- package/templates/professional-services/tier5-src/himi-events-list/index.ts +171 -0
- package/templates/professional-services/tier5-src/himi-events-my-events/index.ts +227 -0
- package/templates/professional-services/tier5-src/himi-events-rsvp/index.ts +230 -0
- package/templates/professional-services/tier5-src/himi-professional-services-community/index.ts +318 -0
- package/templates/professional-services/tier5-src/himi-professional-services-home/index.ts +772 -0
- package/templates/professional-services/tier5-src/himi-store-account/index.ts +1514 -0
- package/templates/professional-services/tier5-src/wix-spaces-coupon-detail/index.ts +43 -0
- package/templates/professional-services/tier5-src/wix-spaces-my-subscriptions/index.ts +89 -0
- package/templates/professional-services/tier5-src/wix-spaces-subscription-detail/index.ts +139 -0
- package/templates/professional-services/tokens.json +456 -0
- package/templates/restaurant/tier5-src/himi-events-list/index.ts +5 -1
- package/templates/salon-spa/config.ts +42 -0
- package/templates/salon-spa/dev/index.ts +4136 -0
- package/templates/salon-spa/himalaya.content.json +18 -0
- package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +295 -0
- package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/index.ts +58 -0
- package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/login-info.ts +274 -0
- package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/personal-info.ts +881 -0
- package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/privacy.ts +139 -0
- package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/shared.ts +136 -0
- package/templates/salon-spa/tier5-src/wix-spaces-delete-account/index.ts +59 -0
- package/templates/wholesale-store/config.ts +43 -1
- package/templates/wholesale-store/dev/index.ts +4136 -0
- package/templates/wholesale-store/himalaya.content.json +18 -0
- package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +295 -0
- package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/index.ts +58 -0
- package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/login-info.ts +274 -0
- package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/personal-info.ts +881 -0
- package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/privacy.ts +139 -0
- package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/shared.ts +136 -0
- package/templates/wholesale-store/tier5-src/wix-spaces-delete-account/index.ts +59 -0
- package/templates/yoga-studio/tier5-src/himi-events-list/index.ts +5 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// A sign-in sheet can be a form page rather than a drawer. `sheetStyle: "page"` keeps the iOS sheet
|
|
2
|
+
// and opens a full-screen modal on Android and web, whose sheet is a bottom drawer. A host older
|
|
3
|
+
// than the param ignores it and draws its own sheet.
|
|
4
|
+
//
|
|
5
|
+
// Opt-in per app: the app passes `signInSheetStyle: "page"` beside `signInPresentation`. These
|
|
6
|
+
// workers are shared (Salon & Spa runs them too), and an app that opens its other sign-ins as a
|
|
7
|
+
// plain sheet must not get a page from some of them and a drawer from the rest.
|
|
8
|
+
|
|
9
|
+
/** The app's `signInSheetStyle` param, read beside `signInPresentation`: "page", else "". */
|
|
10
|
+
export function signInPageStyle(value: unknown): "page" | "" {
|
|
11
|
+
return value === "page" ? "page" : "";
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** The nav args a sign-in opened with `presentation` adds: `sheetStyle` on a sheet the app asked
|
|
15
|
+
* to open as a page, else none. */
|
|
16
|
+
export function signInSheetStyle(presentation: string | undefined, style: "page" | ""): { sheetStyle?: "page" } {
|
|
17
|
+
return presentation === "sheet" && style === "page" ? { sheetStyle: "page" } : {};
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// How a staff member's name splits into words for initials and short names, shared by every
|
|
2
|
+
// worker that shows Bookings staff (himi-booking-service, himi-clinic-home), so a doctor's
|
|
3
|
+
// initials read the same on every screen ("Dr. John Wang, MD" is "JW" everywhere).
|
|
4
|
+
|
|
5
|
+
/** A courtesy title a staff name may start with ("Dr. John Wang"): not a name of its own. */
|
|
6
|
+
const TITLE = /^(dr|prof|mr|mrs|ms|mx)\.?$/i;
|
|
7
|
+
/** A credential or suffix a staff name may end with ("John Wang, MD", "Martin King Jr."). No
|
|
8
|
+
* "Do" or "Pa": they are surnames too ("Anh Do"). */
|
|
9
|
+
const SUFFIX = /^(md|phd|dds|dmd|rn|np|jr|sr|ii|iii|iv)\.?$/i;
|
|
10
|
+
|
|
11
|
+
/** The name's words without a leading title or trailing credentials, commas dropped. A one-word
|
|
12
|
+
* name keeps its word, title or not. */
|
|
13
|
+
export function nameWords(name: string): { title: string; words: string[] } {
|
|
14
|
+
const words = name.split(/\s+/).map((word) => word.replace(/,+$/, "")).filter(Boolean);
|
|
15
|
+
const title = words.length > 1 && TITLE.test(words[0]!) ? words.shift()! : "";
|
|
16
|
+
while (words.length > 1 && SUFFIX.test(words[words.length - 1]!)) words.pop();
|
|
17
|
+
return { title, words };
|
|
18
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// The weekly session goal (`provisioning.goals.weeklySessions`) over a member's own bookings —
|
|
2
|
+
// shared by the home weekly-goal Gauge (himi-branded-lite-home) and the My Bookings "This week"
|
|
3
|
+
// card (himi-booking-bookings), so the two can never count differently.
|
|
4
|
+
//
|
|
5
|
+
// WHAT COUNTS as a session toward the goal: a CONFIRMED booking whose start falls in the CURRENT
|
|
6
|
+
// calendar week (Monday 00:00 local → now) and is already in the past. An allow-list, not a
|
|
7
|
+
// deny-list: CREATED (checkout never completed), PENDING / PENDING_APPROVAL / PENDING_CHECKOUT,
|
|
8
|
+
// WAITING_LIST, CANCELED and DECLINED — and any status Wix adds later — do not count. That is
|
|
9
|
+
// "booked and it happened", not verified
|
|
10
|
+
// attendance: the member-scoped queryBookings row carries no attendance/check-in field (the Wix
|
|
11
|
+
// Attendance API is owner-scoped), so a no-show still counts. Future bookings this week do not
|
|
12
|
+
// count — they have not happened yet.
|
|
13
|
+
//
|
|
14
|
+
// DETERMINISM: nothing here runs at worker boot; every clock read is an argument. PURE (no network,
|
|
15
|
+
// no bridge) so the rules are unit-tested directly; the read lives with its caller.
|
|
16
|
+
|
|
17
|
+
import type { MemberBookingRow } from "./member-bookings.js";
|
|
18
|
+
import { copyParam, copyTemplate } from "./himi-copy.js";
|
|
19
|
+
|
|
20
|
+
export const MAX_WEEKLY_SESSION_GOAL = 21;
|
|
21
|
+
|
|
22
|
+
/** The one status that means the session was booked and held (as memberBookingRow normalizes
|
|
23
|
+
* it: upper-case, `_` → space). */
|
|
24
|
+
const COUNTS_AS_SESSION = /^CONFIRMED$/;
|
|
25
|
+
|
|
26
|
+
/** At most this many pages of past bookings are read for one week's count. */
|
|
27
|
+
export const MAX_WEEKLY_PAGES = 4;
|
|
28
|
+
|
|
29
|
+
/** The onAppear `weeklyGoal` param → a goal in [1, 21], or 0 = no goal provisioned. */
|
|
30
|
+
export function parseWeeklyGoal(raw: unknown): number {
|
|
31
|
+
const n = typeof raw === "number" ? raw : typeof raw === "string" && raw.trim() !== "" ? Number(raw) : NaN;
|
|
32
|
+
return Number.isInteger(n) && n >= 1 ? Math.min(n, MAX_WEEKLY_SESSION_GOAL) : 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Monday 00:00 local of `now`'s week, epoch ms. */
|
|
36
|
+
export function weekStartMs(now: number): number {
|
|
37
|
+
const d = new Date(now);
|
|
38
|
+
d.setHours(0, 0, 0, 0);
|
|
39
|
+
d.setDate(d.getDate() - ((d.getDay() + 6) % 7));
|
|
40
|
+
return d.getTime();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Is `row` a session that was booked and already held at `now`? The one rule every count here uses. */
|
|
44
|
+
export function isHeldSession(row: MemberBookingRow, now: number): boolean {
|
|
45
|
+
const start = Date.parse(row.start);
|
|
46
|
+
return Number.isFinite(start) && start < now && COUNTS_AS_SESSION.test((row.status || "").trim().toUpperCase());
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Sessions toward the goal among `rows` — see the file header for what counts. */
|
|
50
|
+
export function weeklySessionsDone(rows: readonly MemberBookingRow[], now: number): number {
|
|
51
|
+
const from = weekStartMs(now);
|
|
52
|
+
const seen = new Set<string>();
|
|
53
|
+
for (const row of rows) {
|
|
54
|
+
if (Date.parse(row.start) < from || !isHeldSession(row, now)) continue;
|
|
55
|
+
seen.add(row.id || `${row.start}|${row.title}`);
|
|
56
|
+
}
|
|
57
|
+
return seen.size;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface BookingsPage {
|
|
61
|
+
items: MemberBookingRow[];
|
|
62
|
+
nextCursor?: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Sessions toward the goal from PAST bookings read newest-first: `first` is the first page, and
|
|
66
|
+
* `next(cursor)` reads more only while the oldest row so far is still inside this week (a page of
|
|
67
|
+
* 50 almost always reaches back before Monday). Bounded to MAX_WEEKLY_PAGES reads; a failing
|
|
68
|
+
* read rejects, so the caller hides the count rather than under-counting. */
|
|
69
|
+
export async function weeklySessionsFromPages(
|
|
70
|
+
first: BookingsPage,
|
|
71
|
+
next: (cursor: string) => Promise<BookingsPage>,
|
|
72
|
+
now: number,
|
|
73
|
+
): Promise<number> {
|
|
74
|
+
const from = weekStartMs(now);
|
|
75
|
+
const rows = [...first.items];
|
|
76
|
+
let page = first;
|
|
77
|
+
for (let read = 1; read < MAX_WEEKLY_PAGES && page.nextCursor; read++) {
|
|
78
|
+
const oldest = page.items[page.items.length - 1];
|
|
79
|
+
if (oldest && Date.parse(oldest.start) < from) break;
|
|
80
|
+
page = await next(page.nextCursor);
|
|
81
|
+
rows.push(...page.items);
|
|
82
|
+
}
|
|
83
|
+
return weeklySessionsDone(rows, now);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface WeeklyGoalProgress {
|
|
87
|
+
done: number;
|
|
88
|
+
goal: number;
|
|
89
|
+
/** 0..1 — the Gauge / ProgressBar fill. */
|
|
90
|
+
fraction: number;
|
|
91
|
+
met: boolean;
|
|
92
|
+
/** "1 of 2 sessions this week" */
|
|
93
|
+
label: string;
|
|
94
|
+
/** "1 more to reach your weekly goal" / "Weekly goal reached. Great consistency." */
|
|
95
|
+
remainingLabel: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function weeklyGoalProgress(done: number, goal: number): WeeklyGoalProgress {
|
|
99
|
+
const safeGoal = Math.max(1, goal);
|
|
100
|
+
const met = done >= safeGoal;
|
|
101
|
+
return {
|
|
102
|
+
done,
|
|
103
|
+
goal: safeGoal,
|
|
104
|
+
fraction: Math.min(done / safeGoal, 1),
|
|
105
|
+
met,
|
|
106
|
+
label: copyTemplate("weeklyGoal.progress", "{done} of {goal} sessions this week", { done, goal: safeGoal }),
|
|
107
|
+
remainingLabel: met
|
|
108
|
+
? copyParam("weeklyGoal.met", "Weekly goal reached. Great consistency.")
|
|
109
|
+
: copyTemplate("weeklyGoal.remaining", "{count} more to reach your weekly goal", { count: safeGoal - done }),
|
|
110
|
+
};
|
|
111
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// RN BI events whose fields exist only in a worker (epic #4973). The platform maps send every
|
|
2
|
+
// other RN event; these go through `wixPlatform.bi.log`, built inline with RN's own field names
|
|
3
|
+
// rather than by bundling a `@wix/bi-logger-*` package. The host owns every identity and common
|
|
4
|
+
// field (msid, uuid, installationId, contactId, _lv, ...), so none is named here.
|
|
5
|
+
import { bi, type BiLogEvent } from "@himalaya/wix-platform";
|
|
6
|
+
|
|
7
|
+
/** Sends one event without waiting for it and never throws: BI must not change a screen. A
|
|
8
|
+
* screen whose descriptor does not declare `wix_platform` is refused by the host, which is
|
|
9
|
+
* swallowed here like any other BI failure. */
|
|
10
|
+
export function logBi(event: BiLogEvent): void {
|
|
11
|
+
try {
|
|
12
|
+
void Promise.resolve(bi.log(event)).catch(() => undefined);
|
|
13
|
+
} catch {
|
|
14
|
+
/* BI is best-effort */
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** The HTTP status a Wix SDK error carries (`HTTP 429: ...`, or a `status` field), else 0. */
|
|
19
|
+
export function wixErrorStatus(error: unknown): number {
|
|
20
|
+
const own = Number((error as { status?: unknown; statusCode?: unknown } | null)?.status ?? (error as { statusCode?: unknown } | null)?.statusCode);
|
|
21
|
+
if (Number.isFinite(own) && own > 0) return own;
|
|
22
|
+
const match = /\bHTTP (\d{3})\b/.exec(String((error as Error | null)?.message ?? error ?? ""));
|
|
23
|
+
return match ? Number(match[1]) : 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function applicationErrorCode(body: unknown): string {
|
|
27
|
+
const o = body as { details?: { applicationError?: { code?: unknown } }; applicationError?: { code?: unknown }; code?: unknown } | null;
|
|
28
|
+
const code = o?.details?.applicationError?.code ?? o?.applicationError?.code ?? o?.code;
|
|
29
|
+
return typeof code === "string" ? code : "";
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** The code both native bridges put in an application error's message: `HTTP 400 [CODE]: description`
|
|
33
|
+
* (iOS JSWorker.swift `WixApiCapability.Error.application`, Android WebViewJSWorker.kt `Error.Application`). */
|
|
34
|
+
const BRIDGE_APPLICATION_CODE = /\bHTTP \d{3} \[([A-Za-z0-9_.:-]+)\]/;
|
|
35
|
+
|
|
36
|
+
/** The Wix application error code of a failed call (RN's `serializeError(e).code`): read from the
|
|
37
|
+
* error itself, else from the `[CODE]` the native bridges put after `HTTP <status> `, else from the
|
|
38
|
+
* JSON body after `HTTP <status>: ` (the bridges' raw-status arm and the web host's wixCall). ""
|
|
39
|
+
* when there is none. */
|
|
40
|
+
export function wixErrorCode(error: unknown): string {
|
|
41
|
+
const own = applicationErrorCode(error);
|
|
42
|
+
if (own) return own;
|
|
43
|
+
const message = String((error as Error | null)?.message ?? error ?? "");
|
|
44
|
+
const bracketed = BRIDGE_APPLICATION_CODE.exec(message);
|
|
45
|
+
if (bracketed) return bracketed[1];
|
|
46
|
+
const start = message.indexOf("{");
|
|
47
|
+
if (start < 0) return "";
|
|
48
|
+
try {
|
|
49
|
+
return applicationErrorCode(JSON.parse(message.slice(start)));
|
|
50
|
+
} catch {
|
|
51
|
+
return "";
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// RN's `ErrorIndicationType` (mobile-apps-inbox services/errorIndications/errorIndications.type.ts).
|
|
56
|
+
const ERROR_INDICATIONS = new Set([
|
|
57
|
+
"ACCESS_TOKEN_EXPIRED", "ALLOWED_MESSAGING_TIME_WINDOW_EXPIRED", "ATTACHMENT_SIZE_EXCEEDS_ALLOWED_LIMIT", "CAMPAIGN_SUSPENDED",
|
|
58
|
+
"FACEBOOK_ALLOWED_WINDOW_EXPIRED", "GMAIL_ADV_PROTECTION", "INSTAGRAM_ALLOWED_WINDOW_EXPIRED", "INVALID_CHARACTERS",
|
|
59
|
+
"INVALID_PHONE_NUMBER", "INVALID_RECIPIENT_ADDRESS", "LANDLINE_OR_UNREACHABLE_CARRIER", "MESSAGE_FILTERED",
|
|
60
|
+
"MMS_NOT_SUPPORTED_RECEIVING_PHONE_NUMBER", "NETWORK_ISSUE", "NO_MATCHING_RECIPIENT_FOUND", "POLICY_VIOLATION", "QUOTA_EXCEEDED",
|
|
61
|
+
"RATE_LIMIT", "RATE_LIMIT_ERROR", "RECIPIENT_BLOCKED_MESSAGES", "RECIPIENT_NOT_AVAILABLE", "SERVICE_UNAVAILABLE",
|
|
62
|
+
"TELCO_LANDLINE_OR_UNREACHABLE_CARRIER", "TELCO_MEDIA_EXCEEDS_MESSAGING_PROVIDER_SIZE_LIMIT",
|
|
63
|
+
"TELCO_MESSAGE_DELIVERY_UNKNOWN_DESTINATION_HANDSET", "TELCO_MESSAGE_FILTERED", "TELCO_MESSAGE_FROM_NUMBER_STILL_BEING_CONFIGURED",
|
|
64
|
+
"TELCO_MESSAGE_FROM_UNREGISTERED_NUMBER", "TELCO_UNKNOWN_ERROR", "TELCO_UNREACHABLE_DESTINATION_HANDSET", "TOO_MANY_REQUESTS",
|
|
65
|
+
"TOTAL_ATTACHMENTS_SIZE_EXCEEDS_ALLOWED_LIMIT", "UNEXPECTED_ERROR_RETRY_LATER", "UNKNOWN_FAILED_CODE", "UNSUPPORTED",
|
|
66
|
+
"UNSUPPORTED_MESSAGE_TYPE", "USER_RATE_LIMIT",
|
|
67
|
+
]);
|
|
68
|
+
|
|
69
|
+
/** 5:1604 inboxSendMessageErrorMsgShown (`@wix/bi-logger-crm-data` v2, endpoint ''), for a chat
|
|
70
|
+
* send that failed and said so. RN's `errorReason` is the failed message's indication code, and
|
|
71
|
+
* RN reports a code it does not know as UNSUPPORTED (`getErrorIndicationFromCode`); a send that
|
|
72
|
+
* never left the device is NETWORK_ISSUE and a 429 is RATE_LIMIT. */
|
|
73
|
+
export function logChatSendError(input: { chatroomId: string; contactId?: string; error: unknown; offline: boolean }): void {
|
|
74
|
+
const code = wixErrorCode(input.error);
|
|
75
|
+
const errorReason = input.offline ? "NETWORK_ISSUE"
|
|
76
|
+
: ERROR_INDICATIONS.has(code) ? code
|
|
77
|
+
: wixErrorStatus(input.error) === 429 ? "RATE_LIMIT"
|
|
78
|
+
: "UNSUPPORTED";
|
|
79
|
+
logBi({
|
|
80
|
+
evid: 1604,
|
|
81
|
+
src: 5,
|
|
82
|
+
endpoint: "",
|
|
83
|
+
params: { origin: "native", chatroomId: input.chatroomId, ...(input.contactId ? { contact_id: input.contactId } : {}), errorReason },
|
|
84
|
+
});
|
|
85
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// The destination data the inbox tap needs from the Wix member-link catalog (the one an app's push taps use):
|
|
2
|
+
// which links a member notification carries, and the canonical Himi screen and param each one opens.
|
|
3
|
+
//
|
|
4
|
+
// This is a COPY, on purpose. A worker's shared helpers are copied into the starter app by the template
|
|
5
|
+
// generator, which follows only relative imports that stay inside the bundles source folder, so a worker
|
|
6
|
+
// cannot import the catalog from its own package without breaking `himi init`.
|
|
7
|
+
// The copy is pinned to the catalog by the notification-target parity test (every id, link, param and
|
|
8
|
+
// screen must match), so a catalog change fails that test until this file follows it.
|
|
9
|
+
//
|
|
10
|
+
// Generated from the catalog's `id`, `matches`, `screenParam` and `canonicalScreen`; `vertical`, `audience`
|
|
11
|
+
// and the commentary belong to the catalog and are not repeated here.
|
|
12
|
+
|
|
13
|
+
export interface MemberLinkDestination {
|
|
14
|
+
id: string;
|
|
15
|
+
/** Longest first, as in the catalog. */
|
|
16
|
+
matches: readonly string[];
|
|
17
|
+
/** The capture that names the item; absent for a list screen. */
|
|
18
|
+
screenParam?: string;
|
|
19
|
+
canonicalScreen: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const MEMBER_LINK_DESTINATIONS: readonly MemberLinkDestination[] = [
|
|
23
|
+
{
|
|
24
|
+
id: "store.order",
|
|
25
|
+
matches: [
|
|
26
|
+
"my-account/:site/stores/orders/:orderId",
|
|
27
|
+
],
|
|
28
|
+
screenParam: "orderId",
|
|
29
|
+
canonicalScreen: "himi_order",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: "bookings.session",
|
|
33
|
+
matches: [
|
|
34
|
+
"bookings/app/:site/:businessId/:sessionId",
|
|
35
|
+
],
|
|
36
|
+
canonicalScreen: "himi_bookings",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "groups.post",
|
|
40
|
+
matches: [
|
|
41
|
+
"clubs-member/club/:groupId/feed/post/:postId/:commentId",
|
|
42
|
+
"clubs-member/club/:groupId/feed/post/:postId",
|
|
43
|
+
],
|
|
44
|
+
screenParam: "groupId",
|
|
45
|
+
canonicalScreen: "himi_group",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: "forum.thread",
|
|
49
|
+
matches: [
|
|
50
|
+
"forum/post/:postId/:commentId/:replyId",
|
|
51
|
+
"forum/post/:postId/:commentId",
|
|
52
|
+
"forum/post/:postId",
|
|
53
|
+
],
|
|
54
|
+
screenParam: "postId",
|
|
55
|
+
canonicalScreen: "himi_forum_post",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: "forum.create",
|
|
59
|
+
matches: [
|
|
60
|
+
"forum/create-post",
|
|
61
|
+
],
|
|
62
|
+
canonicalScreen: "himi_create_post",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: "blog.post",
|
|
66
|
+
matches: [
|
|
67
|
+
"blog/post/:postId",
|
|
68
|
+
],
|
|
69
|
+
screenParam: "postId",
|
|
70
|
+
canonicalScreen: "himi_blog_post",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: "members.profile",
|
|
74
|
+
matches: [
|
|
75
|
+
"members-area/member-profile/:memberId",
|
|
76
|
+
],
|
|
77
|
+
screenParam: "memberId",
|
|
78
|
+
canonicalScreen: "himi_member",
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: "events.event",
|
|
82
|
+
matches: [
|
|
83
|
+
"my-account/app/140603ad-af8d-84a5-2c80-a0f60cb47351/:instanceId/:eventId/guest-list/:path",
|
|
84
|
+
"my-account/app/140603ad-af8d-84a5-2c80-a0f60cb47351/:instanceId/:eventId/details",
|
|
85
|
+
],
|
|
86
|
+
screenParam: "eventId",
|
|
87
|
+
canonicalScreen: "himi_event",
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: "galleries.shared",
|
|
91
|
+
matches: [
|
|
92
|
+
"shared-gallery/:site/preview/:itemId",
|
|
93
|
+
],
|
|
94
|
+
canonicalScreen: "himi_galleries",
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: "galleries.album",
|
|
98
|
+
matches: [
|
|
99
|
+
"lists/:site/:listId/media/:itemId/:commentId",
|
|
100
|
+
"lists/:site/:listId/:tab/:commentId",
|
|
101
|
+
"spaces/lists/:site/:listId/:tab",
|
|
102
|
+
"lists/:site/:listId/:itemId",
|
|
103
|
+
],
|
|
104
|
+
// No screen reads a Photo Albums album: the tap opens the galleries list.
|
|
105
|
+
canonicalScreen: "himi_galleries",
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
id: "notifications.list",
|
|
109
|
+
matches: [
|
|
110
|
+
"notifications/list/:site",
|
|
111
|
+
],
|
|
112
|
+
canonicalScreen: "himi_notifications",
|
|
113
|
+
},
|
|
114
|
+
];
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
// Shared Wix Bookings service-price formatter for himi workers (#816).
|
|
2
|
+
//
|
|
3
|
+
// One door for turning a Wix Bookings SERVICE payload into a display price
|
|
4
|
+
// string, so the four consuming workers (himi-booking-services,
|
|
5
|
+
// himi-booking-service, himi-booking-time, himi-branded-lite-home) can never
|
|
6
|
+
// drift apart again. Each used to read `payment.price ?? service.price` and
|
|
7
|
+
// default the currency to "USD" — but the live Bookings v2 payload nests the
|
|
8
|
+
// fixed price under `payment.fixed.price.{value,currency}` (Money; `value` is a
|
|
9
|
+
// decimal string), so on a real ILS site the amount rendered blank (the flat
|
|
10
|
+
// fields are absent) or, once decoded, in the wrong "$" currency (the ₪ was
|
|
11
|
+
// dropped). This helper reads the v2 nested shape FIRST and derives the currency
|
|
12
|
+
// FROM THE RECORD, falling back to the legacy/flat shapes for older payloads.
|
|
13
|
+
//
|
|
14
|
+
// Pure + dependency-free (structural `unknown` input, no SDK import) so it bundles
|
|
15
|
+
// into every worker and gen-templates copies it verbatim into each tier5-src.
|
|
16
|
+
|
|
17
|
+
import { formatCurrency } from "../_shared/engine-intl.js";
|
|
18
|
+
/** Coerce a number or numeric string to a finite number, else undefined. */
|
|
19
|
+
function numberOf(value: unknown): number | undefined {
|
|
20
|
+
if (typeof value === "number") return Number.isFinite(value) ? value : undefined;
|
|
21
|
+
if (typeof value === "string" && value.trim()) {
|
|
22
|
+
const n = Number(value);
|
|
23
|
+
return Number.isNaN(n) ? undefined : n;
|
|
24
|
+
}
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Non-empty trimmed string, else "". */
|
|
29
|
+
function stringOf(value: unknown): string {
|
|
30
|
+
return typeof value === "string" ? value.trim() : "";
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
type LooseService = {
|
|
34
|
+
payment?: {
|
|
35
|
+
rateType?: unknown;
|
|
36
|
+
fixed?: { price?: { value?: unknown; amount?: unknown; currency?: unknown } };
|
|
37
|
+
price?: unknown;
|
|
38
|
+
currency?: unknown;
|
|
39
|
+
};
|
|
40
|
+
price?: unknown;
|
|
41
|
+
currency?: unknown;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The numeric price amount for a service, following the same v2-first priority
|
|
46
|
+
* as {@link formatServicePrice}. Returns undefined when there is no usable
|
|
47
|
+
* amount or the rate type is non-FIXED — callers use it for "is this a paid
|
|
48
|
+
* service?" decisions so the flag never disagrees with the rendered price.
|
|
49
|
+
*/
|
|
50
|
+
export function serviceAmount(service: unknown): number | undefined {
|
|
51
|
+
const s = (service ?? {}) as LooseService;
|
|
52
|
+
const payment = s.payment ?? {};
|
|
53
|
+
|
|
54
|
+
// A declared non-FIXED rate type (VARIED/CUSTOM/NO_FEE) carries no single fixed
|
|
55
|
+
// amount. An ABSENT rateType (legacy/flat payloads) is NOT treated as non-FIXED.
|
|
56
|
+
const rateType = stringOf(payment.rateType).toUpperCase();
|
|
57
|
+
if (rateType && rateType !== "FIXED") return undefined;
|
|
58
|
+
|
|
59
|
+
const fixed = payment.fixed?.price;
|
|
60
|
+
return numberOf(fixed?.value ?? fixed?.amount ?? payment.price ?? s.price);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The currency for a service, derived FROM THE RECORD (v2 nested first, then
|
|
65
|
+
* legacy nested, then top-level). "USD" is only the absolute last resort when
|
|
66
|
+
* no currency is present anywhere — it never overrides one the record carries.
|
|
67
|
+
*/
|
|
68
|
+
export function serviceCurrency(service: unknown): string {
|
|
69
|
+
const s = (service ?? {}) as LooseService;
|
|
70
|
+
const payment = s.payment ?? {};
|
|
71
|
+
return (
|
|
72
|
+
stringOf(payment.fixed?.price?.currency) ||
|
|
73
|
+
stringOf(payment.currency) ||
|
|
74
|
+
stringOf(s.currency) ||
|
|
75
|
+
"USD"
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Whether money is due for this service — a MONEY decision, deliberately not the same
|
|
81
|
+
* predicate as "do we have a number to display".
|
|
82
|
+
*
|
|
83
|
+
* `serviceAmount` returns undefined for any non-FIXED rate type, which is right for
|
|
84
|
+
* display (there is no single figure to render) and wrong for routing: a VARIED or CUSTOM
|
|
85
|
+
* service is chargeable, it just has no fixed figure. Deriving "is this paid?" from
|
|
86
|
+
* `serviceAmount() > 0` therefore sent such a booking down the FREE branch — booked, never
|
|
87
|
+
* charged. `NO_FEE` is the one non-FIXED type that really is free.
|
|
88
|
+
*
|
|
89
|
+
* Fails toward charging: the checkout path already degrades gracefully when nothing is
|
|
90
|
+
* actually owed (no `paymentGatewayOrderId` ⇒ it completes the booking and stops), so a
|
|
91
|
+
* false positive costs nothing while a false negative gives the service away.
|
|
92
|
+
*/
|
|
93
|
+
export function serviceIsChargeable(service: unknown): boolean {
|
|
94
|
+
const s = (service ?? {}) as LooseService;
|
|
95
|
+
const rateType = stringOf(s.payment?.rateType).toUpperCase();
|
|
96
|
+
if (rateType === "NO_FEE") return false;
|
|
97
|
+
if (rateType && rateType !== "FIXED") return true; // VARIED / CUSTOM: priced, just not fixed
|
|
98
|
+
const amount = serviceAmount(service);
|
|
99
|
+
return amount != null && amount > 0;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Format one Bookings v2 Money value (`{ value, currency }`, `value` a decimal string) — a
|
|
104
|
+
* price, a deposit, a VARIED minimum, a cancellation fee. A whole amount drops its cents
|
|
105
|
+
* ("₪90", not "₪90.00"), as the service screen shows it. "" when it carries no usable
|
|
106
|
+
* amount. The currency comes from the Money itself, then from `fallbackCurrency`.
|
|
107
|
+
*/
|
|
108
|
+
export function formatServiceMoney(money: unknown, fallbackCurrency = "USD"): string {
|
|
109
|
+
const m = (money ?? {}) as { value?: unknown; amount?: unknown; currency?: unknown };
|
|
110
|
+
const amount = numberOf(m.value ?? m.amount);
|
|
111
|
+
if (amount == null) return "";
|
|
112
|
+
const currency = stringOf(m.currency) || fallbackCurrency;
|
|
113
|
+
try {
|
|
114
|
+
return formatCurrency(amount, currency, undefined, Number.isInteger(amount) ? 0 : undefined);
|
|
115
|
+
} catch {
|
|
116
|
+
return `${amount}`;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Format a Wix Bookings service's price for display, e.g. "₪111" / "$20" / "$19.50".
|
|
122
|
+
*
|
|
123
|
+
* Reads, in order of preference:
|
|
124
|
+
* 1. Bookings v2 fixed price — `payment.fixed.price.{value,currency}` (the
|
|
125
|
+
* live shape; `value`/`amount` is a decimal string, currency is real).
|
|
126
|
+
* 2. Legacy nested — `payment.price` / `payment.currency`.
|
|
127
|
+
* 3. Top-level — `service.price` / `service.currency`.
|
|
128
|
+
*
|
|
129
|
+
* The currency is ALWAYS derived from the record; "USD" is only the absolute
|
|
130
|
+
* last resort when no currency is present anywhere (so behavior is unchanged
|
|
131
|
+
* when the data simply carries none). A non-FIXED `rateType`
|
|
132
|
+
* (VARIED/CUSTOM/NO_FEE) has no single amount to show → returns "".
|
|
133
|
+
* Returns "" (never throws) when there is no usable numeric amount.
|
|
134
|
+
*/
|
|
135
|
+
export function formatServicePrice(service: unknown): string {
|
|
136
|
+
const amount = serviceAmount(service);
|
|
137
|
+
if (amount == null) return "";
|
|
138
|
+
const currency = serviceCurrency(service);
|
|
139
|
+
try {
|
|
140
|
+
// A whole amount drops its cents ("₪70", not "₪70.00"), as formatServiceMoney and the service
|
|
141
|
+
// screen show it, so the same service reads the same price on every screen.
|
|
142
|
+
return formatCurrency(amount, currency, undefined, Number.isInteger(amount) ? 0 : undefined);
|
|
143
|
+
} catch {
|
|
144
|
+
return `${amount}`;
|
|
145
|
+
}
|
|
146
|
+
}
|