refactor(enrollment): normalize frontend shape to camelCase - #1334
Conversation
Rename EnrollmentMembership fields (Status, AutoRenew, PurchaseDate, EndDate, Price, ID, ExtPaymentType) and IndividualEnrollment.ProductName to camelCase, matching their camelCase siblings. The server maps the upstream RawMembership into this shape, so RawMembership (the member-service wire shape) and the auto-renew PATCH payload stay PascalCase. Pure rename — no behavior change. LFXV2-1664 Signed-off-by: Fayaz G <5818912+fayazg@users.noreply.github.com>
Add clarifying notes to the individual-memberships migration doc flagging that LFX One normalizes the membership shape to camelCase, while the legacy myprofile / member-service examples remain PascalCase. Points readers to EnrollmentMembership / IndividualEnrollment as the canonical shape. LFXV2-1664 Signed-off-by: Fayaz G <5818912+fayazg@users.noreply.github.com>
PR SummaryMedium Risk Overview
Call sites updated across shared interfaces/catalog, status derivation util + tests, profile individual-enrollment component (template + TS), server service, Playwright mocks, and migration doc notes describing LFX One vs legacy myprofile shapes. Reviewed by Cursor Bugbot for commit 4c30bc5. 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.
🟢 Ready to approve
The rename is consistently applied while preserving the upstream wire and PATCH contracts.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
Normalizes enrollment data to camelCase at the BFF boundary while preserving the upstream PascalCase contract.
Changes:
- Renames shared enrollment fields and all frontend consumers.
- Maps raw member-service responses to camelCase.
- Updates tests, fixtures, and migration documentation.
File summaries
| File | Description |
|---|---|
packages/shared/src/utils/enrollment.utils.ts |
Uses normalized membership fields. |
packages/shared/src/utils/enrollment.utils.spec.ts |
Updates status fixtures. |
packages/shared/src/interfaces/enrollment.interface.ts |
Defines camelCase enrollment contracts. |
packages/shared/src/constants/individual-enrollment-catalog.ts |
Renames the catalog product field. |
docs/migration/individual-memberships.md |
Documents wire/UI shape divergence. |
apps/lfx-one/src/server/services/enrollment.service.ts |
Normalizes upstream membership records. |
apps/lfx-one/src/app/modules/profile/individual-enrollment/profile-individual-enrollment.component.ts |
Updates component field access. |
apps/lfx-one/src/app/modules/profile/individual-enrollment/profile-individual-enrollment.component.html |
Updates template bindings. |
apps/lfx-one/e2e/individual-enrollment.spec.ts |
Updates behavioral fixtures. |
apps/lfx-one/e2e/individual-enrollment-robust.spec.ts |
Updates structural fixtures. |
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 0
- Review effort level: Balanced
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
luismoriguerra
left a comment
There was a problem hiding this comment.
Approving — checked the rename for completeness on the branch.
- No stragglers: every
item.ProductNameandmembership.{Status,AutoRenew,PurchaseDate,EndDate,Price,ID,ExtPaymentType}reference is gone from TS and the template. Remaining PascalCase is allRawMembershipat the mapping boundary inenrollment.service.ts, which is correct. - Auto-renew PATCH payload correctly stays PascalCase — that's the upstream contract, not the frontend shape.
- Both e2e specs updated including the
stripeActiveMembershipAutoRenewOffspread; since the mocks stub the LFX One response (not member-service), camelCase is the right fixture shape. - The migration-doc divergence notes are a good addition — keeps the doc from silently contradicting the code.
Merge-order note: conflicts with #1306 (same two files, and this branch doesn't include its 'Purchased' tests). Suggest landing #1306 first, then rebasing here and confirming the three new tests get camelCased too. Currently blocked on checks.
Generated by Claude Code
Summary
EnrollmentMembershipfields (Status,AutoRenew,PurchaseDate,EndDate,Price,ID,ExtPaymentType) andIndividualEnrollment.ProductNameto camelCase, matching their camelCase siblings.EnrollmentService.getIndividualEnrollments—RawMembership(the member-service wire shape) and the auto-renew PATCH payload stay PascalCase.individual-membershipsmigration doc flagging the LFX One camelCase divergence from the legacy myprofile / member-service PascalCase examples.LFXV2-1664