"""Schema for Marketing Highlights.""" import marshmallow from marshmallow import fields, validate class HighlightProjectionPostSchema(marshmallow.Schema): """Marketing Highlight Projection POST Schema for an individual item.""" territory_id = fields.Int(required=True, default=None, allow_none=False) spotify_projection = fields.Float(required=True, default=None, allow_none=True) apple_projection = fields.Float(required=True, default=None, allow_none=True) downloads_projection = fields.Float(required=True, default=None, allow_none=True) highlight = fields.String(required=True, default=None, allow_none=True) priority = fields.String(required=False, default=None, allow_none=True) class HighlightProjectionsPostItems(marshmallow.Schema): """Marketing Highlight Projections POST Schema.""" items = fields.Nested(HighlightProjectionPostSchema, required=True, many=True, validate=validate.Length( min=1, error='Field may not be an empty list') )