Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /rubelw_OSSS /src /OSSS /schemas /department.py
| # src/OSSS/schemas/department.py | |
| # Auto-generated by OSSS.schemas.codegen — DO NOT EDIT BY HAND | |
| from __future__ import annotations | |
| from typing import Optional, List | |
| from datetime import datetime | |
| from uuid import UUID | |
| from pydantic import Field | |
| from OSSS.schemas.base import APIModel | |
| # --- Lightweight nested ref for read responses --- | |
| class HRPositionRef(APIModel): | |
| """Minimal projection of an HR position for Department reads.""" | |
| id: UUID | |
| title: str | None = Field(default=None, description="Position title (if loaded)") | |
| # NOTE: Keep this light; avoid pulling full HRPosition schema to prevent circular imports. | |
| # --- Department read model --- | |
| class DepartmentOut(APIModel): | |
| school_id: UUID | |
| name: str | |
| created_at: datetime | |
| updated_at: datetime | |
| id: UUID | |
| # Expose related positions (if relationship is loaded) | |
| positions: List[HRPositionRef] = Field(default_factory=list) | |
| # --- Create/Replace/Patch payloads --- | |
| class DepartmentCreate(APIModel): | |
| school_id: UUID | |
| name: str | |
| # Optional: attach positions during creation (idempotent server-side) | |
| position_ids: List[UUID] = Field(default_factory=list, description="Positions to attach") | |
| # Server-managed; ignored if provided | |
| created_at: datetime | None = None | |
| updated_at: datetime | None = None | |
| class DepartmentReplace(APIModel): | |
| """ | |
| Full replacement (PUT semantics). Provide all fields. | |
| """ | |
| school_id: UUID | |
| name: str | |
| position_ids: List[UUID] = Field(default_factory=list) | |
| # Server-managed; ignored if provided | |
| created_at: datetime | None = None | |
| updated_at: datetime | None = None | |
| class DepartmentPatch(APIModel): | |
| """ | |
| Partial update (PATCH semantics). Supply only what changes. | |
| """ | |
| school_id: UUID | None = None | |
| name: str | None = None | |
| position_ids: List[UUID] | None = Field(default=None, description="Replace current set if provided") | |
| # Server-managed; ignored if provided | |
| created_at: datetime | None = None | |
| updated_at: datetime | None = None | |
| # --- List wrapper for index endpoints --- | |
| class DepartmentList(APIModel): | |
| items: List[DepartmentOut] | |
| total: int | None = None | |
| skip: int = 0 | |
| limit: int = 100 | |
| class DepartmentPatch(APIModel): | |
| school_id: Any | None = None | |
| name: str | None = None | |
| created_at: datetime | None = None | |
| updated_at: datetime | None = None | |
| class DepartmentList(APIModel): | |
| items: list[DepartmentOut] | |
| total: int | None = None | |
| skip: int = 0 | |
| limit: int = 100 | |
Xet Storage Details
- Size:
- 2.53 kB
- Xet hash:
- c8fa34b504b505064b584d33e30b6c0d3abc8b90cbc13930fe9c8e86315f494b
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.