@api-client/core 0.18.21 → 0.18.22

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 (138) hide show
  1. package/build/src/modeling/helpers/Intelisense.d.ts +1 -0
  2. package/build/src/modeling/helpers/Intelisense.d.ts.map +1 -1
  3. package/build/src/modeling/helpers/Intelisense.js +1 -0
  4. package/build/src/modeling/helpers/Intelisense.js.map +1 -1
  5. package/build/src/modeling/templates/index.d.ts +1 -0
  6. package/build/src/modeling/templates/index.d.ts.map +1 -1
  7. package/build/src/modeling/templates/index.js +2 -0
  8. package/build/src/modeling/templates/index.js.map +1 -1
  9. package/build/src/modeling/templates/meta/education-management-platform.json +1 -0
  10. package/build/src/modeling/templates/meta/financial-services-platform.json +1 -0
  11. package/build/src/modeling/templates/meta/gaming-platform.json +1 -0
  12. package/build/src/modeling/templates/meta/healthcare-management-platform.json +1 -0
  13. package/build/src/modeling/templates/meta/hospitality-platform.json +1 -0
  14. package/build/src/modeling/templates/meta/index.d.ts +2 -2
  15. package/build/src/modeling/templates/meta/index.d.ts.map +1 -1
  16. package/build/src/modeling/templates/meta/index.js +31 -1
  17. package/build/src/modeling/templates/meta/index.js.map +1 -1
  18. package/build/src/modeling/templates/meta/iot-smart-home-platform.json +1 -0
  19. package/build/src/modeling/templates/meta/legal-services-platform.json +1 -0
  20. package/build/src/modeling/templates/meta/manufacturing-platform.json +1 -0
  21. package/build/src/modeling/templates/meta/non-profit-platform.json +1 -0
  22. package/build/src/modeling/templates/meta/real-estate-management-platform.json +1 -0
  23. package/build/src/modeling/templates/template-registry.d.ts +14 -0
  24. package/build/src/modeling/templates/template-registry.d.ts.map +1 -1
  25. package/build/src/modeling/templates/template-registry.js +63 -0
  26. package/build/src/modeling/templates/template-registry.js.map +1 -1
  27. package/build/src/modeling/templates/{ecommerce-domain.d.ts → verticals/business-services/ecommerce-domain.d.ts} +2 -2
  28. package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.d.ts.map +1 -0
  29. package/build/src/modeling/templates/{ecommerce-domain.js → verticals/business-services/ecommerce-domain.js} +6 -6
  30. package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.js.map +1 -0
  31. package/build/src/modeling/templates/verticals/business-services/financial-services-domain.d.ts +40 -0
  32. package/build/src/modeling/templates/verticals/business-services/financial-services-domain.d.ts.map +1 -0
  33. package/build/src/modeling/templates/verticals/business-services/financial-services-domain.js +744 -0
  34. package/build/src/modeling/templates/verticals/business-services/financial-services-domain.js.map +1 -0
  35. package/build/src/modeling/templates/verticals/business-services/hospitality-domain.d.ts +45 -0
  36. package/build/src/modeling/templates/verticals/business-services/hospitality-domain.d.ts.map +1 -0
  37. package/build/src/modeling/templates/verticals/business-services/hospitality-domain.js +797 -0
  38. package/build/src/modeling/templates/verticals/business-services/hospitality-domain.js.map +1 -0
  39. package/build/src/modeling/templates/verticals/business-services/index.d.ts +21 -0
  40. package/build/src/modeling/templates/verticals/business-services/index.d.ts.map +1 -0
  41. package/build/src/modeling/templates/verticals/business-services/index.js +50 -0
  42. package/build/src/modeling/templates/verticals/business-services/index.js.map +1 -0
  43. package/build/src/modeling/templates/verticals/business-services/legal-services-domain.d.ts +46 -0
  44. package/build/src/modeling/templates/verticals/business-services/legal-services-domain.d.ts.map +1 -0
  45. package/build/src/modeling/templates/verticals/business-services/legal-services-domain.js +837 -0
  46. package/build/src/modeling/templates/verticals/business-services/legal-services-domain.js.map +1 -0
  47. package/build/src/modeling/templates/verticals/education-training/education-domain.d.ts +40 -0
  48. package/build/src/modeling/templates/verticals/education-training/education-domain.d.ts.map +1 -0
  49. package/build/src/modeling/templates/verticals/education-training/education-domain.js +725 -0
  50. package/build/src/modeling/templates/verticals/education-training/education-domain.js.map +1 -0
  51. package/build/src/modeling/templates/verticals/education-training/index.d.ts +18 -0
  52. package/build/src/modeling/templates/verticals/education-training/index.d.ts.map +1 -0
  53. package/build/src/modeling/templates/verticals/education-training/index.js +21 -0
  54. package/build/src/modeling/templates/verticals/education-training/index.js.map +1 -0
  55. package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.d.ts +40 -0
  56. package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.d.ts.map +1 -0
  57. package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.js +859 -0
  58. package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.js.map +1 -0
  59. package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.d.ts +18 -0
  60. package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.d.ts.map +1 -0
  61. package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.js +21 -0
  62. package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.js.map +1 -0
  63. package/build/src/modeling/templates/verticals/index.d.ts +79 -0
  64. package/build/src/modeling/templates/verticals/index.d.ts.map +1 -0
  65. package/build/src/modeling/templates/verticals/index.js +186 -0
  66. package/build/src/modeling/templates/verticals/index.js.map +1 -0
  67. package/build/src/modeling/templates/verticals/manufacturing-logistics/index.d.ts +18 -0
  68. package/build/src/modeling/templates/verticals/manufacturing-logistics/index.d.ts.map +1 -0
  69. package/build/src/modeling/templates/verticals/manufacturing-logistics/index.js +22 -0
  70. package/build/src/modeling/templates/verticals/manufacturing-logistics/index.js.map +1 -0
  71. package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.d.ts +45 -0
  72. package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.d.ts.map +1 -0
  73. package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.js +710 -0
  74. package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.js.map +1 -0
  75. package/build/src/modeling/templates/verticals/public-sector/index.d.ts +18 -0
  76. package/build/src/modeling/templates/verticals/public-sector/index.d.ts.map +1 -0
  77. package/build/src/modeling/templates/verticals/public-sector/index.js +22 -0
  78. package/build/src/modeling/templates/verticals/public-sector/index.js.map +1 -0
  79. package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.d.ts +47 -0
  80. package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.d.ts.map +1 -0
  81. package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.js +864 -0
  82. package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.js.map +1 -0
  83. package/build/src/modeling/templates/verticals/real-estate-construction/index.d.ts +18 -0
  84. package/build/src/modeling/templates/verticals/real-estate-construction/index.d.ts.map +1 -0
  85. package/build/src/modeling/templates/verticals/real-estate-construction/index.js +21 -0
  86. package/build/src/modeling/templates/verticals/real-estate-construction/index.js.map +1 -0
  87. package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.d.ts +40 -0
  88. package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.d.ts.map +1 -0
  89. package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.js +727 -0
  90. package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.js.map +1 -0
  91. package/build/src/modeling/templates/{blog-domain.d.ts → verticals/technology-media/blog-domain.d.ts} +2 -2
  92. package/build/src/modeling/templates/verticals/technology-media/blog-domain.d.ts.map +1 -0
  93. package/build/src/modeling/templates/{blog-domain.js → verticals/technology-media/blog-domain.js} +5 -5
  94. package/build/src/modeling/templates/verticals/technology-media/blog-domain.js.map +1 -0
  95. package/build/src/modeling/templates/verticals/technology-media/gaming-domain.d.ts +46 -0
  96. package/build/src/modeling/templates/verticals/technology-media/gaming-domain.d.ts.map +1 -0
  97. package/build/src/modeling/templates/verticals/technology-media/gaming-domain.js +1033 -0
  98. package/build/src/modeling/templates/verticals/technology-media/gaming-domain.js.map +1 -0
  99. package/build/src/modeling/templates/verticals/technology-media/index.d.ts +21 -0
  100. package/build/src/modeling/templates/verticals/technology-media/index.d.ts.map +1 -0
  101. package/build/src/modeling/templates/verticals/technology-media/index.js +42 -0
  102. package/build/src/modeling/templates/verticals/technology-media/index.js.map +1 -0
  103. package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.d.ts +47 -0
  104. package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.d.ts.map +1 -0
  105. package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.js +1027 -0
  106. package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.js.map +1 -0
  107. package/build/tsconfig.tsbuildinfo +1 -1
  108. package/package.json +1 -1
  109. package/src/modeling/helpers/Intelisense.ts +1 -0
  110. package/src/modeling/templates/meta/education-management-platform.json +1 -0
  111. package/src/modeling/templates/meta/financial-services-platform.json +1 -0
  112. package/src/modeling/templates/meta/gaming-platform.json +1 -0
  113. package/src/modeling/templates/meta/healthcare-management-platform.json +1 -0
  114. package/src/modeling/templates/meta/hospitality-platform.json +1 -0
  115. package/src/modeling/templates/meta/iot-smart-home-platform.json +1 -0
  116. package/src/modeling/templates/meta/legal-services-platform.json +1 -0
  117. package/src/modeling/templates/meta/manufacturing-platform.json +1 -0
  118. package/src/modeling/templates/meta/non-profit-platform.json +1 -0
  119. package/src/modeling/templates/meta/real-estate-management-platform.json +1 -0
  120. package/src/modeling/templates/readme.md +14 -0
  121. package/src/modeling/templates/template-registry.ts +73 -0
  122. package/src/modeling/templates/verticals/README.md +122 -0
  123. package/src/modeling/templates/{ecommerce-domain.ts → verticals/business-services/ecommerce-domain.ts} +7 -7
  124. package/src/modeling/templates/verticals/business-services/financial-services-domain.ts +943 -0
  125. package/src/modeling/templates/verticals/business-services/hospitality-domain.ts +994 -0
  126. package/src/modeling/templates/verticals/business-services/legal-services-domain.ts +1059 -0
  127. package/src/modeling/templates/verticals/education-training/education-domain.ts +922 -0
  128. package/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.ts +1111 -0
  129. package/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.ts +895 -0
  130. package/src/modeling/templates/verticals/public-sector/non-profit-domain.ts +1109 -0
  131. package/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.ts +944 -0
  132. package/src/modeling/templates/{blog-domain.ts → verticals/technology-media/blog-domain.ts} +6 -6
  133. package/src/modeling/templates/verticals/technology-media/gaming-domain.ts +1290 -0
  134. package/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.ts +1287 -0
  135. package/build/src/modeling/templates/blog-domain.d.ts.map +0 -1
  136. package/build/src/modeling/templates/blog-domain.js.map +0 -1
  137. package/build/src/modeling/templates/ecommerce-domain.d.ts.map +0 -1
  138. package/build/src/modeling/templates/ecommerce-domain.js.map +0 -1
@@ -0,0 +1,994 @@
1
+ /**
2
+ * Hospitality Domain Template
3
+ *
4
+ * A comprehensive hospitality data domain following domain-driven design principles.
5
+ * This template covers the complete hospitality lifecycle including:
6
+ *
7
+ * - Guest Management: Guest profiles, preferences, loyalty programs
8
+ * - Reservation System: Bookings, availability, pricing
9
+ * - Property Management: Rooms, amenities, housekeeping
10
+ * - Service Management: Concierge, room service, activities
11
+ * - Revenue Management: Pricing, promotions, revenue optimization
12
+ * - Operations: Staff scheduling, maintenance, security
13
+ *
14
+ * Key Features:
15
+ * - Complete guest lifecycle management
16
+ * - Reservation and booking system
17
+ * - Room and property management
18
+ * - Service delivery tracking
19
+ * - Revenue optimization and pricing
20
+ * - Operational management
21
+ * - Loyalty program management
22
+ *
23
+ * Use Cases:
24
+ * - Hotels and resorts
25
+ * - Hospitality management
26
+ * - Guest services
27
+ * - Revenue management
28
+ * - Property operations
29
+ */
30
+
31
+ import { DataDomain } from '../../../DataDomain.js'
32
+ import {
33
+ addIdField,
34
+ addNameField,
35
+ addDescriptionField,
36
+ addEmailField,
37
+ addPhoneField,
38
+ addCustomStatusField,
39
+ addCreatedAtField,
40
+ addUpdatedAtField,
41
+ addCurrencyAmountField,
42
+ } from '../../../helpers/Intelisense.js'
43
+ import type { CreateTemplateOptions } from '../../types.js'
44
+
45
+ function createDomain(): DataDomain {
46
+ return new DataDomain({
47
+ info: {
48
+ name: 'Hospitality Platform',
49
+ displayName: 'Hospitality Platform',
50
+ description:
51
+ 'A comprehensive hospitality platform with guest management, reservations, ' +
52
+ 'property management, services, revenue optimization, and operations',
53
+ },
54
+ })
55
+ }
56
+
57
+ /**
58
+ * Creates a comprehensive hospitality data domain following domain-driven design principles.
59
+ *
60
+ * This function demonstrates the proper hierarchy and organization for a hospitality platform:
61
+ * 1. Creates the root DataDomain for the hospitality platform
62
+ * 2. Organizes functionality into logical namespaces (Guest Management, Reservation System, etc.)
63
+ * 3. Groups related entities into models within each namespace
64
+ * 4. Defines entities with proper semantic annotations for hospitality workflows
65
+ * 5. Establishes associations with appropriate cardinality for hospitality relationships
66
+ *
67
+ * @returns A fully configured DataDomain with all hospitality entities and relationships
68
+ */
69
+ export default function createHospitalityDomain(options: CreateTemplateOptions = {}): DataDomain {
70
+ // Ensure the root data domain
71
+ const domain = options.domain ?? createDomain()
72
+
73
+ //
74
+ // 1. GUEST MANAGEMENT NAMESPACE
75
+ //
76
+ const guestManagement = domain.addNamespace({
77
+ info: {
78
+ name: 'GuestManagement',
79
+ displayName: 'Guest Management',
80
+ description: 'Guest profiles, preferences, and loyalty programs',
81
+ },
82
+ })
83
+
84
+ // Guest Model
85
+ const guestModel = guestManagement.addModel({
86
+ info: {
87
+ name: 'Guests',
88
+ displayName: 'Guest Management',
89
+ description: 'Guest profiles and information',
90
+ },
91
+ })
92
+
93
+ // Guest Entity
94
+ const guestEntity = guestModel.addEntity({
95
+ info: {
96
+ name: 'guest',
97
+ displayName: 'Guest',
98
+ description: 'Hotel guest with profile and preferences',
99
+ },
100
+ })
101
+
102
+ addIdField(guestEntity, { displayName: 'Guest ID', description: 'Unique identifier for the guest' })
103
+
104
+ addNameField(guestEntity, { description: 'Guest name and title' })
105
+
106
+ addDescriptionField(guestEntity, { description: 'Guest description and notes' })
107
+
108
+ addEmailField(guestEntity, { description: 'Guest email address' })
109
+
110
+ addPhoneField(guestEntity, { description: 'Guest phone number' })
111
+
112
+ guestEntity.addProperty({
113
+ info: { name: 'date_of_birth', displayName: 'Date of Birth', description: 'Guest date of birth' },
114
+ type: 'date',
115
+ required: false,
116
+ })
117
+
118
+ guestEntity.addProperty({
119
+ info: { name: 'nationality', displayName: 'Nationality', description: 'Guest nationality' },
120
+ type: 'string',
121
+ required: false,
122
+ })
123
+
124
+ guestEntity.addProperty({
125
+ info: { name: 'address', displayName: 'Address', description: 'Guest address' },
126
+ type: 'string',
127
+ required: false,
128
+ })
129
+
130
+ guestEntity.addProperty({
131
+ info: { name: 'guest_type', displayName: 'Guest Type', description: 'Type of guest' },
132
+ type: 'string',
133
+ required: true,
134
+ schema: {
135
+ enum: ['individual', 'business', 'group', 'vip'],
136
+ },
137
+ })
138
+
139
+ addCustomStatusField(guestEntity, ['active', 'inactive', 'blacklisted'], {
140
+ displayName: 'Guest Status',
141
+ description: 'Current status of the guest',
142
+ })
143
+
144
+ addCreatedAtField(guestEntity, { description: 'When the guest record was created' })
145
+ addUpdatedAtField(guestEntity, { description: 'When the guest record was last updated' })
146
+
147
+ // Guest Preference Entity
148
+ const guestPreferenceEntity = guestModel.addEntity({
149
+ info: {
150
+ name: 'guest_preference',
151
+ displayName: 'Guest Preference',
152
+ description: 'Guest preferences and special requirements',
153
+ },
154
+ })
155
+
156
+ addIdField(guestPreferenceEntity, {
157
+ displayName: 'Preference ID',
158
+ description: 'Unique identifier for the guest preference',
159
+ })
160
+
161
+ addNameField(guestPreferenceEntity, { description: 'Preference name and description' })
162
+
163
+ guestPreferenceEntity.addProperty({
164
+ info: { name: 'preference_type', displayName: 'Preference Type', description: 'Type of preference' },
165
+ type: 'string',
166
+ required: true,
167
+ schema: {
168
+ enum: ['room', 'amenity', 'service', 'dietary', 'accessibility'],
169
+ },
170
+ })
171
+
172
+ guestPreferenceEntity.addProperty({
173
+ info: { name: 'value', displayName: 'Value', description: 'Preference value or setting' },
174
+ type: 'string',
175
+ required: true,
176
+ })
177
+
178
+ addCustomStatusField(guestPreferenceEntity, ['active', 'inactive'], {
179
+ displayName: 'Preference Status',
180
+ description: 'Current status of the preference',
181
+ })
182
+
183
+ addCreatedAtField(guestPreferenceEntity, { description: 'When the preference was created' })
184
+
185
+ // GuestPreference-Guest Association (Many-to-One)
186
+ guestPreferenceEntity.addAssociation(
187
+ { key: guestEntity.key },
188
+ {
189
+ info: { name: 'guest', displayName: 'Guest', description: 'Guest for this preference' },
190
+ required: true,
191
+ multiple: false,
192
+ }
193
+ )
194
+
195
+ // Loyalty Program Entity
196
+ const loyaltyProgramEntity = guestModel.addEntity({
197
+ info: {
198
+ name: 'loyalty_program',
199
+ displayName: 'Loyalty Program',
200
+ description: 'Guest loyalty program and membership',
201
+ },
202
+ })
203
+
204
+ addIdField(loyaltyProgramEntity, {
205
+ displayName: 'Loyalty ID',
206
+ description: 'Unique identifier for the loyalty program',
207
+ })
208
+
209
+ addNameField(loyaltyProgramEntity, { description: 'Loyalty program name' })
210
+
211
+ loyaltyProgramEntity.addProperty({
212
+ info: { name: 'membership_number', displayName: 'Membership Number', description: 'Loyalty membership number' },
213
+ type: 'string',
214
+ required: true,
215
+ unique: true,
216
+ })
217
+
218
+ loyaltyProgramEntity.addProperty({
219
+ info: { name: 'tier_level', displayName: 'Tier Level', description: 'Loyalty tier level' },
220
+ type: 'string',
221
+ required: true,
222
+ schema: {
223
+ enum: ['bronze', 'silver', 'gold', 'platinum', 'diamond'],
224
+ },
225
+ })
226
+
227
+ loyaltyProgramEntity.addProperty({
228
+ info: { name: 'points_balance', displayName: 'Points Balance', description: 'Current points balance' },
229
+ type: 'number',
230
+ required: true,
231
+ schema: {
232
+ minimum: 0,
233
+ },
234
+ })
235
+
236
+ addCustomStatusField(loyaltyProgramEntity, ['active', 'inactive', 'suspended'], {
237
+ displayName: 'Loyalty Status',
238
+ description: 'Current status of the loyalty membership',
239
+ })
240
+
241
+ addCreatedAtField(loyaltyProgramEntity, { description: 'When the loyalty membership was created' })
242
+
243
+ // LoyaltyProgram-Guest Association (One-to-One)
244
+ loyaltyProgramEntity.addAssociation(
245
+ { key: guestEntity.key },
246
+ {
247
+ info: { name: 'guest', displayName: 'Guest', description: 'Guest for this loyalty program' },
248
+ required: true,
249
+ multiple: false,
250
+ }
251
+ )
252
+
253
+ //
254
+ // 2. RESERVATION SYSTEM NAMESPACE
255
+ //
256
+ const reservationSystem = domain.addNamespace({
257
+ info: {
258
+ name: 'ReservationSystem',
259
+ displayName: 'Reservation System',
260
+ description: 'Bookings, availability, and pricing management',
261
+ },
262
+ })
263
+
264
+ // Reservation Model
265
+ const reservationModel = reservationSystem.addModel({
266
+ info: {
267
+ name: 'Reservations',
268
+ displayName: 'Reservation Management',
269
+ description: 'Reservation and booking management',
270
+ },
271
+ })
272
+
273
+ // Reservation Entity
274
+ const reservationEntity = reservationModel.addEntity({
275
+ info: {
276
+ name: 'reservation',
277
+ displayName: 'Reservation',
278
+ description: 'Guest reservation and booking',
279
+ },
280
+ })
281
+
282
+ addIdField(reservationEntity, { displayName: 'Reservation ID', description: 'Unique identifier for the reservation' })
283
+
284
+ addNameField(reservationEntity, { description: 'Reservation name and description' })
285
+
286
+ reservationEntity.addProperty({
287
+ info: { name: 'check_in_date', displayName: 'Check-in Date', description: 'Guest check-in date' },
288
+ type: 'date',
289
+ required: true,
290
+ })
291
+
292
+ reservationEntity.addProperty({
293
+ info: { name: 'check_out_date', displayName: 'Check-out Date', description: 'Guest check-out date' },
294
+ type: 'date',
295
+ required: true,
296
+ })
297
+
298
+ reservationEntity.addProperty({
299
+ info: { name: 'adults', displayName: 'Adults', description: 'Number of adult guests' },
300
+ type: 'number',
301
+ required: true,
302
+ schema: {
303
+ minimum: 1,
304
+ },
305
+ })
306
+
307
+ reservationEntity.addProperty({
308
+ info: { name: 'children', displayName: 'Children', description: 'Number of children' },
309
+ type: 'number',
310
+ required: true,
311
+ schema: {
312
+ minimum: 0,
313
+ },
314
+ })
315
+
316
+ reservationEntity.addProperty({
317
+ info: { name: 'reservation_type', displayName: 'Reservation Type', description: 'Type of reservation' },
318
+ type: 'string',
319
+ required: true,
320
+ schema: {
321
+ enum: ['direct', 'ota', 'corporate', 'group', 'package'],
322
+ },
323
+ })
324
+
325
+ addCurrencyAmountField(reservationEntity, 'total_amount', 'Total Amount', {
326
+ description: 'Total reservation amount',
327
+ })
328
+
329
+ addCustomStatusField(reservationEntity, ['confirmed', 'pending', 'cancelled', 'checked_in', 'checked_out'], {
330
+ displayName: 'Reservation Status',
331
+ description: 'Current status of the reservation',
332
+ })
333
+
334
+ addCreatedAtField(reservationEntity, { description: 'When the reservation was created' })
335
+
336
+ // Reservation-Guest Association (Many-to-One)
337
+ reservationEntity.addAssociation(
338
+ { key: guestEntity.key },
339
+ {
340
+ info: { name: 'guest', displayName: 'Guest', description: 'Guest for this reservation' },
341
+ required: true,
342
+ multiple: false,
343
+ }
344
+ )
345
+
346
+ // Room Rate Entity
347
+ const roomRateEntity = reservationModel.addEntity({
348
+ info: {
349
+ name: 'room_rate',
350
+ displayName: 'Room Rate',
351
+ description: 'Room pricing and rate management',
352
+ },
353
+ })
354
+
355
+ addIdField(roomRateEntity, { displayName: 'Rate ID', description: 'Unique identifier for the room rate' })
356
+
357
+ addNameField(roomRateEntity, { description: 'Rate name and description' })
358
+
359
+ roomRateEntity.addProperty({
360
+ info: { name: 'rate_type', displayName: 'Rate Type', description: 'Type of room rate' },
361
+ type: 'string',
362
+ required: true,
363
+ schema: {
364
+ enum: ['rack', 'corporate', 'package', 'promotional', 'seasonal'],
365
+ },
366
+ })
367
+
368
+ roomRateEntity.addProperty({
369
+ info: { name: 'start_date', displayName: 'Start Date', description: 'Rate start date' },
370
+ type: 'date',
371
+ required: true,
372
+ })
373
+
374
+ roomRateEntity.addProperty({
375
+ info: { name: 'end_date', displayName: 'End Date', description: 'Rate end date' },
376
+ type: 'date',
377
+ required: true,
378
+ })
379
+
380
+ addCurrencyAmountField(roomRateEntity, 'base_rate', 'Base Rate', {
381
+ description: 'Base room rate',
382
+ })
383
+
384
+ addCustomStatusField(roomRateEntity, ['active', 'inactive', 'expired'], {
385
+ displayName: 'Rate Status',
386
+ description: 'Current status of the room rate',
387
+ })
388
+
389
+ addCreatedAtField(roomRateEntity, { description: 'When the room rate was created' })
390
+
391
+ //
392
+ // 3. PROPERTY MANAGEMENT NAMESPACE
393
+ //
394
+ const propertyManagement = domain.addNamespace({
395
+ info: {
396
+ name: 'PropertyManagement',
397
+ displayName: 'Property Management',
398
+ description: 'Rooms, amenities, and housekeeping management',
399
+ },
400
+ })
401
+
402
+ // Property Model
403
+ const propertyModel = propertyManagement.addModel({
404
+ info: {
405
+ name: 'Property',
406
+ displayName: 'Property Management',
407
+ description: 'Property and room management',
408
+ },
409
+ })
410
+
411
+ // Room Entity
412
+ const roomEntity = propertyModel.addEntity({
413
+ info: {
414
+ name: 'room',
415
+ displayName: 'Room',
416
+ description: 'Hotel room with amenities and status',
417
+ },
418
+ })
419
+
420
+ addIdField(roomEntity, { displayName: 'Room ID', description: 'Unique identifier for the room' })
421
+
422
+ addNameField(roomEntity, { description: 'Room name and number' })
423
+
424
+ addDescriptionField(roomEntity, { description: 'Room description and features' })
425
+
426
+ roomEntity.addProperty({
427
+ info: { name: 'room_type', displayName: 'Room Type', description: 'Type of room' },
428
+ type: 'string',
429
+ required: true,
430
+ schema: {
431
+ enum: ['standard', 'deluxe', 'suite', 'presidential', 'accessible'],
432
+ },
433
+ })
434
+
435
+ roomEntity.addProperty({
436
+ info: { name: 'floor', displayName: 'Floor', description: 'Room floor number' },
437
+ type: 'number',
438
+ required: true,
439
+ schema: {
440
+ minimum: 1,
441
+ },
442
+ })
443
+
444
+ roomEntity.addProperty({
445
+ info: { name: 'capacity', displayName: 'Capacity', description: 'Room guest capacity' },
446
+ type: 'number',
447
+ required: true,
448
+ schema: {
449
+ minimum: 1,
450
+ },
451
+ })
452
+
453
+ addCustomStatusField(roomEntity, ['available', 'occupied', 'maintenance', 'out_of_order'], {
454
+ displayName: 'Room Status',
455
+ description: 'Current status of the room',
456
+ })
457
+
458
+ addCreatedAtField(roomEntity, { description: 'When the room was created' })
459
+ addUpdatedAtField(roomEntity, { description: 'When the room was last updated' })
460
+
461
+ // Amenity Entity
462
+ const amenityEntity = propertyModel.addEntity({
463
+ info: {
464
+ name: 'amenity',
465
+ displayName: 'Amenity',
466
+ description: 'Hotel amenities and services',
467
+ },
468
+ })
469
+
470
+ addIdField(amenityEntity, { displayName: 'Amenity ID', description: 'Unique identifier for the amenity' })
471
+
472
+ addNameField(amenityEntity, { description: 'Amenity name and description' })
473
+
474
+ addDescriptionField(amenityEntity, { description: 'Amenity description and features' })
475
+
476
+ amenityEntity.addProperty({
477
+ info: { name: 'amenity_type', displayName: 'Amenity Type', description: 'Type of amenity' },
478
+ type: 'string',
479
+ required: true,
480
+ schema: {
481
+ enum: ['room', 'hotel', 'recreation', 'business', 'wellness'],
482
+ },
483
+ })
484
+
485
+ amenityEntity.addProperty({
486
+ info: { name: 'location', displayName: 'Location', description: 'Amenity location' },
487
+ type: 'string',
488
+ required: true,
489
+ })
490
+
491
+ addCustomStatusField(amenityEntity, ['available', 'maintenance', 'closed'], {
492
+ displayName: 'Amenity Status',
493
+ description: 'Current status of the amenity',
494
+ })
495
+
496
+ addCreatedAtField(amenityEntity, { description: 'When the amenity was created' })
497
+
498
+ // Housekeeping Task Entity
499
+ const housekeepingTaskEntity = propertyModel.addEntity({
500
+ info: {
501
+ name: 'housekeeping_task',
502
+ displayName: 'Housekeeping Task',
503
+ description: 'Housekeeping tasks and room cleaning',
504
+ },
505
+ })
506
+
507
+ addIdField(housekeepingTaskEntity, {
508
+ displayName: 'Task ID',
509
+ description: 'Unique identifier for the housekeeping task',
510
+ })
511
+
512
+ addNameField(housekeepingTaskEntity, { description: 'Task name and description' })
513
+
514
+ housekeepingTaskEntity.addProperty({
515
+ info: { name: 'task_type', displayName: 'Task Type', description: 'Type of housekeeping task' },
516
+ type: 'string',
517
+ required: true,
518
+ schema: {
519
+ enum: ['daily_cleaning', 'turnover', 'deep_cleaning', 'maintenance', 'inspection'],
520
+ },
521
+ })
522
+
523
+ housekeepingTaskEntity.addProperty({
524
+ info: { name: 'assigned_to', displayName: 'Assigned To', description: 'Staff member assigned to task' },
525
+ type: 'string',
526
+ required: true,
527
+ })
528
+
529
+ housekeepingTaskEntity.addProperty({
530
+ info: { name: 'scheduled_time', displayName: 'Scheduled Time', description: 'Scheduled task time' },
531
+ type: 'datetime',
532
+ required: true,
533
+ })
534
+
535
+ addCustomStatusField(housekeepingTaskEntity, ['pending', 'in_progress', 'completed', 'cancelled'], {
536
+ displayName: 'Task Status',
537
+ description: 'Current status of the housekeeping task',
538
+ })
539
+
540
+ addCreatedAtField(housekeepingTaskEntity, { description: 'When the task was created' })
541
+
542
+ // HousekeepingTask-Room Association (Many-to-One)
543
+ housekeepingTaskEntity.addAssociation(
544
+ { key: roomEntity.key },
545
+ {
546
+ info: { name: 'room', displayName: 'Room', description: 'Room for this housekeeping task' },
547
+ required: true,
548
+ multiple: false,
549
+ }
550
+ )
551
+
552
+ // Reservation-Room Association (Many-to-One)
553
+ reservationEntity.addAssociation(
554
+ { key: roomEntity.key },
555
+ {
556
+ info: { name: 'room', displayName: 'Room', description: 'Room for this reservation' },
557
+ required: true,
558
+ multiple: false,
559
+ }
560
+ )
561
+
562
+ //
563
+ // 4. SERVICE MANAGEMENT NAMESPACE
564
+ //
565
+ const serviceManagement = domain.addNamespace({
566
+ info: {
567
+ name: 'ServiceManagement',
568
+ displayName: 'Service Management',
569
+ description: 'Concierge, room service, and activities management',
570
+ },
571
+ })
572
+
573
+ // Service Model
574
+ const serviceModel = serviceManagement.addModel({
575
+ info: {
576
+ name: 'Services',
577
+ displayName: 'Service Management',
578
+ description: 'Guest services and activities',
579
+ },
580
+ })
581
+
582
+ // Service Request Entity
583
+ const serviceRequestEntity = serviceModel.addEntity({
584
+ info: {
585
+ name: 'service_request',
586
+ displayName: 'Service Request',
587
+ description: 'Guest service requests and orders',
588
+ },
589
+ })
590
+
591
+ addIdField(serviceRequestEntity, {
592
+ displayName: 'Request ID',
593
+ description: 'Unique identifier for the service request',
594
+ })
595
+
596
+ addNameField(serviceRequestEntity, { description: 'Service request description' })
597
+
598
+ serviceRequestEntity.addProperty({
599
+ info: { name: 'service_type', displayName: 'Service Type', description: 'Type of service requested' },
600
+ type: 'string',
601
+ required: true,
602
+ schema: {
603
+ enum: ['concierge', 'room_service', 'housekeeping', 'maintenance', 'transportation'],
604
+ },
605
+ })
606
+
607
+ serviceRequestEntity.addProperty({
608
+ info: { name: 'priority', displayName: 'Priority', description: 'Request priority level' },
609
+ type: 'string',
610
+ required: true,
611
+ schema: {
612
+ enum: ['low', 'medium', 'high', 'urgent'],
613
+ },
614
+ })
615
+
616
+ serviceRequestEntity.addProperty({
617
+ info: { name: 'requested_time', displayName: 'Requested Time', description: 'Time service was requested' },
618
+ type: 'datetime',
619
+ required: true,
620
+ })
621
+
622
+ addCustomStatusField(serviceRequestEntity, ['pending', 'in_progress', 'completed', 'cancelled'], {
623
+ displayName: 'Request Status',
624
+ description: 'Current status of the service request',
625
+ })
626
+
627
+ addCreatedAtField(serviceRequestEntity, { description: 'When the service request was created' })
628
+
629
+ // ServiceRequest-Guest Association (Many-to-One)
630
+ serviceRequestEntity.addAssociation(
631
+ { key: guestEntity.key },
632
+ {
633
+ info: { name: 'guest', displayName: 'Guest', description: 'Guest for this service request' },
634
+ required: true,
635
+ multiple: false,
636
+ }
637
+ )
638
+
639
+ // ServiceRequest-Room Association (Many-to-One)
640
+ serviceRequestEntity.addAssociation(
641
+ { key: roomEntity.key },
642
+ {
643
+ info: { name: 'room', displayName: 'Room', description: 'Room for this service request' },
644
+ required: true,
645
+ multiple: false,
646
+ }
647
+ )
648
+
649
+ // Activity Entity
650
+ const activityEntity = serviceModel.addEntity({
651
+ info: {
652
+ name: 'activity',
653
+ displayName: 'Activity',
654
+ description: 'Hotel activities and events',
655
+ },
656
+ })
657
+
658
+ addIdField(activityEntity, { displayName: 'Activity ID', description: 'Unique identifier for the activity' })
659
+
660
+ addNameField(activityEntity, { description: 'Activity name and description' })
661
+
662
+ addDescriptionField(activityEntity, { description: 'Activity description and details' })
663
+
664
+ activityEntity.addProperty({
665
+ info: { name: 'activity_type', displayName: 'Activity Type', description: 'Type of activity' },
666
+ type: 'string',
667
+ required: true,
668
+ schema: {
669
+ enum: ['recreation', 'entertainment', 'wellness', 'business', 'cultural'],
670
+ },
671
+ })
672
+
673
+ activityEntity.addProperty({
674
+ info: { name: 'start_time', displayName: 'Start Time', description: 'Activity start time' },
675
+ type: 'datetime',
676
+ required: true,
677
+ })
678
+
679
+ activityEntity.addProperty({
680
+ info: { name: 'end_time', displayName: 'End Time', description: 'Activity end time' },
681
+ type: 'datetime',
682
+ required: true,
683
+ })
684
+
685
+ activityEntity.addProperty({
686
+ info: { name: 'capacity', displayName: 'Capacity', description: 'Activity capacity' },
687
+ type: 'number',
688
+ required: true,
689
+ schema: {
690
+ minimum: 1,
691
+ },
692
+ })
693
+
694
+ addCustomStatusField(activityEntity, ['scheduled', 'in_progress', 'completed', 'cancelled'], {
695
+ displayName: 'Activity Status',
696
+ description: 'Current status of the activity',
697
+ })
698
+
699
+ addCreatedAtField(activityEntity, { description: 'When the activity was created' })
700
+
701
+ //
702
+ // 5. REVENUE MANAGEMENT NAMESPACE
703
+ //
704
+ const revenueManagement = domain.addNamespace({
705
+ info: {
706
+ name: 'RevenueManagement',
707
+ displayName: 'Revenue Management',
708
+ description: 'Pricing, promotions, and revenue optimization',
709
+ },
710
+ })
711
+
712
+ // Revenue Model
713
+ const revenueModel = revenueManagement.addModel({
714
+ info: {
715
+ name: 'Revenue',
716
+ displayName: 'Revenue Management',
717
+ description: 'Revenue optimization and pricing',
718
+ },
719
+ })
720
+
721
+ // Promotion Entity
722
+ const promotionEntity = revenueModel.addEntity({
723
+ info: {
724
+ name: 'promotion',
725
+ displayName: 'Promotion',
726
+ description: 'Hotel promotions and special offers',
727
+ },
728
+ })
729
+
730
+ addIdField(promotionEntity, { displayName: 'Promotion ID', description: 'Unique identifier for the promotion' })
731
+
732
+ addNameField(promotionEntity, { description: 'Promotion name and description' })
733
+
734
+ addDescriptionField(promotionEntity, { description: 'Promotion details and terms' })
735
+
736
+ promotionEntity.addProperty({
737
+ info: { name: 'promotion_type', displayName: 'Promotion Type', description: 'Type of promotion' },
738
+ type: 'string',
739
+ required: true,
740
+ schema: {
741
+ enum: ['discount', 'package', 'loyalty', 'seasonal', 'corporate'],
742
+ },
743
+ })
744
+
745
+ promotionEntity.addProperty({
746
+ info: { name: 'start_date', displayName: 'Start Date', description: 'Promotion start date' },
747
+ type: 'date',
748
+ required: true,
749
+ })
750
+
751
+ promotionEntity.addProperty({
752
+ info: { name: 'end_date', displayName: 'End Date', description: 'Promotion end date' },
753
+ type: 'date',
754
+ required: true,
755
+ })
756
+
757
+ promotionEntity.addProperty({
758
+ info: { name: 'discount_percentage', displayName: 'Discount Percentage', description: 'Discount percentage' },
759
+ type: 'number',
760
+ required: false,
761
+ schema: {
762
+ minimum: 0,
763
+ maximum: 100,
764
+ },
765
+ })
766
+
767
+ addCustomStatusField(promotionEntity, ['active', 'inactive', 'expired'], {
768
+ displayName: 'Promotion Status',
769
+ description: 'Current status of the promotion',
770
+ })
771
+
772
+ addCreatedAtField(promotionEntity, { description: 'When the promotion was created' })
773
+
774
+ // Revenue Report Entity
775
+ const revenueReportEntity = revenueModel.addEntity({
776
+ info: {
777
+ name: 'revenue_report',
778
+ displayName: 'Revenue Report',
779
+ description: 'Revenue reports and analytics',
780
+ },
781
+ })
782
+
783
+ addIdField(revenueReportEntity, {
784
+ displayName: 'Report ID',
785
+ description: 'Unique identifier for the revenue report',
786
+ })
787
+
788
+ addNameField(revenueReportEntity, { description: 'Report name and description' })
789
+
790
+ revenueReportEntity.addProperty({
791
+ info: { name: 'report_type', displayName: 'Report Type', description: 'Type of revenue report' },
792
+ type: 'string',
793
+ required: true,
794
+ schema: {
795
+ enum: ['daily', 'weekly', 'monthly', 'quarterly', 'annual'],
796
+ },
797
+ })
798
+
799
+ revenueReportEntity.addProperty({
800
+ info: { name: 'report_date', displayName: 'Report Date', description: 'Report date' },
801
+ type: 'date',
802
+ required: true,
803
+ })
804
+
805
+ addCurrencyAmountField(revenueReportEntity, 'total_revenue', 'Total Revenue', {
806
+ description: 'Total revenue for the period',
807
+ })
808
+
809
+ addCurrencyAmountField(revenueReportEntity, 'average_daily_rate', 'Average Daily Rate', {
810
+ description: 'Average daily room rate',
811
+ })
812
+
813
+ addCurrencyAmountField(revenueReportEntity, 'occupancy_rate', 'Occupancy Rate', {
814
+ description: 'Room occupancy rate percentage',
815
+ })
816
+
817
+ addCustomStatusField(revenueReportEntity, ['draft', 'final', 'archived'], {
818
+ displayName: 'Report Status',
819
+ description: 'Current status of the revenue report',
820
+ })
821
+
822
+ addCreatedAtField(revenueReportEntity, { description: 'When the revenue report was created' })
823
+
824
+ //
825
+ // 6. OPERATIONS NAMESPACE
826
+ //
827
+ const operations = domain.addNamespace({
828
+ info: {
829
+ name: 'Operations',
830
+ displayName: 'Operations',
831
+ description: 'Staff scheduling, maintenance, and security',
832
+ },
833
+ })
834
+
835
+ // Operations Model
836
+ const operationsModel = operations.addModel({
837
+ info: {
838
+ name: 'Operations',
839
+ displayName: 'Operations Management',
840
+ description: 'Hotel operations and staff management',
841
+ },
842
+ })
843
+
844
+ // Staff Entity
845
+ const staffEntity = operationsModel.addEntity({
846
+ info: {
847
+ name: 'staff',
848
+ displayName: 'Staff',
849
+ description: 'Hotel staff and employees',
850
+ },
851
+ })
852
+
853
+ addIdField(staffEntity, { displayName: 'Staff ID', description: 'Unique identifier for the staff member' })
854
+
855
+ addNameField(staffEntity, { description: 'Staff name and title' })
856
+
857
+ addEmailField(staffEntity, { description: 'Staff email address' })
858
+
859
+ addPhoneField(staffEntity, { description: 'Staff phone number' })
860
+
861
+ staffEntity.addProperty({
862
+ info: { name: 'department', displayName: 'Department', description: 'Staff department' },
863
+ type: 'string',
864
+ required: true,
865
+ schema: {
866
+ enum: ['front_office', 'housekeeping', 'food_beverage', 'maintenance', 'security', 'management'],
867
+ },
868
+ })
869
+
870
+ staffEntity.addProperty({
871
+ info: { name: 'position', displayName: 'Position', description: 'Staff position' },
872
+ type: 'string',
873
+ required: true,
874
+ })
875
+
876
+ staffEntity.addProperty({
877
+ info: { name: 'hire_date', displayName: 'Hire Date', description: 'Staff hire date' },
878
+ type: 'date',
879
+ required: true,
880
+ })
881
+
882
+ addCustomStatusField(staffEntity, ['active', 'inactive', 'on_leave', 'terminated'], {
883
+ displayName: 'Staff Status',
884
+ description: 'Current status of the staff member',
885
+ })
886
+
887
+ addCreatedAtField(staffEntity, { description: 'When the staff record was created' })
888
+ addUpdatedAtField(staffEntity, { description: 'When the staff record was last updated' })
889
+
890
+ // Staff Schedule Entity
891
+ const staffScheduleEntity = operationsModel.addEntity({
892
+ info: {
893
+ name: 'staff_schedule',
894
+ displayName: 'Staff Schedule',
895
+ description: 'Staff scheduling and shift management',
896
+ },
897
+ })
898
+
899
+ addIdField(staffScheduleEntity, {
900
+ displayName: 'Schedule ID',
901
+ description: 'Unique identifier for the staff schedule',
902
+ })
903
+
904
+ staffScheduleEntity.addProperty({
905
+ info: { name: 'shift_type', displayName: 'Shift Type', description: 'Type of work shift' },
906
+ type: 'string',
907
+ required: true,
908
+ schema: {
909
+ enum: ['morning', 'afternoon', 'night', 'split', 'overtime'],
910
+ },
911
+ })
912
+
913
+ staffScheduleEntity.addProperty({
914
+ info: { name: 'start_time', displayName: 'Start Time', description: 'Shift start time' },
915
+ type: 'datetime',
916
+ required: true,
917
+ })
918
+
919
+ staffScheduleEntity.addProperty({
920
+ info: { name: 'end_time', displayName: 'End Time', description: 'Shift end time' },
921
+ type: 'datetime',
922
+ required: true,
923
+ })
924
+
925
+ addCustomStatusField(staffScheduleEntity, ['scheduled', 'in_progress', 'completed', 'cancelled'], {
926
+ displayName: 'Schedule Status',
927
+ description: 'Current status of the staff schedule',
928
+ })
929
+
930
+ addCreatedAtField(staffScheduleEntity, { description: 'When the schedule was created' })
931
+
932
+ // StaffSchedule-Staff Association (Many-to-One)
933
+ staffScheduleEntity.addAssociation(
934
+ { key: staffEntity.key },
935
+ {
936
+ info: { name: 'staff', displayName: 'Staff', description: 'Staff member for this schedule' },
937
+ required: true,
938
+ multiple: false,
939
+ }
940
+ )
941
+
942
+ // Maintenance Request Entity
943
+ const maintenanceRequestEntity = operationsModel.addEntity({
944
+ info: {
945
+ name: 'maintenance_request',
946
+ displayName: 'Maintenance Request',
947
+ description: 'Property maintenance requests',
948
+ },
949
+ })
950
+
951
+ addIdField(maintenanceRequestEntity, {
952
+ displayName: 'Maintenance ID',
953
+ description: 'Unique identifier for the maintenance request',
954
+ })
955
+
956
+ addNameField(maintenanceRequestEntity, { description: 'Maintenance request description' })
957
+
958
+ maintenanceRequestEntity.addProperty({
959
+ info: { name: 'maintenance_type', displayName: 'Maintenance Type', description: 'Type of maintenance' },
960
+ type: 'string',
961
+ required: true,
962
+ schema: {
963
+ enum: ['preventive', 'corrective', 'emergency', 'inspection'],
964
+ },
965
+ })
966
+
967
+ maintenanceRequestEntity.addProperty({
968
+ info: { name: 'priority', displayName: 'Priority', description: 'Maintenance priority level' },
969
+ type: 'string',
970
+ required: true,
971
+ schema: {
972
+ enum: ['low', 'medium', 'high', 'critical'],
973
+ },
974
+ })
975
+
976
+ addCustomStatusField(maintenanceRequestEntity, ['pending', 'in_progress', 'completed', 'cancelled'], {
977
+ displayName: 'Maintenance Status',
978
+ description: 'Current status of the maintenance request',
979
+ })
980
+
981
+ addCreatedAtField(maintenanceRequestEntity, { description: 'When the maintenance request was created' })
982
+
983
+ // MaintenanceRequest-Room Association (Many-to-One)
984
+ maintenanceRequestEntity.addAssociation(
985
+ { key: roomEntity.key },
986
+ {
987
+ info: { name: 'room', displayName: 'Room', description: 'Room for this maintenance request' },
988
+ required: false,
989
+ multiple: false,
990
+ }
991
+ )
992
+
993
+ return domain
994
+ }