aboutsummaryrefslogtreecommitdiff
path: root/src/lib/server/services/references.test.ts
Commit message (Collapse)AuthorAge
* refactor: inject the database into every servicemainMartin Kagamino Lehoux10 hours
| | | | | | | Groceries, projects, references and routines become classes holding the Drizzle handle, wired once in services/index.ts alongside categories. Tests build their own instance on an in-memory database. Drops the unused projects.loadAll and projects.rename.
* feat: promote a reference as the primary shown in listsMartin Kagamino Lehoux12 days
| | | | Add an is_primary flag to references; the promoted ref sorts first on the item page and is the one shown under the item in the list and catalog. Item page gets a star toggle per reference.
* fix: make grocery and reference ordering deterministicMartin Kagamino Lehoux13 days
| | | | | | | | | | | Every list query lacked a tiebreak, so rows sharing a sort key (same-ms createdAt inserts, tied or NULL quality scores) came back in unspecified order and bestRef flipped between loads. Add explicit tiebreaks: items createdAt desc, id desc (newest first); references qualityScore desc, id asc (first inserted wins ties). Categories were already total (order, name unique). Pin the rules with service tests.
* Migrate date handling from Date to Temporal APIMartin Kagamino Lehoux2026-09-08
| | | | | | | | Routine scheduling, health series, service stamps, session expiry, and date formatting move to native Temporal (Instant / ZonedDateTime in UTC), with ISO strings kept at DB and chart boundaries. Ambient types in src/temporal-ambient.d.ts cover the native runtime; no polyfill. Observable behavior and stored formats are unchanged.
* Consolidate duplicated page CSS into app.css, share TestDb typeMartin Kagamino Lehoux2026-09-08
| | | | | | | | | | | | | - Move .page-header/.back-link/.input-invalid/.save-status/.btn-done (plus hover/variant rules) into app.css as shared route scaffolding; delete per-page scoped copies - Unify drifted values: page-header padding 1rem -> 1.25rem (routine page), empty-state spacing 0.75/1.5rem -> 1/2rem (grocery detail), save-status margin -0.25rem applied on both pages, back-link margin 1.5rem -> 1rem (grocery detail); routine page's large Fait button is kept via a .btn-done-lg modifier - Export TestDb from test-helper and use it in the five db/service test files to shrink duplicated fixture scaffolding
* refactor: services layer, valibot validation, shared CSS utilities, aria ↵Martin Kagamino Lehoux2026-07-28
labels, and drizzle migrate - Extract groceries/categories/references services with db injection - Add valibot for form validation and safe numeric id parsing - Fix category delete FK behavior with onDelete: set null + migration - Replace custom migrate.js with drizzle-orm/libsql/migrator - Add shared CSS utility classes in app.css (forms, lists, buttons) - Add aria-pressed and aria-label on interactive elements - Remove redundant app.css imports and unused /stores import - Add integration tests for all services using drizzle migrate helper - Remove smoke test; add db:migrate and db:studio scripts