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>
19 lines
332 B
Python
19 lines
332 B
Python
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
|