Skip to content

feat(coupons): add the coupons catalog resource - #14

Merged
gastonrey merged 1 commit into
mainfrom
feat/coupons
Oct 7, 2026
Merged

gastonrey merged 1 commit into
mainfrom
feat/coupons

Conversation

@gastonrey

Copy link
Copy Markdown
Collaborator

Why

Factorial's Customer Portal will offer Hyperline customers a retention discount (e.g. 50% for 1 month). Hyperline only attaches a discount to a subscription from an existing catalog coupon (add_coupon needs a coupon_id), so the backend has to find or create that coupon.

What

  • client.coupons with list (take / skip, auto-paginate), get, create, update, delete, on top of BaseResource, with the existing Idempotency-Key and retry behaviour.
  • delete accepts Hyperline's empty 204 answer.
  • The add_coupon / remove_coupon comment on subscriptions now documents their payloads.

Verification

  • bundle exec rspec: 165 examples, 0 failures. bundle exec rubocop: no offenses.
  • Request and response shapes checked against Hyperline's OpenAPI spec and a sandbox run (create percent coupon -> 201, delete -> 204).

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gastonrey
gastonrey marked this pull request as ready for review October 7, 2026 14:09
@gastonrey
gastonrey merged commit cc2fd99 into main Oct 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant