• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

andgineer / dinary-server / 24689563722

20 Apr 2026 08:47PM UTC coverage: 72.854% (+1.1%) from 71.757%
24689563722

push

github

andgineer
Phase 2: runtime 3D->2D mapping + admin catalog API + PWA overhaul

Replaces the 1:1 import-derived logging_mapping with a curated
runtime_mapping sourced from a new "map" worksheet tab. The tab is
the source of truth and is lazily reloaded via Drive modifiedTime;
an explicit admin reload endpoint is also exposed. A new
catalog_writer service serialises all catalog mutations and
hash-gates catalog_version bumps so no-op rewrites don't churn the
PWA cache.

Server
- GET /api/catalog: single ETag-cached 3D snapshot replacing per-kind
  endpoints; ETag on HTTP header only (derived client-side from
  catalog_version, not duplicated in the body).
- POST /api/expenses: 3D contract (category_id, event_id, tag_ids).
  Replay-with-inactive-catalog-item defers to insert_expense's
  ON CONFLICT path so 422 vs 409 classification stays correct.
- POST/PATCH /api/admin/catalog/{groups,categories,events,tags}:
  token-protected; every successful mutation returns the full
  snapshot + AddResult.status (created|reactivated|noop). Empty
  string on PATCH sheet_name/sheet_group clears the column.
- POST /api/admin/reload-map: unconditional reload with check_after
  off (halves Drive metadata GETs on this hot button).
- Drop legacy GET /api/categories and its orphan duckdb accessor.

Runtime mapping
- fnmatch event patterns, first-match-wins tag-subset semantics.
- ensure_default_map_tab seeds new tabs from the latest
  import_mapping year (identity fallback for untouched categories)
  and WARNs on reseed if an existing tab references names no longer
  in the active catalog.
- Atomic swap inside a single transaction; drain loop never sees
  a half-populated map.
- Startup preload with configurable timeout
  (warm_runtime_map_timeout_sec).

PWA
- Full 3D catalog client (catalog.js + catalog-add.js): group
  selector drives category selector; events filtered client-side
  to +/-30 days of the selected date; multi-select tags; inline
  "+ Новый" modals for all four kinds be... (continued)

672 of 865 new or added lines in 11 files covered. (77.69%)

1 existing line in 1 file now uncovered.

2359 of 3238 relevant lines covered (72.85%)

0.73 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

84.3
/src/dinary/api/admin_catalog.py


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc