@iveri/contracts 0.51.0 → 0.53.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.
Files changed (52) hide show
  1. package/dist/api/clinic/clinic-location.type.d.ts +11 -0
  2. package/dist/api/clinic/clinic-profile.type.d.ts +11 -0
  3. package/dist/api/clinic/clinic-public.type.d.ts +15 -0
  4. package/dist/api/clinic/clinic-staff.type.d.ts +9 -0
  5. package/dist/api/clinic/clinic-treatment.type.d.ts +19 -0
  6. package/dist/api/realtime/realtime-event-type.enum.d.ts +8 -1
  7. package/dist/api/realtime/realtime-event-type.enum.js +7 -0
  8. package/dist/api/realtime/realtime-resource-type.enum.d.ts +3 -1
  9. package/dist/api/realtime/realtime-resource-type.enum.js +2 -0
  10. package/dist/api/restaurant/index.d.ts +19 -0
  11. package/dist/api/restaurant/index.js +19 -0
  12. package/dist/api/restaurant/restaurant-allergen.enum.d.ts +17 -0
  13. package/dist/api/restaurant/restaurant-allergen.enum.js +18 -0
  14. package/dist/api/restaurant/restaurant-bill-status.enum.d.ts +6 -0
  15. package/dist/api/restaurant/restaurant-bill-status.enum.js +7 -0
  16. package/dist/api/restaurant/restaurant-bill.type.d.ts +124 -0
  17. package/dist/api/restaurant/restaurant-bill.type.js +1 -0
  18. package/dist/api/restaurant/restaurant-branch.type.d.ts +69 -0
  19. package/dist/api/restaurant/restaurant-branch.type.js +1 -0
  20. package/dist/api/restaurant/restaurant-channel.enum.d.ts +6 -0
  21. package/dist/api/restaurant/restaurant-channel.enum.js +7 -0
  22. package/dist/api/restaurant/restaurant-dietary-tag.enum.d.ts +9 -0
  23. package/dist/api/restaurant/restaurant-dietary-tag.enum.js +10 -0
  24. package/dist/api/restaurant/restaurant-floor.type.d.ts +29 -0
  25. package/dist/api/restaurant/restaurant-floor.type.js +1 -0
  26. package/dist/api/restaurant/restaurant-kitchen.type.d.ts +48 -0
  27. package/dist/api/restaurant/restaurant-kitchen.type.js +1 -0
  28. package/dist/api/restaurant/restaurant-line-status.enum.d.ts +7 -0
  29. package/dist/api/restaurant/restaurant-line-status.enum.js +8 -0
  30. package/dist/api/restaurant/restaurant-menu.type.d.ts +141 -0
  31. package/dist/api/restaurant/restaurant-menu.type.js +1 -0
  32. package/dist/api/restaurant/restaurant-order-source.enum.d.ts +6 -0
  33. package/dist/api/restaurant/restaurant-order-source.enum.js +7 -0
  34. package/dist/api/restaurant/restaurant-order-status.enum.d.ts +16 -0
  35. package/dist/api/restaurant/restaurant-order-status.enum.js +17 -0
  36. package/dist/api/restaurant/restaurant-order.type.d.ts +81 -0
  37. package/dist/api/restaurant/restaurant-order.type.js +1 -0
  38. package/dist/api/restaurant/restaurant-payment-method.enum.d.ts +6 -0
  39. package/dist/api/restaurant/restaurant-payment-method.enum.js +7 -0
  40. package/dist/api/restaurant/restaurant-profile.type.d.ts +40 -0
  41. package/dist/api/restaurant/restaurant-profile.type.js +1 -0
  42. package/dist/api/restaurant/restaurant-public.type.d.ts +129 -0
  43. package/dist/api/restaurant/restaurant-public.type.js +1 -0
  44. package/dist/api/restaurant/restaurant-resource-status.enum.d.ts +5 -0
  45. package/dist/api/restaurant/restaurant-resource-status.enum.js +6 -0
  46. package/dist/api/restaurant/restaurant-service-request.type.d.ts +16 -0
  47. package/dist/api/restaurant/restaurant-service-request.type.js +5 -0
  48. package/dist/api/restaurant/restaurant-table.type.d.ts +51 -0
  49. package/dist/api/restaurant/restaurant-table.type.js +1 -0
  50. package/dist/enum/user-permission.enum.d.ts +37 -1
  51. package/dist/enum/user-permission.enum.js +37 -0
  52. package/package.json +5 -1
@@ -2,6 +2,7 @@ import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
2
  import type { Nullable } from '../../type/nil.type.js';
3
3
  import type { UUID } from '../../type/uuid.type.js';
4
4
  import type { ClinicResourceStatus } from './clinic-resource-status.enum.js';
5
+ import type { ClinicWorkingPeriod } from './clinic-staff.type.js';
5
6
  import type { LocalizedText } from './localized-text.type.js';
6
7
  export interface ClinicLocation {
7
8
  id: UUID;
@@ -14,6 +15,10 @@ export interface ClinicLocation {
14
15
  /** The specialties this branch offers, which clients filter branches by. */
15
16
  specialtyIds: UUID[];
16
17
  status: ClinicResourceStatus;
18
+ /** When the doors are open, which a visitor reads. Bookable times come from the staff's hours. */
19
+ openingHours: ClinicWorkingPeriod[];
20
+ latitude: Nullable<number>;
21
+ longitude: Nullable<number>;
17
22
  createdAt: IsoDateTime;
18
23
  updatedAt: IsoDateTime;
19
24
  }
@@ -24,6 +29,9 @@ export interface CreateClinicLocationRequest {
24
29
  phone?: Nullable<string>;
25
30
  timeZone: string;
26
31
  specialtyIds?: UUID[];
32
+ openingHours?: ClinicWorkingPeriod[];
33
+ latitude?: Nullable<number>;
34
+ longitude?: Nullable<number>;
27
35
  }
28
36
  export interface UpdateClinicLocationRequest {
29
37
  name?: LocalizedText;
@@ -33,4 +41,7 @@ export interface UpdateClinicLocationRequest {
33
41
  timeZone?: string;
34
42
  specialtyIds?: UUID[];
35
43
  status?: ClinicResourceStatus;
44
+ openingHours?: ClinicWorkingPeriod[];
45
+ latitude?: Nullable<number>;
46
+ longitude?: Nullable<number>;
36
47
  }
@@ -3,12 +3,21 @@ import type { Nullable } from '../../type/nil.type.js';
3
3
  import type { UUID } from '../../type/uuid.type.js';
4
4
  import type { LocalizedText } from './localized-text.type.js';
5
5
  /** How a clinic presents itself to the public, and the rules for booking online. */
6
+ /** Where else a clinic can be found. WhatsApp is a phone number and the rest are addresses. */
7
+ export interface ClinicSocialLinks {
8
+ instagram: Nullable<string>;
9
+ facebook: Nullable<string>;
10
+ tiktok: Nullable<string>;
11
+ whatsapp: Nullable<string>;
12
+ }
6
13
  export interface ClinicProfile {
7
14
  id: UUID;
8
15
  /** The name its public address and app build use. Unique across every clinic. */
9
16
  slug: string;
10
17
  name: LocalizedText;
11
18
  tagline: Nullable<LocalizedText>;
19
+ about: Nullable<LocalizedText>;
20
+ socialLinks: Nullable<ClinicSocialLinks>;
12
21
  phone: Nullable<string>;
13
22
  email: Nullable<string>;
14
23
  /** The clinic's public website, which the links in its emails point at. No path, no trailing slash. */
@@ -28,6 +37,8 @@ export interface SaveClinicProfileRequest {
28
37
  slug: string;
29
38
  name: LocalizedText;
30
39
  tagline?: Nullable<LocalizedText>;
40
+ about?: Nullable<LocalizedText>;
41
+ socialLinks?: Nullable<ClinicSocialLinks>;
31
42
  phone?: Nullable<string>;
32
43
  email?: Nullable<string>;
33
44
  siteUrl?: Nullable<string>;
@@ -1,6 +1,10 @@
1
1
  import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
2
  import type { Nullable } from '../../type/nil.type.js';
3
3
  import type { UUID } from '../../type/uuid.type.js';
4
+ import type { ClinicMediaImage } from './clinic-media.type.js';
5
+ import type { ClinicSocialLinks } from './clinic-profile.type.js';
6
+ import type { ClinicWorkingPeriod } from './clinic-staff.type.js';
7
+ import type { ClinicTreatmentContent } from './clinic-treatment.type.js';
4
8
  import type { LocalizedText } from './localized-text.type.js';
5
9
  /**
6
10
  * What anybody on the internet may read.
@@ -12,6 +16,8 @@ export interface PublicClinic {
12
16
  slug: string;
13
17
  name: LocalizedText;
14
18
  tagline: Nullable<LocalizedText>;
19
+ about: Nullable<LocalizedText>;
20
+ socialLinks: Nullable<ClinicSocialLinks>;
15
21
  phone: Nullable<string>;
16
22
  email: Nullable<string>;
17
23
  bookingHorizonDays: number;
@@ -29,6 +35,9 @@ export interface PublicBranch {
29
35
  phone: Nullable<string>;
30
36
  timeZone: string;
31
37
  specialtyIds: UUID[];
38
+ openingHours: ClinicWorkingPeriod[];
39
+ latitude: Nullable<number>;
40
+ longitude: Nullable<number>;
32
41
  }
33
42
  export interface PublicTreatmentOption {
34
43
  id: UUID;
@@ -57,12 +66,18 @@ export interface PublicTreatment {
57
66
  isBookableOnline: boolean;
58
67
  options: PublicTreatmentOption[];
59
68
  promotion: Nullable<PublicTreatmentPromotion>;
69
+ content: ClinicTreatmentContent;
70
+ image: Nullable<ClinicMediaImage>;
60
71
  }
61
72
  export interface PublicSpecialist {
62
73
  id: UUID;
63
74
  displayName: string;
64
75
  locationId: UUID;
65
76
  treatmentIds: UUID[];
77
+ title: Nullable<LocalizedText>;
78
+ bio: Nullable<LocalizedText>;
79
+ experienceYears: Nullable<number>;
80
+ photo: Nullable<ClinicMediaImage>;
66
81
  }
67
82
  /** A promotion running today, biggest discount first. */
68
83
  export interface PublicPromotion {
@@ -1,7 +1,9 @@
1
1
  import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
2
  import type { Nullable } from '../../type/nil.type.js';
3
3
  import type { UUID } from '../../type/uuid.type.js';
4
+ import type { ClinicMediaImage } from './clinic-media.type.js';
4
5
  import type { ClinicResourceStatus } from './clinic-resource-status.enum.js';
6
+ import type { LocalizedText } from './localized-text.type.js';
5
7
  /** One stretch of a weekly schedule, read in the location's own time zone. */
6
8
  export interface ClinicWorkingPeriod {
7
9
  /** ISO weekday: 1 is Monday and 7 is Sunday. */
@@ -21,6 +23,10 @@ export interface ClinicStaffMember {
21
23
  /** The treatments this person may perform. */
22
24
  treatmentIds: UUID[];
23
25
  workingHours: ClinicWorkingPeriod[];
26
+ title: Nullable<LocalizedText>;
27
+ bio: Nullable<LocalizedText>;
28
+ experienceYears: Nullable<number>;
29
+ photo: Nullable<ClinicMediaImage>;
24
30
  createdAt: IsoDateTime;
25
31
  updatedAt: IsoDateTime;
26
32
  }
@@ -33,6 +39,9 @@ export interface UpdateClinicStaffMemberRequest {
33
39
  locationId?: UUID;
34
40
  displayName?: string;
35
41
  status?: ClinicResourceStatus;
42
+ title?: Nullable<LocalizedText>;
43
+ bio?: Nullable<LocalizedText>;
44
+ experienceYears?: Nullable<number>;
36
45
  }
37
46
  export interface ReplaceClinicStaffTreatmentsRequest {
38
47
  treatmentIds: UUID[];
@@ -1,6 +1,7 @@
1
1
  import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
2
  import type { Nullable } from '../../type/nil.type.js';
3
3
  import type { UUID } from '../../type/uuid.type.js';
4
+ import type { ClinicMediaImage } from './clinic-media.type.js';
4
5
  import type { ClinicResourceStatus } from './clinic-resource-status.enum.js';
5
6
  import type { LocalizedText } from './localized-text.type.js';
6
7
  /** One way of buying a treatment. A laser zone is an option; a treatment that does not vary has one. */
@@ -12,6 +13,20 @@ export interface ClinicTreatmentOption {
12
13
  priceMinor: number;
13
14
  sortOrder: number;
14
15
  }
16
+ export interface ClinicTreatmentFaq {
17
+ question: LocalizedText;
18
+ answer: LocalizedText;
19
+ }
20
+ /** What a treatment's page says about it. Every part may be left empty. */
21
+ export interface ClinicTreatmentContent {
22
+ benefits: LocalizedText[];
23
+ steps: LocalizedText[];
24
+ preparation: Nullable<LocalizedText>;
25
+ aftercare: Nullable<LocalizedText>;
26
+ faq: ClinicTreatmentFaq[];
27
+ /** How many sessions a course usually takes, which is advice and limits nothing. */
28
+ recommendedSessions: Nullable<number>;
29
+ }
15
30
  export interface ClinicTreatment {
16
31
  id: UUID;
17
32
  specialtyId: UUID;
@@ -27,6 +42,8 @@ export interface ClinicTreatment {
27
42
  isBookableOnline: boolean;
28
43
  status: ClinicResourceStatus;
29
44
  options: ClinicTreatmentOption[];
45
+ content: ClinicTreatmentContent;
46
+ image: Nullable<ClinicMediaImage>;
30
47
  createdAt: IsoDateTime;
31
48
  updatedAt: IsoDateTime;
32
49
  }
@@ -51,6 +68,7 @@ export interface CreateClinicTreatmentRequest {
51
68
  minDaysBetweenSessions?: Nullable<number>;
52
69
  isBookableOnline?: boolean;
53
70
  options: CreateClinicTreatmentOptionRequest[];
71
+ content?: ClinicTreatmentContent;
54
72
  }
55
73
  export interface UpdateClinicTreatmentRequest {
56
74
  specialtyId?: UUID;
@@ -61,4 +79,5 @@ export interface UpdateClinicTreatmentRequest {
61
79
  minDaysBetweenSessions?: Nullable<number>;
62
80
  isBookableOnline?: boolean;
63
81
  status?: ClinicResourceStatus;
82
+ content?: ClinicTreatmentContent;
64
83
  }
@@ -24,5 +24,12 @@ export declare enum RealtimeEventType {
24
24
  * repeat a value the profile events already used and be silently discarded by the outbox's
25
25
  * uniqueness constraint. `mobility_worker_outbox_event.aggregate_type` exists for this.
26
26
  */
27
- MOBILITY_DISPATCH_OFFER_UPDATED = "mobility.dispatch-offer.updated"
27
+ MOBILITY_DISPATCH_OFFER_UPDATED = "mobility.dispatch-offer.updated",
28
+ /**
29
+ * Something on a branch's floor or kitchen changed, so staff screens refetch. Carried on the
30
+ * branch, while the version is that of whichever order or bill moved.
31
+ */
32
+ RESTAURANT_BRANCH_UPDATED = "restaurant.branch.updated",
33
+ /** One diner's order moved. */
34
+ RESTAURANT_ORDER_UPDATED = "restaurant.order.updated"
28
35
  }
@@ -26,4 +26,11 @@ export var RealtimeEventType;
26
26
  * uniqueness constraint. `mobility_worker_outbox_event.aggregate_type` exists for this.
27
27
  */
28
28
  RealtimeEventType["MOBILITY_DISPATCH_OFFER_UPDATED"] = "mobility.dispatch-offer.updated";
29
+ /**
30
+ * Something on a branch's floor or kitchen changed, so staff screens refetch. Carried on the
31
+ * branch, while the version is that of whichever order or bill moved.
32
+ */
33
+ RealtimeEventType["RESTAURANT_BRANCH_UPDATED"] = "restaurant.branch.updated";
34
+ /** One diner's order moved. */
35
+ RealtimeEventType["RESTAURANT_ORDER_UPDATED"] = "restaurant.order.updated";
29
36
  })(RealtimeEventType || (RealtimeEventType = {}));
@@ -8,5 +8,7 @@ export declare enum RealtimeResourceType {
8
8
  TAXI_RIDE = "taxi.ride",
9
9
  DELIVERY_JOB = "delivery.job",
10
10
  MOBILITY_WORKER = "mobility.worker",
11
- MOBILITY_DISPATCH = "mobility.dispatch"
11
+ MOBILITY_DISPATCH = "mobility.dispatch",
12
+ RESTAURANT_BRANCH = "restaurant.branch",
13
+ RESTAURANT_ORDER = "restaurant.order"
12
14
  }
@@ -10,4 +10,6 @@ export var RealtimeResourceType;
10
10
  RealtimeResourceType["DELIVERY_JOB"] = "delivery.job";
11
11
  RealtimeResourceType["MOBILITY_WORKER"] = "mobility.worker";
12
12
  RealtimeResourceType["MOBILITY_DISPATCH"] = "mobility.dispatch";
13
+ RealtimeResourceType["RESTAURANT_BRANCH"] = "restaurant.branch";
14
+ RealtimeResourceType["RESTAURANT_ORDER"] = "restaurant.order";
13
15
  })(RealtimeResourceType || (RealtimeResourceType = {}));
@@ -0,0 +1,19 @@
1
+ export * from './restaurant-allergen.enum.js';
2
+ export * from './restaurant-bill-status.enum.js';
3
+ export * from './restaurant-bill.type.js';
4
+ export * from './restaurant-branch.type.js';
5
+ export * from './restaurant-channel.enum.js';
6
+ export * from './restaurant-dietary-tag.enum.js';
7
+ export * from './restaurant-floor.type.js';
8
+ export * from './restaurant-kitchen.type.js';
9
+ export * from './restaurant-line-status.enum.js';
10
+ export * from './restaurant-menu.type.js';
11
+ export * from './restaurant-order-source.enum.js';
12
+ export * from './restaurant-order-status.enum.js';
13
+ export * from './restaurant-order.type.js';
14
+ export * from './restaurant-payment-method.enum.js';
15
+ export * from './restaurant-profile.type.js';
16
+ export * from './restaurant-public.type.js';
17
+ export * from './restaurant-resource-status.enum.js';
18
+ export * from './restaurant-service-request.type.js';
19
+ export * from './restaurant-table.type.js';
@@ -0,0 +1,19 @@
1
+ export * from './restaurant-allergen.enum.js';
2
+ export * from './restaurant-bill-status.enum.js';
3
+ export * from './restaurant-bill.type.js';
4
+ export * from './restaurant-branch.type.js';
5
+ export * from './restaurant-channel.enum.js';
6
+ export * from './restaurant-dietary-tag.enum.js';
7
+ export * from './restaurant-floor.type.js';
8
+ export * from './restaurant-kitchen.type.js';
9
+ export * from './restaurant-line-status.enum.js';
10
+ export * from './restaurant-menu.type.js';
11
+ export * from './restaurant-order-source.enum.js';
12
+ export * from './restaurant-order-status.enum.js';
13
+ export * from './restaurant-order.type.js';
14
+ export * from './restaurant-payment-method.enum.js';
15
+ export * from './restaurant-profile.type.js';
16
+ export * from './restaurant-public.type.js';
17
+ export * from './restaurant-resource-status.enum.js';
18
+ export * from './restaurant-service-request.type.js';
19
+ export * from './restaurant-table.type.js';
@@ -0,0 +1,17 @@
1
+ /** The fourteen allergens EU food labelling names, the list a Georgian menu is usually held to. */
2
+ export declare enum RestaurantAllergen {
3
+ GLUTEN = "gluten",
4
+ CRUSTACEANS = "crustaceans",
5
+ EGGS = "eggs",
6
+ FISH = "fish",
7
+ PEANUTS = "peanuts",
8
+ SOYBEANS = "soybeans",
9
+ MILK = "milk",
10
+ TREE_NUTS = "tree-nuts",
11
+ CELERY = "celery",
12
+ MUSTARD = "mustard",
13
+ SESAME = "sesame",
14
+ SULPHITES = "sulphites",
15
+ LUPIN = "lupin",
16
+ MOLLUSCS = "molluscs"
17
+ }
@@ -0,0 +1,18 @@
1
+ /** The fourteen allergens EU food labelling names, the list a Georgian menu is usually held to. */
2
+ export var RestaurantAllergen;
3
+ (function (RestaurantAllergen) {
4
+ RestaurantAllergen["GLUTEN"] = "gluten";
5
+ RestaurantAllergen["CRUSTACEANS"] = "crustaceans";
6
+ RestaurantAllergen["EGGS"] = "eggs";
7
+ RestaurantAllergen["FISH"] = "fish";
8
+ RestaurantAllergen["PEANUTS"] = "peanuts";
9
+ RestaurantAllergen["SOYBEANS"] = "soybeans";
10
+ RestaurantAllergen["MILK"] = "milk";
11
+ RestaurantAllergen["TREE_NUTS"] = "tree-nuts";
12
+ RestaurantAllergen["CELERY"] = "celery";
13
+ RestaurantAllergen["MUSTARD"] = "mustard";
14
+ RestaurantAllergen["SESAME"] = "sesame";
15
+ RestaurantAllergen["SULPHITES"] = "sulphites";
16
+ RestaurantAllergen["LUPIN"] = "lupin";
17
+ RestaurantAllergen["MOLLUSCS"] = "molluscs";
18
+ })(RestaurantAllergen || (RestaurantAllergen = {}));
@@ -0,0 +1,6 @@
1
+ /** A bill is open until what it adds up to has been paid, or it is called off. */
2
+ export declare enum RestaurantBillStatus {
3
+ OPEN = "open",
4
+ SETTLED = "settled",
5
+ CANCELLED = "cancelled"
6
+ }
@@ -0,0 +1,7 @@
1
+ /** A bill is open until what it adds up to has been paid, or it is called off. */
2
+ export var RestaurantBillStatus;
3
+ (function (RestaurantBillStatus) {
4
+ RestaurantBillStatus["OPEN"] = "open";
5
+ RestaurantBillStatus["SETTLED"] = "settled";
6
+ RestaurantBillStatus["CANCELLED"] = "cancelled";
7
+ })(RestaurantBillStatus || (RestaurantBillStatus = {}));
@@ -0,0 +1,124 @@
1
+ import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
+ import type { UUID } from '../../type/uuid.type.js';
3
+ import type { RestaurantBillStatus } from './restaurant-bill-status.enum.js';
4
+ import type { RestaurantChannel } from './restaurant-channel.enum.js';
5
+ import type { RestaurantOrder } from './restaurant-order.type.js';
6
+ import type { RestaurantPaymentMethod } from './restaurant-payment-method.enum.js';
7
+ export interface RestaurantPayment {
8
+ id: UUID;
9
+ billId: UUID;
10
+ method: RestaurantPaymentMethod;
11
+ /** Negative for a refund. */
12
+ amountMinor: number;
13
+ tipMinor: number;
14
+ /** The payment a refund gives back. */
15
+ refundOfId: UUID | null;
16
+ note: string | null;
17
+ recordedByUserId: UUID | null;
18
+ createdAt: IsoDateTime;
19
+ }
20
+ /** What a table has run up, or what one takeaway adds up to. */
21
+ export interface RestaurantBill {
22
+ id: UUID;
23
+ branchId: UUID;
24
+ tableId: UUID | null;
25
+ tableLabel: string | null;
26
+ channel: RestaurantChannel;
27
+ status: RestaurantBillStatus;
28
+ currency: string;
29
+ subtotalMinor: number;
30
+ serviceChargeBasisPoints: number;
31
+ serviceChargeMinor: number;
32
+ deliveryFeeMinor: number;
33
+ discountMinor: number;
34
+ totalMinor: number;
35
+ /** Net of refunds. */
36
+ paidMinor: number;
37
+ /** What is still owing, never below zero. */
38
+ balanceMinor: number;
39
+ tipMinor: number;
40
+ orders: RestaurantOrder[];
41
+ payments: RestaurantPayment[];
42
+ openedAt: IsoDateTime;
43
+ closedAt: IsoDateTime | null;
44
+ }
45
+ /** A bill as a line in a list. */
46
+ export interface RestaurantBillSummary {
47
+ id: UUID;
48
+ branchId: UUID;
49
+ tableLabel: string | null;
50
+ channel: RestaurantChannel;
51
+ status: RestaurantBillStatus;
52
+ currency: string;
53
+ totalMinor: number;
54
+ paidMinor: number;
55
+ balanceMinor: number;
56
+ openedAt: IsoDateTime;
57
+ closedAt: IsoDateTime | null;
58
+ }
59
+ export interface RecordRestaurantPaymentRequest {
60
+ method: RestaurantPaymentMethod.CASH | RestaurantPaymentMethod.CARD;
61
+ amountMinor: number;
62
+ tipMinor?: number;
63
+ note?: string | null;
64
+ }
65
+ export interface RefundRestaurantPaymentRequest {
66
+ amountMinor: number;
67
+ reason: string;
68
+ }
69
+ /** One way of paying over a day. Refunds are netted out, so `cash` is what the drawer should hold. */
70
+ export interface RestaurantTakingsByMethod {
71
+ method: RestaurantPaymentMethod;
72
+ amountMinor: number;
73
+ tipMinor: number;
74
+ count: number;
75
+ }
76
+ export interface RestaurantDailyTakings {
77
+ branchId: UUID;
78
+ /** The business day, in the branch's own calendar. */
79
+ date: string;
80
+ currency: string;
81
+ totalMinor: number;
82
+ tipMinor: number;
83
+ byMethod: RestaurantTakingsByMethod[];
84
+ refundsMinor: number;
85
+ billsSettled: number;
86
+ /** Bills from that day still owing something. */
87
+ billsOpen: number;
88
+ openBalanceMinor: number;
89
+ }
90
+ export interface RestaurantSalesByChannel {
91
+ channel: RestaurantChannel;
92
+ orderCount: number;
93
+ salesMinor: number;
94
+ }
95
+ export interface RestaurantSalesByItem {
96
+ itemId: UUID;
97
+ name: Record<string, string>;
98
+ quantity: number;
99
+ salesMinor: number;
100
+ }
101
+ export interface RestaurantSalesByHour {
102
+ /** In the branch's zone, 0 to 23. */
103
+ hour: number;
104
+ orderCount: number;
105
+ salesMinor: number;
106
+ }
107
+ export interface RestaurantSalesByDay {
108
+ date: string;
109
+ orderCount: number;
110
+ salesMinor: number;
111
+ }
112
+ export interface RestaurantSalesReport {
113
+ branchId: UUID;
114
+ from: string;
115
+ to: string;
116
+ currency: string;
117
+ orderCount: number;
118
+ salesMinor: number;
119
+ averageOrderMinor: number;
120
+ byChannel: RestaurantSalesByChannel[];
121
+ byDay: RestaurantSalesByDay[];
122
+ byHour: RestaurantSalesByHour[];
123
+ topItems: RestaurantSalesByItem[];
124
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,69 @@
1
+ import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
+ import type { UUID } from '../../type/uuid.type.js';
3
+ import type { LocalizedText } from '../clinic/localized-text.type.js';
4
+ import type { RestaurantResourceStatus } from './restaurant-resource-status.enum.js';
5
+ /**
6
+ * When a branch is open, as wall-clock times in its own zone. `dayOfWeek` is 0 for Sunday. A `closesAt`
7
+ * at or before `opensAt` runs past midnight, as a bar's does.
8
+ */
9
+ export interface RestaurantOpeningPeriod {
10
+ dayOfWeek: number;
11
+ opensAt: string;
12
+ closesAt: string;
13
+ }
14
+ /** What a branch offers and how it runs. Each channel is off until somebody turns it on. */
15
+ export interface RestaurantBranchSettings {
16
+ dineInEnabled: boolean;
17
+ takeawayEnabled: boolean;
18
+ deliveryEnabled: boolean;
19
+ reservationsEnabled: boolean;
20
+ /** Whether an order from a table waits for a waiter. On by default, because a table code is printed. */
21
+ tableOrdersNeedConfirmation: boolean;
22
+ /** Basis points on a dine-in bill: 1000 is 10%. */
23
+ serviceChargeBasisPoints: number;
24
+ takeawayPrepMinutes: number;
25
+ deliveryPrepMinutes: number;
26
+ /** Straight-line distance from the branch. */
27
+ deliveryRadiusMeters: number;
28
+ deliveryFeeMinor: number;
29
+ deliveryMinimumOrderMinor: number;
30
+ /** Null means delivery is never free. */
31
+ deliveryFreeOverMinor: number | null;
32
+ reservationSlotMinutes: number;
33
+ reservationDurationMinutes: number;
34
+ reservationLeadMinutes: number;
35
+ reservationMaxPartySize: number;
36
+ /** A ticket turns amber after this long. */
37
+ kitchenWarnMinutes: number;
38
+ /** A ticket turns red after this long. */
39
+ kitchenLateMinutes: number;
40
+ /** When the branch's day rolls over, for order numbers, the stop-list and takings. `05:00` by default. */
41
+ businessDayEndsAt: string;
42
+ }
43
+ export interface RestaurantBranch extends RestaurantBranchSettings {
44
+ id: UUID;
45
+ name: LocalizedText;
46
+ address: LocalizedText;
47
+ city: LocalizedText;
48
+ phone: string | null;
49
+ latitude: number | null;
50
+ longitude: number | null;
51
+ timeZone: string;
52
+ status: RestaurantResourceStatus;
53
+ openingHours: RestaurantOpeningPeriod[];
54
+ createdAt: IsoDateTime;
55
+ updatedAt: IsoDateTime;
56
+ }
57
+ export interface CreateRestaurantBranchRequest extends Partial<RestaurantBranchSettings> {
58
+ name: LocalizedText;
59
+ address: LocalizedText;
60
+ city: LocalizedText;
61
+ phone?: string | null;
62
+ latitude?: number | null;
63
+ longitude?: number | null;
64
+ timeZone: string;
65
+ openingHours?: RestaurantOpeningPeriod[];
66
+ }
67
+ export interface UpdateRestaurantBranchRequest extends Partial<CreateRestaurantBranchRequest> {
68
+ status?: RestaurantResourceStatus;
69
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ /** How an order reaches the diner. */
2
+ export declare enum RestaurantChannel {
3
+ DINE_IN = "dine-in",
4
+ TAKEAWAY = "takeaway",
5
+ DELIVERY = "delivery"
6
+ }
@@ -0,0 +1,7 @@
1
+ /** How an order reaches the diner. */
2
+ export var RestaurantChannel;
3
+ (function (RestaurantChannel) {
4
+ RestaurantChannel["DINE_IN"] = "dine-in";
5
+ RestaurantChannel["TAKEAWAY"] = "takeaway";
6
+ RestaurantChannel["DELIVERY"] = "delivery";
7
+ })(RestaurantChannel || (RestaurantChannel = {}));
@@ -0,0 +1,9 @@
1
+ /** What a diner filters a menu by. `lenten` is the Orthodox fasting mark Georgian menus carry. */
2
+ export declare enum RestaurantDietaryTag {
3
+ VEGETARIAN = "vegetarian",
4
+ VEGAN = "vegan",
5
+ LENTEN = "lenten",
6
+ HALAL = "halal",
7
+ GLUTEN_FREE = "gluten-free",
8
+ SPICY = "spicy"
9
+ }
@@ -0,0 +1,10 @@
1
+ /** What a diner filters a menu by. `lenten` is the Orthodox fasting mark Georgian menus carry. */
2
+ export var RestaurantDietaryTag;
3
+ (function (RestaurantDietaryTag) {
4
+ RestaurantDietaryTag["VEGETARIAN"] = "vegetarian";
5
+ RestaurantDietaryTag["VEGAN"] = "vegan";
6
+ RestaurantDietaryTag["LENTEN"] = "lenten";
7
+ RestaurantDietaryTag["HALAL"] = "halal";
8
+ RestaurantDietaryTag["GLUTEN_FREE"] = "gluten-free";
9
+ RestaurantDietaryTag["SPICY"] = "spicy";
10
+ })(RestaurantDietaryTag || (RestaurantDietaryTag = {}));
@@ -0,0 +1,29 @@
1
+ import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
+ import type { UUID } from '../../type/uuid.type.js';
3
+ import type { LocalizedText } from '../clinic/localized-text.type.js';
4
+ import type { RestaurantServiceRequest } from './restaurant-service-request.type.js';
5
+ /** The state of one table on the floor map. */
6
+ export interface RestaurantFloorTable {
7
+ id: UUID;
8
+ label: string;
9
+ seats: number;
10
+ /** The open bill, if somebody is sitting here. */
11
+ billId: UUID | null;
12
+ openedAt: IsoDateTime | null;
13
+ totalMinor: number;
14
+ /** Orders from this table waiting for a waiter to accept them. */
15
+ ordersWaiting: number;
16
+ /** Orders whose food is ready to carry over. */
17
+ ordersReady: number;
18
+ serviceRequests: RestaurantServiceRequest[];
19
+ }
20
+ export interface RestaurantFloorAreaView {
21
+ id: UUID;
22
+ name: LocalizedText;
23
+ tables: RestaurantFloorTable[];
24
+ }
25
+ export interface RestaurantFloor {
26
+ branchId: UUID;
27
+ currency: string;
28
+ areas: RestaurantFloorAreaView[];
29
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,48 @@
1
+ import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
+ import type { UUID } from '../../type/uuid.type.js';
3
+ import type { LocalizedText } from '../clinic/localized-text.type.js';
4
+ import type { RestaurantChannel } from './restaurant-channel.enum.js';
5
+ import type { RestaurantLineStatus } from './restaurant-line-status.enum.js';
6
+ import type { RestaurantOrderLineOption } from './restaurant-order.type.js';
7
+ export interface RestaurantKitchenLine {
8
+ id: UUID;
9
+ name: LocalizedText;
10
+ quantity: number;
11
+ options: RestaurantOrderLineOption[];
12
+ note: string | null;
13
+ status: RestaurantLineStatus;
14
+ startedAt: IsoDateTime | null;
15
+ readyAt: IsoDateTime | null;
16
+ }
17
+ /** What one station sees of one order. */
18
+ export interface RestaurantKitchenTicket {
19
+ orderId: UUID;
20
+ number: number;
21
+ stationId: UUID;
22
+ channel: RestaurantChannel;
23
+ tableLabel: string | null;
24
+ customerName: string | null;
25
+ note: string | null;
26
+ /** When the kitchen was given it. */
27
+ acceptedAt: IsoDateTime;
28
+ requestedFor: IsoDateTime | null;
29
+ lines: RestaurantKitchenLine[];
30
+ }
31
+ /** How many of a dish are waiting, across every ticket. */
32
+ export interface RestaurantAllDayCount {
33
+ itemId: UUID;
34
+ name: LocalizedText;
35
+ quantity: number;
36
+ }
37
+ export interface RestaurantKitchenBoard {
38
+ branchId: UUID;
39
+ warnMinutes: number;
40
+ lateMinutes: number;
41
+ tickets: RestaurantKitchenTicket[];
42
+ allDay: RestaurantAllDayCount[];
43
+ }
44
+ /** Moves every line of a ticket on together. */
45
+ export interface BumpRestaurantTicketRequest {
46
+ stationId: UUID;
47
+ status: RestaurantLineStatus.PREPARING | RestaurantLineStatus.READY;
48
+ }
@@ -0,0 +1 @@
1
+ export {};