Describe the bug
Currently Discount code api does not has one to many relationship for tickets. Since one discount code can be applied to many tickets so there should be a relationship from discount code to tickets.
Expected behavior
Parent issue
Are you working on it or can I take this one?
There is a tickets field in Discount code API which should be removed. It does not make any sense to have tickets as string with value either event or ticket.
It is to identify whether the discount code is only for tickets of the currrent event or can be applied to every event.
The behaviour of discount code is very tricky to understand and I would recommend reading this: https://blog.fossasia.org/discount-codes-in-open-event-server/
@srv-twry There is one more field there which is user-for. IMO that is the field that defines its behaviour.
@schedutron you can work on this.
@srv-twry @schedutron You can see the comments here which might be helpful.
https://github.com/fossasia/open-event-frontend/blob/d7822ae83c65bcafc89a10153a6a192d426b89b6/app/models/discount-code.js#L5-L36
Thanks, understood :)
Most helpful comment
@srv-twry There is one more field there which is user-for. IMO that is the field that defines its behaviour.
@schedutron you can work on this.