class RestaurantSchema(ma.Schema): business_id = fields.String() name = fields.String() is_open = fields.Integer() food_type = fields.List(fields.String()) URL = fields.String() location = fields.Nested(LocationSchema) menus = fields.Nested(MenuItemSchema)
class UserSchema(ma.SQLAlchemySchema): id = fields.Integer() name = fields.String(validate=must_not_be_blank) surname = fields.String(validate=must_not_be_blank) email = fields.Email(validate=must_not_be_blank) username = fields.String(validate=must_not_be_blank) password = fields.String(validate=must_not_be_blank) role_id = fields.Integer(data_key='roleId', validate=must_not_be_blank) department_id = fields.Integer( data_key='departmentId', validate=must_not_be_blank) address_id = fields.Integer( data_key='addressId', validate=must_not_be_blank) created_on = fields.DateTime(data_key='createdOn') updated_on = fields.DateTime(data_key='updatedOn')
class AddressSchema(ma.SQLAlchemySchema): id = fields.Integer() street_name = fields.String( data_key='streetName', validate=must_not_be_blank) city_id = fields.Integer(data_key='cityId', validate=must_not_be_blank) created_on = fields.DateTime(data_key='createdOn') updated_on = fields.DateTime(data_key='updatedOn')
class CitySchema(ma.SQLAlchemyAutoSchema): id = fields.Integer() name = fields.String(validate=must_not_be_blank) country_id = fields.Integer( data_key="countryId", validate=must_not_be_blank) created_on = fields.DateTime(data_key='createdOn') updated_on = fields.DateTime(data_key='updatedOn')
class AreaSchema(Schema): id = fields.Integer() name = fields.String() districts = ma.Nested('self', only=('id', 'name')) class Meta: fields = ('id', 'name', 'districts')
class XssSchema(): id = fields.Integer() user_id = fields.Integer(data_key='userId', validate=must_not_be_blank) text = fields.String(data_key="text", validate=must_not_be_blank) value = fields.Float(data_key='value', validate=must_not_be_blank) is_sqli = fields.Boolean(data_key='isSqli', validate=must_not_be_blank) created_on = fields.DateTime(data_key='createdOn') updated_on = fields.DateTime(data_key='updatedOn')
class UserSchema(ma.Schema): id = fields.Integer() name = fields.String(required=True) phone_number = fields.String(required=True) email = fields.String(required=True) sex = fields.String() age = fields.String() location = fields.String(required=True) created_date = fields.DateTime()
class DepartmentSchema(ma.SQLAlchemySchema): id = fields.Integer() name = fields.String() created_on = fields.DateTime(data_key='createdOn') updated_on = fields.DateTime(data_key='updatedOn')
class RoleSchema(ma.SQLAlchemySchema): id = fields.Integer() name = fields.String(validate=must_not_be_blank) created_on = fields.DateTime(data_key='createdOn') updated_on = fields.DateTime(data_key='updatedOn')
class UserSchema(ma.Schema): id = fields.Integer(dump_only=True, ) username = fields.String(required=True, validate=Length(min=5, max=255)) password = fields.String(required=True, validate=Length(min=8, max=255)) creation = fields.DateTime('%y %m %d', required=True, dump_only=True)
class JobSchema(ma.Schema): id = fields.String() name = fields.String() status = fields.String() tasks = fields.Nested(TaskSchema, many=True)
class TaskSchema(ma.Schema): id = fields.String() name = fields.String()
class MachineSchema(ma.Schema): id = fields.String() name = fields.String() type = fields.String() enabled = fields.String() running = fields.String()
class LocationSchema(ma.Schema): address = fields.String() city = fields.String() post_code = fields.String()
class MenuItemSchema(ma.Schema): name = fields.String() description = fields.String() price = fields.String()