sopra-fs24-group-01 / sopra-fs24-plantparent-server

This is the Spring-based back end for the PlantParent website.
Apache License 2.0
0 stars 1 forks source link

Refactor according to Meeting #70

Closed NorDar closed 5 months ago

NorDar commented 5 months ago
NorDar commented 5 months ago

Abandoning branch 70-refactor-according-to-meeting in favor of 70-rerefactor

NorDar commented 5 months ago

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}]
}
NorDar commented 5 months ago

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.