2026-05-25 09:05:17 +01:00
|
|
|
"""
|
2026-05-26 10:16:59 +01:00
|
|
|
Pydantic models for the service module
|
2026-05-25 09:05:17 +01:00
|
|
|
|
|
|
|
|
Models:
|
|
|
|
|
- List: Description
|
|
|
|
|
- Models: Description
|
2026-05-26 10:16:59 +01:00
|
|
|
"""
|
|
|
|
|
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
|