feat: service module req/res models

This commit is contained in:
Chris Milne 2026-05-26 10:16:59 +01:00
parent b3689c8af6
commit 652dfb7b4a
2 changed files with 63 additions and 31 deletions

View file

@ -1,7 +1,35 @@
"""
Pydantic models for <this module>
Pydantic models for the service module
Models:
- List: Description
- Models: Description
"""
"""
from typing import Optional
from pydantic import EmailStr, ConfigDict
from src.schemas import CustomBaseModel
from src.organisation.constants import Status, ContactType
from src.contact.schemas import ContactAddress
class ServiceResponse(CustomBaseModel):
model_config = ConfigDict(from_attributes=True, extra="ignore")
id: int
name: str
class ServiceWithKeyResponse(ServiceResponse):
api_key: str
class ServiceGetServiceResponse(CustomBaseModel):
services: list[ServiceResponse]
class ServicePostServiceRequest(CustomBaseModel):
name: str
class ServicePostServiceResponse(CustomBaseModel):
service: ServiceWithKeyResponse
class ServicePatchKeyResponse(CustomBaseModel):
service: ServiceWithKeyResponse