Skip to content

Commit

Permalink
feat(amend): Add waiver amendment emails (#993)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminpaige authored and RanyeM committed Jan 9, 2025
1 parent 0b94fa1 commit 73c5fb0
Show file tree
Hide file tree
Showing 12 changed files with 63,618 additions and 10,318 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ import { formatDate, formatActionType } from "shared-utils";
export const Waiver1915bCMSEmail = (props: {
variables:
| (Events["CapitatedInitial"] & CommonEmailVariables)
| (Events["ContractingInitial"] & CommonEmailVariables);
| (Events["ContractingInitial"] & CommonEmailVariables)
| (Events["CapitatedRenewal"] & CommonEmailVariables)
| (Events["ContractingRenewal"] & CommonEmailVariables)
| (Events["CapitatedAmendment"] & CommonEmailVariables)
| (Events["ContractingAmendment"] & CommonEmailVariables);
}) => {
const variables = props.variables;
const previewText = `${variables.authority} ${variables.actionType} Submitted`;
const previewText = `${variables.authority} ${formatActionType(variables.actionType)} Submitted`;
const heading = `The OneMAC Submission Portal received a ${
variables.authority
} ${formatActionType(variables.actionType)} Submission:`;
} ${formatActionType(variables.actionType)} waiver submission:`;
return (
<BaseEmailTemplate
previewText={previewText}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import { BaseEmailTemplate } from "../../email-templates";
export const Waiver1915bStateEmail = (props: {
variables:
| (Events["CapitatedInitial"] & CommonEmailVariables)
| (Events["ContractingInitial"] & CommonEmailVariables);
| (Events["CapitatedRenewal"] & CommonEmailVariables)
| (Events["CapitatedAmendment"] & CommonEmailVariables)
| (Events["ContractingInitial"] & CommonEmailVariables)
| (Events["ContractingRenewal"] & CommonEmailVariables)
| (Events["ContractingAmendment"] & CommonEmailVariables);
}) => {
const variables = props.variables;
const previewText = `${variables.authority} ${formatActionType(variables.actionType)} Submitted`;
Expand Down
6 changes: 4 additions & 2 deletions lib/libs/email/content/new-submission/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ export const newSubmission: AuthoritiesWithUserTypesTemplate = {
cms: async (
variables:
| (Events["CapitatedInitial"] & CommonEmailVariables & { emails: EmailAddresses })
| (Events["ContractingInitial"] & CommonEmailVariables & { emails: EmailAddresses }),
| (Events["ContractingInitial"] & CommonEmailVariables & { emails: EmailAddresses })
| (Events["CapitatedRenewal"] & CommonEmailVariables & { emails: EmailAddresses }),
) => {
return {
to: variables.emails.osgEmail,
Expand All @@ -72,7 +73,8 @@ export const newSubmission: AuthoritiesWithUserTypesTemplate = {
state: async (
variables:
| (Events["CapitatedInitial"] & CommonEmailVariables & { emails: EmailAddresses })
| (Events["ContractingInitial"] & CommonEmailVariables & { emails: EmailAddresses }),
| (Events["ContractingInitial"] & CommonEmailVariables & { emails: EmailAddresses })
| (Events["CapitatedRenewal"] & CommonEmailVariables & { emails: EmailAddresses }),
) => {
return {
to: [`${variables.submitterName} <${variables.submitterEmail}>`],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import AppKCMSEmailPreview from "./AppK";
import ChipSpaCMSEmailPreview from "./CHIP_SPA";
import Medicaid_SPA from "./Medicaid_SPA";
import TempExtCMSPreview from "./Temp_Extension";
import Waiver1915bCMSEmailPreview from "./Waiver_Capitated";

import * as WaiverCapitated from "./Waiver_Capitated";
import * as WaiverContracting from "./Waiver_Contracting";
describe("Initial Submission CMS Email Snapshot Test", () => {
it("renders a AppkCMSEmail Preview Template", () => {
const template = render(<AppKCMSEmailPreview />);
Expand All @@ -28,8 +28,33 @@ describe("Initial Submission CMS Email Snapshot Test", () => {

expect(template).toMatchSnapshot();
});
it("renders a Waiver Capitated Preview Template", () => {
const template = render(<Waiver1915bCMSEmailPreview />);
it("renders a Initial Waiver Capitated Preview Template", () => {
const template = render(<WaiverCapitated.Waiver1915bCMSCapitatedInitialEmailPreview />);

expect(template).toMatchSnapshot();
});
it("renders a Renewal Waiver Capitated Preview Template", () => {
const template = render(<WaiverCapitated.Waiver1915bCMSCapitatedRenewalEmailPreview />);

expect(template).toMatchSnapshot();
});
it("renders a Amendment Waiver Capitated Preview Template", () => {
const template = render(<WaiverCapitated.Waiver1915bCMSCapitatedAmendmentEmailPreview />);

expect(template).toMatchSnapshot();
});
it("renders a Amendment Waiver Contracting Preview Template", () => {
const template = render(<WaiverContracting.Waiver1915bCMSContractingAmendmentEmailPreview />);

expect(template).toMatchSnapshot();
});
it("renders a Renewal Waiver Contracting Preview Template", () => {
const template = render(<WaiverContracting.Waiver1915bCMSContractingRenewalEmailPreview />);

expect(template).toMatchSnapshot();
});
it("renders a Initial Waiver Contracting Preview Template", () => {
const template = render(<WaiverContracting.Waiver1915bCMSContractingInitialEmailPreview />);

expect(template).toMatchSnapshot();
});
Expand Down
102 changes: 99 additions & 3 deletions lib/libs/email/preview/Initial Submissions/CMS/Waiver_Capitated.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Waiver1915bCMSEmail } from "libs/email/content/new-submission/emailTemplates/Waiver1915bCMS";
import { emailTemplateValue } from "../../../mock-data/new-submission";

const Waiver1915bCMSEmailPreview = () => {
export const Waiver1915bCMSCapitatedInitialEmailPreview = () => {
return (
<Waiver1915bCMSEmail
variables={{
Expand Down Expand Up @@ -37,10 +37,106 @@ const Waiver1915bCMSEmailPreview = () => {
event: "capitated-initial",
id: "CO-1234.R21.00",
authority: "1915(b)",
actionType: "New",
actionType: "Initial",
}}
/>
);
};

export default Waiver1915bCMSEmailPreview;
export const Waiver1915bCMSCapitatedRenewalEmailPreview = () => {
return (
<Waiver1915bCMSEmail
variables={{
...emailTemplateValue,
waiverNumber: "CO-1234.R21.00",
attachments: {
bCapIndependentAssessment: {
label: "1915(b) Comprehensive (Capitated) Waiver Independent Assessment",
files: [
{
filename: "capitated-waiver-independent-assessment.pdf",
title: "test.pdf",
bucket: "test",
key: "test",
uploadDate: Date.now(),
},
],
},
bCapWaiverApplication: {
label: "1915(b) Comprehensive (Capitated) Waiver Application Pre-print",
files: [
{
filename: "capitated-waiver-application.pdf",
title: "test.pdf",
bucket: "test",
key: "test",
uploadDate: Date.now(),
},
],
},
bCapCostSpreadsheets: {
label: "1915(b) Comprehensive (Capitated) Waiver Cost Effectiveness Spreadsheets",
files: [
{
filename: "capitated-waiver-cost-effectiveness-spreadsheet.pdf",
title: "test.pdf",
bucket: "test",
key: "test",
uploadDate: Date.now(),
},
],
},
tribalConsultation: { label: "Tribal Consultation", files: [] },
other: { label: "Other", files: [] },
},
event: "capitated-renewal",
id: "CO-1234.R21.00",
authority: "1915(b)",
actionType: "Renewal",
}}
/>
);
};

export const Waiver1915bCMSCapitatedAmendmentEmailPreview = () => {
return (
<Waiver1915bCMSEmail
variables={{
...emailTemplateValue,
waiverNumber: "CO-1234.R21.00",
attachments: {
bCapCostSpreadsheets: {
label: "1915(b) Comprehensive (Capitated) Waiver Cost Effectiveness Spreadsheets",
files: [
{
filename: "capitated-waiver-cost-effectiveness-spreadsheet.pdf",
title: "test.pdf",
bucket: "test",
key: "test",
uploadDate: Date.now(),
},
],
},
bCapWaiverApplication: {
label: "1915(b) Comprehensive (Capitated) Waiver Application Pre-print",
files: [
{
filename: "capitated-waiver-application.pdf",
title: "test.pdf",
bucket: "test",
key: "test",
uploadDate: Date.now(),
},
],
},
tribalConsultation: { label: "Tribal Consultation", files: [] },
other: { label: "Other", files: [] },
},
event: "capitated-amendment",
id: "CO-1234.R21.01",
authority: "1915(b)",
actionType: "Amendment",
}}
/>
);
};
128 changes: 128 additions & 0 deletions lib/libs/email/preview/Initial Submissions/CMS/Waiver_Contracting.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
import { Waiver1915bCMSEmail } from "libs/email/content/new-submission/emailTemplates/Waiver1915bCMS";
import { emailTemplateValue } from "../../../mock-data/new-submission";

export const Waiver1915bCMSContractingInitialEmailPreview = () => {
return (
<Waiver1915bCMSEmail
variables={{
...emailTemplateValue,
attachments: {
b4WaiverApplication: {
label: "1915(b) Comprehensive (Contracting) Waiver Application Pre-print",
files: [
{
filename: "contracting-waiver-application.pdf",
title: "test.pdf",
bucket: "test",
key: "test",
uploadDate: Date.now(),
},
],
},
tribalConsultation: {
label: "Tribal Consultation",
files: [
{
filename: "contracting-waiver-tribal-consultation.pdf",
title: "test.pdf",
bucket: "test",
key: "test",
uploadDate: Date.now(),
},
],
},
other: { label: "Other", files: [] },
},
event: "contracting-initial",
id: "CO-1234.R21.00",
authority: "1915(b)",
actionType: "New",
}}
/>
);
};

export const Waiver1915bCMSContractingRenewalEmailPreview = () => {
return (
<Waiver1915bCMSEmail
variables={{
...emailTemplateValue,
event: "contracting-renewal",
id: "CO-1234.R21.00",
authority: "1915(b)",
actionType: "Renewal",
waiverNumber: "CO-1234.R21.00",
attachments: {
b4WaiverApplication: {
label: "1915(b) Comprehensive (Contracting) Waiver Application Pre-print",
files: [
{
filename: "contracting-waiver-application.pdf",
title: "test.pdf",
bucket: "test",
key: "test",
uploadDate: Date.now(),
},
],
},
b4IndependentAssessment: {
label: "1915(b) Comprehensive (Contracting) Independent Assessment",
files: [
{
filename: "contracting-waiver-independent-assessment.pdf",
title: "test.pdf",
bucket: "test",
key: "test",
uploadDate: Date.now(),
},
],
},
tribalConsultation: { label: "Tribal Consultation", files: [] },
other: { label: "Other", files: [] },
},
}}
/>
);
};

export const Waiver1915bCMSContractingAmendmentEmailPreview = () => {
return (
<Waiver1915bCMSEmail
variables={{
...emailTemplateValue,
event: "contracting-amendment",
id: "CO-1234.R21.01",
authority: "1915(b)",
actionType: "Amendment",
waiverNumber: "CO-1234.R21.00",
attachments: {
b4WaiverApplication: {
label: "1915(b) Comprehensive (Contracting) Waiver Application Pre-print",
files: [
{
filename: "contracting-waiver-application.pdf",
title: "test.pdf",
bucket: "test",
key: "test",
uploadDate: Date.now(),
},
],
},
tribalConsultation: {
label: "Tribal Consultation",
files: [
{
filename: "contracting-waiver-tribal-consultation.pdf",
title: "test.pdf",
bucket: "test",
key: "test",
uploadDate: Date.now(),
},
],
},
other: { label: "Other", files: [] },
},
}}
/>
);
};
Loading

0 comments on commit 73c5fb0

Please sign in to comment.