feat: update contract_version to read from config (#38) #44
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "38-update-contract-version"
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
Update the sign endpoint to derive
contract_versionfromteam.contract_config(season + variant) instead of hardcoding version strings based on team name patterns. Keeps the existing team-name-based fallback for teams with NULL config.Changes
src/routes/contract/[token]/sign/+server.ts— Querycontract_configcolumn alongsidenamefrom teams table. Whencontract_config.variantandcontract_config.seasonare present, construct version string from config data. Otherwise fall back to existingteamName.includes()logic.Test Plan
npm test— 30/30 tests passnpm run check— no new type errors (pre-existing@types/node/@types/pgerrors unchanged)contract_configset get data-driven version; teams without config get fallback behaviorReview Checklist
npm test— 30/30)Related
Closes #38
Related Notes
N/A
QA Review — PR #44
Diff reviewed: 1 file, +18/-8 lines in
src/routes/contract/[token]/sign/+server.tsFindings
SELECT name, contract_config— matches the spec from #38.teamConfig?.variantandteamConfig?.seasonbefore using them./\d{4}/) with'2026'fallback is defensive.includes()logic).@types/node/@types/pgissues are unchanged."spring"segment is hardcoded in the config-driven path (${year}-spring-${teamConfig.variant}-v1). If a future season drops "spring," this will need updating. Acceptable for now since all current contracts are spring.VERDICT: APPROVED