def assemble()

in code/lab-3/query-for-quotes-service/app.py [0:0]


def assemble(response):
    body = {
        'quotes': []
    }

    for item in response['Items']:
        if 'quote' in item:
            body['quotes'].append({
                'responder': item['responder']['S'],
                'quote': item['quote']['N']
            })
        else:
            body['rfq-id'] = item['id']['S']
            body['from'] = item['from']['S']
            body['to'] = item['to']['S']
            body['customer'] = item['customer']['S']

    return body