-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvaluation-request.v1.schema.json
More file actions
328 lines (328 loc) · 8.42 KB
/
Copy pathvaluation-request.v1.schema.json
File metadata and controls
328 lines (328 loc) · 8.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/amethyst/amethyst-api/schemas/valuation-request.v1.schema.json",
"title": "Amethyst Engine POST /valuation/calculate (Draft upstream v1)",
"description": "Flat valuation context forwarded by AmethystDraft from leagues/rosters or Activity #9 fixtures. Mirror of Draft `apps/api/schemas/valuation-request.v1.schema.json` when present. player_id = MLB Stats API person id string (externalPlayerId).",
"type": "object",
"required": [
"roster_slots",
"scoring_categories",
"total_budget",
"drafted_players"
],
"properties": {
"roster_slots": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/$defs/rosterSlot"
}
},
"scoring_categories": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/$defs/scoringCategory"
}
},
"total_budget": {
"type": "number",
"exclusiveMinimum": 0
},
"num_teams": {
"type": "integer",
"minimum": 1
},
"league_scope": {
"type": "string",
"enum": [
"Mixed",
"AL",
"NL"
]
},
"drafted_players": {
"type": "array",
"items": {
"$ref": "#/$defs/draftedPlayer"
}
},
"schema_version": {
"type": "string",
"description": "Fixture / contract version from Draft (e.g. 1.0.0). engine also accepts camelCase schemaVersion."
},
"schemaVersion": {
"type": "string"
},
"league_id": {
"type": "string",
"description": "Optional stable league id from Draft; echoed in valuation `context_v2.scope.league_id`."
},
"checkpoint": {
"type": "string",
"description": "e.g. pre_draft | after_pick_10 | after_pick_50 | after_pick_100 | after_pick_130"
},
"budget_by_team_id": {
"type": "object",
"additionalProperties": {
"type": "number",
"minimum": 0
}
},
"scoring_format": {
"type": "string",
"enum": [
"5x5",
"6x6",
"points"
]
},
"hitter_budget_pct": {
"type": "number"
},
"pos_eligibility_threshold": {
"type": "number",
"description": "Reserved / informational only in v1 — engine does not compute games-by-position from Mongo. Use position_overrides for explicit eligibility."
},
"position_overrides": {
"type": "array",
"description": "Per-player eligibility from Draftroom (min-games rules). Replaces Mongo position/positions for slot fitting, baseline scarcity, replacement_slots_v2, team-adjusted value, and scarcity analysis.",
"items": {
"$ref": "#/$defs/positionOverrideEntry"
}
},
"injury_overrides": {
"type": "array",
"description": "Optional per-player injury severity from Draftroom (MLB roster / IL). Overrides Mongo catalog injurySeverity for the baseline injury pass only.",
"items": {
"$ref": "#/$defs/injuryOverrideEntry"
}
},
"strict_scoring_categories": {
"type": "boolean",
"description": "When true, valuation fails if scoring_categories includes names not modeled in v1 baselines. Default false: unsupported names yield scoring_category_warnings on the response."
},
"minors": {
"type": "array",
"items": {
"$ref": "#/$defs/teamBucket"
}
},
"taxi": {
"type": "array",
"items": {
"$ref": "#/$defs/teamBucket"
}
},
"deterministic": {
"type": "boolean"
},
"seed": {
"type": "number"
},
"player_ids": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"eligible_player_ids": {
"type": "array",
"description": "Optional whitelist of catalog player ids in the valuation universe (after league_scope). Omit or empty = full scoped catalog.",
"items": {
"type": "string",
"minLength": 1
}
},
"excluded_player_ids": {
"type": "array",
"description": "Optional blacklist applied after league_scope and eligible_player_ids.",
"items": {
"type": "string",
"minLength": 1
}
},
"inflation_model": {
"type": "string",
"enum": [
"global_v1",
"surplus_slots_v1",
"replacement_slots_v2"
],
"description": "global_v1 = league-wide list rescale. surplus_slots_v1 = single replacement slice. replacement_slots_v2 = slot/position-aware replacement + surplus (official default when omitted)."
},
"pre_draft_rosters": {
"description": "Keepers / pre-draft rosters: either a map team_id → rows, or an array of { team_id, players } (Draft BFF finalize payload).",
"oneOf": [
{
"type": "object",
"additionalProperties": {
"type": "array"
}
},
{
"type": "array",
"items": {
"$ref": "#/$defs/teamBucket"
}
}
]
},
"user_team_id": {
"type": "string",
"description": "Optional team context for team_adjusted_value; defaults to team_1 when omitted."
},
"explain_valuation_rows": {
"type": "boolean",
"description": "When true, each valuations[] row may include valuation_explain (slot/replacement + pool context + baseline risk multipliers: age, depth, injury — informational only)."
},
"recommended_bid_soft_cap_ratio": {
"type": "number",
"minimum": 1,
"maximum": 5,
"description": "Optional: after smoothing, clamp recommended_bid to at most this multiple of auction_value (auction_value unchanged)."
}
},
"$defs": {
"positionOverrideEntry": {
"type": "object",
"required": ["player_id", "positions"],
"additionalProperties": false,
"properties": {
"player_id": {
"type": "string",
"minLength": 1
},
"positions": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"minLength": 1
}
}
}
},
"injuryOverrideEntry": {
"type": "object",
"required": ["player_id", "injury_severity"],
"additionalProperties": false,
"properties": {
"player_id": {
"type": "string",
"minLength": 1
},
"injury_severity": {
"type": "integer",
"minimum": 0,
"maximum": 3
}
}
},
"rosterSlot": {
"type": "object",
"required": [
"position",
"count"
],
"properties": {
"position": {
"type": "string"
},
"count": {
"type": "integer",
"minimum": 1
}
},
"additionalProperties": false
},
"scoringCategory": {
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"batting",
"pitching"
]
}
},
"additionalProperties": false
},
"draftedPlayer": {
"type": "object",
"required": [
"player_id",
"name",
"position",
"team",
"team_id"
],
"properties": {
"player_id": {
"type": "string",
"minLength": 1
},
"name": {
"type": "string"
},
"position": {
"type": "string"
},
"team": {
"type": "string"
},
"team_id": {
"type": "string"
},
"paid": {
"type": "number",
"minimum": 0
},
"positions": {
"type": "array",
"items": {
"type": "string"
}
},
"is_keeper": {
"type": "boolean"
},
"roster_slot": {
"type": "string"
},
"pick_number": {
"type": "integer"
}
},
"additionalProperties": false
},
"teamBucket": {
"type": "object",
"required": [
"team_id",
"players"
],
"properties": {
"team_id": {
"type": "string"
},
"players": {
"type": "array",
"items": {
"$ref": "#/$defs/draftedPlayer"
}
}
},
"additionalProperties": false
}
}
}