sinfactura-types 1.10.307 → 1.10.308

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.
@@ -36,13 +36,27 @@ exports.SOCKET_ACTIONS = [
36
36
  // Entity upserts — mostly emitted by `dynamoUpdate`'s auto-broadcast.
37
37
  'account',
38
38
  /**
39
- * A scheduled booking created, updated or cancelled. Operator-only —
40
- * broadcast via `wsPostStore(..., { audience: 'operator' })`; Phase 1 is an
41
- * internal ops tool with no customer-facing booking surface.
39
+ * A scheduled booking created, updated or cancelled. TWO shapes now share
40
+ * this one action, keyed by the RECEIVING socket:
42
41
  *
43
- * `data` is the `Appointment` row. One action covers create, update AND
44
- * cancel: a cancellation is `status: 'CANCELLED'`, never a row delete, so a
45
- * separate delete frame would describe a transition that never happens.
42
+ * - **Operator frame** — the full `Appointment` row, via
43
+ * `wsPostStore(..., { audience: 'operator' })`. Unchanged since Phase 1.
44
+ * - **Customer frame** — a SEPARATE, allow-listed projection
45
+ * (`toPublicAppointment`, `stacks/services/appointments.ts`) via
46
+ * `wsPostCustomer`, sent only when the row carries a `customerId`. This
47
+ * is a second, independent frame — never `wsPostStore`'s
48
+ * `'operator-and-customer'` audience — because the hidden fields
49
+ * (`assignedTo`, `cancelledBy`, `supplierId`, `recurrenceRule`,
50
+ * `recurrenceId`, `version`) are per-entity and a generic scrub has no
51
+ * list to draw on. Sent for operator-initiated writes (create,
52
+ * status-change, reschedule, cancel — `stacks/lambdas/appointments/`);
53
+ * the customer's OWN web-surface writes stay operator-only, since their
54
+ * REST response already IS their confirmation. Not sent for a scoped
55
+ * series edit (`this-and-future`/`series`) or the waitlist action below.
56
+ *
57
+ * One action still covers create, update AND cancel: a cancellation is
58
+ * `status: 'CANCELLED'`, never a row delete, so a separate delete frame
59
+ * would describe a transition that never happens.
46
60
  */
47
61
  'appointments',
48
62
  /**
@@ -50,6 +64,8 @@ exports.SOCKET_ACTIONS = [
50
64
  * Operator-only, broadcast via `wsPostStore(..., { audience: 'operator' })`:
51
65
  * `/appointments/waitlist` is an internal ops surface with no customer-facing
52
66
  * side, and the queue discloses who else is waiting for the same window.
67
+ * ⚠️ Structurally excluded from a customer frame, not merely by policy —
68
+ * `AppointmentWaitlistChange` (below) carries no `customerId` at all.
53
69
  *
54
70
  * ⚠️ **`data` is `AppointmentWaitlistChange` — the slot address plus the new
55
71
  * queue depth — never an `AppointmentWaitlistEntry` and never the queue
package/dist/socket.js CHANGED
@@ -33,13 +33,27 @@ export const SOCKET_ACTIONS = [
33
33
  // Entity upserts — mostly emitted by `dynamoUpdate`'s auto-broadcast.
34
34
  'account',
35
35
  /**
36
- * A scheduled booking created, updated or cancelled. Operator-only —
37
- * broadcast via `wsPostStore(..., { audience: 'operator' })`; Phase 1 is an
38
- * internal ops tool with no customer-facing booking surface.
36
+ * A scheduled booking created, updated or cancelled. TWO shapes now share
37
+ * this one action, keyed by the RECEIVING socket:
39
38
  *
40
- * `data` is the `Appointment` row. One action covers create, update AND
41
- * cancel: a cancellation is `status: 'CANCELLED'`, never a row delete, so a
42
- * separate delete frame would describe a transition that never happens.
39
+ * - **Operator frame** — the full `Appointment` row, via
40
+ * `wsPostStore(..., { audience: 'operator' })`. Unchanged since Phase 1.
41
+ * - **Customer frame** — a SEPARATE, allow-listed projection
42
+ * (`toPublicAppointment`, `stacks/services/appointments.ts`) via
43
+ * `wsPostCustomer`, sent only when the row carries a `customerId`. This
44
+ * is a second, independent frame — never `wsPostStore`'s
45
+ * `'operator-and-customer'` audience — because the hidden fields
46
+ * (`assignedTo`, `cancelledBy`, `supplierId`, `recurrenceRule`,
47
+ * `recurrenceId`, `version`) are per-entity and a generic scrub has no
48
+ * list to draw on. Sent for operator-initiated writes (create,
49
+ * status-change, reschedule, cancel — `stacks/lambdas/appointments/`);
50
+ * the customer's OWN web-surface writes stay operator-only, since their
51
+ * REST response already IS their confirmation. Not sent for a scoped
52
+ * series edit (`this-and-future`/`series`) or the waitlist action below.
53
+ *
54
+ * One action still covers create, update AND cancel: a cancellation is
55
+ * `status: 'CANCELLED'`, never a row delete, so a separate delete frame
56
+ * would describe a transition that never happens.
43
57
  */
44
58
  'appointments',
45
59
  /**
@@ -47,6 +61,8 @@ export const SOCKET_ACTIONS = [
47
61
  * Operator-only, broadcast via `wsPostStore(..., { audience: 'operator' })`:
48
62
  * `/appointments/waitlist` is an internal ops surface with no customer-facing
49
63
  * side, and the queue discloses who else is waiting for the same window.
64
+ * ⚠️ Structurally excluded from a customer frame, not merely by policy —
65
+ * `AppointmentWaitlistChange` (below) carries no `customerId` at all.
50
66
  *
51
67
  * ⚠️ **`data` is `AppointmentWaitlistChange` — the slot address plus the new
52
68
  * queue depth — never an `AppointmentWaitlistEntry` and never the queue
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.10.307",
3
+ "version": "1.10.308",
4
4
  "description": "Shared wire and entity contracts for the SINFACTURA platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",