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,21 @@
---
i have new attendance sheet specifically for juniors over here: https://docs.google.com/spreadsheets/d/1E2e_gT_K5AwSRCDLDTa2UetZTkHmBOcz0kFbBUNUNBA/edit?gid=1213318614#gid=1213318614
I would like you to treat as junior anyone in that sheet
- who does not have tier: X
- is above line that says in column A: # Treneri
i want to create similar page as we have in /fees, but for juniors - let's give it path /fees-juniors
i want you to merge monthly attendance from both sheets in the document, but from the first sheet collect only attendance for members in tier: J
Rules for monthly payments will be:
- attended only once - put ? mark as output
- 2 and more: 500 czk per month
Also i want to have an option to merge multiple subsequent months to act as one for the payment, for now give me an option to specify it in some datastructure in the code, later we might read it from google sheet. Immediatelly prepare merge of january and february 2026
Also even though now the monthly payment is one value, i would like to have it configurable per month, for now prepare exception for september 2025 with 250
---
cool, now i need an improvement: if the member name in both sheets is exactly the same i want to treat it as one person. Also i want you to keep attendances from "adult practice" (first sheet) and juniors practices (other one) in a datastructure separately, so that you can display primarily sum of those, but also each of them (in brackets after sum) so that we have better visibility

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**