Skip to content

refactor: deepen directory structure and split overgrown handler files#8

Closed
schliz wants to merge 19 commits into
masterfrom
refactor/deepen-dirs
Closed

refactor: deepen directory structure and split overgrown handler files#8
schliz wants to merge 19 commits into
masterfrom
refactor/deepen-dirs

Conversation

@schliz
Copy link
Copy Markdown
Owner

@schliz schliz commented May 3, 2026

Reorganises the previously flat internal/handler/, templates/pages/, and templates/partials/ directories into per-domain sub-folders (admin, kiosk, member, shared), extracts route registration out of cmd/server/main.go into a dedicated internal/router/ package, and splits four oversized handler files into smaller cohesive ones..

schliz and others added 13 commits May 3, 2026 16:26
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Move all 50+ route registrations, middleware chain assembly, and the
static-asset cache helper out of cmd/server/main.go and into a new
internal/router package. main.go now only handles config, DB, migrations,
renderer + handler construction, CSRF secret generation, and lifecycle.

The router package is split per-domain: router.go (Deps + New),
admin.go, kiosk.go, member.go (exported Register* functions), plus
unexported shared.go (header-stats + 404 catch-all) and static.go
(healthz, /static/, PWA assets, staticCacheHandler).

Behaviour parity preserved: every URL, method, middleware order, and
target function matches the previous main.go. The dead placeholderHandler
helper is dropped.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
schliz and others added 6 commits May 3, 2026 18:59
…k users from stats

Add hard spending limit check with row-level locking to CreateCustomTransaction
handler, preventing orders when balance is at or below the limit. Fix kiosk
spending limit to check current balance instead of projected balance for
consistency. Exclude kiosk users from rank calculations, balance sums, and
active user listings. Update use cases to reflect completed spending limit
and kiosk spending limit features.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add Playwright tests covering spending limit enforcement (blocked menu, exempt
user, low balance warning), kiosk spending limits (blocked user, warning on
confirm), kiosk user exclusion (redirect, no stats, not in target list, not in
rank total), and admin kiosk user display. Set up kiosk Keycloak user/role, auth
setup, Playwright config project, and fix docker-compose networking for tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
# Conflicts:
#	cmd/server/main.go
#	internal/handler/admin/settings.go
#	internal/handler/kiosk.go
#	internal/handler/member/transactions.go
@schliz
Copy link
Copy Markdown
Owner Author

schliz commented May 3, 2026

github bug prevents merging

@schliz schliz closed this May 3, 2026
@github-project-automation github-project-automation Bot moved this from Backlog to Done in schliz/deckel May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant