@novha/anlia-core-lib 0.1.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/cdk/bin/infrastructure.ts +18 -0
- package/cdk/bin/project-names.ts +7 -0
- package/cdk/lib/infrastructure.ts +37 -0
- package/cdk.json +70 -0
- package/dist/cdk/bin/infrastructure.d.ts +1 -0
- package/dist/cdk/bin/infrastructure.js +20 -0
- package/dist/cdk/bin/project-names.d.ts +6 -0
- package/dist/cdk/bin/project-names.js +4 -0
- package/dist/cdk/lib/infrastructure.d.ts +6 -0
- package/dist/cdk/lib/infrastructure.js +32 -0
- package/dist/src/enums/domain/DayOfWeek.d.ts +9 -0
- package/dist/src/enums/domain/DayOfWeek.js +13 -0
- package/dist/src/enums/domain/Delivery.d.ts +19 -0
- package/dist/src/enums/domain/Delivery.js +24 -0
- package/dist/src/enums/domain/Employee.d.ts +12 -0
- package/dist/src/enums/domain/Employee.js +16 -0
- package/dist/src/enums/domain/Ingredient.d.ts +31 -0
- package/dist/src/enums/domain/Ingredient.js +37 -0
- package/dist/src/enums/domain/Inventory.d.ts +29 -0
- package/dist/src/enums/domain/Inventory.js +36 -0
- package/dist/src/enums/domain/Kitchen.d.ts +49 -0
- package/dist/src/enums/domain/Kitchen.js +59 -0
- package/dist/src/enums/domain/Menu.d.ts +13 -0
- package/dist/src/enums/domain/Menu.js +18 -0
- package/dist/src/enums/domain/Payments.d.ts +21 -0
- package/dist/src/enums/domain/Payments.js +26 -0
- package/dist/src/enums/domain/Recipe.d.ts +14 -0
- package/dist/src/enums/domain/Recipe.js +19 -0
- package/dist/src/enums/domain/Reservation.d.ts +17 -0
- package/dist/src/enums/domain/Reservation.js +22 -0
- package/dist/src/enums/domain/Restaurant.d.ts +39 -0
- package/dist/src/enums/domain/Restaurant.js +45 -0
- package/dist/src/enums/domain/Table.d.ts +23 -0
- package/dist/src/enums/domain/Table.js +29 -0
- package/dist/src/enums/domain/Vendors.d.ts +29 -0
- package/dist/src/enums/domain/Vendors.js +35 -0
- package/dist/src/enums/index.d.ts +13 -0
- package/dist/src/enums/index.js +29 -0
- package/dist/src/eventBridge/EventBridgeModule.d.ts +2 -0
- package/dist/src/eventBridge/EventBridgeModule.js +26 -0
- package/dist/src/eventBridge/domain/EventBridgeOptions.d.ts +8 -0
- package/dist/src/eventBridge/domain/EventBridgeOptions.js +2 -0
- package/dist/src/eventBridge/ioc/index.d.ts +3 -0
- package/dist/src/eventBridge/ioc/index.js +6 -0
- package/dist/src/eventBridge/ioc.d.ts +3 -0
- package/dist/src/eventBridge/ioc.js +6 -0
- package/dist/src/eventBridge/service/EventBridgeService.d.ts +5 -0
- package/dist/src/eventBridge/service/EventBridgeService.js +2 -0
- package/dist/src/eventBridge/service/EventBridgeServiceImpl.d.ts +13 -0
- package/dist/src/eventBridge/service/EventBridgeServiceImpl.js +63 -0
- package/dist/src/events/domain/CustomerEvents.d.ts +54 -0
- package/dist/src/events/domain/CustomerEvents.js +2 -0
- package/dist/src/events/domain/DeliveryEvents.d.ts +61 -0
- package/dist/src/events/domain/DeliveryEvents.js +2 -0
- package/dist/src/events/domain/DomainEvent.d.ts +12 -0
- package/dist/src/events/domain/DomainEvent.js +2 -0
- package/dist/src/events/domain/DomainEventType.d.ts +119 -0
- package/dist/src/events/domain/DomainEventType.js +136 -0
- package/dist/src/events/domain/EmployeeEvents.d.ts +51 -0
- package/dist/src/events/domain/EmployeeEvents.js +2 -0
- package/dist/src/events/domain/InventoryEvents.d.ts +141 -0
- package/dist/src/events/domain/InventoryEvents.js +2 -0
- package/dist/src/events/domain/OrderEvents.d.ts +105 -0
- package/dist/src/events/domain/OrderEvents.js +2 -0
- package/dist/src/events/domain/PaymentEvents.d.ts +73 -0
- package/dist/src/events/domain/PaymentEvents.js +2 -0
- package/dist/src/events/domain/RecipeEvents.d.ts +45 -0
- package/dist/src/events/domain/RecipeEvents.js +2 -0
- package/dist/src/events/domain/ReservationEvents.d.ts +93 -0
- package/dist/src/events/domain/ReservationEvents.js +2 -0
- package/dist/src/events/domain/RestaurantEvents.d.ts +62 -0
- package/dist/src/events/domain/RestaurantEvents.js +2 -0
- package/dist/src/events/domain/TableEvents.d.ts +71 -0
- package/dist/src/events/domain/TableEvents.js +2 -0
- package/dist/src/events/domain/VendorEvents.d.ts +28 -0
- package/dist/src/events/domain/VendorEvents.js +2 -0
- package/dist/src/events/index.d.ts +13 -0
- package/dist/src/events/index.js +29 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.js +20 -0
- package/dist/src/interfaces/Address.d.ts +7 -0
- package/dist/src/interfaces/Address.js +2 -0
- package/dist/src/interfaces/Customer.d.ts +21 -0
- package/dist/src/interfaces/Customer.js +2 -0
- package/dist/src/interfaces/Delivery.d.ts +62 -0
- package/dist/src/interfaces/Delivery.js +2 -0
- package/dist/src/interfaces/Employee.d.ts +19 -0
- package/dist/src/interfaces/Employee.js +2 -0
- package/dist/src/interfaces/Ingredient.d.ts +42 -0
- package/dist/src/interfaces/Ingredient.js +2 -0
- package/dist/src/interfaces/Inventory.d.ts +26 -0
- package/dist/src/interfaces/Inventory.js +2 -0
- package/dist/src/interfaces/Kitchen.d.ts +72 -0
- package/dist/src/interfaces/Kitchen.js +2 -0
- package/dist/src/interfaces/Location.d.ts +14 -0
- package/dist/src/interfaces/Location.js +2 -0
- package/dist/src/interfaces/Menu.d.ts +72 -0
- package/dist/src/interfaces/Menu.js +2 -0
- package/dist/src/interfaces/Money.d.ts +5 -0
- package/dist/src/interfaces/Money.js +2 -0
- package/dist/src/interfaces/OpeningHours.d.ts +7 -0
- package/dist/src/interfaces/OpeningHours.js +2 -0
- package/dist/src/interfaces/Payment.d.ts +36 -0
- package/dist/src/interfaces/Payment.js +2 -0
- package/dist/src/interfaces/Recipe.d.ts +58 -0
- package/dist/src/interfaces/Recipe.js +2 -0
- package/dist/src/interfaces/Resevation.d.ts +25 -0
- package/dist/src/interfaces/Resevation.js +2 -0
- package/dist/src/interfaces/Restaurant.d.ts +24 -0
- package/dist/src/interfaces/Restaurant.js +2 -0
- package/dist/src/interfaces/Table.d.ts +54 -0
- package/dist/src/interfaces/Table.js +2 -0
- package/dist/src/interfaces/Vendor.d.ts +19 -0
- package/dist/src/interfaces/Vendor.js +2 -0
- package/dist/src/interfaces/domain/Address.d.ts +7 -0
- package/dist/src/interfaces/domain/Address.js +2 -0
- package/dist/src/interfaces/domain/Customer.d.ts +21 -0
- package/dist/src/interfaces/domain/Customer.js +2 -0
- package/dist/src/interfaces/domain/Delivery.d.ts +62 -0
- package/dist/src/interfaces/domain/Delivery.js +2 -0
- package/dist/src/interfaces/domain/Employee.d.ts +19 -0
- package/dist/src/interfaces/domain/Employee.js +2 -0
- package/dist/src/interfaces/domain/Ingredient.d.ts +42 -0
- package/dist/src/interfaces/domain/Ingredient.js +2 -0
- package/dist/src/interfaces/domain/Inventory.d.ts +26 -0
- package/dist/src/interfaces/domain/Inventory.js +2 -0
- package/dist/src/interfaces/domain/Kitchen.d.ts +72 -0
- package/dist/src/interfaces/domain/Kitchen.js +2 -0
- package/dist/src/interfaces/domain/Location.d.ts +14 -0
- package/dist/src/interfaces/domain/Location.js +2 -0
- package/dist/src/interfaces/domain/Menu.d.ts +72 -0
- package/dist/src/interfaces/domain/Menu.js +2 -0
- package/dist/src/interfaces/domain/Money.d.ts +5 -0
- package/dist/src/interfaces/domain/Money.js +2 -0
- package/dist/src/interfaces/domain/OpeningHours.d.ts +7 -0
- package/dist/src/interfaces/domain/OpeningHours.js +2 -0
- package/dist/src/interfaces/domain/Payment.d.ts +36 -0
- package/dist/src/interfaces/domain/Payment.js +2 -0
- package/dist/src/interfaces/domain/Recipe.d.ts +58 -0
- package/dist/src/interfaces/domain/Recipe.js +2 -0
- package/dist/src/interfaces/domain/Reservation.d.ts +25 -0
- package/dist/src/interfaces/domain/Reservation.js +2 -0
- package/dist/src/interfaces/domain/Restaurant.d.ts +24 -0
- package/dist/src/interfaces/domain/Restaurant.js +2 -0
- package/dist/src/interfaces/domain/Table.d.ts +54 -0
- package/dist/src/interfaces/domain/Table.js +2 -0
- package/dist/src/interfaces/domain/Vendor.d.ts +19 -0
- package/dist/src/interfaces/domain/Vendor.js +2 -0
- package/dist/src/interfaces/index.d.ts +17 -0
- package/dist/src/interfaces/index.js +33 -0
- package/dist/src/orders/OrderModule.d.ts +2 -0
- package/dist/src/orders/OrderModule.js +28 -0
- package/dist/src/orders/domain/Enums.d.ts +16 -0
- package/dist/src/orders/domain/Enums.js +21 -0
- package/dist/src/orders/domain/Order.d.ts +89 -0
- package/dist/src/orders/domain/Order.js +2 -0
- package/dist/src/orders/domain/OrderItem.d.ts +53 -0
- package/dist/src/orders/domain/OrderItem.js +2 -0
- package/dist/src/orders/domain/posDto/SquareOrder.d.ts +347 -0
- package/dist/src/orders/domain/posDto/SquareOrder.js +8 -0
- package/dist/src/orders/index.d.ts +7 -0
- package/dist/src/orders/index.js +25 -0
- package/dist/src/orders/ioc/index.d.ts +3 -0
- package/dist/src/orders/ioc/index.js +6 -0
- package/dist/src/orders/services/square/SquareOrderService.d.ts +22 -0
- package/dist/src/orders/services/square/SquareOrderService.js +4 -0
- package/dist/src/orders/services/square/SquareOrderServiceImpl.d.ts +32 -0
- package/dist/src/orders/services/square/SquareOrderServiceImpl.js +308 -0
- package/jest.config.js +8 -0
- package/package.json +43 -0
- package/src/enums/domain/DayOfWeek.ts +9 -0
- package/src/enums/domain/Delivery.ts +20 -0
- package/src/enums/domain/Employee.ts +12 -0
- package/src/enums/domain/Ingredient.ts +33 -0
- package/src/enums/domain/Inventory.ts +39 -0
- package/src/enums/domain/Kitchen.ts +89 -0
- package/src/enums/domain/Menu.ts +14 -0
- package/src/enums/domain/Payments.ts +41 -0
- package/src/enums/domain/Recipe.ts +15 -0
- package/src/enums/domain/Reservation.ts +18 -0
- package/src/enums/domain/Restaurant.ts +41 -0
- package/src/enums/domain/Table.ts +39 -0
- package/src/enums/domain/Vendors.ts +45 -0
- package/src/enums/index.ts +13 -0
- package/src/eventBridge/EventBridgeModule.ts +14 -0
- package/src/eventBridge/domain/EventBridgeOptions.ts +8 -0
- package/src/eventBridge/ioc/index.ts +3 -0
- package/src/eventBridge/ioc.ts +3 -0
- package/src/eventBridge/service/EventBridgeService.ts +8 -0
- package/src/eventBridge/service/EventBridgeServiceImpl.ts +67 -0
- package/src/events/domain/CustomerEvents.ts +79 -0
- package/src/events/domain/DeliveryEvents.ts +82 -0
- package/src/events/domain/DomainEvent.ts +17 -0
- package/src/events/domain/DomainEventType.ts +143 -0
- package/src/events/domain/EmployeeEvents.ts +74 -0
- package/src/events/domain/InventoryEvents.ts +184 -0
- package/src/events/domain/OrderEvents.ts +142 -0
- package/src/events/domain/PaymentEvents.ts +92 -0
- package/src/events/domain/RecipeEvents.ts +64 -0
- package/src/events/domain/ReservationEvents.ts +133 -0
- package/src/events/domain/RestaurantEvents.ts +89 -0
- package/src/events/domain/TableEvents.ts +102 -0
- package/src/events/domain/VendorEvents.ts +42 -0
- package/src/events/index.ts +13 -0
- package/src/index.ts +4 -0
- package/src/interfaces/domain/Address.ts +7 -0
- package/src/interfaces/domain/Customer.ts +33 -0
- package/src/interfaces/domain/Delivery.ts +96 -0
- package/src/interfaces/domain/Employee.ts +29 -0
- package/src/interfaces/domain/Ingredient.ts +68 -0
- package/src/interfaces/domain/Inventory.ts +52 -0
- package/src/interfaces/domain/Kitchen.ts +128 -0
- package/src/interfaces/domain/Location.ts +20 -0
- package/src/interfaces/domain/Menu.ts +121 -0
- package/src/interfaces/domain/Money.ts +6 -0
- package/src/interfaces/domain/OpeningHours.ts +11 -0
- package/src/interfaces/domain/Payment.ts +45 -0
- package/src/interfaces/domain/Recipe.ts +91 -0
- package/src/interfaces/domain/Reservation.ts +45 -0
- package/src/interfaces/domain/Restaurant.ts +45 -0
- package/src/interfaces/domain/Table.ts +69 -0
- package/src/interfaces/domain/Vendor.ts +35 -0
- package/src/interfaces/index.ts +17 -0
- package/src/orders/OrderModule.ts +17 -0
- package/src/orders/domain/Enums.ts +17 -0
- package/src/orders/domain/Order.ts +109 -0
- package/src/orders/domain/OrderItem.ts +68 -0
- package/src/orders/domain/posDto/SquareOrder.ts +346 -0
- package/src/orders/index.ts +7 -0
- package/src/orders/ioc/index.ts +3 -0
- package/src/orders/services/square/SquareOrderService.ts +27 -0
- package/src/orders/services/square/SquareOrderServiceImpl.ts +330 -0
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { KitchenItemStatus, KitchenPriority, KitchenStationStatus, KitchenStationType, KitchenStatus, KitchenTicketStatus } from "../enums/domain/Kitchen";
|
|
2
|
+
export interface KitchenStation {
|
|
3
|
+
id: string;
|
|
4
|
+
kitchenId: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: KitchenStationType;
|
|
7
|
+
status: KitchenStationStatus;
|
|
8
|
+
createdAt: Date;
|
|
9
|
+
}
|
|
10
|
+
export interface Kitchen {
|
|
11
|
+
id: string;
|
|
12
|
+
restaurantId: string;
|
|
13
|
+
name: string;
|
|
14
|
+
status: KitchenStatus;
|
|
15
|
+
stations: KitchenStation[];
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
updatedAt: Date;
|
|
18
|
+
}
|
|
19
|
+
export interface KitchenTicket {
|
|
20
|
+
id: string;
|
|
21
|
+
restaurantId: string;
|
|
22
|
+
orderId: string;
|
|
23
|
+
stationId?: string;
|
|
24
|
+
items: KitchenTicketItem[];
|
|
25
|
+
status: KitchenTicketStatus;
|
|
26
|
+
priority: KitchenPriority;
|
|
27
|
+
createdAt: Date;
|
|
28
|
+
startedAt?: Date;
|
|
29
|
+
completedAt?: Date;
|
|
30
|
+
}
|
|
31
|
+
export interface KitchenTicketItem {
|
|
32
|
+
id: string;
|
|
33
|
+
/**
|
|
34
|
+
* Parent kitchen ticket
|
|
35
|
+
*/
|
|
36
|
+
kitchenTicketId: string;
|
|
37
|
+
/**
|
|
38
|
+
* Original order item reference
|
|
39
|
+
*/
|
|
40
|
+
orderItemId: string;
|
|
41
|
+
/**
|
|
42
|
+
* Menu item being prepared
|
|
43
|
+
*/
|
|
44
|
+
menuItemId: string;
|
|
45
|
+
/**
|
|
46
|
+
* Snapshot of item name at preparation time
|
|
47
|
+
* (important if menu changes later)
|
|
48
|
+
*/
|
|
49
|
+
menuItemName: string;
|
|
50
|
+
/**
|
|
51
|
+
* Number of items to prepare
|
|
52
|
+
*/
|
|
53
|
+
quantity: number;
|
|
54
|
+
/**
|
|
55
|
+
* Kitchen preparation status
|
|
56
|
+
*/
|
|
57
|
+
status: KitchenItemStatus;
|
|
58
|
+
/**
|
|
59
|
+
* Preparation instructions
|
|
60
|
+
*/
|
|
61
|
+
notes?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Which kitchen station handles it
|
|
64
|
+
*/
|
|
65
|
+
stationId?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Timing information
|
|
68
|
+
*/
|
|
69
|
+
startedAt?: Date;
|
|
70
|
+
completedAt?: Date;
|
|
71
|
+
createdAt: Date;
|
|
72
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ILocation {
|
|
2
|
+
id?: string;
|
|
3
|
+
name?: string;
|
|
4
|
+
addressLine1: string;
|
|
5
|
+
addressLine2?: string;
|
|
6
|
+
city: string;
|
|
7
|
+
stateOrProvince: string;
|
|
8
|
+
postalCode: string;
|
|
9
|
+
country: string;
|
|
10
|
+
latitude?: number;
|
|
11
|
+
longitude?: number;
|
|
12
|
+
timezone?: string;
|
|
13
|
+
instructions?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { MenuItemStatus, MenuStatus } from "../enums/domain/Menu";
|
|
2
|
+
import { Money } from "./Money";
|
|
3
|
+
export interface IMenuItemModifierOption {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
/** Additional cost on top of the item's base price. */
|
|
7
|
+
additionalPrice?: Money;
|
|
8
|
+
isDefault?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface IMenuItemModifier {
|
|
11
|
+
id: string;
|
|
12
|
+
/** Display name of the modifier group (e.g. "Choose a size"). */
|
|
13
|
+
name: string;
|
|
14
|
+
required: boolean;
|
|
15
|
+
/** Minimum number of selections. */
|
|
16
|
+
minSelections: number;
|
|
17
|
+
/** Maximum number of selections (undefined = unlimited). */
|
|
18
|
+
maxSelections?: number;
|
|
19
|
+
options: IMenuItemModifierOption[];
|
|
20
|
+
}
|
|
21
|
+
export interface IMenuCategory {
|
|
22
|
+
id: string;
|
|
23
|
+
menuId: string;
|
|
24
|
+
name: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
/** Display order among sibling categories. */
|
|
27
|
+
sortOrder: number;
|
|
28
|
+
imageUrl?: string;
|
|
29
|
+
isActive: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface IMenuItem {
|
|
32
|
+
id: string;
|
|
33
|
+
restaurantId: string;
|
|
34
|
+
menuId: string;
|
|
35
|
+
categoryId: string;
|
|
36
|
+
name: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
price: Money;
|
|
39
|
+
status: MenuItemStatus;
|
|
40
|
+
/** Estimated kitchen preparation time in minutes. */
|
|
41
|
+
preparationTimeMinutes?: number;
|
|
42
|
+
/** Link to the recipe or production spec. */
|
|
43
|
+
recipeId?: string;
|
|
44
|
+
allergens?: string[];
|
|
45
|
+
modifiers?: IMenuItemModifier[];
|
|
46
|
+
imageUrl?: string;
|
|
47
|
+
/** Display order within its category. */
|
|
48
|
+
sortOrder: number;
|
|
49
|
+
isAvailable: boolean;
|
|
50
|
+
/** Calorie count for nutritional display. */
|
|
51
|
+
calories?: number;
|
|
52
|
+
tags?: string[];
|
|
53
|
+
createdAt: Date;
|
|
54
|
+
updatedAt: Date;
|
|
55
|
+
}
|
|
56
|
+
export interface IMenu {
|
|
57
|
+
id: string;
|
|
58
|
+
restaurantId: string;
|
|
59
|
+
/** Optional location scope — null means the menu applies to all locations. */
|
|
60
|
+
locationId?: string;
|
|
61
|
+
name: string;
|
|
62
|
+
description?: string;
|
|
63
|
+
status: MenuStatus;
|
|
64
|
+
categories: IMenuCategory[];
|
|
65
|
+
items: IMenuItem[];
|
|
66
|
+
/** ISO 8601 date-time when the menu becomes effective. */
|
|
67
|
+
validFrom?: Date;
|
|
68
|
+
/** ISO 8601 date-time when the menu expires. */
|
|
69
|
+
validUntil?: Date;
|
|
70
|
+
createdAt: Date;
|
|
71
|
+
updatedAt: Date;
|
|
72
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { PaymentMethod, PaymentStatus } from "../enums/domain/Payments";
|
|
2
|
+
import { Money } from "./Money";
|
|
3
|
+
export interface IPayment {
|
|
4
|
+
/**
|
|
5
|
+
* Internal payment identifier.
|
|
6
|
+
*/
|
|
7
|
+
id: string;
|
|
8
|
+
/**
|
|
9
|
+
* Vendor payment identifier.
|
|
10
|
+
*/
|
|
11
|
+
externalId?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Payment method.
|
|
14
|
+
*/
|
|
15
|
+
method: PaymentMethod;
|
|
16
|
+
/**
|
|
17
|
+
* Payment amount.
|
|
18
|
+
*/
|
|
19
|
+
amount: Money;
|
|
20
|
+
/**
|
|
21
|
+
* Payment status.
|
|
22
|
+
*/
|
|
23
|
+
status: PaymentStatus;
|
|
24
|
+
/**
|
|
25
|
+
* Authorization code.
|
|
26
|
+
*/
|
|
27
|
+
authorizationCode?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Transaction reference.
|
|
30
|
+
*/
|
|
31
|
+
reference?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Paid timestamp.
|
|
34
|
+
*/
|
|
35
|
+
paidAt: Date;
|
|
36
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { InventoryUnit } from "../enums/domain/Inventory";
|
|
2
|
+
import { AllergenType, DietaryFlag } from "../enums/domain/Ingredient";
|
|
3
|
+
import { INutritionalInfo } from "./Ingredient";
|
|
4
|
+
import { RecipeStatus, RecipeYieldUnit } from "../enums/domain/Recipe";
|
|
5
|
+
export interface IRecipeIngredient {
|
|
6
|
+
ingredientId: string;
|
|
7
|
+
/** Display name snapshot (denormalised for readability). */
|
|
8
|
+
name: string;
|
|
9
|
+
quantity: number;
|
|
10
|
+
unit: InventoryUnit;
|
|
11
|
+
/** If true this ingredient can be omitted without breaking the recipe. */
|
|
12
|
+
optional: boolean;
|
|
13
|
+
notes?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface IRecipeStep {
|
|
16
|
+
/** 1-based step number. */
|
|
17
|
+
stepNumber: number;
|
|
18
|
+
instruction: string;
|
|
19
|
+
/** Estimated time to complete this step in minutes. */
|
|
20
|
+
durationMinutes?: number;
|
|
21
|
+
/** Equipment required for this step (e.g. "Stand mixer", "Salamander"). */
|
|
22
|
+
equipment?: string[];
|
|
23
|
+
imageUrl?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface IRecipe {
|
|
26
|
+
id: string;
|
|
27
|
+
restaurantId: string;
|
|
28
|
+
/** Display name of the recipe. */
|
|
29
|
+
name: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
status: RecipeStatus;
|
|
32
|
+
/** ID of the menu item this recipe produces, if applicable. */
|
|
33
|
+
menuItemId?: string;
|
|
34
|
+
ingredients: IRecipeIngredient[];
|
|
35
|
+
steps: IRecipeStep[];
|
|
36
|
+
/** Number of portions (or other yield units) this recipe produces. */
|
|
37
|
+
yieldQuantity: number;
|
|
38
|
+
yieldUnit: RecipeYieldUnit;
|
|
39
|
+
/** Total preparation time in minutes (before cooking). */
|
|
40
|
+
prepTimeMinutes?: number;
|
|
41
|
+
/** Total cooking/baking time in minutes. */
|
|
42
|
+
cookTimeMinutes?: number;
|
|
43
|
+
allergens?: AllergenType[];
|
|
44
|
+
dietaryFlags?: DietaryFlag[];
|
|
45
|
+
/** Aggregated nutritional info for one yield unit of this recipe. */
|
|
46
|
+
nutritionalInfo?: INutritionalInfo;
|
|
47
|
+
/** Internal cost to produce one yield unit, calculated from ingredients. */
|
|
48
|
+
costPerYield?: number;
|
|
49
|
+
/** URL to a reference photo or instructional video. */
|
|
50
|
+
imageUrl?: string;
|
|
51
|
+
/** Free-form chef notes or plating instructions. */
|
|
52
|
+
notes?: string;
|
|
53
|
+
/** Version counter — increment when the recipe changes. */
|
|
54
|
+
version: number;
|
|
55
|
+
createdBy?: string;
|
|
56
|
+
createdAt: Date;
|
|
57
|
+
updatedAt: Date;
|
|
58
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReservationSource, ReservationStatus } from "../enums/domain/Reservation";
|
|
2
|
+
export interface IReservation {
|
|
3
|
+
id: string;
|
|
4
|
+
restaurantId: string;
|
|
5
|
+
customerId: string;
|
|
6
|
+
reservationDate: Date;
|
|
7
|
+
startTime: string;
|
|
8
|
+
endTime: string;
|
|
9
|
+
partySize: number;
|
|
10
|
+
status: ReservationStatus;
|
|
11
|
+
tableIds: string[];
|
|
12
|
+
specialRequests?: string;
|
|
13
|
+
customerName: string;
|
|
14
|
+
customerPhone?: string;
|
|
15
|
+
customerEmail?: string;
|
|
16
|
+
source: ReservationSource;
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
updatedAt: Date;
|
|
19
|
+
cancelledAt?: Date;
|
|
20
|
+
confirmedAt?: Date;
|
|
21
|
+
checkedInAt?: Date;
|
|
22
|
+
completedAt?: Date;
|
|
23
|
+
createdBy?: string;
|
|
24
|
+
assignedEmployeeId?: string;
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CuisineType, RestaurantStatus, RestaurantType } from "../enums/domain/Restaurant";
|
|
2
|
+
import { IAddress } from "./Address";
|
|
3
|
+
import { OperatingHours } from "./OpeningHours";
|
|
4
|
+
export interface IRestaurant {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
legalName?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
email?: string;
|
|
10
|
+
phone?: string;
|
|
11
|
+
website?: string;
|
|
12
|
+
address: IAddress;
|
|
13
|
+
businessType: RestaurantType;
|
|
14
|
+
cuisineTypes: CuisineType[];
|
|
15
|
+
operatingHours: OperatingHours[];
|
|
16
|
+
timezone: string;
|
|
17
|
+
currency: string;
|
|
18
|
+
locale: string;
|
|
19
|
+
seatingCapacity?: number;
|
|
20
|
+
status: RestaurantStatus;
|
|
21
|
+
logoUrl?: string;
|
|
22
|
+
createdAt: Date;
|
|
23
|
+
updatedAt: Date;
|
|
24
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { TableArea, TableShape, TableStatus } from "../enums/domain/Table";
|
|
2
|
+
export interface ITablePosition {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
rotation?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface ITable {
|
|
8
|
+
id: string;
|
|
9
|
+
restaurantId: string;
|
|
10
|
+
locationId?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Human-readable table number or identifier.
|
|
13
|
+
* Examples: "1", "12", "A5", "Patio-3"
|
|
14
|
+
*/
|
|
15
|
+
number: string;
|
|
16
|
+
/**
|
|
17
|
+
* Optional display name.
|
|
18
|
+
*/
|
|
19
|
+
name?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Number of guests this table can comfortably seat.
|
|
22
|
+
*/
|
|
23
|
+
capacity: number;
|
|
24
|
+
/**
|
|
25
|
+
* Physical area of the restaurant.
|
|
26
|
+
*/
|
|
27
|
+
area?: TableArea;
|
|
28
|
+
/**
|
|
29
|
+
* Shape of the table.
|
|
30
|
+
*/
|
|
31
|
+
shape?: TableShape;
|
|
32
|
+
/**
|
|
33
|
+
* Current operational status.
|
|
34
|
+
*/
|
|
35
|
+
status: TableStatus;
|
|
36
|
+
/**
|
|
37
|
+
* Can this table be combined with others?
|
|
38
|
+
*/
|
|
39
|
+
combinable: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* IDs of tables that may be combined with this one.
|
|
42
|
+
*/
|
|
43
|
+
combinableTableIds?: string[];
|
|
44
|
+
/**
|
|
45
|
+
* Optional floor plan coordinates.
|
|
46
|
+
*/
|
|
47
|
+
position?: ITablePosition;
|
|
48
|
+
/**
|
|
49
|
+
* Notes visible to staff.
|
|
50
|
+
*/
|
|
51
|
+
notes?: string;
|
|
52
|
+
createdAt: Date;
|
|
53
|
+
updatedAt: Date;
|
|
54
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Vendor, VendorStatus, VendorType } from "../enums/domain/Vendors";
|
|
2
|
+
import { IAddress } from "./Address";
|
|
3
|
+
export interface IVendor {
|
|
4
|
+
id: string;
|
|
5
|
+
restaurantId: string;
|
|
6
|
+
name: string;
|
|
7
|
+
vendorCode: Vendor;
|
|
8
|
+
type: VendorType;
|
|
9
|
+
status: VendorStatus;
|
|
10
|
+
contactName?: string;
|
|
11
|
+
email?: string;
|
|
12
|
+
phoneNumber?: string;
|
|
13
|
+
address?: IAddress;
|
|
14
|
+
taxId?: string;
|
|
15
|
+
website?: string;
|
|
16
|
+
notes?: string;
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
updatedAt: Date;
|
|
19
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IAddress } from "./Address";
|
|
2
|
+
export interface ICustomer {
|
|
3
|
+
/**
|
|
4
|
+
* Internal customer identifier.
|
|
5
|
+
*/
|
|
6
|
+
id: string;
|
|
7
|
+
/**
|
|
8
|
+
* Vendor customer identifier.
|
|
9
|
+
*/
|
|
10
|
+
externalId?: string;
|
|
11
|
+
firstName?: string;
|
|
12
|
+
lastName?: string;
|
|
13
|
+
fullName?: string;
|
|
14
|
+
email?: string;
|
|
15
|
+
phoneNumber?: string;
|
|
16
|
+
loyaltyId?: string;
|
|
17
|
+
dateOfBirth?: Date;
|
|
18
|
+
address?: IAddress;
|
|
19
|
+
createdAt?: Date;
|
|
20
|
+
updatedAt?: Date;
|
|
21
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { DeliveryProvider, DeliveryStatus } from "../../enums/domain/Delivery";
|
|
2
|
+
import { IAddress } from "./Address";
|
|
3
|
+
import { Money } from "./Money";
|
|
4
|
+
export interface IDeliveryDriver {
|
|
5
|
+
id?: string;
|
|
6
|
+
name: string;
|
|
7
|
+
phoneNumber?: string;
|
|
8
|
+
/** External driver ID from the delivery provider. */
|
|
9
|
+
externalId?: string;
|
|
10
|
+
/** Real-time latitude of the driver. */
|
|
11
|
+
latitude?: number;
|
|
12
|
+
/** Real-time longitude of the driver. */
|
|
13
|
+
longitude?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface IDeliveryTracking {
|
|
16
|
+
/** Current latitude of the delivery. */
|
|
17
|
+
latitude?: number;
|
|
18
|
+
/** Current longitude of the delivery. */
|
|
19
|
+
longitude?: number;
|
|
20
|
+
/** Estimated arrival time. */
|
|
21
|
+
estimatedArrivalAt?: Date;
|
|
22
|
+
lastUpdatedAt: Date;
|
|
23
|
+
}
|
|
24
|
+
export interface IDeliveryProvider {
|
|
25
|
+
/** Name of the delivery provider. */
|
|
26
|
+
name: string;
|
|
27
|
+
code: DeliveryProvider;
|
|
28
|
+
/** External delivery identifier from the provider. */
|
|
29
|
+
externalId?: string;
|
|
30
|
+
/** Tracking URL for the delivery, if available. */
|
|
31
|
+
trackingUrl?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface IDelivery {
|
|
34
|
+
id: string;
|
|
35
|
+
restaurantId: string;
|
|
36
|
+
orderId: string;
|
|
37
|
+
/** External delivery identifier from the provider. */
|
|
38
|
+
externalId?: string;
|
|
39
|
+
provider: IDeliveryProvider;
|
|
40
|
+
status: DeliveryStatus;
|
|
41
|
+
driver?: IDeliveryDriver;
|
|
42
|
+
/** Destination address for the delivery. */
|
|
43
|
+
deliveryAddress: IAddress;
|
|
44
|
+
/** Delivery fee charged to the customer. */
|
|
45
|
+
deliveryFee?: Money;
|
|
46
|
+
/** Tip for the driver. */
|
|
47
|
+
driverTip?: Money;
|
|
48
|
+
/** Estimated delivery time in minutes from order placement. */
|
|
49
|
+
estimatedDeliveryMinutes?: number;
|
|
50
|
+
/** Distance to the delivery address in kilometres. */
|
|
51
|
+
distanceKm?: number;
|
|
52
|
+
tracking?: IDeliveryTracking;
|
|
53
|
+
/** Free-text delivery instructions from the customer. */
|
|
54
|
+
deliveryInstructions?: string;
|
|
55
|
+
/** Reason for failure or cancellation, if applicable. */
|
|
56
|
+
failureReason?: string;
|
|
57
|
+
scheduledAt?: Date;
|
|
58
|
+
pickedUpAt?: Date;
|
|
59
|
+
deliveredAt?: Date;
|
|
60
|
+
createdAt: Date;
|
|
61
|
+
updatedAt: Date;
|
|
62
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { EmployeeRole } from "../../enums/domain/Employee";
|
|
2
|
+
export interface IEmployee {
|
|
3
|
+
/**
|
|
4
|
+
* Internal employee identifier.
|
|
5
|
+
*/
|
|
6
|
+
id: string;
|
|
7
|
+
/**
|
|
8
|
+
* Vendor employee identifier.
|
|
9
|
+
*/
|
|
10
|
+
externalId?: string;
|
|
11
|
+
firstName: string;
|
|
12
|
+
lastName: string;
|
|
13
|
+
fullName?: string;
|
|
14
|
+
email?: string;
|
|
15
|
+
phoneNumber?: string;
|
|
16
|
+
role: EmployeeRole;
|
|
17
|
+
active: boolean;
|
|
18
|
+
hiredAt?: Date;
|
|
19
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { InventoryUnit } from "../../enums/domain/Inventory";
|
|
2
|
+
import { Money } from "./Money";
|
|
3
|
+
import { IngredientStatus, AllergenType, DietaryFlag } from "../../enums/domain/Ingredient";
|
|
4
|
+
export interface INutritionalInfo {
|
|
5
|
+
/** Per 100 g or 100 ml of the ingredient. */
|
|
6
|
+
per100g: boolean;
|
|
7
|
+
calories?: number;
|
|
8
|
+
protein?: number;
|
|
9
|
+
carbohydrates?: number;
|
|
10
|
+
sugar?: number;
|
|
11
|
+
fat?: number;
|
|
12
|
+
saturatedFat?: number;
|
|
13
|
+
fiber?: number;
|
|
14
|
+
sodium?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface IIngredient {
|
|
17
|
+
id: string;
|
|
18
|
+
restaurantId: string;
|
|
19
|
+
/** Human-readable name (e.g. "Whole Wheat Flour"). */
|
|
20
|
+
name: string;
|
|
21
|
+
/** Optional short code used in recipes and purchase orders. */
|
|
22
|
+
sku?: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
status: IngredientStatus;
|
|
25
|
+
/** Unit used when measuring this ingredient in recipes. */
|
|
26
|
+
unit: InventoryUnit;
|
|
27
|
+
/** Standard purchase cost per unit. */
|
|
28
|
+
unitCost?: Money;
|
|
29
|
+
/** Link to the corresponding inventory item. */
|
|
30
|
+
inventoryItemId?: string;
|
|
31
|
+
allergens?: AllergenType[];
|
|
32
|
+
dietaryFlags?: DietaryFlag[];
|
|
33
|
+
nutritionalInfo?: INutritionalInfo;
|
|
34
|
+
/** Storage location or section (e.g. "Walk-in Cooler", "Dry Storage"). */
|
|
35
|
+
storageLocation?: string;
|
|
36
|
+
/** Minimum shelf life in days after opening. */
|
|
37
|
+
shelfLifeDays?: number;
|
|
38
|
+
/** Supplier or vendor reference. */
|
|
39
|
+
supplierId?: string;
|
|
40
|
+
createdAt: Date;
|
|
41
|
+
updatedAt: Date;
|
|
42
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { InventoryCategory, InventoryStatus, InventoryUnit } from "../../enums/domain/Inventory";
|
|
2
|
+
export interface IInventoryItem {
|
|
3
|
+
id: string;
|
|
4
|
+
restaurantId: string;
|
|
5
|
+
name: string;
|
|
6
|
+
sku: string;
|
|
7
|
+
category: InventoryCategory;
|
|
8
|
+
unit: InventoryUnit;
|
|
9
|
+
quantityOnHand: number;
|
|
10
|
+
minimumStockLevel: number;
|
|
11
|
+
maximumStockLevel?: number;
|
|
12
|
+
unitCost: number;
|
|
13
|
+
vendorId?: string;
|
|
14
|
+
location?: string;
|
|
15
|
+
expiryDate?: Date;
|
|
16
|
+
status: InventoryStatus;
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
updatedAt: Date;
|
|
19
|
+
}
|
|
20
|
+
export interface IInventory {
|
|
21
|
+
id: string;
|
|
22
|
+
restaurantId: string;
|
|
23
|
+
items: IInventoryItem[];
|
|
24
|
+
createdAt: Date;
|
|
25
|
+
updatedAt: Date;
|
|
26
|
+
}
|