from flask import json, Response

from app.resource.CustomerJSONEncoder import CustomerJSONEncoder


class ResponseBuilder:
    @staticmethod
    def build(values):
        js = json.dumps(values, cls=CustomerJSONEncoder)
        return ResponseBuilder.buildJson(js)
    
    @staticmethod
    def buildJson(jasonValue):
        response = Response(jasonValue, status=200, mimetype='application/json')
        #response.headers.add('Access-Control-Allow-Origin', '*')
        #response.headers.add('Access-Control-Allow-Headers', 'Content-Type,Authorization')
        #response.headers.add('Access-Control-Allow-Methods', '*')
        return response
