Skip to content

test(enrollment): document and pin Purchased status derivation - #1306

Open
fayazg wants to merge 5 commits into
mainfrom
test/LFXV2-1664-purchased-status
Open

test(enrollment): document and pin Purchased status derivation#1306
fayazg wants to merge 5 commits into
mainfrom
test/LFXV2-1664-purchased-status

Conversation

@fayazg

@fayazg fayazg commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Document that deriveEnrollmentStatus intentionally 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).
  • Add tests pinning '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

@fayazg
fayazg requested a review from a team as a code owner August 4, 2026 16:36
Copilot AI balanced review requested due to automatic review settings August 4, 2026 16:36
@cursor

cursor Bot commented Aug 4, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Comment and test-only change with no production logic modifications.

Overview
Documents that deriveEnrollmentStatus treats Purchased like Active for display—only Expired short-circuits before the EndDate / Stripe auto-renew logic—and adds regression tests so that equivalence stays pinned.

No runtime behavior change: comments in enrollment.utils.ts and a new nested describe in the spec cover Active, Expiring Soon, and Expired outcomes for status: 'Purchased'.

Reviewed by Cursor Bugbot for commit dc0531b. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 14ece216-c3cd-4fb5-a019-595f956aa24f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Documents and tests the intentional handling of Purchased enrollment status without changing runtime behavior.

Changes:

  • Clarifies that Purchased follows Active date-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
luismoriguerra previously approved these changes Aug 5, 2026

@luismoriguerra luismoriguerra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copilot AI review requested due to automatic review settings August 5, 2026 22:49
@fayazg
fayazg force-pushed the test/LFXV2-1664-purchased-status branch from 6eca81a to d71d252 Compare August 5, 2026 22:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI review requested due to automatic review settings August 6, 2026 22:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants