dodil/erp-brick-time-off
DODIL ERP brick: time off
src/brick_time_off/application/inputs.py
"""The bounded inputs of this brick's use cases (BRICKS.md: an unbounded int or str is a promise the engine cannot keep)."""
from typing import Annotated, Literal
from erp_platform.types import text
from pydantic import Field, WithJsonSchema
Code = text(64, min_length=1)
Reason = text(500)
Note = text(500)
Ref = text(140)
Part = Literal["full", "am", "pm"]
# A date given as text, parsed by the use case AFTER the permission gate: a caller without the permission is told so (403), not that
# their date is malformed (422).
DateText = Annotated[str, Field(max_length=32), WithJsonSchema({"type": "string", "format": "date", "description": "a date like 2026-12-21"})]
Document = Annotated[str, Field(max_length=4_300_000)] # a base64 document of at most 3 MiB
DocType = Literal["application/pdf", "image/jpeg", "image/png"]