This is a system architecture question. We've built a Flutter app (with a GraphQL server in Golang) and now want to implement a promo code system.
We want a setup that will allow us to create ad hoc promo codes for various campaigns. When redeemed, the user gets increased benefits / values. The creation of the promo codes should allow for different input parameters, such as validity (fixed number of days or a date range), expiration date, value provided, single-use or multi-use, and all the other parameters one can think of for promo codes.
My question, are there any suggested articles, tutorials, or best practices on how to structure such a promo code system? I'm not looking for specific code but rather the flow and how the logic ought to be set up, i.e. what logic the frontend (app) handles, what the backend handles, the flow of the requests / data, and so on. Any and all suggestions are welcome!
In case it can be of help to anyone else, we ended up emulating the setup of this coupon management tool. It's pretty well-documented and you can simply modify it to your requirements (to be able to perform the required CRUD operations for your specific case, i.e. to Create, Read, Update, and Delete coupons / codes).
In terms of the flow, below is a simplified diagram of how we have structured it (follow steps A -> B -> C -> D):