Skip to content

refactor(enrollment): normalize frontend shape to camelCase - #1334

Merged
fayazg merged 2 commits into
mainfrom
refactor/LFXV2-1664-enrollment-camelcase
Aug 5, 2026
Merged

refactor(enrollment): normalize frontend shape to camelCase#1334
fayazg merged 2 commits into
mainfrom
refactor/LFXV2-1664-enrollment-camelcase

Conversation

@fayazg

@fayazg fayazg commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Rename EnrollmentMembership fields (Status, AutoRenew, PurchaseDate, EndDate, Price, ID, ExtPaymentType) and IndividualEnrollment.ProductName to camelCase, matching their camelCase siblings.
  • Normalization happens at the server mapping boundary in EnrollmentService.getIndividualEnrollmentsRawMembership (the member-service wire shape) and the auto-renew PATCH payload stay PascalCase.
  • Pure rename, no behavior change; updated the shared interface, catalog constant, status-derivation util + spec, the profile component (TS + template), backend service, and both e2e specs.
  • Added clarifying notes to the individual-memberships migration doc flagging the LFX One camelCase divergence from the legacy myprofile / member-service PascalCase examples.

LFXV2-1664

fayazg added 2 commits August 5, 2026 15:41
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>
@fayazg
fayazg requested a review from a team as a code owner August 5, 2026 22:12
Copilot AI balanced review requested due to automatic review settings August 5, 2026 22:12
@cursor

cursor Bot commented Aug 5, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Wide mechanical rename across profile enrollment UI, shared types, and API mapping; wrong property names would break display and auto-renew without compile-time coverage everywhere.

Overview
Individual enrollment types and UI now use camelCase (productName, status, autoRenew, purchaseDate, endDate, price, id, extPaymentType) instead of the previous PascalCase fields on EnrollmentMembership and IndividualEnrollment.

EnrollmentService.getIndividualEnrollments maps member-service RawMembership (still PascalCase on the wire) into that camelCase shape before the Angular app and /api/enrollments consumers see it. Auto-renew PATCH to member-service is unchanged (PascalCase body).

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.

@coderabbitai

coderabbitai Bot commented Aug 5, 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: 7386601b-e955-4c78-879f-575d2ef7dd22

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.

🟢 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 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 — checked the rename for completeness on the branch.

  • No stragglers: every item.ProductName and membership.{Status,AutoRenew,PurchaseDate,EndDate,Price,ID,ExtPaymentType} reference is gone from TS and the template. Remaining PascalCase is all RawMembership at the mapping boundary in enrollment.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 stripeActiveMembershipAutoRenewOff spread; 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

@fayazg
fayazg merged commit 26971d7 into main Aug 5, 2026
13 checks passed
@fayazg
fayazg deleted the refactor/LFXV2-1664-enrollment-camelcase branch August 5, 2026 22:42
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