City-of-Helsinki/harrastuspassi-backend

Add support for paid hobbies

Opened this issue · 0 comments

Add support for paid hobbies.

  1. Add the following attributes to Hobby model:
  • price_type (choicefield, defaults to free)
  • price_amount (positive integer field, defaults to 0)
  1. Add the following validation to Hobby model:
if type is free:
    price_amount has to be 0
if type is not free:
    price_amount has to be something else than 0