dimanche 26 avril 2015

Handling calendar based data with REST

I have the following Data model -

"Room":
   "id": 1
   "name": "Deluxe"
   "description": "A big room"
    ...


"Inventory":
     "room_id" : 1
     "date"  :  "27/04/2015"
     "availability" : 10 //Given a date the number of rooms available

The use cases for UI would be - For a Room -

  1. set availability for a single day
  2. set availability for multiple days at once

-- by selecting the date(s) from calendar in one go.

Going the Primary/Unique keys I can consider Inventory for a day as Resource and issue multiple post/put calls for each day. But it might be overkill to issue multiple requests.

We are using Ember REST Adapter on the client side/Django Rest framework on the server side.

Are there any suggested REST patterns to deal with this kind time/day based data?

Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire