@profitstudio/booking-engine 2.0.0-beta.1 → 2.0.0-beta.2
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 +16 -0
- package/README.md +1 -1
- package/dist/admin/BookingAdmin.d.ts +8 -1
- package/dist/admin/BookingAdmin.js +2 -1
- package/dist/admin/booking-detail.d.ts +11 -1
- package/dist/admin/booking-detail.js +23 -13
- package/dist/admin/context.d.ts +4 -0
- package/dist/admin/index.d.ts +1 -0
- package/dist/admin/sections/EmailSection.js +4 -2
- package/dist/admin/sections/OverviewSection.js +2 -2
- package/dist/generated/manifest.d.ts +1 -1
- package/dist/generated/manifest.js +1 -1
- package/docs/INTEGRATION.md +7 -4
- package/engine.manifest.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog — @profitstudio/booking-engine
|
|
2
2
|
|
|
3
|
+
## 2.0.0-beta.2 — 2026-11-04
|
|
4
|
+
|
|
5
|
+
A dashboard option for public demos. **No migration** (schema 2.0.0-alpha.10),
|
|
6
|
+
no client or Edge Function change, and no change for existing sites.
|
|
7
|
+
|
|
8
|
+
**Added:**
|
|
9
|
+
|
|
10
|
+
- `<BookingAdmin emailDelivery="none">` (optional; default `'live'`) for an
|
|
11
|
+
installation that never emails anyone — a public demo or a showcase. The
|
|
12
|
+
dashboard then never says a customer gets an email: the answer footnote under a
|
|
13
|
+
request, the toast after Confirm / Decline / Cancel and the Decline / Cancel
|
|
14
|
+
dialogs say that no email is sent from the demo, and the Email page's subtitle
|
|
15
|
+
starts with "This demo sends no email". Without the prop (or with `'live'`)
|
|
16
|
+
every text is exactly as in 2.0.0-beta.1. Type: `EmailDelivery` from
|
|
17
|
+
`@profitstudio/booking-engine/admin`.
|
|
18
|
+
|
|
3
19
|
## 2.0.0-beta.1 — 2026-11-03
|
|
4
20
|
|
|
5
21
|
First public beta, after the hosted rehearsal (a real Supabase project, Resend,
|
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ an AI builder.
|
|
|
12
12
|
- Changes and upgrade notes: [CHANGELOG.md](CHANGELOG.md)
|
|
13
13
|
- Versions: see `engine.manifest.json`
|
|
14
14
|
|
|
15
|
-
**Status:** 2.0.0-beta.
|
|
15
|
+
**Status:** 2.0.0-beta.2 — public beta (owner-editable website content, the Studio dashboard, calendar helpers for booking UIs, optional service photos, opening times with closures; builds check the Supabase connection; the dashboard asks where new-request alerts go; `connect` sets up Supabase and email, `photos` prepares a site's photos). Install the exact version.
|
|
16
16
|
|
|
17
17
|
## Licence
|
|
18
18
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { BookingEngine } from '../client.js';
|
|
2
2
|
import type { SiteContentSchema } from '../content/schema.js';
|
|
3
3
|
import type { Preset } from '../types.js';
|
|
4
|
+
import { type EmailDelivery } from './context.js';
|
|
4
5
|
export interface BookingAdminProps {
|
|
5
6
|
/** The same engine instance the website uses. */
|
|
6
7
|
engine: BookingEngine;
|
|
@@ -13,10 +14,16 @@ export interface BookingAdminProps {
|
|
|
13
14
|
* it the Website section explains how to add some.
|
|
14
15
|
*/
|
|
15
16
|
content?: SiteContentSchema;
|
|
17
|
+
/**
|
|
18
|
+
* How booking emails reach customers. 'live' (the default): the engine's mailer
|
|
19
|
+
* sends them. 'none': an installation that never emails anyone — a public demo
|
|
20
|
+
* or a showcase. The dashboard then never says that a customer gets an email.
|
|
21
|
+
*/
|
|
22
|
+
emailDelivery?: EmailDelivery;
|
|
16
23
|
}
|
|
17
24
|
export type Appearance = 'system' | 'light' | 'dark';
|
|
18
25
|
/**
|
|
19
26
|
* The packaged admin dashboard. Mount it on its own page (e.g. /admin/).
|
|
20
27
|
* It handles sign-in, admin checks and every management screen.
|
|
21
28
|
*/
|
|
22
|
-
export declare function BookingAdmin({ engine, presets, siteUrl, content }: BookingAdminProps): import("react").JSX.Element;
|
|
29
|
+
export declare function BookingAdmin({ engine, presets, siteUrl, content, emailDelivery }: BookingAdminProps): import("react").JSX.Element;
|
|
@@ -58,7 +58,7 @@ function routeFromHash() {
|
|
|
58
58
|
* The packaged admin dashboard. Mount it on its own page (e.g. /admin/).
|
|
59
59
|
* It handles sign-in, admin checks and every management screen.
|
|
60
60
|
*/
|
|
61
|
-
export function BookingAdmin({ engine, presets, siteUrl = '/', content }) {
|
|
61
|
+
export function BookingAdmin({ engine, presets, siteUrl = '/', content, emailDelivery = 'live' }) {
|
|
62
62
|
const [phase, setPhase] = useState({ kind: 'checking' });
|
|
63
63
|
const { appearance, setAppearance, mode } = useAppearance();
|
|
64
64
|
const rootProps = { 'data-appearance': appearance, 'data-mode': mode };
|
|
@@ -215,6 +215,7 @@ export function BookingAdmin({ engine, presets, siteUrl = '/', content }) {
|
|
|
215
215
|
refreshCounts,
|
|
216
216
|
contentSchema: content ?? null,
|
|
217
217
|
siteUrl,
|
|
218
|
+
emailDelivery,
|
|
218
219
|
website,
|
|
219
220
|
refreshWebsite,
|
|
220
221
|
toast,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AdminBooking, AdminService, BookingStatus } from '../types.js';
|
|
2
|
+
import { type EmailDelivery } from './context.js';
|
|
2
3
|
import type { ConfirmInput } from './feedback.js';
|
|
3
4
|
export interface BookingAction {
|
|
4
5
|
status: Exclude<BookingStatus, 'pending'>;
|
|
@@ -7,8 +8,17 @@ export interface BookingAction {
|
|
|
7
8
|
/** Asked first, for answers that email the customer and cannot be taken back. */
|
|
8
9
|
confirm?: ConfirmInput;
|
|
9
10
|
}
|
|
11
|
+
/** What an answer means for the customer's inbox — in the confirm dialogs. */
|
|
12
|
+
export declare const notifies: (b: AdminBooking, delivery?: EmailDelivery) => string;
|
|
13
|
+
/** The line under a request's answers. */
|
|
14
|
+
export declare const answerNote: (b: AdminBooking, delivery?: EmailDelivery) => string;
|
|
10
15
|
/** The answers that make sense for a booking right now. */
|
|
11
|
-
export declare function actionsFor(b: AdminBooking, now?: number): BookingAction[];
|
|
16
|
+
export declare function actionsFor(b: AdminBooking, now?: number, delivery?: EmailDelivery): BookingAction[];
|
|
17
|
+
/** The toast after an answer. */
|
|
18
|
+
export declare function doneMessage(b: AdminBooking, a: BookingAction, delivery?: EmailDelivery): {
|
|
19
|
+
title: string;
|
|
20
|
+
detail?: string;
|
|
21
|
+
};
|
|
12
22
|
/**
|
|
13
23
|
* Run an answer: ask first when needed, save it, tell the owner, recount the
|
|
14
24
|
* badge. Resolves to the updated booking, or an error message to show in place.
|
|
@@ -10,11 +10,20 @@ import { Drawer } from './drawer.js';
|
|
|
10
10
|
import { Icon } from './icons.js';
|
|
11
11
|
import { holdState } from './today.js';
|
|
12
12
|
import { Button, IconButton, Notice, StatusBadge, firstName, formatMinutes, formatSpan, useNow } from './ui.js';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
/** What an answer means for the customer's inbox — in the confirm dialogs. */
|
|
14
|
+
export const notifies = (b, delivery = 'live') => delivery === 'none'
|
|
15
|
+
? 'No email is sent from this demo.'
|
|
16
|
+
: b.emailVerified
|
|
17
|
+
? `${firstName(b.customer.name)} gets an email.`
|
|
18
|
+
: `${firstName(b.customer.name)}’s email address was never verified, so they are not emailed — contact them directly.`;
|
|
19
|
+
/** The line under a request's answers. */
|
|
20
|
+
export const answerNote = (b, delivery = 'live') => delivery === 'none'
|
|
21
|
+
? 'No email is sent from this demo — answer here and see the result on the website.'
|
|
22
|
+
: b.emailVerified
|
|
23
|
+
? `${b.customer.name} gets an email with your answer.`
|
|
24
|
+
: `${b.customer.name} is not emailed (unverified address).`;
|
|
16
25
|
/** The answers that make sense for a booking right now. */
|
|
17
|
-
export function actionsFor(b, now = Date.now()) {
|
|
26
|
+
export function actionsFor(b, now = Date.now(), delivery = 'live') {
|
|
18
27
|
const started = Date.parse(b.startsAt) <= now;
|
|
19
28
|
if (b.status === 'pending' || b.status === 'expired') {
|
|
20
29
|
return [
|
|
@@ -24,7 +33,7 @@ export function actionsFor(b, now = Date.now()) {
|
|
|
24
33
|
tone: 'danger',
|
|
25
34
|
confirm: {
|
|
26
35
|
title: `Decline ${b.customer.name}’s request?`,
|
|
27
|
-
body: `The time opens again for other customers. ${notifies(b)}`,
|
|
36
|
+
body: `The time opens again for other customers. ${notifies(b, delivery)}`,
|
|
28
37
|
confirmLabel: 'Decline request',
|
|
29
38
|
cancelLabel: 'Keep the request',
|
|
30
39
|
},
|
|
@@ -39,7 +48,7 @@ export function actionsFor(b, now = Date.now()) {
|
|
|
39
48
|
tone: 'danger',
|
|
40
49
|
confirm: {
|
|
41
50
|
title: `Cancel ${b.customer.name}’s appointment?`,
|
|
42
|
-
body: `The time opens again for other customers. ${notifies(b)}`,
|
|
51
|
+
body: `The time opens again for other customers. ${notifies(b, delivery)}`,
|
|
43
52
|
confirmLabel: 'Cancel appointment',
|
|
44
53
|
cancelLabel: 'Keep it',
|
|
45
54
|
},
|
|
@@ -50,9 +59,10 @@ export function actionsFor(b, now = Date.now()) {
|
|
|
50
59
|
}
|
|
51
60
|
return [];
|
|
52
61
|
}
|
|
53
|
-
|
|
62
|
+
/** The toast after an answer. */
|
|
63
|
+
export function doneMessage(b, a, delivery = 'live') {
|
|
54
64
|
const name = b.customer.name;
|
|
55
|
-
const emailed = b.emailVerified ? `${firstName(name)} gets an email` : undefined;
|
|
65
|
+
const emailed = delivery === 'live' && b.emailVerified ? `${firstName(name)} gets an email` : undefined;
|
|
56
66
|
if (a.status === 'confirmed')
|
|
57
67
|
return { title: `${name} confirmed`, detail: emailed };
|
|
58
68
|
if (a.status === 'cancelled')
|
|
@@ -66,7 +76,7 @@ function doneMessage(b, a) {
|
|
|
66
76
|
* badge. Resolves to the updated booking, or an error message to show in place.
|
|
67
77
|
*/
|
|
68
78
|
export function useBookingActions() {
|
|
69
|
-
const { engine, toast, confirm, refreshCounts } = useAdmin();
|
|
79
|
+
const { engine, toast, confirm, refreshCounts, emailDelivery } = useAdmin();
|
|
70
80
|
return async (b, a, onStart) => {
|
|
71
81
|
if (a.confirm && !(await confirm(a.confirm)))
|
|
72
82
|
return { skipped: true };
|
|
@@ -74,7 +84,7 @@ export function useBookingActions() {
|
|
|
74
84
|
const r = await engine.admin.setBookingStatus(b.id, a.status);
|
|
75
85
|
if (!r.ok)
|
|
76
86
|
return { error: r.error.message };
|
|
77
|
-
toast({ kind: 'success', ...doneMessage(b, a) });
|
|
87
|
+
toast({ kind: 'success', ...doneMessage(b, a, emailDelivery) });
|
|
78
88
|
refreshCounts();
|
|
79
89
|
return { booking: r.data };
|
|
80
90
|
};
|
|
@@ -97,7 +107,7 @@ export function priceText(b, services, locale) {
|
|
|
97
107
|
}
|
|
98
108
|
/** The detail panel for one booking. */
|
|
99
109
|
export function BookingDrawer({ booking, services, docked, onClose, onChanged, onPrevious, onNext, }) {
|
|
100
|
-
const { settings } = useAdmin();
|
|
110
|
+
const { settings, emailDelivery } = useAdmin();
|
|
101
111
|
const run = useBookingActions();
|
|
102
112
|
const now = useNow(15_000);
|
|
103
113
|
const [busy, setBusy] = useState(null);
|
|
@@ -109,7 +119,7 @@ export function BookingDrawer({ booking, services, docked, onClose, onChanged, o
|
|
|
109
119
|
const time = (hhmm) => formatClockTime(hhmm, locale);
|
|
110
120
|
const at = (iso) => formatDateTime(iso, tz, locale, { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' });
|
|
111
121
|
const hold = b.status === 'pending' || b.status === 'expired' ? holdState(b, settings.pendingHoldMinutes, now) : null;
|
|
112
|
-
const actions = actionsFor(b, now);
|
|
122
|
+
const actions = actionsFor(b, now, emailDelivery);
|
|
113
123
|
const minutes = Math.round((Date.parse(b.endsAt) - Date.parse(b.startsAt)) / 60_000);
|
|
114
124
|
const name = firstName(b.customer.name);
|
|
115
125
|
const phoneHref = b.customer.phone ? `tel:${b.customer.phone.replace(/[^\d+]/g, '')}` : null;
|
|
@@ -136,7 +146,7 @@ export function BookingDrawer({ booking, services, docked, onClose, onChanged, o
|
|
|
136
146
|
? 'Cancelled'
|
|
137
147
|
: b.status === 'completed'
|
|
138
148
|
? 'Marked as done'
|
|
139
|
-
: 'Marked as a no-show' }) }), _jsx("time", { dateTime: b.statusChangedAt, children: at(b.statusChangedAt) })] }))] })] })] }), actions.length ? (_jsxs("div", { className: "pbe-drawer-foot", children: [b.status === 'pending' || b.status === 'expired' ? (_jsx("p", { className: "pbe-drawer-foot-note", children: b
|
|
149
|
+
: 'Marked as a no-show' }) }), _jsx("time", { dateTime: b.statusChangedAt, children: at(b.statusChangedAt) })] }))] })] })] }), actions.length ? (_jsxs("div", { className: "pbe-drawer-foot", children: [b.status === 'pending' || b.status === 'expired' ? (_jsx("p", { className: "pbe-drawer-foot-note", children: answerNote(b, emailDelivery) })) : null, _jsx("div", { className: `pbe-drawer-actions${primaryRow.length === 2 ? ' pbe-drawer-actions--weighted' : ''}`, children: primaryRow.map((a) => (_jsx(Button, { variant: a.tone === 'primary' ? 'primary' : a.tone === 'danger' ? 'danger-quiet' : 'secondary', icon: a.status === 'confirmed' || a.status === 'completed' ? 'check' : undefined, loading: busy === a.status, disabled: busy !== null && busy !== a.status, onClick: () => void act(a), children: a.status === 'confirmed' ? 'Confirm request' : a.label }, a.status))) }), trailing ? (_jsx(Button, { variant: "quiet", size: "sm", className: "pbe-button--danger-text", loading: busy === 'cancelled', disabled: busy !== null && busy !== 'cancelled', onClick: () => void act(trailing), children: trailing.label })) : null] })) : null] }));
|
|
140
150
|
}
|
|
141
151
|
function CopyButton({ text }) {
|
|
142
152
|
const [copied, setCopied] = useState(false);
|
package/dist/admin/context.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import type { BookingEngine } from '../client.js';
|
|
|
2
2
|
import type { SiteContentSchema } from '../content/schema.js';
|
|
3
3
|
import type { AdminSettings, Preset } from '../types.js';
|
|
4
4
|
import type { ConfirmInput, ToastInput } from './feedback.js';
|
|
5
|
+
/** Whether this installation emails customers ('none': a demo — see BookingAdminProps.emailDelivery). */
|
|
6
|
+
export type EmailDelivery = 'live' | 'none';
|
|
5
7
|
/** What the navigation shows about the website (null until known, or without editable content). */
|
|
6
8
|
export interface WebsiteStatus {
|
|
7
9
|
version: number;
|
|
@@ -25,6 +27,8 @@ export interface AdminContextValue {
|
|
|
25
27
|
contentSchema: SiteContentSchema | null;
|
|
26
28
|
/** The public website (for "View website" and previews). */
|
|
27
29
|
siteUrl: string;
|
|
30
|
+
/** 'none' in a demo that never emails anyone: no copy may say a customer gets an email. */
|
|
31
|
+
emailDelivery: EmailDelivery;
|
|
28
32
|
/** Published version and draft state, for the navigation and Today. */
|
|
29
33
|
website: WebsiteStatus | null;
|
|
30
34
|
refreshWebsite: () => void;
|
package/dist/admin/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { BookingAdmin } from './BookingAdmin.js';
|
|
2
2
|
export type { Appearance, BookingAdminProps } from './BookingAdmin.js';
|
|
3
|
+
export type { EmailDelivery } from './context.js';
|
|
3
4
|
export { ADMIN_SECTIONS } from './sections.js';
|
|
4
5
|
export type { AdminSection } from './sections.js';
|
|
5
6
|
export { BUSINESS_GROUP, POLICY_GROUP } from './fields.js';
|
|
@@ -58,7 +58,7 @@ function reveal(id) {
|
|
|
58
58
|
}
|
|
59
59
|
/** Email health, test email, the online-booking switch and email settings. */
|
|
60
60
|
export function EmailSection() {
|
|
61
|
-
const { engine, settings, refreshSettings, toast, view } = useAdmin();
|
|
61
|
+
const { engine, settings, refreshSettings, toast, view, emailDelivery } = useAdmin();
|
|
62
62
|
const [load, reload] = useResult(() => engine.admin.emailStatus(), []);
|
|
63
63
|
// Where new-request alerts go (the alerts address, else the public email); the test email goes there by default.
|
|
64
64
|
const alerts = alertsAddress(settings);
|
|
@@ -172,7 +172,9 @@ export function EmailSection() {
|
|
|
172
172
|
const online = settings.onlineBookingEnabled;
|
|
173
173
|
// Going live needs both: customers receive their codes, and the owner hears about every request.
|
|
174
174
|
const canGoLive = working && Boolean(alerts);
|
|
175
|
-
return (_jsxs("section", { "aria-labelledby": "pbe-email-title", className: "pbe-page", children: [_jsx(PageHeader, { id: "pbe-email-title", title: "Email & online booking", sub:
|
|
175
|
+
return (_jsxs("section", { "aria-labelledby": "pbe-email-title", className: "pbe-page", children: [_jsx(PageHeader, { id: "pbe-email-title", title: "Email & online booking", sub: emailDelivery === 'none'
|
|
176
|
+
? 'This demo sends no email. On your own website, customers confirm their email address with a code before a request reaches you, get an email when you confirm, decline or cancel, and you are emailed about every new request.'
|
|
177
|
+
: `Customers confirm their email address with a code before a request reaches you, and get an email when you confirm, decline or cancel.${alerts ? ` You are emailed about every new request at ${alerts}.` : ''}` }), problem ? _jsx(Notice, { kind: "error", children: problem }) : null, !alerts ? (_jsxs(Notice, { kind: "warning", children: [_jsx("strong", { children: "New-request alerts have no address." }), " Nobody is emailed when a customer asks for an appointment, so a request could wait unanswered until its hold ends. Choose an address under \u201CSend new-request alerts to\u201D, or add a public email in Business.", ' ', _jsx("button", { type: "button", className: "pbe-link-button", onClick: () => reveal(ALERTS_FIELD), children: "Choose an address" })] })) : null, _jsxs("div", { className: "pbe-grid-2", children: [_jsxs("div", { className: "pbe-card pbe-card--pad pbe-stack", "aria-labelledby": "pbe-online-title", role: "region", children: [_jsxs("div", { className: "pbe-status-head", children: [_jsx("span", { className: `pbe-status-icon${online ? ' pbe-status-icon--ok' : ''}`, "aria-hidden": "true", children: _jsx(Icon, { name: "online", size: 20 }) }), _jsxs("div", { children: [_jsxs("h2", { id: "pbe-online-title", className: "pbe-card-title", children: ["Online booking is ", online ? 'on' : 'off'] }), _jsx("p", { className: "pbe-card-sub", children: online
|
|
176
178
|
? 'Customers can request appointments on your website.'
|
|
177
179
|
: !working
|
|
178
180
|
? 'Send a test email first: customers must be able to receive their code before they can book.'
|
|
@@ -51,7 +51,7 @@ const FIRST_REQUESTS = { wide: 3, phone: 2 };
|
|
|
51
51
|
* booking drawer). When nothing waits, the same place says so, calmly.
|
|
52
52
|
*/
|
|
53
53
|
function Requests({ requests, services, now, onOpen, onAnswered, }) {
|
|
54
|
-
const { settings, go } = useAdmin();
|
|
54
|
+
const { settings, go, emailDelivery } = useAdmin();
|
|
55
55
|
const run = useBookingActions();
|
|
56
56
|
const phone = useMediaQuery('(max-width: 899px)');
|
|
57
57
|
const [expanded, setExpanded] = useState(false);
|
|
@@ -103,7 +103,7 @@ function Requests({ requests, services, now, onOpen, onAnswered, }) {
|
|
|
103
103
|
return (_jsxs("section", { ref: panel, className: "pbe-urgent", "aria-labelledby": "pbe-urgent-title", children: [_jsxs("div", { className: "pbe-urgent-head", children: [_jsx("span", { className: "pbe-urgent-number", "aria-hidden": "true", children: n }), _jsxs("div", { className: "pbe-urgent-text", children: [_jsxs("h2", { id: "pbe-urgent-title", className: "pbe-urgent-title", tabIndex: -1, children: [_jsxs("span", { className: "pbe-sr-only", children: [n, " "] }), n === 1 ? 'request needs your answer' : 'requests need your answer'] }), _jsx("p", { className: "pbe-urgent-sub", children: soonest ? (_jsxs(_Fragment, { children: ["Times stay held until you answer or the hold ends. Next to expire: ", _jsx("b", { children: firstName(soonest.customer.name) }), ", at", ' ', _jsx("b", { children: until(soonest.holdExpiresAt) }), ".", ended ? (_jsxs(_Fragment, { children: [' ', _jsxs("span", { className: "pbe-urgent-ended", children: [ended === 1 ? '1 hold has ended' : `${ended} holds have ended`, ": confirm ", ended === 1 ? 'it' : 'them', " if the time is still free."] })] })) : null] })) : n === 1 ? ('Its hold has ended, so the time is open to others again. Confirm it if the time is still free.') : ('Their holds have ended, so the times are open to others again. Confirm the ones that are still free.') })] }), _jsx(Button, { size: "sm", className: "pbe-urgent-link", iconAfter: "arrow", onClick: () => go('bookings', 'pending'), children: "Open in Bookings" })] }), _jsxs("div", { className: "pbe-requests", children: [_jsx("ul", { className: "pbe-requests-list", id: "pbe-requests-list", "aria-labelledby": "pbe-urgent-title", children: shown.map((b, index) => {
|
|
104
104
|
const hold = holdState(b, settings.pendingHoldMinutes, now);
|
|
105
105
|
const isEnded = !holdRunning(b, now);
|
|
106
|
-
const actions = actionsFor(b, now);
|
|
106
|
+
const actions = actionsFor(b, now, emailDelivery);
|
|
107
107
|
const decline = actions.find((a) => a.status === 'cancelled');
|
|
108
108
|
const confirm = actions.find((a) => a.status === 'confirmed');
|
|
109
109
|
const error = errors[b.id];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const ENGINE_PACKAGE = "@profitstudio/booking-engine";
|
|
2
|
-
export declare const ENGINE_VERSION = "2.0.0-beta.
|
|
2
|
+
export declare const ENGINE_VERSION = "2.0.0-beta.2";
|
|
3
3
|
/** Schema version this package's migrations produce. */
|
|
4
4
|
export declare const SCHEMA_VERSION = "2.0.0-alpha.10";
|
|
5
5
|
/** Oldest database schema this package can talk to (same major). */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// GENERATED by scripts/build.mjs from package.json — do not edit.
|
|
2
2
|
export const ENGINE_PACKAGE = "@profitstudio/booking-engine";
|
|
3
|
-
export const ENGINE_VERSION = "2.0.0-beta.
|
|
3
|
+
export const ENGINE_VERSION = "2.0.0-beta.2";
|
|
4
4
|
/** Schema version this package's migrations produce. */
|
|
5
5
|
export const SCHEMA_VERSION = "2.0.0-alpha.10";
|
|
6
6
|
/** Oldest database schema this package can talk to (same major). */
|
package/docs/INTEGRATION.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Booking Engine — Integration Contract
|
|
2
2
|
|
|
3
|
-
`@profitstudio/booking-engine` · engine 2.0.0-beta.
|
|
3
|
+
`@profitstudio/booking-engine` · engine 2.0.0-beta.2 · database schema 2.0.0-alpha.10
|
|
4
4
|
(booking works from schema alpha.5; website content (§15) needs alpha.7;
|
|
5
5
|
service photos and opening times need alpha.10)
|
|
6
6
|
|
|
@@ -56,7 +56,7 @@ prompt and this document disagree on a technical point, this document wins.
|
|
|
56
56
|
## 3. Install
|
|
57
57
|
|
|
58
58
|
```bash
|
|
59
|
-
npm install --save-exact @profitstudio/booking-engine@2.0.0-beta.
|
|
59
|
+
npm install --save-exact @profitstudio/booking-engine@2.0.0-beta.2 # exact version from the guide
|
|
60
60
|
npx booking-engine init # a hair salon may add: --preset hair-salon
|
|
61
61
|
```
|
|
62
62
|
|
|
@@ -622,9 +622,12 @@ createRoot(document.getElementById('admin')!).render(
|
|
|
622
622
|
```
|
|
623
623
|
|
|
624
624
|
Props: `engine` (the site's one instance), `siteUrl` (default `/`), `content`
|
|
625
|
-
(optional, §15)
|
|
625
|
+
(optional, §15), `presets` (optional: the starter sets offered while the
|
|
626
626
|
owner has no services; default the engine's own — pass the site's preset from
|
|
627
|
-
§5 for any other kind of business)
|
|
627
|
+
§5 for any other kind of business) and `emailDelivery` (optional, since
|
|
628
|
+
2.0.0-beta.2: `'live'` by default; `'none'` only for a public demo or showcase
|
|
629
|
+
that never emails anyone — the dashboard then never says a customer gets an
|
|
630
|
+
email. A real site never sets it).
|
|
628
631
|
|
|
629
632
|
The dashboard handles sign-in, the admin check, a **Today** overview (the
|
|
630
633
|
requests waiting for an answer, with their hold countdown and Confirm /
|
package/engine.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@profitstudio/booking-engine",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.2",
|
|
4
4
|
"description": "Secure, versioned booking engine for independently owned small-business websites: Supabase migrations, a typed client, an admin dashboard and a CLI.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Youssef Es-salhi",
|