Yeah that’s my first thought on this. But then the extra work that the caller has to do (request to db) makes me feel like I’m duplicating a lot of logic.
Anyway, your opinion on the side effect part is something I’ve never thought of. So I think i would go with this kinda kybrid approach
def validate_coupon(%Coupon{} = coupon) do
end
def validate_coupon(coupon_id) do
end
What do you think about this?


















