feat: Implement junior fees dashboard and reconciliation
All checks were successful
Deploy to K8s / deploy (push) Successful in 11s
Build and Push / build (push) Successful in 9s

- Add dual-sheet architecture to pull attendance from both adult and junior spreadsheets.
- Introduce parsing rules to isolate juniors (e.g. above '# Treneri', tier 'J').
- Add new endpoints `/fees-juniors` and `/reconcile-juniors` to track junior attendances and match bank payments.
- Display granular attendance components showing adult vs. junior practices.
- Add fee rule configuration supporting custom pricing exceptions for specific months (e.g. Sep 2025) and merging billing periods.
- Add `make sync-2025` target to the Makefile for convenience.
- Document junior fees implementation logic and rules in prompts/outcomes.

Co-authored-by: Antigravity <antigravity@google.com>
This commit is contained in:
Jan Novak
2026-03-09 17:33:32 +01:00
parent f40015a2ef
commit 75a36eb49b
12 changed files with 1515 additions and 22 deletions

View File

@@ -0,0 +1,34 @@
# Junior Fees Implementation Summary
Based on the recent updates, we have introduced a dedicated system for tracking, displaying, and reconciling junior team attendances and payments.
## 1. Implemented Features
- **Dual-Sheet Architecture:** The system now pulls attendance from two separate Google Sheet tabs—one for adult practices and another for junior practices.
- **New Views:**
- `/fees-juniors`: A dedicated dashboard showing junior attendances and calculated fees.
- `/reconcile-juniors`: A dedicated page matching Fio bank transactions against expected junior fees.
- **Granular Attendance Display:** The UI clearly separates and tallies adult (`A`) and junior (`J`) practice counts for each member (e.g., `4 (2A+2J)` or `2 (J)`).
## 2. Membership Rules
- **Identification:** A member is processed as a junior if they appear in the *Junior Sheet*, UNLESS:
- They are listed below the separator line `# Treneri` (or `# Trenéři`).
- Their tier is explicitly marked as `X`.
- **Adult Sheet Fallback:** Members from the Adult Sheet whose tier is marked as `J` are also tracked as juniors.
- **Merging Identities:** If a member has the identical name in both the Adult Sheet and the Junior Sheet, their attendance records are merged together into a single profile.
## 3. Fee Calculation Rules
The base fee calculation for juniors relies on the total combined attendance across both adult and junior practices for a given month:
- **0 attendances:** 0 CZK
- **Exactly 1 attendance:** `?` (Flags the month for manual review/decision)
- **2 or more attendances:** 500 CZK (Default base rate)
## 4. Exceptions & Overrides
We have hardcoded specific timeline and pricing exceptions directly into the logic:
- **Modified Monthly Rates:**
- **September 2025** (`2025-09`) is explicitly configured to have a fee of **250 CZK** for 2+ attendances instead of the default 500 CZK.
- **Merged Billing Months:**
To handle holidays and off-seasons, certain subsequent months are merged and billed as a single period. Their attendances are summed up before the fee rule is applied. The current active merges are:
- **December 2025** is merged into **January 2026**
- **September 2025** is merged into **October 2025**