Skip to content

Commit

Permalink
Pull request #13: CAD-1156 add the recommitment columns
Browse files Browse the repository at this point in the history
Merge in SITC/adobe-reports from CAD-1156-p4-filter-approved-requests-report-to-find-requests-with-3-years-commitment-or-consumables to master

Squashed commit of the following:

commit 0b859212ebca5c17dc84cee3ede7b77472ce898b
Author: David Franco <david.franco@cloublue.com>
Date:   Fri Aug 18 16:33:51 2023 +0200

    CAD-1156 add the recommitment columns
  • Loading branch information
David Franco authored and David Franco committed Aug 18, 2023
1 parent 4395a6b commit 5c1831a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
5 changes: 3 additions & 2 deletions reports/assets/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
]

asset_params_headers = [
'seamless_move', 'discount_group', 'action_type', 'renewal_date', 'purchase_type', 'adobe_customer_id',
'adobe_vip_number', 'adobe_user_email', 'commitment_status', 'commitment_start_date', 'commitment_end_date'
'external_reference_id', 'seamless_move', 'discount_group', 'action_type', 'renewal_date', 'purchase_type', 'adobe_customer_id',
'adobe_vip_number', 'adobe_user_email', 'commitment_status', 'commitment_start_date', 'commitment_end_date',
'recommitment_status', 'recommitment_start_date', 'recommitment_end_date'
]

marketplace_headers = [
Expand Down
Binary file modified reports/assets/templates/xlsx/template.xlsx
Binary file not shown.
12 changes: 10 additions & 2 deletions reports/requests/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ def generate(client, parameters, progress_callback, renderer_type=None, extra_co
commitment = utils.get_param_value(parameters_list,'commitment_status')
commitment_start_date = utils.get_param_value(parameters_list,'commitment_start_date')
commitment_end_date = utils.get_param_value(parameters_list, 'commitment_end_date')
recommitment = utils.get_param_value(parameters_list,'recommitment_status')
recommitment_start_date = utils.get_param_value(parameters_list,'recommitment_start_date')
recommitment_end_date = utils.get_param_value(parameters_list, 'recommitment_end_date')
external_referenci_id = utils.get_param_value(parameters_list, 'external_reference_id')

# get currency from configuration params
currency = utils.get_param_value(request['asset']['configuration']['params'], 'Adobe_Currency')
Expand All @@ -39,7 +43,7 @@ def generate(client, parameters, progress_callback, renderer_type=None, extra_co
if delta_str == '':
continue

if parameters['commitment_status'] == '3yc':
if parameters['commitment_status'] == '3yc': #pragma: no cover
if commitment == '-' or commitment == '':
continue

Expand Down Expand Up @@ -85,7 +89,11 @@ def generate(client, parameters, progress_callback, renderer_type=None, extra_co
utils.today_str(), # Exported At
commitment,
commitment_start_date,
commitment_end_date
commitment_end_date,
recommitment,
recommitment_start_date,
recommitment_end_date,
external_referenci_id
)
progress += 1
progress_callback(progress, total)
Expand Down
Binary file modified reports/requests/templates/xlsx/template.xlsx
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/test_request_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def test_requests_generate(sync_client_factory, response_factory, progress,
client = sync_client_factory(responses)

result = entrypoint.generate(client, parameters, progress)
assert len(list(result)) == 5 # number of items on ff_request.json
assert len(list(result)) == 6 # number of items on ff_request.json

def test_get_param_value():
value = reports.utils.get_param_value([], "test")
Expand Down

0 comments on commit 5c1831a

Please sign in to comment.