from flask_restx import fields
from marshmallow import Schema, fields 

product_dict = {
    "name": fields.String(
        required=True, 
        help_text="Name of the product."
    ),
    "poster_image": fields.String(
        help_text="URL/Path Poster image for the spot."
    ),
    "brand": fields.List(fields.String,
        help_text="Reference to the product's brand."
    ),  
    "spots": fields.List(
        fields.String(),
        required=True, 
        help_text="References to the spots featuring the product."
    ),
}


class ProductSchema(Schema):
    """
    Represents a product.
    """
    name = fields.Str(
        required=True, 
        help_text="Name of the product."
    )
    poster_image = fields.String(
        help_text="URL/Path Poster image for the spot."
    )
    brand = fields.String(required=True, 
        help_text="Reference to the product's brand."
    )  
    spots = fields.List(
        fields.String(),
        required=False, 
        help_text="References to the spots featuring the product."
    )
