Closed adamdoty closed 2 years ago
@adamdoty great question, so thinking about this: treat and user is a many-to-many relationship:
So shall we make a TreatRequest model where both come together (User and Treat foreign key columns), and maybe store the coupon used as a foreign key on that new model / table as well (another foreign key)?
A TreatRequest model with a Treat foreign key doesn't make sense to me.
Conceptually what I am going for is a way for users to request a treat that isn't in the catalogue -> that request goes to the baker for approval -> then if it is approved it goes into the catalogue. So in this way its more like an incomplete treat.
I think this might work the easiest as adding a new is_recipient_request Boolean field on the Treat model, but I wasn't sure that this is best practice. SOLID's Single responsibility principle - not sure if having including this field would overcomplicate the model.
Sorry I misunderstood then, this comment clarifies a lot. I will go through the rest now and we can discuss on Slack later as well ...
Maybe it would be helpful to create a flow chart?
Yes that would be helpful, thanks
@bbelderbos Coupon recipients can request a treat outside of the treat catalogue. For a treat that has been requested by a recipient: