S5 (a1): prop viability — lineups, injury wire, date navigation
- lineupService: statsapi hydrate=lineups (live shape verified) → CONFIRMED (batting slot) / NOT_IN (team posted without the player) / PROJECTED (not posted). 10-min cache, pure parser, injectable. - NOT_IN visibly KILLS the grade on the slate: struck through + NOT IN LINEUP chip, parlay/book actions suppressed. The locked ledger read is untouched — honesty is showing the read is dead, not deleting it. - injuryService: ESPN injuries feed → OUT/GTD/PROB chips (unknown status → no chip, never invented). Chips on slate strips via ViabilityChips. - Date navigation on the Slate: YESTERDAY (results surface — finals + THE SETTLE panel of that date's settled reads w/ outcome + CLV chips, via new ?date= filter on /api/ledger/model) / TODAY / TOMORROW (schedule until lines post). Odds/grades/pitcher layers are TODAY's and never fake other dates; 60s poll only refreshes today. - Routes /api/schedule/:sport/lineups + /injuries + Next proxies. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -49,6 +49,38 @@ router.get('/:sport/pitchers', async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
// Session 64 (A1-S5) — MLB lineup confirmation. { byPlayer, postedTeams };
|
||||
// consumers resolve CONFIRMED / NOT_IN / PROJECTED via the posted-team rule.
|
||||
router.get('/:sport/lineups', async (req, res) => {
|
||||
const sport = String(req.params.sport || '').toLowerCase();
|
||||
if (sport !== 'mlb') return res.set(MISSION_HEADER).json({ sport, byPlayer: {}, postedTeams: [] });
|
||||
const date = req.query.date || scheduleService.todayET();
|
||||
try {
|
||||
const { fetchLineups } = require('../services/lineupService');
|
||||
const parsed = await fetchLineups(date);
|
||||
res.set('Cache-Control', 'public, max-age=300');
|
||||
return res.set(MISSION_HEADER).json({ sport, date, ...parsed });
|
||||
} catch (err) {
|
||||
console.error('[schedule/lineups]', err.message);
|
||||
return res.set(MISSION_HEADER).json({ sport, date, byPlayer: {}, postedTeams: [] });
|
||||
}
|
||||
});
|
||||
|
||||
// Session 64 (A1-S5) — the injury wire (ESPN feed): { byPlayer: { key:
|
||||
// { status: OUT|GTD|PROB, detail, team } } }. Accurate chips, no cascades yet.
|
||||
router.get('/:sport/injuries', async (req, res) => {
|
||||
const sport = String(req.params.sport || '').toLowerCase();
|
||||
try {
|
||||
const { fetchInjuries } = require('../services/injuryService');
|
||||
const byPlayer = await fetchInjuries(sport);
|
||||
res.set('Cache-Control', 'public, max-age=600');
|
||||
return res.set(MISSION_HEADER).json({ sport, byPlayer });
|
||||
} catch (err) {
|
||||
console.error('[schedule/injuries]', err.message);
|
||||
return res.set(MISSION_HEADER).json({ sport, byPlayer: {} });
|
||||
}
|
||||
});
|
||||
|
||||
router.get('/:sport', async (req, res) => {
|
||||
const sport = String(req.params.sport || '').toLowerCase();
|
||||
const date = req.query.date || scheduleService.todayET();
|
||||
|
||||
Reference in New Issue
Block a user