Query Handler: GetTradeAssistInputByTeamIdQueryHandler
QueryType: GetTradeAssistInputByTeamId
Endpoint: POST /api/readmodel
Authentication: Bearer JWT, requires Member role
Summary
Returns the raw TradeAssistInput payload that would be sent to the modelling API for a saved SuperCoach team. This is a diagnostic endpoint useful for inspecting the exact data being sent to the modelling service, without actually calling the modelling API.
Request
{
"QueryType": "GetTradeAssistInputByTeamId",
"SupercoachTeamId": "123e4567-e89b-12d3-a456-426614174000",
"TradesLeft": 5,
"NumbersOfTradesToSuggest": [1, 2, 3],
"FinalRound": 27
}
| Field |
Type |
Required |
Description |
SupercoachTeamId |
GUID |
Yes |
The saved SuperCoach team ID |
TradesLeft |
int |
Yes |
Number of trades remaining for the season |
NumbersOfTradesToSuggest |
int[] |
No |
How many trades to suggest per scenario (default: [1, 2, 3]) |
FinalRound |
int |
No |
Final round of the season (default: 27) |
Response
Returns the TradeAssistInput object — the exact payload prepared for the modelling API.
{
"Round": 10,
"FinalRound": 27,
"NumbersOfTradesToSuggest": [1, 2, 3],
"Team": {
"SalaryLeft": 50000,
"TradesLeft": 5,
"Players": {
"12345": {
"Id": "12345",
"Index": 0,
"SelectedPosition": 7,
"SelectionStatus": 2,
"FantasyRoundScore": 55
},
"67890": {
"Id": "67890",
"Index": 1,
"SelectedPosition": 6,
"SelectionStatus": 0,
"FantasyRoundScore": null
}
}
}
}
Response Fields
| Field |
Type |
Description |
Round |
int |
Current round number (upcoming/in-progress) |
FinalRound |
int |
Final round of the season |
NumbersOfTradesToSuggest |
int[] |
Trade scenarios requested |
Team |
TradeAssistTeam |
Team data with players |
TradeAssistTeam
| Field |
Type |
Description |
SalaryLeft |
int |
Remaining salary cap in dollars |
TradesLeft |
int |
Number of trades remaining |
Players |
Dictionary<string, TradeAssistPlayer> |
Players keyed by FoxSports player ID |
TradeAssistPlayer
| Field |
Type |
Description |
Id |
string |
FoxSports player ID |
Index |
int |
Player order index |
SelectedPosition |
int |
Position enum (see Position Mapping below) |
SelectionStatus |
int |
Selection status enum (see Status Mapping below) |
FantasyRoundScore |
int? |
Fantasy score from last completed round (null if unavailable) |
Position Mapping
| Value |
Position |
| 0 |
INT (Interchange/Flex) |
| 1 |
FLB (Fullback) |
| 2 |
CTW (Centre/Wing) |
| 3 |
5/8 (Five-Eighth) |
| 4 |
HFB (Halfback) |
| 5 |
2RF (Second Row Forward) |
| 6 |
FRF (Front Row Forward) |
| 7 |
HOK (Hooker) |
Selection Status Mapping
| Value |
Status |
| 0 |
Captain (double points) |
| 1 |
Vice-Captain |
| 2 |
Selected (on field) |
| 3 |
Reserve (auto-sub eligible) |
| 4 |
Bench |
How It Works
- Validate authenticated user from JWT token
- Load team from database by
SupercoachTeamId
- Translate internal player IDs to FoxSports IDs via the mapped-players provider (
IMappedPlayersProvider)
- Determine current round from the NRL Premiership season
- Fetch player stats for the last completed round
- Build and return the
TradeAssistInput payload (does NOT call the modelling API)
Error Handling
| Scenario |
Behaviour |
| Invalid user credentials |
Throws UnauthorizedAccessException (401) |
| Team not found |
Returns empty result set |
| Empty roster |
Returns empty result set |
| Unable to determine current round |
Defaults to round 1, last completed round 0 |