Exemplo n.º 1
0
 def readAll(propertyId):
     # Authenticate
     # All Access
     # Call Service Layer
     response = ImageService.readAll(propertyId)
     return ResponseFormatter.getFormmattedServiceListResponse(
         ImageConverter.toResource, response)
Exemplo n.º 2
0
 def getAll(customerId):
     # Authenticate
     authenticator = Authenticator(request.headers.get(HeaderKey.TOKEN)).allowAgent().allowCustomer(customerId)
     authentification = authenticator.authenticate()
     if FieldKey.ERROR in authentification:
         return ResponseFormatter.getFormattedValidatorResponse(authentification)
     # Call Service Layer
     response = ViewingService.readAll(customerId)
     return ResponseFormatter.getFormmattedServiceListResponse(ViewingConverter.toResource, response)
 def readAll(ownerId):
     # Authenticate
     authenticator = Authenticator(request.headers.get(HeaderKey.TOKEN)).allowAgent().allowOwner(ownerId)
     authentification = authenticator.authenticate()
     if FieldKey.ERROR in authentification:
         return ResponseFormatter.getFormattedValidatorResponse(authentification)
     # Call Service Layer
     response = PropertyService.readAll(ownerId)
     return ResponseFormatter.getFormmattedServiceListResponse(PropertyConverter.toResource, response)
 def history(ownerId):
     # Authenticate
     authenticator = Authenticator(request.headers.get(HeaderKey.TOKEN)).allowAgent().allowOwner(ownerId)
     authentification = authenticator.authenticate()
     if FieldKey.ERROR in authentification:
         return ResponseFormatter.getFormattedValidatorResponse(authentification)
     # Create Domain Instance
     start = request.args.get('start', default=None, type=str)
     end = request.args.get('end', default=None, type=str)
     # Call Service Layer
     response = PropertyService.history(ownerId, start, end)
     return ResponseFormatter.getFormmattedServiceListResponse(PropertyConverter.toResource, response)
 def search():
     # Authenticate
         # All Access
     # Create Domain Instance
     criteria = {
         "city": request.args.get("city", default=None, type=str),
         "province": request.args.get("prov", default=None, type=str),
         "min": request.args.get("min", default=None, type=int),
         "max": request.args.get("max", default=None, type=int)
     }
     # Call Service Layer
     response = PropertyService.search(criteria)
     return ResponseFormatter.getFormmattedServiceListResponse(PropertyConverter.toResource, response)