from pydantic import BaseModel, Field, PositiveInt


class PictureAsset(BaseModel):
    id: str = Field(min_length=1)
    name: str = Field(min_length=1)
    image_path: str = Field(min_length=1)


class PictureContainer(BaseModel):
    position: PositiveInt
    quantity: PositiveInt
    picture: PictureAsset


class NumberCard(BaseModel):
    position: PositiveInt
    value: PositiveInt
    shows_blocks: bool = True
    has_answer_box: bool = True


class JoinPicturesWithQuantityProblem(BaseModel):
    instructions: str = "Cuenta las imágenes y une cada grupo con el número correcto."
    left_containers: list[PictureContainer]
    number_cards: list[NumberCard]
    right_containers: list[PictureContainer]


class JoinPicturesWithQuantityRequest(BaseModel):
    available_pictures: list[PictureAsset] = Field(min_length=1)
    container_count_per_side: PositiveInt = 5
    min_quantity: PositiveInt = 1
    max_quantity: PositiveInt = 10
    seed: int | None = None
