Configure: Western Cape Schools Cycling Annual Leaderboard
|
This procedure assumes the Leaderboard
Model — it is the operator’s "set it up" companion to that design. Read the model first if you
are unsure what a |
1. Outcome
A configured set of leaderboards for the Western Cape Schools Cycling (WCSC) season, ready to be populated from imported race results:
-
School and Top Schools boards ranking schools by aggregate points, split by PS (Primary School) and HS (High School) level and by gender.
-
An All Stars board combining the male and female school totals.
-
An Individual Rider board ranking riders by season-wide points.
All boards score with the default SASchoolCyclingSeriesPointsCalculator (1→250, 2→200, …
tapering to 1 for 68+) and group schools by EventParticipant.custom3 (the School CustomList).
2. Cadence
Once per season, when the WCSC series and its events have been created. Re-run only when the board structure changes (new level/gender split, new category). Per-event result import is a separate, recurring task — see Import Operations Guide.
3. Prerequisites
-
The WCSC Series exists for the season, with its series-level
EventCategoryrows in place (the categories riders are classified into). -
The School CustomList exists on the organisation and is mapped to
EventParticipant.custom3on the series' events, so imported EPs carry their school. -
The PS and HS
CustomListValue`s exist (the level classification used as `levelFilter). -
You have the target environment’s series id and series-category ids to hand (query them in the target DB — they are environment-specific, not fixed).
4. Steps
4.1. 1. Decide the board matrix
WCSC boards are the product of level (PS, HS) × gender (Male, Female) × type. A typical season is:
| Board | type |
Filters | Notes |
|---|---|---|---|
Top Schools — PS Boys |
|
|
|
Top Schools — PS Girls |
|
|
|
Top Schools — HS Boys |
|
|
|
Top Schools — HS Girls |
|
|
|
All Stars — PS |
|
|
Combines PS Boys + PS Girls school totals |
All Stars — HS |
|
|
|
Individual Rider |
|
optional |
Season-wide per- |
A plain School (SCHOOL) board — every result counted, no topCount — can be added where a
total-participation ranking is wanted alongside Top Schools.
4.2. 2. Create the Leaderboard rows
For each board, create a Leaderboard with:
-
series= the WCSC series. -
type,gender,levelFilter,topCount,resultLimitper the matrix. -
groupByList= the School CustomList. -
pointsCalculatorClass= leave blank to use the defaultSASchoolCyclingSeriesPointsCalculator, or set it explicitly for clarity. -
active= true.
-- Illustrative; substitute the real series id, levelFilter CustomListValue id,
-- and School CustomList id for the target environment.
INSERT INTO leaderboard
(name, type, gender, top_count, result_limit, active,
points_calculator_class, series_id, level_filter_id, group_by_list_id)
VALUES
('Top Schools — HS Boys', 'T', 'M', 5, 50, 1,
'SASchoolCyclingSeriesPointsCalculator', :seriesId, :hsValueId, :schoolListId);
4.3. 3. Wire each board to its series categories
Add a LeaderboardCategory row for every series category that feeds the board (this replaces
the old hardcoded series_category_id IN (…) lists). Set pointsMultiplier only where a
category is weighted differently.
INSERT INTO leaderboard_category (leaderboard_id, series_category_id, points_multiplier)
VALUES (:leaderboardId, :seriesCategoryId, NULL);
4.4. 4. Populate the standings
Until Leaderboard Sync lands, standings
are aggregated manually from RaceResult.points. Ensure each event’s results have been
imported with correct points (default calculator), then run the season aggregation that groups
by school (custom3), applies the level/gender filters, and — for Top Schools — keeps only the
best topCount per school.
5. Verification
-
Each intended board exists with the right
type/gender/levelFilter/topCount. -
Every board has at least one
LeaderboardCategoryrow; the set matches the season’s categories for that level. -
Spot-check one school’s total against the underlying
RaceResult.pointsfor its riders in the relevant categories. -
PS and HS boards do not bleed into each other (a rider’s
custom1level matches the board’slevelFilter).
6. Recovery
-
Wrong points on a board → the scoring happened at import; re-import the affected event’s results (default calculator) per Import Operations Guide, then re-aggregate.
-
Missing school → check the EP’s
custom3(school) is set; schools with nocustom3are excluded by design. -
Board double-counts or omits a category → audit the board’s
LeaderboardCategoryrows.
7. References
-
Leaderboard Model & Result Classification — the schema and classification this procedure configures.
-
Configure: WP Cycling Road League Leaderboard — the sibling procedure; same model, different scoring and grouping.
-
Import Operations Guide — importing results with the correct points calculator.