feat: edit the reference week from the admin

The first administration page, built for the actual use case: a phone
held in one hand behind the counter. One card per day, native time
inputs so the platform keyboard does the work, and the consequences
shown before the save rather than after — the footer names which days
are about to change, and the button stays disabled until something
actually has.

"Duplicate onto the other open days" leaves closed days closed. Someone
copying Tuesday's hours means "the days I open, I open like this", not
"open seven days a week".

Validation runs in the browser for the feedback and again in the action
before the write: the client is a convenience, not a guarantee, and this
is the schedule the shop window shows. A day being closed drops its
leftover slots rather than failing on them.

A save that changes nothing writes nothing — no rows, no audit entry,
and so no needless panel redraw. Reordering slots does not count as a
change. The audit diff stores one readable line per day in French, so
the log can be read without cross-referencing the schema.

The editing helpers are pure and tested, and the write path is tested
against a real database including the read-only refusal.

Test files now run sequentially: the integration files share one
database and each truncates it, so parallel files raced. The suite takes
six seconds; giving every file its own database would buy nothing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012cSY9pVhZmJUKNN7wf1Myd
This commit is contained in:
2026-09-20 18:57:46 +02:00
co-authored by Claude Opus 5
parent 5c0b8119a4
commit eb23eb650b
8 changed files with 829 additions and 0 deletions
+4
View File
@@ -13,6 +13,10 @@ export default defineConfig({
// Runs before any module is imported, so the Prisma client is built
// against the test database rather than the development one.
setupFiles: ['tests/setup-database.ts'],
// The integration files share one database and each truncates it, so
// running files in parallel makes them race. The whole suite is a couple
// of seconds; giving every file its own database would buy nothing.
fileParallelism: false,
coverage: {
provider: 'v8',
reporter: ['text', 'html', 'lcov'],