Separated translation logic from the POST actions for statuses. Ensuring the presence of at least 1 resultaat needs information from the translation logic of statuses, but the resultaat needs to be present before an endstatus can be POSTed.
Added injection of a resultaat when the current action is going to close the zaak (contains a status update to the endstatus) and there is no resultaat on the zaak. It injects a resultaat with of the resultaatType from the "BeeindigZaakWanneerEinddatum" mapping.
The scenario of a zds application updating the zaak with the resultaat AFTER an endstatus has closed the zaak, should still work correctly. Resultaat only has a relation with a zaak. It is not part of a zaak and therefor the resultaat can be changed after the zaak is closed. Updating the resultaat after the zaak is closed, will replace the injected resultaat, so a dummy/incorrect resultaattype can be used to inject for this scenario.
Separated translation logic from the POST actions for statuses. Ensuring the presence of at least 1 resultaat needs information from the translation logic of statuses, but the resultaat needs to be present before an endstatus can be POSTed.
Added injection of a resultaat when the current action is going to close the zaak (contains a status update to the endstatus) and there is no resultaat on the zaak. It injects a resultaat with of the resultaatType from the "BeeindigZaakWanneerEinddatum" mapping.
The scenario of a zds application updating the zaak with the resultaat AFTER an endstatus has closed the zaak, should still work correctly. Resultaat only has a relation with a zaak. It is not part of a zaak and therefor the resultaat can be changed after the zaak is closed. Updating the resultaat after the zaak is closed, will replace the injected resultaat, so a dummy/incorrect resultaattype can be used to inject for this scenario.