m7madmagdy/promotable ? reverse-engineered prompt
Reverse engineered prompt
Build me a Ruby on Rails 8 compatible promotion and coupon engine gem called Promotable.
I want it to work with any model I choose, like orders, carts, subscriptions, or bookings, and let me add a simple concern to those models so they can accept coupon codes, auto apply the best promotions, remove discounts, and recalculate them when needed. It should also work for the user side, so a user can redeem codes and I can check how many times they have used a promotion.
Please include support for promotions, rules, actions, coupon codes, usage tracking, and discount adjustments, with a clean way to add new rule and action types later. It should be multitenant friendly, so promotions and codes can be scoped to a tenant but still allow global promotions when needed. I also want an install generator, migrations, configuration in an initializer, and a solid test suite.
If you need to look up current Rails 8 or acts_as_tenant docs online, do that too.
Are you gonna build this?
make sure you review the code using coderabbit