@iveri/contracts 0.52.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.
- package/dist/api/realtime/realtime-event-type.enum.d.ts +8 -1
- package/dist/api/realtime/realtime-event-type.enum.js +7 -0
- package/dist/api/realtime/realtime-resource-type.enum.d.ts +3 -1
- package/dist/api/realtime/realtime-resource-type.enum.js +2 -0
- package/dist/api/restaurant/index.d.ts +19 -0
- package/dist/api/restaurant/index.js +19 -0
- package/dist/api/restaurant/restaurant-allergen.enum.d.ts +17 -0
- package/dist/api/restaurant/restaurant-allergen.enum.js +18 -0
- package/dist/api/restaurant/restaurant-bill-status.enum.d.ts +6 -0
- package/dist/api/restaurant/restaurant-bill-status.enum.js +7 -0
- package/dist/api/restaurant/restaurant-bill.type.d.ts +124 -0
- package/dist/api/restaurant/restaurant-bill.type.js +1 -0
- package/dist/api/restaurant/restaurant-branch.type.d.ts +69 -0
- package/dist/api/restaurant/restaurant-branch.type.js +1 -0
- package/dist/api/restaurant/restaurant-channel.enum.d.ts +6 -0
- package/dist/api/restaurant/restaurant-channel.enum.js +7 -0
- package/dist/api/restaurant/restaurant-dietary-tag.enum.d.ts +9 -0
- package/dist/api/restaurant/restaurant-dietary-tag.enum.js +10 -0
- package/dist/api/restaurant/restaurant-floor.type.d.ts +29 -0
- package/dist/api/restaurant/restaurant-floor.type.js +1 -0
- package/dist/api/restaurant/restaurant-kitchen.type.d.ts +48 -0
- package/dist/api/restaurant/restaurant-kitchen.type.js +1 -0
- package/dist/api/restaurant/restaurant-line-status.enum.d.ts +7 -0
- package/dist/api/restaurant/restaurant-line-status.enum.js +8 -0
- package/dist/api/restaurant/restaurant-menu.type.d.ts +141 -0
- package/dist/api/restaurant/restaurant-menu.type.js +1 -0
- package/dist/api/restaurant/restaurant-order-source.enum.d.ts +6 -0
- package/dist/api/restaurant/restaurant-order-source.enum.js +7 -0
- package/dist/api/restaurant/restaurant-order-status.enum.d.ts +16 -0
- package/dist/api/restaurant/restaurant-order-status.enum.js +17 -0
- package/dist/api/restaurant/restaurant-order.type.d.ts +81 -0
- package/dist/api/restaurant/restaurant-order.type.js +1 -0
- package/dist/api/restaurant/restaurant-payment-method.enum.d.ts +6 -0
- package/dist/api/restaurant/restaurant-payment-method.enum.js +7 -0
- package/dist/api/restaurant/restaurant-profile.type.d.ts +40 -0
- package/dist/api/restaurant/restaurant-profile.type.js +1 -0
- package/dist/api/restaurant/restaurant-public.type.d.ts +129 -0
- package/dist/api/restaurant/restaurant-public.type.js +1 -0
- package/dist/api/restaurant/restaurant-resource-status.enum.d.ts +5 -0
- package/dist/api/restaurant/restaurant-resource-status.enum.js +6 -0
- package/dist/api/restaurant/restaurant-service-request.type.d.ts +16 -0
- package/dist/api/restaurant/restaurant-service-request.type.js +5 -0
- package/dist/api/restaurant/restaurant-table.type.d.ts +51 -0
- package/dist/api/restaurant/restaurant-table.type.js +1 -0
- package/dist/enum/user-permission.enum.d.ts +37 -1
- package/dist/enum/user-permission.enum.js +37 -0
- package/package.json +5 -1
|
@@ -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,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,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 {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** One plate's progress at its station. */
|
|
2
|
+
export var RestaurantLineStatus;
|
|
3
|
+
(function (RestaurantLineStatus) {
|
|
4
|
+
RestaurantLineStatus["QUEUED"] = "queued";
|
|
5
|
+
RestaurantLineStatus["PREPARING"] = "preparing";
|
|
6
|
+
RestaurantLineStatus["READY"] = "ready";
|
|
7
|
+
RestaurantLineStatus["VOIDED"] = "voided";
|
|
8
|
+
})(RestaurantLineStatus || (RestaurantLineStatus = {}));
|
|
@@ -0,0 +1,141 @@
|
|
|
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 { RestaurantAllergen } from './restaurant-allergen.enum.js';
|
|
5
|
+
import type { RestaurantDietaryTag } from './restaurant-dietary-tag.enum.js';
|
|
6
|
+
import type { RestaurantResourceStatus } from './restaurant-resource-status.enum.js';
|
|
7
|
+
/** Where a plate is made: the hot kitchen, the bar. A ticket is what one station sees of an order. */
|
|
8
|
+
export interface RestaurantStation {
|
|
9
|
+
id: UUID;
|
|
10
|
+
name: LocalizedText;
|
|
11
|
+
position: number;
|
|
12
|
+
status: RestaurantResourceStatus;
|
|
13
|
+
createdAt: IsoDateTime;
|
|
14
|
+
updatedAt: IsoDateTime;
|
|
15
|
+
}
|
|
16
|
+
export interface CreateRestaurantStationRequest {
|
|
17
|
+
name: LocalizedText;
|
|
18
|
+
position?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface UpdateRestaurantStationRequest {
|
|
21
|
+
name?: LocalizedText;
|
|
22
|
+
position?: number;
|
|
23
|
+
status?: RestaurantResourceStatus;
|
|
24
|
+
}
|
|
25
|
+
export interface RestaurantMenuCategory {
|
|
26
|
+
id: UUID;
|
|
27
|
+
name: LocalizedText;
|
|
28
|
+
description: LocalizedText | null;
|
|
29
|
+
position: number;
|
|
30
|
+
/** Wall-clock times in the branch's zone. Both null means all day. */
|
|
31
|
+
availableFrom: string | null;
|
|
32
|
+
availableUntil: string | null;
|
|
33
|
+
status: RestaurantResourceStatus;
|
|
34
|
+
createdAt: IsoDateTime;
|
|
35
|
+
updatedAt: IsoDateTime;
|
|
36
|
+
}
|
|
37
|
+
export interface CreateRestaurantMenuCategoryRequest {
|
|
38
|
+
name: LocalizedText;
|
|
39
|
+
description?: LocalizedText | null;
|
|
40
|
+
position?: number;
|
|
41
|
+
availableFrom?: string | null;
|
|
42
|
+
availableUntil?: string | null;
|
|
43
|
+
}
|
|
44
|
+
export interface UpdateRestaurantMenuCategoryRequest extends Partial<CreateRestaurantMenuCategoryRequest> {
|
|
45
|
+
status?: RestaurantResourceStatus;
|
|
46
|
+
}
|
|
47
|
+
export interface RestaurantModifierOption {
|
|
48
|
+
id: UUID;
|
|
49
|
+
name: LocalizedText;
|
|
50
|
+
/** Added to the item's price. May be negative. */
|
|
51
|
+
priceDeltaMinor: number;
|
|
52
|
+
position: number;
|
|
53
|
+
status: RestaurantResourceStatus;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A choice on a dish. Size is a group with exactly one pick and "extras" a group with none required,
|
|
57
|
+
* so one mechanism covers both, and a group is shared by every dish that offers it.
|
|
58
|
+
*/
|
|
59
|
+
export interface RestaurantModifierGroup {
|
|
60
|
+
id: UUID;
|
|
61
|
+
name: LocalizedText;
|
|
62
|
+
minSelections: number;
|
|
63
|
+
maxSelections: number;
|
|
64
|
+
status: RestaurantResourceStatus;
|
|
65
|
+
options: RestaurantModifierOption[];
|
|
66
|
+
createdAt: IsoDateTime;
|
|
67
|
+
updatedAt: IsoDateTime;
|
|
68
|
+
}
|
|
69
|
+
export interface RestaurantModifierOptionInput {
|
|
70
|
+
/** Present when keeping an option, so an order that names it still can. */
|
|
71
|
+
id?: UUID;
|
|
72
|
+
name: LocalizedText;
|
|
73
|
+
priceDeltaMinor: number;
|
|
74
|
+
status?: RestaurantResourceStatus;
|
|
75
|
+
}
|
|
76
|
+
export interface CreateRestaurantModifierGroupRequest {
|
|
77
|
+
name: LocalizedText;
|
|
78
|
+
minSelections: number;
|
|
79
|
+
maxSelections: number;
|
|
80
|
+
options: RestaurantModifierOptionInput[];
|
|
81
|
+
}
|
|
82
|
+
export interface UpdateRestaurantModifierGroupRequest extends Partial<CreateRestaurantModifierGroupRequest> {
|
|
83
|
+
status?: RestaurantResourceStatus;
|
|
84
|
+
}
|
|
85
|
+
export interface RestaurantMenuItem {
|
|
86
|
+
id: UUID;
|
|
87
|
+
categoryId: UUID;
|
|
88
|
+
stationId: UUID;
|
|
89
|
+
name: LocalizedText;
|
|
90
|
+
description: LocalizedText | null;
|
|
91
|
+
priceMinor: number;
|
|
92
|
+
imageUrl: string | null;
|
|
93
|
+
thumbnailUrl: string | null;
|
|
94
|
+
allergens: RestaurantAllergen[];
|
|
95
|
+
dietaryTags: RestaurantDietaryTag[];
|
|
96
|
+
prepMinutes: number | null;
|
|
97
|
+
weightGrams: number | null;
|
|
98
|
+
calories: number | null;
|
|
99
|
+
isFeatured: boolean;
|
|
100
|
+
position: number;
|
|
101
|
+
status: RestaurantResourceStatus;
|
|
102
|
+
/** In the order they are asked. */
|
|
103
|
+
modifierGroupIds: UUID[];
|
|
104
|
+
createdAt: IsoDateTime;
|
|
105
|
+
updatedAt: IsoDateTime;
|
|
106
|
+
}
|
|
107
|
+
export interface CreateRestaurantMenuItemRequest {
|
|
108
|
+
categoryId: UUID;
|
|
109
|
+
stationId: UUID;
|
|
110
|
+
name: LocalizedText;
|
|
111
|
+
description?: LocalizedText | null;
|
|
112
|
+
priceMinor: number;
|
|
113
|
+
allergens?: RestaurantAllergen[];
|
|
114
|
+
dietaryTags?: RestaurantDietaryTag[];
|
|
115
|
+
prepMinutes?: number | null;
|
|
116
|
+
weightGrams?: number | null;
|
|
117
|
+
calories?: number | null;
|
|
118
|
+
isFeatured?: boolean;
|
|
119
|
+
position?: number;
|
|
120
|
+
modifierGroupIds?: UUID[];
|
|
121
|
+
}
|
|
122
|
+
export interface UpdateRestaurantMenuItemRequest extends Partial<CreateRestaurantMenuItemRequest> {
|
|
123
|
+
status?: RestaurantResourceStatus;
|
|
124
|
+
}
|
|
125
|
+
/** How one branch differs from the menu. A row exists only where it does. */
|
|
126
|
+
export interface RestaurantBranchItem {
|
|
127
|
+
itemId: UUID;
|
|
128
|
+
branchId: UUID;
|
|
129
|
+
isHidden: boolean;
|
|
130
|
+
priceMinorOverride: number | null;
|
|
131
|
+
/** Null is not sold out. A date in the far future is sold out until somebody says otherwise. */
|
|
132
|
+
soldOutUntil: IsoDateTime | null;
|
|
133
|
+
}
|
|
134
|
+
export interface UpdateRestaurantBranchItemRequest {
|
|
135
|
+
isHidden?: boolean;
|
|
136
|
+
priceMinorOverride?: number | null;
|
|
137
|
+
}
|
|
138
|
+
/** Puts a dish on the stop-list. `end-of-day` ends with the branch's business day. */
|
|
139
|
+
export interface MarkRestaurantItemSoldOutRequest {
|
|
140
|
+
until: 'end-of-day' | 'indefinite';
|
|
141
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Who entered an order: staff, a diner at a table, or a diner elsewhere. */
|
|
2
|
+
export var RestaurantOrderSource;
|
|
3
|
+
(function (RestaurantOrderSource) {
|
|
4
|
+
RestaurantOrderSource["STAFF"] = "staff";
|
|
5
|
+
RestaurantOrderSource["TABLE"] = "table";
|
|
6
|
+
RestaurantOrderSource["ONLINE"] = "online";
|
|
7
|
+
})(RestaurantOrderSource || (RestaurantOrderSource = {}));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How far an order has got.
|
|
3
|
+
*
|
|
4
|
+
* `awaiting-payment` keeps an order paying online away from the kitchen until the money is verified.
|
|
5
|
+
* `placed` waits for a person to accept it. Payment is a separate fact, because cancelled and paid
|
|
6
|
+
* has to be expressible.
|
|
7
|
+
*/
|
|
8
|
+
export declare enum RestaurantOrderStatus {
|
|
9
|
+
AWAITING_PAYMENT = "awaiting-payment",
|
|
10
|
+
PLACED = "placed",
|
|
11
|
+
IN_KITCHEN = "in-kitchen",
|
|
12
|
+
READY = "ready",
|
|
13
|
+
OUT_FOR_DELIVERY = "out-for-delivery",
|
|
14
|
+
COMPLETED = "completed",
|
|
15
|
+
CANCELLED = "cancelled"
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How far an order has got.
|
|
3
|
+
*
|
|
4
|
+
* `awaiting-payment` keeps an order paying online away from the kitchen until the money is verified.
|
|
5
|
+
* `placed` waits for a person to accept it. Payment is a separate fact, because cancelled and paid
|
|
6
|
+
* has to be expressible.
|
|
7
|
+
*/
|
|
8
|
+
export var RestaurantOrderStatus;
|
|
9
|
+
(function (RestaurantOrderStatus) {
|
|
10
|
+
RestaurantOrderStatus["AWAITING_PAYMENT"] = "awaiting-payment";
|
|
11
|
+
RestaurantOrderStatus["PLACED"] = "placed";
|
|
12
|
+
RestaurantOrderStatus["IN_KITCHEN"] = "in-kitchen";
|
|
13
|
+
RestaurantOrderStatus["READY"] = "ready";
|
|
14
|
+
RestaurantOrderStatus["OUT_FOR_DELIVERY"] = "out-for-delivery";
|
|
15
|
+
RestaurantOrderStatus["COMPLETED"] = "completed";
|
|
16
|
+
RestaurantOrderStatus["CANCELLED"] = "cancelled";
|
|
17
|
+
})(RestaurantOrderStatus || (RestaurantOrderStatus = {}));
|
|
@@ -0,0 +1,81 @@
|
|
|
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 { RestaurantOrderSource } from './restaurant-order-source.enum.js';
|
|
7
|
+
import type { RestaurantOrderStatus } from './restaurant-order-status.enum.js';
|
|
8
|
+
/** What was chosen on a line, as it was named and priced when ordered. */
|
|
9
|
+
export interface RestaurantOrderLineOption {
|
|
10
|
+
optionId: UUID;
|
|
11
|
+
groupName: LocalizedText;
|
|
12
|
+
name: LocalizedText;
|
|
13
|
+
priceDeltaMinor: number;
|
|
14
|
+
}
|
|
15
|
+
export interface RestaurantOrderLine {
|
|
16
|
+
id: UUID;
|
|
17
|
+
itemId: UUID;
|
|
18
|
+
stationId: UUID;
|
|
19
|
+
name: LocalizedText;
|
|
20
|
+
quantity: number;
|
|
21
|
+
unitPriceMinor: number;
|
|
22
|
+
lineTotalMinor: number;
|
|
23
|
+
options: RestaurantOrderLineOption[];
|
|
24
|
+
note: string | null;
|
|
25
|
+
status: RestaurantLineStatus;
|
|
26
|
+
startedAt: IsoDateTime | null;
|
|
27
|
+
readyAt: IsoDateTime | null;
|
|
28
|
+
voidedAt: IsoDateTime | null;
|
|
29
|
+
voidReason: string | null;
|
|
30
|
+
}
|
|
31
|
+
export interface RestaurantOrder {
|
|
32
|
+
id: UUID;
|
|
33
|
+
/** Per branch and business day, so a kitchen can call it across the room. */
|
|
34
|
+
number: number;
|
|
35
|
+
branchId: UUID;
|
|
36
|
+
billId: UUID;
|
|
37
|
+
tableId: UUID | null;
|
|
38
|
+
tableLabel: string | null;
|
|
39
|
+
channel: RestaurantChannel;
|
|
40
|
+
source: RestaurantOrderSource;
|
|
41
|
+
status: RestaurantOrderStatus;
|
|
42
|
+
customerName: string | null;
|
|
43
|
+
customerPhone: string | null;
|
|
44
|
+
note: string | null;
|
|
45
|
+
/** When it should be ready. Null means as soon as it can be. */
|
|
46
|
+
requestedFor: IsoDateTime | null;
|
|
47
|
+
subtotalMinor: number;
|
|
48
|
+
currency: string;
|
|
49
|
+
lines: RestaurantOrderLine[];
|
|
50
|
+
placedAt: IsoDateTime;
|
|
51
|
+
acceptedAt: IsoDateTime | null;
|
|
52
|
+
readyAt: IsoDateTime | null;
|
|
53
|
+
completedAt: IsoDateTime | null;
|
|
54
|
+
cancelledAt: IsoDateTime | null;
|
|
55
|
+
cancelReason: string | null;
|
|
56
|
+
version: number;
|
|
57
|
+
}
|
|
58
|
+
/** What is being ordered. A client never sends a price. */
|
|
59
|
+
export interface RestaurantOrderLineRequest {
|
|
60
|
+
itemId: UUID;
|
|
61
|
+
quantity: number;
|
|
62
|
+
optionIds?: UUID[];
|
|
63
|
+
note?: string | null;
|
|
64
|
+
}
|
|
65
|
+
/** A waiter entering an order. */
|
|
66
|
+
export interface CreateRestaurantOrderRequest {
|
|
67
|
+
branchId: UUID;
|
|
68
|
+
channel: RestaurantChannel;
|
|
69
|
+
/** Required for dine-in, refused otherwise. */
|
|
70
|
+
tableId?: UUID | null;
|
|
71
|
+
lines: RestaurantOrderLineRequest[];
|
|
72
|
+
customerName?: string | null;
|
|
73
|
+
customerPhone?: string | null;
|
|
74
|
+
note?: string | null;
|
|
75
|
+
}
|
|
76
|
+
export interface CancelRestaurantOrderRequest {
|
|
77
|
+
reason: string;
|
|
78
|
+
}
|
|
79
|
+
export interface VoidRestaurantOrderLineRequest {
|
|
80
|
+
reason: string;
|
|
81
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** How money reached the restaurant. `online` is written only by a verified billing session. */
|
|
2
|
+
export var RestaurantPaymentMethod;
|
|
3
|
+
(function (RestaurantPaymentMethod) {
|
|
4
|
+
RestaurantPaymentMethod["CASH"] = "cash";
|
|
5
|
+
RestaurantPaymentMethod["CARD"] = "card";
|
|
6
|
+
RestaurantPaymentMethod["ONLINE"] = "online";
|
|
7
|
+
})(RestaurantPaymentMethod || (RestaurantPaymentMethod = {}));
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
export type { LocalizedText };
|
|
5
|
+
export interface RestaurantSocialLink {
|
|
6
|
+
network: string;
|
|
7
|
+
url: string;
|
|
8
|
+
}
|
|
9
|
+
/** What a restaurant publishes about itself. With no row, or unpublished, its public routes answer 404. */
|
|
10
|
+
export interface RestaurantProfile {
|
|
11
|
+
id: UUID;
|
|
12
|
+
slug: string;
|
|
13
|
+
name: LocalizedText;
|
|
14
|
+
tagline: LocalizedText | null;
|
|
15
|
+
about: LocalizedText | null;
|
|
16
|
+
/** ISO 4217. Fixed once a bill names it. */
|
|
17
|
+
currency: string;
|
|
18
|
+
phone: string | null;
|
|
19
|
+
email: string | null;
|
|
20
|
+
/** The address the table codes open and emails link to. */
|
|
21
|
+
siteUrl: string | null;
|
|
22
|
+
logoUrl: string | null;
|
|
23
|
+
coverUrl: string | null;
|
|
24
|
+
socialLinks: RestaurantSocialLink[];
|
|
25
|
+
isPublished: boolean;
|
|
26
|
+
createdAt: IsoDateTime;
|
|
27
|
+
updatedAt: IsoDateTime;
|
|
28
|
+
}
|
|
29
|
+
export interface UpdateRestaurantProfileRequest {
|
|
30
|
+
slug: string;
|
|
31
|
+
name: LocalizedText;
|
|
32
|
+
tagline?: LocalizedText | null;
|
|
33
|
+
about?: LocalizedText | null;
|
|
34
|
+
currency: string;
|
|
35
|
+
phone?: string | null;
|
|
36
|
+
email?: string | null;
|
|
37
|
+
siteUrl?: string | null;
|
|
38
|
+
socialLinks?: RestaurantSocialLink[];
|
|
39
|
+
isPublished: boolean;
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
2
|
+
import type { LocalizedText } from '../clinic/localized-text.type.js';
|
|
3
|
+
import type { RestaurantAllergen } from './restaurant-allergen.enum.js';
|
|
4
|
+
import type { RestaurantBillStatus } from './restaurant-bill-status.enum.js';
|
|
5
|
+
import type { RestaurantOpeningPeriod } from './restaurant-branch.type.js';
|
|
6
|
+
import type { RestaurantDietaryTag } from './restaurant-dietary-tag.enum.js';
|
|
7
|
+
import type { RestaurantLineStatus } from './restaurant-line-status.enum.js';
|
|
8
|
+
import type { RestaurantOrderStatus } from './restaurant-order-status.enum.js';
|
|
9
|
+
import type { RestaurantOrderLineOption, RestaurantOrderLineRequest } from './restaurant-order.type.js';
|
|
10
|
+
import type { RestaurantSocialLink } from './restaurant-profile.type.js';
|
|
11
|
+
import type { RestaurantServiceRequestKind } from './restaurant-service-request.type.js';
|
|
12
|
+
export interface PublicRestaurant {
|
|
13
|
+
slug: string;
|
|
14
|
+
name: LocalizedText;
|
|
15
|
+
tagline: LocalizedText | null;
|
|
16
|
+
about: LocalizedText | null;
|
|
17
|
+
currency: string;
|
|
18
|
+
phone: string | null;
|
|
19
|
+
email: string | null;
|
|
20
|
+
logoUrl: string | null;
|
|
21
|
+
coverUrl: string | null;
|
|
22
|
+
socialLinks: RestaurantSocialLink[];
|
|
23
|
+
}
|
|
24
|
+
export interface PublicRestaurantBranch {
|
|
25
|
+
id: UUID;
|
|
26
|
+
name: LocalizedText;
|
|
27
|
+
address: LocalizedText;
|
|
28
|
+
city: LocalizedText;
|
|
29
|
+
phone: string | null;
|
|
30
|
+
latitude: number | null;
|
|
31
|
+
longitude: number | null;
|
|
32
|
+
timeZone: string;
|
|
33
|
+
openingHours: RestaurantOpeningPeriod[];
|
|
34
|
+
isOpenNow: boolean;
|
|
35
|
+
dineInEnabled: boolean;
|
|
36
|
+
takeawayEnabled: boolean;
|
|
37
|
+
deliveryEnabled: boolean;
|
|
38
|
+
reservationsEnabled: boolean;
|
|
39
|
+
takeawayPrepMinutes: number;
|
|
40
|
+
deliveryPrepMinutes: number;
|
|
41
|
+
deliveryRadiusMeters: number;
|
|
42
|
+
deliveryFeeMinor: number;
|
|
43
|
+
deliveryMinimumOrderMinor: number;
|
|
44
|
+
deliveryFreeOverMinor: number | null;
|
|
45
|
+
serviceChargeBasisPoints: number;
|
|
46
|
+
reservationMaxPartySize: number;
|
|
47
|
+
}
|
|
48
|
+
export interface PublicRestaurantModifierOption {
|
|
49
|
+
id: UUID;
|
|
50
|
+
name: LocalizedText;
|
|
51
|
+
priceDeltaMinor: number;
|
|
52
|
+
}
|
|
53
|
+
export interface PublicRestaurantModifierGroup {
|
|
54
|
+
id: UUID;
|
|
55
|
+
name: LocalizedText;
|
|
56
|
+
minSelections: number;
|
|
57
|
+
maxSelections: number;
|
|
58
|
+
options: PublicRestaurantModifierOption[];
|
|
59
|
+
}
|
|
60
|
+
export interface PublicRestaurantMenuItem {
|
|
61
|
+
id: UUID;
|
|
62
|
+
name: LocalizedText;
|
|
63
|
+
description: LocalizedText | null;
|
|
64
|
+
priceMinor: number;
|
|
65
|
+
imageUrl: string | null;
|
|
66
|
+
thumbnailUrl: string | null;
|
|
67
|
+
allergens: RestaurantAllergen[];
|
|
68
|
+
dietaryTags: RestaurantDietaryTag[];
|
|
69
|
+
weightGrams: number | null;
|
|
70
|
+
calories: number | null;
|
|
71
|
+
isFeatured: boolean;
|
|
72
|
+
/** On the stop-list, or outside its category's hours. Shown and not orderable. */
|
|
73
|
+
isAvailable: boolean;
|
|
74
|
+
modifierGroups: PublicRestaurantModifierGroup[];
|
|
75
|
+
}
|
|
76
|
+
export interface PublicRestaurantMenuCategory {
|
|
77
|
+
id: UUID;
|
|
78
|
+
name: LocalizedText;
|
|
79
|
+
description: LocalizedText | null;
|
|
80
|
+
availableFrom: string | null;
|
|
81
|
+
availableUntil: string | null;
|
|
82
|
+
items: PublicRestaurantMenuItem[];
|
|
83
|
+
}
|
|
84
|
+
export interface PublicRestaurantMenu {
|
|
85
|
+
branchId: UUID;
|
|
86
|
+
currency: string;
|
|
87
|
+
categories: PublicRestaurantMenuCategory[];
|
|
88
|
+
}
|
|
89
|
+
/** What the table code opens. */
|
|
90
|
+
export interface PublicRestaurantTable {
|
|
91
|
+
label: string;
|
|
92
|
+
seats: number;
|
|
93
|
+
branch: PublicRestaurantBranch;
|
|
94
|
+
}
|
|
95
|
+
export interface PublicRestaurantTableOrderRequest {
|
|
96
|
+
lines: RestaurantOrderLineRequest[];
|
|
97
|
+
note?: string | null;
|
|
98
|
+
}
|
|
99
|
+
export interface PublicRestaurantTableOrderLine {
|
|
100
|
+
id: UUID;
|
|
101
|
+
name: LocalizedText;
|
|
102
|
+
quantity: number;
|
|
103
|
+
lineTotalMinor: number;
|
|
104
|
+
options: RestaurantOrderLineOption[];
|
|
105
|
+
note: string | null;
|
|
106
|
+
status: RestaurantLineStatus;
|
|
107
|
+
}
|
|
108
|
+
export interface PublicRestaurantTableOrder {
|
|
109
|
+
number: number;
|
|
110
|
+
status: RestaurantOrderStatus;
|
|
111
|
+
placedAt: string;
|
|
112
|
+
lines: PublicRestaurantTableOrderLine[];
|
|
113
|
+
}
|
|
114
|
+
/** A table's bill as anyone holding the code can read it: dishes and prices, and no names. */
|
|
115
|
+
export interface PublicRestaurantTableBill {
|
|
116
|
+
status: RestaurantBillStatus;
|
|
117
|
+
currency: string;
|
|
118
|
+
subtotalMinor: number;
|
|
119
|
+
serviceChargeBasisPoints: number;
|
|
120
|
+
serviceChargeMinor: number;
|
|
121
|
+
totalMinor: number;
|
|
122
|
+
paidMinor: number;
|
|
123
|
+
balanceMinor: number;
|
|
124
|
+
orders: PublicRestaurantTableOrder[];
|
|
125
|
+
openRequests: RestaurantServiceRequestKind[];
|
|
126
|
+
}
|
|
127
|
+
export interface PublicRestaurantServiceRequestBody {
|
|
128
|
+
kind: RestaurantServiceRequestKind;
|
|
129
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Whether a branch, table, station or menu entry is in use. Retiring keeps the history that names it. */
|
|
2
|
+
export var RestaurantResourceStatus;
|
|
3
|
+
(function (RestaurantResourceStatus) {
|
|
4
|
+
RestaurantResourceStatus["ACTIVE"] = "active";
|
|
5
|
+
RestaurantResourceStatus["INACTIVE"] = "inactive";
|
|
6
|
+
})(RestaurantResourceStatus || (RestaurantResourceStatus = {}));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
3
|
+
export declare enum RestaurantServiceRequestKind {
|
|
4
|
+
WAITER = "waiter",
|
|
5
|
+
BILL = "bill"
|
|
6
|
+
}
|
|
7
|
+
/** A table asking for somebody. */
|
|
8
|
+
export interface RestaurantServiceRequest {
|
|
9
|
+
id: UUID;
|
|
10
|
+
branchId: UUID;
|
|
11
|
+
tableId: UUID;
|
|
12
|
+
tableLabel: string;
|
|
13
|
+
kind: RestaurantServiceRequestKind;
|
|
14
|
+
createdAt: IsoDateTime;
|
|
15
|
+
resolvedAt: IsoDateTime | null;
|
|
16
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
/** A part of the room: the hall, the terrace, upstairs. */
|
|
6
|
+
export interface RestaurantFloorArea {
|
|
7
|
+
id: UUID;
|
|
8
|
+
branchId: UUID;
|
|
9
|
+
name: LocalizedText;
|
|
10
|
+
position: number;
|
|
11
|
+
status: RestaurantResourceStatus;
|
|
12
|
+
createdAt: IsoDateTime;
|
|
13
|
+
updatedAt: IsoDateTime;
|
|
14
|
+
}
|
|
15
|
+
export interface CreateRestaurantFloorAreaRequest {
|
|
16
|
+
branchId: UUID;
|
|
17
|
+
name: LocalizedText;
|
|
18
|
+
position?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface UpdateRestaurantFloorAreaRequest {
|
|
21
|
+
name?: LocalizedText;
|
|
22
|
+
position?: number;
|
|
23
|
+
status?: RestaurantResourceStatus;
|
|
24
|
+
}
|
|
25
|
+
export interface RestaurantTable {
|
|
26
|
+
id: UUID;
|
|
27
|
+
branchId: UUID;
|
|
28
|
+
areaId: UUID;
|
|
29
|
+
/** What is painted on the table: `12`, `T4`. */
|
|
30
|
+
label: string;
|
|
31
|
+
seats: number;
|
|
32
|
+
position: number;
|
|
33
|
+
status: RestaurantResourceStatus;
|
|
34
|
+
/** What the printed code carries. Replacing it stops every printed copy working. */
|
|
35
|
+
qrToken: string;
|
|
36
|
+
createdAt: IsoDateTime;
|
|
37
|
+
updatedAt: IsoDateTime;
|
|
38
|
+
}
|
|
39
|
+
export interface CreateRestaurantTableRequest {
|
|
40
|
+
areaId: UUID;
|
|
41
|
+
label: string;
|
|
42
|
+
seats: number;
|
|
43
|
+
position?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface UpdateRestaurantTableRequest {
|
|
46
|
+
areaId?: UUID;
|
|
47
|
+
label?: string;
|
|
48
|
+
seats?: number;
|
|
49
|
+
position?: number;
|
|
50
|
+
status?: RestaurantResourceStatus;
|
|
51
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -462,7 +462,43 @@ export declare enum UserPermission {
|
|
|
462
462
|
/** Record money taken at the desk and sell prepaid courses. */
|
|
463
463
|
CLINIC_PAYMENT_RECORD = "clinic:payment:record",
|
|
464
464
|
/** Give money back. Its own permission, because reception taking money does not imply returning it. */
|
|
465
|
-
CLINIC_PAYMENT_REFUND = "clinic:payment:refund"
|
|
465
|
+
CLINIC_PAYMENT_REFUND = "clinic:payment:refund",
|
|
466
|
+
/** Read a restaurant's profile, branches, tables and kitchen stations. */
|
|
467
|
+
RESTAURANT_SETUP_READ = "restaurant:setup:read",
|
|
468
|
+
/** Change them, including what each branch offers. */
|
|
469
|
+
RESTAURANT_SETUP_MANAGE = "restaurant:setup:manage",
|
|
470
|
+
/** Read the menu as staff see it, including what is hidden. */
|
|
471
|
+
RESTAURANT_MENU_READ = "restaurant:menu:read",
|
|
472
|
+
/** Change the menu: dishes, prices, modifiers, photographs. */
|
|
473
|
+
RESTAURANT_MENU_MANAGE = "restaurant:menu:manage",
|
|
474
|
+
/** Say a dish has run out. A cook can do this without being able to change a price. */
|
|
475
|
+
RESTAURANT_STOCK_MANAGE = "restaurant:stock:manage",
|
|
476
|
+
/** See orders, bills and the floor. */
|
|
477
|
+
RESTAURANT_ORDER_READ = "restaurant:order:read",
|
|
478
|
+
/** Take, accept, cancel and hand over orders, and answer a table's requests. */
|
|
479
|
+
RESTAURANT_ORDER_MANAGE = "restaurant:order:manage",
|
|
480
|
+
/** See the kitchen screen and move plates along it. */
|
|
481
|
+
RESTAURANT_KITCHEN_OPERATE = "restaurant:kitchen:operate",
|
|
482
|
+
/** See what has been paid and the day's takings. */
|
|
483
|
+
RESTAURANT_PAYMENT_READ = "restaurant:payment:read",
|
|
484
|
+
/** Record money taken at the table or till. */
|
|
485
|
+
RESTAURANT_PAYMENT_RECORD = "restaurant:payment:record",
|
|
486
|
+
/** Give money back. Its own permission, because taking money does not imply returning it. */
|
|
487
|
+
RESTAURANT_PAYMENT_REFUND = "restaurant:payment:refund",
|
|
488
|
+
/** See the booking book. */
|
|
489
|
+
RESTAURANT_RESERVATION_READ = "restaurant:reservation:read",
|
|
490
|
+
/** Take, seat and cancel bookings. */
|
|
491
|
+
RESTAURANT_RESERVATION_MANAGE = "restaurant:reservation:manage",
|
|
492
|
+
/** See a restaurant's diners. */
|
|
493
|
+
RESTAURANT_CUSTOMER_READ = "restaurant:customer:read",
|
|
494
|
+
/** Change what is held about them. */
|
|
495
|
+
RESTAURANT_CUSTOMER_MANAGE = "restaurant:customer:manage",
|
|
496
|
+
/** See promotions and reviews. */
|
|
497
|
+
RESTAURANT_MARKETING_READ = "restaurant:marketing:read",
|
|
498
|
+
/** Change promotions and moderate reviews. */
|
|
499
|
+
RESTAURANT_MARKETING_MANAGE = "restaurant:marketing:manage",
|
|
500
|
+
/** See sales reports. */
|
|
501
|
+
RESTAURANT_REPORT_READ = "restaurant:report:read"
|
|
466
502
|
}
|
|
467
503
|
/**
|
|
468
504
|
* Every member, for seeding the owner role and validating custom-role input.
|
|
@@ -525,6 +525,43 @@ export var UserPermission;
|
|
|
525
525
|
UserPermission["CLINIC_PAYMENT_RECORD"] = "clinic:payment:record";
|
|
526
526
|
/** Give money back. Its own permission, because reception taking money does not imply returning it. */
|
|
527
527
|
UserPermission["CLINIC_PAYMENT_REFUND"] = "clinic:payment:refund";
|
|
528
|
+
// Restaurant
|
|
529
|
+
/** Read a restaurant's profile, branches, tables and kitchen stations. */
|
|
530
|
+
UserPermission["RESTAURANT_SETUP_READ"] = "restaurant:setup:read";
|
|
531
|
+
/** Change them, including what each branch offers. */
|
|
532
|
+
UserPermission["RESTAURANT_SETUP_MANAGE"] = "restaurant:setup:manage";
|
|
533
|
+
/** Read the menu as staff see it, including what is hidden. */
|
|
534
|
+
UserPermission["RESTAURANT_MENU_READ"] = "restaurant:menu:read";
|
|
535
|
+
/** Change the menu: dishes, prices, modifiers, photographs. */
|
|
536
|
+
UserPermission["RESTAURANT_MENU_MANAGE"] = "restaurant:menu:manage";
|
|
537
|
+
/** Say a dish has run out. A cook can do this without being able to change a price. */
|
|
538
|
+
UserPermission["RESTAURANT_STOCK_MANAGE"] = "restaurant:stock:manage";
|
|
539
|
+
/** See orders, bills and the floor. */
|
|
540
|
+
UserPermission["RESTAURANT_ORDER_READ"] = "restaurant:order:read";
|
|
541
|
+
/** Take, accept, cancel and hand over orders, and answer a table's requests. */
|
|
542
|
+
UserPermission["RESTAURANT_ORDER_MANAGE"] = "restaurant:order:manage";
|
|
543
|
+
/** See the kitchen screen and move plates along it. */
|
|
544
|
+
UserPermission["RESTAURANT_KITCHEN_OPERATE"] = "restaurant:kitchen:operate";
|
|
545
|
+
/** See what has been paid and the day's takings. */
|
|
546
|
+
UserPermission["RESTAURANT_PAYMENT_READ"] = "restaurant:payment:read";
|
|
547
|
+
/** Record money taken at the table or till. */
|
|
548
|
+
UserPermission["RESTAURANT_PAYMENT_RECORD"] = "restaurant:payment:record";
|
|
549
|
+
/** Give money back. Its own permission, because taking money does not imply returning it. */
|
|
550
|
+
UserPermission["RESTAURANT_PAYMENT_REFUND"] = "restaurant:payment:refund";
|
|
551
|
+
/** See the booking book. */
|
|
552
|
+
UserPermission["RESTAURANT_RESERVATION_READ"] = "restaurant:reservation:read";
|
|
553
|
+
/** Take, seat and cancel bookings. */
|
|
554
|
+
UserPermission["RESTAURANT_RESERVATION_MANAGE"] = "restaurant:reservation:manage";
|
|
555
|
+
/** See a restaurant's diners. */
|
|
556
|
+
UserPermission["RESTAURANT_CUSTOMER_READ"] = "restaurant:customer:read";
|
|
557
|
+
/** Change what is held about them. */
|
|
558
|
+
UserPermission["RESTAURANT_CUSTOMER_MANAGE"] = "restaurant:customer:manage";
|
|
559
|
+
/** See promotions and reviews. */
|
|
560
|
+
UserPermission["RESTAURANT_MARKETING_READ"] = "restaurant:marketing:read";
|
|
561
|
+
/** Change promotions and moderate reviews. */
|
|
562
|
+
UserPermission["RESTAURANT_MARKETING_MANAGE"] = "restaurant:marketing:manage";
|
|
563
|
+
/** See sales reports. */
|
|
564
|
+
UserPermission["RESTAURANT_REPORT_READ"] = "restaurant:report:read";
|
|
528
565
|
})(UserPermission || (UserPermission = {}));
|
|
529
566
|
/**
|
|
530
567
|
* Every member, for seeding the owner role and validating custom-role input.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iveri/contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.0",
|
|
4
4
|
"description": "Wire contracts shared by every Iveri backend and frontend. Zero runtime dependencies.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -52,6 +52,10 @@
|
|
|
52
52
|
"types": "./dist/api/clinic/index.d.ts",
|
|
53
53
|
"default": "./dist/api/clinic/index.js"
|
|
54
54
|
},
|
|
55
|
+
"./restaurant": {
|
|
56
|
+
"types": "./dist/api/restaurant/index.d.ts",
|
|
57
|
+
"default": "./dist/api/restaurant/index.js"
|
|
58
|
+
},
|
|
55
59
|
"./mobility": {
|
|
56
60
|
"types": "./dist/api/mobility/index.d.ts",
|
|
57
61
|
"default": "./dist/api/mobility/index.js"
|