types-salon-management 1.0.50 → 1.0.52

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.
Files changed (38) hide show
  1. package/dist/api/appointments/appointment.constants.d.ts +7 -2
  2. package/dist/api/appointments/appointment.constants.d.ts.map +1 -1
  3. package/dist/api/appointments/appointment.constants.js +7 -2
  4. package/dist/api/appointments/appointment.constants.js.map +1 -1
  5. package/dist/api/appointments/book-appointment.request.d.ts +5 -0
  6. package/dist/api/appointments/book-appointment.request.d.ts.map +1 -1
  7. package/dist/api/appointments/check-scheduling.request.d.ts +7 -1
  8. package/dist/api/appointments/check-scheduling.request.d.ts.map +1 -1
  9. package/dist/api/appointments/reschedule-item.request.d.ts +8 -2
  10. package/dist/api/appointments/reschedule-item.request.d.ts.map +1 -1
  11. package/dist/api/calendar/calendar.dto.d.ts +24 -0
  12. package/dist/api/calendar/calendar.dto.d.ts.map +1 -1
  13. package/dist/api/index.d.ts +1 -0
  14. package/dist/api/index.d.ts.map +1 -1
  15. package/dist/api/index.js +1 -0
  16. package/dist/api/index.js.map +1 -1
  17. package/dist/api/staff-blocks/index.d.ts +3 -0
  18. package/dist/api/staff-blocks/index.d.ts.map +1 -0
  19. package/dist/api/staff-blocks/index.js +19 -0
  20. package/dist/api/staff-blocks/index.js.map +1 -0
  21. package/dist/api/staff-blocks/staff-block.dto.d.ts +26 -0
  22. package/dist/api/staff-blocks/staff-block.dto.d.ts.map +1 -0
  23. package/dist/api/staff-blocks/staff-block.dto.js +3 -0
  24. package/dist/api/staff-blocks/staff-block.dto.js.map +1 -0
  25. package/dist/api/staff-blocks/staff-block.request.d.ts +26 -0
  26. package/dist/api/staff-blocks/staff-block.request.d.ts.map +1 -0
  27. package/dist/api/staff-blocks/staff-block.request.js +3 -0
  28. package/dist/api/staff-blocks/staff-block.request.js.map +1 -0
  29. package/package.json +1 -1
  30. package/src/api/appointments/appointment.constants.ts +7 -2
  31. package/src/api/appointments/book-appointment.request.ts +5 -0
  32. package/src/api/appointments/check-scheduling.request.ts +7 -1
  33. package/src/api/appointments/reschedule-item.request.ts +8 -3
  34. package/src/api/calendar/calendar.dto.ts +26 -0
  35. package/src/api/index.ts +1 -0
  36. package/src/api/staff-blocks/index.ts +2 -0
  37. package/src/api/staff-blocks/staff-block.dto.ts +26 -0
  38. package/src/api/staff-blocks/staff-block.request.ts +26 -0
@@ -25,12 +25,17 @@ export declare const OccupancyStaffRole: {
25
25
  };
26
26
  export type OccupancyStaffRole = (typeof OccupancyStaffRole)[keyof typeof OccupancyStaffRole];
27
27
  /**
28
- * Advisory scheduling problems. These never block a booking double-booking is the
29
- * only hard conflict, enforced by exclusion constraints and surfaced as 409.
28
+ * Advisory scheduling problems. None of these block a booking: the caller may proceed by
29
+ * setting `allowOverlap` on the write request, which is recorded on the occupancy. The
30
+ * exclusion constraints still reject overlaps that were never acknowledged.
30
31
  */
31
32
  export declare const SchedulingWarningCode: {
32
33
  readonly STAFF_DAY_OFF: "staff_day_off";
33
34
  readonly STAFF_OUTSIDE_WORKING_HOURS: "staff_outside_working_hours";
35
+ readonly STAFF_DOUBLE_BOOKED: "staff_double_booked";
36
+ readonly RESOURCE_DOUBLE_BOOKED: "resource_double_booked";
37
+ /** Clash with a staff block rather than a booking; overridable like a double-booking. */
38
+ readonly STAFF_BLOCKED: "staff_blocked";
34
39
  };
35
40
  export type SchedulingWarningCode = (typeof SchedulingWarningCode)[keyof typeof SchedulingWarningCode];
36
41
  //# sourceMappingURL=appointment.constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"appointment.constants.d.ts","sourceRoot":"","sources":["../../../src/api/appointments/appointment.constants.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,eAAO,MAAM,2BAA2B;;;;;;;;CAQ9B,CAAC;AAEX,MAAM,MAAM,2BAA2B,GACrC,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,OAAO,2BAA2B,CAAC,CAAC;AAEjF,iEAAiE;AACjE,eAAO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;;;;GAIG;AACH,eAAO,MAAM,qBAAqB;;;;;IAKhC,yFAAyF;;CAEjF,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAC/B,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC"}
@@ -24,11 +24,16 @@ exports.OccupancyStaffRole = {
24
24
  ASSISTANT: 'assistant',
25
25
  };
26
26
  /**
27
- * Advisory scheduling problems. These never block a booking double-booking is the
28
- * only hard conflict, enforced by exclusion constraints and surfaced as 409.
27
+ * Advisory scheduling problems. None of these block a booking: the caller may proceed by
28
+ * setting `allowOverlap` on the write request, which is recorded on the occupancy. The
29
+ * exclusion constraints still reject overlaps that were never acknowledged.
29
30
  */
30
31
  exports.SchedulingWarningCode = {
31
32
  STAFF_DAY_OFF: 'staff_day_off',
32
33
  STAFF_OUTSIDE_WORKING_HOURS: 'staff_outside_working_hours',
34
+ STAFF_DOUBLE_BOOKED: 'staff_double_booked',
35
+ RESOURCE_DOUBLE_BOOKED: 'resource_double_booked',
36
+ /** Clash with a staff block rather than a booking; overridable like a double-booking. */
37
+ STAFF_BLOCKED: 'staff_blocked',
33
38
  };
34
39
  //# sourceMappingURL=appointment.constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"appointment.constants.js","sourceRoot":"","sources":["../../../src/api/appointments/appointment.constants.ts"],"names":[],"mappings":";;;AAAA,oGAAoG;AACvF,QAAA,2BAA2B,GAAG;IACzC,GAAG,EAAE,KAAK;IACV,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;CACV,CAAC;AAKX,iEAAiE;AACpD,QAAA,qBAAqB,GAAG;IACnC,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;CACZ,CAAC;AAKE,QAAA,eAAe,GAAG;IAC7B,OAAO,EAAE,SAAS;CACV,CAAC;AAIE,QAAA,kBAAkB,GAAG;IAChC,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;CACd,CAAC;AAIX;;;GAGG;AACU,QAAA,qBAAqB,GAAG;IACnC,aAAa,EAAE,eAAe;IAC9B,2BAA2B,EAAE,6BAA6B;CAClD,CAAC"}
1
+ {"version":3,"file":"appointment.constants.js","sourceRoot":"","sources":["../../../src/api/appointments/appointment.constants.ts"],"names":[],"mappings":";;;AAAA,oGAAoG;AACvF,QAAA,2BAA2B,GAAG;IACzC,GAAG,EAAE,KAAK;IACV,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;CACV,CAAC;AAKX,iEAAiE;AACpD,QAAA,qBAAqB,GAAG;IACnC,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;CACZ,CAAC;AAKE,QAAA,eAAe,GAAG;IAC7B,OAAO,EAAE,SAAS;CACV,CAAC;AAIE,QAAA,kBAAkB,GAAG;IAChC,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;CACd,CAAC;AAIX;;;;GAIG;AACU,QAAA,qBAAqB,GAAG;IACnC,aAAa,EAAE,eAAe;IAC9B,2BAA2B,EAAE,6BAA6B;IAC1D,mBAAmB,EAAE,qBAAqB;IAC1C,sBAAsB,EAAE,wBAAwB;IAChD,yFAAyF;IACzF,aAAa,EAAE,eAAe;CACtB,CAAC"}
@@ -14,5 +14,10 @@ export interface BookAppointmentRequest {
14
14
  clientEmail?: string | null;
15
15
  notes?: string | null;
16
16
  items: BookAppointmentItemRequest[];
17
+ /**
18
+ * Set once the user has seen a clash and chosen to double-book anyway. Without it the
19
+ * exclusion constraints reject the overlap with a 409.
20
+ */
21
+ allowOverlap?: boolean;
17
22
  }
18
23
  //# sourceMappingURL=book-appointment.request.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"book-appointment.request.d.ts","sourceRoot":"","sources":["../../../src/api/appointments/book-appointment.request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,MAAM,WAAW,0BAA0B;IACzC,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,0BAA0B,EAAE,CAAC;CACrC"}
1
+ {"version":3,"file":"book-appointment.request.d.ts","sourceRoot":"","sources":["../../../src/api/appointments/book-appointment.request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,MAAM,WAAW,0BAA0B;IACzC,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,0BAA0B,EAAE,CAAC;IACpC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB"}
@@ -4,18 +4,24 @@ export interface CheckSchedulingSlotRequest {
4
4
  serviceVariantId?: string;
5
5
  staffId: string;
6
6
  staffId2?: string;
7
+ resourceId?: string;
7
8
  startAt: string;
8
9
  endAt?: string;
9
10
  }
10
11
  export interface CheckSchedulingRequest {
11
12
  locationId: string;
12
13
  slots: CheckSchedulingSlotRequest[];
14
+ /** Occupancies of this item are ignored, so rescheduling never clashes with itself. */
15
+ excludeAppointmentItemId?: string;
16
+ /** Same, for a staff block being moved or resized. */
17
+ excludeStaffBlockId?: string;
13
18
  }
14
19
  export interface SchedulingWarningDto {
15
20
  code: SchedulingWarningCode;
16
21
  /** Ready-to-display sentence; the server owns the wording. */
17
22
  message: string;
18
- staffId: string;
23
+ /** Null for resource clashes, which aren't tied to a staff member. */
24
+ staffId: string | null;
19
25
  staffName: string | null;
20
26
  startAt: string;
21
27
  endAt: string;
@@ -1 +1 @@
1
- {"version":3,"file":"check-scheduling.request.d.ts","sourceRoot":"","sources":["../../../src/api/appointments/check-scheduling.request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErE,gGAAgG;AAChG,MAAM,WAAW,0BAA0B;IACzC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,0BAA0B,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,8DAA8D;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,oBAAoB,EAAE,CAAC;CAClC"}
1
+ {"version":3,"file":"check-scheduling.request.d.ts","sourceRoot":"","sources":["../../../src/api/appointments/check-scheduling.request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErE,gGAAgG;AAChG,MAAM,WAAW,0BAA0B;IACzC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,0BAA0B,EAAE,CAAC;IACpC,uFAAuF;IACvF,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,sDAAsD;IACtD,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,8DAA8D;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,oBAAoB,EAAE,CAAC;CAClC"}
@@ -1,10 +1,16 @@
1
- import type { OccupancyStaffRole } from './appointment.constants';
2
1
  export interface RescheduleItemRequest {
3
2
  startAt: string;
4
3
  endAt: string;
4
+ /** New primary staff; omit to leave unchanged. */
5
5
  staffId?: string;
6
+ /** New assistant staff for two-staff services; omit to leave unchanged. */
6
7
  staffId2?: string;
8
+ /** New room; omit or null to leave unchanged. */
7
9
  resourceId?: string | null;
8
- staffRole?: OccupancyStaffRole;
10
+ /**
11
+ * Set once the user has seen a clash and chosen to double-book anyway. Without it the
12
+ * exclusion constraints reject the overlap with a 409.
13
+ */
14
+ allowOverlap?: boolean;
9
15
  }
10
16
  //# sourceMappingURL=reschedule-item.request.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reschedule-item.request.d.ts","sourceRoot":"","sources":["../../../src/api/appointments/reschedule-item.request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,CAAC,EAAE,kBAAkB,CAAC;CAChC"}
1
+ {"version":3,"file":"reschedule-item.request.d.ts","sourceRoot":"","sources":["../../../src/api/appointments/reschedule-item.request.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB"}
@@ -24,11 +24,35 @@ export interface CalendarOccupancyDto {
24
24
  durationMinutes: number;
25
25
  durationSegments: AppointmentItemDurationSegmentDto[];
26
26
  }
27
+ /**
28
+ * A staff block on the calendar. Kept separate from `CalendarOccupancyDto` because a
29
+ * block has no client, service or status — sharing one shape would mean a dozen
30
+ * meaningless nulls per row.
31
+ */
32
+ export interface CalendarStaffBlockDto {
33
+ occupancyId: string;
34
+ staffBlockId: string;
35
+ locationId: string;
36
+ staffId: string | null;
37
+ staffName: string | null;
38
+ title: string;
39
+ notes: string | null;
40
+ allowsOnlineBooking: boolean;
41
+ startAt: string;
42
+ endAt: string;
43
+ }
44
+ /** SSE `calendar.changed` payload; tells other sessions which location's feed is stale. */
45
+ export interface CalendarChangedEvent {
46
+ locationId: string;
47
+ changeType: 'book' | 'reschedule' | 'staff_block';
48
+ entityId: string;
49
+ }
27
50
  export interface CalendarFeedDto {
28
51
  locationId: string;
29
52
  from: string;
30
53
  to: string;
31
54
  occupancies: CalendarOccupancyDto[];
55
+ staffBlocks: CalendarStaffBlockDto[];
32
56
  closures: LocationClosureDto[];
33
57
  }
34
58
  //# sourceMappingURL=calendar.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.dto.d.ts","sourceRoot":"","sources":["../../../src/api/calendar/calendar.dto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,iCAAiC,CAAC;AACzF,OAAO,KAAK,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE7G,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,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AAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,oBAAoB,EAAE,CAAC;IACpC,WAAW,EAAE,qBAAqB,EAAE,CAAC;IACrC,QAAQ,EAAE,kBAAkB,EAAE,CAAC;CAChC"}
@@ -10,6 +10,7 @@ export * from './gst-number/index';
10
10
  export * from './cancellation-reason';
11
11
  export * from './location-closures/index';
12
12
  export * from './appointments/index';
13
+ export * from './staff-blocks/index';
13
14
  export * from './calendar/index';
14
15
  export * from './location';
15
16
  export * from './platform-terms';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC"}
package/dist/api/index.js CHANGED
@@ -26,6 +26,7 @@ __exportStar(require("./gst-number/index"), exports);
26
26
  __exportStar(require("./cancellation-reason"), exports);
27
27
  __exportStar(require("./location-closures/index"), exports);
28
28
  __exportStar(require("./appointments/index"), exports);
29
+ __exportStar(require("./staff-blocks/index"), exports);
29
30
  __exportStar(require("./calendar/index"), exports);
30
31
  __exportStar(require("./location"), exports);
31
32
  __exportStar(require("./platform-terms"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qEAAqE;AACrE,0CAAwB;AACxB,4CAA0B;AAC1B,iDAA+B;AAC/B,+CAA6B;AAC7B,2CAAyB;AACzB,+CAA6B;AAC7B,8CAA4B;AAC5B,qDAAmC;AACnC,wDAAsC;AACtC,4DAA0C;AAC1C,uDAAqC;AACrC,mDAAiC;AACjC,6CAA2B;AAC3B,mDAAiC;AACjC,+CAA6B;AAC7B,2DAAyC;AACzC,oDAAkC;AAClC,gDAA8B;AAC9B,uDAAqC;AACrC,oDAAkC;AAClC,4DAA0C;AAC1C,6DAA2C;AAC3C,mDAAiC;AACjC,yDAAuC;AACvC,qDAAmC;AACnC,sDAAoC;AACpC,0DAAwC;AACxC,kDAAgC;AAChC,mDAAiC;AACjC,+DAA6C;AAC7C,qDAAmC;AACnC,6DAA2C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qEAAqE;AACrE,0CAAwB;AACxB,4CAA0B;AAC1B,iDAA+B;AAC/B,+CAA6B;AAC7B,2CAAyB;AACzB,+CAA6B;AAC7B,8CAA4B;AAC5B,qDAAmC;AACnC,wDAAsC;AACtC,4DAA0C;AAC1C,uDAAqC;AACrC,uDAAqC;AACrC,mDAAiC;AACjC,6CAA2B;AAC3B,mDAAiC;AACjC,+CAA6B;AAC7B,2DAAyC;AACzC,oDAAkC;AAClC,gDAA8B;AAC9B,uDAAqC;AACrC,oDAAkC;AAClC,4DAA0C;AAC1C,6DAA2C;AAC3C,mDAAiC;AACjC,yDAAuC;AACvC,qDAAmC;AACnC,sDAAoC;AACpC,0DAAwC;AACxC,kDAAgC;AAChC,mDAAiC;AACjC,+DAA6C;AAC7C,qDAAmC;AACnC,6DAA2C"}
@@ -0,0 +1,3 @@
1
+ export * from './staff-block.dto';
2
+ export * from './staff-block.request';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/staff-blocks/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./staff-block.dto"), exports);
18
+ __exportStar(require("./staff-block.request"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/staff-blocks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,wDAAsC"}
@@ -0,0 +1,26 @@
1
+ import type { AuditActor } from '../audit';
2
+ /**
3
+ * Time a staff member is unavailable for reasons other than an appointment (break,
4
+ * training, personal). The held time itself lives on a schedule occupancy, so blocks
5
+ * and appointments contend for the same slots through the same exclusion constraints.
6
+ */
7
+ export interface StaffBlockDto {
8
+ id: string;
9
+ locationId: string;
10
+ staffId: string;
11
+ staffName: string | null;
12
+ title: string;
13
+ notes: string | null;
14
+ /** When true the slot stays bookable online; the block is internal-only. */
15
+ allowsOnlineBooking: boolean;
16
+ startAt: string;
17
+ endAt: string;
18
+ /** The occupancy holding the time. Calendar events are keyed off this. */
19
+ occupancyId: string;
20
+ createdAt: string;
21
+ updatedAt: string | null;
22
+ createdBy: AuditActor | null;
23
+ updatedBy: AuditActor | null;
24
+ deletedBy: AuditActor | null;
25
+ }
26
+ //# sourceMappingURL=staff-block.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staff-block.dto.d.ts","sourceRoot":"","sources":["../../../src/api/staff-blocks/staff-block.dto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,4EAA4E;IAC5E,mBAAmB,EAAE,OAAO,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,UAAU,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,UAAU,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,UAAU,GAAG,IAAI,CAAC;CAC9B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=staff-block.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staff-block.dto.js","sourceRoot":"","sources":["../../../src/api/staff-blocks/staff-block.dto.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ export interface CreateStaffBlockRequest {
2
+ locationId: string;
3
+ staffId: string;
4
+ title: string;
5
+ notes?: string | null;
6
+ /** Defaults to false: a block normally closes the slot to online booking too. */
7
+ allowsOnlineBooking?: boolean;
8
+ startAt: string;
9
+ endAt: string;
10
+ /**
11
+ * Set once the user has seen a clash and chosen to overlap anyway. Without it the
12
+ * exclusion constraints reject the overlap with a 409.
13
+ */
14
+ allowOverlap?: boolean;
15
+ }
16
+ /** Also carries drag/resize on the calendar, which sends only `startAt`/`endAt`/`staffId`. */
17
+ export interface UpdateStaffBlockRequest {
18
+ staffId?: string;
19
+ title?: string;
20
+ notes?: string | null;
21
+ allowsOnlineBooking?: boolean;
22
+ startAt?: string;
23
+ endAt?: string;
24
+ allowOverlap?: boolean;
25
+ }
26
+ //# sourceMappingURL=staff-block.request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staff-block.request.d.ts","sourceRoot":"","sources":["../../../src/api/staff-blocks/staff-block.request.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,iFAAiF;IACjF,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,8FAA8F;AAC9F,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=staff-block.request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staff-block.request.js","sourceRoot":"","sources":["../../../src/api/staff-blocks/staff-block.request.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "types-salon-management",
3
- "version": "1.0.50",
3
+ "version": "1.0.52",
4
4
  "description": "Types for Salon Management",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -35,12 +35,17 @@ export const OccupancyStaffRole = {
35
35
  export type OccupancyStaffRole = (typeof OccupancyStaffRole)[keyof typeof OccupancyStaffRole];
36
36
 
37
37
  /**
38
- * Advisory scheduling problems. These never block a booking double-booking is the
39
- * only hard conflict, enforced by exclusion constraints and surfaced as 409.
38
+ * Advisory scheduling problems. None of these block a booking: the caller may proceed by
39
+ * setting `allowOverlap` on the write request, which is recorded on the occupancy. The
40
+ * exclusion constraints still reject overlaps that were never acknowledged.
40
41
  */
41
42
  export const SchedulingWarningCode = {
42
43
  STAFF_DAY_OFF: 'staff_day_off',
43
44
  STAFF_OUTSIDE_WORKING_HOURS: 'staff_outside_working_hours',
45
+ STAFF_DOUBLE_BOOKED: 'staff_double_booked',
46
+ RESOURCE_DOUBLE_BOOKED: 'resource_double_booked',
47
+ /** Clash with a staff block rather than a booking; overridable like a double-booking. */
48
+ STAFF_BLOCKED: 'staff_blocked',
44
49
  } as const;
45
50
 
46
51
  export type SchedulingWarningCode =
@@ -16,4 +16,9 @@ export interface BookAppointmentRequest {
16
16
  clientEmail?: string | null;
17
17
  notes?: string | null;
18
18
  items: BookAppointmentItemRequest[];
19
+ /**
20
+ * Set once the user has seen a clash and chosen to double-book anyway. Without it the
21
+ * exclusion constraints reject the overlap with a 409.
22
+ */
23
+ allowOverlap?: boolean;
19
24
  }
@@ -5,6 +5,7 @@ export interface CheckSchedulingSlotRequest {
5
5
  serviceVariantId?: string;
6
6
  staffId: string;
7
7
  staffId2?: string;
8
+ resourceId?: string;
8
9
  startAt: string;
9
10
  endAt?: string;
10
11
  }
@@ -12,13 +13,18 @@ export interface CheckSchedulingSlotRequest {
12
13
  export interface CheckSchedulingRequest {
13
14
  locationId: string;
14
15
  slots: CheckSchedulingSlotRequest[];
16
+ /** Occupancies of this item are ignored, so rescheduling never clashes with itself. */
17
+ excludeAppointmentItemId?: string;
18
+ /** Same, for a staff block being moved or resized. */
19
+ excludeStaffBlockId?: string;
15
20
  }
16
21
 
17
22
  export interface SchedulingWarningDto {
18
23
  code: SchedulingWarningCode;
19
24
  /** Ready-to-display sentence; the server owns the wording. */
20
25
  message: string;
21
- staffId: string;
26
+ /** Null for resource clashes, which aren't tied to a staff member. */
27
+ staffId: string | null;
22
28
  staffName: string | null;
23
29
  startAt: string;
24
30
  endAt: string;
@@ -1,10 +1,15 @@
1
- import type { OccupancyStaffRole } from './appointment.constants';
2
-
3
1
  export interface RescheduleItemRequest {
4
2
  startAt: string;
5
3
  endAt: string;
4
+ /** New primary staff; omit to leave unchanged. */
6
5
  staffId?: string;
6
+ /** New assistant staff for two-staff services; omit to leave unchanged. */
7
7
  staffId2?: string;
8
+ /** New room; omit or null to leave unchanged. */
8
9
  resourceId?: string | null;
9
- staffRole?: OccupancyStaffRole;
10
+ /**
11
+ * Set once the user has seen a clash and chosen to double-book anyway. Without it the
12
+ * exclusion constraints reject the overlap with a 409.
13
+ */
14
+ allowOverlap?: boolean;
10
15
  }
@@ -26,10 +26,36 @@ export interface CalendarOccupancyDto {
26
26
  durationSegments: AppointmentItemDurationSegmentDto[];
27
27
  }
28
28
 
29
+ /**
30
+ * A staff block on the calendar. Kept separate from `CalendarOccupancyDto` because a
31
+ * block has no client, service or status — sharing one shape would mean a dozen
32
+ * meaningless nulls per row.
33
+ */
34
+ export interface CalendarStaffBlockDto {
35
+ occupancyId: string;
36
+ staffBlockId: string;
37
+ locationId: string;
38
+ staffId: string | null;
39
+ staffName: string | null;
40
+ title: string;
41
+ notes: string | null;
42
+ allowsOnlineBooking: boolean;
43
+ startAt: string;
44
+ endAt: string;
45
+ }
46
+
47
+ /** SSE `calendar.changed` payload; tells other sessions which location's feed is stale. */
48
+ export interface CalendarChangedEvent {
49
+ locationId: string;
50
+ changeType: 'book' | 'reschedule' | 'staff_block';
51
+ entityId: string;
52
+ }
53
+
29
54
  export interface CalendarFeedDto {
30
55
  locationId: string;
31
56
  from: string;
32
57
  to: string;
33
58
  occupancies: CalendarOccupancyDto[];
59
+ staffBlocks: CalendarStaffBlockDto[];
34
60
  closures: LocationClosureDto[];
35
61
  }
package/src/api/index.ts CHANGED
@@ -10,6 +10,7 @@ export * from './gst-number/index';
10
10
  export * from './cancellation-reason';
11
11
  export * from './location-closures/index';
12
12
  export * from './appointments/index';
13
+ export * from './staff-blocks/index';
13
14
  export * from './calendar/index';
14
15
  export * from './location';
15
16
  export * from './platform-terms';
@@ -0,0 +1,2 @@
1
+ export * from './staff-block.dto';
2
+ export * from './staff-block.request';
@@ -0,0 +1,26 @@
1
+ import type { AuditActor } from '../audit';
2
+
3
+ /**
4
+ * Time a staff member is unavailable for reasons other than an appointment (break,
5
+ * training, personal). The held time itself lives on a schedule occupancy, so blocks
6
+ * and appointments contend for the same slots through the same exclusion constraints.
7
+ */
8
+ export interface StaffBlockDto {
9
+ id: string;
10
+ locationId: string;
11
+ staffId: string;
12
+ staffName: string | null;
13
+ title: string;
14
+ notes: string | null;
15
+ /** When true the slot stays bookable online; the block is internal-only. */
16
+ allowsOnlineBooking: boolean;
17
+ startAt: string;
18
+ endAt: string;
19
+ /** The occupancy holding the time. Calendar events are keyed off this. */
20
+ occupancyId: string;
21
+ createdAt: string;
22
+ updatedAt: string | null;
23
+ createdBy: AuditActor | null;
24
+ updatedBy: AuditActor | null;
25
+ deletedBy: AuditActor | null;
26
+ }
@@ -0,0 +1,26 @@
1
+ export interface CreateStaffBlockRequest {
2
+ locationId: string;
3
+ staffId: string;
4
+ title: string;
5
+ notes?: string | null;
6
+ /** Defaults to false: a block normally closes the slot to online booking too. */
7
+ allowsOnlineBooking?: boolean;
8
+ startAt: string;
9
+ endAt: string;
10
+ /**
11
+ * Set once the user has seen a clash and chosen to overlap anyway. Without it the
12
+ * exclusion constraints reject the overlap with a 409.
13
+ */
14
+ allowOverlap?: boolean;
15
+ }
16
+
17
+ /** Also carries drag/resize on the calendar, which sends only `startAt`/`endAt`/`staffId`. */
18
+ export interface UpdateStaffBlockRequest {
19
+ staffId?: string;
20
+ title?: string;
21
+ notes?: string | null;
22
+ allowsOnlineBooking?: boolean;
23
+ startAt?: string;
24
+ endAt?: string;
25
+ allowOverlap?: boolean;
26
+ }