from marshmallow import Schema, fields, validate

ALLOWED_SLOTS = ("hero", "side_top", "side_bottom")


class HomeBannerSchema(Schema):
    id = fields.Integer(dump_only=True)
    slot = fields.String(dump_only=True)
    title = fields.String(allow_none=True, validate=validate.Length(max=180))
    subtitle = fields.String(allow_none=True)
    image_url = fields.String(allow_none=True, validate=validate.Length(max=500))
    cta_label = fields.String(allow_none=True, validate=validate.Length(max=60))
    cta_link = fields.String(allow_none=True, validate=validate.Length(max=255))
    is_active = fields.Boolean(load_default=True)
    updated_at = fields.DateTime(dump_only=True)
