Closed erawat closed 3 years ago
This PR changes Payment Schedule API response to include the calculation for total instalments amount for the schedule.
The total amount will be set to two different places when schedule instalments is generated.
The PR also updates payment plan toggler UI that includes:
The PR also includes the unit tests for testing calculation of total amount for fixed membership type, rolling membership type, price field value
The gift shows that the schedule prices do not equal to total price on price value total amount
The gift shows the error message when non the price values are selected
The gift shows that the schedule prices (pro rated price in this case) do not equal to total price on price value total amount
The gift shows that no error message appears when none of the price value is selected.
This section shows that JSON response looks like before and after this PR.
The response only provides instalments which have already formatted.
{ "is_error": 0, "version": 3, "count": 1, "id": 0, "values": [ { "instalment_no": 1, "instalment_date": "1st July 2020", "instalment_tax_amount": "£180", "instalment_amount": "£900", "instalment_status": "Pending" } ] }
After this PR.
JSON response if sequential = 0 on the request.
{ "is_error": 0, "version": 3, "count": 2, "values": { "instalments": [ { "instalment_no": 1, "instalment_date": "1st July 2020", "instalment_tax_amount": "£180", "instalment_amount": "£900", "instalment_status": "Pending" } ], "total_amount": 1080 } }
JSON response if sequential = 1 on the request.
{ "is_error": 0, "version": 3, "count": 2, "values": [ [ { "instalment_no": 1, "instalment_date": "1st July 2020", "instalment_tax_amount": "£180", "instalment_amount": "£900", "instalment_status": "Pending" } ], 1080 ] }
The reason that total_amount should return to in the response because
Overview
This PR changes Payment Schedule API response to include the calculation for total instalments amount for the schedule.
The total amount will be set to two different places when schedule instalments is generated.
The PR also updates payment plan toggler UI that includes:
The PR also includes the unit tests for testing calculation of total amount for fixed membership type, rolling membership type, price field value
Before
The gift shows that the schedule prices do not equal to total price on price value total amount
The gift shows the error message when non the price values are selected
After
The gift shows that the schedule prices (pro rated price in this case) do not equal to total price on price value total amount
The gift shows that no error message appears when none of the price value is selected.
Technical Details
This section shows that JSON response looks like before and after this PR.
The response only provides instalments which have already formatted.
After this PR.
JSON response if sequential = 0 on the request.
JSON response if sequential = 1 on the request.
The reason that total_amount should return to in the response because