Workflow
- •Load the provided
field.jsonand readpga_tournament_idandplayer_tiers. If a tournament ID is not explicitly provided, infer it fromfield.json. - •Load league and pool seeds to get
league_idandpool_idfor the target season. Usesrc/seed-data/lib/league.seed.tsand the relevantsrc/seed-data/lib/pools/<year>/pool.seed.ts. - •Parse the CSV with columns
Team_Name,Tier_num, andPlayer_Name. - •Normalize names for matching: trim, casefold, remove punctuation, collapse spaces, and strip diacritics.
- •Map each
Team_Nameto a league user ID by matching against usernameandnickname. Prefer exact matches, then normalized matches. If multiple candidates match, ask for confirmation. - •Map each
Player_Nameto a PGA player ID by matching againstplayer_tiersnames. Prefer exact matches, then normalized matches. If multiple candidates match, ask for confirmation. - •Build
picksas an object keyed by user ID. Each value is an array of 4 integers where index0..3corresponds to tier1..4. - •For any missing or unmapped pick, write
0in that tier and report the issue. - •Write
picks.jsonin the same directory as the inputfield.json.
Output Shape
- •Root keys:
league_id,pool_id,pga_tournament_id,picks. - •
picksvalues are always arrays of length 4.
Built-in Schema
Use this schema as the expected output shape (do not ask the user to paste it):
json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Pool Picks Schema",
"type": "object",
"properties": {
"league_id": {
"type": "string",
"description": "League ID",
"example": "15b26666-819a-460c-b7c2-2b2feb1613e2"
},
"pool_id": {
"type": "string",
"description": "Pool ID",
"example": "64033d48-0083-406f-9847-d0d096c3fbfd"
},
"pga_tournament_id": {
"type": "string",
"description": "PGA Tournament ID",
"example": "R2026004"
},
"picks": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "integer",
"description": "The PGA Player ID. The index of each value corresponds to the tier of the pick, i.e. index=1 correponds to tier 2. A value of 0 indicates no pick was made."
},
"minLength": 4,
"maxLength": 4
}
}
},
"required": [
"league_id",
"pool_id",
"pga_tournament_id",
"picks"
]
}
Checks
- •Ensure the
field.jsontournament ID matches any explicitly requested tournament ID before writing output. - •Ensure every CSV row targets tiers 1 through 4 only.
- •Report any ambiguous or missing team or player matches before finalizing.