naturerobots / HSOS-SEP-PlantMap-2022

PlantMap Digital Logbook: A tool to support sustainable micro farming :link: https://naturerobots.github.io/HSOS-SEP-PlantMap-2022/
BSD 3-Clause "New" or "Revised" License
4 stars 5 forks source link

Endpoints to create a company and a garden #172

Closed dobro929 closed 2 years ago

dobro929 commented 2 years ago

After registration we start an onboarding process where the user can create a company and a garden. Therefore we need 2 more endpoints.

Here is a rough example:

  1. Post: /companies
  2. Post: /companies/{companyId}/gardens

Both endpoints should be authenticated.

They have the same body for now. We will add an optional address to both later on.

{
    "name": "exampleName"
}

If the object was created successfully, we get the id as return.

jarkenau commented 2 years ago

@dobro929 Not sure if I got that correctly, both endpoints should just accept a name from the request? :thinking:

dobro929 commented 2 years ago

@jarkenau Yes, we will extend it later, but make sure you set the user as admin when we create a company.

jarkenau commented 2 years ago

I will probably implement it without requiring admin privileges for now, since @pbrozi is still working on the permission system.