The warehouse will reject a POST request to /services/rest/samples like this because a child sub-sample doesn't contain a valid date or a survey. I don't see a reason why a subsample survey could differ from its parent's, and it should be safe to default to the parent survey date if one is missing. Automatically setting these values would clean up and simplify client code in numerous places and help prevent mismatched sample and sub-sample dates.
As a bonus, I would also default the entered_sref values.
The warehouse will reject a POST request to
/services/rest/samples
like this because a child sub-sample doesn't contain a valid date or a survey. I don't see a reason why a subsample survey could differ from its parent's, and it should be safe to default to the parent survey date if one is missing. Automatically setting these values would clean up and simplify client code in numerous places and help prevent mismatched sample and sub-sample dates.As a bonus, I would also default the
entered_sref
values.