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:"
- }
-