-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathConstraints for CS2102 Project.txt
50 lines (42 loc) · 5.07 KB
/
Constraints for CS2102 Project.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
Constraints
1. Each Account can be uniquely identified by a username (not null), and it has one username, password, phone number, email, and email verified status.
2. Each User must have exactly one user profile (which is the address, profile picture URL, self introduction).
3. The existence of a credit card depends on a user, and the credit card number can uniquely identify a credit card. Each credit card can identify exactly one user(existential dependency).
4. The PCS Administrator has an attribute of privilege, which is a string representing privileges and permissions that he/her has.
5. A Pet is uniquely identified by the serial type ID.
6. A Pet Category is uniquely identified by the Type.
7. Each Pet must belong to exactly one Pet Category, and must be owned by exactly one Pet Owner.
8. A Pet Owner can own 0 or more pets.
9. The Calendar is uniquely identified by Date.
10. A Timeslot is uniquely identified by the Start Date and End Date, which reference Date in the Calendar.
11. The daily price is determined by the Care Taker and the specific type of pet.
12. A Pet Owner can only bid for service when the Care Taker is available on every day during the service period.
13. A Pet Owner cannot submit duplicate bids for the same Pet under the same Care Taker for the same period of time.
14. Each Account is either a User or PCS Administrator or both (satisfies Covering and Overlapping Constraint).
15. Each User is either a Care Taker or Pet Owner or both (satisfies Covering and Overlapping Constraint).
16. Each Care Taker is either a Full-time or Part-Time Employee (satisfies Covering Constraint, but does not satisfy Overlap Constraint).
17. For each Account, the Password, Phone Number and Email cannot be null. Phone Number and Email are both unique. Email and Phone Number formats must be of specific styles(Email format: %_@_%._%, Phone Number format: In the Singapore Context, we limit to 8 digits only).
18. For each User, the Address cannot be null.
19. For each Credit Card, CVV and Expiry Date cannot be null.
20. For Looks After, Daily Price cannot be null.
21. For Is Available, Status cannot be null.
22. For Orders, the status and delivery mode cannot be null.
23. For Transactions, the payment method cannot be null.
24. The Care Taker can only take care of Pets belonging to Pet Categories he/she can take care of.
25. A Care Taker must not exceed the number of pets allowed to be taken care of at any given time.
26. The Pet Owner should specify only one of the three Delivery Modes given in the project description while bidding. We assume Full Time Care Takers accept any transfer method. Part Time Care Taker shall consider the Delivery Mode while accepting the bid. Accepting the bid indicates accepting the Delivery Mode and guarantees availability.
27. The Pet Owner should specify the Payment Method while Bidding.
28. We assume Pet Owners do not need to place a deposit when placing a bid. However, if they do not pay for orders after their bids being accepted for two times, their account will be blocked.
29. For a Full-Time Care Taker, we assume he is able to satisfy any special requirement due to training provided by PCS. Therefore, he will accept the bid immediately if he is able to (available & can take care of that pet category). For a Part-Time Care Taker, he will always accept the bid by himself.
30. An order is immediately placed after a bidding is accepted.
31. The Pet Owner can give at most one Rating and Review after each caretaking service finished.
32. A Full-Time Care Taker must have at least 2*150 consecutive available days each year.
33. Every day, a Full-Time Care Taker is by default available, while a Part-Time Care Taker is by default unavailable. Only PCS Administrator can set Full-Time Care Taker to be unavailable (when care taker applies for leave and admin approves).
34. A Care Taker has one of the three statuses on each day, available means on working and can take at least one more pet, busy means on working but already taking 5 pets (For Part Time Care Takers, it can be 2 or 5), unavailable means not working/on leave. The status needs to be updated when an order status is changed.
35. An order can have a status of ‘Pending Payment’, ‘Payment Received’, ‘Service Finished’.
36. A bid can have a status of ‘Pending’, ‘Accepted’, ‘Rejected’.
37. A Full-Time Care Taker cannot apply for leave on a day when there is a Pet to take care of (even when there is a pending payment order).
38. For Full-Time Care Taker, the admin specifies Daily Price of each category (based on rating) of Care Taker for each Pet Category. Part Time Care Takers specify their own daily prices for each Pet Category.
Justification for serial type
1. When a bid is accepted, an order will be created. In order to conveniently identify each order, an orderID will be automatically generated, so serial type will be used.
2. When a pet is created, an ID will be automatically generated to identify it and serial type shall be used. This generated ID will work as the primary key for the pet entity, so using serial type is crucial.