diff --git a/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-generate-petition.cy.ts b/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-generate-petition.cy.ts index bccfa5c57cd..d7317d5f8be 100644 --- a/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-generate-petition.cy.ts +++ b/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-generate-petition.cy.ts @@ -363,15 +363,15 @@ describe('File a petition', () => { "Petitioner's contact information: John Cruz 123 Test Drive Boulder, CO 12345 Phone: Test Phone", ); expect(text).to.include( - "Counsel's contact information: Test Private Practitioner Bogus Barristers 234 Main St Apartment 4 Under the stairs Chicago, IL 61234 +1 (555) 555-5555 privatePractitioner1@example.com Tax Court Bar No.: PT5432", + "Counsel's contact information: Test Private Practitioner Bogus Barristers 234 Main St Apartment 4 Under the stairs Chicago, IL 61234 Phone: +1 (555) 555-5555 Email: privatePractitioner1@example.com Tax Court Bar No.: PT5432", + ); + expect(text).not.to.include('Service Email'); + expect(text).not.to.include( + 'Register for electronic filing and service', ); }, ); }); - - // should not display Service Email - // should not display Register for electronic filing and service: - // should display counsel contact information }); }); }); diff --git a/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-step-1-myself.cy.ts b/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-step-1-myself.cy.ts index e1bbdcb6287..90a4ce95162 100644 --- a/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-step-1-myself.cy.ts +++ b/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-step-1-myself.cy.ts @@ -52,6 +52,12 @@ describe('File a petition: Step 1 - Petitioner Information', () => { ); }); + it('should not display email field', () => { + cy.get('[data-testid="filing-type-0"]').click(); + cy.get('[data-testid="contact-primary-paper-petition-email"]').should( + 'not.exist', + ); + }); it('should display validation error messages to all required fields left empty', () => { const ERROR_MESSAGES_DATA_TEST_ID = [ 'primary-contact-name-error-message', @@ -201,6 +207,12 @@ describe('File a petition: Step 1 - Petitioner Information', () => { 'Petitioner’s full name', ); }); + it('should display email field', () => { + cy.get('[data-testid="filing-type-0"]').click(); + cy.get('[data-testid="contact-primary-paper-petition-email"]').should( + 'exist', + ); + }); }); }); }); diff --git a/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-step-1-other--minor-or-legally-incompetent.cy.ts b/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-step-1-other--minor-or-legally-incompetent.cy.ts index a1899d22d7d..5e336d77885 100644 --- a/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-step-1-other--minor-or-legally-incompetent.cy.ts +++ b/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-step-1-other--minor-or-legally-incompetent.cy.ts @@ -687,21 +687,28 @@ describe('File a petition: Step 1 - Petitioner Information', () => { }); describe('Practitioner', () => { - beforeEach(() => { - loginAsPrivatePractitioner(); - cy.visit('/file-a-petition/new'); - cy.get('[data-testid="step-indicator-current-step-1-icon"]'); - cy.get('[data-testid="filing-type-3"').click(); - }); - describe('Other', () => { - describe('A minor or legally incompetent person', () => { - it('should display correct other type title', () => { - cy.get('[data-testid="other-type-radio-option-1"]').click(); - cy.get('[data-testid="estate-type-legend"]').should( - 'have.text', - 'What is the petitioner’s role in filing for this minor or legally incompetent person?', - ); - }); + describe('Other Filing Options', () => { + it('should display other filing options', () => { + loginAsPrivatePractitioner(); + cy.visit('/file-a-petition/new'); + cy.get('[data-testid="filing-type-3"').click(); + + cy.get('[data-testid="other-type-radio-option-0"]').should( + 'have.text', + 'An estate or trust', + ); + cy.get('[data-testid="other-type-radio-option-1"]').should( + 'have.text', + 'Donor', + ); + cy.get('[data-testid="other-type-radio-option-2"]').should( + 'have.text', + 'Transferee', + ); + cy.get('[data-testid="other-type-radio-option-3"]').should( + 'have.text', + 'Deceased Spouse', + ); }); }); }); diff --git a/shared/src/business/entities/contacts/ContactFactoryUpdated.ts b/shared/src/business/entities/contacts/ContactFactoryUpdated.ts index 3c7fc709a72..c1c7ec26d72 100644 --- a/shared/src/business/entities/contacts/ContactFactoryUpdated.ts +++ b/shared/src/business/entities/contacts/ContactFactoryUpdated.ts @@ -1,5 +1,5 @@ import { BusinessContact } from './BusinessContact'; -import { CONTACT_TYPES, PARTY_TYPES } from '../EntityConstants'; +import { CONTACT_TYPES, FilingType, PARTY_TYPES } from '../EntityConstants'; import { ContactUpdated } from '@shared/business/entities/contacts/ContactUpdated'; import { DeceasedSpouseContact } from '@shared/business/entities/contacts/DeceasedSpouseContact'; import { OtherContact } from '@shared/business/entities/contacts/OtherContact'; @@ -15,7 +15,7 @@ export function ContactFactoryUpdated({ }: { contactInfoPrimary: {}; contactInfoSecondary: {}; - filingType: string; + filingType: FilingType; partyType: string; petitionType: string; hasSpouseConsent: boolean; diff --git a/shared/src/business/useCases/generatePetitionPdfInteractor.ts b/shared/src/business/useCases/generatePetitionPdfInteractor.ts index e2b3e6f2d1b..e38c83e13f7 100644 --- a/shared/src/business/useCases/generatePetitionPdfInteractor.ts +++ b/shared/src/business/useCases/generatePetitionPdfInteractor.ts @@ -27,6 +27,7 @@ export interface Contact { address2?: string; address3?: string; city: string; + paperPetitionEmail?: string; postalCode: string; phone: string; state: string; diff --git a/shared/src/business/utilities/pdfGenerator/documentTemplates/Petition.tsx b/shared/src/business/utilities/pdfGenerator/documentTemplates/Petition.tsx index 7939beb3657..dbd83b4aaf0 100644 --- a/shared/src/business/utilities/pdfGenerator/documentTemplates/Petition.tsx +++ b/shared/src/business/utilities/pdfGenerator/documentTemplates/Petition.tsx @@ -199,6 +199,12 @@ export const Petition = ({ Phone: {contactPrimary.phone} + {!isPetitioner && ( +
+ Email: + {contactPrimary.paperPetitionEmail || 'Email not provided'} +
+ )} {contactPrimary.placeOfLegalResidence && (
{BUSINESS_TYPE_VALUES.includes(partyType) ? ( @@ -288,8 +294,14 @@ export const Petition = ({ {contactCounsel.city}, {contactCounsel.state}{' '} {contactCounsel.postalCode}
-
{contactCounsel.phone}
-
{contactCounsel.email}
+
+ Phone: + {contactCounsel.phone} +
+
+ Email: + {contactCounsel.email} +
Tax Court Bar No.: diff --git a/web-api/src/business/useCases/createCaseInteractor.test.ts b/web-api/src/business/useCases/createCaseInteractor.test.ts index f3243dfcb35..03595fd9a9f 100644 --- a/web-api/src/business/useCases/createCaseInteractor.test.ts +++ b/web-api/src/business/useCases/createCaseInteractor.test.ts @@ -347,7 +347,7 @@ describe('createCaseInteractor', () => { stinFile: new File([], 'test.pdf'), stinFileSize: 1, }, - stinFileId: '96759830-8970-486f-916b-23439a8ebb70', + stinFileId: '413f62ce-7c8d-446e-aeda-14a2a625a611', }, user, ); @@ -398,7 +398,7 @@ describe('createCaseInteractor', () => { stinFile: new File([], 'test.pdf'), stinFileSize: 1, }, - stinFileId: '96759830-8970-486f-916b-23439a8ebb70', + stinFileId: '413f62ce-7c8d-446e-aeda-14a2a625a611', }, user, ); @@ -548,7 +548,7 @@ describe('createCaseInteractor', () => { }); }); - it('should set serviceIndicator to none for petitioner when case is created by a private petitioner', async () => { + it('should remove email and serviceIndicator for petitioner when case is created by a private petitioner', async () => { user = new PrivatePractitioner({ barNumber: 'BN1234', email: 'kb@example.com', @@ -594,6 +594,7 @@ describe('createCaseInteractor', () => { result.petitioners.forEach(p => { expect(p.serviceIndicator).toBe(SERVICE_INDICATOR_TYPES.SI_NONE); + expect(p.email).toBeUndefined(); }); }); }); diff --git a/web-api/src/business/useCases/createCaseInteractor.ts b/web-api/src/business/useCases/createCaseInteractor.ts index 930ed3039cc..76b3a49ea9c 100644 --- a/web-api/src/business/useCases/createCaseInteractor.ts +++ b/web-api/src/business/useCases/createCaseInteractor.ts @@ -110,7 +110,9 @@ export const createCaseInteractor = async ( ); } - // remove the email from contactPrimary since the practitioners array should have a service email + // remove the email from contactPrimary + // since the practitioners array should have a service email + // and paperPetitionEmail is used as email for the petitioner delete petitionEntity.getContactPrimary().email; delete petitionEntity.getContactPrimary().serviceIndicator; diff --git a/web-client/src/presenter/actions/formatPetitionAction.test.ts b/web-client/src/presenter/actions/formatPetitionAction.test.ts index 358036b2c01..e7cfc5e5cd1 100644 --- a/web-client/src/presenter/actions/formatPetitionAction.test.ts +++ b/web-client/src/presenter/actions/formatPetitionAction.test.ts @@ -1,10 +1,10 @@ -import { - CASE_TYPES_MAP, - ROLES, -} from '@shared/business/entities/EntityConstants'; +import { CASE_TYPES_MAP } from '@shared/business/entities/EntityConstants'; import { applicationContextForClient as applicationContext } from '@web-client/test/createClientTestApplicationContext'; import { formatPetitionAction } from '@web-client/presenter/actions/formatPetitionAction'; -import { mockPetitionerUser } from '@shared/test/mockAuthUsers'; +import { + mockPetitionerUser, + mockPrivatePractitionerUser, +} from '@shared/test/mockAuthUsers'; import { presenter } from '../presenter-mock'; import { runAction } from '@web-client/presenter/test.cerebral'; @@ -170,6 +170,7 @@ describe('formatPetitionAction', () => { state: { petitionFormatted: undefined, user: { + ...mockPrivatePractitionerUser, barNumber: 'TEST_barNumber', contact: { address1: 'TEST_address1', @@ -180,10 +181,7 @@ describe('formatPetitionAction', () => { postalCode: 'TEST_postalCode', state: 'TEST_state', }, - email: TEST_EMAIL, firmName: 'TEST_firmName', - name: 'TEST_Name', - role: ROLES.privatePractitioner, }, }, }); @@ -194,12 +192,51 @@ describe('formatPetitionAction', () => { address3: 'TEST_address3', barNumber: 'TEST_barNumber', city: 'TEST_city', - email: 'TEST_EMAIL', + email: 'mockPrivatePractitioner@example.com', firmName: 'TEST_firmName', - name: 'TEST_Name', + name: 'Reginald Barclay', phone: 'TEST_phone', postalCode: 'TEST_postalCode', state: 'TEST_state', }); }); + + it('should set primary contact email to user email when the user is a petitioner', async () => { + const results = await runAction(formatPetitionAction, { + modules: { + presenter, + }, + props: PROPS, + state: { + petitionFormatted: undefined, + user: mockPetitionerUser, + }, + }); + + expect(results.state.petitionFormatted?.contactPrimary?.email).toEqual( + 'mockPetitioner@example.com', + ); + }); + + it('should not set primary contact email to user email when the user is a private practitioner', async () => { + const results = await runAction(formatPetitionAction, { + modules: { + presenter, + }, + props: { + ...PROPS, + createPetitionStep1Data: { + contactPrimary: { email: 'test@example.com' }, + }, + }, + state: { + petitionFormatted: undefined, + user: mockPrivatePractitionerUser, + }, + }); + + expect(results.state.petitionFormatted?.contactPrimary?.email).toEqual( + 'mockPrivatePractitioner@example.com', + ); + }); }); diff --git a/web-client/src/presenter/actions/formatPetitionAction.ts b/web-client/src/presenter/actions/formatPetitionAction.ts index 2e29f97bb32..65ffd156b9f 100644 --- a/web-client/src/presenter/actions/formatPetitionAction.ts +++ b/web-client/src/presenter/actions/formatPetitionAction.ts @@ -37,6 +37,7 @@ export const formatPetitionAction = ({ const { contactPrimary, irsNotices } = petitionInfo; const user = get(state.user); + contactPrimary.email = user.email; const irsNoticesWithCaseTypes = irsNotices.map(irsNotice => { diff --git a/web-client/src/presenter/actions/saveAndSubmitCaseAction.test.ts b/web-client/src/presenter/actions/saveAndSubmitCaseAction.test.ts index ecd812683b2..ed932172e66 100644 --- a/web-client/src/presenter/actions/saveAndSubmitCaseAction.test.ts +++ b/web-client/src/presenter/actions/saveAndSubmitCaseAction.test.ts @@ -1,5 +1,6 @@ import { PETITION_TYPES } from '@shared/business/entities/EntityConstants'; import { applicationContextForClient as applicationContext } from '@web-client/test/createClientTestApplicationContext'; +import { mockPetitionerUser } from '@shared/test/mockAuthUsers'; import { presenter } from '@web-client/presenter/presenter-mock'; import { runAction } from '@web-client/presenter/test.cerebral'; import { saveAndSubmitCaseAction } from '@web-client/presenter/actions/saveAndSubmitCaseAction'; @@ -68,6 +69,7 @@ describe('saveAndSubmitCaseAction', () => { petitionFormatted: 'petitionFormattedData', petitionType: PETITION_TYPES.userUploaded, }, + user: mockPetitionerUser, }, }); @@ -150,6 +152,7 @@ describe('saveAndSubmitCaseAction', () => { petitionFormatted: 'petitionFormattedData', petitionType: PETITION_TYPES.autoGenerated, }, + user: mockPetitionerUser, }, }); @@ -234,6 +237,7 @@ describe('saveAndSubmitCaseAction', () => { petitionFormatted: 'petitionFormattedData', petitionType: PETITION_TYPES.autoGenerated, }, + user: mockPetitionerUser, }, }); diff --git a/web-client/src/presenter/actions/saveAndSubmitCaseAction.ts b/web-client/src/presenter/actions/saveAndSubmitCaseAction.ts index 52eebd0e098..283f6ecc681 100644 --- a/web-client/src/presenter/actions/saveAndSubmitCaseAction.ts +++ b/web-client/src/presenter/actions/saveAndSubmitCaseAction.ts @@ -3,6 +3,7 @@ import { FileUploadProgressType, FileUploadProgressValueType, PETITION_TYPES, + ROLES, } from '@shared/business/entities/EntityConstants'; import { state } from '@web-client/presenter/app.cerebral'; @@ -82,11 +83,14 @@ export const saveAndSubmitCaseAction = async ({ await Promise.all(documentsThatNeedCoverSheet.map(addCoversheet)); + const isPetitioner = user.role === ROLES.petitioner; + const successTitle = `${isPetitioner ? 'Your' : 'The'} case has been assigned docket number ${caseDetail.docketNumberWithSuffix || caseDetail.docketNumber}`; + const successMessage = `${isPetitioner ? 'Your' : 'The'} case has been created and ${isPetitioner ? 'your' : ''} documents sent to the U.S. Tax Court.`; + return path.success({ alertSuccess: { - message: - 'Your case has been created and your documents sent to the U.S. Tax Court.', - title: `Your case has been assigned docket number ${caseDetail.docketNumberWithSuffix || caseDetail.docketNumber}`, + message: successMessage, + title: successTitle, }, caseDetail, }); diff --git a/web-client/src/presenter/computeds/internalPetitionPartiesHelper.test.ts b/web-client/src/presenter/computeds/internalPetitionPartiesHelper.test.ts index 5c32dbda3b1..2fb11067cab 100644 --- a/web-client/src/presenter/computeds/internalPetitionPartiesHelper.test.ts +++ b/web-client/src/presenter/computeds/internalPetitionPartiesHelper.test.ts @@ -2,6 +2,7 @@ import { ALLOWLIST_FEATURE_FLAGS, FILING_TYPES, PARTY_TYPES, + ROLES, } from '../../../../shared/src/business/entities/EntityConstants'; import { applicationContextForClient as applicationContext } from '@web-client/test/createClientTestApplicationContext'; import { @@ -420,44 +421,44 @@ describe('internalPetitionPartiesHelper', () => { user: docketClerk1User, }; - it('should be false when the current user is an external user', () => { + it('should not show email and consent fields when the e-consent feature flag is disabled', () => { const result = runCompute(internalPetitionPartiesHelper, { - state: { ...baseState, user: petitionerUser }, + state: { + ...baseState, + featureFlags: { + [ALLOWLIST_FEATURE_FLAGS.E_CONSENT_FIELDS_ENABLED_FEATURE_FLAG.key]: + false, + }, + user: petitionsClerkUser, + }, }); expect(result.showPaperPetitionEmailFieldAndConsentBox).toEqual(false); }); - it('should be true when the current user is a petitions clerk user', () => { + it('should not show email and consent fields for external user', () => { const result = runCompute(internalPetitionPartiesHelper, { - state: { - ...baseState, - form: { - isPaper: true, - }, - user: petitionsClerkUser, - }, + state: { ...baseState, user: petitionerUser }, }); - expect(result.showPaperPetitionEmailFieldAndConsentBox).toEqual(true); + expect(result.showPaperPetitionEmailFieldAndConsentBox).toEqual(false); }); - it('should be false when the e-consent feature flag is disabled', () => { + it('should show email and consent fields for an internal user with paper filing', () => { const result = runCompute(internalPetitionPartiesHelper, { state: { ...baseState, - featureFlags: { - [ALLOWLIST_FEATURE_FLAGS.E_CONSENT_FIELDS_ENABLED_FEATURE_FLAG.key]: - false, + form: { + isPaper: true, }, user: petitionsClerkUser, }, }); - expect(result.showPaperPetitionEmailFieldAndConsentBox).toEqual(false); + expect(result.showPaperPetitionEmailFieldAndConsentBox).toEqual(true); }); - it('should be true when the e-consent feature flag is enabled, it is a paper petition and the current user is internal', () => { + it('should not show email and consent fields for an internal user with an electronic filing', () => { const result = runCompute(internalPetitionPartiesHelper, { state: { ...baseState, @@ -466,16 +467,16 @@ describe('internalPetitionPartiesHelper', () => { true, }, form: { - isPaper: true, + isPaper: false, }, user: petitionsClerkUser, }, }); - expect(result.showPaperPetitionEmailFieldAndConsentBox).toEqual(true); + expect(result.showPaperPetitionEmailFieldAndConsentBox).toEqual(false); }); - it('should be false when the e-consent feature flag is enabled, and it is NOT a paper petition', () => { + it('should show email and consent fields when petition was filed electronically by a private practitioner', () => { const result = runCompute(internalPetitionPartiesHelper, { state: { ...baseState, @@ -485,12 +486,13 @@ describe('internalPetitionPartiesHelper', () => { }, form: { isPaper: false, + privatePractitioners: [{ role: ROLES.privatePractitioner }], }, user: petitionsClerkUser, }, }); - expect(result.showPaperPetitionEmailFieldAndConsentBox).toEqual(false); + expect(result.showPaperPetitionEmailFieldAndConsentBox).toEqual(true); }); }); diff --git a/web-client/src/presenter/computeds/internalPetitionPartiesHelper.ts b/web-client/src/presenter/computeds/internalPetitionPartiesHelper.ts index d947b603d43..ba76931db0f 100644 --- a/web-client/src/presenter/computeds/internalPetitionPartiesHelper.ts +++ b/web-client/src/presenter/computeds/internalPetitionPartiesHelper.ts @@ -213,7 +213,10 @@ export const internalPetitionPartiesHelper = ( applicationContext.getConstants(); const user = get(state.user); - const { filingType, isPaper, partyType } = get(state.form); + const { filingType, isPaper, partyType, privatePractitioners } = get( + state.form, + ); + const E_CONSENT_FIELDS_ENABLED_FEATURE_FLAG = get( state.featureFlags[ ALLOWLIST_FEATURE_FLAGS.E_CONSENT_FIELDS_ENABLED_FEATURE_FLAG.key @@ -225,7 +228,12 @@ export const internalPetitionPartiesHelper = ( .isExternalUser(user.role); const showPaperPetitionEmailFieldAndConsentBox = - E_CONSENT_FIELDS_ENABLED_FEATURE_FLAG && !!isPaper && !isExternalUser; + getShowPaperPetitionEmailFieldAndConsentBox({ + eConsentFieldsEnabled: !!E_CONSENT_FIELDS_ENABLED_FEATURE_FLAG, + isExternalUser, + isPaperFiling: isPaper, + petitionFiledByPrivatePractitioner: privatePractitioners?.length, + }); const showSecondaryContactEmailFieldAndConsentBox = E_CONSENT_FIELDS_ENABLED_FEATURE_FLAG && @@ -242,3 +250,19 @@ export const internalPetitionPartiesHelper = ( showSecondaryContactEmailFieldAndConsentBox, }; }; + +function getShowPaperPetitionEmailFieldAndConsentBox({ + eConsentFieldsEnabled, + isExternalUser, + isPaperFiling, + petitionFiledByPrivatePractitioner, +}: { + eConsentFieldsEnabled: boolean; + isExternalUser: boolean; + petitionFiledByPrivatePractitioner: boolean; + isPaperFiling: boolean; +}) { + if (!eConsentFieldsEnabled || isExternalUser) return false; + if (petitionFiledByPrivatePractitioner || isPaperFiling) return true; + return false; +} diff --git a/web-client/src/presenter/computeds/updatedFilePetitionHelper.test.ts b/web-client/src/presenter/computeds/updatedFilePetitionHelper.test.ts index 42af2830104..b2aa17d4844 100644 --- a/web-client/src/presenter/computeds/updatedFilePetitionHelper.test.ts +++ b/web-client/src/presenter/computeds/updatedFilePetitionHelper.test.ts @@ -113,6 +113,31 @@ describe('updatedFilePetitionHelper', () => { ]); }); }); + describe('otherFilingOptions', () => { + it('should return the other filing options for petitioner', () => { + const result = runCompute(updatedFilePetitionHelper, { + state: { form: {}, user: petitionerUser }, + }); + expect(result.otherFilingOptions).toEqual([ + 'An estate or trust', + 'A minor or legally incompetent person', + 'Donor', + 'Transferee', + 'Deceased Spouse', + ]); + }); + it('should return other filing options for practitioner', () => { + const result = runCompute(updatedFilePetitionHelper, { + state: { form: {}, user: privatePractitionerUser }, + }); + expect(result.otherFilingOptions).toEqual([ + 'An estate or trust', + 'Donor', + 'Transferee', + 'Deceased Spouse', + ]); + }); + }); describe('showContactInformationForOtherPartyType', () => { const partyTypesWithOtherPartyTypeContactInfo = [ PARTY_TYPES.donor, @@ -155,7 +180,6 @@ describe('updatedFilePetitionHelper', () => { expect(result.showContactInformationForOtherPartyType).toBeFalsy(); }); }); - describe('otherContactNameLabel', () => { it('should return correct labels for survivingSpouse', () => { const result = runCompute(updatedFilePetitionHelper, { diff --git a/web-client/src/presenter/computeds/updatedFilePetitionHelper.ts b/web-client/src/presenter/computeds/updatedFilePetitionHelper.ts index 96593675d87..abd10e6f173 100644 --- a/web-client/src/presenter/computeds/updatedFilePetitionHelper.ts +++ b/web-client/src/presenter/computeds/updatedFilePetitionHelper.ts @@ -1,6 +1,6 @@ import { ClientApplicationContext } from '@web-client/applicationContext'; +import { FilingType, ROLES } from '@shared/business/entities/EntityConstants'; import { Get } from 'cerebral'; -import { ROLES } from '@shared/business/entities/EntityConstants'; import { state } from '@web-client/presenter/app.cerebral'; interface IBusinessFields { @@ -26,6 +26,7 @@ type UpdatedFilePetitionHelper = { isPractitioner: boolean; businessFieldNames: IBusinessFields | {}; otherContactNameLabel?: IOtherContactNameLabel; + otherFilingOptions: string[]; showContactInformationForOtherPartyType: boolean; }; @@ -49,18 +50,41 @@ export const updatedFilePetitionHelper = ( const isPetitioner = user.role === ROLES.petitioner; const isPractitioner = user.role === ROLES.privatePractitioner; + const otherFilingOptions = getOtherFilingOptions(isPractitioner); + return { businessFieldNames, filingOptions, isPetitioner, isPractitioner, otherContactNameLabel, + otherFilingOptions, showContactInformationForOtherPartyType: getShowContactInformationForOtherPartyType(partyType, PARTY_TYPES), }; }; -function formatFilingTypes(filingOptions) { +function getOtherFilingOptions(isPractitioner) { + const estateOrTrust = 'An estate or trust'; + const minorOrIncompetentPerson = 'A minor or legally incompetent person'; + const donor = 'Donor'; + const transferee = 'Transferee'; + const deceasedSpouse = 'Deceased Spouse'; + + const otherFilingOptions = isPractitioner + ? [estateOrTrust, donor, transferee, deceasedSpouse] + : [ + estateOrTrust, + minorOrIncompetentPerson, + donor, + transferee, + deceasedSpouse, + ]; + + return otherFilingOptions; +} + +function formatFilingTypes(filingOptions: FilingType[]) { return filingOptions.map(option => { if (option === 'Individual petitioner') { return { diff --git a/web-client/src/presenter/state.ts b/web-client/src/presenter/state.ts index b0bcba3afe7..643ef2b6fee 100644 --- a/web-client/src/presenter/state.ts +++ b/web-client/src/presenter/state.ts @@ -1,4 +1,5 @@ /* eslint-disable max-lines */ +import { Contact } from '@shared/business/useCases/generatePetitionPdfInteractor'; import { FormattedPendingMotionWithWorksheet } from '@web-api/business/useCases/pendingMotion/getPendingMotionDocketEntriesForCurrentJudgeInteractor'; import { GetCasesByStatusAndByJudgeResponse } from '@web-api/business/useCases/judgeActivityReport/getCaseWorksheetsByJudgeInteractor'; import { @@ -768,8 +769,8 @@ export const baseState = { caseTitle: undefined, caseType: undefined, contactCounsel: undefined, - contactPrimary: undefined, - contactSecondary: undefined, + contactPrimary: undefined as Contact | undefined, + contactSecondary: undefined as Contact | undefined, corporateDisclosureFile: undefined, corporateDisclosureFileUrl: undefined, hasIrsNotice: undefined, diff --git a/web-client/src/styles/overrides.scss b/web-client/src/styles/overrides.scss index eed8c8a9ed7..4537aa5bfd4 100644 --- a/web-client/src/styles/overrides.scss +++ b/web-client/src/styles/overrides.scss @@ -343,14 +343,6 @@ p { font-size: 17px; font-weight: normal; } - - button:not([disabled]):focus { - outline: none; - } - - .usa-accordion__button:hover { - background-color: inherit; - } } .other-filing-option { diff --git a/web-client/src/views/BeforeStartingCase.tsx b/web-client/src/views/BeforeStartingCase.tsx index 8874d22c036..90f60866153 100644 --- a/web-client/src/views/BeforeStartingCase.tsx +++ b/web-client/src/views/BeforeStartingCase.tsx @@ -14,6 +14,8 @@ import { sequences } from '@web-client/presenter/app.cerebral'; import { state } from '@web-client/presenter/app.cerebral'; import React from 'react'; +type PetitionCreationRoles = 'petitioner' | 'privatePractitioner'; + export const BeforeStartingCase = connect( { closeModalAndReturnToDashboardSequence: @@ -30,7 +32,9 @@ export const BeforeStartingCase = connect( }) { const redirectUrl = petitionFlowUpdated && - [ROLES.petitioner, ROLES.privatePractitioner].includes(user.role) + [ROLES.petitioner, ROLES.privatePractitioner].includes( + user.role as PetitionCreationRoles, + ) ? '/file-a-petition/new' : '/file-a-petition/step-1'; @@ -209,7 +213,8 @@ export const BeforeStartingCase = connect( > If {isPetitioner ? 'you' : 'the petitioner'} received a notice in the mail from the IRS, it may show the last date to file or the - number of days you have to file a Petition.{' '} + number of days {isPetitioner ? 'you have' : ''} to file a + Petition.{' '} In most cases, the Court must receive{' '} {isPetitioner ? 'your' : 'the'} electronically filed Petition no @@ -219,85 +224,7 @@ export const BeforeStartingCase = connect( {isPetitioner ? 'your' : 'the'} case may be dismissed.
-
- {isPetitioner && ( - - -
- { - "To file a joint Petition with your spouse, you must have the spouse's consent. If you do not have your spouse's consent, select “Myself” as the person who is filing." - } -
-
-
- )} - {isPetitioner && ( - - -
- To file a case on behalf of someone else, you must be - authorized to practice before this Court as provided by the{' '} - - { - '. Enrolled agents, certified public accountants, and attorneys who are not admitted to practice before the Court are not eligible to represent a party.' - } -
-
-
- )} - - -
- {`If ${isPetitioner ? "you're filing for" : 'the petitioner is'} a business, you'll need to complete and - submit the Corporate Disclosure Statement.`} -
-
- { - "Download and fill out the form if you haven't already done so:" - } -
- -
-
-
+ + { + '. Enrolled agents, certified public accountants, and attorneys who are not admitted to practice before the Court are not eligible to represent a party.' + } + + + + )} + + +
+ {`If ${isPetitioner ? "you're filing for" : 'the petitioner is'} a business, you'll need to complete and + submit the Corporate Disclosure Statement.`} +
+
+ {"Download and fill out the form if you haven't already done so:"} +
+ +
+
+ + ); +} diff --git a/web-client/src/views/StartCase/ContactPrimaryUpdated.tsx b/web-client/src/views/StartCase/ContactPrimaryUpdated.tsx index e4fc365f62e..d8bdaa87380 100644 --- a/web-client/src/views/StartCase/ContactPrimaryUpdated.tsx +++ b/web-client/src/views/StartCase/ContactPrimaryUpdated.tsx @@ -25,6 +25,7 @@ type ContactPrimaryUpdate = { registerRef?: Function; secondaryLabel?: string; secondaryLabelNote?: string; + showEmail?: boolean; showInCareOf?: boolean; showInCareOfOptional?: boolean; titleLabel?: string; @@ -52,6 +53,7 @@ export const ContactPrimaryUpdated = connect< registerRef, secondaryLabel, secondaryLabelNote, + showEmail, showInCareOf, showInCareOfOptional, titleLabel, @@ -271,6 +273,43 @@ export const ContactPrimaryUpdated = connect< }} /> + {showEmail && ( + + + { + handleBlur({ + validationKey: ['contactPrimary', 'paperPetitionEmail'], + }); + }} + onChange={e => { + handleChange({ + key: e.target.name, + value: e.target.value, + }); + }} + /> + + )} ); diff --git a/web-client/src/views/StartCaseUpdated/BusinessInfo.tsx b/web-client/src/views/StartCaseUpdated/BusinessInfo.tsx index 3f0f526cddc..d031d63cbbc 100644 --- a/web-client/src/views/StartCaseUpdated/BusinessInfo.tsx +++ b/web-client/src/views/StartCaseUpdated/BusinessInfo.tsx @@ -7,6 +7,7 @@ import React from 'react'; export function BusinessInfo({ businessFieldNames, form, + isPractitioner, petitionGenerationLiveValidationSequence, registerRef, updateFilingTypeSequence, @@ -71,6 +72,7 @@ export function BusinessInfo({ placeOfLegalResidenceTitle="Place of business" registerRef={registerRef} secondaryLabel={businessFieldNames.secondary} + showEmail={isPractitioner} showInCareOf={businessFieldNames.showInCareOf} showInCareOfOptional={businessFieldNames.showInCareOfOptional} /> diff --git a/web-client/src/views/StartCaseUpdated/CounselInformation.tsx b/web-client/src/views/StartCaseUpdated/CounselInformation.tsx index 452f958f981..72dcf9b840d 100644 --- a/web-client/src/views/StartCaseUpdated/CounselInformation.tsx +++ b/web-client/src/views/StartCaseUpdated/CounselInformation.tsx @@ -39,7 +39,7 @@ export function CounselInformation({ userInfo }) { What other type of taxpayer are you filing for? - {[ - 'An estate or trust', - 'A minor or legally incompetent person', - 'Donor', - 'Transferee', - 'Deceased Spouse', - ].map((otherType, idx) => ( + {otherFilingOptions.map((otherType, idx) => (
Party type -
{petitionFormatted.partyType}
+
+ {getPartyType(petitionFormatted.partyType, isPetitioner)} +
{petitionFormatted.corporateDisclosureFile && (
{petitionFormatted.contactPrimary.placeOfLegalResidence && (
@@ -121,6 +131,9 @@ export function PetitionerInformation({ isPetitioner, petitionFormatted }) { email: petitionFormatted.contactSecondary.paperPetitionEmail || 'Email not provided', + phone: + petitionFormatted.contactSecondary.phone || + 'Phone number not provided', }} /> @@ -165,3 +178,10 @@ export function PetitionerInformation({ isPetitioner, petitionFormatted }) {
); } + +function getPartyType(partyType: PartyType, isPetitioner: boolean) { + if (!isPetitioner && partyType === PARTY_TYPES.petitionerSpouse) { + return 'Petitioner & petitioner spouse'; + } + return partyType; +} diff --git a/web-client/src/views/StartCaseUpdated/SecondaryMinorIncompetentOptions.tsx b/web-client/src/views/StartCaseUpdated/SecondaryMinorIncompetentOptions.tsx index 12db8f640b1..c49630fb63f 100644 --- a/web-client/src/views/StartCaseUpdated/SecondaryMinorIncompetentOptions.tsx +++ b/web-client/src/views/StartCaseUpdated/SecondaryMinorIncompetentOptions.tsx @@ -3,7 +3,6 @@ import { OTHER_TYPES } from '@shared/business/entities/EntityConstants'; import React from 'react'; export function SecondaryMinorIncompetentOptions({ - isPetitioner, selectedMinorIncompetentType, updateFilingTypeSequence, validationErrors, @@ -16,9 +15,8 @@ export function SecondaryMinorIncompetentOptions({ >
- {isPetitioner - ? 'What is your role in filing for this minor or legally incompetent person?' - : 'What is the petitioner’s role in filing for this minor or legally incompetent person?'} + What is your role in filing for this minor or legally incompetent + person? {[ OTHER_TYPES.conservator, diff --git a/web-client/src/views/StartCaseUpdated/Spouse.tsx b/web-client/src/views/StartCaseUpdated/Spouse.tsx index 5054139b133..2d4f0c3cb12 100644 --- a/web-client/src/views/StartCaseUpdated/Spouse.tsx +++ b/web-client/src/views/StartCaseUpdated/Spouse.tsx @@ -74,7 +74,11 @@ export function Spouse({ handleBlur={petitionGenerationLiveValidationSequence} handleChange={updateFormValueUpdatedSequence} handleChangeCountryType={updateFormValueCountryTypeSequence} - nameLabel="Full name of spouse" + nameLabel={ + isPetitioner + ? 'Full name of spouse' + : 'Full name of petitioner spouse' + } registerRef={registerRef} showElectronicServiceConsent={isPetitioner} showSameAsPrimaryCheckbox={true} diff --git a/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep1.tsx b/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep1.tsx index 493874a99e3..eaa01aaee7f 100644 --- a/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep1.tsx +++ b/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep1.tsx @@ -93,6 +93,7 @@ export const UpdatedFilePetitionStep1 = connect( handleChangeCountryType={updateFormValueCountryTypeSequence} nameLabel={isPetitioner ? 'Full Name' : 'Petitioner’s full name'} registerRef={registerRef} + showEmail={isPractitioner} /> )} {(form.filingType === 'Myself and my spouse' || @@ -106,6 +107,7 @@ export const UpdatedFilePetitionStep1 = connect( handleChangeCountryType={updateFormValueCountryTypeSequence} nameLabel={isPetitioner ? 'Full Name' : 'Petitioner’s full name'} registerRef={registerRef} + showEmail={isPractitioner} />

{isPetitioner ? "Your spouse's" : 'Petitioner Spouse'} information @@ -132,6 +134,7 @@ export const UpdatedFilePetitionStep1 = connect(