from typing import Optional
from pydantic import BaseModel, Field

from .models import Entity, Institution, Individual, Corporation
from ..core.schemas import Writer


class EntityRead(Entity):
    pass


class EntityCreate(Writer):
    entity_data: Individual | Corporation | Institution = Field(..., discriminator='type')
    address: str = Field(default="", title='Adresse')

    class Config:
        title = "Création d'un client"


class EntityUpdate(EntityCreate):
    pass
