refactor: deepen directory structure and split overgrown handler files#9
Merged
Conversation
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
|
🎉 This PR is included in version 1.3.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reorganises the previously flat
internal/handler/,templates/pages/, andtemplates/partials/directories into per-domain sub-folders (admin,kiosk,member,shared), extracts route registration out ofcmd/server/main.gointo a dedicatedinternal/router/package, and splits four oversized handler files into smaller cohesive ones..