Indicia-Team/warehouse

Drop sub-sample date and survey requirement

Closed this issue · 2 comments

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.

{
  "values": {
    "survey_id": "1",
    "entered_sref_system": 4326,
    "entered_sref": "51, 1",
    "date": "5/12/2023"
  },
  "samples": [
    {
      "values": {
        "entered_sref_system": 4326,
        "entered_sref": "51, 1"
      }
    }
  ]
}

Thanks! 🎉

Just waiting for continuous integration tests - will be deployed in half an hour if OK.