| | 2 | |
| | 3 | == Notation == |
| | 4 | Primary keys are marked in '''bold'''. |
| | 5 | Foreign keys are marked with FK* and the referenced table is written in parentheses (). |
| | 6 | |
| | 7 | == Tables == |
| | 8 | |
| | 9 | === Owners & Pets === |
| | 10 | Owner ('''owner_id''', last_name, first_name, phone, email, address, gender) |
| | 11 | |
| | 12 | Pet ('''pet_id''', name, is_active, type, breed, age, medical_history, age_display, owner_id*(Owner)) |
| | 13 | |
| | 14 | === Staff === |
| | 15 | Role ('''role_id''', name, description) |
| | 16 | |
| | 17 | Employee ('''employee_id''', last_name, first_name, phone, email, address, date_employment, experience, gender, role_id*(Role), supervised_by*(Employee)) |
| | 18 | |
| | 19 | Specialization ('''specialization_id''', specialization, license_number, employee_id*(Employee)) |
| | 20 | |
| | 21 | Certificate ('''certificate_id''', certificate_name, category, employee_id*(Employee)) |
| | 22 | |
| | 23 | === Scheduling === |
| | 24 | Appointment ('''appointment_id''', date_appointment, reason, phone, owner_id*(Owner), pet_id*(Pet)) |
| | 25 | |
| | 26 | Examination_room ('''examination_room_id''', room_number, type, capacity, status) |
| | 27 | |
| | 28 | Examination ('''examination_id''', date_examination, status, description, appointment_id*(Appointment), employee_id*(Employee), examination_room_id*(Examination_room)) |
| | 29 | |
| | 30 | === Treatments === |
| | 31 | Treatment_type ('''treatment_type_id''', name) |
| | 32 | |
| | 33 | Treatment ('''treatment_id''', date_treatment, notes, treatment_type_id*(Treatment_type), examination_id*(Examination)) |
| | 34 | |
| | 35 | Treatment_attribute ('''treatment_attribute_id''', name, data_type, treatment_type_id*(Treatment_type)) |
| | 36 | |
| | 37 | Treatment_attribute_value ('''treatment_attribute_value_id''', value, notes, treatment_attribute_id*(Treatment_attribute), treatment_id*(Treatment)) |
| | 38 | |
| | 39 | === Prescriptions & Medicine === |
| | 40 | Prescription ('''prescription_id''', date_start, date_end, description, examination_id*(Examination)) |
| | 41 | |
| | 42 | Prescription_medicine ('''prescription_id'''*(Prescription), '''medicine_id'''*(Medicine), dosage, num_days) |
| | 43 | |
| | 44 | Medicine ('''medicine_id''', name, manufacturer, description, shop_item_id*(Shop_item)) |
| | 45 | |
| | 46 | === Shop === |
| | 47 | Shop_item_category ('''shop_item_category_id''', name, parent_id*(Shop_item_category)) |
| | 48 | |
| | 49 | Shop_item ('''shop_item_id''', name, price, stock, shop_item_category_id*(Shop_item_category)) |
| | 50 | |
| | 51 | Shop_item_attribute ('''shop_item_attribute_id''', name, data_type, shop_item_category_id*(Shop_item_category)) |
| | 52 | |
| | 53 | Shop_item_attribute_value ('''shop_item_attribute_value_id''', value, notes, shop_item_attribute_id*(Shop_item_attribute), shop_item_id*(Shop_item)) |
| | 54 | |
| | 55 | Discount ('''discount_id''', type, value, description, date_from, date_to, shop_item_id*(Shop_item)) |
| | 56 | |
| | 57 | === Billing === |
| | 58 | Coupon ('''coupon_id''', code, type, value, valid_from, valid_to, usage_limit, usage_count, is_active, min_total) |
| | 59 | |
| | 60 | Invoice ('''invoice_id''', date_invoice, total, coupon_id*(Coupon), owner_id*(Owner)) |
| | 61 | |
| | 62 | Invoice_item ('''num_item''', '''invoice_id'''*(Invoice), price, quantity, type, shop_item_id*(Shop_item), treatment_id*(Treatment)) |
| | 63 | |
| | 64 | Payment ('''payment_id''', date_payment, amount, method, invoice_id*(Invoice)) |