add http-api
This commit is contained in:
23
http-api/models.py
Normal file
23
http-api/models.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from typing import Annotated
|
||||
|
||||
import shortuuid
|
||||
from layercake.extra_types import CnpjStr
|
||||
from pydantic import BaseModel, Field, StringConstraints
|
||||
|
||||
|
||||
class Org(BaseModel):
|
||||
id: str
|
||||
name: Annotated[str, StringConstraints(strip_whitespace=True)]
|
||||
cnpj: CnpjStr | None = None
|
||||
|
||||
|
||||
class Cert(BaseModel):
|
||||
id: str
|
||||
exp_interval: int
|
||||
|
||||
|
||||
class Course(BaseModel):
|
||||
id: str = Field(default_factory=shortuuid.uuid)
|
||||
name: str
|
||||
cert: Cert | None = None
|
||||
access_period: int | None = None
|
||||
Reference in New Issue
Block a user