-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Task
Implement POST /lamps/bulk-toggle with request-scoped caching to avoid querying the same room multiple times.
Endpoint
POST /lamps/bulk-toggle
{
"lampIds": ["uuid1", "uuid2", "uuid3"],
"status": true
}Functional Requirement
Must not query the same room multiple times even if multiple lamps belong to the same room.
Implementation Hints
- Use a
Dictionary<Guid, Room>as request-scoped cache - EF Core's change tracker may already cache entities within a DbContext scope
- Verify behavior and add explicit caching if needed
Acceptance Criteria
- Bulk toggle updates all specified lamps
- Room validation occurs for each lamp (room must be active)
- Same room is only queried once per request (verify with EF logging)
- Returns 422 if any lamp belongs to deleted room
Parent Issue
Relates to #289
Reactions are currently unavailable