Skip to content

Pet Weight Tracking #66

@llinsss

Description

@llinsss

Description:
Create a system to track pet weight over time and alert owners about weight changes.

What You'll Build:
A weight tracking feature that helps pet owners monitor their pet's health by recording weight measurements and showing trends.

Files to Create:

backend/src/weight-tracking/
├── weight-tracking.module.ts
├── weight-tracking.controller.ts
├── weight-tracking.service.ts
├── entities/
│ └── weight-entry.entity.ts
└── dto/
└── create-weight-entry.dto.ts

Step-by-Step Tasks:

  1. Create weight-tracking module: nest g module weight-tracking
  2. Create controller: nest g controller weight-tracking
  3. Create service: nest g service weight-tracking
  4. Create WeightEntry entity (id, petId, weight, date, notes)
  5. Add relationship to Pet entity
  6. Create POST /pets/:petId/weight endpoint (add weight entry)
  7. Create GET /pets/:petId/weight endpoint (get weight history)
  8. Add weight trend calculation (gaining/losing/stable)
  9. Add weight alerts for significant changes
  10. Calculate ideal weight range by breed
  11. Write tests

API Endpoints:

POST /pets/:petId/weight - Add weight entry
GET /pets/:petId/weight - Get weight history
GET /pets/:petId/weight/trends - Get weight trends
DELETE /pets/:petId/weight/:id - Delete weight entry

Database Schema:

weight_entries: id, pet_id, weight, unit, date, notes, created_at

Acceptance Criteria:

  • ✅ Users can record pet weight with date
  • ✅ Weight history returned in chronological order
  • ✅ Calculate weight trends (gaining/losing/stable)
  • ✅ Alert if weight change > 10% in 30 days
  • ✅ Support kg and lbs units
  • ✅ Graph-ready data format
  • ✅ Tests with 80%+ coverage

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions