Closed NorDar closed 5 months ago
Abandoning branch 70-refactor-according-to-meeting in favor of 70-rerefactor
As there were two days experimenting with implementing a translation from the entity user to userid (User owner as an attribute of Plant) that were not successfull the current implementation is as follows: All entities that have relations allow the creation of a relation of two objects by adding the id of the respective other element when creating it.
To create a Plant and add two caretakers to it:
{
"plantName": "initialPlant",
"species": "initialSpecies",
"careInstructions": "Only water at night.",
"lastWateringDate": "1910-11-09T23:00:00.000+00:00",
"nextWateringDate": "1910-11-12T23:00:00.000+00:00",
"wateringInterval": 3,
"owner": {"id": 1},
"caretakers": [{"id":2}, {"id":3}]
}
As per Daniels request spaces in their pure base form are also implemented. One can see an empty space field when requesting plants. The JPA relations are configured.