Documented new subscription data in theme members page#49
Documented new subscription data in theme members page#49minimaluminium wants to merge 2 commits intomainfrom
Conversation
Added documentation for next_payment object, tier, offer, offer_redemptions, and cancel_at_period_end to the members theme docs page
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
WalkthroughDocumentation for Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@themes/members.mdx`:
- Line 477: The sentence listing offer properties incorrectly includes "trial"
as an offer type; update the enumeration in the line that mentions key offer
properties (the one listing `display_title`, `display_description`, `type`
(`"percent"`, `"fixed"`, or `"trial"`), `amount`, `duration`, and `cadence`) to
remove `"trial"` so `type` only lists `"percent"` and `"fixed"`, and ensure any
adjacent text doesn't imply offer types include trials (leave the "trialing"
subscription status references unchanged).
sagzy
left a comment
There was a problem hiding this comment.
Nice one @minimaluminium! Left a few nits
themes/members.mdx
Outdated
| - `next_payment.interval` – `"month"` or `"year"` | ||
| - `next_payment.currency` – ISO currency code, e.g. `"USD"` | ||
| - `next_payment.discount` – Active discount details, or `null` when no discount applies | ||
| - `offer` – The offer applied when the member subscribed, or `null` |
There was a problem hiding this comment.
"The offer applied when the member subscribed" → The offer can be either a signup or retention offer, so I think this should be something like "Details of the last offered redeemed on this subscription" (regardless of whether it's a signup or retention offer)
themes/members.mdx
Outdated
| {{/foreach}} | ||
| ``` | ||
|
|
||
| When a discount is active, `next_payment.discount` contains details about it. The `discount.end` property returns a date for both one-time and repeating discounts, and `null` for forever discounts — so you can check for an end date directly without inspecting the discount type: |
There was a problem hiding this comment.
nit: "— so you can check for an end date directly without inspecting the discount type" feels unnecessary, would remove
themes/members.mdx
Outdated
| - `next_payment.original_amount` – Original amount before discounts | ||
| - `next_payment.interval` – `"month"` or `"year"` | ||
| - `next_payment.currency` – ISO currency code, e.g. `"USD"` | ||
| - `next_payment.discount` – Active discount details, or `null` when no discount applies |
There was a problem hiding this comment.
next_payment first-level properties are listed here (interval, currency, etc.), versus next_payment.discount properties are listed in the "Next payment" section. Might be easier to read if everything is under the "Next payment" section, next to the examples of usage?
themes/members.mdx
Outdated
| @@ -407,7 +407,74 @@ Subscription data comes from Stripe meaning a valid Stripe account connected to | |||
| - `status` – The status of the subscription (can be one of: “active”, “trialing”, “unpaid”, “past_due”, “canceled”) | |||
| - `start_date` –The date which the subscription was first started, can be used with the `{{date}}` helper | |||
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@themes/members.mdx`:
- Line 408: Update the `start_date` description to remove the redundant wording;
change the phrase "was first started" to simply "started" so the line reads:
"`start_date` – The date the subscription started, can be used with the
`{{date}}` helper", editing the text that references the `start_date` field and
the `{{date}}` helper.
| - `plan.amount` – The amount of the Stripe plan in the smallest currency denomination (e.g. USD \$5 would be “500” cents) | ||
| - `status` – The status of the subscription (can be one of: “active”, “trialing”, “unpaid”, “past_due”, “canceled”) | ||
| - `start_date` –The date which the subscription was first started, can be used with the `{{date}}` helper | ||
| - `start_date` – The date which the subscription was first started, can be used with the `{{date}}` helper |
There was a problem hiding this comment.
Tighten wording on start_date description.
Line 408 uses “was first started,” which is redundant. Suggest simplifying to “started.”
✏️ Proposed doc edit
-- `start_date` – The date which the subscription was first started, can be used with the `{{date}}` helper
+- `start_date` – The date the subscription started, can be used with the `{{date}}` helper🧰 Tools
🪛 LanguageTool
[style] ~408-~408: This phrase is redundant. Consider writing “started”.
Context: ...– The date which the subscription was first started, can be used with the{{date}}` helper...
(FIRST_BEGAN)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@themes/members.mdx` at line 408, Update the `start_date` description to
remove the redundant wording; change the phrase "was first started" to simply
"started" so the line reads: "`start_date` – The date the subscription started,
can be used with the `{{date}}` helper", editing the text that references the
`start_date` field and the `{{date}}` helper.
There was a problem hiding this comment.
The text was already there before our changes.
There was a problem hiding this comment.
@minimaluminium, you're right — looking at the diff, the only change on that line was adding a space after the dash (formatting), and the wording "was first started" was already present in the original file before this PR. The style suggestion is valid in isolation but is outside the scope of your changes. Would you like me to open a separate follow-up issue to track this wording cleanup, or would you prefer to leave it as-is?
ref https://linear.app/ghost/issue/BER-3386/document-new-subscription-data-and-helpers-in-theme-docs
cancel_at_period_end,tier,next_payment,offer, andoffer_redemptionsto the subscription attributes listnext_paymentdocs reflect the simplifieddiscount.endbehavior from BER-3466, where theme devs can check for an end date directly without matching on the discount duration type