feat(14-01): add sector CRUD backend with migration, model, service, and router

- Create sectors table migration (034) with RLS and devices.sector_id FK
- Add Sector ORM model with site_id and tenant_id foreign keys
- Add SectorCreate/Update/Response/ListResponse Pydantic schemas
- Implement sector_service with CRUD and device assignment functions
- Add sectors router with GET/POST/PUT/DELETE and device sector assignment
- Register sectors router in main.py
- Add sector_id and sector_name to Device model and DeviceResponse

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jason Staack
2026-03-19 06:40:44 -05:00
parent 0434d31030
commit ea5afe3408
13 changed files with 613 additions and 13 deletions

View File

@@ -90,6 +90,8 @@ class DeviceResponse(BaseModel):
groups: list[DeviceGroupRef] = []
site_id: Optional[uuid.UUID] = None
site_name: Optional[str] = None
sector_id: Optional[uuid.UUID] = None
sector_name: Optional[str] = None
created_at: datetime
model_config = {"from_attributes": True}