DEFRA / sroc-service-team

Guides, info and issue management for the Charging Module Team
Other
0 stars 1 forks source link

Summary values not zeroed for an empty bill run #78

Closed StuAA78 closed 2 years ago

StuAA78 commented 3 years ago

If a transaction is added to an invoice after the bill run has been generated, and the invoice is subsequently deleted leaving the bill run in an initialised state, the summary values will be incorrect. To replicate:

{
    "billRun": {
        "id": "260dc7e8-94b9-4d0d-a50a-63f7599e260c",
        "billRunNumber": 10016,
        "region": "W",
        "status": "initialised",
        "creditNoteCount": 0,
        "creditNoteValue": 0,
        "invoiceCount": 0,
        "invoiceValue": -21528,
        "netTotal": 0,
        "transactionFileReference": null,
        "invoices": []
    }
}

We accept that the summary stats for a bill run with status initialised cannot be relied on but having such a glaring error doesn't sit well with us. Since we already set the status back to initialised for bill runs without any invoices, we should also reset the values at this time.

StuAA78 commented 3 years ago

Logged in the backlog as https://eaflood.atlassian.net/browse/CMEA-153

StuAA78 commented 2 years ago

This has been completed and tested so we can close this issue now.