-
Notifications
You must be signed in to change notification settings - Fork 0
/
sizzler-odl.txt
566 lines (454 loc) · 24.4 KB
/
sizzler-odl.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
class BranchOpenTime{
attribute enum DayOfWeek {
'monday', 'tuesday', 'wednesday',
'thursday', 'friday', 'saturday',
'sunday'} dayOfWeek;
attribute time timeOpening;
attribute time timeClosing;
};
class Branch(extent branches key branchId){
attribute string branchId;
attribute string name;
attribute struct Address {
string province,
string fullAddress,
float coordinateLatitude,
float coordinateLongitude
} address;
attribute list<string> telephoneNumber;
attribute string email;
attribute date establishingDate;
attribute enum BranchStatus{
'normally operational',
'under maintenance',
'out-of-business' } status;
attribute set<BranchOpenTime> openTime;
attribute set<Table> tables;
relationship set<Employee> operatedBy inverse Employee::worksAt;
relationship SaladBar offersSaladBar inverse SaladBar::offeredBy;
relationship set<ComputerMachine> deploysComputerMachine inverse ComputerMachine::deployedBy;
relationship set<CustomerDelivery> handlesCustomerDelivery inverse CustomerDelivery::handledBy;
relationship set<MemberCustomer> locatedNear inverse MemberCustomer::livesNear;
relationship set<InventoryInboundOrder> ownsInventoryOrder inverse InventoryInboundOrder::ownedBy;
relationship set<MenuRef> menuOffers inverse MenuRef::menuOfferedBy;
void updateStatus(in BranchStatus status);
void printBranchSummary();
};
class SaladBar(extent saladBars key saladBarId){
attribute string saladBarId;
relationship Branch offeredBy inverse Branch::offersSaladBar;
relationship set<SaladBarServing> leadsTo inverse SaladBarServing::causedBy;
void summarizeIngredientUsage()
};
class ComputerMachine(extent computerMachines key computerMachineId){
attribute string computerMachineId;
attribute string macAddress;
attribute string serialNumber;
attribute timestamp deploymentTimestamp;
relationship Branch deployedBy inverse Branch::deploysComputerMachine;
};
class TimeAttendanceMachine extends ComputerMachine(extent timeAttendanceMachines){
attribute boolean isSupportFingerprintBiometric;
relationship set<ClockInOut> relatesTo inverse ClockInOut::performedAt;
};
class Employee(extent employees key employeeId){
attribute string employeeId;
attribute string firstname;
attribute string surname;
attribute string nickname;
attribute string email;
attribute set<string> telephoneNo;
attribute enum EducationLevel {
'Vocational Certificate',
'High Vocational Certificate',
'High School',
'Primary School'} educationLevel;
attribute struct Address {
string province,
string fullAddress} address;
attribute enum Gender {
'male', 'female'} gender;
attribute string citizenId;
attribute date joinDate;
attribute date birthdate;
attribute float wage;
attribute set<WorkTime> workTimes;
relationship Branch worksAt inverse Branch::operatedBy;
relationship set<ClockInOut> performs inverse ClockInOut::performedBy;
relationship set<EmployeeWagePayment> getsPaidVia inverse EmployeeWagePayment::paysTo;
relationship set<SaladBarRefill> carriesOut inverse SaladBarRefill::carriedOutBy;
float summarizeWageToPay();
void summarizeWorkAttendance();
boolean assignRole(in string role) raises(InvalidRoleArgumentException);
boolean unassignRole(in string role) raises(InvalidRoleArgumentException, NoRoleToUnassignException);
boolean checkInWork();
boolean checkOutWork();
};
class Waiter extends Employee(extent waiters){
attribute set<string> languageFluency;
relationship Order handles inverse Order::handledBy;
};
class KitchenPorter extends Employee(extent kitchenPorters){};
class ChefCookingRole{
attribute string name;
attribute string description;
attribute enum Priority {'low',
'medium', 'high'} priority;
};
class Chef extends Employee(extent chefs){
attribute set<ChefCookingRole> cookingRole;
};
class Cashier extends Employee(extent cashiers){
relationship set<CashierBillingHandling> participates inverse CashierBillingHandling::participatedBy;
boolean loginToCashierSystem();
boolean logoutFromCashierSystem();
};
class KitchenManager extends Employee(extent kitchenManagers){
relationship set<InventoryInboundOrder> manages inverse InventoryInboundOrder::managedBy;
void summarizeInvolvedIngredientTx();
};
class DeliveryMan extends Employee(extent deliveryMen){
attribute string timeUsed;
attribute float distanceKM;
relationship set<BillingDelivery> deliverItemsFor inverse BillingDelivery::deliveredBy;
boolean acceptDeliveryJob(in BillingDelivery billingDelivery)
};
class EmployeeWagePayment(extent employeeWagePayments){
attribute float wagePaymentAmount
attribute timestamp timestamp;
relationship BranchManager madeBy inverse BranchManager::makes;
relationship Employee paysTo inverse Employee::getsPaidVia;
};
class BranchManager extends Employee(extent branchManagers){
relationship set<EmployeeWagePayment> makes inverse EmployeeWagePayment::madeBy;
};
class ClockInOut(extent clockInOuts key clockInTimestamp){
attribute timestamp clockInTimestamp;
attribute timestamp clockOutTimestamp;
relationship TimeAttendanceMachine performedAt inverse TimeAttendanceMachine::relatesTo;
relationship Employee performedBy inverse Employee::performs;
relationship WorkTime involvedWith inverse WorkTime::involves;
};
class CashierMachine extends ComputerMachine(extent cashierMachines){
relationship set<CashierBillingHandling> involvedIn inverse CashierBillingHandling::involves;
};
interface CustomerInstance{
attribute string custInstanceId;
void addOrder(in Order order) raises(OrderAlreadyExistedException, MalformedOrderException);
};
class CustomerPax : CustomerInstance (extent customerPaxes key custInstanceId){
attribute short totalCustomers;
relationship Table uses inverse Table::isUsedBy;
relationship set<Order> creates inverse Order::createdByOnSite;
relationship BillingOnSite owns inverse BillingOnSite::ownedBy;
};
class CustomerDelivery : CustomerInstance(extent customerDeliveries key custInstanceId){
attribute string telephoneNo;
attribute string fullAddress;
attribute string province;
relationship Branch handledBy inverse Branch::handlesCustomerDelivery;
relationship Order creates inverse Order::createdByDelivery;
relationship BillingDelivery responsibleFor inverse BillingDelivery::responsibleBy;
};
class Table(key tableId){
attribute short tableId;
relationship set<CustomerPax> isUsedBy inverse CustomerPax::uses;
};
class Order (extent orders key orderId){
attribute string orderId;
attribute timestamp timeCreated;
attribute string note;
relationship CustomerPax createdByOnSite inverse CustomerPax::creates;
relationship CustomerDelivery createdByDelivery inverse CustomerDelivery::creates;
relationship Waiter handledBy inverse Waiter::handlesOrder;
relationship set<OrderItem> includes inverse OrderItem::includedIn;
void summarizeOrder();
void addFoodOrder(in OrderItem orderItem);
};
class WorkTime (extent workTimes key workTimeId){
attribute int workTimeId;
attribute enum DayOfWeek {
'monday', 'tuesday', 'wednesday',
'thursday', 'friday', 'saturday',
'sunday'} dayOfWeek;
attribute time timeStart;
attribute time timeEnd;
attribute boolean isPartTime;
relationship set<ClockInOut> involves inverse ClockInOut::involvedWith;
};
class MemberCustomer(extent memberCustomers key memberCustomerId){
attribute string memberCustomerId;
attribute string firstname;
attribute string surname;
attribute string telephoneNo;
attribute date birthdate;
attribute string hashedPwd;
attribute string salt;
attribute string email;
attribute timestamp registrationTimestamp;
attribute enum Gender {
'male', 'female'} gender;
relationship Branch livesNear inverse Branch::locatedNear;
relationship set<CustomerRewardRedemption> creates inverse CustomerRewardRedemption::createdBy;
relationship set<Billing> involves inverse Billing::involvedWith;
relationship set<MemberLevelGrant> involvedWith inverse MemberCustomer::grantedTo;
boolean updatePassword(in string password) raises(MalformedPasswordException,
TooShortPasswordException, TooLongPasswordException,
WeakPasswordException);
};
class MemberLevelGrant(extend memberLevelGrants){
attribute timestamp timestamp;
relationship MemberCustomer grantedTo inverse MemberCustomer::involvedWith;
relationship MemberLevelRef refers inverse MemberLevelRef::referredBy;
};
class CustomerRewardRedemption(extent customerRewardRedemptions){
attribute timestamp timestamp;
attribute short pointSpent;
relationship MemberCustomer createdBy inverse MemberCustomer::creates;
relationship RedeemableRewardRef isBasedOn inverse RedeemableRewardRef::leadsTo;
};
class MemberLevelRef(extent memberLevelRefs key memberLevelRefId){
attribute string memberLevelRefId;
attribute string name;
attribute string description;
attribute short pointThreshold;
relationship set<RedeemableRewardRef> offers inverse RedeemableRewardRef::offeredBy;
relationship set<MemberLevelGrant> referredBy inverse MemberLevelRef::refers;
}
class RedeemableRewardRef(extent redeemableRewards key redeemableRewardRefId){
attribute string redeemableRewardRefId;
attribute string name;
attribute string description;
attribute short basePointRequired;
attribute boolean isInUse;
relationship set<CustomerRewardRedemption> leadsTo inverse CustomerRewardRedemption::isBasedOn;
relationship set<MemberLevelRef> offeredBy inverse MemberLevelRef::offers;
void summarizeUsage();
};
class Billing(extent billings key billingId){
attribute string billingId;
attribute string taxInvoiceId;
attribute timestamp timeCreated;
attribute timestamp timePaid;
attribute timestamp timeCanceled;
attribute short pointReceived;
attribute timestamp pointExpirationTime;
attribute set<Order> orders;
relationship MemberCustomer involvedWith inverse MemberCustomer::involves;
relationship set<PaymentTransaction> involves inverse PaymentTransaction::involvedBy;
void summarize();
boolean cancelBilling() raises(CannotCancelBillException);
void verifyRelatedTransactions() raises(NoVerifiableTransactionException);
boolean addPaymentTransaction(in PaymentTransaction tx) raises(InvalidTransactionException);
boolean bindToMemberCustomer(in MemberCustomer memberCustomer) raises(NoSuchMemberCustomerException);
};
class BillingOnSite extends Billing(extent billingOnSite){
relationship CashierBillingHandling needs inverse CashierBillingHandling::needed;
relationship CustomerPax ownedBy inverse CustomerPax::owns;
};
class BillingDelivery extends Billing(extent billingDelivery){
relationship DeliveryMan deliveredBy inverse DeliveryMan::deliverItemsFor;
relationship CustomerPax responsibleBy inverse CustomerPax::responsibleFor;
};
class CashierBillingHandling(extent cashierBillingHandlings){
relationship Cashier participatedBy inverse Cashier::participates;
relationship CashierMachine involves inverse CashierMachine::involvedIn;
relationship BillingOnSite needed inverse BillingOnSite::needs;
};
class InventoryInboundOrder(extent inventoryInboundOrders key inboundOrderId){
attribute long inboundOrderId;
attribute timestamp timeCreated;
attribute timestamp timeDelivered;
attribute timestamp timeCanceled;
attribute string note;
attribute string deliverIn;
attribute set<InventoryInboundOrderItem> items;
relationship KitchenManager managedBy inverse KitchenManager::manages;
relationship Branch ownedBy inverse Branch::ownsInventoryOrder;
void cancel();
boolean markAsDelivered();
};
class InventoryInboundOrderItem(key inboundOrderItemId){
attribute string inboundOrderItemId;
attribute timestamp verificationTime;
attribute short quantity;
attribute string quantityUnit;
attribute short pricePerUnit;
relationship FoodIngredientRef involves inverse FoodIngredientRef::involvedWith;
};
interface PaymentTransaction{
attribute string paymentTransactionId;
attribute timestamp timestamp;
relationship Billing involvedBy inverse Billing::involves;
void verifyValidity() raises(InvalidPaymentTransactionException);
};
class CashTransaction : PaymentTransaction(extent cashTransactions key paymentTransactionId){
attribute float amount;
};
class CreditTransaction : PaymentTransaction(extent creditTransactions key paymentTransactionId){
attribute string cardNumber;
attribute float amount;
};
class GiftVoucherTransaction : PaymentTransaction(extent giftVoucherTransactions key paymentTransactionId){
relationship GiftVoucher consequenceOf inverse GiftVoucher::leadsTo;
};
class GiftVoucherRef(extent giftVoucherRefs key giftVoucherRefId){
attribute long giftVoucherRefId;
attribute string name;
attribute string description;
attribute timestamp timeAdded;
attribute timestamp timeCanceled;
attribute short valueAmount;
attribute string lifetime;
relationship set<GiftVoucher> giftVoucherNo inverse GiftVoucher::refersTo;
void summarizeOverVoucherLevelUsage()
void cancelVoucherUsage()
};
class GiftVoucher(extent giftVouchers key giftVoucherId){
attribute long giftVoucherNo;
attribute timestamp timeIssued;
relationship GiftVoucherRef refersTo inverse GiftVoucherRef::referredBy;
relationship GiftVoucherTransaction leadsTo inverse GiftVoucherTransaction::consequenceOf;
};
class OrderItem(extent orderItems key orderItemId){
attribute long orderItemId;
attribute short quantity;
attribute timestamp timeStarted;
attribute timestamp timeServed;
attribute float perUnitPrice;
attribute float perUnitDiscount;
attribute float perUnitTakeHomeFee;
attribute boolean isRefunded;
relationship MenuRef refersTo inverse MenuRef::referredBy;
relationship Order includedIn inverse Order::includes;
relationship set<MenuServingCustomization> tiedWith inverse MenuServingCustomization::tiesTo;
void markAsServed() raises(OrderItemAlreadyServedException, OutOfTimeWindowException);
void markAsRefunded() raises(OrderItemAlreadyRefundedException, OutOfTimeWindowException);
boolean customizeServing(in MenuServingCustomization customization) raises(IllegalMenuCustomizationException);
};
class SeasonRef(extent seasonRefs key seasonRefId){
attribute long seasonRefId;
attribute string name;
attribute date dateStart;
attribute date dateEnd;
relationship set<MenuRef> dependedBy inverse MenuRef::dependsOnSeason;
};
class MenuAvailability(extent menuAvailability key menuAvailabilityId){
attribute long menuAvailabilityId;
attribute enum DayOfWeek {
'monday', 'tuesday', 'wednesday',
'thursday', 'friday', 'saturday',
'sunday'} dayOfWeek;
attribute time timeRangeStart;
attribute time timeRangeEnd;
relationship MenuRef dependedBy inverse MenuRef::dependsOnAvailability;
};
class MenuRef(extent menuRefs key menuRefId){
attribute long menuRefId;
attribute string nameEng;
attribute string nameTha;
attribute string descriptionEng;
attribute string descriptionTha;
attribute date dateAdded;
attribute boolean isActive;
relationship set<Branch> menuOfferedBy inverse Branch::menuOffers;
relationship set<OrderItem> referredBy inverse OrderItem::refersTo;
relationship set<SeasonRef> dependsOnSeason inverse SeasonRef::dependedBy;
relationship set<MenuAvailability> dependsOnAvailability inverse MenuAvailability::dependedBy;
relationship set<MenuServingRef> includes inverse MenuServingRef::includedIn;
void toggleIsActive();
string calculatePopularity();
};
class ServingRef(extent servingRefs key servingRefId){
attribute long servingRefId;
attribute string nameEng;
attribute string nameTha;
attribute string descriptionEng;
attribute string descriptionTha;
attribute enum Genre {
'australia', 'asian', 'western'
} genre;
attribute float basePrice;
attribute date dateAdded;
attribute boolean hasFreeSaladBar;
relationship set<MenuServingRef> tiedIn inverse MenuServingRef::tiesTo;
relationship set<ServingFoodItemRef> involves inverse ServingFoodItemRef::involvedIn;
};
class MenuServingRef(extent menuServingRefs){
attribute float realPrice;
attribute timestamp pricingTimestamp;
relationship MenuRef includedIn inverse MenuRef::includes;
relationship ServingRef tiesTo inverse ServingRef::tiedIn;
};
class Food extends ServingRef{
attribute string cookingDescription;
attribute enum FoodType {
'steak', 'double steaks', 'burger', 'salad', 'rice', 'spaghetti', 'wrap', 'sandwich'
} type;
attribute boolean isForChildren;
};
class Appetizer extends Food{
};
class Beverage extends ServingRef{
attribute float volumeOz;
attribute boolean isRefillable;
};
class FoodItemRef(extent foodItemRefs key foodItemRefId){
attribute long foodItemRefId;
attribute string nameEng;
attribute string nameTha;
attribute string descriptionTha;
attribute string descriptionEng;
relationship set<ServingFoodItemRef> involvedIn inverse ServingFoodItemRef::involves;
relationship set<FoodItemIngredientRef> consistsOf inverse FoodItemIngredientRef::consistedOf;
relationship set<MenuServingCustomization> replacedBy inverse MenuServingCustomization::replacesWith;
relationship set<SaladBarServing> requiredFor inverse SaladBarServing::needs;
string inferConsumption(in set<Branch> branches) raises(IllegalArgumentException, NoSuchBranchException);
};
class ServingFoodItemRef(extent servingFoodItemRef){
attribute short quantity;
attribute string quantityUnit;
attribute boolean isCustomizable;
relationship ServingRef involvedWith inverse ServingRef::involves;
relationship FoodItemRef involves inverse FoodItemRef::involvedIn;
relationship set<MenuServingCustomization> relates inverse MenuServingCustomization::relatesTo;
};
class FoodItemIngredientRef(extent foodItemIngredientRefs){
attribute float quantity;
attribute string quantityUnit
relationship FoodItemRef consistedOf inverse FoodItemRef::consistsOf;
relationship FoodIngredientRef madeOf inverse FoodIngredientRef::make;
};
class FoodIngredientRef(extent foodIngredientRefs key foodIngredientRefId){
attribute long foodIngredientRefId;
attribute string nameEng;
attribute string nameTha;
attribute string description;
attribute enum Category{
'meat', 'vegetable',
'spice', 'sauce',
'desert', 'beverage',
'fruit'} category;
relationship set<FoodItemIngredientRef> make inverse FoodItemIngredientRef::madeOf;
relationship set<InventoryInboundOrderItem> involvedWith inverse InventoryInboundOrderItem::involves;
string inferConsumption(in set<Branch> branches) raises(IllegalArgumentException, NoSuchBranchException);
};
class MenuServingCustomization(extent menuServingCustomizations){
relationship OrderItem tiesTo inverse OrderItem::tiedWith;
relationship ServingFoodItemRef relatesTo inverse ServingFoodItemRef::relates;
relationship FoodItemRef replacesWith inverse FoodItemRef::replacedBy;
};
class SaladBarServing(extent saladBarServings){
attribute short maxQuantity;
attribute string maxQuantityUnit;
relationship SaladBar causedBy inverse SaladBar::leadsTo;
relationship FoodItemRef needs inverse FoodItemRef::requiredFor;
relationship set<SaladBarRefill> referredBy inverse SaladBarRefill::refersTo;
};
class SaladBarRefill(extent saladBarRefills){
attribute short quantity;
attribute string quantityUnit;
attribute timestamp timeRefilled;
relationship Employee carriedOutBy inverse Employee::carriesOut;
relationship SaladBarServing refersTo inverse SaladBarServing::referredBy;
};