from apistar import types, validators from cookie_api.util import Decimal class CookieSchema(types.Type): id = validators.Integer(allow_null=True) created_date = validators.DateTime(allow_null=True) modified_date = validators.DateTime(allow_null=True) name = validators.String(max_length=50) recipe_url = validators.String(max_length=255) sku = validators.String(max_length=55) qoh = validators.Integer(minimum=0) unit_cost = Decimal(minimum=0.0) class UserCreateSchema(types.Type): email = validators.String(max_length=255) password = validators.String(max_length=255) class UserExportSchema(types.Type): id = validators.Integer() created_date = validators.DateTime(allow_null=True) modified_date = validators.DateTime(allow_null=True) email = validators.String() admin = validators.Boolean() confirmed = validators.Boolean()