normogen/backend/src/models
goose 09589b3bb2 feat(backend): dose scheduling + health stats zero-knowledge
Backend changes (frontend + tests follow in next commit):

Dose scheduling:
- New DoseSchedule struct (times_per_day + days_of_week) as a top-level
  plaintext field on Medication. Create/update requests accept it.
- Revised get_adherence: computes scheduled_doses from the schedule over the
  period (days_of_week filtering), so missed doses are now reflected.
  Falls back to taken/total_logged when no schedule.

Health stats zero-knowledge:
- HealthStatistic model now uses opaque encrypted_data blob (like medications).
  Only recorded_at stays plaintext (filterable/sortable).
- HealthStatResponse wire type. Handlers echo opaque blobs.
- Removed the trends endpoint (server can't compute trends on ciphertext;
  frontend computes them client-side after decrypting).
- Deleted the dead HealthData model (kept EncryptedField which it defined).

Verified: backend 24 tests, 0 clippy warnings.
2026-07-04 08:41:48 -03:00
..
appointment.rs feat: zero-knowledge encryption Phase 1 — backend opaque + crypto module (WIP) 2026-06-28 20:08:38 -03:00
audit_log.rs fix(backend): refresh-token jti + code cleanup (#15,#28,#29,#30) 2026-06-27 20:57:24 -03:00
family.rs fix(backend): refresh-token jti + code cleanup (#15,#28,#29,#30) 2026-06-27 20:57:24 -03:00
health_data.rs feat(backend): dose scheduling + health stats zero-knowledge 2026-07-04 08:41:48 -03:00
health_stats.rs feat(backend): dose scheduling + health stats zero-knowledge 2026-07-04 08:41:48 -03:00
interactions.rs fix(backend): refresh-token jti + code cleanup (#15,#28,#29,#30) 2026-06-27 20:57:24 -03:00
lab_result.rs fix(backend): refresh-token jti + code cleanup (#15,#28,#29,#30) 2026-06-27 20:57:24 -03:00
medication.rs feat(backend): dose scheduling + health stats zero-knowledge 2026-07-04 08:41:48 -03:00
mod.rs feat: full appointment feature (CRUD + Appointments tab) 2026-06-28 16:35:50 -03:00
permission.rs fix(backend): refresh-token jti + code cleanup (#15,#28,#29,#30) 2026-06-27 20:57:24 -03:00
profile.rs feat: zero-knowledge encryption Phase 1 — backend opaque + crypto module (WIP) 2026-06-28 20:08:38 -03:00
refresh_token.rs fix(backend): refresh-token jti + code cleanup (#15,#28,#29,#30) 2026-06-27 20:57:24 -03:00
session.rs fix(backend): refresh-token jti + code cleanup (#15,#28,#29,#30) 2026-06-27 20:57:24 -03:00
share.rs fix(backend): refresh-token jti + code cleanup (#15,#28,#29,#30) 2026-06-27 20:57:24 -03:00
user.rs feat: zero-knowledge recovery (Phase 2) — wrapped-DEK model 2026-06-29 03:34:24 -03:00