Models#
Database Models#
The backend uses SQLAlchemy ORM to define database tables as python classes. These models represent the key entities of PetSync system such as owners, pet, health records, schedules, reminders, and reports.
Main Models#
Owner –> Stores user account informations
Pet –> Stores the pet profile details and links to owners account
Species_config –> Defines pet species and breed
PetMetaData –> Stores additional notes for pets
Metric Definition –> Defines health metric for each species
Health Metric –> Stores recorded health data for pets
PetAppointment –> Manages vet appointments and reminders
FeedingSchedule –> Stores feeding schedule for pets
Reminder –> Handles notifications for scheduling appointments/feeding reminders/advice reminders..
PetGoal –> Tracks pet health goals
PetReport –> Stores generated reports and analytics.
Relationships#
The models are linked using Foreign Keys. For example:
One Owner can have many pets (1-M)
One Pet can have many health records (1-M)
One Pet can have many appointments and feeding schedule (1-M)
API Reference#
- class petsync_backend.models.Owner(**kwargs)[source]#
Bases:
Base- owner_id#
- owner_first_name#
- owner_last_name#
- owner_email#
- password#
- deletion_requested_at#
- pets#
- class petsync_backend.models.SpeciesType(value)[source]#
Bases:
Enum- dog = 'dog'#
- cat = 'cat'#
- hamster = 'hamster'#
- snake = 'snake'#
- bird = 'bird'#
- rabbit = 'rabbit'#
- class petsync_backend.models.Species_config(**kwargs)[source]#
Bases:
Base- species_id#
- species_name#
- breed_name#
- notes#
- class petsync_backend.models.Pet(**kwargs)[source]#
Bases:
Base- pet_id#
- species_id#
- owner_id#
- pet_first_name#
- pet_last_name#
- pet_image_path#
- class petsync_backend.models.PetMetaData(**kwargs)[source]#
Bases:
Base- meta_data_id#
- pet_id#
- notes#
- class petsync_backend.models.MetricName(value)[source]#
Bases:
Enum- weight = 'weight'#
- stool_quality = 'stool_quality'#
- energy_level = 'energy_level'#
- appetite = 'appetite'#
- water_intake = 'water_intake'#
- litter_box_usage = 'litter_box_usage'#
- vomit_events = 'vomit_events'#
- feather_condition = 'feather_condition'#
- wing_strength = 'wing_strength'#
- perch_activity = 'perch_activity'#
- vocalisation_level = 'vocalisation_level'#
- basking_time = 'basking_time'#
- shedding_quality = 'shedding_quality'#
- humidity_level = 'humidity_level'#
- stool_pellets = 'stool_pellets'#
- chewing_behaviour = 'chewing_behaviour'#
- wheel_activity = 'wheel_activity'#
- notes = 'notes'#
- custom = 'custom'#
- class petsync_backend.models.MetricUnit(value)[source]#
Bases:
Enum- kg = 'kg'#
- grams = 'grams'#
- ml = 'ml'#
- scale_1_5 = 'scale_1_5'#
- count_day = 'count_day'#
- minutes_day = 'minutes_day'#
- percent = 'percent'#
- text = 'text'#
- custom = 'custom'#
- class petsync_backend.models.MetricDefinition(**kwargs)[source]#
Bases:
Base- metric_def_id#
- species_id#
- metric_name#
- metric_unit#
- notes#
- class petsync_backend.models.HealthMetric(**kwargs)[source]#
Bases:
Base- health_metric_id#
- metric_def_id#
- pet_id#
- metric_value#
- metric_time#
- notes#
- class petsync_backend.models.AppointmentStatus(value)[source]#
Bases:
Enum- Scheduled = 'Scheduled'#
- Completed = 'Completed'#
- Cancelled = 'Cancelled'#
- class petsync_backend.models.AppointmentReminderFrequency(value)[source]#
Bases:
Enum- once = 'once'#
- weekly = 'weekly'#
- monthly = 'monthly'#
- none = 'none'#
- class petsync_backend.models.PetAppointment(**kwargs)[source]#
Bases:
Base- pet_appointment_id#
- pet_id#
- series_id#
- enable_reminder#
- reminder_frequency#
- pet_appointment_date#
- pet_appointment_time#
- appointment_status#
- appointment_notes#
- class petsync_backend.models.FeedingSchedule(**kwargs)[source]#
Bases:
Base- feeding_schedule_id#
- pet_id#
- feeding_schedule_start#
- feeding_schedule_end#
- feeding_time#
- portion_size#
- food_name#
- class petsync_backend.models.ReminderStatus(value)[source]#
Bases:
Enum- pending = 'Pending'#
- sent = 'Sent'#
- dismissed = 'Dismissed'#
- missed = 'Missed'#
- cancelled = 'Cancelled'#
- class petsync_backend.models.Reminder(**kwargs)[source]#
Bases:
Base- reminder_id#
- pet_appointment_id#
- feeding_schedule_id#
- reminder_datetime#
- reminder_status#
- reminder_notes#
- class petsync_backend.models.PetGoal(**kwargs)[source]#
Bases:
Base- pet_goal_id#
- pet_id#
- metric_def_id#
- target_value#
- updated_at#
- pet#
- metric_definition#