Commit Graph

30 Commits

Author SHA1 Message Date
jason
b8633863b0 fix: add pagination to unbounded GET endpoints
All list endpoints now accept ?page and ?limit (default 50, max 200) and
return { data, total, page, limit } instead of a bare array, preventing
memory and performance failures at scale.

- GET /api/dogs: adds pagination, server-side search (?search) and sex
  filter (?sex), and a stats aggregate (total/males/females) for the
  Dashboard to avoid counting from the array
- GET /api/litters: adds pagination; also fixes N+1 query by fetching
  all puppies for the current page in a single query instead of one per
  litter
- DogList: moves search/sex filtering server-side with 300ms debounce;
  adds Prev/Next pagination controls
- LitterList: uses paginated response; adds Prev/Next pagination controls
- Dashboard: reads counts from stats/total fields instead of array length
- LitterDetail, LitterForm: switch dogs fetch to /api/dogs/all (complete
  list, no pagination, for sire/dam dropdowns)
- DogForm: updates litters fetch to use paginated response shape

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 16:40:28 -05:00
13185a5281 Roadmap 2,3,4 2026-03-11 23:48:35 -05:00
jason
58b53c981e feat: Add pedigree routes for COI calculation, direct relation checks, and ancestral/descendant trees. 2026-03-11 14:48:59 -05:00
Zenflow
ff1eb455dc "Fix_COI_and_routes" 2026-03-11 13:07:04 -05:00
Zenflow
c22ebbe45c New task (zenflow 738246ea)
In the Pairing Simulator page, I am getting the error:

**Error:**Unexpected token '<', "<!DOCTYPE "... is not valid JSON

Fid and fix the bug
2026-03-11 13:02:24 -05:00
5eaa6e566c fix: GET /api/dogs honours ?include_external=1 query param for pairing simulator 2026-03-11 01:00:48 -05:00
9738b24db6 feat(api): add is_external support — GET /api/dogs filters kennel dogs; GET /api/dogs/external returns external roster 2026-03-10 15:24:50 -05:00
389636ce6f fix: COI correctly calculates parent×offspring and direct-relation pairings
- Remove blanket `id !== sid && id !== did` exclusion from commonIds filter
  which was silently zeroing out COI for parent×offspring pairings because
  the sire (sid) IS the common ancestor in damMap but was being filtered out.
- Instead: exclude `did` from sireMap keys (sire can't be its own common
  ancestor with the dam) and exclude `sid` from damMap keys (same logic).
- Parent×offspring pairing now correctly yields ~25% COI as expected by
  Wright's path coefficient method.
- All other normal pairings are unaffected.
2026-03-10 15:08:33 -05:00
2164b035a8 fix(backend): move named routes above /:id wildcard — Express route order bug causing 0% COI 2026-03-10 15:01:22 -05:00
c949fe2502 fix(backend): rewrite COI with self-at-gen-0 Wright method + direct-relation detection endpoint 2026-03-10 14:54:59 -05:00
f5ee9837c6 fix: correct COI Wright path algorithm — include sire/dam as direct ancestors of each other 2026-03-10 14:44:27 -05:00
20fcc39a58 fix: use single quotes for sex string literals in trial-pairing SQL (SQLite double-quote = identifier) 2026-03-10 14:38:16 -05:00
d9cd0bec58 feat(api): add genetics.js — DNA panel CRUD + pairing-risk endpoint 2026-03-09 23:23:46 -05:00
8635483332 feat(api): rewrite health.js with OFA clearance fields, clearance-summary, chic-eligible endpoints 2026-03-09 23:22:55 -05:00
0ade8586f9 feat(dogs): add hard DELETE /api/dogs/:id with cascade cleanup 2026-03-09 22:57:43 -05:00
43939c664e fix(settings): rewrite route to match single-row column schema (was double-encoded base64 + wrong key/value schema) 2026-03-09 22:34:13 -05:00
421ea5cb58 feat(api): expose is_champion on all dog queries incl sire/dam/offspring joins 2026-03-09 22:24:39 -05:00
6ce9aebabd feat: add settings API route for kennel info 2026-03-09 22:01:12 -05:00
6e37abf6e8 feat: add puppy weight/health log endpoints to litters router 2026-03-09 21:02:15 -05:00
d7bad19275 feat: Add breeding date suggestion window endpoint 2026-03-09 20:30:42 -05:00
d311bc24a7 Clean: Proper sire/dam handling via parents table with logging 2026-03-09 02:01:18 -05:00
eec18daeea Fix: Remove weight/height columns - match actual schema 2026-03-09 01:38:42 -05:00
e62d35041f Fix: Don't return sire/dam columns from dogs table, select explicit fields 2026-03-09 01:29:40 -05:00
cc5af29c11 Enhanced litters API with puppy linking and litter_id support 2026-03-09 00:07:26 -05:00
56fb9cb7af Fix: Convert empty microchip strings to NULL in database 2026-03-08 23:55:38 -05:00
3d76ccf3be Add breeding/heat cycle API routes 2026-03-08 22:46:21 -05:00
a2b39957fa Add health records API routes 2026-03-08 22:45:54 -05:00
ac516a0911 Add litters API routes 2026-03-08 22:45:27 -05:00
df252e828a Add pedigree API routes 2026-03-08 22:45:07 -05:00
e8c7d77c52 Add dogs API routes 2026-03-08 22:44:23 -05:00