| | 136 | |
| | 137 | ---- |
| | 138 | |
| | 139 | {{{Review}}} |
| | 140 | |
| | 141 | The feedback that the {{{PetOwner}}} leaves for the {{{PetSitter}}} after a completed {{{Booking}}}. This is mandatory to maintain trust and establish quality on the platform. |
| | 142 | |
| | 143 | '''Candidate keys:''' |
| | 144 | * {{{review_id}}} - '''Primary key'''; Unique surrogate key. |
| | 145 | |
| | 146 | '''Attributes:''' |
| | 147 | |
| | 148 | * {{{review_id}}} - Numeric (Required, Unique, Auto-generated integer). |
| | 149 | |
| | 150 | * {{{rating}}} - Numeric (Required, Integer from 1 to 5). |
| | 151 | |
| | 152 | * {{{comment}}} - Text (Optional). |
| | 153 | |
| | 154 | ---- |
| | 155 | |
| | 156 | {{{Service}}} |
| | 157 | |
| | 158 | Defines the type of care offered for the {{{Pet}}}, for example walking, overnight stay or short visit. If needed new services can be added without changing the database schema. |
| | 159 | |
| | 160 | '''Candidate keys:''' |
| | 161 | * {{{service_id}}} - '''Primary key'''; Unique surrogate key. |
| | 162 | |
| | 163 | '''Attributes:''' |
| | 164 | |
| | 165 | * {{{service_id}}} - Numeric (Required, Unique, Auto-generated integer). |
| | 166 | |
| | 167 | * {{{type}}} - Text (Required). |
| | 168 | |
| | 169 | * {{{description}}} - Text (Optional). |
| | 170 | |
| | 171 | |
| | 172 | ---- |
| | 173 | |
| | 174 | {{{Payment}}} |
| | 175 | |
| | 176 | Defines the financial transaction related to a {{{Booking}}}. |
| | 177 | |
| | 178 | '''Candidate keys:''' |
| | 179 | * {{{payment_id}}} - '''Primary key'''; Unique surrogate key. |
| | 180 | |
| | 181 | '''Attributes:''' |
| | 182 | |
| | 183 | * {{{payment_id}}} - Numeric (Required, Unique, Auto-generated integer). |
| | 184 | |
| | 185 | * {{{amount}}} - Numeric (Required, positive integer > 0). |
| | 186 | |
| | 187 | * {{{payment_type}}} - Text (Required, for example Cash or Card). |
| | 188 | |
| | 189 | == Relations |
| | 190 | |
| | 191 | {{{manage - Admin to User}}} |
| | 192 | * M:N relation |
| | 193 | * an {{{Admin}}} can manage multiple users, and a {{{User}}} can be managed by multiple admins. |
| | 194 | |
| | 195 | ---- |
| | 196 | |
| | 197 | {{{leaves - PetOwner to Review}}} |
| | 198 | * 1:N relation |
| | 199 | * one {{{PetOwner}}} can leave many reviews to sitters, but each {{{Review}}} has one unique owner. |
| | 200 | |
| | 201 | ---- |
| | 202 | |
| | 203 | {{{receives - Review to PetSitter}}} |
| | 204 | * 1:N relation |
| | 205 | * one {{{PetSitter}}} can receive many reviews from clients, but each {{{Review}}} is meant for one unique {{{PetSitter}}}. |
| | 206 | |
| | 207 | |
| | 208 | ---- |
| | 209 | |
| | 210 | {{{is_a - Pet to PetType}}} |
| | 211 | * M:1 relation |
| | 212 | * many Pets can have one {{{PetType}}} (for example Cat), but each {{{Pet}}} has exactly one type. |
| | 213 | |
| | 214 | ---- |
| | 215 | |
| | 216 | {{{is_for - Pet to Booking}}} |
| | 217 | * N:N relation |
| | 218 | * a {{{Booking}}} can have two pets from the same owner, while a {{{Pet}}} can be part of many bookings during its life. |
| | 219 | |
| | 220 | ---- |
| | 221 | |
| | 222 | {{{books - PetOwner to Booking}}} |
| | 223 | * 1:N relation |
| | 224 | * a {{{PetOwner}}} can schedule many bookings, but each {{{Booking}}} is created by and owned by one unique {{{PetOwner}}}. |
| | 225 | |
| | 226 | ---- |
| | 227 | |
| | 228 | {{{is_booked - Booking to PetSitter}}} |
| | 229 | * 1:N relation |
| | 230 | * a {{{PetSitter}}} can be booked for many bookings, but each {{{Booking}}} is assigned to only one {{{PetSitter}}} at a time. |
| | 231 | |
| | 232 | ---- |
| | 233 | |
| | 234 | {{{provides - PetSitter to Service}}} |
| | 235 | * M:N relation |
| | 236 | * a {{{PetSitter}}} can provide multiple services (Walking, Overnight stay) and a {{{Service}}} (Walking) can be provided by many different sitters. |
| | 237 | |
| | 238 | ---- |
| | 239 | |
| | 240 | {{{requires - Booking to Service}}} |
| | 241 | * M:N relation |
| | 242 | * a {{{Booking}}} can require multiple services (Walking, Overnight stay) and a specific {{{Service}}} type can be requested in many different bookings. |
| | 243 | |
| | 244 | ---- |
| | 245 | |
| | 246 | {{{charged - Booking to Payment}}} |
| | 247 | * 1:1 relation |
| | 248 | * each {{{Booking}}} has exactly one {{{Payment}}} record, and each {{{Payment}}} record is associated with exactly one {{{Booking}}} |