from flask_restx import fields
from marshmallow import Schema, fields as ma_fields, validate


class BrandSchema(Schema):
    name = ma_fields.StringField(
        required=True,
        help_text="Name of the brand."
    )
    parent_brand = ma_fields.ReferenceField(
        'self',
        help_text="Reference to the parent brand.",
    )
    products = ma_fields.ListField(
        ma_fields.ReferenceField('Product'),
        help_text="References to the products associated with the brand.",
    )
    description = ma_fields.StringField(
        help_text="A brief description of the brand.",
    )
    logo_url = ma_fields.StringField(
        help_text="URL of the brand's logo.",
    )
    country = ma_fields.StringField(
        help_text="Country where the brand is based.",
    )
    website = ma_fields.URLField(
        help_text="Official website URL of the brand.",
    )
    founded_date = ma_fields.DateTimeField(
        help_text="Date when the brand was founded.",
    )