icebreaker-science/backend

Add availability

Closed this issue · 3 comments

Devices can be offered by the users. With this endpoint, a user can specify that she has a certain device.

Request:

POST /device-availability

{
  deviceId: int (the ID of the wiki page of a device),
  comment: string (optional),
  german_postal_code: string (optional),
  institution: string,
  researchGroup: string (optional)
}

Response:

  • Status code 200: if a wiki object with the given ID exists and if it has the type "device"
  • Status code 4??: if no wiki object with the ID exists or if the wiki object is not of type "device"

This endpoint should only be available for registered users.

A database table device_availability should be created with these fields: "id", "device_id" (foreign key references wiki_page), "comment", "german_postal_code", "institution", "research_group".

Edit: The database table should also contain a column to store the id of the user who has added the availability. Maybe call it "owner_id" or "account id"?

Hey. It just occurred to me that I have forgotten to store the information about the user who is creating the availability. This is quite essential to make it possible to contact her later. Sorry!

I have edited the original post.

Hey. It just occurred to me that I have forgotten to store the information about the user who is creating the availability. This is quite essential to make it possible to contact her later. Sorry!

I have edited the original post.

In this case, do you still want to keep the institution field in the availability table? Can the user add availability on behalf of other institutions as well or must it be his own?

Let's keep it and allow a user to add for another institution for now.