feat(l1): seat_enforcement service for engineer + L1 seat limits
Shared helper used by invite, accept-invite, and role-change endpoints (integrated in T8). Counts active users by role against role-specific seat limit on subscription (engineer → seat_limit, l1_tech → l1_seat_limit). None limit = unlimited. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
18
backend/app/schemas/seat_enforcement.py
Normal file
18
backend/app/schemas/seat_enforcement.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from typing import Literal, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
Role = Literal['engineer', 'l1_tech']
|
||||
|
||||
|
||||
class SeatCheckResult(BaseModel):
|
||||
available: bool
|
||||
current: int
|
||||
limit: Optional[int] # None = unlimited
|
||||
role: Role
|
||||
|
||||
|
||||
class SeatUsage(BaseModel):
|
||||
engineer: SeatCheckResult
|
||||
l1_tech: SeatCheckResult
|
||||
Reference in New Issue
Block a user