alan-turing-institute / Hotdesk-Indicator

Displaying the status of a hotdesk using a raspberrypi and the Inky pHAT
MIT License
3 stars 4 forks source link

API resource for booking desks #12

Open JimMadge opened 3 years ago

JimMadge commented 3 years ago

As an alternative to the desk booking form, there should be an API resource to create a booking record.

This will be a bit trickier than API endpoints which fetch data from the database. Booking need to be validated. There is already some logic in view.py book() which should be moved into separate functions (maybe methods of the Booking class?) so that it can be reused (rather than duplicated).

rpdswtk commented 3 years ago

Hi @JimMadge,

I would like to work on this one.

JimMadge commented 3 years ago

@rpdswtk Please do!

I haven't had a chance to have a proper look at your other PR yet, but if you want to do something similar and use flask-marshmallow I would be supportive. I'm not familiar with that module but it looks like it could save a lot of boiler plate code in the long run.