1
0
Fork 0
Commit graph

2 commits

Author SHA1 Message Date
db98adbcee fix(game-structures): repair Labor Crew panel data loading
- Read labor requirements via useAllFormFields + reduceFieldsToValues:
  useField on an array path returns the row count, not rows, so
  requirementList.flatMap threw and raised the "Failed to load labor
  data" toast on every page load
- Use valid REST where syntax (where[structure][equals]= plus
  positionType/status filters); the dot-notation key was silently
  ignored and returned every staffing doc unfiltered
- Match staffing rows by raw relationship id at depth=0;
  m.laborClassification?.id never matched numeric ids
- Validate fetch responses and show a distinct load-failure message
  instead of the misleading "no classifications configured" empty state
- Give the Apply button type="button" so it stops submitting the
  whole document form on every click
2026-10-10 13:23:52 -04:00
0370df6c2d feat(game-structures): add Labor Crew admin panel for staffing writes
Wire the previously orphaned LaborCrewPanel into the game-structures
editor so staff can set actual headcount and per-worker wage for a
labor classification. Adds a laborCrewPanel ui field on the edit view,
a POST route under /api/game-structures that authenticates and gates on
game-structures:update, delegates to the canonical setLaborHeadcount
service (enforcing caps and wage logic), and an integration test
covering auth, validation, and cap enforcement.
2026-10-07 23:28:35 -04:00