@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.
Files changed (233) hide show
  1. package/cdk/bin/infrastructure.ts +18 -0
  2. package/cdk/bin/project-names.ts +7 -0
  3. package/cdk/lib/infrastructure.ts +37 -0
  4. package/cdk.json +70 -0
  5. package/dist/cdk/bin/infrastructure.d.ts +1 -0
  6. package/dist/cdk/bin/infrastructure.js +20 -0
  7. package/dist/cdk/bin/project-names.d.ts +6 -0
  8. package/dist/cdk/bin/project-names.js +4 -0
  9. package/dist/cdk/lib/infrastructure.d.ts +6 -0
  10. package/dist/cdk/lib/infrastructure.js +32 -0
  11. package/dist/src/enums/domain/DayOfWeek.d.ts +9 -0
  12. package/dist/src/enums/domain/DayOfWeek.js +13 -0
  13. package/dist/src/enums/domain/Delivery.d.ts +19 -0
  14. package/dist/src/enums/domain/Delivery.js +24 -0
  15. package/dist/src/enums/domain/Employee.d.ts +12 -0
  16. package/dist/src/enums/domain/Employee.js +16 -0
  17. package/dist/src/enums/domain/Ingredient.d.ts +31 -0
  18. package/dist/src/enums/domain/Ingredient.js +37 -0
  19. package/dist/src/enums/domain/Inventory.d.ts +29 -0
  20. package/dist/src/enums/domain/Inventory.js +36 -0
  21. package/dist/src/enums/domain/Kitchen.d.ts +49 -0
  22. package/dist/src/enums/domain/Kitchen.js +59 -0
  23. package/dist/src/enums/domain/Menu.d.ts +13 -0
  24. package/dist/src/enums/domain/Menu.js +18 -0
  25. package/dist/src/enums/domain/Payments.d.ts +21 -0
  26. package/dist/src/enums/domain/Payments.js +26 -0
  27. package/dist/src/enums/domain/Recipe.d.ts +14 -0
  28. package/dist/src/enums/domain/Recipe.js +19 -0
  29. package/dist/src/enums/domain/Reservation.d.ts +17 -0
  30. package/dist/src/enums/domain/Reservation.js +22 -0
  31. package/dist/src/enums/domain/Restaurant.d.ts +39 -0
  32. package/dist/src/enums/domain/Restaurant.js +45 -0
  33. package/dist/src/enums/domain/Table.d.ts +23 -0
  34. package/dist/src/enums/domain/Table.js +29 -0
  35. package/dist/src/enums/domain/Vendors.d.ts +29 -0
  36. package/dist/src/enums/domain/Vendors.js +35 -0
  37. package/dist/src/enums/index.d.ts +13 -0
  38. package/dist/src/enums/index.js +29 -0
  39. package/dist/src/eventBridge/EventBridgeModule.d.ts +2 -0
  40. package/dist/src/eventBridge/EventBridgeModule.js +26 -0
  41. package/dist/src/eventBridge/domain/EventBridgeOptions.d.ts +8 -0
  42. package/dist/src/eventBridge/domain/EventBridgeOptions.js +2 -0
  43. package/dist/src/eventBridge/ioc/index.d.ts +3 -0
  44. package/dist/src/eventBridge/ioc/index.js +6 -0
  45. package/dist/src/eventBridge/ioc.d.ts +3 -0
  46. package/dist/src/eventBridge/ioc.js +6 -0
  47. package/dist/src/eventBridge/service/EventBridgeService.d.ts +5 -0
  48. package/dist/src/eventBridge/service/EventBridgeService.js +2 -0
  49. package/dist/src/eventBridge/service/EventBridgeServiceImpl.d.ts +13 -0
  50. package/dist/src/eventBridge/service/EventBridgeServiceImpl.js +63 -0
  51. package/dist/src/events/domain/CustomerEvents.d.ts +54 -0
  52. package/dist/src/events/domain/CustomerEvents.js +2 -0
  53. package/dist/src/events/domain/DeliveryEvents.d.ts +61 -0
  54. package/dist/src/events/domain/DeliveryEvents.js +2 -0
  55. package/dist/src/events/domain/DomainEvent.d.ts +12 -0
  56. package/dist/src/events/domain/DomainEvent.js +2 -0
  57. package/dist/src/events/domain/DomainEventType.d.ts +119 -0
  58. package/dist/src/events/domain/DomainEventType.js +136 -0
  59. package/dist/src/events/domain/EmployeeEvents.d.ts +51 -0
  60. package/dist/src/events/domain/EmployeeEvents.js +2 -0
  61. package/dist/src/events/domain/InventoryEvents.d.ts +141 -0
  62. package/dist/src/events/domain/InventoryEvents.js +2 -0
  63. package/dist/src/events/domain/OrderEvents.d.ts +105 -0
  64. package/dist/src/events/domain/OrderEvents.js +2 -0
  65. package/dist/src/events/domain/PaymentEvents.d.ts +73 -0
  66. package/dist/src/events/domain/PaymentEvents.js +2 -0
  67. package/dist/src/events/domain/RecipeEvents.d.ts +45 -0
  68. package/dist/src/events/domain/RecipeEvents.js +2 -0
  69. package/dist/src/events/domain/ReservationEvents.d.ts +93 -0
  70. package/dist/src/events/domain/ReservationEvents.js +2 -0
  71. package/dist/src/events/domain/RestaurantEvents.d.ts +62 -0
  72. package/dist/src/events/domain/RestaurantEvents.js +2 -0
  73. package/dist/src/events/domain/TableEvents.d.ts +71 -0
  74. package/dist/src/events/domain/TableEvents.js +2 -0
  75. package/dist/src/events/domain/VendorEvents.d.ts +28 -0
  76. package/dist/src/events/domain/VendorEvents.js +2 -0
  77. package/dist/src/events/index.d.ts +13 -0
  78. package/dist/src/events/index.js +29 -0
  79. package/dist/src/index.d.ts +4 -0
  80. package/dist/src/index.js +20 -0
  81. package/dist/src/interfaces/Address.d.ts +7 -0
  82. package/dist/src/interfaces/Address.js +2 -0
  83. package/dist/src/interfaces/Customer.d.ts +21 -0
  84. package/dist/src/interfaces/Customer.js +2 -0
  85. package/dist/src/interfaces/Delivery.d.ts +62 -0
  86. package/dist/src/interfaces/Delivery.js +2 -0
  87. package/dist/src/interfaces/Employee.d.ts +19 -0
  88. package/dist/src/interfaces/Employee.js +2 -0
  89. package/dist/src/interfaces/Ingredient.d.ts +42 -0
  90. package/dist/src/interfaces/Ingredient.js +2 -0
  91. package/dist/src/interfaces/Inventory.d.ts +26 -0
  92. package/dist/src/interfaces/Inventory.js +2 -0
  93. package/dist/src/interfaces/Kitchen.d.ts +72 -0
  94. package/dist/src/interfaces/Kitchen.js +2 -0
  95. package/dist/src/interfaces/Location.d.ts +14 -0
  96. package/dist/src/interfaces/Location.js +2 -0
  97. package/dist/src/interfaces/Menu.d.ts +72 -0
  98. package/dist/src/interfaces/Menu.js +2 -0
  99. package/dist/src/interfaces/Money.d.ts +5 -0
  100. package/dist/src/interfaces/Money.js +2 -0
  101. package/dist/src/interfaces/OpeningHours.d.ts +7 -0
  102. package/dist/src/interfaces/OpeningHours.js +2 -0
  103. package/dist/src/interfaces/Payment.d.ts +36 -0
  104. package/dist/src/interfaces/Payment.js +2 -0
  105. package/dist/src/interfaces/Recipe.d.ts +58 -0
  106. package/dist/src/interfaces/Recipe.js +2 -0
  107. package/dist/src/interfaces/Resevation.d.ts +25 -0
  108. package/dist/src/interfaces/Resevation.js +2 -0
  109. package/dist/src/interfaces/Restaurant.d.ts +24 -0
  110. package/dist/src/interfaces/Restaurant.js +2 -0
  111. package/dist/src/interfaces/Table.d.ts +54 -0
  112. package/dist/src/interfaces/Table.js +2 -0
  113. package/dist/src/interfaces/Vendor.d.ts +19 -0
  114. package/dist/src/interfaces/Vendor.js +2 -0
  115. package/dist/src/interfaces/domain/Address.d.ts +7 -0
  116. package/dist/src/interfaces/domain/Address.js +2 -0
  117. package/dist/src/interfaces/domain/Customer.d.ts +21 -0
  118. package/dist/src/interfaces/domain/Customer.js +2 -0
  119. package/dist/src/interfaces/domain/Delivery.d.ts +62 -0
  120. package/dist/src/interfaces/domain/Delivery.js +2 -0
  121. package/dist/src/interfaces/domain/Employee.d.ts +19 -0
  122. package/dist/src/interfaces/domain/Employee.js +2 -0
  123. package/dist/src/interfaces/domain/Ingredient.d.ts +42 -0
  124. package/dist/src/interfaces/domain/Ingredient.js +2 -0
  125. package/dist/src/interfaces/domain/Inventory.d.ts +26 -0
  126. package/dist/src/interfaces/domain/Inventory.js +2 -0
  127. package/dist/src/interfaces/domain/Kitchen.d.ts +72 -0
  128. package/dist/src/interfaces/domain/Kitchen.js +2 -0
  129. package/dist/src/interfaces/domain/Location.d.ts +14 -0
  130. package/dist/src/interfaces/domain/Location.js +2 -0
  131. package/dist/src/interfaces/domain/Menu.d.ts +72 -0
  132. package/dist/src/interfaces/domain/Menu.js +2 -0
  133. package/dist/src/interfaces/domain/Money.d.ts +5 -0
  134. package/dist/src/interfaces/domain/Money.js +2 -0
  135. package/dist/src/interfaces/domain/OpeningHours.d.ts +7 -0
  136. package/dist/src/interfaces/domain/OpeningHours.js +2 -0
  137. package/dist/src/interfaces/domain/Payment.d.ts +36 -0
  138. package/dist/src/interfaces/domain/Payment.js +2 -0
  139. package/dist/src/interfaces/domain/Recipe.d.ts +58 -0
  140. package/dist/src/interfaces/domain/Recipe.js +2 -0
  141. package/dist/src/interfaces/domain/Reservation.d.ts +25 -0
  142. package/dist/src/interfaces/domain/Reservation.js +2 -0
  143. package/dist/src/interfaces/domain/Restaurant.d.ts +24 -0
  144. package/dist/src/interfaces/domain/Restaurant.js +2 -0
  145. package/dist/src/interfaces/domain/Table.d.ts +54 -0
  146. package/dist/src/interfaces/domain/Table.js +2 -0
  147. package/dist/src/interfaces/domain/Vendor.d.ts +19 -0
  148. package/dist/src/interfaces/domain/Vendor.js +2 -0
  149. package/dist/src/interfaces/index.d.ts +17 -0
  150. package/dist/src/interfaces/index.js +33 -0
  151. package/dist/src/orders/OrderModule.d.ts +2 -0
  152. package/dist/src/orders/OrderModule.js +28 -0
  153. package/dist/src/orders/domain/Enums.d.ts +16 -0
  154. package/dist/src/orders/domain/Enums.js +21 -0
  155. package/dist/src/orders/domain/Order.d.ts +89 -0
  156. package/dist/src/orders/domain/Order.js +2 -0
  157. package/dist/src/orders/domain/OrderItem.d.ts +53 -0
  158. package/dist/src/orders/domain/OrderItem.js +2 -0
  159. package/dist/src/orders/domain/posDto/SquareOrder.d.ts +347 -0
  160. package/dist/src/orders/domain/posDto/SquareOrder.js +8 -0
  161. package/dist/src/orders/index.d.ts +7 -0
  162. package/dist/src/orders/index.js +25 -0
  163. package/dist/src/orders/ioc/index.d.ts +3 -0
  164. package/dist/src/orders/ioc/index.js +6 -0
  165. package/dist/src/orders/services/square/SquareOrderService.d.ts +22 -0
  166. package/dist/src/orders/services/square/SquareOrderService.js +4 -0
  167. package/dist/src/orders/services/square/SquareOrderServiceImpl.d.ts +32 -0
  168. package/dist/src/orders/services/square/SquareOrderServiceImpl.js +308 -0
  169. package/jest.config.js +8 -0
  170. package/package.json +43 -0
  171. package/src/enums/domain/DayOfWeek.ts +9 -0
  172. package/src/enums/domain/Delivery.ts +20 -0
  173. package/src/enums/domain/Employee.ts +12 -0
  174. package/src/enums/domain/Ingredient.ts +33 -0
  175. package/src/enums/domain/Inventory.ts +39 -0
  176. package/src/enums/domain/Kitchen.ts +89 -0
  177. package/src/enums/domain/Menu.ts +14 -0
  178. package/src/enums/domain/Payments.ts +41 -0
  179. package/src/enums/domain/Recipe.ts +15 -0
  180. package/src/enums/domain/Reservation.ts +18 -0
  181. package/src/enums/domain/Restaurant.ts +41 -0
  182. package/src/enums/domain/Table.ts +39 -0
  183. package/src/enums/domain/Vendors.ts +45 -0
  184. package/src/enums/index.ts +13 -0
  185. package/src/eventBridge/EventBridgeModule.ts +14 -0
  186. package/src/eventBridge/domain/EventBridgeOptions.ts +8 -0
  187. package/src/eventBridge/ioc/index.ts +3 -0
  188. package/src/eventBridge/ioc.ts +3 -0
  189. package/src/eventBridge/service/EventBridgeService.ts +8 -0
  190. package/src/eventBridge/service/EventBridgeServiceImpl.ts +67 -0
  191. package/src/events/domain/CustomerEvents.ts +79 -0
  192. package/src/events/domain/DeliveryEvents.ts +82 -0
  193. package/src/events/domain/DomainEvent.ts +17 -0
  194. package/src/events/domain/DomainEventType.ts +143 -0
  195. package/src/events/domain/EmployeeEvents.ts +74 -0
  196. package/src/events/domain/InventoryEvents.ts +184 -0
  197. package/src/events/domain/OrderEvents.ts +142 -0
  198. package/src/events/domain/PaymentEvents.ts +92 -0
  199. package/src/events/domain/RecipeEvents.ts +64 -0
  200. package/src/events/domain/ReservationEvents.ts +133 -0
  201. package/src/events/domain/RestaurantEvents.ts +89 -0
  202. package/src/events/domain/TableEvents.ts +102 -0
  203. package/src/events/domain/VendorEvents.ts +42 -0
  204. package/src/events/index.ts +13 -0
  205. package/src/index.ts +4 -0
  206. package/src/interfaces/domain/Address.ts +7 -0
  207. package/src/interfaces/domain/Customer.ts +33 -0
  208. package/src/interfaces/domain/Delivery.ts +96 -0
  209. package/src/interfaces/domain/Employee.ts +29 -0
  210. package/src/interfaces/domain/Ingredient.ts +68 -0
  211. package/src/interfaces/domain/Inventory.ts +52 -0
  212. package/src/interfaces/domain/Kitchen.ts +128 -0
  213. package/src/interfaces/domain/Location.ts +20 -0
  214. package/src/interfaces/domain/Menu.ts +121 -0
  215. package/src/interfaces/domain/Money.ts +6 -0
  216. package/src/interfaces/domain/OpeningHours.ts +11 -0
  217. package/src/interfaces/domain/Payment.ts +45 -0
  218. package/src/interfaces/domain/Recipe.ts +91 -0
  219. package/src/interfaces/domain/Reservation.ts +45 -0
  220. package/src/interfaces/domain/Restaurant.ts +45 -0
  221. package/src/interfaces/domain/Table.ts +69 -0
  222. package/src/interfaces/domain/Vendor.ts +35 -0
  223. package/src/interfaces/index.ts +17 -0
  224. package/src/orders/OrderModule.ts +17 -0
  225. package/src/orders/domain/Enums.ts +17 -0
  226. package/src/orders/domain/Order.ts +109 -0
  227. package/src/orders/domain/OrderItem.ts +68 -0
  228. package/src/orders/domain/posDto/SquareOrder.ts +346 -0
  229. package/src/orders/index.ts +7 -0
  230. package/src/orders/ioc/index.ts +3 -0
  231. package/src/orders/services/square/SquareOrderService.ts +27 -0
  232. package/src/orders/services/square/SquareOrderServiceImpl.ts +330 -0
  233. 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,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ export type Currency = 'USD' | 'EUR' | 'GBP' | 'JPY' | 'CAD' | 'AUD' | 'CHF' | 'CNY' | 'INR' | 'BRL' | 'MXN' | 'ZAR';
2
+ export interface Money {
3
+ amount: number;
4
+ currency: Currency;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ import { DayOfWeek } from "../../enums/domain/DayOfWeek";
2
+ export interface OperatingHours {
3
+ dayOfWeek: DayOfWeek;
4
+ openTime: string;
5
+ closeTime: string;
6
+ isClosed: boolean;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,17 @@
1
+ export * from "./domain/Address";
2
+ export * from "./domain/Employee";
3
+ export * from "./domain/Inventory";
4
+ export * from "./domain/Kitchen";
5
+ export * from "./domain/Menu";
6
+ export * from "./domain/Payment";
7
+ export * from "./domain/Recipe";
8
+ export * from "./domain/Restaurant";
9
+ export * from "./domain/Table";
10
+ export * from "./domain/Vendor";
11
+ export * from "./domain/Delivery";
12
+ export * from "./domain/Ingredient";
13
+ export * from "./domain/Customer";
14
+ export * from "./domain/Money";
15
+ export * from "./domain/Location";
16
+ export * from "./domain/Reservation";
17
+ export * from "./domain/OpeningHours";
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./domain/Address"), exports);
18
+ __exportStar(require("./domain/Employee"), exports);
19
+ __exportStar(require("./domain/Inventory"), exports);
20
+ __exportStar(require("./domain/Kitchen"), exports);
21
+ __exportStar(require("./domain/Menu"), exports);
22
+ __exportStar(require("./domain/Payment"), exports);
23
+ __exportStar(require("./domain/Recipe"), exports);
24
+ __exportStar(require("./domain/Restaurant"), exports);
25
+ __exportStar(require("./domain/Table"), exports);
26
+ __exportStar(require("./domain/Vendor"), exports);
27
+ __exportStar(require("./domain/Delivery"), exports);
28
+ __exportStar(require("./domain/Ingredient"), exports);
29
+ __exportStar(require("./domain/Customer"), exports);
30
+ __exportStar(require("./domain/Money"), exports);
31
+ __exportStar(require("./domain/Location"), exports);
32
+ __exportStar(require("./domain/Reservation"), exports);
33
+ __exportStar(require("./domain/OpeningHours"), exports);
@@ -0,0 +1,2 @@
1
+ export declare class OrderModule {
2
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.OrderModule = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const EventBridgeModule_1 = require("../eventBridge/EventBridgeModule");
12
+ const SquareOrderServiceImpl_1 = require("./services/square/SquareOrderServiceImpl");
13
+ const ioc_1 = require("./ioc");
14
+ let OrderModule = class OrderModule {
15
+ };
16
+ exports.OrderModule = OrderModule;
17
+ exports.OrderModule = OrderModule = __decorate([
18
+ (0, common_1.Module)({
19
+ imports: [EventBridgeModule_1.EventBridgeModule],
20
+ providers: [
21
+ {
22
+ provide: ioc_1.OrderSymbols.SquareOrderService,
23
+ useClass: SquareOrderServiceImpl_1.SquareOrderServiceImpl,
24
+ },
25
+ ],
26
+ exports: [ioc_1.OrderSymbols.SquareOrderService],
27
+ })
28
+ ], OrderModule);
@@ -0,0 +1,16 @@
1
+ export declare enum OrderType {
2
+ DINE_IN = "DINE_IN",
3
+ TAKEAWAY = "TAKEAWAY",
4
+ DELIVERY = "DELIVERY",
5
+ CURBSIDE = "CURBSIDE",
6
+ DRIVE_THROUGH = "DRIVE_THROUGH"
7
+ }
8
+ export declare enum OrderStatus {
9
+ PENDING = "PENDING",
10
+ ACCEPTED = "ACCEPTED",
11
+ IN_PROGRESS = "IN_PROGRESS",
12
+ READY = "READY",
13
+ COMPLETED = "COMPLETED",
14
+ CANCELLED = "CANCELLED",
15
+ REFUNDED = "REFUNDED"
16
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrderStatus = exports.OrderType = void 0;
4
+ var OrderType;
5
+ (function (OrderType) {
6
+ OrderType["DINE_IN"] = "DINE_IN";
7
+ OrderType["TAKEAWAY"] = "TAKEAWAY";
8
+ OrderType["DELIVERY"] = "DELIVERY";
9
+ OrderType["CURBSIDE"] = "CURBSIDE";
10
+ OrderType["DRIVE_THROUGH"] = "DRIVE_THROUGH";
11
+ })(OrderType || (exports.OrderType = OrderType = {}));
12
+ var OrderStatus;
13
+ (function (OrderStatus) {
14
+ OrderStatus["PENDING"] = "PENDING";
15
+ OrderStatus["ACCEPTED"] = "ACCEPTED";
16
+ OrderStatus["IN_PROGRESS"] = "IN_PROGRESS";
17
+ OrderStatus["READY"] = "READY";
18
+ OrderStatus["COMPLETED"] = "COMPLETED";
19
+ OrderStatus["CANCELLED"] = "CANCELLED";
20
+ OrderStatus["REFUNDED"] = "REFUNDED";
21
+ })(OrderStatus || (exports.OrderStatus = OrderStatus = {}));
@@ -0,0 +1,89 @@
1
+ import { ICustomer } from "../../interfaces/domain/Customer";
2
+ import { IEmployee } from "../../interfaces/domain/Employee";
3
+ import { Money } from "../../interfaces/domain/Money";
4
+ import { IOrderItem } from "./OrderItem";
5
+ import { OrderStatus, OrderType } from "./Enums";
6
+ import { IPayment } from "../../interfaces/domain/Payment";
7
+ import { IVendor } from "../../interfaces/domain/Vendor";
8
+ export interface IOrder {
9
+ /**
10
+ * Unique order identifier in your platform.
11
+ */
12
+ id: string;
13
+ /**
14
+ * Original vendor order identifier.
15
+ */
16
+ externalId: string;
17
+ /**
18
+ * Restaurant that owns the order.
19
+ */
20
+ restaurantId: string;
21
+ /**
22
+ * POS vendor.
23
+ */
24
+ vendor: IVendor;
25
+ /**
26
+ * Location/branch.
27
+ */
28
+ locationId: string;
29
+ /**
30
+ * Customer (optional).
31
+ */
32
+ customer?: ICustomer;
33
+ /**
34
+ * Employee who created the order.
35
+ */
36
+ employee?: IEmployee;
37
+ /**
38
+ * Ordered items.
39
+ */
40
+ items: IOrderItem[];
41
+ /**
42
+ * Current order status.
43
+ */
44
+ status: OrderStatus;
45
+ /**
46
+ * Order type.
47
+ */
48
+ type: OrderType;
49
+ /**
50
+ * Subtotal before discounts and taxes.
51
+ */
52
+ subtotal: Money;
53
+ /**
54
+ * Total discount.
55
+ */
56
+ discount: Money;
57
+ /**
58
+ * Total tax.
59
+ */
60
+ tax: Money;
61
+ /**
62
+ * Tip amount.
63
+ */
64
+ tip: Money;
65
+ /**
66
+ * Final amount paid.
67
+ */
68
+ total: Money;
69
+ /**
70
+ * Payment information.
71
+ */
72
+ payments: IPayment[];
73
+ /**
74
+ * Optional notes.
75
+ */
76
+ notes?: string;
77
+ /**
78
+ * Date/time the order was created.
79
+ */
80
+ createdAt: Date;
81
+ /**
82
+ * Date/time last updated.
83
+ */
84
+ updatedAt: Date;
85
+ /**
86
+ * Date/time completed.
87
+ */
88
+ completedAt?: Date;
89
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });