feat: implement redemption code management including creation, listing, and redemption functionality#80
Merged
Merged
Conversation
Closed
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Added billing redemption code functionality and improved the handling of recurring subscription benefits.
This change allows administrators to create, edit, start, stop, delete, batch copy, and export redemption codes in the backend; users can use redemption codes on the subscription/billing page. Redemption codes take effect according to the current billing mode:
usagemode for redeeming balance,periodmode for redeeming subscription benefits; redemption is not possible if the billing mode does not match or the self-use mode is not supported.The backend adds redemption code definition, redemption records, subscription benefit queue, and balance crediting logic; redemption codes are processed as secrets in plaintext, and the list does not return the complete plaintext; decryption is performed as needed when copying. The frontend adds backend redemption code management, user redemption entry, subscription benefit display, status filtering, availability filtering, and local optimistic updates.
Included commits:
142604b feat: implement redemption code management including creation, listing, and redemption functionalityede6c1c feat: load redemption codes when availability filter is set to availableChange type
Affected areas
Verification
-[x]
cd backend && go test ./internal/application/billing ./internal/infra/persistence/postgres/billing ./internal/shared/responsecd frontend && pnpm lintcd frontend && pnpm buildcd backend && make swaggergit diff --checkScreenshots, API examples, or logs
UI changes include:
No secrets, tokens, or personal data are included.
Configuration, migration, and compatibility notes
billing_redemption_codesbilling_redemptionsredemptionbalance transaction type.Documentation
Security and privacy
Security notes:
Checklist
.pycfiles,.envfiles, and local storage data are not committed.