@ai-matrx/records 0.27.0 → 0.28.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,28 @@
1
1
  # Changelog — @ai-matrx/records
2
2
 
3
+ ## 0.28.0
4
+
5
+ **The owner's side of a booking page — the one method that was standing between
6
+ `BookingSlots` and being the panel it should be.**
7
+
8
+ `bookings({ table_id? })` over `custom.bookings`, which has been live and granted to
9
+ `authenticated` since lane BOOKING landed and which no client could name. It is
10
+ modelled line for line on `forms()`, because a booking page IS an `anon_form`: the
11
+ same object, asked for its booking half, opened and closed by the same
12
+ `anonPublish`. `BookingSummary` (`src/rule.ts`) carries what makes the list worth
13
+ opening — booked, cancelled, still upcoming, how many slots somebody is holding
14
+ right now, and when the next appointment is — every number the store's own, because
15
+ a screen that counted appointments in the browser would drift from the unique index
16
+ that actually protects a slot.
17
+
18
+ `bookingPath(formId)` sits beside `publicFormPath` for the same reason: the page id
19
+ IS the capability, and the visitor's `booking_ref` is the separate secret that lets
20
+ ONE person manage the appointment they made.
21
+
22
+ The VISITOR's three doors (`booking_public`, `booking_hold`, `booking_confirm`) are
23
+ deliberately still absent from this client. They are server-lane, a signed-out
24
+ visitor reaches them through the host's own route, and a browser never calls them.
25
+
3
26
  ## 0.27.0
4
27
 
5
28
  **"Give me a board of deals by stage" — the rules that judge every move become
@@ -73,6 +73,7 @@ __export(core_exports, {
73
73
  asPermissionLevel: () => asPermissionLevel,
74
74
  asWriteConflict: () => asWriteConflict,
75
75
  atLeast: () => atLeast,
76
+ bookingPath: () => bookingPath,
76
77
  cellText: () => cellText,
77
78
  choiceSlug: () => choiceSlug,
78
79
  choiceValuesOf: () => choiceValuesOf,
@@ -251,6 +252,9 @@ function mayDrag(level) {
251
252
  }
252
253
 
253
254
  // src/rule.ts
255
+ function bookingPath(formId) {
256
+ return `/b/${formId}`;
257
+ }
254
258
  function publicFormPath(formId) {
255
259
  return `/f/${formId}`;
256
260
  }
@@ -2383,6 +2387,12 @@ var DOORS = {
2383
2387
  // are server-lane doors and a browser never calls them.
2384
2388
  forms: "forms",
2385
2389
  formDeclare: "form_declare",
2390
+ // PRODUCTS row 14 — "let clients book a 30-minute consult". A booking page IS an
2391
+ // `anon_form`, so it is opened and closed by `anonPublish` like any other; this is
2392
+ // the owner's list of them with the numbers that make it worth opening. The
2393
+ // VISITOR's three (`booking_public`, `booking_hold`, `booking_confirm`) are
2394
+ // deliberately absent: they are server-lane and a browser never calls them.
2395
+ bookings: "bookings",
2386
2396
  // PRODUCTS row 9 — "pull my spreadsheet in". W4-IO built `io_import_open` and
2387
2397
  // `io_import_rows`; lane IMPORT gave a run an IDENTITY (the file's sha-256, so
2388
2398
  // a re-import doubles nothing), a duplicate key, a policy, per-row outcomes
@@ -3236,6 +3246,13 @@ function createRecordsClient(config) {
3236
3246
  "forms"
3237
3247
  );
3238
3248
  },
3249
+ async bookings(args) {
3250
+ return callDoor(
3251
+ DOORS.bookings,
3252
+ { p_organization_id: org, p_table_id: args?.table_id ?? null },
3253
+ "bookings"
3254
+ );
3255
+ },
3239
3256
  async formDeclare(args) {
3240
3257
  return callDoor(
3241
3258
  DOORS.formDeclare,