City-of-Helsinki/harrastuspassi-backend

Add support for favorite logging

Opened this issue · 0 comments

  1. Create a new TimestampedModel for HobbyFavorite:
  • hobby (fk)
  • count (int)
  1. Add attribute favorite_count (int) for model Hobby.
  • Handle increment of favorite_count the way it is handled in Benefit and Promotion
  1. Add API endpoints for HobbyFavorite.
  • Validate count in serializer to only allow 1 or -1 value.