Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(waiver-amend): Add waiver amendment emails #993

Merged
merged 2 commits into from
Jan 9, 2025
Merged

Conversation

benjaminpaige
Copy link
Collaborator

@benjaminpaige benjaminpaige commented Jan 8, 2025

Pull Request Description:

This PR introduces support for 1915(b) Waiver Amendments and Renewals (both Capitated and Contracting) within the OneMAC Submission Portal’s email notifications. Below is a breakdown of the major changes introduced by these commits:


1. Enhanced Email Templates

  1. Waiver1915bCMS.tsx and Waiver1915bState.tsx

    • Added new event types to the props.variables union:
      • Events["CapitatedRenewal"]
      • Events["ContractingRenewal"]
      • Events["CapitatedAmendment"]
      • Events["ContractingAmendment"]
    • Updated the previewText and heading to dynamically use formatActionType() (instead of hard-coded actionType) for improved readability.
    • Included references to “waiver submission” in the email heading to clarify the nature of the submission (Initial, Renewal, or Amendment).
  2. new-submission/index.tsx

    • Modified the newSubmission object to handle additional events for Capitated Renewals:
      • Updated the cms and state methods to accept (Events["CapitatedRenewal"] & CommonEmailVariables & { emails: EmailAddresses }).
    • Ensures that notifications for these new event types are routed to the correct recipients (variables.emails.osgEmail for CMS, and the submitter’s email for the state).

2. Preview & Test Files

  1. Refactoring & Expanding Test Coverage

    • Renamed references to the old single “Waiver1915bCMSEmailPreview” component and split them out into event-specific components:
      • Waiver1915bCMSCapitatedInitialEmailPreview
      • Waiver1915bCMSCapitatedRenewalEmailPreview
      • Waiver1915bCMSCapitatedAmendmentEmailPreview
    • Created parallel versions for Contracting events in a new file:
      • Waiver1915bCMSContractingInitialEmailPreview
      • Waiver1915bCMSContractingRenewalEmailPreview
      • Waiver1915bCMSContractingAmendmentEmailPreview
  2. InitialSubmissionCMS.test.tsx

    • Extended snapshot testing to cover the newly added email preview components for:
      • Capitated (Initial, Renewal, Amendment)
      • Contracting (Initial, Renewal, Amendment)
    • Ensures that each scenario is rendered correctly and captured in Jest snapshots.
  3. New File: Waiver_Contracting.tsx

    • Located under preview/Initial Submissions/CMS/, this file introduces all the new Contracting-related 1915(b) waiver email previews.
    • Follows a similar structure to the Capitated email preview file, with specific attachments and labeling for Contracting forms and documents.

3. Miscellaneous Changes

  • Formatting & Utility Updates
    • Minor updates to the utility function calls (e.g., formatActionType) to ensure the email subject lines, headings, and preview text accurately reflect the waiver submission type.
  • Snapshot Updates
    • Large changes in snapshot files (.test.tsx.snap) reflect newly introduced components and updated email text. This accounts for the majority of insertions and deletions in the diff.

4. Summary

In essence, these changes expand the Portal’s capability to handle Initial, Renewal, and Amendment submissions for 1915(b) Capitated and 1915(b) Contracting waivers. This PR:

  • Introduces new event types and integrates them into existing email templates.
  • Splits out email previews by type (Capitated vs. Contracting) to improve maintainability and clarity.
  • Updates and enlarges the Jest snapshot test coverage to ensure correctness and prevent regressions.

Once merged, users will see accurate and context-specific email notifications (for both CMS and state recipients) for Initial, Renewal, and Amendment submissions of 1915(b) Waivers.

Copy link
Contributor

github-actions bot commented Jan 8, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 80.73% 7190 / 8906
🔵 Statements 79.73% 7512 / 9421
🔵 Functions 72.09% 2095 / 2906
🔵 Branches 48.68% 1347 / 2767
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
lib/libs/email/content/new-submission/index.tsx 33.33% 100% 25% 33.33% 43-106
lib/libs/email/content/new-submission/emailTemplates/Waiver1915bCMS.tsx 100% 100% 100% 100%
lib/libs/email/content/new-submission/emailTemplates/Waiver1915bState.tsx 100% 100% 100% 100%
lib/libs/email/preview/Initial Submissions/CMS/InitialSubmissionCMS.test.tsx 100% 100% 100% 100%
lib/libs/email/preview/Initial Submissions/CMS/Waiver_Capitated.tsx 100% 100% 100% 100%
lib/libs/email/preview/Initial Submissions/CMS/Waiver_Contracting.tsx 100% 100% 100% 100%
lib/libs/email/preview/Initial Submissions/State/InitialSubmissionState.test.tsx 100% 100% 100% 100%
lib/libs/email/preview/Initial Submissions/State/Waiver_Capitated.tsx 100% 100% 100% 100%
lib/libs/email/preview/Initial Submissions/State/Waiver_Contracting.tsx 100% 100% 100% 100%
Generated in workflow #1417 for commit 7361cf6 by the Vitest Coverage Report Action

Copy link
Collaborator

@13bfrancis 13bfrancis left a comment

Choose a reason for hiding this comment

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

I like it

@benjaminpaige benjaminpaige merged commit f0b89cc into main Jan 9, 2025
21 checks passed
@benjaminpaige benjaminpaige deleted the waiver-amend branch January 9, 2025 18:40
RanyeM pushed a commit that referenced this pull request Jan 9, 2025
RanyeM added a commit that referenced this pull request Jan 9, 2025
* feature: adding new FAQ to FAQ page

* feature: question should open corresponding section

* fix: corrected code back to faq page direct link

* fix: removed id

* fix: #5 and #6 to expanded section

* fix: test coverage

* revert package json to what is on main

* fix(email): Fixes an issue with Outlook not correctly displaying the OneMAC logo and header (#972)

* fixed index test

* fix(test): Create mock for calling lambdas (#973)

* Added msw endpoints for Lambda, Step Functions, Secure Token Services, and other related services
* Added/updated test data to support new endpoints
* Updated tests to use the new endpoints instead of mocking individually

* fix(email): switch email logo back to using url

* fix(schema): remove logic for determining next business day for `submissionDate` (#980)

* fix: remove logic for determining next business day for `submissionDate`

* fix: update `submissionDate` value

* feat(ui): Remove status date from package details pages for all users (#965)

* fix(initial verbiage fix): Email verbiage fixes from qa (#974)

* correct verbage for med and chip spa

* fix issues with verbiage need confirmation

* remove comment

* add date and attachment logic

* update snapshots

* Update ChipSpaState.tsx

* test(email): proces email test (#979)

* feat(test)proces email test

* Removed console.log

* linter correction

* removed a ine

* remove brackets

* add region

* Address change reqeust

* feat(test)-submit lambda (#987)

* feat(test)-submit lambda

* Update withdrawpackage to withdrawrai

* linter corrections

* Fix some test

* Test for malformed objects

* Remove import vs code added in

* remove console.log

* Updatign to use get requestcontext

* feat(test) fix email test (#991)

* feat(test) fix email test
* Update processEmails.test.ts

* fix(os) helpers for getting domain and index for opensearch (#992)

* created helpers for getting domain and index for opensearch
* fixed import

* feat(test) updates to s3 calls on backend (#985)

* updates to s3 calls on backend

* feat(test)-unauthorized submission test (#996)

* feat(amend): Add waiver amendment emails (#993)

* Feat(playwright performance): Pw perf tests (#959)

* feat: initial perf tests for routes

fix: refactor

* Fix: updated per review comments

---------

Co-authored-by: asharonbaltazar <[email protected]>

---------

Co-authored-by: 13bfrancis <[email protected]>
Co-authored-by: Ty Bolt <[email protected]>
Co-authored-by: Tiffany Forkner <[email protected]>
Co-authored-by: asharonbaltazar <[email protected]>
Co-authored-by: James Dinh <[email protected]>
Co-authored-by: Thomas Walker <[email protected]>
Co-authored-by: Benjamin Paige <[email protected]>
Co-authored-by: Jon Schaffer <[email protected]>
Copy link
Contributor

github-actions bot commented Jan 9, 2025

🎉 This PR is included in version 1.5.0-val.103 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants