karma-exchange-org/karma-exchange — pull request #37 by avaliani (2013-05-29 23:42:17+00:00)
Title: Added event rating crud

An event rating crud has been added:

**1. GET /api/event//review**
* get current user's review for the event

**2. POST /api/event//review**
* update current user's review for the event

Content format - see Review.java:
{"rating":{"value":3.5}}

Value must be between 1 and 5. The value is a double.

public class Review extends NameBaseDao {
private Rating rating;
...
}

**3. DELETE /api/event//review**
* delete current user's review for the event

Note that ratings can only be added by event participants (Organizers + Registered users).

**PULL NOTES:**
* You will most likely have to re-create any event you want to update. And users will eventually require re-creation also.
* I've renamed the rating variable in event to just 'rating'

**Upcoming merges note:**
* organizer ratings will be automatically updated based on event ratings in a follow-up pull request. App engine has a limit on 5 entity group modifications per transaction. Thus, it's not as straightforward as one would imagine.