refactor(app): extract view-model builders into scripts/views.py #15
Reference in New Issue
Block a user
Delete Branch "feat/m5-python-views-extraction"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
adults_view,juniors_view, andpaymentsinto three pure builder functions inscripts/views.py:build_adults_view_model,build_juniors_view_model,build_payments_view_modelget_month_labels,group_payments_by_person, andadapt_junior_membersout ofapp.pyintoviews.py(view-model concerns, not Flask concerns)record_steptiming + a singlerender_templatecall (~25 lines each vs 167/205/35 before)Why
Prep for M5 of the Go rewrite: the
/api/*shadow endpoints will be one-liners calling the same builders +jsonify(vm), with no logic duplication.Test plan
make test— 27/27 green/adults,/juniors,/paymentsrender identically to before🤖 Generated with Claude Code