Add brev redeem command for coupon code redemption#259
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Add RedeemCouponCode method to organization store - Create new redeem command with --org flag support - Wire command into CLI command tree - Include completion handler for org names - Display success message with credits amount and duration Co-Authored-By: Alec Fong <alecsanf@usc.edu>
aab2df1 to
9a0633d
Compare
|
so these coupon codes are for adding value to a Org almost like a gift card? How does this jive with the concept of the Coupon that we attached to launchables that do the like "first 10 deploys are free". Is this a separate concept? |
|
Hi @patelspratik! Good question. Based on my implementation: This coupon redemption feature (what I just added):
I implemented this based on the existing API endpoint I found in As for how this relates to the launchables coupon system you mentioned (like "first 10 deploys free") - that's a product architecture question I'd defer to @theFong or the team. I just implemented the CLI command to match what the UI already supports for credit redemption. |
|
That's a good call out. I think there's a difference between coupons and credit codes created from the admin portal. I'll have to look into it a bit more and may need to make the distinction here. |
Add brev redeem command for coupon code redemption
Summary
Adds a new
brev redeem <code>CLI command that allows users to redeem coupon codes for credits in their Brev organization. The implementation includes:RedeemCouponCodemethod in the organization store that callsPOST /api/organizations/{id}/credits/code/redeembrev redeemcommand with--orgflag support to specify target organization--orgflagUsage:
Review & Testing Checklist for Human
/api/organizations/{id}/credits/code/redeem, request body structure{"Code": "..."}, and response format match the actual backend implementationNotes
brev-environments-ui/src/server/index.tsandbrev invitecommandLink to Devin run: https://app.devin.ai/sessions/a77074d17cd54f40879cd855245492d0
Requested by: @theFong