Verification totals: handicap_engine.py unit tests went from 63 → 98 (all passing), plus 400+ scratch-API checks across the eight formats' test scripts, covering both frittstående runder and the appropriate org-scoped system (team or individual) for each. test_isolation.sql stayed 12/12 throughout — migrations 041–050 are purely additive.
A few real things surfaced and were fixed during testing:
Nassau can be blocked by the existing "match already decided" lock (ADR-012) if the overall 18-hole match closes early — documented as a known v1 limitation, not fixed (would mean loosening an established safety guard).
Københavner's points depend on all 3 players at once, breaking the usual "recompute one participant" pattern — handled with a dedicated recompute path.
High-low-high doesn't fit the existing win/loss/halved match cache, so it gets its own dedicated read endpoint (like Nassau) — verified digit-for-digit against your own worked example ("1-1 etter hull 1", "2-1 til lag 2").
Two missing-column crashes (caught in scratch, never reached anything resembling "done").
20 lines
1.3 KiB
SQL
20 lines
1.3 KiB
SQL
-- =====================================================================
|
|
-- TeeCup — High-low-high, migrasjon 050. Siste (åttende) av de nye
|
|
-- turneringsformatene denne runden.
|
|
--
|
|
-- 2 lag à 2 spillere -- strukturelt identisk med fourball (individuell
|
|
-- ball, round_hole/hole_score keyet per SPILLER, ikke per side). INGEN
|
|
-- nye kolonner -- per-hull-rangeringen (høy/lav) og poengtellingen
|
|
-- regnes helt ved LESING (handicap_engine.py sin high_low_high_points_
|
|
-- for_hole/high_low_high_running_score), ingen cache-kolonne (samme
|
|
-- "regn ut ved lesing"-filosofi som Nassau).
|
|
-- =====================================================================
|
|
\set ON_ERROR_STOP on
|
|
|
|
ALTER TABLE round DROP CONSTRAINT round_play_format_check;
|
|
ALTER TABLE round ADD CONSTRAINT round_play_format_check
|
|
CHECK (play_format IN ('stroke', 'match', 'skins', 'fourball', 'foursome', 'greensome', 'scramble_2', 'scramble_4', 'stableford', 'chapman', 'copenhagen', 'bbb', 'flag', 'shamble', 'money_ball', 'high_low_high'));
|
|
|
|
ALTER TABLE session DROP CONSTRAINT session_format_check;
|
|
ALTER TABLE session ADD CONSTRAINT session_format_check
|
|
CHECK (format IN ('singles', 'fourball', 'foursome', 'greensome', 'scramble_2', 'scramble_4', 'chapman', 'shamble', 'money_ball', 'high_low_high'));
|