DEFRA / sroc-service-team

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

disinfect plugin fails on null input #22

Closed StuAA78 closed 3 years ago

StuAA78 commented 4 years ago

While working on the SRoC calculate charge feature I found that disinfect would error and return a 500 code response if supplied with data where one of the values is null, eg:

{
  "chargeCategoryCode": "S181",
  "periodStart": "01-APR-2020",
  "periodEnd": "31-OCT-2020",
  "section126Factor": null,
  "section127Agreement": true,
  "section130Agreement": true,
  "source": "Supported",
  "billableDays": 214,
  "authorisedDays": 214,
  "credit": false,
  "compensationCharge": false,
  "twoPartTariff": false
}

I checked with Sally and she confirmed that WRLS would not actually send section126Factor in cases such as this. However it would be a problem if we do need to allow null values in future.

StuAA78 commented 3 years ago

The disinfect plugin has been removed and replaced with an improved custom plugin which handles this case and resolves other issues as well.