Skip to content

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

Merged
schliz merged 19 commits into
masterfrom
refactor/deepen-dirs
May 3, 2026
Merged

refactor: deepen directory structure and split overgrown handler files#9
schliz merged 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 19 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>
…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
@github-project-automation github-project-automation Bot moved this to Backlog in schliz/deckel May 3, 2026
@schliz schliz linked an issue May 3, 2026 that may be closed by this pull request
@schliz schliz merged commit 7b0766e into master May 3, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in schliz/deckel May 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

🎉 This PR is included in version 1.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions Bot added the released This pull request is included in a release. label May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released This pull request is included in a release.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Re-evaluate flat project structure

1 participant