@iveri/contracts 0.65.0 → 0.67.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 (28) hide show
  1. package/dist/api/hr/hr-time-off.type.d.ts +3 -1
  2. package/dist/api/restaurant/index.d.ts +11 -0
  3. package/dist/api/restaurant/index.js +11 -0
  4. package/dist/api/restaurant/restaurant-customer.type.d.ts +27 -0
  5. package/dist/api/restaurant/restaurant-customer.type.js +1 -0
  6. package/dist/api/restaurant/restaurant-delivery-state.enum.d.ts +9 -0
  7. package/dist/api/restaurant/restaurant-delivery-state.enum.js +10 -0
  8. package/dist/api/restaurant/restaurant-diner-order.type.d.ts +131 -0
  9. package/dist/api/restaurant/restaurant-diner-order.type.js +1 -0
  10. package/dist/api/restaurant/restaurant-order-payment-status.enum.d.ts +12 -0
  11. package/dist/api/restaurant/restaurant-order-payment-status.enum.js +13 -0
  12. package/dist/api/restaurant/restaurant-order.type.d.ts +11 -0
  13. package/dist/api/restaurant/restaurant-pay-with.enum.d.ts +5 -0
  14. package/dist/api/restaurant/restaurant-pay-with.enum.js +6 -0
  15. package/dist/api/restaurant/restaurant-promotion.type.d.ts +53 -0
  16. package/dist/api/restaurant/restaurant-promotion.type.js +1 -0
  17. package/dist/api/restaurant/restaurant-public.type.d.ts +2 -0
  18. package/dist/api/restaurant/restaurant-reservation-source.enum.d.ts +5 -0
  19. package/dist/api/restaurant/restaurant-reservation-source.enum.js +6 -0
  20. package/dist/api/restaurant/restaurant-reservation-status.enum.d.ts +7 -0
  21. package/dist/api/restaurant/restaurant-reservation-status.enum.js +8 -0
  22. package/dist/api/restaurant/restaurant-reservation.type.d.ts +78 -0
  23. package/dist/api/restaurant/restaurant-reservation.type.js +1 -0
  24. package/dist/api/restaurant/restaurant-review-status.enum.d.ts +6 -0
  25. package/dist/api/restaurant/restaurant-review-status.enum.js +7 -0
  26. package/dist/api/restaurant/restaurant-review.type.d.ts +41 -0
  27. package/dist/api/restaurant/restaurant-review.type.js +1 -0
  28. package/package.json +1 -1
@@ -144,4 +144,6 @@ export interface HrLeaveDaysRequest {
144
144
  endsAtNoon?: boolean;
145
145
  reason?: Nullable<string>;
146
146
  }
147
- export type UpdateHrLeaveTypeRequest = Partial<Omit<CreateHrLeaveTypeRequest, 'code'>>;
147
+ export interface UpdateHrLeaveTypeRequest extends Partial<Omit<CreateHrLeaveTypeRequest, 'code'>> {
148
+ status?: HrResourceStatus;
149
+ }
@@ -3,17 +3,28 @@ export * from './restaurant-bill-status.enum.js';
3
3
  export * from './restaurant-bill.type.js';
4
4
  export * from './restaurant-branch.type.js';
5
5
  export * from './restaurant-channel.enum.js';
6
+ export * from './restaurant-customer.type.js';
7
+ export * from './restaurant-delivery-state.enum.js';
6
8
  export * from './restaurant-dietary-tag.enum.js';
9
+ export * from './restaurant-diner-order.type.js';
7
10
  export * from './restaurant-floor.type.js';
8
11
  export * from './restaurant-kitchen.type.js';
9
12
  export * from './restaurant-line-status.enum.js';
10
13
  export * from './restaurant-menu.type.js';
14
+ export * from './restaurant-order-payment-status.enum.js';
11
15
  export * from './restaurant-order-source.enum.js';
12
16
  export * from './restaurant-order-status.enum.js';
13
17
  export * from './restaurant-order.type.js';
18
+ export * from './restaurant-pay-with.enum.js';
14
19
  export * from './restaurant-payment-method.enum.js';
15
20
  export * from './restaurant-profile.type.js';
21
+ export * from './restaurant-promotion.type.js';
16
22
  export * from './restaurant-public.type.js';
23
+ export * from './restaurant-reservation-source.enum.js';
24
+ export * from './restaurant-reservation-status.enum.js';
25
+ export * from './restaurant-reservation.type.js';
17
26
  export * from './restaurant-resource-status.enum.js';
27
+ export * from './restaurant-review-status.enum.js';
28
+ export * from './restaurant-review.type.js';
18
29
  export * from './restaurant-service-request.type.js';
19
30
  export * from './restaurant-table.type.js';
@@ -3,17 +3,28 @@ export * from './restaurant-bill-status.enum.js';
3
3
  export * from './restaurant-bill.type.js';
4
4
  export * from './restaurant-branch.type.js';
5
5
  export * from './restaurant-channel.enum.js';
6
+ export * from './restaurant-customer.type.js';
7
+ export * from './restaurant-delivery-state.enum.js';
6
8
  export * from './restaurant-dietary-tag.enum.js';
9
+ export * from './restaurant-diner-order.type.js';
7
10
  export * from './restaurant-floor.type.js';
8
11
  export * from './restaurant-kitchen.type.js';
9
12
  export * from './restaurant-line-status.enum.js';
10
13
  export * from './restaurant-menu.type.js';
14
+ export * from './restaurant-order-payment-status.enum.js';
11
15
  export * from './restaurant-order-source.enum.js';
12
16
  export * from './restaurant-order-status.enum.js';
13
17
  export * from './restaurant-order.type.js';
18
+ export * from './restaurant-pay-with.enum.js';
14
19
  export * from './restaurant-payment-method.enum.js';
15
20
  export * from './restaurant-profile.type.js';
21
+ export * from './restaurant-promotion.type.js';
16
22
  export * from './restaurant-public.type.js';
23
+ export * from './restaurant-reservation-source.enum.js';
24
+ export * from './restaurant-reservation-status.enum.js';
25
+ export * from './restaurant-reservation.type.js';
17
26
  export * from './restaurant-resource-status.enum.js';
27
+ export * from './restaurant-review-status.enum.js';
28
+ export * from './restaurant-review.type.js';
18
29
  export * from './restaurant-service-request.type.js';
19
30
  export * from './restaurant-table.type.js';
@@ -0,0 +1,27 @@
1
+ import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
+ import type { UUID } from '../../type/uuid.type.js';
3
+ /** Somebody who has ordered or booked. Staff book people who will never make an account. */
4
+ export interface RestaurantCustomer {
5
+ id: UUID;
6
+ userId: UUID | null;
7
+ firstName: string;
8
+ lastName: string;
9
+ phone: string;
10
+ email: string | null;
11
+ localeCode: string | null;
12
+ /** Null means nothing is sent to `email`, since anybody can register with an address not theirs. */
13
+ emailConfirmedAt: IsoDateTime | null;
14
+ orderCount: number;
15
+ reservationCount: number;
16
+ createdAt: IsoDateTime;
17
+ }
18
+ export interface SaveMyRestaurantCustomerRequest {
19
+ firstName: string;
20
+ lastName: string;
21
+ phone: string;
22
+ email?: string | null;
23
+ localeCode?: string | null;
24
+ }
25
+ export interface ConfirmRestaurantCustomerEmailRequest {
26
+ token: string;
27
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ /** Where a courier has got to. Null on an order means nobody has been asked. */
2
+ export declare enum RestaurantDeliveryState {
3
+ SEARCHING = "searching",
4
+ COURIER_ASSIGNED = "courier-assigned",
5
+ PICKED_UP = "picked-up",
6
+ IN_TRANSIT = "in-transit",
7
+ DELIVERED = "delivered",
8
+ UNDELIVERABLE = "undeliverable"
9
+ }
@@ -0,0 +1,10 @@
1
+ /** Where a courier has got to. Null on an order means nobody has been asked. */
2
+ export var RestaurantDeliveryState;
3
+ (function (RestaurantDeliveryState) {
4
+ RestaurantDeliveryState["SEARCHING"] = "searching";
5
+ RestaurantDeliveryState["COURIER_ASSIGNED"] = "courier-assigned";
6
+ RestaurantDeliveryState["PICKED_UP"] = "picked-up";
7
+ RestaurantDeliveryState["IN_TRANSIT"] = "in-transit";
8
+ RestaurantDeliveryState["DELIVERED"] = "delivered";
9
+ RestaurantDeliveryState["UNDELIVERABLE"] = "undeliverable";
10
+ })(RestaurantDeliveryState || (RestaurantDeliveryState = {}));
@@ -0,0 +1,131 @@
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 { RestaurantDeliveryState } from './restaurant-delivery-state.enum.js';
6
+ import type { RestaurantOrderPaymentStatus } from './restaurant-order-payment-status.enum.js';
7
+ import type { RestaurantOrderStatus } from './restaurant-order-status.enum.js';
8
+ import type { RestaurantOrderLineRequest } from './restaurant-order.type.js';
9
+ import type { RestaurantPayWith } from './restaurant-pay-with.enum.js';
10
+ /** A pin on the map and the words a driver reads. There is no address search, so the pin is what counts. */
11
+ export interface RestaurantDeliveryAddress {
12
+ address: string;
13
+ details: string | null;
14
+ latitude: number;
15
+ longitude: number;
16
+ }
17
+ export interface RestaurantDeliveryAddressRequest {
18
+ address: string;
19
+ details?: string | null;
20
+ latitude: number;
21
+ longitude: number;
22
+ }
23
+ export interface PlaceRestaurantOrderRequest {
24
+ branchId: UUID;
25
+ /** Takeaway or delivery. A table's order goes through its code. */
26
+ channel: RestaurantChannel;
27
+ lines: RestaurantOrderLineRequest[];
28
+ note?: string | null;
29
+ /** When it should be ready. Null or absent means as soon as it can be. */
30
+ requestedFor?: IsoDateTime | null;
31
+ payWith: RestaurantPayWith;
32
+ customerName: string;
33
+ customerPhone: string;
34
+ /** Required for delivery, refused otherwise. */
35
+ deliveryAddress?: RestaurantDeliveryAddressRequest | null;
36
+ }
37
+ /** Everything the server would charge for a basket, before anybody commits to it. */
38
+ export interface RestaurantOrderQuoteRequest {
39
+ branchId: UUID;
40
+ channel: RestaurantChannel;
41
+ lines: RestaurantOrderLineRequest[];
42
+ deliveryAddress?: RestaurantDeliveryAddressRequest | null;
43
+ }
44
+ export interface RestaurantOrderQuote {
45
+ subtotalMinor: number;
46
+ discountMinor: number;
47
+ deliveryFeeMinor: number;
48
+ totalMinor: number;
49
+ currency: string;
50
+ /** Short of the branch's minimum for delivery. Null when it is met or does not apply. */
51
+ shortOfMinimumMinor: number | null;
52
+ }
53
+ export interface RestaurantDinerOrderLineOption {
54
+ optionId: UUID;
55
+ groupName: LocalizedText;
56
+ name: LocalizedText;
57
+ }
58
+ export interface RestaurantDinerOrderLine {
59
+ itemId: UUID;
60
+ name: LocalizedText;
61
+ quantity: number;
62
+ options: RestaurantDinerOrderLineOption[];
63
+ note: string | null;
64
+ /** What was charged, after any promotion. */
65
+ lineTotalMinor: number;
66
+ discountMinor: number;
67
+ }
68
+ /** An order as the person who placed it sees it. It names no staff, table, station or provider. */
69
+ export interface RestaurantDinerOrder {
70
+ trackingToken: string;
71
+ number: number;
72
+ branchId: UUID;
73
+ branchName: LocalizedText;
74
+ branchAddress: LocalizedText;
75
+ branchPhone: string | null;
76
+ channel: RestaurantChannel;
77
+ status: RestaurantOrderStatus;
78
+ paymentStatus: RestaurantOrderPaymentStatus;
79
+ deliveryState: RestaurantDeliveryState | null;
80
+ deliveryAddress: RestaurantDeliveryAddress | null;
81
+ customerName: string | null;
82
+ note: string | null;
83
+ requestedFor: IsoDateTime | null;
84
+ /** When it is expected to be ready, for the diner to plan around. */
85
+ expectedAt: IsoDateTime | null;
86
+ subtotalMinor: number;
87
+ discountMinor: number;
88
+ deliveryFeeMinor: number;
89
+ totalMinor: number;
90
+ currency: string;
91
+ lines: RestaurantDinerOrderLine[];
92
+ placedAt: IsoDateTime;
93
+ readyAt: IsoDateTime | null;
94
+ completedAt: IsoDateTime | null;
95
+ cancelledAt: IsoDateTime | null;
96
+ /** Whether a checkout can still be opened for it. */
97
+ canPay: boolean;
98
+ /** Whether the person who placed it can still say how it was. */
99
+ canReview: boolean;
100
+ }
101
+ export interface RestaurantOrderPlaced {
102
+ order: RestaurantDinerOrder;
103
+ /** Null when paying at the restaurant, or when the provider could not be reached yet. */
104
+ checkoutUrl: string | null;
105
+ }
106
+ export interface RestaurantOrderCheckout {
107
+ checkoutUrl: string;
108
+ }
109
+ export interface RestaurantDinerOrderPage {
110
+ items: RestaurantDinerOrder[];
111
+ total: number;
112
+ }
113
+ /** When an order can be ready. Every time offered falls in the branch's opening hours. */
114
+ export interface PublicRestaurantOrderTimes {
115
+ channel: RestaurantChannel;
116
+ isAccepting: boolean;
117
+ isOpenNow: boolean;
118
+ canOrderNow: boolean;
119
+ /** The soonest it could be ready if ordered now. */
120
+ earliestAt: IsoDateTime | null;
121
+ times: IsoDateTime[];
122
+ }
123
+ export interface PublicRestaurantDeliveryQuote {
124
+ isDeliverable: boolean;
125
+ distanceMeters: number;
126
+ feeMinor: number;
127
+ minimumOrderMinor: number;
128
+ freeOverMinor: number | null;
129
+ prepMinutes: number;
130
+ currency: string;
131
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Whether money is owed to a provider for this order. A fact of its own, beside the order's status,
3
+ * because cancelled and paid has to be expressible.
4
+ */
5
+ export declare enum RestaurantOrderPaymentStatus {
6
+ /** Eaten in, or paid at the restaurant. Nothing is waiting on a provider. */
7
+ NOT_REQUIRED = "not-required",
8
+ PENDING = "pending",
9
+ PAID = "paid",
10
+ FAILED = "failed",
11
+ EXPIRED = "expired"
12
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Whether money is owed to a provider for this order. A fact of its own, beside the order's status,
3
+ * because cancelled and paid has to be expressible.
4
+ */
5
+ export var RestaurantOrderPaymentStatus;
6
+ (function (RestaurantOrderPaymentStatus) {
7
+ /** Eaten in, or paid at the restaurant. Nothing is waiting on a provider. */
8
+ RestaurantOrderPaymentStatus["NOT_REQUIRED"] = "not-required";
9
+ RestaurantOrderPaymentStatus["PENDING"] = "pending";
10
+ RestaurantOrderPaymentStatus["PAID"] = "paid";
11
+ RestaurantOrderPaymentStatus["FAILED"] = "failed";
12
+ RestaurantOrderPaymentStatus["EXPIRED"] = "expired";
13
+ })(RestaurantOrderPaymentStatus || (RestaurantOrderPaymentStatus = {}));
@@ -2,7 +2,10 @@ import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
2
  import type { UUID } from '../../type/uuid.type.js';
3
3
  import type { LocalizedText } from '../clinic/localized-text.type.js';
4
4
  import type { RestaurantChannel } from './restaurant-channel.enum.js';
5
+ import type { RestaurantDeliveryState } from './restaurant-delivery-state.enum.js';
6
+ import type { RestaurantDeliveryAddress } from './restaurant-diner-order.type.js';
5
7
  import type { RestaurantLineStatus } from './restaurant-line-status.enum.js';
8
+ import type { RestaurantOrderPaymentStatus } from './restaurant-order-payment-status.enum.js';
6
9
  import type { RestaurantOrderSource } from './restaurant-order-source.enum.js';
7
10
  import type { RestaurantOrderStatus } from './restaurant-order-status.enum.js';
8
11
  /** What was chosen on a line, as it was named and priced when ordered. */
@@ -19,7 +22,9 @@ export interface RestaurantOrderLine {
19
22
  name: LocalizedText;
20
23
  quantity: number;
21
24
  unitPriceMinor: number;
25
+ /** After any promotion, so every sum built on it is already right. */
22
26
  lineTotalMinor: number;
27
+ discountMinor: number;
23
28
  options: RestaurantOrderLineOption[];
24
29
  note: string | null;
25
30
  status: RestaurantLineStatus;
@@ -39,12 +44,18 @@ export interface RestaurantOrder {
39
44
  channel: RestaurantChannel;
40
45
  source: RestaurantOrderSource;
41
46
  status: RestaurantOrderStatus;
47
+ paymentStatus: RestaurantOrderPaymentStatus;
48
+ deliveryState: RestaurantDeliveryState | null;
49
+ deliveryAddress: RestaurantDeliveryAddress | null;
50
+ customerId: UUID | null;
42
51
  customerName: string | null;
43
52
  customerPhone: string | null;
44
53
  note: string | null;
45
54
  /** When it should be ready. Null means as soon as it can be. */
46
55
  requestedFor: IsoDateTime | null;
47
56
  subtotalMinor: number;
57
+ discountMinor: number;
58
+ deliveryFeeMinor: number;
48
59
  currency: string;
49
60
  lines: RestaurantOrderLine[];
50
61
  placedAt: IsoDateTime;
@@ -0,0 +1,5 @@
1
+ /** How a diner means to pay when they place an order from outside the restaurant. */
2
+ export declare enum RestaurantPayWith {
3
+ ONLINE = "online",
4
+ AT_RESTAURANT = "at-restaurant"
5
+ }
@@ -0,0 +1,6 @@
1
+ /** How a diner means to pay when they place an order from outside the restaurant. */
2
+ export var RestaurantPayWith;
3
+ (function (RestaurantPayWith) {
4
+ RestaurantPayWith["ONLINE"] = "online";
5
+ RestaurantPayWith["AT_RESTAURANT"] = "at-restaurant";
6
+ })(RestaurantPayWith || (RestaurantPayWith = {}));
@@ -0,0 +1,53 @@
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 { RestaurantResourceStatus } from './restaurant-resource-status.enum.js';
6
+ /** Money off by the day and the hour, which is what a happy hour is. */
7
+ export interface RestaurantPromotion {
8
+ id: UUID;
9
+ name: LocalizedText;
10
+ description: LocalizedText | null;
11
+ /** 2000 is 20% off. */
12
+ percentBasisPoints: number;
13
+ channels: RestaurantChannel[];
14
+ /** Empty means every section of the menu. */
15
+ categoryIds: UUID[];
16
+ /** Empty means every branch. */
17
+ branchIds: UUID[];
18
+ /** Sunday is 0. Empty means every day. */
19
+ daysOfWeek: number[];
20
+ /** Null on both means all day. A window closing before it opens runs past midnight. */
21
+ startsAtTime: string | null;
22
+ endsAtTime: string | null;
23
+ validFrom: string | null;
24
+ validUntil: string | null;
25
+ status: RestaurantResourceStatus;
26
+ createdAt: IsoDateTime;
27
+ updatedAt: IsoDateTime;
28
+ }
29
+ export interface SaveRestaurantPromotionRequest {
30
+ name: LocalizedText;
31
+ description?: LocalizedText | null;
32
+ percentBasisPoints: number;
33
+ channels: RestaurantChannel[];
34
+ categoryIds?: UUID[];
35
+ branchIds?: UUID[];
36
+ daysOfWeek?: number[];
37
+ startsAtTime?: string | null;
38
+ endsAtTime?: string | null;
39
+ validFrom?: string | null;
40
+ validUntil?: string | null;
41
+ status?: RestaurantResourceStatus;
42
+ }
43
+ export interface PublicRestaurantPromotion {
44
+ id: UUID;
45
+ name: LocalizedText;
46
+ description: LocalizedText | null;
47
+ percentBasisPoints: number;
48
+ channels: RestaurantChannel[];
49
+ daysOfWeek: number[];
50
+ startsAtTime: string | null;
51
+ endsAtTime: string | null;
52
+ validUntil: string | null;
53
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -62,6 +62,8 @@ export interface PublicRestaurantMenuItem {
62
62
  name: LocalizedText;
63
63
  description: LocalizedText | null;
64
64
  priceMinor: number;
65
+ /** What a promotion running now makes it. Null when none applies. */
66
+ discountedPriceMinor: number | null;
65
67
  imageUrl: string | null;
66
68
  thumbnailUrl: string | null;
67
69
  allergens: RestaurantAllergen[];
@@ -0,0 +1,5 @@
1
+ export declare enum RestaurantReservationSource {
2
+ ONLINE = "online",
3
+ STAFF = "staff",
4
+ WALK_IN = "walk-in"
5
+ }
@@ -0,0 +1,6 @@
1
+ export var RestaurantReservationSource;
2
+ (function (RestaurantReservationSource) {
3
+ RestaurantReservationSource["ONLINE"] = "online";
4
+ RestaurantReservationSource["STAFF"] = "staff";
5
+ RestaurantReservationSource["WALK_IN"] = "walk-in";
6
+ })(RestaurantReservationSource || (RestaurantReservationSource = {}));
@@ -0,0 +1,7 @@
1
+ export declare enum RestaurantReservationStatus {
2
+ BOOKED = "booked",
3
+ SEATED = "seated",
4
+ COMPLETED = "completed",
5
+ CANCELLED = "cancelled",
6
+ NO_SHOW = "no-show"
7
+ }
@@ -0,0 +1,8 @@
1
+ export var RestaurantReservationStatus;
2
+ (function (RestaurantReservationStatus) {
3
+ RestaurantReservationStatus["BOOKED"] = "booked";
4
+ RestaurantReservationStatus["SEATED"] = "seated";
5
+ RestaurantReservationStatus["COMPLETED"] = "completed";
6
+ RestaurantReservationStatus["CANCELLED"] = "cancelled";
7
+ RestaurantReservationStatus["NO_SHOW"] = "no-show";
8
+ })(RestaurantReservationStatus || (RestaurantReservationStatus = {}));
@@ -0,0 +1,78 @@
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 { RestaurantReservationSource } from './restaurant-reservation-source.enum.js';
5
+ import type { RestaurantReservationStatus } from './restaurant-reservation-status.enum.js';
6
+ export interface RestaurantReservationTable {
7
+ id: UUID;
8
+ label: string;
9
+ seats: number;
10
+ }
11
+ export interface RestaurantReservation {
12
+ id: UUID;
13
+ branchId: UUID;
14
+ status: RestaurantReservationStatus;
15
+ source: RestaurantReservationSource;
16
+ startsAt: IsoDateTime;
17
+ endsAt: IsoDateTime;
18
+ partySize: number;
19
+ customerId: UUID | null;
20
+ customerName: string;
21
+ customerPhone: string | null;
22
+ note: string | null;
23
+ tables: RestaurantReservationTable[];
24
+ seatedAt: IsoDateTime | null;
25
+ completedAt: IsoDateTime | null;
26
+ cancelledAt: IsoDateTime | null;
27
+ cancelReason: string | null;
28
+ createdAt: IsoDateTime;
29
+ version: number;
30
+ }
31
+ /** Staff taking a booking by phone, or sitting somebody who walked in. */
32
+ export interface CreateRestaurantReservationRequest {
33
+ branchId: UUID;
34
+ startsAt: IsoDateTime;
35
+ partySize: number;
36
+ customerName: string;
37
+ customerPhone?: string | null;
38
+ note?: string | null;
39
+ /** Left out, the smallest free table that fits is taken. Several are pushed together. */
40
+ tableIds?: UUID[];
41
+ isWalkIn?: boolean;
42
+ }
43
+ export interface UpdateRestaurantReservationRequest {
44
+ startsAt?: IsoDateTime;
45
+ partySize?: number;
46
+ customerName?: string;
47
+ customerPhone?: string | null;
48
+ note?: string | null;
49
+ tableIds?: UUID[];
50
+ }
51
+ export interface CancelRestaurantReservationRequest {
52
+ reason?: string | null;
53
+ }
54
+ export interface PublicRestaurantReservationSlots {
55
+ date: string;
56
+ partySize: number;
57
+ /** The largest party that can book online. A bigger one is told to call. */
58
+ maxPartySize: number;
59
+ slots: IsoDateTime[];
60
+ }
61
+ export interface BookMyRestaurantReservationRequest {
62
+ branchId: UUID;
63
+ startsAt: IsoDateTime;
64
+ partySize: number;
65
+ note?: string | null;
66
+ }
67
+ export interface MyRestaurantReservation {
68
+ id: UUID;
69
+ branchId: UUID;
70
+ branchName: LocalizedText;
71
+ branchAddress: LocalizedText;
72
+ status: RestaurantReservationStatus;
73
+ startsAt: IsoDateTime;
74
+ endsAt: IsoDateTime;
75
+ partySize: number;
76
+ note: string | null;
77
+ canCancel: boolean;
78
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ /** A review waits until somebody at the restaurant has read it. */
2
+ export declare enum RestaurantReviewStatus {
3
+ PENDING = "pending",
4
+ PUBLISHED = "published",
5
+ HIDDEN = "hidden"
6
+ }
@@ -0,0 +1,7 @@
1
+ /** A review waits until somebody at the restaurant has read it. */
2
+ export var RestaurantReviewStatus;
3
+ (function (RestaurantReviewStatus) {
4
+ RestaurantReviewStatus["PENDING"] = "pending";
5
+ RestaurantReviewStatus["PUBLISHED"] = "published";
6
+ RestaurantReviewStatus["HIDDEN"] = "hidden";
7
+ })(RestaurantReviewStatus || (RestaurantReviewStatus = {}));
@@ -0,0 +1,41 @@
1
+ import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
+ import type { UUID } from '../../type/uuid.type.js';
3
+ import type { RestaurantReviewStatus } from './restaurant-review-status.enum.js';
4
+ export interface RestaurantReview {
5
+ id: UUID;
6
+ orderId: UUID;
7
+ authorName: string;
8
+ rating: number;
9
+ comment: string | null;
10
+ status: RestaurantReviewStatus;
11
+ reply: string | null;
12
+ repliedAt: IsoDateTime | null;
13
+ createdAt: IsoDateTime;
14
+ }
15
+ export interface RestaurantReviewPage {
16
+ items: RestaurantReview[];
17
+ total: number;
18
+ }
19
+ /** Only somebody whose order was completed can write one. */
20
+ export interface SubmitRestaurantReviewRequest {
21
+ trackingToken: string;
22
+ rating: number;
23
+ comment?: string | null;
24
+ }
25
+ export interface ReplyRestaurantReviewRequest {
26
+ reply: string | null;
27
+ }
28
+ export interface PublicRestaurantReview {
29
+ id: UUID;
30
+ authorName: string;
31
+ rating: number;
32
+ comment: string | null;
33
+ reply: string | null;
34
+ createdAt: IsoDateTime;
35
+ }
36
+ export interface PublicRestaurantReviews {
37
+ /** Null until somebody has been published, never zero. */
38
+ averageRating: number | null;
39
+ count: number;
40
+ items: PublicRestaurantReview[];
41
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iveri/contracts",
3
- "version": "0.65.0",
3
+ "version": "0.67.0",
4
4
  "description": "Wire contracts shared by every Iveri backend and frontend. Zero runtime dependencies.",
5
5
  "license": "MIT",
6
6
  "repository": {