wutzcalc/server
Repository files (latest commit first)
Filename Latest commit message Latest commit date
iris 9c75ce5243 server: /api/stats endpoint + per-day-per-drink trend data
New GET /api/stats — same computeStats() shared with the existing
/admin/api/stats, so the numbers stay identical. Auth is gated by
STATS_PUBLIC (default: requires the admin session, same as every other
/admin/api endpoint) rather than always-open, so a bare deploy doesn't
expose revenue by default.

Also adds per_drink_by_day (day -> per-drink sold qty) alongside the
existing all-time per_drink totals — the trend-over-time data mara asked
for on #40. Same businessDay() JS bucketing as by_day for DST correctness,
same reasoning as the existing comment on that.

Client page for /stats itself is a follow-up commit.
2026-07-30 11:40:34 +02:00
..
migrations snapshot the Pfand rate used for returns, like every other money value already is 2026-07-29 20:26:52 +02:00
src server: /api/stats endpoint + per-day-per-drink trend data 2026-07-30 11:40:34 +02:00
package.json scaffold festival drink tracker (pnpm workspace, Fastify + SQLite, Preact tablet UI, admin) 2026-05-19 18:12:01 +02:00
tsconfig.json scaffold festival drink tracker (pnpm workspace, Fastify + SQLite, Preact tablet UI, admin) 2026-05-19 18:12:01 +02:00