"""Schema for get_orders.""" from marshmallow import fields, pre_load from marshmallow import Schema class GetProductPhysicalChangeHistorySchema(Schema): """Validation schema for GET /product//change_history .""" store_id = fields.Integer(required=True) product_ids = fields.List(fields.Integer(required=True), required=True) @pre_load def deconstruct_lists(self, data, **kwargs): """Pre load args.""" if 'product_ids' in data: data['product_ids'] = data['product_ids'] \ .replace(' ', '') \ .split(',') return data