Display promo credits in --status output#222
Merged
Merged
Conversation
Integrate the additive promo_credits field from the /status endpoint (plain2code_rest_api#111). Promo buckets share the purchased-credit shape, so the purchased-credit line renderer is generalized to take a label and reused for both, and the no-credits-remaining check now also considers promo buckets.
Rename test references from _display_purchased_credit_line to the generalized _display_bucket_credit_line, pass the new promo_credits argument to _display_status_message, and add coverage for promo display, promo-only remaining balance, and backward compatibility when the API omits promo_credits.
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
Integrates the additive `promo_credits` field added to the `/status` endpoint in plain2code_rest_api#111, so credits granted via promo codes now appear in `plain2code.py --status`.
Promo buckets share the same shape as purchased credits (`total`, `remaining`, `expiry_date`). Changes in `cli_output/status.py`:
Notes