test(enrollment): document and pin Purchased status derivation - #1306
test(enrollment): document and pin Purchased status derivation#1306fayazg wants to merge 5 commits into
Conversation
PR SummaryLow Risk Overview No runtime behavior change: comments in Reviewed by Cursor Bugbot for commit dc0531b. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
There was a problem hiding this comment.
Pull request overview
Documents and tests the intentional handling of Purchased enrollment status without changing runtime behavior.
Changes:
- Clarifies that
PurchasedfollowsActivedate-based derivation. - Adds regression tests for active, expiring-soon, and expired outcomes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
packages/shared/src/utils/enrollment.utils.ts |
Documents status fall-through behavior. |
packages/shared/src/utils/enrollment.utils.spec.ts |
Tests Purchased status derivation. |
luismoriguerra
left a comment
There was a problem hiding this comment.
Approving — tests + comments only, no behavior change.
- The comment matches the code:
'Expired'is the only short-circuit;'Active'/'Purchased'both fall through to the date/Stripe derivation. - The three new cases correctly pin that fall-through and reuse the existing builders, so no fixture drift.
- Nit (non-blocking):
'Purchased'+ stripe + autoRenew isn't covered, but that branch is already pinned for'Active'.
Merge-order note: this collides with #1334, which renames these same fields to camelCase and is not built on this branch. Merging this one first is the cheaper order — #1334 then just camelCases the three new tests. The reverse drags PascalCase fixtures back in on rebase. Needs a rebase on main either way (currently behind).
Generated by Claude Code
LFXV2-1664 Signed-off-by: Fayaz G <5818912+fayazg@users.noreply.github.com>
6eca81a to
d71d252
Compare
Summary
deriveEnrollmentStatusintentionally has no dedicated'Purchased'branch — only'Expired'short-circuits, while'Active'and'Purchased'are equivalent for display and both flow into the date-based derivation (EndDate + Stripe/auto-renew).'Purchased'to the same outcomes as'Active'(active when >30 days out, expiring-soon within 30 days, expired when past) so the fall-through can't silently regress.Follow-up to PR #732 review notes. No behavior change.
LFXV2-1664