')).toBeGreaterThan(-1);
diff --git a/shared/src/business/utilities/generateHTMLTemplateForPDF/reactTemplateGenerator.js b/shared/src/business/utilities/generateHTMLTemplateForPDF/reactTemplateGenerator.js
index b4ba97240d8..b409a032c06 100644
--- a/shared/src/business/utilities/generateHTMLTemplateForPDF/reactTemplateGenerator.js
+++ b/shared/src/business/utilities/generateHTMLTemplateForPDF/reactTemplateGenerator.js
@@ -14,15 +14,24 @@ const {
const {
ChangeOfAddress,
} = require('../pdfGenerator/documentTemplates/ChangeOfAddress.jsx');
+const {
+ CoverSheet,
+} = require('../pdfGenerator/documentTemplates/CoverSheet.jsx');
const {
DatePrintedFooter,
} = require('../pdfGenerator/components/DatePrintedFooter.jsx');
+const {
+ DateServedFooter,
+} = require('../pdfGenerator/components/DateServedFooter.jsx');
const {
DocketRecord,
} = require('../pdfGenerator/documentTemplates/DocketRecord.jsx');
const {
NoticeOfDocketChange,
} = require('../pdfGenerator/documentTemplates/NoticeOfDocketChange.jsx');
+const {
+ NoticeOfReceiptOfPetition,
+} = require('../pdfGenerator/documentTemplates/NoticeOfReceiptOfPetition.jsx');
const {
PageMetaHeaderDocket,
} = require('../pdfGenerator/components/PageMetaHeaderDocket.jsx');
@@ -64,10 +73,13 @@ const components = {
AddressLabelCoverSheet,
CaseInventoryReport,
ChangeOfAddress,
+ CoverSheet,
DatePrintedFooter,
+ DateServedFooter,
DocketRecord,
DocumentService,
NoticeOfDocketChange,
+ NoticeOfReceiptOfPetition,
Order,
PageMetaHeaderDocket,
PendingReport,
diff --git a/shared/src/business/utilities/getCaseCaptionMeta.js b/shared/src/business/utilities/getCaseCaptionMeta.js
index 580b13856dd..2ffcc266e6b 100644
--- a/shared/src/business/utilities/getCaseCaptionMeta.js
+++ b/shared/src/business/utilities/getCaseCaptionMeta.js
@@ -1,4 +1,5 @@
const { Case } = require('../entities/cases/Case');
+const { CASE_CAPTION_POSTFIX } = require('../entities/EntityConstants');
/**
* Gets case caption parts from case data
@@ -8,7 +9,6 @@ const { Case } = require('../entities/cases/Case');
*/
const getCaseCaptionMeta = caseDetail => {
- const { CASE_CAPTION_POSTFIX } = Case;
const { caseCaption } = caseDetail;
const caseTitle = Case.getCaseTitle(caseDetail.caseCaption);
diff --git a/shared/src/business/utilities/getCaseCaptionMeta.test.js b/shared/src/business/utilities/getCaseCaptionMeta.test.js
index c87691929d7..382d248c10d 100644
--- a/shared/src/business/utilities/getCaseCaptionMeta.test.js
+++ b/shared/src/business/utilities/getCaseCaptionMeta.test.js
@@ -1,4 +1,4 @@
-const { Case } = require('../entities/cases/Case');
+const { CASE_CAPTION_POSTFIX } = require('../entities/EntityConstants');
const { getCaseCaptionMeta } = require('./getCaseCaptionMeta');
describe('getCaseCaptionMeta', () => {
@@ -7,9 +7,9 @@ describe('getCaseCaptionMeta', () => {
caseCaption: 'Eve Brewer, Petitioner',
};
expect(getCaseCaptionMeta(caseDetail)).toMatchObject({
- CASE_CAPTION_POSTFIX: Case.CASE_CAPTION_POSTFIX,
+ CASE_CAPTION_POSTFIX: CASE_CAPTION_POSTFIX,
caseCaption: 'Eve Brewer, Petitioner',
- caseCaptionWithPostfix: `Eve Brewer, Petitioner ${Case.CASE_CAPTION_POSTFIX}`,
+ caseCaptionWithPostfix: `Eve Brewer, Petitioner ${CASE_CAPTION_POSTFIX}`,
});
});
diff --git a/shared/src/business/utilities/getFormattedCaseDetail.js b/shared/src/business/utilities/getFormattedCaseDetail.js
index 823849a10d2..ff102d57077 100644
--- a/shared/src/business/utilities/getFormattedCaseDetail.js
+++ b/shared/src/business/utilities/getFormattedCaseDetail.js
@@ -3,12 +3,17 @@ const {
calendarDatesCompared,
createISODateString,
} = require('./DateHandler');
+const {
+ CASE_STATUS_TYPES,
+ COURT_ISSUED_EVENT_CODES,
+ PAYMENT_STATUS,
+ TRANSCRIPT_EVENT_CODE,
+} = require('../entities/EntityConstants');
const { Case } = require('../entities/cases/Case');
const { cloneDeep, isEmpty } = require('lodash');
-const { Document } = require('../entities/Document');
-const { User } = require('../entities/User');
+const { ROLES } = require('../entities/EntityConstants');
-const courtIssuedDocumentTypes = Document.COURT_ISSUED_EVENT_CODES.map(
+const courtIssuedDocumentTypes = COURT_ISSUED_EVENT_CODES.map(
courtIssuedDoc => courtIssuedDoc.documentType,
);
@@ -58,7 +63,7 @@ const formatDocument = (applicationContext, document) => {
result.isNotServedCourtIssuedDocument =
result.isCourtIssuedDocument && !result.servedAt;
- result.isTranscript = result.eventCode === Document.TRANSCRIPT_EVENT_CODE;
+ result.isTranscript = result.eventCode === TRANSCRIPT_EVENT_CODE;
result.qcWorkItemsUntouched =
!!qcWorkItems.length &&
@@ -70,7 +75,7 @@ const formatDocument = (applicationContext, document) => {
if (result.servedParties && result.servedParties.length > 0) {
if (
result.servedParties.length === 1 &&
- result.servedParties[0].role === User.ROLES.irsSuperuser
+ result.servedParties[0].role === ROLES.irsSuperuser
) {
result.servedPartiesCode = 'R';
} else {
@@ -95,7 +100,7 @@ const formatDocketRecord = (applicationContext, docketRecord) => {
const TRANSCRIPT_AGE_DAYS_MIN = 90;
const documentMeetsAgeRequirements = document => {
- const transcriptCodes = [Document.TRANSCRIPT_EVENT_CODE];
+ const transcriptCodes = [TRANSCRIPT_EVENT_CODE];
const isTranscript = transcriptCodes.includes(document.eventCode);
if (!isTranscript) return true;
const availableOnDate = calculateISODate({
@@ -316,8 +321,8 @@ const formatCase = (applicationContext, caseDetail) => {
result.formattedPreferredTrialCity =
result.preferredTrialCity || 'No location selected';
- if (result.trialSessionId && result.status !== Case.STATUS_TYPES.closed) {
- if (result.status === Case.STATUS_TYPES.calendared) {
+ if (result.trialSessionId && result.status !== CASE_STATUS_TYPES.closed) {
+ if (result.status === CASE_STATUS_TYPES.calendared) {
result.showTrialCalendared = true;
} else {
result.showScheduled = true;
@@ -374,12 +379,12 @@ const formatCase = (applicationContext, caseDetail) => {
let paymentDate = '';
let paymentMethod = '';
- if (caseDetail.petitionPaymentStatus === Case.PAYMENT_STATUS.PAID) {
+ if (caseDetail.petitionPaymentStatus === PAYMENT_STATUS.PAID) {
paymentDate = applicationContext
.getUtilities()
.formatDateString(caseDetail.petitionPaymentDate, 'MM/DD/YY');
paymentMethod = caseDetail.petitionPaymentMethod;
- } else if (caseDetail.petitionPaymentStatus === Case.PAYMENT_STATUS.WAIVED) {
+ } else if (caseDetail.petitionPaymentStatus === PAYMENT_STATUS.WAIVED) {
paymentDate = applicationContext
.getUtilities()
.formatDateString(caseDetail.petitionPaymentWaivedDate, 'MM/DD/YY');
diff --git a/shared/src/business/utilities/getFormattedCaseDetail.test.js b/shared/src/business/utilities/getFormattedCaseDetail.test.js
index 5e56c62f0f7..864cd95f06c 100644
--- a/shared/src/business/utilities/getFormattedCaseDetail.test.js
+++ b/shared/src/business/utilities/getFormattedCaseDetail.test.js
@@ -1,4 +1,3 @@
-import { Case } from '../entities/cases/Case';
import {
TRANSCRIPT_AGE_DAYS_MIN,
documentMeetsAgeRequirements,
@@ -9,9 +8,13 @@ import {
getFormattedCaseDetail,
sortDocketRecords,
} from './getFormattedCaseDetail';
-import { User } from '../entities/User';
import { applicationContext } from '../../../../web-client/src/applicationContext';
import { calculateISODate, createISODateString } from './DateHandler';
+const {
+ CASE_STATUS_TYPES,
+ PAYMENT_STATUS,
+ ROLES,
+} = require('../entities/EntityConstants');
const { MOCK_USERS } = require('../../test/mockUsers');
applicationContext.getCurrentUser = () =>
@@ -429,7 +432,7 @@ describe('formatCase', () => {
it('should format trial details if case status is calendared', () => {
const result = formatCase(applicationContext, {
...mockCaseDetail,
- status: Case.STATUS_TYPES.calendared,
+ status: CASE_STATUS_TYPES.calendared,
trialDate: '2011-11-11',
trialLocation: 'Boise, Idaho',
trialSessionId: '1f1aa3f7-e2e3-43e6-885d-4ce341588c76',
@@ -469,7 +472,7 @@ describe('formatCase', () => {
it('should format trial details with incomplete trial information', () => {
const result = formatCase(applicationContext, {
...mockCaseDetail,
- status: Case.STATUS_TYPES.calendared,
+ status: CASE_STATUS_TYPES.calendared,
trialDate: undefined,
trialLocation: undefined,
trialSessionId: '1f1aa3f7-e2e3-43e6-885d-4ce341588c76',
@@ -494,7 +497,7 @@ describe('formatCase', () => {
it('should show not scheduled section if case status is closed', () => {
const result = formatCase(applicationContext, {
...mockCaseDetail,
- status: Case.STATUS_TYPES.closed,
+ status: CASE_STATUS_TYPES.closed,
});
expect(result).toMatchObject({
@@ -611,7 +614,7 @@ describe('formatDocument', () => {
it('should set the servedPartiesCode to `R` if servedAt date exists and servedParties is an array of length 1 with role irsSuperuser', () => {
const results = formatDocument(applicationContext, {
servedAt: '2019-03-27T21:53:00.297Z',
- servedParties: [{ role: User.ROLES.irsSuperuser }],
+ servedParties: [{ role: ROLES.irsSuperuser }],
});
expect(results).toMatchObject({
servedPartiesCode: 'R',
@@ -753,7 +756,7 @@ it('should format filing fee string for a paid petition fee', () => {
...mockCaseDetailBase,
petitionPaymentDate: '2019-03-01T21:40:46.415Z',
petitionPaymentMethod: 'check',
- petitionPaymentStatus: Case.PAYMENT_STATUS.PAID,
+ petitionPaymentStatus: PAYMENT_STATUS.PAID,
},
});
@@ -765,7 +768,7 @@ it('should format filing fee string for a waived petition fee', () => {
applicationContext,
caseDetail: {
...mockCaseDetailBase,
- petitionPaymentStatus: Case.PAYMENT_STATUS.WAIVED,
+ petitionPaymentStatus: PAYMENT_STATUS.WAIVED,
petitionPaymentWaivedDate: '2019-03-01T21:40:46.415Z',
},
});
@@ -778,7 +781,7 @@ it('should format filing fee string for an unpaid petition fee', () => {
applicationContext,
caseDetail: {
...mockCaseDetailBase,
- petitionPaymentStatus: Case.PAYMENT_STATUS.UNPAID,
+ petitionPaymentStatus: PAYMENT_STATUS.UNPAID,
},
});
diff --git a/shared/src/business/utilities/getFormattedTrialSessionDetails.test.js b/shared/src/business/utilities/getFormattedTrialSessionDetails.test.js
index a654802f478..1a2a6e4f7e4 100644
--- a/shared/src/business/utilities/getFormattedTrialSessionDetails.test.js
+++ b/shared/src/business/utilities/getFormattedTrialSessionDetails.test.js
@@ -1,14 +1,12 @@
import { MOCK_CASE } from '../../../../shared/src/test/mockCase';
-import { TrialSession } from '../entities/trialSessions/TrialSession';
-const { SESSION_STATUS_GROUPS } = TrialSession;
+import { SESSION_STATUS_GROUPS } from '../entities/EntityConstants';
+import { applicationContext } from '../../../../web-client/src/applicationContext';
import {
formattedTrialSessionDetails,
getTrialSessionStatus,
} from './getFormattedTrialSessionDetails';
import { omit } from 'lodash';
-import { applicationContext } from '../../../../web-client/src/applicationContext';
-
describe('formattedTrialSessionDetails', () => {
const TRIAL_SESSION = {
caseOrder: [],
diff --git a/shared/src/business/utilities/htmlGenerator/index.scss b/shared/src/business/utilities/htmlGenerator/index.scss
index c7c47dee155..e4af36c3ad4 100644
--- a/shared/src/business/utilities/htmlGenerator/index.scss
+++ b/shared/src/business/utilities/htmlGenerator/index.scss
@@ -78,10 +78,18 @@ th {
width: 49%;
}
+.margin-top-40 {
+ margin-top: 40px;
+}
+
.margin-top-80 {
margin-top: 80px;
}
+.margin-top-200 {
+ margin-top: 200px;
+}
+
.margin-top-5 {
margin-top: 5px;
}
@@ -140,6 +148,10 @@ th {
font-size: 14px;
line-height: 18px;
+ &.border-none {
+ border: none;
+ }
+
#caption-extension,
#caption-v,
#caption-respondent {
@@ -350,6 +362,20 @@ th {
text-decoration: none;
}
}
+#document-cover-sheet {
+ .case-information,
+ #docket-number,
+ #document-title,
+ #certificate-of-service {
+ font-family: 'nimbus_sans_l', sans-serif !important;
+ }
+
+ #certificate-of-service {
+ position: absolute;
+ bottom: 60px;
+ left: 60;
+ }
+}
#document-docket-record {
// TODO: These are basically cards, and could be refactored for more reusability
@@ -408,7 +434,7 @@ th {
padding-left: 0.6in;
}
- .address {
+ .address-label {
position: absolute;
bottom: 0in;
left: 0.5in;
diff --git a/shared/src/business/utilities/pdfGenerator/components/AddressLabel.jsx b/shared/src/business/utilities/pdfGenerator/components/AddressLabel.jsx
new file mode 100644
index 00000000000..fa5cca7d626
--- /dev/null
+++ b/shared/src/business/utilities/pdfGenerator/components/AddressLabel.jsx
@@ -0,0 +1,25 @@
+const React = require('react');
+
+export const AddressLabel = ({
+ address1,
+ address2,
+ address3,
+ city,
+ countryName,
+ name,
+ postalCode,
+ state,
+}) => {
+ return (
+
+
{name}
+
{address1}
+ {address2 &&
{address2}
}
+ {address3 &&
{address3}
}
+
+ {city}, {state} {postalCode}
+
+ {!address3 &&
{countryName}
}
+
+ );
+};
diff --git a/shared/src/business/utilities/pdfGenerator/components/AddressLabel.test.js b/shared/src/business/utilities/pdfGenerator/components/AddressLabel.test.js
new file mode 100644
index 00000000000..52ed2c38f82
--- /dev/null
+++ b/shared/src/business/utilities/pdfGenerator/components/AddressLabel.test.js
@@ -0,0 +1,43 @@
+const React = require('react');
+const { AddressLabel } = require('./AddressLabel.jsx');
+const { shallow } = require('enzyme');
+
+describe('AddressLabel', () => {
+ it('renders the name and address', () => {
+ const wrapper = shallow(
+
,
+ );
+
+ expect(wrapper.text()).toContain('123 Some Street');
+ expect(wrapper.text()).toContain('Some City');
+ expect(wrapper.text()).toContain('USA');
+ expect(wrapper.text()).toContain('Test Person');
+ expect(wrapper.text()).toContain('89890');
+ expect(wrapper.text()).toContain('ZZ');
+ });
+
+ it('renders optional address information if present', () => {
+ const wrapper = shallow(
+
,
+ );
+
+ expect(wrapper.text()).toContain('address two');
+ expect(wrapper.text()).toContain('address three');
+ expect(wrapper.text()).not.toContain('USA');
+ });
+});
diff --git a/shared/src/business/utilities/pdfGenerator/components/DatePrintedFooter.test.js b/shared/src/business/utilities/pdfGenerator/components/DatePrintedFooter.test.js
new file mode 100644
index 00000000000..d2ed537a5b2
--- /dev/null
+++ b/shared/src/business/utilities/pdfGenerator/components/DatePrintedFooter.test.js
@@ -0,0 +1,10 @@
+const React = require('react');
+const { DatePrintedFooter } = require('./DatePrintedFooter.jsx');
+const { shallow } = require('enzyme');
+
+describe('DatePrintedFooter', () => {
+ it('renders the given dateServed from props', () => {
+ let wrapper = shallow(
);
+ expect(wrapper.text()).toContain('Printed 01/01/2020');
+ });
+});
diff --git a/shared/src/business/utilities/pdfGenerator/components/DateServedFooter.jsx b/shared/src/business/utilities/pdfGenerator/components/DateServedFooter.jsx
new file mode 100644
index 00000000000..aed02ef3e1e
--- /dev/null
+++ b/shared/src/business/utilities/pdfGenerator/components/DateServedFooter.jsx
@@ -0,0 +1,18 @@
+const React = require('react');
+
+export const DateServedFooter = ({ dateServed }) => {
+ return (
+
+ SERVED {dateServed}
+
+ );
+};
diff --git a/shared/src/business/utilities/pdfGenerator/components/DateServedFooter.test.js b/shared/src/business/utilities/pdfGenerator/components/DateServedFooter.test.js
new file mode 100644
index 00000000000..087b3169643
--- /dev/null
+++ b/shared/src/business/utilities/pdfGenerator/components/DateServedFooter.test.js
@@ -0,0 +1,10 @@
+const React = require('react');
+const { DateServedFooter } = require('./DateServedFooter.jsx');
+const { shallow } = require('enzyme');
+
+describe('DateServedFooter', () => {
+ it('renders the given dateServed from props', () => {
+ let wrapper = shallow(
);
+ expect(wrapper.text()).toContain('SERVED 01/01/2020');
+ });
+});
diff --git a/shared/src/business/utilities/pdfGenerator/components/PageMetaHeaderDocket.jsx b/shared/src/business/utilities/pdfGenerator/components/PageMetaHeaderDocket.jsx
index 10320cb10cf..39b428c99e7 100644
--- a/shared/src/business/utilities/pdfGenerator/components/PageMetaHeaderDocket.jsx
+++ b/shared/src/business/utilities/pdfGenerator/components/PageMetaHeaderDocket.jsx
@@ -3,10 +3,14 @@ const React = require('react');
export const PageMetaHeaderDocket = ({ docketNumber }) => {
return (
<>
-
+
Docket Number: {docketNumber}
-
+
Page of{' '}
diff --git a/shared/src/business/utilities/pdfGenerator/components/ReportsMetaHeader.jsx b/shared/src/business/utilities/pdfGenerator/components/ReportsMetaHeader.jsx
index 99e4b75bc14..c3350a20c6c 100644
--- a/shared/src/business/utilities/pdfGenerator/components/ReportsMetaHeader.jsx
+++ b/shared/src/business/utilities/pdfGenerator/components/ReportsMetaHeader.jsx
@@ -3,10 +3,15 @@ const React = require('react');
export const ReportsMetaHeader = ({ headerTitle }) => {
return (
<>
-
+
{headerTitle}
-
+
Page of{' '}
diff --git a/shared/src/business/utilities/pdfGenerator/documentTemplates/AddressLabelCoverSheet.jsx b/shared/src/business/utilities/pdfGenerator/documentTemplates/AddressLabelCoverSheet.jsx
index e374ea08b45..588e6ea9499 100644
--- a/shared/src/business/utilities/pdfGenerator/documentTemplates/AddressLabelCoverSheet.jsx
+++ b/shared/src/business/utilities/pdfGenerator/documentTemplates/AddressLabelCoverSheet.jsx
@@ -1,4 +1,5 @@
const React = require('react');
+const { AddressLabel } = require('../components/AddressLabel.jsx');
export const AddressLabelCoverSheet = ({
address1,
@@ -14,16 +15,16 @@ export const AddressLabelCoverSheet = ({
return (
Docket {docketNumberWithSuffix}
-
-
{name}
-
{address1}
- {address2 &&
{address2}
}
- {address3 &&
{address3}
}
-
- {city}, {state} {postalCode}
-
- {!address3 &&
{countryName}
}
-
+
);
};
diff --git a/shared/src/business/utilities/pdfGenerator/documentTemplates/AddressLabelCoverSheet.test.js b/shared/src/business/utilities/pdfGenerator/documentTemplates/AddressLabelCoverSheet.test.js
index 5f90450f1a6..bd01cb57cd9 100644
--- a/shared/src/business/utilities/pdfGenerator/documentTemplates/AddressLabelCoverSheet.test.js
+++ b/shared/src/business/utilities/pdfGenerator/documentTemplates/AddressLabelCoverSheet.test.js
@@ -1,10 +1,10 @@
const React = require('react');
const { AddressLabelCoverSheet } = require('./AddressLabelCoverSheet.jsx');
-const { shallow } = require('enzyme');
+const { mount } = require('enzyme');
describe('AddressLabelCoverSheet', () => {
it('renders the docket number with suffix', () => {
- const wrapper = shallow(
+ const wrapper = mount(
,
);
@@ -12,7 +12,7 @@ describe('AddressLabelCoverSheet', () => {
});
it('renders the name and address', () => {
- const wrapper = shallow(
+ const wrapper = mount(
{
expect(wrapper.text()).toContain('89890');
expect(wrapper.text()).toContain('ZZ');
});
-
- it('renders optional address information if present', () => {
- const wrapper = shallow(
- ,
- );
-
- expect(wrapper.text()).toContain('address two');
- expect(wrapper.text()).toContain('address three');
- expect(wrapper.text()).not.toContain('USA');
- });
});
diff --git a/shared/src/business/utilities/pdfGenerator/documentTemplates/CoverSheet.jsx b/shared/src/business/utilities/pdfGenerator/documentTemplates/CoverSheet.jsx
new file mode 100644
index 00000000000..e48ef6edced
--- /dev/null
+++ b/shared/src/business/utilities/pdfGenerator/documentTemplates/CoverSheet.jsx
@@ -0,0 +1,66 @@
+const React = require('react');
+
+export const CoverSheet = ({
+ caseCaptionExtension,
+ caseTitle,
+ certificateOfService,
+ dateFiledLodged,
+ dateFiledLodgedLabel,
+ dateReceived,
+ docketNumberWithSuffix,
+ documentTitle,
+ electronicallyFiled,
+ mailingDate,
+}) => {
+ return (
+
+
+
+
+
+ Received
+
+ {dateReceived}
+
+
+
+
+ {dateFiledLodgedLabel}
+
+ {dateFiledLodged}
+
+
+
+
+
+
+
{caseTitle}
+
{caseCaptionExtension}
+
v.
+
Commissioner of Internal Revenue
+
Respondent
+
+
+
+ {electronicallyFiled &&
Electronically Filed
}
+ {mailingDate &&
{mailingDate}
}
+
Docket Number {docketNumberWithSuffix}
+
+
+
+
+
+ {documentTitle}
+
+
+ {certificateOfService && (
+
Certificate of Service
+ )}
+
+ );
+};
diff --git a/shared/src/business/utilities/pdfGenerator/documentTemplates/CoverSheet.test.js b/shared/src/business/utilities/pdfGenerator/documentTemplates/CoverSheet.test.js
new file mode 100644
index 00000000000..3e3e883f676
--- /dev/null
+++ b/shared/src/business/utilities/pdfGenerator/documentTemplates/CoverSheet.test.js
@@ -0,0 +1,76 @@
+const React = require('react');
+const { CoverSheet } = require('./CoverSheet.jsx');
+const { shallow } = require('enzyme');
+
+describe('CoverSheet', () => {
+ it('renders a document header with case information', () => {
+ const wrapper = shallow(
+ ,
+ );
+
+ expect(wrapper.find('#caption-title').text()).toEqual('Captain Fantastic');
+ expect(wrapper.find('#caption-extension').text()).toEqual('Petitioner');
+ expect(wrapper.find('#docket-number').text()).toContain(
+ 'Docket Number 123-45S',
+ );
+ });
+
+ it('renders the received date', () => {
+ const wrapper = shallow();
+ const text = wrapper.find('#date-received').text();
+
+ expect(text).toContain('Received');
+ expect(text).toContain('01/01/2020');
+ });
+
+ it('renders a filed or lodged label along with the associated date', () => {
+ const wrapper = shallow(
+ ,
+ );
+ const text = wrapper.find('#filed-or-lodged').text();
+
+ expect(text).toContain('Some Label');
+ expect(text).toContain('02/02/2020');
+ });
+
+ it('renders Electronically Filed if the case was filed electronically', () => {
+ let wrapper = shallow();
+
+ expect(wrapper.find('#docket-number').text()).not.toContain(
+ 'Electronically Filed',
+ );
+
+ wrapper = shallow();
+
+ expect(wrapper.find('#docket-number').text()).toContain(
+ 'Electronically Filed',
+ );
+ });
+
+ it('renders the mailingDate if provided', () => {
+ let wrapper = shallow();
+
+ expect(wrapper.find('#docket-number').text()).not.toContain('12/1/2019');
+
+ wrapper = shallow();
+
+ expect(wrapper.find('#docket-number').text()).toContain('12/1/2019');
+ });
+
+ it('renders Certificate of Service of there is a certificateOfService', () => {
+ let wrapper = shallow();
+
+ expect(wrapper.find('#certificate-of-service').length).toEqual(0);
+
+ wrapper = shallow();
+
+ expect(wrapper.find('#certificate-of-service').length).toEqual(1);
+ });
+});
diff --git a/shared/src/business/utilities/pdfGenerator/documentTemplates/DocketRecord.test.js b/shared/src/business/utilities/pdfGenerator/documentTemplates/DocketRecord.test.js
index 1db0df5652d..2412e390e3d 100644
--- a/shared/src/business/utilities/pdfGenerator/documentTemplates/DocketRecord.test.js
+++ b/shared/src/business/utilities/pdfGenerator/documentTemplates/DocketRecord.test.js
@@ -1,5 +1,5 @@
const React = require('react');
-const { ContactFactory } = require('../../../entities/contacts/ContactFactory');
+const { COUNTRY_TYPES } = require('../../../entities/EntityConstants');
const { DocketRecord } = require('./DocketRecord.jsx');
const { mount } = require('enzyme');
@@ -107,7 +107,7 @@ describe('DocketRecord', () => {
const wrapper = mount(
,
@@ -138,7 +138,7 @@ describe('DocketRecord', () => {
const wrapper = mount(
,
@@ -158,7 +158,7 @@ describe('DocketRecord', () => {
const wrapper = mount(
,
@@ -181,13 +181,13 @@ describe('DocketRecord', () => {
});
it("displays a party's country if international", () => {
- contactPrimary.countryType = ContactFactory.COUNTRY_TYPES.INTERNATIONAL;
+ contactPrimary.countryType = COUNTRY_TYPES.INTERNATIONAL;
contactPrimary.country = 'The Republic of Texas';
const wrapper = mount(
,
@@ -205,7 +205,7 @@ describe('DocketRecord', () => {
const wrapper = mount(
,
@@ -225,7 +225,7 @@ describe('DocketRecord', () => {
let wrapper = mount(
,
@@ -238,7 +238,7 @@ describe('DocketRecord', () => {
wrapper = mount(
,
@@ -279,7 +279,7 @@ describe('DocketRecord', () => {
const wrapper = mount(
,
@@ -308,7 +308,7 @@ describe('DocketRecord', () => {
let wrapper = mount(
,
@@ -321,7 +321,7 @@ describe('DocketRecord', () => {
wrapper = mount(
,
@@ -350,7 +350,7 @@ describe('DocketRecord', () => {
const wrapper = mount(
,
@@ -376,7 +376,7 @@ describe('DocketRecord', () => {
const wrapper = mount(
,
@@ -394,7 +394,7 @@ describe('DocketRecord', () => {
const wrapper = mount(
,
@@ -411,7 +411,7 @@ describe('DocketRecord', () => {
const wrapper = mount(
,
@@ -428,7 +428,7 @@ describe('DocketRecord', () => {
const wrapper = mount(
,
@@ -446,7 +446,7 @@ describe('DocketRecord', () => {
const wrapper = mount(
,
diff --git a/shared/src/business/utilities/pdfGenerator/documentTemplates/NoticeOfReceiptOfPetition.jsx b/shared/src/business/utilities/pdfGenerator/documentTemplates/NoticeOfReceiptOfPetition.jsx
new file mode 100644
index 00000000000..518368afa48
--- /dev/null
+++ b/shared/src/business/utilities/pdfGenerator/documentTemplates/NoticeOfReceiptOfPetition.jsx
@@ -0,0 +1,96 @@
+const React = require('react');
+const {
+ CompressedDocketHeader,
+} = require('../components/CompressedDocketHeader.jsx');
+const { AddressLabel } = require('../components/AddressLabel.jsx');
+const { PrimaryHeader } = require('../components/PrimaryHeader.jsx');
+
+export const NoticeOfReceiptOfPetition = ({
+ address,
+ caseCaptionExtension,
+ caseTitle,
+ docketNumberWithSuffix,
+ preferredTrialCity,
+ receivedAtFormatted,
+ servedDate,
+}) => {
+ return (
+ <>
+
+
+
+ The Court received and filed your petition on {receivedAtFormatted} and
+ served it on respondent on {servedDate}.
+
+
+
+ (X) Request for Place of Trial at {preferredTrialCity}.
+
+
+
+
+ Your Docket Number: {docketNumberWithSuffix}
+
+
+ Please use this docket number on all papers and correspondence that
+ you send to the Tax Court. Do not include your Social Security or
+ Taxpayer Identification numbers on any documents you file with the
+ Court.
+
+
+
+
+
Internet Access:
+
+ To obtain further information about proceeding in the Tax Court,
+ please visit{' '}
+
+ www.ustaxcourt.gov
+ {' '}
+ and select "Taxpayer Identification".
+
+
+
+
+
Change of Address:
+
+ You must notify the Clerk of the Court if you change your address. If
+ you filed your petition in paper, see Tax Court Form 10, Notice of
+ Change of Address, under “Forms” on the Tax Court’s Website at{' '}
+
+ www.ustaxcourt.gov
+
+ . If you filed your petition electronically, you may update your
+ address under the “Case Information” tab in your case online. Failure
+ to notify the Clerk of the Court of a change of your address can mean
+ you do not receive notices and documents essential to your case and
+ can lead to dismissal of your case.
+
+
+
+
+ Stephanie A. Servoss
+
+ Clerk of the Court
+
+
+
+ >
+ );
+};
diff --git a/shared/src/business/utilities/pdfGenerator/documentTemplates/NoticeOfReceiptOfPetition.test.js b/shared/src/business/utilities/pdfGenerator/documentTemplates/NoticeOfReceiptOfPetition.test.js
new file mode 100644
index 00000000000..962b368070c
--- /dev/null
+++ b/shared/src/business/utilities/pdfGenerator/documentTemplates/NoticeOfReceiptOfPetition.test.js
@@ -0,0 +1,78 @@
+const React = require('react');
+const {
+ NoticeOfReceiptOfPetition,
+} = require('./NoticeOfReceiptOfPetition.jsx');
+const { mount, shallow } = require('enzyme');
+
+describe('NoticeOfReceiptOfPetition', () => {
+ const caseCaptionExtension = 'Petitioner(s)';
+ const caseTitle = 'Test Petitioner';
+ const docketNumberWithSuffix = '123-19S';
+ const address = {
+ address1: '123 Some St.',
+ city: 'Somecity',
+ countryName: '',
+ name: 'Test Petitioner',
+ postalCode: '80008',
+ state: 'ZZ',
+ };
+
+ it('renders a document header with case information', () => {
+ const wrapper = mount(
+ ,
+ );
+
+ expect(wrapper.find('#caption').text()).toContain(caseTitle);
+ expect(wrapper.find('#caption').text()).toContain(caseCaptionExtension);
+ expect(wrapper.find('#docket-number').text()).toEqual(
+ `Docket Number ${docketNumberWithSuffix}`,
+ );
+ expect(wrapper.find('h3').at(0).text()).toEqual(
+ 'Notice of Receipt of Petition',
+ );
+ });
+
+ it('renders the case information', () => {
+ const wrapper = shallow(
+ ,
+ );
+ const textContent = wrapper.text();
+ expect(textContent).toContain(docketNumberWithSuffix);
+ expect(textContent).toContain('Birmingham, AL');
+ expect(textContent).toContain('December 1, 2019');
+ expect(textContent).toContain('June 3, 2020');
+ });
+
+ it('renders the the petitioner mailing address', () => {
+ const wrapper = mount(
+ ,
+ );
+ const textContent = wrapper.text();
+ expect(textContent).toContain(address.name);
+ expect(textContent).toContain(address.address1);
+ expect(textContent).toContain(address.city);
+ expect(textContent).toContain(address.state);
+ expect(textContent).toContain(address.postalCode);
+ });
+});
diff --git a/shared/src/business/utilities/pdfGenerator/documentTemplates/StandingPretrialNotice.jsx b/shared/src/business/utilities/pdfGenerator/documentTemplates/StandingPretrialNotice.jsx
index 5df91e10727..887af65fce0 100644
--- a/shared/src/business/utilities/pdfGenerator/documentTemplates/StandingPretrialNotice.jsx
+++ b/shared/src/business/utilities/pdfGenerator/documentTemplates/StandingPretrialNotice.jsx
@@ -88,7 +88,7 @@ export const StandingPretrialNotice = ({ footerDate, options, trialInfo }) => {
-
+
WHAT TO DO THE DAY OF THE TRIAL SESSION
-
diff --git a/shared/src/business/utilities/setServiceIndicatorsForCase.js b/shared/src/business/utilities/setServiceIndicatorsForCase.js
index 87e4e1bff2d..e953e3bc26a 100644
--- a/shared/src/business/utilities/setServiceIndicatorsForCase.js
+++ b/shared/src/business/utilities/setServiceIndicatorsForCase.js
@@ -1,5 +1,5 @@
const { isEmpty } = require('lodash');
-const { SERVICE_INDICATOR_TYPES } = require('../entities/cases/CaseConstants');
+const { SERVICE_INDICATOR_TYPES } = require('../entities/EntityConstants');
/**
* sets the service indicators for parties on the given case
diff --git a/shared/src/business/utilities/setServiceIndicatorsForCase.test.js b/shared/src/business/utilities/setServiceIndicatorsForCase.test.js
index 8670cc1a9f4..2c41d96551f 100644
--- a/shared/src/business/utilities/setServiceIndicatorsForCase.test.js
+++ b/shared/src/business/utilities/setServiceIndicatorsForCase.test.js
@@ -1,5 +1,4 @@
-import { SERVICE_INDICATOR_TYPES } from '../entities/cases/CaseConstants';
-import { User } from '../entities/User';
+import { ROLES, SERVICE_INDICATOR_TYPES } from '../entities/EntityConstants';
import { setServiceIndicatorsForCase } from './setServiceIndicatorsForCase';
let baseCaseDetail;
@@ -8,7 +7,7 @@ const basePractitioner = {
email: 'practitioner1@example.com',
name: 'Test Practitioner',
representingPrimary: true,
- role: User.ROLES.privatePractitioner,
+ role: ROLES.privatePractitioner,
serviceIndicator: 'Paper',
};
@@ -16,7 +15,7 @@ const baseRespondent = {
email: 'flexionustc+respondent@gmail.com',
name: 'Test Respondent',
respondentId: '123-abc-123-abc',
- role: User.ROLES.irsPractitioner,
+ role: ROLES.irsPractitioner,
serviceIndicator: 'Paper',
userId: 'abc-123-abc-123',
};
diff --git a/shared/src/errors/errors.js b/shared/src/errors/errors.js
index 99b62c3467b..fd39f7e0e10 100644
--- a/shared/src/errors/errors.js
+++ b/shared/src/errors/errors.js
@@ -99,9 +99,11 @@ module.exports.InvalidEntityError = class InvalidEntityError extends Error {
*
* @param {string} message the error message
*/
- constructor(message = 'entity is invalid or invalid for operation') {
- super(message);
-
- this.statusCode = 422;
+ constructor(
+ message = 'entity is invalid or invalid for operation',
+ validationName,
+ entityIds,
+ ) {
+ super(`The ${validationName} entity was invalid. ${message}. ${entityIds}`);
}
};
diff --git a/shared/src/errors/errors.test.js b/shared/src/errors/errors.test.js
index 3475ff01cb1..e21bd3f4580 100644
--- a/shared/src/errors/errors.test.js
+++ b/shared/src/errors/errors.test.js
@@ -75,15 +75,13 @@ describe('InvalidEntityError', () => {
let error;
beforeEach(() => {
- error = new InvalidEntityError();
+ error = new InvalidEntityError('Test message', 'TestEntity', 123);
});
- it('should set a status code of 422', () => {
- expect(error.statusCode).toEqual(422);
- });
-
- it('should set the message', () => {
- expect(error.message).toEqual('entity is invalid or invalid for operation');
+ it('should set the message which includes the entityName and failing ids', () => {
+ expect(error.message).toEqual(
+ 'The TestEntity entity was invalid. Test message. 123',
+ );
});
});
diff --git a/shared/src/persistence/dynamo/cases/getCasesByUser.test.js b/shared/src/persistence/dynamo/cases/getCasesByUser.test.js
index 8a8d6ebc06b..24d8ad3f70f 100644
--- a/shared/src/persistence/dynamo/cases/getCasesByUser.test.js
+++ b/shared/src/persistence/dynamo/cases/getCasesByUser.test.js
@@ -1,6 +1,6 @@
const client = require('../../../../../shared/src/persistence/dynamodbClientService');
const { getCasesByUser } = require('./getCasesByUser');
-const { User } = require('../../../business/entities/User');
+const { ROLES } = require('../../../business/entities/EntityConstants');
const {
applicationContext,
@@ -18,7 +18,7 @@ applicationContext.getDocumentClient.mockReturnValue({
});
const user = {
- role: User.ROLES.petitioner,
+ role: ROLES.petitioner,
userId: '522573b0-dc40-47f7-96fd-64758da315f5',
};
diff --git a/shared/src/persistence/dynamo/cases/getClosedCasesByUser.js b/shared/src/persistence/dynamo/cases/getClosedCasesByUser.js
new file mode 100644
index 00000000000..fa8a815a955
--- /dev/null
+++ b/shared/src/persistence/dynamo/cases/getClosedCasesByUser.js
@@ -0,0 +1,22 @@
+const {
+ CASE_STATUS_TYPES,
+} = require('../../../business/entities/EntityConstants');
+const { getUserCases } = require('./getUserCases');
+
+/**
+ * getClosedCasesByUser
+ *
+ * @param {object} providers the providers object
+ * @param {object} providers.applicationContext the application context
+ * @param {string} providers.userId the user id to get closed cases by
+ * @returns {object} the closed cases
+ */
+exports.getClosedCasesByUser = async ({ applicationContext, userId }) => {
+ const userCases = await getUserCases({ applicationContext, userId });
+
+ const closedCases = userCases.filter(
+ x => x.status === CASE_STATUS_TYPES.closed,
+ );
+
+ return closedCases;
+};
diff --git a/shared/src/persistence/dynamo/cases/getClosedCasesByUser.test.js b/shared/src/persistence/dynamo/cases/getClosedCasesByUser.test.js
new file mode 100644
index 00000000000..80016a01566
--- /dev/null
+++ b/shared/src/persistence/dynamo/cases/getClosedCasesByUser.test.js
@@ -0,0 +1,45 @@
+const {
+ applicationContext,
+} = require('../../../business/test/createTestApplicationContext');
+const { getClosedCasesByUser } = require('./getClosedCasesByUser');
+const { ROLES } = require('../../../business/entities/EntityConstants');
+
+jest.mock('./getUserCases', () => ({
+ getUserCases: jest.fn().mockReturnValue([
+ {
+ caseId: '123',
+ pk: 'case|123',
+ sk: 'case|123',
+ status: 'New',
+ },
+ {
+ caseId: '121',
+ pk: 'case|121',
+ sk: 'case|121',
+ status: 'Closed',
+ },
+ ]),
+}));
+
+const user = {
+ role: ROLES.petitioner,
+ userId: '522573b0-dc40-47f7-96fd-64758da315f5',
+};
+
+describe('getClosedCasesByUser', () => {
+ it('should filter out cases that are not closed', async () => {
+ const result = await getClosedCasesByUser({
+ applicationContext,
+ user,
+ });
+
+ expect(result).toMatchObject([
+ {
+ caseId: '121',
+ pk: 'case|121',
+ sk: 'case|121',
+ status: 'Closed',
+ },
+ ]);
+ });
+});
diff --git a/shared/src/persistence/dynamo/cases/getOpenCasesByUser.js b/shared/src/persistence/dynamo/cases/getOpenCasesByUser.js
index 8515f777392..d597dc11fa6 100644
--- a/shared/src/persistence/dynamo/cases/getOpenCasesByUser.js
+++ b/shared/src/persistence/dynamo/cases/getOpenCasesByUser.js
@@ -1,5 +1,7 @@
-const { Case } = require('../../../business/entities/cases/Case');
-const { getCasesByUser } = require('./getCasesByUser');
+const {
+ CASE_STATUS_TYPES,
+} = require('../../../business/entities/EntityConstants');
+const { getUserCases } = require('./getUserCases');
/**
* getOpenCasesByUserId
@@ -10,10 +12,10 @@ const { getCasesByUser } = require('./getCasesByUser');
* @returns {object} the open cases
*/
exports.getOpenCasesByUser = async ({ applicationContext, userId }) => {
- const userCases = await getCasesByUser({ applicationContext, userId });
+ const userCases = await getUserCases({ applicationContext, userId });
const openCases = userCases.filter(
- x => x.status !== Case.STATUS_TYPES.closed,
+ x => x.status !== CASE_STATUS_TYPES.closed,
);
return openCases;
diff --git a/shared/src/persistence/dynamo/cases/getOpenCasesByUser.test.js b/shared/src/persistence/dynamo/cases/getOpenCasesByUser.test.js
index 186ab55d862..9320f915597 100644
--- a/shared/src/persistence/dynamo/cases/getOpenCasesByUser.test.js
+++ b/shared/src/persistence/dynamo/cases/getOpenCasesByUser.test.js
@@ -2,9 +2,10 @@ const {
applicationContext,
} = require('../../../business/test/createTestApplicationContext');
const { getOpenCasesByUser } = require('./getOpenCasesByUser');
-const { User } = require('../../../business/entities/User');
-jest.mock('./getCasesByUser', () => ({
- getCasesByUser: jest.fn().mockReturnValue([
+const { ROLES } = require('../../../business/entities/EntityConstants');
+
+jest.mock('./getUserCases', () => ({
+ getUserCases: jest.fn().mockReturnValue([
{
caseId: '123',
pk: 'case|123',
@@ -21,7 +22,7 @@ jest.mock('./getCasesByUser', () => ({
}));
const user = {
- role: User.ROLES.petitioner,
+ role: ROLES.petitioner,
userId: '522573b0-dc40-47f7-96fd-64758da315f5',
};
diff --git a/shared/src/persistence/dynamo/cases/getUserDashboardCases.js b/shared/src/persistence/dynamo/cases/getUserCases.js
similarity index 86%
rename from shared/src/persistence/dynamo/cases/getUserDashboardCases.js
rename to shared/src/persistence/dynamo/cases/getUserCases.js
index 94355c88713..33a53e13e1d 100644
--- a/shared/src/persistence/dynamo/cases/getUserDashboardCases.js
+++ b/shared/src/persistence/dynamo/cases/getUserCases.js
@@ -1,7 +1,7 @@
const client = require('../../dynamodbClientService');
const { stripInternalKeys } = require('../helpers/stripInternalKeys');
-exports.getUserDashboardCases = async ({ applicationContext, userId }) => {
+exports.getUserCases = async ({ applicationContext, userId }) => {
const userCases = await client.query({
ExpressionAttributeNames: {
'#pk': 'pk',
diff --git a/shared/src/persistence/dynamo/cases/getUserDashboardCases.test.js b/shared/src/persistence/dynamo/cases/getUserCases.test.js
similarity index 71%
rename from shared/src/persistence/dynamo/cases/getUserDashboardCases.test.js
rename to shared/src/persistence/dynamo/cases/getUserCases.test.js
index bf3ffda6b98..f9fe5924a87 100644
--- a/shared/src/persistence/dynamo/cases/getUserDashboardCases.test.js
+++ b/shared/src/persistence/dynamo/cases/getUserCases.test.js
@@ -1,6 +1,6 @@
-const client = require('../../../../../shared/src/persistence/dynamodbClientService');
-const { getUserDashboardCases } = require('./getUserDashboardCases');
-const { User } = require('../../../business/entities/User');
+const client = require('../../dynamodbClientService');
+const { getUserCases } = require('./getUserCases');
+const { ROLES } = require('../../../business/entities/EntityConstants');
const {
applicationContext,
@@ -17,11 +17,11 @@ applicationContext.getDocumentClient.mockReturnValue({
});
const user = {
- role: User.ROLES.petitioner,
+ role: ROLES.petitioner,
userId: '522573b0-dc40-47f7-96fd-64758da315f5',
};
-describe('getUserDashboardCases', () => {
+describe('getUserCases', () => {
beforeEach(() => {
client.query = jest.fn().mockReturnValueOnce([
{
@@ -35,7 +35,7 @@ describe('getUserDashboardCases', () => {
});
it('should return data with stripped internal keys from persistence', async () => {
- const result = await getUserDashboardCases({
+ const result = await getUserCases({
applicationContext,
user,
});
diff --git a/shared/src/persistence/dynamo/cases/updateCase.js b/shared/src/persistence/dynamo/cases/updateCase.js
index 309e561b2ba..81e57ade36b 100644
--- a/shared/src/persistence/dynamo/cases/updateCase.js
+++ b/shared/src/persistence/dynamo/cases/updateCase.js
@@ -261,7 +261,7 @@ exports.updateCase = async ({ applicationContext, caseToUpdate }) => {
caseCaption: caseToUpdate.caseCaption,
docketNumberSuffix: caseToUpdate.docketNumberSuffix,
docketNumberWithSuffix: caseToUpdate.docketNumberWithSuffix,
- gsi1pk: caseToUpdate.caseId,
+ gsi1pk: `user-case|${caseToUpdate.caseId}`,
leadCaseId: caseToUpdate.leadCaseId,
status: caseToUpdate.status,
},
diff --git a/shared/src/persistence/dynamo/cases/updateCase.test.js b/shared/src/persistence/dynamo/cases/updateCase.test.js
index 620480cca55..9ed92669ec5 100644
--- a/shared/src/persistence/dynamo/cases/updateCase.test.js
+++ b/shared/src/persistence/dynamo/cases/updateCase.test.js
@@ -2,7 +2,9 @@ const client = require('../../dynamodbClientService');
const {
applicationContext,
} = require('../../../business/test/createTestApplicationContext');
-const { Case } = require('../../../business/entities/cases/Case');
+const {
+ CASE_STATUS_TYPES,
+} = require('../../../business/entities/EntityConstants');
const { updateCase } = require('./updateCase');
describe('updateCase', () => {
@@ -16,17 +18,17 @@ describe('updateCase', () => {
inProgress: false,
pk: 'case|123',
sk: 'case|123',
- status: Case.STATUS_TYPES.generalDocket,
+ status: CASE_STATUS_TYPES.generalDocket,
},
];
secondQueryStub = [
{
gsi1pk: 'user-case|123',
- leadCaseId: 'case|123',
+ leadCaseId: '123',
pk: 'user|123',
sk: 'case|123',
- status: Case.STATUS_TYPES.generalDocket,
+ status: CASE_STATUS_TYPES.generalDocket,
},
];
@@ -76,7 +78,7 @@ describe('updateCase', () => {
caseId: '123',
docketNumber: '101-18',
docketNumberSuffix: null,
- status: Case.STATUS_TYPES.generalDocket,
+ status: CASE_STATUS_TYPES.generalDocket,
userId: 'petitioner',
},
});
@@ -99,7 +101,7 @@ describe('updateCase', () => {
docketNumber: '101-18',
docketNumberSuffix: 'W',
inProgress: true,
- status: Case.STATUS_TYPES.calendared,
+ status: CASE_STATUS_TYPES.calendared,
trialDate: '2019-03-01T21:40:46.415Z',
userId: 'petitioner',
},
@@ -115,7 +117,7 @@ describe('updateCase', () => {
applicationContext.getDocumentClient().update.mock.calls[0][0],
).toMatchObject({
ExpressionAttributeValues: {
- ':caseStatus': Case.STATUS_TYPES.calendared,
+ ':caseStatus': CASE_STATUS_TYPES.calendared,
},
});
expect(
@@ -162,7 +164,7 @@ describe('updateCase', () => {
associatedJudge: 'Judge Buch',
caseId: '123',
docketNumberSuffix: null,
- status: Case.STATUS_TYPES.generalDocket,
+ status: CASE_STATUS_TYPES.generalDocket,
},
});
@@ -181,7 +183,7 @@ describe('updateCase', () => {
caseToUpdate: {
caseId: '123',
docketNumberSuffix: null,
- status: Case.STATUS_TYPES.generalDocket,
+ status: CASE_STATUS_TYPES.generalDocket,
},
});
@@ -204,7 +206,7 @@ describe('updateCase', () => {
irsPractitioners: [
{ name: 'Guy Fieri', userId: 'user-id-existing-234' },
],
- status: Case.STATUS_TYPES.generalDocket,
+ status: CASE_STATUS_TYPES.generalDocket,
},
});
@@ -235,7 +237,7 @@ describe('updateCase', () => {
{ name: 'Guy Fieri', userId: 'user-id-existing-123' },
{ name: 'Rachel Ray', userId: 'user-id-existing-234' },
],
- status: Case.STATUS_TYPES.generalDocket,
+ status: CASE_STATUS_TYPES.generalDocket,
},
});
@@ -279,7 +281,7 @@ describe('updateCase', () => {
},
{ name: 'Rachel Ray', userId: 'user-id-existing-234' },
],
- status: Case.STATUS_TYPES.generalDocket,
+ status: CASE_STATUS_TYPES.generalDocket,
},
});
expect(
@@ -321,7 +323,7 @@ describe('updateCase', () => {
userId: 'user-id-existing-234',
},
],
- status: Case.STATUS_TYPES.generalDocket,
+ status: CASE_STATUS_TYPES.generalDocket,
},
});
@@ -348,7 +350,7 @@ describe('updateCase', () => {
privatePractitioners: [
{ name: 'Guy Fieri', userId: 'user-id-existing-234' },
],
- status: Case.STATUS_TYPES.generalDocket,
+ status: CASE_STATUS_TYPES.generalDocket,
},
});
@@ -381,7 +383,7 @@ describe('updateCase', () => {
{ name: 'Guy Fieri', userId: 'user-id-existing-123' },
{ name: 'Rachel Ray', userId: 'user-id-existing-234' },
],
- status: Case.STATUS_TYPES.generalDocket,
+ status: CASE_STATUS_TYPES.generalDocket,
},
});
@@ -414,7 +416,7 @@ describe('updateCase', () => {
},
{ name: 'Rachel Ray', userId: 'user-id-existing-234' },
],
- status: Case.STATUS_TYPES.generalDocket,
+ status: CASE_STATUS_TYPES.generalDocket,
},
});
@@ -443,7 +445,7 @@ describe('updateCase', () => {
privatePractitioners: [
{ name: 'Rachel Ray', userId: 'user-id-existing-234' },
],
- status: Case.STATUS_TYPES.generalDocket,
+ status: CASE_STATUS_TYPES.generalDocket,
},
});
@@ -480,7 +482,7 @@ describe('updateCase', () => {
docketNumber: '101-18',
docketNumberSuffix: null,
inProgress: true,
- status: Case.STATUS_TYPES.calendared,
+ status: CASE_STATUS_TYPES.calendared,
trialDate: '2019-03-01T21:40:46.415Z',
userId: 'petitioner',
},
@@ -489,10 +491,10 @@ describe('updateCase', () => {
expect(
applicationContext.getDocumentClient().put.mock.calls[0][0].Item,
).toMatchObject({
- gsi1pk: '123',
+ gsi1pk: 'user-case|123',
pk: 'user|123',
sk: 'case|123',
- status: Case.STATUS_TYPES.calendared,
+ status: CASE_STATUS_TYPES.calendared,
});
});
@@ -505,7 +507,7 @@ describe('updateCase', () => {
docketNumber: '101-18',
docketNumberSuffix: 'W',
inProgress: true,
- status: Case.STATUS_TYPES.generalDocket,
+ status: CASE_STATUS_TYPES.generalDocket,
trialDate: '2019-03-01T21:40:46.415Z',
userId: 'petitioner',
},
@@ -515,7 +517,7 @@ describe('updateCase', () => {
applicationContext.getDocumentClient().put.mock.calls[0][0].Item,
).toMatchObject({
docketNumberSuffix: 'W',
- gsi1pk: '123',
+ gsi1pk: 'user-case|123',
pk: 'user|123',
sk: 'case|123',
});
@@ -531,7 +533,7 @@ describe('updateCase', () => {
docketNumber: '101-18',
docketNumberSuffix: null,
inProgress: true,
- status: Case.STATUS_TYPES.generalDocket,
+ status: CASE_STATUS_TYPES.generalDocket,
trialDate: '2019-03-01T21:40:46.415Z',
userId: 'petitioner',
},
@@ -541,7 +543,7 @@ describe('updateCase', () => {
applicationContext.getDocumentClient().put.mock.calls[0][0].Item,
).toMatchObject({
caseCaption: 'Guy Fieri, Petitioner',
- gsi1pk: '123',
+ gsi1pk: 'user-case|123',
pk: 'user|123',
sk: 'case|123',
});
@@ -557,7 +559,7 @@ describe('updateCase', () => {
docketNumberSuffix: null,
inProgress: true,
leadCaseId: 'case|321',
- status: Case.STATUS_TYPES.generalDocket,
+ status: CASE_STATUS_TYPES.generalDocket,
trialDate: '2019-03-01T21:40:46.415Z',
userId: 'petitioner',
},
@@ -566,7 +568,7 @@ describe('updateCase', () => {
expect(
applicationContext.getDocumentClient().put.mock.calls[0][0].Item,
).toMatchObject({
- gsi1pk: '123',
+ gsi1pk: 'user-case|123',
leadCaseId: 'case|321',
pk: 'user|123',
sk: 'case|123',
diff --git a/shared/src/persistence/dynamo/elasticsearch/getElasticsearchReindexRecords.js b/shared/src/persistence/dynamo/elasticsearch/getElasticsearchReindexRecords.js
index e90426bad44..a7757e81ccb 100644
--- a/shared/src/persistence/dynamo/elasticsearch/getElasticsearchReindexRecords.js
+++ b/shared/src/persistence/dynamo/elasticsearch/getElasticsearchReindexRecords.js
@@ -3,8 +3,9 @@ const client = require('../../dynamodbClientService');
/**
* getElasticsearchReindexRecords
*
- * @param {object} providers the providers object
- * @param {object} providers.applicationContext the application context
+ * @param {object} arguments deconstructed arguments
+ * @param {object} arguments.applicationContext the application context
+ * @returns {Promise} resolved with query results
*/
exports.getElasticsearchReindexRecords = async ({ applicationContext }) => {
return await client.query({
diff --git a/shared/src/persistence/dynamo/elasticsearch/getRecord.js b/shared/src/persistence/dynamo/elasticsearch/getRecord.js
index 672fc4955d6..b0a0e5af152 100644
--- a/shared/src/persistence/dynamo/elasticsearch/getRecord.js
+++ b/shared/src/persistence/dynamo/elasticsearch/getRecord.js
@@ -3,10 +3,11 @@ const client = require('../../dynamodbClientService');
/**
* getRecord - get a generic record from dynamo to index in elasticsearch
*
- * @param {object} providers the providers object
- * @param {object} providers.applicationContext the application context
- * @param {object} providers.recordPk the pk of the record to get
- * @param {object} providers.recordSk the sk of the record to get
+ * @param {object} arguments deconstructed arguments
+ * @param {object} arguments.applicationContext the application context
+ * @param {string} arguments.recordPk the pk of the record to get
+ * @param {string} arguments.recordSk the sk of the record to get
+ * @returns {Promise} resolves with result of query
*/
exports.getRecord = async ({ applicationContext, recordPk, recordSk }) => {
return await client.get({
diff --git a/shared/src/persistence/dynamo/messages/createCaseMessage.js b/shared/src/persistence/dynamo/messages/createCaseMessage.js
new file mode 100644
index 00000000000..94f3cea8d47
--- /dev/null
+++ b/shared/src/persistence/dynamo/messages/createCaseMessage.js
@@ -0,0 +1,21 @@
+const { put } = require('../../dynamodbClientService');
+
+/**
+ * createCaseMessage
+ *
+ * @param {object} providers the providers object
+ * @param {object} providers.applicationContext the application context
+ * @param {object} providers.caseMessage the case message data
+ * @returns {object} the created case message
+ */
+exports.createCaseMessage = async ({ applicationContext, caseMessage }) => {
+ await put({
+ Item: {
+ gsi1pk: `message|${caseMessage.messageId}`,
+ pk: `case|${caseMessage.caseId}`,
+ sk: `message|${caseMessage.messageId}`,
+ ...caseMessage,
+ },
+ applicationContext,
+ });
+};
diff --git a/shared/src/persistence/dynamo/messages/createCaseMessage.test.js b/shared/src/persistence/dynamo/messages/createCaseMessage.test.js
new file mode 100644
index 00000000000..a5845b9c066
--- /dev/null
+++ b/shared/src/persistence/dynamo/messages/createCaseMessage.test.js
@@ -0,0 +1,46 @@
+const {
+ applicationContext,
+} = require('../../../business/test/createTestApplicationContext');
+const { createCaseMessage } = require('./createCaseMessage');
+
+const mockCaseMessage = {
+ caseId: 'b3f09a45-b27c-4383-acc1-2ab1f99e6725',
+ createdAt: '2019-03-01T21:40:46.415Z',
+ from: 'Test Petitionsclerk',
+ fromSection: 'petitions',
+ fromUserId: '4791e892-14ee-4ab1-8468-0c942ec379d2',
+ message: 'hey there',
+ messageId: 'a10d6855-f3ee-4c11-861c-c7f11cba4dff',
+ subject: 'hello',
+ to: 'Test Petitionsclerk2',
+ toSection: 'petitions',
+ toUserId: '449b916e-3362-4a5d-bf56-b2b94ba29c12',
+};
+
+describe('createCaseMessage', () => {
+ beforeAll(() => {
+ applicationContext.environment.stage = 'dev';
+ applicationContext.getDocumentClient().put.mockReturnValue({
+ promise: () => Promise.resolve(null),
+ });
+ });
+
+ it('attempts to persist the case message record', async () => {
+ await createCaseMessage({
+ applicationContext,
+ caseMessage: mockCaseMessage,
+ });
+
+ expect(
+ applicationContext.getDocumentClient().put.mock.calls.length,
+ ).toEqual(1);
+ expect(
+ applicationContext.getDocumentClient().put.mock.calls[0][0].Item,
+ ).toMatchObject({
+ gsi1pk: `message|${mockCaseMessage.messageId}`,
+ pk: `case|${mockCaseMessage.caseId}`,
+ sk: `message|${mockCaseMessage.messageId}`,
+ ...mockCaseMessage,
+ });
+ });
+});
diff --git a/shared/src/persistence/dynamo/messages/getCaseMessageById.js b/shared/src/persistence/dynamo/messages/getCaseMessageById.js
new file mode 100644
index 00000000000..2fd2f0aa99d
--- /dev/null
+++ b/shared/src/persistence/dynamo/messages/getCaseMessageById.js
@@ -0,0 +1,25 @@
+const { query } = require('../../dynamodbClientService');
+
+/**
+ * getCaseMessageById
+ *
+ * @param {object} providers the providers object
+ * @param {object} providers.applicationContext the application context
+ * @param {string} providers.messageId the message id
+ * @returns {object} the created case message
+ */
+exports.getCaseMessageById = async ({ applicationContext, messageId }) => {
+ const messages = await query({
+ ExpressionAttributeNames: {
+ '#gsi1pk': 'gsi1pk',
+ },
+ ExpressionAttributeValues: {
+ ':gsi1pk': `message|${messageId}`,
+ },
+ IndexName: 'gsi1',
+ KeyConditionExpression: '#gsi1pk = :gsi1pk',
+ applicationContext,
+ });
+
+ return messages[0];
+};
diff --git a/shared/src/persistence/dynamo/messages/getCaseMessageById.test.js b/shared/src/persistence/dynamo/messages/getCaseMessageById.test.js
new file mode 100644
index 00000000000..2976dd980f0
--- /dev/null
+++ b/shared/src/persistence/dynamo/messages/getCaseMessageById.test.js
@@ -0,0 +1,36 @@
+const {
+ applicationContext,
+} = require('../../../business/test/createTestApplicationContext');
+const { getCaseMessageById } = require('./getCaseMessageById');
+
+const mockCaseMessage = {
+ caseId: 'b3f09a45-b27c-4383-acc1-2ab1f99e6725',
+ createdAt: '2019-03-01T21:40:46.415Z',
+ from: 'Test Petitionsclerk',
+ fromSection: 'petitions',
+ fromUserId: '4791e892-14ee-4ab1-8468-0c942ec379d2',
+ message: 'hey there',
+ messageId: 'a10d6855-f3ee-4c11-861c-c7f11cba4dff',
+ subject: 'hello',
+ to: 'Test Petitionsclerk2',
+ toSection: 'petitions',
+ toUserId: '449b916e-3362-4a5d-bf56-b2b94ba29c12',
+};
+
+describe('getCaseMessageById', () => {
+ beforeAll(() => {
+ applicationContext.environment.stage = 'dev';
+ applicationContext.getDocumentClient().query.mockReturnValue({
+ promise: () => Promise.resolve({ Items: [mockCaseMessage] }),
+ });
+ });
+
+ it('retrieves the case message from persistence', async () => {
+ const retrievedMessage = await getCaseMessageById({
+ applicationContext,
+ messageId: mockCaseMessage.messageId,
+ });
+
+ expect(retrievedMessage).toEqual(mockCaseMessage);
+ });
+});
diff --git a/shared/src/persistence/dynamo/users/createPractitionerUser.js b/shared/src/persistence/dynamo/users/createPractitionerUser.js
index 236f3a824f4..86a721d8902 100644
--- a/shared/src/persistence/dynamo/users/createPractitionerUser.js
+++ b/shared/src/persistence/dynamo/users/createPractitionerUser.js
@@ -1,5 +1,5 @@
const client = require('../../dynamodbClientService');
-const { User } = require('../../../business/entities/User');
+const { ROLES } = require('../../../business/entities/EntityConstants');
exports.createUserRecords = async ({ applicationContext, user, userId }) => {
delete user.password;
@@ -53,11 +53,7 @@ exports.createUserRecords = async ({ applicationContext, user, userId }) => {
exports.createPractitionerUser = async ({ applicationContext, user }) => {
let userId = applicationContext.getUniqueId();
- if (
- ![User.ROLES.privatePractitioner, User.ROLES.irsPractitioner].includes(
- user.role,
- )
- ) {
+ if (![ROLES.privatePractitioner, ROLES.irsPractitioner].includes(user.role)) {
throw new Error(
'Practitioner users must have either private or IRS practitioner role',
);
diff --git a/shared/src/persistence/dynamo/users/createPractitionerUser.test.js b/shared/src/persistence/dynamo/users/createPractitionerUser.test.js
index 163f6842e07..ca9d0ac619e 100644
--- a/shared/src/persistence/dynamo/users/createPractitionerUser.test.js
+++ b/shared/src/persistence/dynamo/users/createPractitionerUser.test.js
@@ -5,14 +5,14 @@ const {
createPractitionerUser,
createUserRecords,
} = require('./createPractitionerUser');
-const { User } = require('../../../business/entities/User');
+const { ROLES } = require('../../../business/entities/EntityConstants');
const userId = '9b52c605-edba-41d7-b045-d5f992a499d3';
const privatePractitionerUser = {
barNumber: 'pt1234', //intentionally lower case - should be converted to upper case when persisted
name: 'Test Private Practitioner',
- role: User.ROLES.privatePractitioner,
+ role: ROLES.privatePractitioner,
section: 'privatePractitioner',
};
@@ -20,14 +20,14 @@ const privatePractitionerUserWithSection = {
barNumber: 'pt1234',
email: 'test@example.com',
name: 'Test Private Practitioner',
- role: User.ROLES.privatePractitioner,
+ role: ROLES.privatePractitioner,
section: 'privatePractitioner',
};
const privatePractitionerUserWithoutBarNumber = {
barNumber: '',
name: 'Test Private Practitioner',
- role: User.ROLES.privatePractitioner,
+ role: ROLES.privatePractitioner,
section: 'privatePractitioner',
};
@@ -35,7 +35,7 @@ const otherUser = {
barNumber: 'pt1234',
email: 'test@example.com',
name: 'Test Other',
- role: User.ROLES.other,
+ role: ROLES.other,
section: 'other',
};
diff --git a/shared/src/persistence/dynamo/users/createUser.js b/shared/src/persistence/dynamo/users/createUser.js
index 610bd5778a7..5225b0901be 100644
--- a/shared/src/persistence/dynamo/users/createUser.js
+++ b/shared/src/persistence/dynamo/users/createUser.js
@@ -1,5 +1,5 @@
const client = require('../../dynamodbClientService');
-const { User } = require('../../../business/entities/User');
+const { ROLES } = require('../../../business/entities/EntityConstants');
exports.createUserRecords = async ({ applicationContext, user, userId }) => {
delete user.password;
@@ -17,7 +17,7 @@ exports.createUserRecords = async ({ applicationContext, user, userId }) => {
applicationContext,
});
- if (user.role === User.ROLES.judge) {
+ if (user.role === ROLES.judge) {
await client.put({
Item: {
pk: 'section|judge',
@@ -39,8 +39,8 @@ exports.createUserRecords = async ({ applicationContext, user, userId }) => {
});
if (
- (user.role === User.ROLES.privatePractitioner ||
- user.role === User.ROLES.irsPractitioner) &&
+ (user.role === ROLES.privatePractitioner ||
+ user.role === ROLES.irsPractitioner) &&
user.name &&
user.barNumber
) {
@@ -70,7 +70,7 @@ exports.createUserRecords = async ({ applicationContext, user, userId }) => {
exports.createUser = async ({ applicationContext, user }) => {
let userId;
let userPoolId =
- user.role === User.ROLES.irsSuperuser
+ user.role === ROLES.irsSuperuser
? process.env.USER_POOL_IRS_ID
: process.env.USER_POOL_ID;
diff --git a/shared/src/persistence/dynamo/users/createUser.test.js b/shared/src/persistence/dynamo/users/createUser.test.js
index d771b928d3f..87fff5f0345 100644
--- a/shared/src/persistence/dynamo/users/createUser.test.js
+++ b/shared/src/persistence/dynamo/users/createUser.test.js
@@ -2,27 +2,27 @@ const {
applicationContext,
} = require('../../../business/test/createTestApplicationContext');
const { createUser, createUserRecords } = require('./createUser');
-const { User } = require('../../../business/entities/User');
+const { ROLES } = require('../../../business/entities/EntityConstants');
const userId = '9b52c605-edba-41d7-b045-d5f992a499d3';
const petitionsClerkUser = {
name: 'Test Petitionsclerk',
- role: User.ROLES.petitionsClerk,
+ role: ROLES.petitionsClerk,
section: 'petitions',
};
const privatePractitionerUser = {
barNumber: 'pt1234', //intentionally lower case - should be converted to upper case when persisted
name: 'Test Private Practitioner',
- role: User.ROLES.privatePractitioner,
+ role: ROLES.privatePractitioner,
section: 'privatePractitioner',
};
const privatePractitionerUserWithoutBarNumber = {
barNumber: '',
name: 'Test Private Practitioner',
- role: User.ROLES.privatePractitioner,
+ role: ROLES.privatePractitioner,
section: 'privatePractitioner',
};
@@ -56,7 +56,7 @@ describe('createUser', () => {
it('should call adminCreateUser', async () => {
const petitionsclerkUser = {
name: 'Test Petitionsclerk',
- role: User.ROLES.petitionsClerk,
+ role: ROLES.petitionsClerk,
section: 'petitions',
};
@@ -166,7 +166,7 @@ describe('createUser', () => {
it('attempts to persist a judge user with a section mapping record for the chambers and the judge', async () => {
const judgeUser = {
name: 'Judge Adam',
- role: User.ROLES.judge,
+ role: ROLES.judge,
section: 'adamsChambers',
};
@@ -319,7 +319,7 @@ describe('createUser', () => {
it('does not persist section mapping record if user does not have a section', async () => {
const privatePractitionerUserWithoutSection = {
name: 'Test Private Practitioner',
- role: User.ROLES.privatePractitioner,
+ role: ROLES.privatePractitioner,
};
await createUserRecords({
diff --git a/shared/src/persistence/dynamo/users/getInternalUsers.js b/shared/src/persistence/dynamo/users/getInternalUsers.js
index 09333c80766..8768c31689c 100644
--- a/shared/src/persistence/dynamo/users/getInternalUsers.js
+++ b/shared/src/persistence/dynamo/users/getInternalUsers.js
@@ -2,7 +2,7 @@ const {
ADC_SECTION,
DOCKET_SECTION,
PETITIONS_SECTION,
-} = require('../../../business/entities/WorkQueue');
+} = require('../../../business/entities/EntityConstants');
const { getUsersInSection } = require('./getUsersInSection');
exports.getInternalUsers = async ({ applicationContext }) => {
diff --git a/shared/src/persistence/dynamo/users/getPractitionerByBarNumber.test.js b/shared/src/persistence/dynamo/users/getPractitionerByBarNumber.test.js
index b58cbb5cb7e..9076e2fc009 100644
--- a/shared/src/persistence/dynamo/users/getPractitionerByBarNumber.test.js
+++ b/shared/src/persistence/dynamo/users/getPractitionerByBarNumber.test.js
@@ -2,7 +2,7 @@ const client = require('../../../../../shared/src/persistence/dynamodbClientServ
const {
applicationContext,
} = require('../../../business/test/createTestApplicationContext');
-const { User } = require('../../../business/entities/User');
+const { ROLES } = require('../../../business/entities/EntityConstants');
const { getPractitionerByBarNumber } = require('./getPractitionerByBarNumber');
@@ -11,7 +11,7 @@ describe('getPractitionerByBarNumber', () => {
barNumber: 'PT1234',
name: 'Test Practitioner',
pk: 'user|9805d1ab-18d0-43ec-bafb-654e83405416',
- role: User.ROLES.privatePractitioner,
+ role: ROLES.privatePractitioner,
section: 'privatePractitioner',
sk: '9805d1ab-18d0-43ec-bafb-654e83405416',
userId: '9805d1ab-18d0-43ec-bafb-654e83405416',
@@ -21,7 +21,7 @@ describe('getPractitionerByBarNumber', () => {
barNumber: 'PI5678',
name: 'IRS Practitioner',
pk: 'user|0105d1ab-18d0-43ec-bafb-654e83405416',
- role: User.ROLES.irsPractitioner,
+ role: ROLES.irsPractitioner,
section: 'irsPractitioner',
sk: '0105d1ab-18d0-43ec-bafb-654e83405416',
userId: '0105d1ab-18d0-43ec-bafb-654e83405416',
@@ -31,7 +31,7 @@ describe('getPractitionerByBarNumber', () => {
barNumber: 'PI9999',
name: 'Inactive Practitioner',
pk: 'user|be4274f0-c525-45bc-8378-9f30fd841571',
- role: User.ROLES.inactivePractitioner,
+ role: ROLES.inactivePractitioner,
section: 'inactivePractitioner',
sk: 'be4274f0-c525-45bc-8378-9f30fd841571',
userId: 'be4274f0-c525-45bc-8378-9f30fd841571',
diff --git a/shared/src/persistence/dynamo/users/getUsersBySearchKey.test.js b/shared/src/persistence/dynamo/users/getUsersBySearchKey.test.js
index c6981b49798..27826381892 100644
--- a/shared/src/persistence/dynamo/users/getUsersBySearchKey.test.js
+++ b/shared/src/persistence/dynamo/users/getUsersBySearchKey.test.js
@@ -1,6 +1,6 @@
const client = require('../../../../../shared/src/persistence/dynamodbClientService');
const { getUsersBySearchKey } = require('./getUsersBySearchKey');
-const { User } = require('../../../business/entities/User');
+const { ROLES } = require('../../../business/entities/EntityConstants');
const {
applicationContext,
@@ -13,7 +13,7 @@ describe('getUsersBySearchKey', () => {
barNumber: 'PT1234',
name: 'Test Practitioner',
pk: 'user|9805d1ab-18d0-43ec-bafb-654e83405416',
- role: User.ROLES.privatePractitioner,
+ role: ROLES.privatePractitioner,
section: 'privatePractitioner',
sk: '9805d1ab-18d0-43ec-bafb-654e83405416',
userId: '9805d1ab-18d0-43ec-bafb-654e83405416',
@@ -38,7 +38,7 @@ describe('getUsersBySearchKey', () => {
barNumber: 'PT1234',
name: 'Test Practitioner',
pk: 'user|9805d1ab-18d0-43ec-bafb-654e83405416',
- role: User.ROLES.privatePractitioner,
+ role: ROLES.privatePractitioner,
section: 'privatePractitioner',
sk: '9805d1ab-18d0-43ec-bafb-654e83405416',
userId: '9805d1ab-18d0-43ec-bafb-654e83405416',
diff --git a/shared/src/persistence/dynamo/users/updatePractitionerUser.test.js b/shared/src/persistence/dynamo/users/updatePractitionerUser.test.js
index 7fe57521bd0..422692375cc 100644
--- a/shared/src/persistence/dynamo/users/updatePractitionerUser.test.js
+++ b/shared/src/persistence/dynamo/users/updatePractitionerUser.test.js
@@ -5,7 +5,7 @@ const {
updatePractitionerUser,
updateUserRecords,
} = require('./updatePractitionerUser');
-const { User } = require('../../../business/entities/User');
+const { ROLES } = require('../../../business/entities/EntityConstants');
const userId = '9b52c605-edba-41d7-b045-d5f992a499d3';
@@ -14,13 +14,13 @@ describe('updatePractitionerUser', () => {
const oldUser = {
barNumber: 'PT1234',
name: 'Test Private Practitioner',
- role: User.ROLES.privatePractitioner,
+ role: ROLES.privatePractitioner,
section: 'privatePractitioner',
};
const updatedUser = {
barNumber: 'PT1234',
name: 'Test Private Practitioner',
- role: User.ROLES.inactivePractitioner,
+ role: ROLES.inactivePractitioner,
section: 'inactivePractitioner',
};
@@ -99,7 +99,7 @@ describe('updatePractitionerUser', () => {
Item: {
barNumber: 'PT1234',
name: 'Test Practitioner',
- role: User.ROLES.inactivePractitioner,
+ role: ROLES.inactivePractitioner,
section: 'inactivePractitioner',
},
}),
@@ -107,7 +107,7 @@ describe('updatePractitionerUser', () => {
const updatedUser = {
barNumber: 'PT1234',
name: 'Test Practitioner',
- role: User.ROLES.inactivePractitioner,
+ role: ROLES.inactivePractitioner,
section: 'inactivePractitioner',
};
@@ -130,7 +130,7 @@ describe('updatePractitionerUser', () => {
Item: {
barNumber: 'PT1234',
name: 'Test Practitioner',
- role: User.ROLES.inactivePractitioner,
+ role: ROLES.inactivePractitioner,
section: 'inactivePractitioner',
},
}),
@@ -138,7 +138,7 @@ describe('updatePractitionerUser', () => {
const updatedUser = {
barNumber: 'PT1234',
name: 'Test Practitioner',
- role: User.ROLES.inactivePractitioner,
+ role: ROLES.inactivePractitioner,
section: 'inactivePractitioner',
};
@@ -156,7 +156,7 @@ describe('updatePractitionerUser - with a cognito response', () => {
const updatedUser = {
barNumber: 'PT1234',
name: 'Test Practitioner',
- role: User.ROLES.inactivePractitioner,
+ role: ROLES.inactivePractitioner,
section: 'inactivePractitioner',
};
diff --git a/shared/src/persistence/dynamo/users/updateUser.test.js b/shared/src/persistence/dynamo/users/updateUser.test.js
index 43e3c3e2b90..69e4b0f11f8 100644
--- a/shared/src/persistence/dynamo/users/updateUser.test.js
+++ b/shared/src/persistence/dynamo/users/updateUser.test.js
@@ -1,14 +1,14 @@
const {
applicationContext,
} = require('../../../business/test/createTestApplicationContext');
+const { ROLES } = require('../../../business/entities/EntityConstants');
const { updateUser } = require('./updateUser');
-const { User } = require('../../../business/entities/User');
const mockUserId = '9b52c605-edba-41d7-b045-d5f992a499d3';
const mockUser = {
name: 'Test User',
- role: User.ROLES.petitionsClerk,
+ role: ROLES.petitionsClerk,
section: 'petitions',
userId: mockUserId,
};
diff --git a/shared/src/persistence/dynamsoft/getScannerInterface.test.js b/shared/src/persistence/dynamsoft/getScannerInterface.test.js
index 80853557b09..54508bff2e0 100644
--- a/shared/src/persistence/dynamsoft/getScannerInterface.test.js
+++ b/shared/src/persistence/dynamsoft/getScannerInterface.test.js
@@ -3,7 +3,7 @@ const {
} = require('../../business/test/createTestApplicationContext');
const { getScannerInterface } = require('./getScannerInterface');
const { JSDOM } = require('jsdom');
-import { Scan } from '../../business/entities/Scan';
+import { SCAN_MODES } from '../../business/entities/EntityConstants';
describe('getScannerInterface', () => {
const jsdom = new JSDOM('');
@@ -22,8 +22,6 @@ describe('getScannerInterface', () => {
const mockOpenSource = jest.fn();
const mockRemoveAllImages = jest.fn();
- const { SCAN_MODES } = Scan;
-
applicationContext.getScannerResourceUri.mockReturnValue('abc');
const DWObject = {
diff --git a/shared/src/persistence/elasticsearch/bulkIndexRecords.js b/shared/src/persistence/elasticsearch/bulkIndexRecords.js
index 2ba55c32bb5..75cf3bef5b8 100644
--- a/shared/src/persistence/elasticsearch/bulkIndexRecords.js
+++ b/shared/src/persistence/elasticsearch/bulkIndexRecords.js
@@ -25,8 +25,8 @@ exports.bulkIndexRecords = async ({ applicationContext, records }) => {
});
const failedRecords = [];
- if (response.body.errors) {
- response.body.items.forEach((action, i) => {
+ if (response.errors) {
+ response.items.forEach((action, i) => {
const operation = Object.keys(action)[0];
if (action[operation].error) {
let record = body[i * 2 + 1];
diff --git a/shared/src/persistence/elasticsearch/bulkIndexRecords.test.js b/shared/src/persistence/elasticsearch/bulkIndexRecords.test.js
new file mode 100644
index 00000000000..a4136455545
--- /dev/null
+++ b/shared/src/persistence/elasticsearch/bulkIndexRecords.test.js
@@ -0,0 +1,77 @@
+const {
+ applicationContext,
+} = require('../../business/test/createTestApplicationContext');
+const { bulkIndexRecords } = require('./bulkIndexRecords');
+
+describe('bulkIndexRecords', () => {
+ const newImageRecord = {
+ caseId: { S: '6f3d97f8-1bdd-4779-a150-c076d08ad8fd' },
+ caseStatus: { S: 'New' },
+ createdAt: { S: '2020-06-10T15:10:23.553Z' },
+ docketNumber: { S: '105-19' },
+ docketNumberWithSuffix: { S: '105-19' },
+ entityName: { S: 'CaseMessage' },
+ from: { S: 'Test Docketclerk' },
+ fromSection: { S: 'docket' },
+ fromUserId: { S: '1805d1ab-18d0-43ec-bafb-654e83405416' },
+ gsi1pk: { S: 'message|2e30ecc2-3818-4855-ad3f-4a3ce8d29767' },
+ message: { S: 'D' },
+ messageId: { S: '2e30ecc2-3818-4855-ad3f-4a3ce8d29767' },
+ pk: { S: 'case|6f3d97f8-1bdd-4779-a150-c076d08ad8fd' },
+ sk: { S: 'message|2e30ecc2-3818-4855-ad3f-4a3ce8d29767' },
+ subject: { S: 'S' },
+ to: { S: 'Test Docketclerk' },
+ toSection: { S: 'docket' },
+ toUserId: { S: '1805d1ab-18d0-43ec-bafb-654e83405416' },
+ };
+
+ const records = [
+ {
+ dynamodb: {
+ NewImage: newImageRecord,
+ },
+ },
+ ];
+
+ it('returns no failed records if the bulk call is successful', async () => {
+ applicationContext.getSearchClient().bulk.mockReturnValue({
+ errors: false,
+ items: [{}],
+ took: 100,
+ });
+
+ const result = await bulkIndexRecords({
+ applicationContext,
+ records: records,
+ });
+ expect(result.failedRecords).toEqual([]);
+ });
+
+ it('returns failed records if the bulk call is unsuccessful', async () => {
+ applicationContext.getSearchClient().bulk.mockReturnValue({
+ errors: true,
+ items: [
+ {
+ index: {
+ _index: 'efcms-message',
+ error: {
+ index: 'efcms-message',
+ index_uuid: 'aAsFqTI0Tc2W0LCWgPNrOA',
+ reason: 'document missing',
+ shard: '0',
+ type: 'document_missing_exception',
+ },
+ status: 404,
+ },
+ },
+ ],
+ took: 100,
+ });
+
+ const result = await bulkIndexRecords({
+ applicationContext,
+ records: records,
+ });
+ expect(result.failedRecords).toEqual([newImageRecord]);
+ });
+});
diff --git a/shared/src/persistence/elasticsearch/getIndexMappingFields.js b/shared/src/persistence/elasticsearch/getIndexMappingFields.js
index b7262bc646c..9cf34f11585 100644
--- a/shared/src/persistence/elasticsearch/getIndexMappingFields.js
+++ b/shared/src/persistence/elasticsearch/getIndexMappingFields.js
@@ -1,8 +1,8 @@
/**
- * @param {object} args deconstructed arguments
- * @param {object} args.applicationContext the application context
- * @param {string} args.index the index we're querying
- * @return {object} the mapping properties of the specified index
+ * @param {object} arguments deconstructed arguments
+ * @param {object} arguments.applicationContext the application context
+ * @param {string} arguments.index the index we're querying
+ * @returns {object} the mapping properties of the specified index
*/
exports.getIndexMappingFields = async ({ applicationContext, index }) => {
const searchClient = applicationContext.getSearchClient();
diff --git a/shared/src/persistence/elasticsearch/getIndexMappingLimit.js b/shared/src/persistence/elasticsearch/getIndexMappingLimit.js
index 79c2ec94869..7ae4e558bc8 100644
--- a/shared/src/persistence/elasticsearch/getIndexMappingLimit.js
+++ b/shared/src/persistence/elasticsearch/getIndexMappingLimit.js
@@ -2,7 +2,7 @@
* @param {object} params deconstructed arguments
* @param {object} params.applicationContext the application context
* @param {string} params.index the index we're querying
- * @return {string} the limit for the specified index
+ * @returns {Promise} the limit for the specified index
*/
exports.getIndexMappingLimit = async ({ applicationContext, index }) => {
const searchClient = applicationContext.getSearchClient();
diff --git a/shared/src/persistence/elasticsearch/getIndexNameForRecord.js b/shared/src/persistence/elasticsearch/getIndexNameForRecord.js
index 616acfa8a28..bbf533757be 100644
--- a/shared/src/persistence/elasticsearch/getIndexNameForRecord.js
+++ b/shared/src/persistence/elasticsearch/getIndexNameForRecord.js
@@ -26,6 +26,10 @@ exports.getIndexNameForRecord = record => {
index = 'efcms-document';
} else if (isRecordOfType(record, 'User')) {
index = 'efcms-user';
+ } else if (isRecordOfType(record, 'CaseMessage')) {
+ index = 'efcms-message';
+ } else if (isRecordOfType(record, 'UserCase')) {
+ index = 'efcms-user-case';
}
return index;
diff --git a/shared/src/persistence/elasticsearch/getIndexNameForRecord.test.js b/shared/src/persistence/elasticsearch/getIndexNameForRecord.test.js
index 8a69246ee06..a70a6e83735 100644
--- a/shared/src/persistence/elasticsearch/getIndexNameForRecord.test.js
+++ b/shared/src/persistence/elasticsearch/getIndexNameForRecord.test.js
@@ -5,6 +5,7 @@ describe('getIndexNameForRecord', () => {
const record = {};
const result = getIndexNameForRecord(record);
+
expect(result).toEqual(null);
});
@@ -16,6 +17,7 @@ describe('getIndexNameForRecord', () => {
};
const result = getIndexNameForRecord(record);
+
expect(result).toEqual('efcms-case');
});
@@ -27,6 +29,7 @@ describe('getIndexNameForRecord', () => {
};
const result = getIndexNameForRecord(record);
+
expect(result).toEqual('efcms-document');
});
@@ -38,6 +41,7 @@ describe('getIndexNameForRecord', () => {
};
const result = getIndexNameForRecord(record);
+
expect(result).toEqual('efcms-user');
});
@@ -49,6 +53,7 @@ describe('getIndexNameForRecord', () => {
};
const result = getIndexNameForRecord(record);
+
expect(result).toEqual('efcms-user');
});
@@ -60,6 +65,7 @@ describe('getIndexNameForRecord', () => {
};
const result = getIndexNameForRecord(record);
+
expect(result).toEqual('efcms-user');
});
@@ -71,6 +77,31 @@ describe('getIndexNameForRecord', () => {
};
const result = getIndexNameForRecord(record);
+
expect(result).toEqual('efcms-user');
});
+
+ it('returns efcms-message for CaseMessage records', () => {
+ const record = {
+ entityName: {
+ S: 'CaseMessage',
+ },
+ };
+
+ const result = getIndexNameForRecord(record);
+
+ expect(result).toEqual('efcms-message');
+ });
+
+ it('returns efcms-user-case for UserCase records', () => {
+ const record = {
+ entityName: {
+ S: 'UserCase',
+ },
+ };
+
+ const result = getIndexNameForRecord(record);
+
+ expect(result).toEqual('efcms-user-case');
+ });
});
diff --git a/shared/src/persistence/elasticsearch/getIndexedCasesForUser.js b/shared/src/persistence/elasticsearch/getIndexedCasesForUser.js
new file mode 100644
index 00000000000..d0e235ec27a
--- /dev/null
+++ b/shared/src/persistence/elasticsearch/getIndexedCasesForUser.js
@@ -0,0 +1,59 @@
+const { search } = require('./searchClient');
+
+/**
+ * getIndexedCasesForUser
+ *
+ * @param {object} providers the providers object
+ * @param {object} providers.applicationContext the application context
+ * @param {string} providers.statuses case status to filter by
+ * @param {string} providers.userId the userId to filter cases by
+ * @returns {object} the case data
+ */
+exports.getIndexedCasesForUser = async ({
+ applicationContext,
+ statuses,
+ userId,
+}) => {
+ const { results } = await search({
+ applicationContext,
+ searchParameters: {
+ body: {
+ _source: [
+ 'docketNumber',
+ 'docketNumberWithSuffix',
+ 'caseCaption',
+ 'leadCaseId',
+ 'caseId',
+ 'createdAt',
+ 'status',
+ ],
+ query: {
+ bool: {
+ must: [
+ {
+ match: {
+ 'pk.S': { operator: 'and', query: `user|${userId}` },
+ },
+ },
+ { match: { 'sk.S': 'case|' } },
+ { match: { 'gsi1pk.S': 'user-case|' } },
+ {
+ bool: {
+ should: statuses.map(status => ({
+ match: {
+ 'status.S': status,
+ },
+ })),
+ },
+ },
+ ],
+ },
+ },
+ size: 5000,
+ },
+ index: 'efcms-user-case',
+ },
+ });
+
+ return results;
+};
diff --git a/shared/src/persistence/elasticsearch/getIndexedCasesForUser.test.js b/shared/src/persistence/elasticsearch/getIndexedCasesForUser.test.js
new file mode 100644
index 00000000000..86c2f88299e
--- /dev/null
+++ b/shared/src/persistence/elasticsearch/getIndexedCasesForUser.test.js
@@ -0,0 +1,70 @@
+const {
+ applicationContext,
+} = require('../../business/test/createTestApplicationContext');
+const {
+ CASE_STATUS_TYPES,
+} = require('../../business/entities/EntityConstants');
+const { getIndexedCasesForUser } = require('./getIndexedCasesForUser');
+
+describe('getIndexedCasesForUser', () => {
+ beforeEach(() => {});
+
+ it('should search for cases by the userId and statuses provided', async () => {
+ const mockUserId = '123';
+
+ await getIndexedCasesForUser({
+ applicationContext,
+ statuses: [
+ CASE_STATUS_TYPES.new,
+ CASE_STATUS_TYPES.jurisdictionRetained,
+ CASE_STATUS_TYPES.calendared,
+ ],
+ userId: mockUserId,
+ });
+
+ expect(
+ applicationContext.getSearchClient().search.mock.calls[0][0].body.query
+ .bool.must,
+ ).toMatchObject([
+ {
+ match: {
+ 'pk.S': {
+ operator: 'and',
+ query: `user|${mockUserId}`,
+ },
+ },
+ },
+ {
+ match: {
+ 'sk.S': 'case|',
+ },
+ },
+ {
+ match: {
+ 'gsi1pk.S': 'user-case|',
+ },
+ },
+ {
+ bool: {
+ should: [
+ {
+ match: {
+ 'status.S': CASE_STATUS_TYPES.new,
+ },
+ },
+ {
+ match: {
+ 'status.S': 'Jurisdiction Retained',
+ },
+ },
+ {
+ match: {
+ 'status.S': 'Calendared',
+ },
+ },
+ ],
+ },
+ },
+ ]);
+ });
+});
diff --git a/shared/src/persistence/elasticsearch/messages/getSectionInboxMessages.js b/shared/src/persistence/elasticsearch/messages/getSectionInboxMessages.js
new file mode 100644
index 00000000000..6fe8c0770d2
--- /dev/null
+++ b/shared/src/persistence/elasticsearch/messages/getSectionInboxMessages.js
@@ -0,0 +1,26 @@
+const { search } = require('../searchClient');
+
+exports.getSectionInboxMessages = async ({ applicationContext, section }) => {
+ const query = {
+ body: {
+ query: {
+ bool: {
+ must: {
+ match: {
+ 'toSection.S': { operator: 'and', query: section },
+ },
+ },
+ },
+ },
+ size: 5000,
+ },
+ index: 'efcms-message',
+ };
+
+ const { results } = await search({
+ applicationContext,
+ searchParameters: query,
+ });
+
+ return results;
+};
diff --git a/shared/src/persistence/elasticsearch/messages/getSectionInboxMessages.test.js b/shared/src/persistence/elasticsearch/messages/getSectionInboxMessages.test.js
new file mode 100644
index 00000000000..b6f8bca6067
--- /dev/null
+++ b/shared/src/persistence/elasticsearch/messages/getSectionInboxMessages.test.js
@@ -0,0 +1,20 @@
+const {
+ applicationContext,
+} = require('../../../business/test/createTestApplicationContext');
+const { getSectionInboxMessages } = require('./getSectionInboxMessages');
+jest.mock('../searchClient');
+const { search } = require('../searchClient');
+
+describe('getSectionInboxMessages', () => {
+ it('returns results from the search client', async () => {
+ search.mockReturnValue({ results: ['some', 'matches'], total: 0 });
+
+ const results = await getSectionInboxMessages({
+ applicationContext,
+ section: 'petitions',
+ });
+
+ expect(search).toHaveBeenCalledTimes(1);
+ expect(results).toMatchObject(['some', 'matches']);
+ });
+});
diff --git a/shared/src/persistence/elasticsearch/messages/getSectionOutboxMessages.js b/shared/src/persistence/elasticsearch/messages/getSectionOutboxMessages.js
new file mode 100644
index 00000000000..6655fb2212e
--- /dev/null
+++ b/shared/src/persistence/elasticsearch/messages/getSectionOutboxMessages.js
@@ -0,0 +1,26 @@
+const { search } = require('../searchClient');
+
+exports.getSectionOutboxMessages = async ({ applicationContext, section }) => {
+ const query = {
+ body: {
+ query: {
+ bool: {
+ must: {
+ match: {
+ 'fromSection.S': { operator: 'and', query: section },
+ },
+ },
+ },
+ },
+ size: 5000,
+ },
+ index: 'efcms-message',
+ };
+
+ const { results } = await search({
+ applicationContext,
+ searchParameters: query,
+ });
+
+ return results;
+};
diff --git a/shared/src/persistence/elasticsearch/messages/getSectionOutboxMessages.test.js b/shared/src/persistence/elasticsearch/messages/getSectionOutboxMessages.test.js
new file mode 100644
index 00000000000..3204b439b8d
--- /dev/null
+++ b/shared/src/persistence/elasticsearch/messages/getSectionOutboxMessages.test.js
@@ -0,0 +1,20 @@
+const {
+ applicationContext,
+} = require('../../../business/test/createTestApplicationContext');
+const { getSectionOutboxMessages } = require('./getSectionOutboxMessages');
+jest.mock('../searchClient');
+const { search } = require('../searchClient');
+
+describe('getSectionOutboxMessages', () => {
+ it('returns results from the search client', async () => {
+ search.mockReturnValue({ results: ['some', 'matches'], total: 0 });
+
+ const results = await getSectionOutboxMessages({
+ applicationContext,
+ section: 'petitions',
+ });
+
+ expect(search).toHaveBeenCalledTimes(1);
+ expect(results).toMatchObject(['some', 'matches']);
+ });
+});
diff --git a/shared/src/persistence/elasticsearch/messages/getUserInboxMessages.js b/shared/src/persistence/elasticsearch/messages/getUserInboxMessages.js
new file mode 100644
index 00000000000..1d9e0d925de
--- /dev/null
+++ b/shared/src/persistence/elasticsearch/messages/getUserInboxMessages.js
@@ -0,0 +1,26 @@
+const { search } = require('../searchClient');
+
+exports.getUserInboxMessages = async ({ applicationContext, userId }) => {
+ const query = {
+ body: {
+ query: {
+ bool: {
+ must: {
+ match: {
+ 'toUserId.S': { operator: 'and', query: userId },
+ },
+ },
+ },
+ },
+ size: 5000,
+ },
+ index: 'efcms-message',
+ };
+
+ const { results } = await search({
+ applicationContext,
+ searchParameters: query,
+ });
+
+ return results;
+};
diff --git a/shared/src/persistence/elasticsearch/messages/getUserInboxMessages.test.js b/shared/src/persistence/elasticsearch/messages/getUserInboxMessages.test.js
new file mode 100644
index 00000000000..ef8656addc1
--- /dev/null
+++ b/shared/src/persistence/elasticsearch/messages/getUserInboxMessages.test.js
@@ -0,0 +1,20 @@
+const {
+ applicationContext,
+} = require('../../../business/test/createTestApplicationContext');
+const { getUserInboxMessages } = require('./getUserInboxMessages');
+jest.mock('../searchClient');
+const { search } = require('../searchClient');
+
+describe('getUserInboxMessages', () => {
+ it('returns results from the search client', async () => {
+ search.mockReturnValue({ results: ['some', 'matches'], total: 0 });
+
+ const results = await getUserInboxMessages({
+ applicationContext,
+ userId: 'f5d68c53-af31-484d-803b-da22c4d03357',
+ });
+
+ expect(search).toHaveBeenCalledTimes(1);
+ expect(results).toMatchObject(['some', 'matches']);
+ });
+});
diff --git a/shared/src/persistence/elasticsearch/messages/getUserOutboxMessages.js b/shared/src/persistence/elasticsearch/messages/getUserOutboxMessages.js
new file mode 100644
index 00000000000..d11d9b7bdd4
--- /dev/null
+++ b/shared/src/persistence/elasticsearch/messages/getUserOutboxMessages.js
@@ -0,0 +1,26 @@
+const { search } = require('../searchClient');
+
+exports.getUserOutboxMessages = async ({ applicationContext, userId }) => {
+ const query = {
+ body: {
+ query: {
+ bool: {
+ must: {
+ match: {
+ 'fromUserId.S': { operator: 'and', query: userId },
+ },
+ },
+ },
+ },
+ size: 5000,
+ },
+ index: 'efcms-message',
+ };
+
+ const { results } = await search({
+ applicationContext,
+ searchParameters: query,
+ });
+
+ return results;
+};
diff --git a/shared/src/persistence/elasticsearch/messages/getUserOutboxMessages.test.js b/shared/src/persistence/elasticsearch/messages/getUserOutboxMessages.test.js
new file mode 100644
index 00000000000..34d004f6280
--- /dev/null
+++ b/shared/src/persistence/elasticsearch/messages/getUserOutboxMessages.test.js
@@ -0,0 +1,20 @@
+const {
+ applicationContext,
+} = require('../../../business/test/createTestApplicationContext');
+const { getUserOutboxMessages } = require('./getUserOutboxMessages');
+jest.mock('../searchClient');
+const { search } = require('../searchClient');
+
+describe('getUserOutboxMessages', () => {
+ it('returns results from the search client', async () => {
+ search.mockReturnValue({ results: ['some', 'matches'], total: 0 });
+
+ const results = await getUserOutboxMessages({
+ applicationContext,
+ userId: '318de3b3-1625-4638-98a3-c67ab1b17be7',
+ });
+
+ expect(search).toHaveBeenCalledTimes(1);
+ expect(results).toMatchObject(['some', 'matches']);
+ });
+});
diff --git a/shared/src/persistence/s3/getUploadPolicy.js b/shared/src/persistence/s3/getUploadPolicy.js
index ed8cc569390..6f1a06a2206 100644
--- a/shared/src/persistence/s3/getUploadPolicy.js
+++ b/shared/src/persistence/s3/getUploadPolicy.js
@@ -1,5 +1,6 @@
-exports.MAX_FILE_SIZE_MB = 250; // megabytes
-exports.MAX_FILE_SIZE_BYTES = exports.MAX_FILE_SIZE_MB * 1024 * 1024; // bytes -> megabytes
+const {
+ MAX_FILE_SIZE_BYTES,
+} = require('../../business/entities/EntityConstants');
/**
* getUploadPolicy
@@ -16,7 +17,7 @@ exports.getUploadPolicy = ({ applicationContext, documentId }) =>
Conditions: [
['starts-with', '$key', documentId],
['starts-with', '$Content-Type', ''],
- ['content-length-range', 0, exports.MAX_FILE_SIZE_BYTES],
+ ['content-length-range', 0, MAX_FILE_SIZE_BYTES],
],
},
(err, data) => {
diff --git a/shared/src/proxies/getOpenCasesProxy.js b/shared/src/proxies/getClosedCasesProxy.js
similarity index 68%
rename from shared/src/proxies/getOpenCasesProxy.js
rename to shared/src/proxies/getClosedCasesProxy.js
index d8afe7cfb48..54021128a57 100644
--- a/shared/src/proxies/getOpenCasesProxy.js
+++ b/shared/src/proxies/getClosedCasesProxy.js
@@ -1,15 +1,15 @@
const { get } = require('./requests');
/**
- * getOpenCasesInteractor
+ * getClosedCasesInteractor
*
* @param {object} providers the providers object
* @param {object} providers.applicationContext the application context
* @returns {Promise<*>} the promise of the api call
*/
-exports.getOpenCasesInteractor = ({ applicationContext }) => {
+exports.getClosedCasesInteractor = ({ applicationContext }) => {
return get({
applicationContext,
- endpoint: '/cases/open-cases',
+ endpoint: '/cases/closed',
});
};
diff --git a/shared/src/proxies/getConsolidatedCasesByUserProxy.js b/shared/src/proxies/getOpenConsolidatedCasesProxy.js
similarity index 58%
rename from shared/src/proxies/getConsolidatedCasesByUserProxy.js
rename to shared/src/proxies/getOpenConsolidatedCasesProxy.js
index 475d8f63f37..6e99dd27178 100644
--- a/shared/src/proxies/getConsolidatedCasesByUserProxy.js
+++ b/shared/src/proxies/getOpenConsolidatedCasesProxy.js
@@ -1,15 +1,15 @@
const { get } = require('./requests');
/**
+ * getOpenConsolidatedCasesInteractor
*
* @param {object} providers the providers object
* @param {object} providers.applicationContext the application context
* @returns {Promise<*>} the promise of the api call
*/
-exports.getConsolidatedCasesByUserInteractor = ({ applicationContext }) => {
- const user = applicationContext.getCurrentUser();
+exports.getOpenConsolidatedCasesInteractor = ({ applicationContext }) => {
return get({
applicationContext,
- endpoint: `/users/${user.userId}/cases-with-consolidation`,
+ endpoint: '/cases/open',
});
};
diff --git a/shared/src/proxies/messages/createCaseMessageProxy.js b/shared/src/proxies/messages/createCaseMessageProxy.js
new file mode 100644
index 00000000000..507ba6c1465
--- /dev/null
+++ b/shared/src/proxies/messages/createCaseMessageProxy.js
@@ -0,0 +1,36 @@
+const { post } = require('../requests');
+
+/**
+ * createCaseMessageInteractor
+ *
+ * @param {object} providers the providers object
+ * @param {object} providers.applicationContext the application context
+ * @param {string} providers.caseId the id of the case
+ * @param {string} providers.message the message text
+ * @param {string} providers.subject the message subject
+ * @param {string} providers.toSection the section of the user receiving the message
+ * @param {string} providers.toUserId the user id of the user receiving the message
+ * @returns {Promise<*>} the promise of the api call
+ */
+exports.createCaseMessageInteractor = ({
+ applicationContext,
+ attachments,
+ caseId,
+ message,
+ subject,
+ toSection,
+ toUserId,
+}) => {
+ return post({
+ applicationContext,
+ body: {
+ attachments,
+ caseId,
+ message,
+ subject,
+ toSection,
+ toUserId,
+ },
+ endpoint: '/messages/',
+ });
+};
diff --git a/shared/src/proxies/messages/getCaseMessageProxy.js b/shared/src/proxies/messages/getCaseMessageProxy.js
new file mode 100644
index 00000000000..ecc64beff70
--- /dev/null
+++ b/shared/src/proxies/messages/getCaseMessageProxy.js
@@ -0,0 +1,16 @@
+const { get } = require('../requests');
+
+/**
+ * getCaseMessageInteractor
+ *
+ * @param {object} providers the providers object
+ * @param {object} providers.applicationContext the application context
+ * @param {string} providers.messageId the message id
+ * @returns {Promise<*>} the promise of the api call
+ */
+exports.getCaseMessageInteractor = ({ applicationContext, messageId }) => {
+ return get({
+ applicationContext,
+ endpoint: `/messages/${messageId}`,
+ });
+};
diff --git a/shared/src/proxies/messages/getInboxCaseMessagesForSectionProxy.js b/shared/src/proxies/messages/getInboxCaseMessagesForSectionProxy.js
new file mode 100644
index 00000000000..04489ee0876
--- /dev/null
+++ b/shared/src/proxies/messages/getInboxCaseMessagesForSectionProxy.js
@@ -0,0 +1,19 @@
+const { get } = require('../requests');
+
+/**
+ * getInboxCaseMessagesForSectionInteractor
+ *
+ * @param {object} providers the providers object
+ * @param {object} providers.applicationContext the application context
+ * @param {string} providers.section the section
+ * @returns {Promise<*>} the promise of the api call
+ */
+exports.getInboxCaseMessagesForSectionInteractor = ({
+ applicationContext,
+ section,
+}) => {
+ return get({
+ applicationContext,
+ endpoint: `/messages/inbox/section/${section}`,
+ });
+};
diff --git a/shared/src/proxies/messages/getInboxCaseMessagesForUserProxy.js b/shared/src/proxies/messages/getInboxCaseMessagesForUserProxy.js
new file mode 100644
index 00000000000..4f0fcf02708
--- /dev/null
+++ b/shared/src/proxies/messages/getInboxCaseMessagesForUserProxy.js
@@ -0,0 +1,19 @@
+const { get } = require('../requests');
+
+/**
+ * getInboxCaseMessagesForUserInteractor
+ *
+ * @param {object} providers the providers object
+ * @param {object} providers.applicationContext the application context
+ * @param {string} providers.userId the user id
+ * @returns {Promise<*>} the promise of the api call
+ */
+exports.getInboxCaseMessagesForUserInteractor = ({
+ applicationContext,
+ userId,
+}) => {
+ return get({
+ applicationContext,
+ endpoint: `/messages/inbox/${userId}`,
+ });
+};
diff --git a/shared/src/proxies/messages/getOutboxCaseMessagesForSectionProxy.js b/shared/src/proxies/messages/getOutboxCaseMessagesForSectionProxy.js
new file mode 100644
index 00000000000..7573f7a4a9d
--- /dev/null
+++ b/shared/src/proxies/messages/getOutboxCaseMessagesForSectionProxy.js
@@ -0,0 +1,19 @@
+const { get } = require('../requests');
+
+/**
+ * getOutboxCaseMessagesForSectionInteractor
+ *
+ * @param {object} providers the providers object
+ * @param {object} providers.applicationContext the application context
+ * @param {string} providers.section the section
+ * @returns {Promise<*>} the promise of the api call
+ */
+exports.getOutboxCaseMessagesForSectionInteractor = ({
+ applicationContext,
+ section,
+}) => {
+ return get({
+ applicationContext,
+ endpoint: `/messages/outbox/section/${section}`,
+ });
+};
diff --git a/shared/src/proxies/messages/getOutboxCaseMessagesForUserProxy.js b/shared/src/proxies/messages/getOutboxCaseMessagesForUserProxy.js
new file mode 100644
index 00000000000..e75d75c47c3
--- /dev/null
+++ b/shared/src/proxies/messages/getOutboxCaseMessagesForUserProxy.js
@@ -0,0 +1,19 @@
+const { get } = require('../requests');
+
+/**
+ * getOutboxCaseMessagesForUserInteractor
+ *
+ * @param {object} providers the providers object
+ * @param {object} providers.applicationContext the application context
+ * @param {string} providers.userId the user id
+ * @returns {Promise<*>} the promise of the api call
+ */
+exports.getOutboxCaseMessagesForUserInteractor = ({
+ applicationContext,
+ userId,
+}) => {
+ return get({
+ applicationContext,
+ endpoint: `/messages/outbox/${userId}`,
+ });
+};
diff --git a/shared/src/proxies/public/getTodaysOpinionsProxy.js b/shared/src/proxies/public/getTodaysOpinionsProxy.js
new file mode 100644
index 00000000000..a7e769f5438
--- /dev/null
+++ b/shared/src/proxies/public/getTodaysOpinionsProxy.js
@@ -0,0 +1,15 @@
+const { get } = require('../requests');
+
+/**
+ * getTodaysOpinionsProxy
+ *
+ * @param {object} providers the providers object
+ * @param {object} providers.applicationContext the application context
+ * @returns {Promise<*>} the promise of the api call
+ */
+exports.getTodaysOpinionsInteractor = ({ applicationContext }) => {
+ return get({
+ applicationContext,
+ endpoint: '/public-api/todays-opinions',
+ });
+};
diff --git a/shared/src/test/mockCase.js b/shared/src/test/mockCase.js
index 9b089642b36..ad9a59e9f2c 100644
--- a/shared/src/test/mockCase.js
+++ b/shared/src/test/mockCase.js
@@ -16,6 +16,7 @@ exports.MOCK_CASE = {
title: 'Executor',
},
correspondence: [],
+ createdAt: '2018-03-01T21:40:46.415Z',
docketNumber: '101-18',
docketNumberWithSuffix: '101-18',
docketRecord: [
diff --git a/shared/src/tools/court-issued-event-codes.csv b/shared/src/tools/court-issued-event-codes.csv
index 6d121e572bf..83de0170276 100644
--- a/shared/src/tools/court-issued-event-codes.csv
+++ b/shared/src/tools/court-issued-event-codes.csv
@@ -1,17 +1,17 @@
-CODE,DOCKET ENTRY LANGUAGE,Display in Dropdown ,Nonstandard type ,What is this order for? ,Judge's name ,Date,Docket number(s),Trial location (dropdown) ,Concatenated Docket Entry ,Served Stamp
-O,ORDER *ANYTHING*,O - Order ,Type A ,[Anything],,,,,[Anything],Served OR Entered and Served
-OAJ,ORDER that case is assigned to *JUDGE* . *ANYTHING*,OAJ - Order that case is assigned ,Type B,[Anything],[Judge Name],,,,Order [Judge name] [Anything],Served
-OAL,"ORDER that the letter ""L"" is added to the Dkt. No. *ANYTHING*","OAL - Order that the letter ""L"" is added to Docket number ",Type C,,,,[Docket number],,"Order that the letter ""L"" is added to Docket number [Anything]",Served
-OAP,ORDER for Amended Petition on *DATE*. *ANY*,OAP - Order for Amended Petition ,Type D,[Anything],,[Date],,,Order for Amended Petition on [Date] [Anything],Served
-OAPF,ORDER for Amended Petition and Filing Fee on *DATE*. *ANY*,OAPF - Order for Amended Petition and Filing Fee ,Type D,[Anything],,[Date],,,Order for Amended Petition and Filing Fee on [Date] [Anything],Served
-OAR,"ORDER that the letter ""R"" is added to the Dkt. No. *ANYTHING*","OAR - Order that the letter ""R"" is added to the Docket number ",Type C,,,,[Docket number],,"Order that the letter ""R"" is added to the Docket number [Docket number]",Served
-OAS,"ORDER that the letter ""S"" is added to the Dkt. No. *ANYTHING*","OAS - Order that the letter ""S"" is added to the Docket number ",Type C,,,,[Docket number],,"Order that the letter ""S"" is added to the Docket number [Docket number]",Served
-OASL,"ORDER that the letters ""SL"" are added to the Dkt. No. *ANY*","OASL - Order that the letters ""SL"" are added to the Docket number ",Type C,,,,[Docket number],,"Order that the letters ""SL"" are added to the Docket number [Docket number]",Served
-OAW,"ORDER that the letter ""W"" is added to the Dkt. No. *ANYTHING*","OAW - Order that the letter ""W"" is added to the Docket number ",Type C,,,,[Docket number],,"Order that the letter ""W"" is added to the Docket number [Docket number]",Served
-OAX,"ORDER that the letter ""X"" is added to the Dkt. No. *ANYTHING*","OAX - Order that the letter ""X"" is added to the Docket number ",Type C,,,,[Docket number],,"Order that the letter ""X"" is added to the Docket number [Docket number]",Served
+CODE,DOCKET ENTRY LANGUAGE,Display in Dropdown ,Nonstandard type ,What is this order for? ,Judge's name ,Date,Docket number(s),Trial location (dropdown) ,Concatenated Docket Entry ,Served Stamp
+O,ORDER *ANYTHING*,O - Order ,Type A ,[Anything],,,,,[Anything],Served OR Entered and Served
+OAJ,ORDER that case is assigned to *JUDGE* . *ANYTHING*,OAJ - Order that case is assigned ,Type B,[Anything],[Judge Name],,,,Order [Judge name] [Anything],Served
+OAL,"ORDER that the letter ""L"" is added to the Dkt. No. *ANYTHING*","OAL - Order that the letter ""L"" is added to Docket number ",Type C,,,,[Docket number],,"Order that the letter ""L"" is added to Docket number [Anything]",Served
+OAP,ORDER for Amended Petition on *DATE*. *ANY*,OAP - Order for Amended Petition ,Type D,[Anything],,[Date],,,Order for Amended Petition on [Date] [Anything],Served
+OAPF,ORDER for Amended Petition and Filing Fee on *DATE*. *ANY*,OAPF - Order for Amended Petition and Filing Fee ,Type D,[Anything],,[Date],,,Order for Amended Petition and Filing Fee on [Date] [Anything],Served
+OAR,"ORDER that the letter ""R"" is added to the Dkt. No. *ANYTHING*","OAR - Order that the letter ""R"" is added to the Docket number ",Type C,,,,[Docket number],,"Order that the letter ""R"" is added to the Docket number [Docket number]",Served
+OAS,"ORDER that the letter ""S"" is added to the Dkt. No. *ANYTHING*","OAS - Order that the letter ""S"" is added to the Docket number ",Type C,,,,[Docket number],,"Order that the letter ""S"" is added to the Docket number [Docket number]",Served
+OASL,"ORDER that the letters ""SL"" are added to the Dkt. No. *ANY*","OASL - Order that the letters ""SL"" are added to the Docket number ",Type C,,,,[Docket number],,"Order that the letters ""SL"" are added to the Docket number [Docket number]",Served
+OAW,"ORDER that the letter ""W"" is added to the Dkt. No. *ANYTHING*","OAW - Order that the letter ""W"" is added to the Docket number ",Type C,,,,[Docket number],,"Order that the letter ""W"" is added to the Docket number [Docket number]",Served
+OAX,"ORDER that the letter ""X"" is added to the Dkt. No. *ANYTHING*","OAX - Order that the letter ""X"" is added to the Docket number ",Type C,,,,[Docket number],,"Order that the letter ""X"" is added to the Docket number [Docket number]",Served
OCA,ORDER that caption of case is amended. *ANYTHING*,OCA - Order that caption of case is amended ,Type A ,[Anything],,,,,Order that caption of case is amended [Anything],Served
-OD,"ORDER OF DISMISSAL Entered,, *JUDGE*. *ANYTHING*","OD - Order of Dismissal Entered, ",Type B,[Anything],[Judge name],,,,"Order of Dismissal Entered, [Judge Name] [Anything]",Entered and Served
-ODD,"ORDER OF DISMISSAL AND DECISION Entered,, *JUDGE*. *ANYTHING*","ODD - Order of Dismissal and Decision Entered, ",Type B,[Anything],[Judge name],,,,"Order of Dismissal and Decision Entered, [Judge Name] [Anything]",Entered and Served
+OD,"ORDER OF DISMISSAL Entered,, *JUDGE*. *ANYTHING*","OD - Order of Dismissal Entered",Type B,[Anything],[Judge name],,,,"Order of Dismissal Entered, [Judge Name] [Anything]",Entered and Served
+ODD,"ORDER OF DISMISSAL AND DECISION Entered,, *JUDGE*. *ANYTHING*","ODD - Order of Dismissal and Decision Entered, ",Type B,[Anything],[Judge name],,,,"Order of Dismissal and Decision Entered, [Judge Name] [Anything]",Entered and Served
ODL,"ORDER that the letter ""L"" is deleted from the Dkt. No. *ANY*","ODL - Order that the letter ""L"" is deleted from the Docket number ",Type C,,,,[Docket number],,"Order that the letter ""L"" is deleted from the Docket number [Docket number]",Served
ODP,"ORDER that the letter ""P"" is deleted from the Dkt. No. *ANYTHING*","ODP - Order that the letter ""P"" is deleted from the Docket number ",Type C,,,,[Docket number],,"Order that the letter ""P"" is deleted from the Docket number [Docket number]",Served
ODR,"ORDER that the letter ""R"" is deleted from the Dkt. No. *ANY*","ODR - Order that the letter ""R"" is deleted from the Docket number ",Type C,,,,[Docket number],,"Order that the letter ""R"" is deleted from the Docket number [Docket number]",Served
@@ -35,10 +35,10 @@ OSC,ORDER *ANYTHING*,OSC - Order ,Type A ,[Anything],,,,,Order [Anything],Served
OSCP,"ORDER petr(s) by *DATE* show cause why ""S"" should not be removed *ANYTHING*","OSCP - Order petr(s) to show cause why ""S"" should not be removed ",Type D,[Anything],,[Date],,,"OSCP - Order petr(s) by [Date] to show cause why ""S"" should not be removed [Anything]",Served
OST,ORDER of Service of Transcript (Bench Opinion) *ANYTHING*,OST - Order of Service of Transcript (Bench Opinion),Type A ,[Anything],,,,,Order of Service of Transcript (Bench Opinion) [Anything],Served
OSUB,ORDER that case is submitted to *JUDGE*. *ANYTHING*,OSUB - Order that case is submitted,Type B,[Anything],[Judge name],,,,Order that case is submitted to [Judge Name] [Anything],Served
-DEC,"DECISION Entered,, *JUDGE* *ANYTHING*","DEC - Decision Entered, ",Type B,[Anything],[Judge name],,,,"Decision Entered, [Judge Name] [Anything]",Entered and Served
-OAD,"ORDER AND DECISION Entered,, *ANY* *JUDGE*. *ANYTHING*","OAD - Order and Decision Entered,",Type B,[Anything],[Judge name],,,,"Order and Decision Entered, [Judge Name] [Anything]",Entered and Served
-ODJ,"ORDER OF DISMISSAL FOR LACK OF JURISDICTION Entered,, *JUDGE*. *ANYTHING*","ODJ - Order of Dismissal for Lack of Jurisdiction Entered,",Type B,[Anything],[Judge name],,,,"Order of Dismissal for Lack of Jurisdiction Entered, [Judge Name] [Anything]",Entered and Served
-SDEC,"STIPULATED DECISION Entered, *JUDGE*. *ANYTHING*","SDEC - Stipulated Decision Entered,",Type B,[Anything],[Judge name],,,,"Stipulated Decision Entered, [Judge Name] [Anything]",Entered and Served
+DEC,"DECISION Entered,, *JUDGE* *ANYTHING*","DEC - Decision Entered, ",Type B,[Anything],[Judge name],,,,"Decision Entered, [Judge Name] [Anything]",Entered and Served
+OAD,"ORDER AND DECISION Entered,, *ANY* *JUDGE*. *ANYTHING*","OAD - Order and Decision Entered,",Type B,[Anything],[Judge name],,,,"Order and Decision Entered, [Judge Name] [Anything]",Entered and Served
+ODJ,"ORDER OF DISMISSAL FOR LACK OF JURISDICTION Entered,, *JUDGE*. *ANYTHING*","ODJ - Order of Dismissal for Lack of Jurisdiction Entered,",Type B,[Anything],[Judge name],,,,"Order of Dismissal for Lack of Jurisdiction Entered, [Judge Name] [Anything]",Entered and Served
+SDEC,"STIPULATED DECISION Entered, *JUDGE*. *ANYTHING*","SDEC - Stipulated Decision Entered,",Type B,[Anything],[Judge name],,,,"Stipulated Decision Entered, [Judge Name] [Anything]",Entered and Served
MOP ,Memorandum Opinion [judge],MOP - Memorandum Opinion ,Type B,[Anything],[Judge name],,,,Memorandum Opinion [judge],
NOT ,Notice [Anything],NOT - Notice ,Type A ,[Anything],,,,,[Anything],
SOP ,Summary Opinion [judge],Summary Opinion ,Type B,[Anything],[Judge name],,,,Summary Opinion [judge],
@@ -54,4 +54,4 @@ TCOP ,T.C. Opinion [judge] [anything],TCOP - T.C. Opinion,Type B,[Anything],[Jud
RTRA ,Revised Transcript of [anything],RTRA - Revised Transcript ,Type A,[Anything],,,,,Revised Transcript of [anything],
TRAN,Transcript of [anything],TRAN - Transcript ,Type H,[Anything],,[Date],,,Transcript of [anything] on [date],
SPTO,Standing Pre-Trial Order ,SPTO - Standing Pre-Trial Order ,HOLD hold (dependent on if we get to automated logic) ,,,,,,Standing Pre-Trial Order ,
-MISC,,MISC - Miscellaneous ,Type A,[Anything],,,,,,
\ No newline at end of file
+MISC,,MISC - Miscellaneous ,Type A,[Anything],,,,,,
diff --git a/shared/src/tools/courtIssuedEventCodes.json b/shared/src/tools/courtIssuedEventCodes.json
index dd734654ffa..6d0f9f6f919 100644
--- a/shared/src/tools/courtIssuedEventCodes.json
+++ b/shared/src/tools/courtIssuedEventCodes.json
@@ -67,13 +67,13 @@
},
{
"eventCode": "OD",
- "documentType": "OD - Order of Dismissal Entered,",
+ "documentType": "OD - Order of Dismissal Entered",
"documentTitle": "Order of Dismissal Entered, [Judge Name] [Anything]",
"scenario": "Type B"
},
{
"eventCode": "ODD",
- "documentType": "ODD - Order of Dismissal and Decision Entered,",
+ "documentType": "ODD - Order of Dismissal and Decision Entered",
"documentTitle": "Order of Dismissal and Decision Entered, [Judge Name] [Anything]",
"scenario": "Type B"
},
diff --git a/shared/src/tools/generateMarkdownSchema.js b/shared/src/tools/generateMarkdownSchema.js
index 0591cf922a0..cbfb0ba69ff 100644
--- a/shared/src/tools/generateMarkdownSchema.js
+++ b/shared/src/tools/generateMarkdownSchema.js
@@ -48,20 +48,36 @@ const {
const {
getSurvivingSpouseContact,
} = require('../business/entities/contacts/SurvivingSpouseContact');
+const {
+ InitialWorkItemMessage,
+} = require('../business/entities/InitialWorkItemMessage');
+const {
+ OrderWithoutBody,
+} = require('../business/entities/orders/OrderWithoutBody');
const {
PrivatePractitioner,
} = require('../business/entities/PrivatePractitioner');
const { Batch } = require('../business/entities/Batch');
const { Case } = require('../business/entities/cases/Case');
const { CaseDeadline } = require('../business/entities/CaseDeadline');
+const { CaseMessage } = require('../business/entities/CaseMessage');
const { Correspondence } = require('../business/entities/Correspondence');
const { DocketRecord } = require('../business/entities/DocketRecord');
const { Document } = require('../business/entities/Document');
const { ForwardMessage } = require('../business/entities/ForwardMessage');
+const { IrsPractitioner } = require('../business/entities/IrsPractitioner');
+const { Message } = require('../business/entities/Message');
+const { NewCaseMessage } = require('../business/entities/NewCaseMessage');
+const { NewPractitioner } = require('../business/entities/NewPractitioner');
+const { Note } = require('../business/entities/notes/Note');
+const { Order } = require('../business/entities/orders/Order');
const { Practitioner } = require('../business/entities/Practitioner');
const { PublicUser } = require('../business/entities/PublicUser');
+const { Scan } = require('../business/entities/Scan');
const { Statistic } = require('../business/entities/Statistic');
const { User } = require('../business/entities/User');
+const { UserCase } = require('../business/entities/UserCase');
+const { UserCaseNote } = require('../business/entities/notes/UserCaseNote');
const { WorkItem } = require('../business/entities/WorkItem');
const generateMarkdownSchema = (entity, entityName) => {
@@ -204,13 +220,25 @@ generateMarkdownSchema(
generateMarkdownSchema(Batch, 'Batch');
generateMarkdownSchema(Case, 'Case');
generateMarkdownSchema(CaseDeadline, 'CaseDeadline');
+generateMarkdownSchema(CaseMessage, 'CaseMessage');
generateMarkdownSchema(Correspondence, 'Correspondence');
generateMarkdownSchema(DocketRecord, 'DocketRecord');
generateMarkdownSchema(Document, 'Document');
generateMarkdownSchema(ForwardMessage, 'ForwardMessage');
+generateMarkdownSchema(InitialWorkItemMessage, 'InitialWorkItemMessage');
+generateMarkdownSchema(IrsPractitioner, 'IrsPractitioner');
+generateMarkdownSchema(Message, 'Message');
+generateMarkdownSchema(NewCaseMessage, 'NewCaseMessage');
+generateMarkdownSchema(NewPractitioner, 'NewPractitioner');
+generateMarkdownSchema(Note, 'Note');
+generateMarkdownSchema(Order, 'Order');
+generateMarkdownSchema(OrderWithoutBody, 'OrderWithoutBody');
generateMarkdownSchema(Practitioner, 'Practitioner');
generateMarkdownSchema(PrivatePractitioner, 'PrivatePractitioner');
generateMarkdownSchema(PublicUser, 'PublicUser');
+generateMarkdownSchema(Scan, 'Scan');
generateMarkdownSchema(Statistic, 'Statistic');
generateMarkdownSchema(User, 'User');
+generateMarkdownSchema(UserCase, 'UserCase');
+generateMarkdownSchema(UserCaseNote, 'UserCaseNote');
generateMarkdownSchema(WorkItem, 'WorkItem');
diff --git a/shared/src/tools/validateUser.js b/shared/src/tools/validateUser.js
new file mode 100644
index 00000000000..cfaf84d1961
--- /dev/null
+++ b/shared/src/tools/validateUser.js
@@ -0,0 +1,30 @@
+const { getUniqueId } = require('../sharedAppContext');
+const { User } = require('../business/entities/User');
+
+const [
+ email,
+ role,
+ section,
+ name,
+ judgeFullName,
+ judgeTitle,
+] = process.argv.slice(2);
+
+const user = new User({
+ email,
+ judgeFullName,
+ judgeTitle,
+ name,
+ role,
+ section,
+ userId: getUniqueId(),
+});
+
+if (!user.isValid()) {
+ console.error(
+ 'Validation errors: ',
+ user.getValidationErrors(),
+ JSON.stringify(user.toRawObject(), null, 2),
+ );
+ process.exit(1);
+}
diff --git a/shared/src/utilities/JoiValidationDecorator.js b/shared/src/utilities/JoiValidationDecorator.js
index 72e567494a3..4af129ffb1b 100644
--- a/shared/src/utilities/JoiValidationDecorator.js
+++ b/shared/src/utilities/JoiValidationDecorator.js
@@ -1,4 +1,5 @@
const joi = require('@hapi/joi');
+const { InvalidEntityError } = require('../errors/errors');
const { isEmpty } = require('lodash');
/**
@@ -67,7 +68,7 @@ function getFormattedValidationErrors(entity) {
const keys = Object.keys(entity);
const obj = {};
let errors = null;
- if (entity && entity.getFormattedValidationErrors) {
+ if (entity.getFormattedValidationErrors) {
errors = getFormattedValidationErrorsHelper(entity);
}
if (errors) {
@@ -133,12 +134,14 @@ exports.joiValidationDecorator = function (
entityConstructor.prototype.validate = function validate() {
if (!this.isValid()) {
- throw new Error(
- `The ${
- entityConstructor.validationName || ''
- } entity was invalid ${JSON.stringify(
- this.getFormattedValidationErrors(),
- )}`,
+ const ids = Object.entries(this)
+ .filter(([key, value]) => value && key.endsWith('Id'))
+ .map(([key, value]) => `${key}: "${value}"`)
+ .join('; ');
+ throw new InvalidEntityError(
+ JSON.stringify(this.getFormattedValidationErrors()),
+ entityConstructor.validationName,
+ ids,
);
}
return this;
diff --git a/shared/src/utilities/getAllEventCodes.js b/shared/src/utilities/getAllEventCodes.js
index f47fa701080..3f203a21e67 100644
--- a/shared/src/utilities/getAllEventCodes.js
+++ b/shared/src/utilities/getAllEventCodes.js
@@ -1,7 +1,7 @@
const courtIssuedEventCodes = require('../tools/courtIssuedEventCodes.json');
const documentMapExternal = require('../tools/externalFilingEvents.json');
const documentMapInternal = require('../tools/internalFilingEvents.json');
-const { Document } = require('../business/entities/Document');
+const { EVENT_CODES } = require('../business/entities/EntityConstants');
const eventCodes = [];
for (const category in documentMapExternal) {
@@ -18,9 +18,7 @@ for (const document of courtIssuedEventCodes) {
eventCodes.push(document.eventCode);
}
-const results = Array.from(
- new Set(eventCodes.concat(Document.eventCodes)),
-).sort();
+const results = Array.from(new Set(eventCodes.concat(EVENT_CODES))).sort();
exports.getAllEventCodes = () => {
return results;
diff --git a/web-api/config/custom.yml b/web-api/config/custom.yml
index 0fb984433e6..56562260fc5 100644
--- a/web-api/config/custom.yml
+++ b/web-api/config/custom.yml
@@ -225,6 +225,15 @@ practitioners:
<<: *customDomainDefault
basePath: 'practitioners'
+messages:
+ <<: *customDefault
+ serverless-offline:
+ <<: *serverless-offline-default
+ port: 3018
+ customDomain:
+ <<: *customDomainDefault
+ basePath: 'messages'
+
migrate:
<<: *customDefault
serverless-offline:
diff --git a/web-api/config/environment-variables.yml b/web-api/config/environment-variables.yml
index e210eba55d1..f1d72ac40ea 100644
--- a/web-api/config/environment-variables.yml
+++ b/web-api/config/environment-variables.yml
@@ -7,6 +7,7 @@ ELASTICSEARCH_ENDPOINT: ${self:custom.vars.elasticsearchEndpoint, self:provider.
MASTER_REGION: ${self:provider.masterRegion}
STAGE: ${self:custom.stage}
USER_POOL_ID: ${opt:userPoolId, self:provider.userPoolId}
+USER_POOL_IRS_ID: ${opt:userPoolIrsId, self.provider.userPoolIrsId}
NODE_ENV: ${self:custom.vars.nodeEnv}
EMAIL_SOURCE: noreply@mail.efcms-${opt:stage}.${opt:domain}
EMAIL_DOCUMENT_SERVED_TEMPLATE: document_served_${opt:stage}
diff --git a/web-api/elasticsearch/elasticsearch-indexes.js b/web-api/elasticsearch/elasticsearch-indexes.js
index fc089f05dd5..b2e92767bc2 100644
--- a/web-api/elasticsearch/elasticsearch-indexes.js
+++ b/web-api/elasticsearch/elasticsearch-indexes.js
@@ -1 +1,7 @@
-exports.elasticsearchIndexes = ['efcms-case', 'efcms-document', 'efcms-user'];
+exports.elasticsearchIndexes = [
+ 'efcms-case',
+ 'efcms-document',
+ 'efcms-user',
+ 'efcms-message',
+ 'efcms-user-case',
+];
diff --git a/web-api/migrations/00001-statistics.js b/web-api/migrations/00001-statistics.js
index 2f4c27624e3..fbabf8014c5 100644
--- a/web-api/migrations/00001-statistics.js
+++ b/web-api/migrations/00001-statistics.js
@@ -1,4 +1,7 @@
const createApplicationContext = require('../src/applicationContext');
+const {
+ CASE_TYPES_MAP,
+} = require('../../shared/src/business/entities/EntityConstants');
const { Case } = require('../../shared/src/business/entities/cases/Case');
const { isCaseRecord, upGenerator } = require('./utilities');
const { Statistic } = require('../../shared/src/business/entities/Statistic');
@@ -7,7 +10,7 @@ const applicationContext = createApplicationContext({});
const mutateRecord = item => {
if (
isCaseRecord(item) &&
- item.caseType === Case.CASE_TYPES_MAP.deficiency &&
+ item.caseType === CASE_TYPES_MAP.deficiency &&
item.hasVerifiedIrsNotice === true
) {
let { statistics } = item;
diff --git a/web-api/migrations/00001-statistics.test.js b/web-api/migrations/00001-statistics.test.js
index e1627da106b..22580394ff0 100644
--- a/web-api/migrations/00001-statistics.test.js
+++ b/web-api/migrations/00001-statistics.test.js
@@ -1,4 +1,6 @@
-const { Case } = require('../../shared/src/business/entities/cases/Case');
+const {
+ CASE_TYPES_MAP,
+} = require('../../shared/src/business/entities/EntityConstants');
const { forAllRecords } = require('./utilities');
const { MOCK_CASE } = require('../../shared/src/test/mockCase');
const { up } = require('./00001-statistics');
@@ -54,7 +56,7 @@ describe('case statistics migration', () => {
Items: [
{
...mockCaseWithKeys,
- caseType: Case.CASE_TYPES_MAP.cdp,
+ caseType: CASE_TYPES_MAP.cdp,
},
],
}),
@@ -71,7 +73,7 @@ describe('case statistics migration', () => {
Items: [
{
...mockCaseWithKeys,
- caseType: Case.CASE_TYPES_MAP.deficiency,
+ caseType: CASE_TYPES_MAP.deficiency,
hasVerifiedIrsNotice: false,
},
],
@@ -89,7 +91,7 @@ describe('case statistics migration', () => {
Items: [
{
...mockCaseWithKeys,
- caseType: Case.CASE_TYPES_MAP.deficiency,
+ caseType: CASE_TYPES_MAP.deficiency,
hasVerifiedIrsNotice: true,
},
],
@@ -117,7 +119,7 @@ describe('case statistics migration', () => {
Items: [
{
...mockCaseWithKeys,
- caseType: Case.CASE_TYPES_MAP.deficiency,
+ caseType: CASE_TYPES_MAP.deficiency,
hasVerifiedIrsNotice: true,
statistics: [],
},
@@ -146,7 +148,7 @@ describe('case statistics migration', () => {
Items: [
{
...mockCaseWithKeys,
- caseType: Case.CASE_TYPES_MAP.deficiency,
+ caseType: CASE_TYPES_MAP.deficiency,
hasVerifiedIrsNotice: true,
statistics: [
{
@@ -182,7 +184,7 @@ describe('case statistics migration', () => {
Items: [
{
...mockCaseWithKeys,
- caseType: Case.CASE_TYPES_MAP.deficiency,
+ caseType: CASE_TYPES_MAP.deficiency,
hasVerifiedIrsNotice: true,
statistics: [
{
diff --git a/web-api/migrations/00002-invalid-statistics.js b/web-api/migrations/00002-invalid-statistics.js
new file mode 100644
index 00000000000..8bd6d1165fb
--- /dev/null
+++ b/web-api/migrations/00002-invalid-statistics.js
@@ -0,0 +1,33 @@
+const createApplicationContext = require('../src/applicationContext');
+const {
+ CASE_TYPES_MAP,
+} = require('../../shared/src/business/entities/EntityConstants');
+const { Case } = require('../../shared/src/business/entities/cases/Case');
+const { isCaseRecord, upGenerator } = require('./utilities');
+const applicationContext = createApplicationContext({});
+
+const mutateRecord = item => {
+ let { statistics } = item;
+
+ if (
+ isCaseRecord(item) &&
+ (item.caseType !== CASE_TYPES_MAP.deficiency ||
+ item.hasVerifiedIrsNotice !== true) &&
+ statistics &&
+ statistics.length
+ ) {
+ const caseEntity = new Case(
+ {
+ ...item,
+ statistics: [],
+ },
+ { applicationContext },
+ )
+ .validate()
+ .toRawObject();
+
+ return { ...item, ...caseEntity };
+ }
+};
+
+module.exports = { mutateRecord, up: upGenerator(mutateRecord) };
diff --git a/web-api/migrations/00002-invalid-statistics.test.js b/web-api/migrations/00002-invalid-statistics.test.js
new file mode 100644
index 00000000000..d38aeae35a2
--- /dev/null
+++ b/web-api/migrations/00002-invalid-statistics.test.js
@@ -0,0 +1,158 @@
+const {
+ CASE_TYPES_MAP,
+} = require('../../shared/src/business/entities/EntityConstants');
+const { forAllRecords } = require('./utilities');
+const { MOCK_CASE } = require('../../shared/src/test/mockCase');
+const { up } = require('./00002-invalid-statistics');
+
+describe('invalid statistics migration', () => {
+ let applicationContext;
+ let scanStub;
+ let putStub;
+
+ const mockCaseWithKeys = {
+ ...MOCK_CASE,
+ pk: `case|${MOCK_CASE.caseId}`,
+ sk: `case|${MOCK_CASE.caseId}`,
+ };
+
+ beforeEach(() => {
+ scanStub = jest.fn().mockReturnValue({
+ promise: async () => ({
+ Items: [mockCaseWithKeys],
+ }),
+ });
+
+ putStub = jest.fn().mockReturnValue({
+ promise: async () => ({}),
+ });
+
+ applicationContext = {
+ environment: {
+ stage: 'dev',
+ },
+ getDocumentClient: () => ({
+ put: putStub,
+ scan: scanStub,
+ }),
+ };
+ });
+
+ it('should wipe out any existing statistics if hasVerifiedIrsNotice is false', async () => {
+ scanStub = jest.fn().mockReturnValue({
+ promise: async () => ({
+ Items: [
+ {
+ ...mockCaseWithKeys,
+ caseType: CASE_TYPES_MAP.deficiency,
+ hasVerifiedIrsNotice: false,
+ statistics: [
+ {
+ irsDeficiencyAmount: 1,
+ irsTotalPenalties: 1,
+ year: '2012',
+ yearOrPeriod: 'Year',
+ },
+ ],
+ },
+ ],
+ }),
+ });
+
+ await up(applicationContext.getDocumentClient(), '', forAllRecords);
+
+ expect(putStub.mock.calls.length).toBe(1);
+ expect(putStub.mock.calls[0][0].Item).toMatchObject({
+ statistics: [],
+ });
+ });
+
+ it('should wipe out any existing statistics if case is not a deficiency', async () => {
+ scanStub = jest.fn().mockReturnValue({
+ promise: async () => ({
+ Items: [
+ {
+ ...mockCaseWithKeys,
+ caseType: CASE_TYPES_MAP.cdp,
+ hasVerifiedIrsNotice: true,
+ statistics: [
+ {
+ irsDeficiencyAmount: 1,
+ irsTotalPenalties: 1,
+ year: '2012',
+ yearOrPeriod: 'Year',
+ },
+ ],
+ },
+ ],
+ }),
+ });
+
+ await up(applicationContext.getDocumentClient(), '', forAllRecords);
+
+ expect(putStub.mock.calls.length).toBe(1);
+ expect(putStub.mock.calls[0][0].Item).toMatchObject({
+ statistics: [],
+ });
+ });
+
+ it('should not wipe out any existing statistics if case is not a deficiency and has no statistics', async () => {
+ scanStub = jest.fn().mockReturnValue({
+ promise: async () => ({
+ Items: [
+ {
+ ...mockCaseWithKeys,
+ caseType: CASE_TYPES_MAP.cdp,
+ hasVerifiedIrsNotice: true,
+ statistics: [],
+ },
+ ],
+ }),
+ });
+
+ await up(applicationContext.getDocumentClient(), '', forAllRecords);
+
+ expect(putStub.mock.calls.length).toBe(0);
+ });
+
+ it('should wipe out any existing statistics if case is not a deficiency, has no verified irs notice, and has no statistics', async () => {
+ scanStub = jest.fn().mockReturnValue({
+ promise: async () => ({
+ Items: [
+ {
+ ...mockCaseWithKeys,
+ caseType: CASE_TYPES_MAP.cdp,
+ hasVerifiedIrsNotice: false,
+ statistics: [{ yearOrPeriod: 'Year' }],
+ },
+ ],
+ }),
+ });
+
+ await up(applicationContext.getDocumentClient(), '', forAllRecords);
+
+ expect(putStub.mock.calls.length).toBe(1);
+ expect(putStub.mock.calls[0][0].Item).toMatchObject({
+ statistics: [],
+ });
+ });
+
+ it('should not wipe out any existing statistics if deficiency case hasVerifiedIrsNotice is false and has no statistics', async () => {
+ scanStub = jest.fn().mockReturnValue({
+ promise: async () => ({
+ Items: [
+ {
+ ...mockCaseWithKeys,
+ caseType: CASE_TYPES_MAP.deficiency,
+ hasVerifiedIrsNotice: false,
+ statistics: [],
+ },
+ ],
+ }),
+ });
+
+ await up(applicationContext.getDocumentClient(), '', forAllRecords);
+
+ expect(putStub.mock.calls.length).toBe(0);
+ });
+});
diff --git a/web-api/migrations/00003-user-case-mapping.js b/web-api/migrations/00003-user-case-mapping.js
new file mode 100644
index 00000000000..bde3f73cbb8
--- /dev/null
+++ b/web-api/migrations/00003-user-case-mapping.js
@@ -0,0 +1,43 @@
+const createApplicationContext = require('../src/applicationContext');
+const {
+ isNewUserCaseMappingRecord,
+ isUserCaseMappingRecord,
+ upGenerator,
+} = require('./utilities');
+const { Case } = require('../../shared/src/business/entities/cases/Case');
+const { UserCase } = require('../../shared/src/business/entities/UserCase');
+const applicationContext = createApplicationContext({});
+
+const mutateRecord = async (item, documentClient, tableName) => {
+ const caseId = item.sk.split('|')[1];
+
+ if (isUserCaseMappingRecord(item) && !isNewUserCaseMappingRecord(item)) {
+ const mappedCase = await documentClient
+ .get({
+ Key: {
+ pk: `case|${caseId}`,
+ sk: `case|${caseId}`,
+ },
+ TableName: tableName,
+ })
+ .promise();
+
+ if (mappedCase.Item) {
+ const caseEntity = new Case(mappedCase.Item, { applicationContext });
+ const userCaseEntity = new UserCase(caseEntity.validate().toRawObject(), {
+ applicationContext,
+ })
+ .validate()
+ .toRawObject();
+
+ return {
+ ...item,
+ ...userCaseEntity,
+ entityName: 'UserCase',
+ gsi1pk: `user-case|${caseId}`,
+ };
+ }
+ }
+};
+
+module.exports = { mutateRecord, up: upGenerator(mutateRecord) };
diff --git a/web-api/migrations/00003-user-case-mapping.test.js b/web-api/migrations/00003-user-case-mapping.test.js
new file mode 100644
index 00000000000..8ba137565df
--- /dev/null
+++ b/web-api/migrations/00003-user-case-mapping.test.js
@@ -0,0 +1,85 @@
+const { forAllRecords } = require('./utilities');
+const { MOCK_CASE } = require('../../shared/src/test/mockCase');
+const { up } = require('./00003-user-case-mapping');
+const { UserCase } = require('../../shared/src/business/entities/UserCase');
+
+describe('user case mapping migration', () => {
+ let documentClient;
+ let scanStub;
+ let putStub;
+ let getStub;
+
+ const mockUserCaseItem = {
+ pk: 'user|6805d1ab-18d0-43ec-bafb-654e83405416',
+ sk: `case|${MOCK_CASE.caseId}`,
+ };
+
+ const mockUserCaseEntity = new UserCase(MOCK_CASE).validate().toRawObject();
+
+ const mockNewUserCaseItem = {
+ gsi1pk: `user-case|${MOCK_CASE.caseId}`,
+ pk: 'user|6805d1ab-18d0-43ec-bafb-654e83405416',
+ sk: `case|${MOCK_CASE.caseId}`,
+ ...mockUserCaseEntity,
+ };
+
+ const mockCaseWithKeys = {
+ ...MOCK_CASE,
+ pk: `case|${MOCK_CASE.caseId}`,
+ sk: `case|${MOCK_CASE.caseId}`,
+ };
+
+ beforeEach(() => {
+ scanStub = jest.fn().mockReturnValue({
+ promise: async () => ({
+ Items: [mockUserCaseItem],
+ }),
+ });
+
+ putStub = jest.fn().mockReturnValue({
+ promise: async () => ({}),
+ });
+
+ getStub = jest.fn().mockReturnValue({
+ promise: async () => ({
+ Item: mockCaseWithKeys,
+ }),
+ });
+
+ documentClient = {
+ get: getStub,
+ put: putStub,
+ scan: scanStub,
+ };
+ });
+
+ it('should not update the item when it is not a user-case record', async () => {
+ documentClient.scan = jest.fn().mockReturnValue({
+ promise: async () => ({
+ Items: [mockCaseWithKeys],
+ }),
+ });
+
+ await up(documentClient, '', forAllRecords);
+
+ expect(putStub).not.toHaveBeenCalled();
+ });
+
+ it('should not update the item when its a new user-case record', async () => {
+ documentClient.scan = jest.fn().mockReturnValue({
+ promise: async () => ({
+ Items: [mockNewUserCaseItem],
+ }),
+ });
+
+ await up(documentClient, '', forAllRecords);
+
+ expect(putStub).not.toHaveBeenCalled();
+ });
+
+ it('should update the item', async () => {
+ await up(documentClient, '', forAllRecords);
+
+ expect(putStub.mock.calls.length).toBe(1);
+ });
+});
diff --git a/web-api/migrations/00004-user-case-status.js b/web-api/migrations/00004-user-case-status.js
new file mode 100644
index 00000000000..896130d7c5d
--- /dev/null
+++ b/web-api/migrations/00004-user-case-status.js
@@ -0,0 +1,36 @@
+const createApplicationContext = require('../src/applicationContext');
+const { Case } = require('../../shared/src/business/entities/cases/Case');
+const { isUserCaseMappingRecord, upGenerator } = require('./utilities');
+const { UserCase } = require('../../shared/src/business/entities/UserCase');
+const applicationContext = createApplicationContext({});
+
+const mutateRecord = async (item, documentClient, tableName) => {
+ if (isUserCaseMappingRecord(item) && !item.status) {
+ const caseId = item.sk.split('|')[1];
+ const mappedCase = await documentClient
+ .get({
+ Key: {
+ pk: `case|${caseId}`,
+ sk: `case|${caseId}`,
+ },
+ TableName: tableName,
+ })
+ .promise();
+
+ if (mappedCase.Item) {
+ const caseEntity = new Case(mappedCase.Item, { applicationContext });
+ const userCaseEntity = new UserCase(caseEntity.validate().toRawObject(), {
+ applicationContext,
+ })
+ .validate()
+ .toRawObject();
+
+ return {
+ ...item,
+ ...userCaseEntity,
+ };
+ }
+ }
+};
+
+module.exports = { mutateRecord, up: upGenerator(mutateRecord) };
diff --git a/web-api/migrations/00004-user-case-status.test.js b/web-api/migrations/00004-user-case-status.test.js
new file mode 100644
index 00000000000..62c0151de70
--- /dev/null
+++ b/web-api/migrations/00004-user-case-status.test.js
@@ -0,0 +1,93 @@
+const {
+ CASE_STATUS_TYPES,
+} = require('../../shared/src/business/entities/EntityConstants');
+const { forAllRecords } = require('./utilities');
+const { MOCK_CASE } = require('../../shared/src/test/mockCase');
+const { up } = require('./00004-user-case-status');
+const { UserCase } = require('../../shared/src/business/entities/UserCase');
+
+describe('user case mapping migration', () => {
+ let documentClient;
+ let scanStub;
+ let putStub;
+ let getStub;
+
+ const mockUserCaseItem = {
+ pk: 'user|6805d1ab-18d0-43ec-bafb-654e83405416',
+ sk: `case|${MOCK_CASE.caseId}`,
+ };
+
+ const mockUserCaseEntity = new UserCase(MOCK_CASE).validate().toRawObject();
+
+ const mockNewUserCaseItem = {
+ gsi1pk: `user-case|${MOCK_CASE.caseId}`,
+ pk: 'user|6805d1ab-18d0-43ec-bafb-654e83405416',
+ sk: `case|${MOCK_CASE.caseId}`,
+ ...mockUserCaseEntity,
+ };
+
+ const mockCaseWithKeys = {
+ ...MOCK_CASE,
+ pk: `case|${MOCK_CASE.caseId}`,
+ sk: `case|${MOCK_CASE.caseId}`,
+ };
+
+ beforeEach(() => {
+ scanStub = jest.fn().mockReturnValue({
+ promise: async () => ({
+ Items: [mockUserCaseItem],
+ }),
+ });
+
+ putStub = jest.fn().mockReturnValue({
+ promise: async () => ({}),
+ });
+
+ getStub = jest.fn().mockReturnValue({
+ promise: async () => ({
+ Item: mockCaseWithKeys,
+ }),
+ });
+
+ documentClient = {
+ get: getStub,
+ put: putStub,
+ scan: scanStub,
+ };
+ });
+
+ it('should not update the item when it is not a user-case record', async () => {
+ documentClient.scan = jest.fn().mockReturnValue({
+ promise: async () => ({
+ Items: [mockCaseWithKeys],
+ }),
+ });
+
+ await up(documentClient, '', forAllRecords);
+
+ expect(putStub).not.toHaveBeenCalled();
+ });
+
+ it('should not update the item when it has a status', async () => {
+ documentClient.scan = jest.fn().mockReturnValue({
+ promise: async () => ({
+ Items: [
+ {
+ ...mockNewUserCaseItem,
+ status: CASE_STATUS_TYPES.closed,
+ },
+ ],
+ }),
+ });
+
+ await up(documentClient, '', forAllRecords);
+
+ expect(putStub).not.toHaveBeenCalled();
+ });
+
+ it('should update the item', async () => {
+ await up(documentClient, '', forAllRecords);
+
+ expect(putStub.mock.calls.length).toBe(1);
+ });
+});
diff --git a/web-api/migrations/utilities.js b/web-api/migrations/utilities.js
index deb8588d25b..f05d05210f0 100644
--- a/web-api/migrations/utilities.js
+++ b/web-api/migrations/utilities.js
@@ -1,6 +1,10 @@
const isCaseRecord = item => !!item.caseType;
const isTrialSessionRecord = item =>
!!item.caseOrder && !!item.trialSessionId && !!item.maxCases;
+const isUserCaseMappingRecord = item =>
+ item.pk.startsWith('user|') && item.sk.startsWith('case|');
+const isNewUserCaseMappingRecord = item =>
+ !!item.gsi1pk && item.gsi1pk.startsWith('user-case|');
const forAllRecords = async (documentClient, tableName, cb) => {
let hasMoreResults = true;
@@ -48,6 +52,8 @@ const upGenerator = mutateFunction => async (
module.exports = {
forAllRecords,
isCaseRecord,
+ isNewUserCaseMappingRecord,
isTrialSessionRecord,
+ isUserCaseMappingRecord,
upGenerator,
};
diff --git a/web-api/migrations/utilities.test.js b/web-api/migrations/utilities.test.js
index f1988aab729..6bac7f70c9e 100644
--- a/web-api/migrations/utilities.test.js
+++ b/web-api/migrations/utilities.test.js
@@ -1,16 +1,20 @@
+const {
+ CASE_TYPES_MAP,
+} = require('../../shared/src/business/entities/EntityConstants');
const {
forAllRecords,
isCaseRecord,
+ isNewUserCaseMappingRecord,
isTrialSessionRecord,
+ isUserCaseMappingRecord,
upGenerator,
} = require('./utilities');
-const { Case } = require('../../shared/src/business/entities/cases/Case');
describe('utilities', () => {
describe('isCaseRecord', () => {
it('should return true if the item is a case record', () => {
const result = isCaseRecord({
- caseType: Case.CASE_TYPES_MAP.cdp,
+ caseType: CASE_TYPES_MAP.cdp,
});
expect(result).toEqual(true);
@@ -38,11 +42,63 @@ describe('utilities', () => {
it('should return false if the item is not a trial session record', () => {
const result = isTrialSessionRecord({
- caseType: Case.CASE_TYPES_MAP.cdp,
+ caseType: CASE_TYPES_MAP.cdp,
+ });
+
+ expect(result).toEqual(false);
+ });
+ });
+
+ describe('isUserCaseMappingRecord', () => {
+ it('should return true if the item is a user case mapping record', () => {
+ const result = isUserCaseMappingRecord({
+ pk: 'user|',
+ sk: 'case|',
+ });
+
+ expect(result).toEqual(true);
+ });
+
+ it('should return false if the item is not a user case mapping record (pk,sk = case|)', () => {
+ const result = isUserCaseMappingRecord({
+ pk: 'case|',
+ sk: 'case|',
});
expect(result).toEqual(false);
});
+
+ it('should return false if the item is not a user case mapping record (pk,sk = user|)', () => {
+ const result = isUserCaseMappingRecord({
+ pk: 'user|',
+ sk: 'user|',
+ });
+ expect(result).toEqual(false);
+ });
+ });
+
+ describe('isNewUserCaseMappingRecord', () => {
+ it('should return true if the record is a new user-case mapping record', () => {
+ const result = isNewUserCaseMappingRecord({
+ gsi1pk: 'user-case|',
+ });
+
+ expect(result).toEqual(true);
+ });
+
+ it('should return false if the record is not a new user-case mapping record', () => {
+ const result = isNewUserCaseMappingRecord({
+ gsi1pk: 'case|',
+ });
+
+ expect(result).toEqual(false);
+ });
+
+ it('should return false if the record is not a new user-case mapping record (no gsi1pk)', () => {
+ const result = isNewUserCaseMappingRecord({});
+
+ expect(result).toEqual(false);
+ });
});
describe('forAllRecords', () => {
@@ -54,11 +110,11 @@ describe('utilities', () => {
scannedItems = [
{
caseId: 'case-123',
- caseType: Case.CASE_TYPES_MAP.cdp,
+ caseType: CASE_TYPES_MAP.cdp,
},
{
caseId: 'case-321',
- caseType: Case.CASE_TYPES_MAP.deficiency,
+ caseType: CASE_TYPES_MAP.deficiency,
},
];
@@ -94,11 +150,11 @@ describe('utilities', () => {
scannedItems = [
{
caseId: 'case-123',
- caseType: Case.CASE_TYPES_MAP.cdp,
+ caseType: CASE_TYPES_MAP.cdp,
},
{
caseId: 'case-321',
- caseType: Case.CASE_TYPES_MAP.deficiency,
+ caseType: CASE_TYPES_MAP.deficiency,
},
];
diff --git a/web-api/proxy.js b/web-api/proxy.js
index 68f18ca6c27..3e32a60293d 100644
--- a/web-api/proxy.js
+++ b/web-api/proxy.js
@@ -20,6 +20,7 @@ const PROXY_DESTINATIONS = {
'/case-parties': `http://${PROXY_HOST}:3014`,
'/cases': `http://${PROXY_HOST}:3002`,
'/documents': `http://${PROXY_HOST}:3004`,
+ '/messages': `http://${PROXY_HOST}:3018`,
'/migrate': `http://${PROXY_HOST}:3030`,
'/notifications': `http://${PROXY_HOST}:3011`,
'/practitioners': `http://${PROXY_HOST}:3017`,
diff --git a/web-api/run-serverless-messages.sh b/web-api/run-serverless-messages.sh
new file mode 100755
index 00000000000..013aac73d54
--- /dev/null
+++ b/web-api/run-serverless-messages.sh
@@ -0,0 +1,3 @@
+#!/bin/bash -e
+
+./web-api/run-serverless.sh "${1}" "${2}" "messagesHandlers.js" "serverless-messages.yml" "build:api:messages"
diff --git a/web-api/seed-elasticsearch.sh b/web-api/seed-elasticsearch.sh
index 5ba100d01ac..b7eaa5796f3 100755
--- a/web-api/seed-elasticsearch.sh
+++ b/web-api/seed-elasticsearch.sh
@@ -3,4 +3,6 @@
curl -X DELETE "localhost:9200/efcms-case"
curl -X DELETE "localhost:9200/efcms-document"
curl -X DELETE "localhost:9200/efcms-user"
+curl -X DELETE "localhost:9200/efcms-message"
+curl -X DELETE "localhost:9200/efcms-user-case"
ELASTICSEARCH_PORT=9200 ELASTICSEARCH_PROTOCOL="http" node ./web-api/elasticsearch/elasticsearch-index-settings.js
diff --git a/web-api/serverless-cases.yml b/web-api/serverless-cases.yml
index 78200ae4d97..564c939e108 100644
--- a/web-api/serverless-cases.yml
+++ b/web-api/serverless-cases.yml
@@ -111,11 +111,22 @@ functions:
arn: arn:aws:lambda:${opt:region}:${opt:accountId}:function:cognito_authorizer_lambda_${opt:stage}
managedExternally: true
- getOpenCases:
- handler: web-api/${self:provider.dir}/casesHandlers.getOpenCasesLambda
+ getOpenConsolidatedCases:
+ handler: web-api/${self:provider.dir}/casesHandlers.getOpenConsolidatedCasesLambda
events:
- http:
- path: /open-cases
+ path: /open
+ method: get
+ cors: ui-${self:provider.stage}.ef-cms.${opt:domain}
+ authorizer:
+ arn: arn:aws:lambda:${opt:region}:${opt:accountId}:function:cognito_authorizer_lambda_${opt:stage}
+ managedExternally: true
+
+ getClosedCases:
+ handler: web-api/${self:provider.dir}/casesHandlers.getClosedCasesLambda
+ events:
+ - http:
+ path: /closed
method: get
cors: ui-${self:provider.stage}.ef-cms.${opt:domain}
authorizer:
diff --git a/web-api/serverless-messages.yml b/web-api/serverless-messages.yml
new file mode 100644
index 00000000000..69d4d746610
--- /dev/null
+++ b/web-api/serverless-messages.yml
@@ -0,0 +1,121 @@
+service: ef-cms-messages-${opt:stageColor}
+plugins:
+ - serverless-domain-manager
+ - serverless-offline
+ - serverless-prune-plugin
+ - serverless-plugin-tracing
+ - serverless-latest-layer-version
+ - serverless-jetpack
+ - serverless-log-forwarding
+
+custom: ${file(./web-api/config/custom.yml):messages}
+
+provider:
+ name: aws
+ endpointType: REGIONAL
+ tracing: true
+ stage: ${self:custom.stage}
+ region: ${self:custom.region}
+ runtime: nodejs12.x
+ memorySize: 768
+ timeout: 30
+ logRetentionInDays: 7
+ role: arn:aws:iam::${opt:accountId}:role/lambda_role_${opt:stage}
+ dir: ${opt:run_dir, 'src'}
+ s3Endpoint: s3.us-east-1.amazonaws.com
+ dynamodbEndpoint: dynamodb.${opt:region}.amazonaws.com
+ elasticsearchEndpoint: ${opt:elasticsearch_endpoint}
+ masterRegion: us-east-1
+ userPoolId: us-east-1_7uRkF0Axn
+ masterDynamodbEndpoint: dynamodb.us-east-1.amazonaws.com
+ deploymentBucket:
+ name: ${env:SLS_DEPLOYMENT_BUCKET}
+ serverSideEncryption: AES256
+ apiGateway:
+ binaryMediaTypes:
+ - 'application/pdf'
+ clamavDefDir: /opt/var/lib/clamav
+
+ environment: ${file(./web-api/config/environment-variables.yml)}
+
+package:
+ exclude:
+ - ./**
+ include:
+ - web-api/${self:provider.dir}/messagesHandlers.js
+ excludeDevDependencies: true
+
+resources: ${file(./web-api/config/resources.yml)}
+
+functions:
+ createCaseMessage:
+ handler: web-api/${self:provider.dir}/messagesHandlers.createCaseMessageLambda
+ events:
+ - http:
+ path: /
+ method: post
+ cors: ui-${self:provider.stage}.ef-cms.${opt:domain}
+ authorizer:
+ type: COGNITO_USER_POOLS
+ authorizerId:
+ Ref: ApiGatewayAuthorizer
+
+ getCaseMessage:
+ handler: web-api/${self:provider.dir}/messagesHandlers.getCaseMessageLambda
+ events:
+ - http:
+ path: /{messageId}
+ method: get
+ cors: ui-${self:provider.stage}.ef-cms.${opt:domain}
+ authorizer:
+ type: COGNITO_USER_POOLS
+ authorizerId:
+ Ref: ApiGatewayAuthorizer
+
+ getInboxCaseMessagesForUser:
+ handler: web-api/${self:provider.dir}/messagesHandlers.getInboxCaseMessagesForUserLambda
+ events:
+ - http:
+ path: /inbox/{userId}
+ method: get
+ cors: ui-${self:provider.stage}.ef-cms.${opt:domain}
+ authorizer:
+ type: COGNITO_USER_POOLS
+ authorizerId:
+ Ref: ApiGatewayAuthorizer
+
+ getInboxCaseMessagesForSection:
+ handler: web-api/${self:provider.dir}/messagesHandlers.getInboxCaseMessagesForSectionLambda
+ events:
+ - http:
+ path: /inbox/section/{section}
+ method: get
+ cors: ui-${self:provider.stage}.ef-cms.${opt:domain}
+ authorizer:
+ type: COGNITO_USER_POOLS
+ authorizerId:
+ Ref: ApiGatewayAuthorizer
+
+ getOutboxCaseMessagesForUser:
+ handler: web-api/${self:provider.dir}/messagesHandlers.getOutboxCaseMessagesForUserLambda
+ events:
+ - http:
+ path: /outbox/{userId}
+ method: get
+ cors: ui-${self:provider.stage}.ef-cms.${opt:domain}
+ authorizer:
+ type: COGNITO_USER_POOLS
+ authorizerId:
+ Ref: ApiGatewayAuthorizer
+
+ getOutboxCaseMessagesForSection:
+ handler: web-api/${self:provider.dir}/messagesHandlers.getOutboxCaseMessagesForSectionLambda
+ events:
+ - http:
+ path: /outbox/section/{section}
+ method: get
+ cors: ui-${self:provider.stage}.ef-cms.${opt:domain}
+ authorizer:
+ type: COGNITO_USER_POOLS
+ authorizerId:
+ Ref: ApiGatewayAuthorizer
diff --git a/web-api/serverless-public-api.yml b/web-api/serverless-public-api.yml
index b381b4055a4..47f457b3dfa 100644
--- a/web-api/serverless-public-api.yml
+++ b/web-api/serverless-public-api.yml
@@ -116,3 +116,11 @@ functions:
path: /opinion-search
method: get
cors: ui-public-${self:provider.stage}.ef-cms.${opt:domain}
+
+ todaysOpinions:
+ handler: web-api/${self:provider.dir}/publicApiHandlers.todaysOpinionsLambda
+ events:
+ - http:
+ path: /todays-opinions
+ method: get
+ cors: ui-${self:provider.stage}.ef-cms.${opt:domain}
diff --git a/web-api/serverless-users.yml b/web-api/serverless-users.yml
index fc24452440a..d05ac2789ae 100644
--- a/web-api/serverless-users.yml
+++ b/web-api/serverless-users.yml
@@ -107,18 +107,6 @@ functions:
authorizerId:
Ref: ApiGatewayAuthorizer
- getConsolidatedCasesByUser:
- handler: web-api/${self:provider.dir}/usersHandlers.getConsolidatedCasesByUserLambda
- events:
- - http:
- path: /{userId}/cases-with-consolidation
- method: get
- cors: ui-${self:provider.stage}.ef-cms.${opt:domain}
- authorizer:
- type: COGNITO_USER_POOLS
- authorizerId:
- Ref: ApiGatewayAuthorizer
-
verifyPendingCaseForUser:
handler: web-api/${self:provider.dir}/usersHandlers.verifyPendingCaseForUserLambda
events:
diff --git a/web-api/setup-court-users.sh b/web-api/setup-court-users.sh
index 027974d2672..331a692dd87 100755
--- a/web-api/setup-court-users.sh
+++ b/web-api/setup-court-users.sh
@@ -42,6 +42,8 @@ createAccount() {
judgeFullName=$5
judgeTitle=$6
+ node ../shared/src/tools/validateUser.js "${email}" "${role}" "${section}" "${name}" "${judgeFullName}" "${judgeTitle}"
+
curl --header "Content-Type: application/json" \
--header "Authorization: Bearer ${adminToken}" \
--request POST \
diff --git a/web-api/src/applicationContext.js b/web-api/src/applicationContext.js
index 96f5a3d211d..5b211bf5b25 100644
--- a/web-api/src/applicationContext.js
+++ b/web-api/src/applicationContext.js
@@ -7,13 +7,11 @@ const AWS =
? AWSXRay.captureAWS(require('aws-sdk'))
: require('aws-sdk');
-const { getUniqueId } = require('../../shared/src/sharedAppContext.js');
-
const barNumberGenerator = require('../../shared/src/persistence/dynamo/users/barNumberGenerator');
const connectionClass = require('http-aws-es');
const docketNumberGenerator = require('../../shared/src/persistence/dynamo/cases/docketNumberGenerator');
const elasticsearch = require('elasticsearch');
-const elasticsearchIndexes = require('../elasticsearch/elasticsearch-indexes');
+const pdfLib = require('pdf-lib');
const util = require('util');
const {
addCaseToTrialSessionInteractor,
@@ -31,8 +29,10 @@ const {
addressLabelCoverSheet,
caseInventoryReport,
changeOfAddress,
+ coverSheet,
docketRecord,
noticeOfDocketChange,
+ noticeOfReceiptOfPetition,
order,
pendingReport,
receiptOfFiling,
@@ -77,6 +77,10 @@ const {
const {
bulkIndexRecords,
} = require('../../shared/src/persistence/elasticsearch/bulkIndexRecords');
+const {
+ CASE_STATUS_TYPES,
+ SESSION_STATUS_GROUPS,
+} = require('../../shared/src/business/entities/EntityConstants');
const {
caseAdvancedSearch,
} = require('../../shared/src/persistence/elasticsearch/caseAdvancedSearch');
@@ -128,6 +132,12 @@ const {
const {
createCaseInteractor,
} = require('../../shared/src/business/useCases/createCaseInteractor');
+const {
+ createCaseMessage,
+} = require('../../shared/src/persistence/dynamo/messages/createCaseMessage');
+const {
+ createCaseMessageInteractor,
+} = require('../../shared/src/business/useCases/messages/createCaseMessageInteractor');
const {
createCaseTrialSortMappingRecords,
} = require('../../shared/src/persistence/dynamo/cases/createCaseTrialSortMappingRecords');
@@ -239,6 +249,9 @@ const {
const {
deleteWorkItemFromSection,
} = require('../../shared/src/persistence/dynamo/workitems/deleteWorkItemFromSection');
+const {
+ elasticsearchIndexes,
+} = require('../elasticsearch/elasticsearch-indexes');
const {
fetchPendingItems,
} = require('../../shared/src/business/useCaseHelper/pendingItems/fetchPendingItems');
@@ -269,15 +282,15 @@ const {
const {
fileExternalDocumentInteractor,
} = require('../../shared/src/business/useCases/externalDocument/fileExternalDocumentInteractor');
+const {
+ formatAndSortConsolidatedCases,
+} = require('../../shared/src/business/useCaseHelper/consolidatedCases/formatAndSortConsolidatedCases');
const {
formatJudgeName,
} = require('../../shared/src/business/utilities/getFormattedJudgeName');
const {
forwardWorkItemInteractor,
} = require('../../shared/src/business/useCases/workitems/forwardWorkItemInteractor');
-const {
- generateCaseConfirmationPdf,
-} = require('../../shared/src/business/useCaseHelper/caseConfirmation/generateCaseConfirmationPdf');
const {
generateCaseInventoryReportPdf,
} = require('../../shared/src/business/useCaseHelper/caseInventoryReport/generateCaseInventoryReportPdf');
@@ -361,6 +374,12 @@ const {
const {
getCaseInventoryReportInteractor,
} = require('../../shared/src/business/useCases/caseInventoryReport/getCaseInventoryReportInteractor');
+const {
+ getCaseMessageById,
+} = require('../../shared/src/persistence/dynamo/messages/getCaseMessageById');
+const {
+ getCaseMessageInteractor,
+} = require('../../shared/src/business/useCases/messages/getCaseMessageInteractor');
const {
getCasesByCaseIds,
} = require('../../shared/src/persistence/dynamo/cases/getCasesByCaseIds');
@@ -376,12 +395,18 @@ const {
const {
getChromiumBrowser,
} = require('../../shared/src/business/utilities/getChromiumBrowser');
+const {
+ getClosedCasesByUser,
+} = require('../../shared/src/persistence/dynamo/cases/getClosedCasesByUser');
+const {
+ getClosedCasesInteractor,
+} = require('../../shared/src/business/useCases/getClosedCasesInteractor');
const {
getConsolidatedCasesByCaseInteractor,
} = require('../../shared/src/business/useCases/getConsolidatedCasesByCaseInteractor');
const {
- getConsolidatedCasesByUserInteractor,
-} = require('../../shared/src/business/useCases/getConsolidatedCasesByUserInteractor');
+ getConsolidatedCasesForLeadCase,
+} = require('../../shared/src/business/useCaseHelper/consolidatedCases/getConsolidatedCasesForLeadCase');
const {
getDocumentQCInboxForSection,
} = require('../../shared/src/persistence/dynamo/workitems/getDocumentQCInboxForSection');
@@ -430,6 +455,12 @@ const {
const {
getFormattedCaseDetail,
} = require('../../shared/src/business/utilities/getFormattedCaseDetail');
+const {
+ getInboxCaseMessagesForSectionInteractor,
+} = require('../../shared/src/business/useCases/messages/getInboxCaseMessagesForSectionInteractor');
+const {
+ getInboxCaseMessagesForUserInteractor,
+} = require('../../shared/src/business/useCases/messages/getInboxCaseMessagesForUserInteractor');
const {
getInboxMessagesForSection,
} = require('../../shared/src/persistence/dynamo/workitems/getInboxMessagesForSection');
@@ -442,6 +473,9 @@ const {
const {
getInboxMessagesForUserInteractor,
} = require('../../shared/src/business/useCases/workitems/getInboxMessagesForUserInteractor');
+const {
+ getIndexedCasesForUser,
+} = require('../../shared/src/persistence/elasticsearch/getIndexedCasesForUser');
const {
getIndexMappingFields,
} = require('../../shared/src/persistence/elasticsearch/getIndexMappingFields');
@@ -470,8 +504,14 @@ const {
getOpenCasesByUser,
} = require('../../shared/src/persistence/dynamo/cases/getOpenCasesByUser');
const {
- getOpenCasesInteractor,
-} = require('../../shared/src/business/useCases/getOpenCasesInteractor');
+ getOpenConsolidatedCasesInteractor,
+} = require('../../shared/src/business/useCases/getOpenConsolidatedCasesInteractor');
+const {
+ getOutboxCaseMessagesForSectionInteractor,
+} = require('../../shared/src/business/useCases/messages/getOutboxCaseMessagesForSectionInteractor');
+const {
+ getOutboxCaseMessagesForUserInteractor,
+} = require('../../shared/src/business/useCases/messages/getOutboxCaseMessagesForUserInteractor');
const {
getPractitionerByBarNumber,
} = require('../../shared/src/persistence/dynamo/users/getPractitionerByBarNumber');
@@ -499,6 +539,12 @@ const {
const {
getRecord,
} = require('../../shared/src/persistence/dynamo/elasticsearch/getRecord');
+const {
+ getSectionInboxMessages,
+} = require('../../shared/src/persistence/elasticsearch/messages/getSectionInboxMessages');
+const {
+ getSectionOutboxMessages,
+} = require('../../shared/src/persistence/elasticsearch/messages/getSectionOutboxMessages');
const {
getSentMessagesForSection,
} = require('../../shared/src/persistence/dynamo/workitems/getSentMessagesForSection');
@@ -511,6 +557,9 @@ const {
const {
getSentMessagesForUserInteractor,
} = require('../../shared/src/business/useCases/workitems/getSentMessagesForUserInteractor');
+const {
+ getTodaysOpinionsInteractor,
+} = require('../../shared/src/business/useCases/public/getTodaysOpinionsInteractor');
const {
getTrialSessionById,
} = require('../../shared/src/persistence/dynamo/trialSessions/getTrialSessionById');
@@ -529,6 +578,9 @@ const {
const {
getTrialSessionWorkingCopyInteractor,
} = require('../../shared/src/business/useCases/trialSessions/getTrialSessionWorkingCopyInteractor');
+const {
+ getUnassociatedLeadCase,
+} = require('../../shared/src/business/useCaseHelper/consolidatedCases/getUnassociatedLeadCase');
const {
getUploadPolicy,
} = require('../../shared/src/persistence/s3/getUploadPolicy');
@@ -554,11 +606,17 @@ const {
getUserCaseNoteInteractor,
} = require('../../shared/src/business/useCases/caseNote/getUserCaseNoteInteractor');
const {
- getUserDashboardCases,
-} = require('../../shared/src/persistence/dynamo/cases/getUserDashboardCases');
+ getUserCases,
+} = require('../../shared/src/persistence/dynamo/cases/getUserCases');
+const {
+ getUserInboxMessages,
+} = require('../../shared/src/persistence/elasticsearch/messages/getUserInboxMessages');
const {
getUserInteractor,
} = require('../../shared/src/business/useCases/getUserInteractor');
+const {
+ getUserOutboxMessages,
+} = require('../../shared/src/persistence/elasticsearch/messages/getUserOutboxMessages');
const {
getUsersBySearchKey,
} = require('../../shared/src/persistence/dynamo/users/getUsersBySearchKey');
@@ -611,6 +669,9 @@ const {
const {
opinionPublicSearchInteractor,
} = require('../../shared/src/business/useCases/public/opinionPublicSearchInteractor');
+const {
+ ORDER_TYPES,
+} = require('../../shared/src/business/entities/EntityConstants');
const {
orderAdvancedSearchInteractor,
} = require('../../shared/src/business/useCases/orderAdvancedSearchInteractor');
@@ -629,6 +690,9 @@ const {
const {
processStreamRecordsInteractor,
} = require('../../shared/src/business/useCases/processStreamRecordsInteractor');
+const {
+ processUserAssociatedCases,
+} = require('../../shared/src/business/useCaseHelper/consolidatedCases/processUserAssociatedCases');
const {
putWorkItemInOutbox,
} = require('../../shared/src/persistence/dynamo/workitems/putWorkItemInOutbox');
@@ -731,9 +795,6 @@ const {
const {
submitPendingCaseAssociationRequestInteractor,
} = require('../../shared/src/business/useCases/caseAssociationRequest/submitPendingCaseAssociationRequestInteractor');
-const {
- TrialSession,
-} = require('../../shared/src/business/entities/trialSessions/TrialSession');
const {
unblockCaseFromTrialInteractor,
} = require('../../shared/src/business/useCases/unblockCaseFromTrialInteractor');
@@ -873,11 +934,8 @@ const { Case } = require('../../shared/src/business/entities/cases/Case');
const { Document } = require('../../shared/src/business/entities/Document');
const { exec } = require('child_process');
const { getDocument } = require('../../shared/src/persistence/s3/getDocument');
-const { Order } = require('../../shared/src/business/entities/orders/Order');
+const { getUniqueId } = require('../../shared/src/sharedAppContext.js');
const { User } = require('../../shared/src/business/entities/User');
-
-const pdfLib = require('pdf-lib');
-
const { v4: uuidv4 } = require('uuid');
// increase the timeout for zip uploads to S3
@@ -993,8 +1051,11 @@ module.exports = (appContextUser = {}) => {
},
getConstants: () => ({
CASE_INVENTORY_MAX_PAGE_SIZE: 5000,
- ORDER_TYPES_MAP: Order.ORDER_TYPES,
- SESSION_STATUS_GROUPS: TrialSession.SESSION_STATUS_GROUPS,
+ OPEN_CASE_STATUSES: Object.values(CASE_STATUS_TYPES).filter(
+ status => status !== CASE_STATUS_TYPES.closed,
+ ),
+ ORDER_TYPES_MAP: ORDER_TYPES,
+ SESSION_STATUS_GROUPS,
}),
getCurrentUser,
getDispatchers: () => ({
@@ -1005,8 +1066,10 @@ module.exports = (appContextUser = {}) => {
addressLabelCoverSheet,
caseInventoryReport,
changeOfAddress,
+ coverSheet,
docketRecord,
noticeOfDocketChange,
+ noticeOfReceiptOfPetition,
order,
pendingReport,
receiptOfFiling,
@@ -1102,6 +1165,7 @@ module.exports = (appContextUser = {}) => {
createCase,
createCaseCatalogRecord,
createCaseDeadline,
+ createCaseMessage,
createCaseTrialSortMappingRecords,
createElasticsearchReindexRecord,
createPractitionerUser,
@@ -1135,9 +1199,11 @@ module.exports = (appContextUser = {}) => {
getCaseByDocketNumber,
getCaseDeadlinesByCaseId,
getCaseInventoryReport,
+ getCaseMessageById,
getCasesByCaseIds,
getCasesByLeadCaseId,
getCasesByUser,
+ getClosedCasesByUser,
getDocument,
getDocumentQCInboxForSection,
getDocumentQCInboxForUser,
@@ -1151,12 +1217,15 @@ module.exports = (appContextUser = {}) => {
getInboxMessagesForUser,
getIndexMappingFields,
getIndexMappingLimit,
+ getIndexedCasesForUser,
getInternalUsers,
getOpenCasesByUser,
getPractitionerByBarNumber,
getPractitionersByName,
getPublicDownloadPolicyUrl,
getRecord,
+ getSectionInboxMessages,
+ getSectionOutboxMessages,
getSentMessagesForSection,
getSentMessagesForUser,
getTrialSessionById,
@@ -1166,7 +1235,9 @@ module.exports = (appContextUser = {}) => {
getUserById,
getUserCaseNote,
getUserCaseNoteForCases,
- getUserDashboardCases,
+ getUserCases,
+ getUserInboxMessages,
+ getUserOutboxMessages,
getUsersBySearchKey,
getUsersInSection,
getWebSocketConnectionByConnectionId,
@@ -1267,9 +1338,12 @@ module.exports = (appContextUser = {}) => {
appendPaperServiceAddressPageToPdf,
countPagesInDocument,
fetchPendingItems,
- generateCaseConfirmationPdf,
+ formatAndSortConsolidatedCases,
generateCaseInventoryReportPdf,
getCaseInventoryReport,
+ getConsolidatedCasesForLeadCase,
+ getUnassociatedLeadCase,
+ processUserAssociatedCases,
saveFileAndGenerateUrl,
sendIrsSuperuserPetitionEmail,
sendServedPartiesEmails,
@@ -1296,6 +1370,7 @@ module.exports = (appContextUser = {}) => {
createCaseDeadlineInteractor,
createCaseFromPaperInteractor,
createCaseInteractor,
+ createCaseMessageInteractor,
createCourtIssuedOrderPdfFromHtmlInteractor,
createPractitionerUserInteractor,
createTrialSessionInteractor,
@@ -1333,15 +1408,18 @@ module.exports = (appContextUser = {}) => {
getCaseForPublicDocketSearchInteractor,
getCaseInteractor,
getCaseInventoryReportInteractor,
+ getCaseMessageInteractor,
getCasesByUserInteractor,
+ getClosedCasesInteractor,
getConsolidatedCasesByCaseInteractor,
- getConsolidatedCasesByUserInteractor,
getDocumentQCInboxForSectionInteractor,
getDocumentQCInboxForUserInteractor,
getDocumentQCServedForSectionInteractor,
getDocumentQCServedForUserInteractor,
getDownloadPolicyUrlInteractor,
getEligibleCasesForTrialSessionInteractor,
+ getInboxCaseMessagesForSectionInteractor,
+ getInboxCaseMessagesForUserInteractor,
getInboxMessagesForSectionInteractor,
getInboxMessagesForUserInteractor,
getInternalUsersInteractor,
@@ -1349,7 +1427,9 @@ module.exports = (appContextUser = {}) => {
getJudgeForUserChambersInteractor,
getJudgesForPublicSearchInteractor,
getNotificationsInteractor,
- getOpenCasesInteractor,
+ getOpenConsolidatedCasesInteractor,
+ getOutboxCaseMessagesForSectionInteractor,
+ getOutboxCaseMessagesForUserInteractor,
getPractitionerByBarNumberInteractor,
getPractitionersByNameInteractor,
getPrivatePractitionersBySearchKeyInteractor,
@@ -1357,6 +1437,7 @@ module.exports = (appContextUser = {}) => {
getPublicDownloadPolicyUrlInteractor,
getSentMessagesForSectionInteractor,
getSentMessagesForUserInteractor,
+ getTodaysOpinionsInteractor,
getTrialSessionDetailsInteractor,
getTrialSessionWorkingCopyInteractor,
getTrialSessionsInteractor,
@@ -1447,7 +1528,7 @@ module.exports = (appContextUser = {}) => {
logger: {
error: value => {
// eslint-disable-next-line no-console
- console.error(JSON.stringify(value));
+ console.error(value);
},
info: (key, value) => {
// eslint-disable-next-line no-console
diff --git a/web-api/src/cases/getOpenCasesLambda.js b/web-api/src/cases/getClosedCasesLambda.js
similarity index 67%
rename from web-api/src/cases/getOpenCasesLambda.js
rename to web-api/src/cases/getClosedCasesLambda.js
index 02b657a3b3b..d9d8fa10733 100644
--- a/web-api/src/cases/getOpenCasesLambda.js
+++ b/web-api/src/cases/getClosedCasesLambda.js
@@ -1,14 +1,14 @@
const { genericHandler } = require('../genericHandler');
/**
- * used for fetching all open cases
+ * used for fetching all closed cases
*
* @param {object} event the AWS event object
* @returns {Promise<*|undefined>} the api gateway response object containing the statusCode, body, and headers
*/
-exports.getOpenCasesLambda = event =>
+exports.getClosedCasesLambda = event =>
genericHandler(event, async ({ applicationContext }) => {
- return await applicationContext.getUseCases().getOpenCasesInteractor({
+ return await applicationContext.getUseCases().getClosedCasesInteractor({
applicationContext,
});
});
diff --git a/web-api/src/cases/getOpenConsolidatedCasesLambda.js b/web-api/src/cases/getOpenConsolidatedCasesLambda.js
new file mode 100644
index 00000000000..719e0e4ab36
--- /dev/null
+++ b/web-api/src/cases/getOpenConsolidatedCasesLambda.js
@@ -0,0 +1,16 @@
+const { genericHandler } = require('../genericHandler');
+
+/**
+ * used for fetching all open cases
+ *
+ * @param {object} event the AWS event object
+ * @returns {Promise<*|undefined>} the api gateway response object containing the statusCode, body, and headers
+ */
+exports.getOpenConsolidatedCasesLambda = event =>
+ genericHandler(event, async ({ applicationContext }) => {
+ return await applicationContext
+ .getUseCases()
+ .getOpenConsolidatedCasesInteractor({
+ applicationContext,
+ });
+ });
diff --git a/web-api/src/casesHandlers.js b/web-api/src/casesHandlers.js
index 7e53011cbaa..f8454a9b029 100644
--- a/web-api/src/casesHandlers.js
+++ b/web-api/src/casesHandlers.js
@@ -5,9 +5,12 @@ module.exports = {
.createCaseFromPaperLambda,
createCaseLambda: require('./cases/createCaseLambda').createCaseLambda,
getCaseLambda: require('./cases/getCaseLambda').getCaseLambda,
+ getClosedCasesLambda: require('./cases/getClosedCasesLambda')
+ .getClosedCasesLambda,
getConsolidatedCasesByCaseLambda: require('./cases/getConsolidatedCasesByCaseLambda')
.getConsolidatedCasesByCaseLambda,
- getOpenCasesLambda: require('./cases/getOpenCasesLambda').getOpenCasesLambda,
+ getOpenConsolidatedCasesLambda: require('./cases/getOpenConsolidatedCasesLambda')
+ .getOpenConsolidatedCasesLambda,
removeCasePendingItemLambda: require('./cases/removeCasePendingItemLambda')
.removeCasePendingItemLambda,
saveCaseDetailInternalEditLambda: require('./cases/saveCaseDetailInternalEditLambda')
diff --git a/web-api/src/messages/createCaseMessageLambda.js b/web-api/src/messages/createCaseMessageLambda.js
new file mode 100644
index 00000000000..66ef3b0c933
--- /dev/null
+++ b/web-api/src/messages/createCaseMessageLambda.js
@@ -0,0 +1,15 @@
+const { genericHandler } = require('../genericHandler');
+
+/**
+ * lambda which is used for creating a new case message
+ *
+ * @param {object} event the AWS event object
+ * @returns {Promise<*|undefined>} the api gateway response object containing the statusCode, body, and headers
+ */
+exports.createCaseMessageLambda = event =>
+ genericHandler(event, async ({ applicationContext }) => {
+ return await applicationContext.getUseCases().createCaseMessageInteractor({
+ ...JSON.parse(event.body),
+ applicationContext,
+ });
+ });
diff --git a/web-api/src/messages/getCaseMessageLambda.js b/web-api/src/messages/getCaseMessageLambda.js
new file mode 100644
index 00000000000..60f0f3ef43e
--- /dev/null
+++ b/web-api/src/messages/getCaseMessageLambda.js
@@ -0,0 +1,15 @@
+const { genericHandler } = require('../genericHandler');
+
+/**
+ * lambda which is used for creating a new case message
+ *
+ * @param {object} event the AWS event object
+ * @returns {Promise<*|undefined>} the api gateway response object containing the statusCode, body, and headers
+ */
+exports.getCaseMessageLambda = event =>
+ genericHandler(event, async ({ applicationContext }) => {
+ return await applicationContext.getUseCases().getCaseMessageInteractor({
+ applicationContext,
+ messageId: event.pathParameters.messageId,
+ });
+ });
diff --git a/web-api/src/messages/getInboxCaseMessagesForSectionLambda.js b/web-api/src/messages/getInboxCaseMessagesForSectionLambda.js
new file mode 100644
index 00000000000..eedd1e8cc8d
--- /dev/null
+++ b/web-api/src/messages/getInboxCaseMessagesForSectionLambda.js
@@ -0,0 +1,17 @@
+const { genericHandler } = require('../genericHandler');
+
+/**
+ * gets the inbox case messages for the section
+ *
+ * @param {object} event the AWS event object
+ * @returns {Promise<*|undefined>} the api gateway response object containing the statusCode, body, and headers
+ */
+exports.getInboxCaseMessagesForSectionLambda = event =>
+ genericHandler(event, async ({ applicationContext }) => {
+ return await applicationContext
+ .getUseCases()
+ .getInboxCaseMessagesForSectionInteractor({
+ applicationContext,
+ section: event.pathParameters.section,
+ });
+ });
diff --git a/web-api/src/messages/getInboxCaseMessagesForUserLambda.js b/web-api/src/messages/getInboxCaseMessagesForUserLambda.js
new file mode 100644
index 00000000000..9e4623c3568
--- /dev/null
+++ b/web-api/src/messages/getInboxCaseMessagesForUserLambda.js
@@ -0,0 +1,17 @@
+const { genericHandler } = require('../genericHandler');
+
+/**
+ * gets the inbox case messages for the user
+ *
+ * @param {object} event the AWS event object
+ * @returns {Promise<*|undefined>} the api gateway response object containing the statusCode, body, and headers
+ */
+exports.getInboxCaseMessagesForUserLambda = event =>
+ genericHandler(event, async ({ applicationContext }) => {
+ return await applicationContext
+ .getUseCases()
+ .getInboxCaseMessagesForUserInteractor({
+ applicationContext,
+ userId: event.pathParameters.userId,
+ });
+ });
diff --git a/web-api/src/messages/getOutboxCaseMessagesForSectionLambda.js b/web-api/src/messages/getOutboxCaseMessagesForSectionLambda.js
new file mode 100644
index 00000000000..d1ecfd66aef
--- /dev/null
+++ b/web-api/src/messages/getOutboxCaseMessagesForSectionLambda.js
@@ -0,0 +1,17 @@
+const { genericHandler } = require('../genericHandler');
+
+/**
+ * gets the outbox case messages for the section
+ *
+ * @param {object} event the AWS event object
+ * @returns {Promise<*|undefined>} the api gateway response object containing the statusCode, body, and headers
+ */
+exports.getOutboxCaseMessagesForSectionLambda = event =>
+ genericHandler(event, async ({ applicationContext }) => {
+ return await applicationContext
+ .getUseCases()
+ .getOutboxCaseMessagesForSectionInteractor({
+ applicationContext,
+ section: event.pathParameters.section,
+ });
+ });
diff --git a/web-api/src/messages/getOutboxCaseMessagesForUserLambda.js b/web-api/src/messages/getOutboxCaseMessagesForUserLambda.js
new file mode 100644
index 00000000000..cc9d5493829
--- /dev/null
+++ b/web-api/src/messages/getOutboxCaseMessagesForUserLambda.js
@@ -0,0 +1,17 @@
+const { genericHandler } = require('../genericHandler');
+
+/**
+ * gets the outbox case messages for the user
+ *
+ * @param {object} event the AWS event object
+ * @returns {Promise<*|undefined>} the api gateway response object containing the statusCode, body, and headers
+ */
+exports.getOutboxCaseMessagesForUserLambda = event =>
+ genericHandler(event, async ({ applicationContext }) => {
+ return await applicationContext
+ .getUseCases()
+ .getOutboxCaseMessagesForUserInteractor({
+ applicationContext,
+ userId: event.pathParameters.userId,
+ });
+ });
diff --git a/web-api/src/messagesHandlers.js b/web-api/src/messagesHandlers.js
new file mode 100644
index 00000000000..1925d327f21
--- /dev/null
+++ b/web-api/src/messagesHandlers.js
@@ -0,0 +1,14 @@
+module.exports = {
+ createCaseMessageLambda: require('./messages/createCaseMessageLambda')
+ .createCaseMessageLambda,
+ getCaseMessageLambda: require('./messages/getCaseMessageLambda')
+ .getCaseMessageLambda,
+ getInboxCaseMessagesForSectionLambda: require('./messages/getInboxCaseMessagesForSectionLambda')
+ .getInboxCaseMessagesForSectionLambda,
+ getInboxCaseMessagesForUserLambda: require('./messages/getInboxCaseMessagesForUserLambda')
+ .getInboxCaseMessagesForUserLambda,
+ getOutboxCaseMessagesForSectionLambda: require('./messages/getOutboxCaseMessagesForSectionLambda')
+ .getOutboxCaseMessagesForSectionLambda,
+ getOutboxCaseMessagesForUserLambda: require('./messages/getOutboxCaseMessagesForUserLambda')
+ .getOutboxCaseMessagesForUserLambda,
+};
diff --git a/web-api/src/cases/getConsolidatedCasesByUserLambda.js b/web-api/src/public-api/todaysOpinionsLambda.js
similarity index 56%
rename from web-api/src/cases/getConsolidatedCasesByUserLambda.js
rename to web-api/src/public-api/todaysOpinionsLambda.js
index 907435f4cce..895cc519bb2 100644
--- a/web-api/src/cases/getConsolidatedCasesByUserLambda.js
+++ b/web-api/src/public-api/todaysOpinionsLambda.js
@@ -1,23 +1,23 @@
const { genericHandler } = require('../genericHandler');
/**
- * used for fetching all cases (including consolidated) of a particular status, user role, etc
+ * used for fetching opinions created for the current date
*
* @param {object} event the AWS event object
* @returns {Promise<*|undefined>} the api gateway response object containing the statusCode, body, and headers
*/
-exports.getConsolidatedCasesByUserLambda = event =>
+exports.todaysOpinionsLambda = event =>
genericHandler(
event,
async ({ applicationContext }) => {
- const { userId } = event.pathParameters || {};
-
return await applicationContext
.getUseCases()
- .getConsolidatedCasesByUserInteractor({
+ .getTodaysOpinionsInteractor({
applicationContext,
- userId,
});
},
- { logResults: false, skipFiltering: true },
+ {
+ isPublicUser: true,
+ user: {},
+ },
);
diff --git a/web-api/src/publicApiHandlers.js b/web-api/src/publicApiHandlers.js
index ce466c97033..e0e5a01e887 100644
--- a/web-api/src/publicApiHandlers.js
+++ b/web-api/src/publicApiHandlers.js
@@ -15,4 +15,6 @@ module.exports = {
.opinionPublicSearchLambda,
orderPublicSearchLambda: require('./public-api/orderPublicSearchLambda')
.orderPublicSearchLambda,
+ todaysOpinionsLambda: require('./public-api/todaysOpinionsLambda')
+ .todaysOpinionsLambda,
};
diff --git a/web-api/src/streamsHandlers.js b/web-api/src/streamsHandlers.js
index a25f36fbeca..6d71546f2c6 100644
--- a/web-api/src/streamsHandlers.js
+++ b/web-api/src/streamsHandlers.js
@@ -2,5 +2,5 @@ module.exports = {
processStreamRecordsLambda: require('./streams/processStreamRecordsLambda')
.processStreamRecordsLambda,
reprocessFailedRecordsLambda: require('./streams/reprocessFailedRecordsLambda')
- .handler,
+ .reprocessFailedRecordsLambda,
};
diff --git a/web-api/src/usersHandlers.js b/web-api/src/usersHandlers.js
index b09294bb4f3..791e0cf4708 100644
--- a/web-api/src/usersHandlers.js
+++ b/web-api/src/usersHandlers.js
@@ -2,8 +2,6 @@ module.exports = {
createUserLambda: require('./users/createUserLambda').createUserLambda,
getCasesByUserLambda: require('./cases/getCasesByUserLambda')
.getCasesByUserLambda,
- getConsolidatedCasesByUserLambda: require('./cases/getConsolidatedCasesByUserLambda')
- .getConsolidatedCasesByUserLambda,
getDocumentQCInboxForUserLambda: require('./workitems/getDocumentQCInboxForUserLambda')
.getDocumentQCInboxForUserLambda,
getDocumentQCServedForUserLambda: require('./workitems/getDocumentQCServedForUserLambda')
diff --git a/web-api/storage/fixtures/create-random-cases.js b/web-api/storage/fixtures/create-random-cases.js
index 21e51d93133..8475a00b48b 100755
--- a/web-api/storage/fixtures/create-random-cases.js
+++ b/web-api/storage/fixtures/create-random-cases.js
@@ -2,12 +2,11 @@ const axios = require('axios');
const faker = require('faker');
const jwt = require('jsonwebtoken');
const {
- ContactFactory,
-} = require('../../../shared/src/business/entities/contacts/ContactFactory');
-const {
- TrialSession,
-} = require('../../../shared/src/business/entities/trialSessions/TrialSession');
-const { Case } = require('../../../shared/src/business/entities/cases/Case');
+ CASE_TYPES,
+ PARTY_TYPES,
+ PROCEDURE_TYPES,
+ TRIAL_CITIES,
+} = require('../../../shared/src/business/entities/EntityConstants');
const { userMap } = require('../../../shared/src/test/mockUserTokenMap');
const USAGE = `
@@ -42,7 +41,7 @@ const main = () => {
for (let i = 0; i < numToCreate; i++) {
const preferredTrialCityObject =
- TrialSession.TRIAL_CITIES.ALL[faker.random.number() % 74];
+ TRIAL_CITIES.ALL[faker.random.number() % 74];
const preferredTrialCity =
preferredTrialCityObject.city + ', ' + preferredTrialCityObject.state;
@@ -51,7 +50,7 @@ const main = () => {
const randomlyGeneratedData = {
petitionFileId,
petitionMetadata: {
- caseType: Case.CASE_TYPES[faker.random.number() % 13],
+ caseType: CASE_TYPES[faker.random.number() % 13],
contactPrimary: {
address1: faker.address.streetAddress(),
city: faker.address.city(),
@@ -73,10 +72,10 @@ const main = () => {
countryType: 'domestic',
filingType: 'Myself and my spouse',
hasIrsNotice: faker.random.boolean(),
- partyType: ContactFactory.PARTY_TYPES.petitionerSpouse,
+ partyType: PARTY_TYPES.petitionerSpouse,
preferredTrialCity,
privatePractitioners: [],
- procedureType: Case.PROCEDURE_TYPES[faker.random.number() % 2],
+ procedureType: PROCEDURE_TYPES[faker.random.number() % 2],
},
stinFileId,
};
diff --git a/web-api/storage/fixtures/get-diffs.js b/web-api/storage/fixtures/get-diffs.js
index 0b699c7a227..46b330f24da 100755
--- a/web-api/storage/fixtures/get-diffs.js
+++ b/web-api/storage/fixtures/get-diffs.js
@@ -26,6 +26,11 @@ process.argv.forEach((val, index) => {
}
});
+/**
+ * @arg obj1 {object}
+ * @arg obj2 {object}
+ * @returns {boolean} if objects are deep-equal
+ */
function deepEqual(obj1, obj2) {
//Loop through properties in object 1
for (let p in obj1) {
@@ -36,23 +41,23 @@ function deepEqual(obj1, obj2) {
if (obj2[p] === null && obj1[p] !== null) return false;
switch (typeof obj1[p]) {
- //Deep compare objects
- case 'object':
- if (!deepEqual(obj1[p], obj2[p])) return false;
- break;
+ //Deep compare objects
+ case 'object':
+ if (!deepEqual(obj1[p], obj2[p])) return false;
+ break;
//Compare function code
- case 'function':
- if (
- typeof obj2[p] == 'undefined' ||
+ case 'function':
+ if (
+ typeof obj2[p] == 'undefined' ||
(p != 'compare' && obj1[p].toString() != obj2[p].toString())
- )
- return false;
- break;
+ )
+ return false;
+ break;
//Compare values
- default:
- if (obj1[p] === '' && obj2[p] !== '') return false;
- if (obj2[p] === '' && obj1[p] !== '') return false;
- if (obj1[p] != obj2[p]) return false;
+ default:
+ if (obj1[p] === '' && obj2[p] !== '') return false;
+ if (obj2[p] === '' && obj1[p] !== '') return false;
+ if (obj1[p] != obj2[p]) return false;
}
}
@@ -91,4 +96,4 @@ const main = () => {
console.log(JSON.stringify(differences, null, 2));
};
-main(arguments);
+main();
diff --git a/web-api/storage/fixtures/seed/101-19.json b/web-api/storage/fixtures/seed/101-19.json
index bbb1d84b43f..dc6b7d118da 100755
--- a/web-api/storage/fixtures/seed/101-19.json
+++ b/web-api/storage/fixtures/seed/101-19.json
@@ -73,7 +73,8 @@
"caseCaption": "Brett Osborne, Petitioner",
"docketNumber": "101-19",
"docketNumberWithSuffix": "101-19W",
- "status": "New"
+ "status": "New",
+ "entityName": "UserCase"
},
{
"sk": "case|2fa6da8d-4328-4a20-a5d7-b76637e1dc02",
diff --git a/web-api/storage/fixtures/seed/102-19.json b/web-api/storage/fixtures/seed/102-19.json
index 7cdc3c60554..1e3780dfd83 100755
--- a/web-api/storage/fixtures/seed/102-19.json
+++ b/web-api/storage/fixtures/seed/102-19.json
@@ -92,7 +92,8 @@
"docketNumber": "102-19",
"status": "New",
"createdAt": "2019-03-01T21:40:46.415Z",
- "caseCaption": "Selma Horn & Cairo Harris, Petitioners"
+ "caseCaption": "Selma Horn & Cairo Harris, Petitioners",
+ "entityName": "UserCase"
},
{
"docketNumberWithSuffix": "102-19P",
diff --git a/web-api/storage/fixtures/seed/102-20.json b/web-api/storage/fixtures/seed/102-20.json
index c063ca4b36c..f11c13f29d0 100644
--- a/web-api/storage/fixtures/seed/102-20.json
+++ b/web-api/storage/fixtures/seed/102-20.json
@@ -54,7 +54,8 @@
"caseCaption": "Eve Brewer, Petitioner",
"docketNumber": "102-20",
"docketNumberWithSuffix": "102-20S",
- "status": "New"
+ "status": "New",
+ "entityName": "UserCase"
},
{
"sk": "case|c862926c-119f-49d5-8cc3-6e93ab703fa3",
@@ -74,7 +75,8 @@
"caseCaption": "Eve Brewer, Petitioner",
"docketNumber": "102-20",
"docketNumberWithSuffix": "102-20S",
- "status": "New"
+ "status": "New",
+ "entityName": "UserCase"
},
{
"docketNumberWithSuffix": "102-20S",
@@ -205,7 +207,8 @@
"caseCaption": "Eve Brewer, Petitioner",
"docketNumber": "102-20",
"docketNumberWithSuffix": "102-20S",
- "status": "New"
+ "status": "New",
+ "entityName": "UserCase"
},
{
"role": "irsPractitioner",
diff --git a/web-api/storage/fixtures/seed/103-19.json b/web-api/storage/fixtures/seed/103-19.json
index 98946a90399..9aa29b8cfce 100755
--- a/web-api/storage/fixtures/seed/103-19.json
+++ b/web-api/storage/fixtures/seed/103-19.json
@@ -91,9 +91,10 @@
"caseId": "491b05b4-483f-4b85-8dd7-2dd4c069eb50",
"createdAt": "2019-03-01T22:53:50.097Z",
"caseCaption": "Samson Workman, Petitioner",
- "docketNumber": "102-20",
+ "docketNumber": "103-19",
"docketNumberWithSuffix": "103-19S",
- "status": "New"
+ "status": "New",
+ "entityName": "UserCase"
},
{
"sk": "case|491b05b4-483f-4b85-8dd7-2dd4c069eb50",
@@ -106,9 +107,10 @@
"caseId": "491b05b4-483f-4b85-8dd7-2dd4c069eb50",
"createdAt": "2019-03-01T22:53:50.097Z",
"caseCaption": "Samson Workman, Petitioner",
- "docketNumber": "102-20",
+ "docketNumber": "103-19",
"docketNumberWithSuffix": "103-19S",
- "status": "New"
+ "status": "New",
+ "entityName": "UserCase"
},
{
"sk": "work-item|9055257a-0a95-4b80-a728-5bb754c60e59",
diff --git a/web-api/storage/fixtures/seed/103-20.json b/web-api/storage/fixtures/seed/103-20.json
index fa2dc351d68..542bb405517 100644
--- a/web-api/storage/fixtures/seed/103-20.json
+++ b/web-api/storage/fixtures/seed/103-20.json
@@ -235,7 +235,8 @@
"createdAt": "2020-01-23T21:45:34.520Z",
"docketNumber": "103-20",
"docketNumberWithSuffix": "103-20L",
- "status": "Calendared"
+ "status": "Calendared",
+ "entityName": "UserCase"
},
{
"associatedJudge": "Judge Armen",
diff --git a/web-api/storage/fixtures/seed/104-19.json b/web-api/storage/fixtures/seed/104-19.json
index 9445b2ea0a0..7060664cc82 100755
--- a/web-api/storage/fixtures/seed/104-19.json
+++ b/web-api/storage/fixtures/seed/104-19.json
@@ -97,7 +97,8 @@
"createdAt": "2019-03-05T17:34:13.490Z",
"docketNumber": "104-19",
"docketNumberWithSuffix": "104-19L",
- "status": "New"
+ "status": "New",
+ "entityName": "UserCase"
},
{
"sk": "case|5f6e8b8e-4fac-4fd7-bf3c-42f0d7c3ca05",
diff --git a/web-api/storage/fixtures/seed/104-20.json b/web-api/storage/fixtures/seed/104-20.json
index f943fbfd780..bec659be234 100644
--- a/web-api/storage/fixtures/seed/104-20.json
+++ b/web-api/storage/fixtures/seed/104-20.json
@@ -26,7 +26,7 @@
}
],
"attachments": false,
- "documentType": "ODD - Order of Dismissal and Decision Entered,",
+ "documentType": "ODD - Order of Dismissal and Decision Entered",
"entityName": "Document",
"filingDate": "2020-04-14T03:01:15.215Z",
"pending": false,
@@ -54,7 +54,7 @@
"docketNumber": "104-20"
},
"attachments": false,
- "documentType": "ODD - Order of Dismissal and Decision Entered,",
+ "documentType": "ODD - Order of Dismissal and Decision Entered",
"filingDate": "2020-04-14T03:01:15.215Z",
"pending": false,
"documentContents": "Déjà vu, this is a seed order in case 104-20 filed on Apr 13 at 11:01pm ET\n",
@@ -245,7 +245,7 @@
}
],
"attachments": false,
- "documentType": "ODD - Order of Dismissal and Decision Entered,",
+ "documentType": "ODD - Order of Dismissal and Decision Entered",
"entityName": "Document",
"filingDate": "2020-04-14T03:01:15.215Z",
"pending": false,
@@ -278,7 +278,7 @@
}
],
"attachments": false,
- "documentType": "ODD - Order of Dismissal and Decision Entered,",
+ "documentType": "ODD - Order of Dismissal and Decision Entered",
"filingDate": "2020-04-14T03:01:15.215Z",
"pending": false,
"receivedAt": "2020-04-14T03:01:15.215Z",
@@ -305,7 +305,7 @@
"docketNumber": "104-20"
},
"attachments": false,
- "documentType": "ODD - Order of Dismissal and Decision Entered,",
+ "documentType": "ODD - Order of Dismissal and Decision Entered",
"filingDate": "2020-04-14T03:01:15.215Z",
"pending": false,
"documentContents": "Déjà vu, this is a seed order in case 104-20 filed on Apr 13 at 11:01pm ET\n",
diff --git a/web-api/storage/fixtures/seed/105-19.json b/web-api/storage/fixtures/seed/105-19.json
index 63309c14ca3..7e502d2384e 100755
--- a/web-api/storage/fixtures/seed/105-19.json
+++ b/web-api/storage/fixtures/seed/105-19.json
@@ -75,7 +75,8 @@
"createdAt": "2019-03-27T21:53:00.297Z",
"docketNumber": "105-19",
"docketNumberWithSuffix": "105-19",
- "status": "New"
+ "status": "New",
+ "entityName": "UserCase"
},
{
"sk": "case|6f3d97f8-1bdd-4779-a150-c076d08ad8fd",
diff --git a/web-api/storage/fixtures/seed/105-20.json b/web-api/storage/fixtures/seed/105-20.json
index e720cfda7b5..84969f6031b 100644
--- a/web-api/storage/fixtures/seed/105-20.json
+++ b/web-api/storage/fixtures/seed/105-20.json
@@ -579,8 +579,9 @@
"caseCaption": "Astra Santiago, Petitioner",
"createdAt": "2020-04-29T15:50:41.686Z",
"docketNumber": "105-20",
- "docketNumberWithSuffix": "105-19L",
- "status": "General Docket - Not at Issue"
+ "docketNumberWithSuffix": "105-20L",
+ "status": "General Docket - Not at Issue",
+ "entityName": "UserCase"
},
{
"sk": "case|28caad58-df69-4a4d-af15-6554aee7fbd6",
@@ -594,8 +595,9 @@
"caseCaption": "Astra Santiago, Petitioner",
"createdAt": "2020-04-29T15:50:41.686Z",
"docketNumber": "105-20",
- "docketNumberWithSuffix": "105-19L",
- "status": "General Docket - Not at Issue"
+ "docketNumberWithSuffix": "105-20L",
+ "status": "General Docket - Not at Issue",
+ "entityName": "UserCase"
},
{
"associatedJudge": "Chief Judge",
diff --git a/web-api/storage/fixtures/seed/106-19.json b/web-api/storage/fixtures/seed/106-19.json
index 45b49735353..fe3ce4670da 100755
--- a/web-api/storage/fixtures/seed/106-19.json
+++ b/web-api/storage/fixtures/seed/106-19.json
@@ -589,7 +589,8 @@
"caseId": "d3d92ca6-d9b3-4bd6-8328-e94a9fc36f88",
"status": "New",
"docketNumber": "106-19",
- "docketNumberWithSuffix": "106-19"
+ "docketNumberWithSuffix": "106-19",
+ "entityName": "UserCase"
},
{
"docketNumberSuffix": null,
diff --git a/web-api/storage/fixtures/seed/107-19.json b/web-api/storage/fixtures/seed/107-19.json
index c2553495261..765a79100a8 100644
--- a/web-api/storage/fixtures/seed/107-19.json
+++ b/web-api/storage/fixtures/seed/107-19.json
@@ -29,7 +29,8 @@
"caseId": "58c1f7a3-8062-42f0-a73e-8bd69b419878",
"docketNumber": "107-19",
"docketNumberWithSuffix": "107-19L",
- "status": "General Docket - At Issue (Ready for Trial)"
+ "status": "General Docket - At Issue (Ready for Trial)",
+ "entityName": "UserCase"
},
{
"sk": "case|58c1f7a3-8062-42f0-a73e-8bd69b419878",
@@ -40,7 +41,8 @@
"caseId": "58c1f7a3-8062-42f0-a73e-8bd69b419878",
"docketNumber": "107-19",
"docketNumberWithSuffix": "107-19L",
- "status": "General Docket - At Issue (Ready for Trial)"
+ "status": "General Docket - At Issue (Ready for Trial)",
+ "entityName": "UserCase"
},
{
"completedAt": "2019-08-16T17:30:10.526Z",
@@ -272,7 +274,8 @@
"caseId": "58c1f7a3-8062-42f0-a73e-8bd69b419878",
"docketNumber": "107-19",
"docketNumberWithSuffix": "107-19L",
- "status": "General Docket - At Issue (Ready for Trial)"
+ "status": "General Docket - At Issue (Ready for Trial)",
+ "entityName": "UserCase"
},
{
"sk": "case|58c1f7a3-8062-42f0-a73e-8bd69b419878",
diff --git a/web-api/storage/fixtures/seed/108-19.json b/web-api/storage/fixtures/seed/108-19.json
index 04fe4ca9652..c2166ee71ba 100644
--- a/web-api/storage/fixtures/seed/108-19.json
+++ b/web-api/storage/fixtures/seed/108-19.json
@@ -229,7 +229,8 @@
"caseId": "46c4064f-b44a-4ac3-9dfb-9ce9f00e43f5",
"docketNumber": "108-19",
"docketNumberWithSuffix": "108-19",
- "status": "Calendared"
+ "status": "Calendared",
+ "entityName": "UserCase"
},
{
"sk": "work-item|ba1c4ce7-6def-4eb8-9ac7-be844ba3a380",
diff --git a/web-api/storage/fixtures/seed/111-19.json b/web-api/storage/fixtures/seed/111-19.json
index 91e4fb8f54f..0d7a3c8df1d 100644
--- a/web-api/storage/fixtures/seed/111-19.json
+++ b/web-api/storage/fixtures/seed/111-19.json
@@ -81,7 +81,8 @@
"leadCaseId": "fd8d1139-5e54-4117-9b94-7a69359423c2",
"docketNumber": "111-19",
"docketNumberWithSuffix": "111-19L",
- "status": "Submitted"
+ "status": "Submitted",
+ "entityName": "UserCase"
},
{
"documentType": "Statement of Taxpayer Identification",
diff --git a/web-api/storage/fixtures/seed/112-19.json b/web-api/storage/fixtures/seed/112-19.json
index 1d454fffe95..ffdf7355462 100644
--- a/web-api/storage/fixtures/seed/112-19.json
+++ b/web-api/storage/fixtures/seed/112-19.json
@@ -82,7 +82,8 @@
"leadCaseId": "fd8d1139-5e54-4117-9b94-7a69359423c2",
"docketNumber": "112-19",
"docketNumberWithSuffix": "112-19L",
- "status": "Submitted"
+ "status": "Submitted",
+ "entityName": "UserCase"
},
{
"documentType": "Statement of Taxpayer Identification",
diff --git a/web-api/storage/fixtures/seed/113-19.json b/web-api/storage/fixtures/seed/113-19.json
index d2d8d55a656..42471da76ee 100644
--- a/web-api/storage/fixtures/seed/113-19.json
+++ b/web-api/storage/fixtures/seed/113-19.json
@@ -82,7 +82,8 @@
"leadCaseId": "fd8d1139-5e54-4117-9b94-7a69359423c2",
"docketNumber": "113-19",
"docketNumberWithSuffix": "113-19L",
- "status": "Submitted"
+ "status": "Submitted",
+ "entityName": "UserCase"
},
{
"documentType": "Statement of Taxpayer Identification",
diff --git a/web-api/storage/fixtures/seed/case-messages.json b/web-api/storage/fixtures/seed/case-messages.json
new file mode 100644
index 00000000000..97a43c68ed9
--- /dev/null
+++ b/web-api/storage/fixtures/seed/case-messages.json
@@ -0,0 +1,23 @@
+[
+ {
+ "attachments": [],
+ "caseId": "0bc59d5b-c2b9-41f7-92a7-03b8cadffcc0",
+ "caseStatus": "General Docket - Not at Issue",
+ "createdAt": "2020-06-05T18:02:25.280Z",
+ "docketNumber": "105-20",
+ "docketNumberWithSuffix": "105-20L",
+ "entityName": "CaseMessage",
+ "from": "Test Petitionsclerk",
+ "fromSection": "petitions",
+ "fromUserId": "3805d1ab-18d0-43ec-bafb-654e83405416",
+ "gsi1pk": "message|eb0a139a-8951-4de1-8b83-f02a27504105",
+ "message": "hello!",
+ "messageId": "eb0a139a-8951-4de1-8b83-f02a27504105",
+ "pk": "case|0bc59d5b-c2b9-41f7-92a7-03b8cadffcc0",
+ "sk": "message|eb0a139a-8951-4de1-8b83-f02a27504105",
+ "subject": "message to myself",
+ "to": "Test Petitionsclerk",
+ "toSection": "petitions",
+ "toUserId": "3805d1ab-18d0-43ec-bafb-654e83405416"
+ }
+]
diff --git a/web-api/storage/fixtures/seed/fix.js b/web-api/storage/fixtures/seed/fix.js
index b8045d985a2..47b49e9b373 100644
--- a/web-api/storage/fixtures/seed/fix.js
+++ b/web-api/storage/fixtures/seed/fix.js
@@ -20,6 +20,7 @@ const files = [
];
for (const file of files) {
+ // eslint-disable-next-line security/detect-non-literal-require
let json = require(file);
const items = [];
for (const item of json) {
diff --git a/web-api/storage/fixtures/seed/index.js b/web-api/storage/fixtures/seed/index.js
index ae4c648ba9c..1e703409d9d 100755
--- a/web-api/storage/fixtures/seed/index.js
+++ b/web-api/storage/fixtures/seed/index.js
@@ -17,6 +17,7 @@ module.exports = [
...require('./103-20.json'),
...require('./104-20.json'),
...require('./105-20.json'),
+ ...require('./case-messages.json'),
...require('./trial-sessions.json'),
...require('./trial-sessions-past.json'),
...require('./misc.json'),
diff --git a/web-api/storage/fixtures/validate-seed.js b/web-api/storage/fixtures/validate-seed.js
index 4b312eaeeea..1755c569c81 100755
--- a/web-api/storage/fixtures/validate-seed.js
+++ b/web-api/storage/fixtures/validate-seed.js
@@ -25,10 +25,9 @@ stdin.on('end', () => {
/**
* @param {Array} entry to the seedFile which ought to exist
- * @param {string} entry.seedFile the seed file that referenced the documentId
* @param {string} entry.uuid the documentId's UUID
*/
-function checkFilesExist([uuid, seedFile]) {
+function checkFilesExist([uuid]) {
const createFiles = {
[`${__dirname}/s3/noop-documents-local-us-east-1/${uuid}._S3rver_metadata.json`]: `${__dirname}/s3/noop-documents-local-us-east-1/${EXISTING_UUID}._S3rver_metadata.json`,
[`${__dirname}/s3/noop-documents-local-us-east-1/${uuid}._S3rver_object`]: `${__dirname}/s3/noop-documents-local-us-east-1/${EXISTING_UUID}._S3rver_object`,
diff --git a/web-api/storage/scripts/createUsers.js b/web-api/storage/scripts/createUsers.js
index 1c4d58f1411..8e1c5dfb83e 100644
--- a/web-api/storage/scripts/createUsers.js
+++ b/web-api/storage/scripts/createUsers.js
@@ -6,8 +6,10 @@ const {
const {
createUserRecords: createPractitionerUserRecords,
} = require('../../../shared/src/persistence/dynamo/users/createPractitionerUser.js');
+const {
+ ROLES,
+} = require('../../../shared/src/business/entities/EntityConstants');
const { omit } = require('lodash');
-const { User } = require('../../../shared/src/business/entities/User');
let usersByEmail = {};
@@ -32,9 +34,9 @@ module.exports.createUsers = async () => {
if (
[
- User.ROLES.irsPractitioner,
- User.ROLES.privatePractitioner,
- User.ROLES.inactivePractitioner,
+ ROLES.irsPractitioner,
+ ROLES.privatePractitioner,
+ ROLES.inactivePractitioner,
].includes(userRecord.role)
) {
return createPractitionerUserRecords({
diff --git a/web-api/storage/scripts/loadTest/loadTestHelpers.js b/web-api/storage/scripts/loadTest/loadTestHelpers.js
index 20699532fc3..5a40a9a8440 100644
--- a/web-api/storage/scripts/loadTest/loadTestHelpers.js
+++ b/web-api/storage/scripts/loadTest/loadTestHelpers.js
@@ -1,9 +1,10 @@
const faker = require('faker');
const {
- TrialSession,
-} = require('../../../../shared/src/business/entities/trialSessions/TrialSession');
-const { Case } = require('../../../../shared/src/business/entities/cases/Case');
-const { User } = require('../../../../shared/src/business/entities/User');
+ FILING_TYPES,
+ PROCEDURE_TYPES,
+ ROLES,
+ TRIAL_CITY_STRINGS,
+} = require('../../../../shared/src/business/entities/EntityConstants');
const createTrialSession = async ({ applicationContext }) => {
let startDate = faker.date.future(1);
@@ -35,9 +36,7 @@ const createTrialSession = async ({ applicationContext }) => {
term = 'Fall';
}
- let trialLocation = faker.random.arrayElement(
- TrialSession.TRIAL_CITY_STRINGS,
- );
+ let trialLocation = faker.random.arrayElement(TRIAL_CITY_STRINGS);
return await applicationContext.getUseCases().createTrialSessionInteractor({
applicationContext,
@@ -129,15 +128,11 @@ const createCase = async ({
postalCode: faker.address.zipCode(),
state: faker.address.stateAbbr(),
},
- filingType: faker.random.arrayElement(
- Case.FILING_TYPES[User.ROLES.petitioner],
- ),
+ filingType: faker.random.arrayElement(FILING_TYPES[ROLES.petitioner]),
hasIrsNotice: false,
partyType: 'Petitioner',
- preferredTrialCity: faker.random.arrayElement(
- TrialSession.TRIAL_CITY_STRINGS,
- ),
- procedureType: faker.random.arrayElement(Case.PROCEDURE_TYPES),
+ preferredTrialCity: faker.random.arrayElement(TRIAL_CITY_STRINGS),
+ procedureType: faker.random.arrayElement(PROCEDURE_TYPES),
},
stinFileId,
});
diff --git a/web-api/storage/scripts/loadTest/loadTestPractitioners.js b/web-api/storage/scripts/loadTest/loadTestPractitioners.js
index 05f4ba4199a..1afbc9fac2a 100644
--- a/web-api/storage/scripts/loadTest/loadTestPractitioners.js
+++ b/web-api/storage/scripts/loadTest/loadTestPractitioners.js
@@ -12,7 +12,7 @@ const cognito = new AWS.CognitoIdentityServiceProvider({
(async () => {
let practitionerUser;
- var apigateway = new AWS.APIGateway({
+ const apigateway = new AWS.APIGateway({
region: process.env.REGION,
});
const { items: apis } = await apigateway
@@ -28,14 +28,14 @@ const cognito = new AWS.CognitoIdentityServiceProvider({
return obj;
}, {});
- let token = await getUserToken({
+ const token = await getUserToken({
cognito,
env: process.env.ENV,
password: 'Testing1234$',
username: 'practitioner1@example.com',
});
- let response = await axios.get(`${services['ef-cms-users-green']}`, {
+ const response = await axios.get(`${services['ef-cms-users-green']}`, {
headers: {
Authorization: `Bearer ${token}`,
},
diff --git a/web-api/storage/scripts/loadTest/loadTestTrialSession.js b/web-api/storage/scripts/loadTest/loadTestTrialSession.js
index 5996e7c2646..67a77d8d42b 100644
--- a/web-api/storage/scripts/loadTest/loadTestTrialSession.js
+++ b/web-api/storage/scripts/loadTest/loadTestTrialSession.js
@@ -18,7 +18,7 @@ const cognito = new AWS.CognitoIdentityServiceProvider({
let petitionerUser;
let docketClerkUser;
- var apigateway = new AWS.APIGateway({
+ const apigateway = new AWS.APIGateway({
region: process.env.REGION,
});
const { items: apis } = await apigateway
diff --git a/web-api/swagger.json b/web-api/swagger.json
index 95fe05c0c7b..ddb632fd79f 100644
--- a/web-api/swagger.json
+++ b/web-api/swagger.json
@@ -1065,7 +1065,7 @@
}
}
},
- "/cases/open-cases": {
+ "/cases/open": {
"get": {
"tags": ["cases"],
"summary": "Retrieve open cases",
@@ -1109,6 +1109,50 @@
}
}
},
+ "/cases/closed": {
+ "get": {
+ "tags": ["cases"],
+ "summary": "Retrieve closed cases",
+ "description": "Retrieve closed cases.\n",
+ "produces": ["application/json"],
+ "responses": {
+ "200": {
+ "description": "200 response",
+ "schema": {
+ "$ref": "#/definitions/case"
+ }
+ }
+ },
+ "security": [
+ {
+ "CognitoUserPool": []
+ }
+ ]
+ },
+ "options": {
+ "consumes": ["application/json"],
+ "produces": ["application/json"],
+ "responses": {
+ "200": {
+ "description": "200 response",
+ "headers": {
+ "Access-Control-Allow-Origin": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Methods": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Credentials": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Headers": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
"/public-api/cases/{caseId}": {
"parameters": [
{
@@ -5453,6 +5497,354 @@
}
}
}
+ },
+ "/messages": {
+ "post": {
+ "tags": ["messages"],
+ "summary": "create a case message",
+ "description": "Create a message.\n",
+ "produces": ["application/json"],
+ "responses": {
+ "200": {
+ "description": "200 response",
+ "schema": {
+ "$ref": "#/definitions/caseMessage"
+ }
+ }
+ },
+ "security": [
+ {
+ "CognitoUserPool": []
+ }
+ ]
+ },
+ "options": {
+ "consumes": ["application/json"],
+ "produces": ["application/json"],
+ "responses": {
+ "200": {
+ "description": "200 response",
+ "headers": {
+ "Access-Control-Allow-Origin": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Methods": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Credentials": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Headers": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "/messages/{messageId}": {
+ "parameters": [
+ {
+ "name": "messageId",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "get": {
+ "tags": ["messages"],
+ "summary": "gets the message for the specific id",
+ "description": "Gets the message for the specific id.\n",
+ "produces": ["application/json"],
+ "responses": {
+ "200": {
+ "description": "200 response",
+ "schema": {
+ "$ref": "#/definitions/caseMessage"
+ }
+ }
+ },
+ "security": [
+ {
+ "CognitoUserPool": []
+ }
+ ]
+ },
+ "options": {
+ "consumes": ["application/json"],
+ "produces": ["application/json"],
+ "responses": {
+ "200": {
+ "description": "200 response",
+ "headers": {
+ "Access-Control-Allow-Origin": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Methods": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Credentials": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Headers": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "/messages/inbox/{userId}": {
+ "parameters": [
+ {
+ "name": "userId",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "get": {
+ "tags": ["messages"],
+ "summary": "gets the inbox messages for the specific user id",
+ "description": "Gets the inbox messages for the specific user id.\n",
+ "produces": ["application/json"],
+ "responses": {
+ "200": {
+ "description": "200 response",
+ "schema": {
+ "$ref": "#/definitions/caseMessage"
+ }
+ }
+ },
+ "security": [
+ {
+ "CognitoUserPool": []
+ }
+ ]
+ },
+ "options": {
+ "consumes": ["application/json"],
+ "produces": ["application/json"],
+ "responses": {
+ "200": {
+ "description": "200 response",
+ "headers": {
+ "Access-Control-Allow-Origin": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Methods": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Credentials": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Headers": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "/messages/inbox/section/{section}": {
+ "parameters": [
+ {
+ "name": "section",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "get": {
+ "tags": ["messages"],
+ "summary": "gets the inbox messages for the specific section",
+ "description": "Gets the inbox messages for the specific user section.\n",
+ "produces": ["application/json"],
+ "responses": {
+ "200": {
+ "description": "200 response",
+ "schema": {
+ "$ref": "#/definitions/caseMessage"
+ }
+ }
+ },
+ "security": [
+ {
+ "CognitoUserPool": []
+ }
+ ]
+ },
+ "options": {
+ "consumes": ["application/json"],
+ "produces": ["application/json"],
+ "responses": {
+ "200": {
+ "description": "200 response",
+ "headers": {
+ "Access-Control-Allow-Origin": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Methods": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Credentials": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Headers": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "/messages/outbox/{userId}": {
+ "parameters": [
+ {
+ "name": "userId",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "get": {
+ "tags": ["messages"],
+ "summary": "gets the outbox messages for the specific user id",
+ "description": "Gets the outbox messages for the specific user id.\n",
+ "produces": ["application/json"],
+ "responses": {
+ "200": {
+ "description": "200 response",
+ "schema": {
+ "$ref": "#/definitions/caseMessage"
+ }
+ }
+ },
+ "security": [
+ {
+ "CognitoUserPool": []
+ }
+ ]
+ },
+ "options": {
+ "consumes": ["application/json"],
+ "produces": ["application/json"],
+ "responses": {
+ "200": {
+ "description": "200 response",
+ "headers": {
+ "Access-Control-Allow-Origin": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Methods": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Credentials": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Headers": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "/messages/outbox/section/{section}": {
+ "parameters": [
+ {
+ "name": "section",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "get": {
+ "tags": ["messages"],
+ "summary": "gets the outbox messages for the specific section",
+ "description": "Gets the outbox messages for the specific user section.\n",
+ "produces": ["application/json"],
+ "responses": {
+ "200": {
+ "description": "200 response",
+ "schema": {
+ "$ref": "#/definitions/caseMessage"
+ }
+ }
+ },
+ "security": [
+ {
+ "CognitoUserPool": []
+ }
+ ]
+ },
+ "options": {
+ "consumes": ["application/json"],
+ "produces": ["application/json"],
+ "responses": {
+ "200": {
+ "description": "200 response",
+ "headers": {
+ "Access-Control-Allow-Origin": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Methods": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Credentials": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Headers": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public-api/todays-opinions": {
+ "get": {
+ "tags": ["case-documents"],
+ "summary": "returns the opinions created for the current date",
+ "description": "Returns the opinions created for the current date.\n",
+ "produces": ["application/json"],
+ "responses": {
+ "200": {
+ "description": "200 response",
+ "schema": {
+ "$ref": "#/definitions/document"
+ }
+ }
+ },
+ "security": [
+ {
+ "CognitoUserPool": []
+ }
+ ]
+ },
+ "options": {
+ "consumes": ["application/json"],
+ "produces": ["application/json"],
+ "responses": {
+ "200": {
+ "description": "200 response",
+ "headers": {
+ "Access-Control-Allow-Origin": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Methods": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Credentials": {
+ "type": "string"
+ },
+ "Access-Control-Allow-Headers": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
}
},
"securityDefinitions": {
@@ -5818,6 +6210,72 @@
}
},
"description": "a case procedural note"
+ },
+ "caseMessage": {
+ "type": "object",
+ "properties": {
+ "caseId": {
+ "type": "string",
+ "description": "id of the associated case"
+ },
+ "caseStatus": {
+ "type": "string",
+ "description": "status of the associated case"
+ },
+ "createdAt": {
+ "type": "string",
+ "description": "message created time"
+ },
+ "docketNumber": {
+ "type": "string",
+ "description": "docket number of the associated case"
+ },
+ "docketNumberWithSuffix": {
+ "type": "string",
+ "description": "docket number of the associated case with its suffix"
+ },
+ "entityName": {
+ "type": "string",
+ "description": "the name of the entity - CaseMessage"
+ },
+ "from": {
+ "type": "string",
+ "description": "the name of the user who sent the message"
+ },
+ "fromSection": {
+ "type": "string",
+ "description": "the section of the user who sent the message"
+ },
+ "fromUserId": {
+ "type": "string",
+ "description": "the ID of the user who sent the message"
+ },
+ "message": {
+ "type": "string",
+ "description": "the message text"
+ },
+ "messageId": {
+ "type": "string",
+ "description": "the unique ID generated by the system to represent the message"
+ },
+ "subject": {
+ "type": "string",
+ "description": "the subject line of the message"
+ },
+ "to": {
+ "type": "string",
+ "description": "the name of the user who is the recipient of the message"
+ },
+ "toSection": {
+ "type": "string",
+ "description": "the section of the user who is the recipient of the message"
+ },
+ "toUserId": {
+ "type": "string",
+ "description": "the ID of the user who is the recipient of the message"
+ }
+ },
+ "description": "a case deadline"
}
}
}
diff --git a/web-api/terraform/template/cognito.tf b/web-api/terraform/template/cognito.tf
index 787ec26d9d7..feb694918ac 100644
--- a/web-api/terraform/template/cognito.tf
+++ b/web-api/terraform/template/cognito.tf
@@ -106,11 +106,6 @@ resource "aws_cognito_user_pool" "irs_pool" {
enabled = true
}
- device_configuration {
- challenge_required_on_new_device = true
- device_only_remembered_on_user_prompt = false
- }
-
auto_verified_attributes = ["email"]
username_attributes = ["email"]
diff --git a/web-client/integration-tests-public/journey/unauthedUserViewsCaseDetail.js b/web-client/integration-tests-public/journey/unauthedUserViewsCaseDetail.js
index cd831e309ec..23cb7268966 100644
--- a/web-client/integration-tests-public/journey/unauthedUserViewsCaseDetail.js
+++ b/web-client/integration-tests-public/journey/unauthedUserViewsCaseDetail.js
@@ -77,7 +77,7 @@ export const unauthedUserViewsCaseDetail = test => {
documentType: 'Statement of Taxpayer Identification',
}),
expect.objectContaining({
- documentType: 'OD - Order of Dismissal Entered,',
+ documentType: 'OD - Order of Dismissal Entered',
}),
expect.objectContaining({ documentType: 'TRAN - Transcript' }),
]),
diff --git a/web-client/integration-tests-public/journey/unauthedUserViewsTodaysOpinions.js b/web-client/integration-tests-public/journey/unauthedUserViewsTodaysOpinions.js
new file mode 100644
index 00000000000..9c73d30a400
--- /dev/null
+++ b/web-client/integration-tests-public/journey/unauthedUserViewsTodaysOpinions.js
@@ -0,0 +1,18 @@
+import { refreshElasticsearchIndex } from '../../integration-tests/helpers';
+
+export const unauthedUserViewsTodaysOpinions = test => {
+ return it('should view todays opinions', async () => {
+ await refreshElasticsearchIndex();
+
+ await test.runSequence('gotoTodaysOpinionsSequence', {});
+
+ expect(test.getState('todaysOpinions')).toEqual(
+ expect.arrayContaining([
+ expect.objectContaining({
+ documentType: 'TCOP - T.C. Opinion',
+ numberOfPages: 1,
+ }),
+ ]),
+ );
+ });
+};
diff --git a/web-client/integration-tests-public/unauthedUserSearchesForCase.test.js b/web-client/integration-tests-public/unauthedUserSearchesForCase.test.js
index e1e937ddb12..5a23172d4b7 100644
--- a/web-client/integration-tests-public/unauthedUserSearchesForCase.test.js
+++ b/web-client/integration-tests-public/unauthedUserSearchesForCase.test.js
@@ -15,7 +15,7 @@ import { petitionerCreatesNewCase } from '../integration-tests/journey/petitione
import { docketClerkAddsDocketEntryFromOrderOfDismissal } from '../integration-tests/journey/docketClerkAddsDocketEntryFromOrderOfDismissal';
import { docketClerkAddsTranscriptDocketEntryFromOrder } from '../integration-tests/journey/docketClerkAddsTranscriptDocketEntryFromOrder';
import { docketClerkCreatesAnOrder } from '../integration-tests/journey/docketClerkCreatesAnOrder';
-import { docketClerkServesOrder } from '../integration-tests/journey/docketClerkServesOrder';
+import { docketClerkServesDocument } from '../integration-tests/journey/docketClerkServesDocument';
// Public User
import { unauthedUserNavigatesToPublicSite } from './journey/unauthedUserNavigatesToPublicSite';
@@ -63,7 +63,7 @@ describe('Docket clerk creates and serves an order (should be viewable to the pu
expectedDocumentType: 'Order of Dismissal',
});
docketClerkAddsDocketEntryFromOrderOfDismissal(testClient, 1);
- docketClerkServesOrder(testClient, 1);
+ docketClerkServesDocument(testClient, 1);
});
describe('Docket clerk creates and serves a transcript (should not be viewable to the public)', () => {
@@ -78,7 +78,7 @@ describe('Docket clerk creates and serves a transcript (should not be viewable t
month: '01',
year: '2019',
});
- docketClerkServesOrder(testClient, 2);
+ docketClerkServesDocument(testClient, 2);
});
describe('Unauthed user searches for a case and views a case detail page', () => {
diff --git a/web-client/integration-tests-public/unauthedUserSearchesForOrder.test.js b/web-client/integration-tests-public/unauthedUserSearchesForOrder.test.js
index 64b9bd6e261..6d3fde04268 100644
--- a/web-client/integration-tests-public/unauthedUserSearchesForOrder.test.js
+++ b/web-client/integration-tests-public/unauthedUserSearchesForOrder.test.js
@@ -1,9 +1,9 @@
-import { ContactFactory } from '../../shared/src/business/entities/contacts/ContactFactory';
+import { PARTY_TYPES } from '../../shared/src/business/entities/EntityConstants';
import { docketClerkAddsDocketEntryFromOrder } from '../integration-tests/journey/docketClerkAddsDocketEntryFromOrder';
import { docketClerkAddsDocketEntryFromOrderOfDismissal } from '../integration-tests/journey/docketClerkAddsDocketEntryFromOrderOfDismissal';
import { docketClerkCreatesAnOrder } from '../integration-tests/journey/docketClerkCreatesAnOrder';
import { docketClerkSealsCase } from '../integration-tests/journey/docketClerkSealsCase';
-import { docketClerkServesOrder } from '../integration-tests/journey/docketClerkServesOrder';
+import { docketClerkServesDocument } from '../integration-tests/journey/docketClerkServesDocument';
import {
loginAs,
setupTest as setupTestClient,
@@ -41,7 +41,7 @@ describe('Petitioner creates case', () => {
postalCode: '77546',
state: 'CT',
},
- partyType: ContactFactory.PARTY_TYPES.petitionerSpouse,
+ partyType: PARTY_TYPES.petitionerSpouse,
});
expect(caseDetail.docketNumber).toBeDefined();
test.docketNumber = caseDetail.docketNumber;
@@ -58,7 +58,7 @@ describe('Docket clerk creates orders to search for', () => {
signedAtFormatted: '01/02/2020',
});
docketClerkAddsDocketEntryFromOrder(testClient, 0);
- docketClerkServesOrder(testClient, 0);
+ docketClerkServesDocument(testClient, 0);
docketClerkCreatesAnOrder(testClient, {
documentTitle: 'Order of Dismissal',
@@ -66,7 +66,7 @@ describe('Docket clerk creates orders to search for', () => {
expectedDocumentType: 'Order of Dismissal',
});
docketClerkAddsDocketEntryFromOrderOfDismissal(testClient, 1);
- docketClerkServesOrder(testClient, 1);
+ docketClerkServesDocument(testClient, 1);
docketClerkCreatesAnOrder(testClient, {
documentTitle: 'Order of Dismissal',
diff --git a/web-client/integration-tests-public/unauthedUserSearchesForSealedCase.test.js b/web-client/integration-tests-public/unauthedUserSearchesForSealedCase.test.js
index 69d2c4ba8f3..486117d7334 100644
--- a/web-client/integration-tests-public/unauthedUserSearchesForSealedCase.test.js
+++ b/web-client/integration-tests-public/unauthedUserSearchesForSealedCase.test.js
@@ -1,15 +1,11 @@
-import { setupTest } from './helpers';
-
+import { PARTY_TYPES } from '../../shared/src/business/entities/EntityConstants';
+import { docketClerkSealsCase } from '../integration-tests/journey/docketClerkSealsCase';
import {
loginAs,
setupTest as setupTestClient,
uploadPetition,
} from '../integration-tests/helpers';
-
-import { ContactFactory } from '../../shared/src/business/entities/contacts/ContactFactory';
-
-// Public User
-import { docketClerkSealsCase } from '../integration-tests/journey/docketClerkSealsCase';
+import { setupTest } from './helpers';
import { unauthedUserNavigatesToPublicSite } from './journey/unauthedUserNavigatesToPublicSite';
import { unauthedUserSearchesForSealedCaseByName } from './journey/unauthedUserSearchesForSealedCaseByName';
import { unauthedUserSearchesForSealedCasesByDocketNumber } from './journey/unauthedUserSearchesForSealedCasesByDocketNumber';
@@ -37,7 +33,7 @@ describe('Petitioner creates cases to search for', () => {
postalCode: '77546',
state: 'CT',
},
- partyType: ContactFactory.PARTY_TYPES.petitionerSpouse,
+ partyType: PARTY_TYPES.petitionerSpouse,
});
expect(caseDetail.docketNumber).toBeDefined();
test.docketNumber = caseDetail.docketNumber;
diff --git a/web-client/integration-tests-public/unauthedUserViewsTodaysOpinions.test.js b/web-client/integration-tests-public/unauthedUserViewsTodaysOpinions.test.js
new file mode 100644
index 00000000000..1f56f402d10
--- /dev/null
+++ b/web-client/integration-tests-public/unauthedUserViewsTodaysOpinions.test.js
@@ -0,0 +1,46 @@
+import { docketClerkAddsDocketEntryFromOrder } from '../integration-tests/journey/docketClerkAddsDocketEntryFromOrder';
+import { docketClerkConvertsAnOrderToAnOpinion } from '../integration-tests/journey/docketClerkConvertsAnOrderToAnOpinion';
+import { docketClerkCreatesAnOrder } from '../integration-tests/journey/docketClerkCreatesAnOrder';
+import { docketClerkServesDocument } from '../integration-tests/journey/docketClerkServesDocument';
+import { docketClerkViewsDraftOrder } from '../integration-tests/journey/docketClerkViewsDraftOrder';
+
+import {
+ loginAs,
+ setupTest as setupTestClient,
+ uploadPetition,
+} from '../integration-tests/helpers';
+import { setupTest } from './helpers';
+import { unauthedUserViewsTodaysOpinions } from './journey/unauthedUserViewsTodaysOpinions';
+
+const test = setupTest();
+const testClient = setupTestClient({
+ useCases: {
+ loadPDFForSigningInteractor: () => Promise.resolve(null),
+ },
+});
+
+testClient.draftOrders = [];
+
+describe('Unauthed user views todays opinions', () => {
+ loginAs(testClient, 'petitioner');
+ it('Create test case to add an opinion to', async () => {
+ const caseDetail = await uploadPetition(testClient);
+ expect(caseDetail.docketNumber).toBeDefined();
+ testClient.docketNumber = caseDetail.docketNumber;
+ });
+
+ // the next few tests create an order document, then edit it to convert
+ // it to an opinion type document, and then serve that opinion in order for it to show up in todays opinions
+ loginAs(testClient, 'docketclerk');
+ docketClerkCreatesAnOrder(testClient, {
+ documentTitle: 'Order to do something',
+ eventCode: 'O',
+ expectedDocumentType: 'Order',
+ });
+ docketClerkViewsDraftOrder(testClient, 0);
+ docketClerkAddsDocketEntryFromOrder(testClient, 0);
+ docketClerkConvertsAnOrderToAnOpinion(testClient, 0);
+ docketClerkServesDocument(testClient, 0);
+
+ unauthedUserViewsTodaysOpinions(test);
+});
diff --git a/web-client/integration-tests/admissionsClerkPractitionerJourney.test.js b/web-client/integration-tests/admissionsClerkPractitionerJourney.test.js
index d0abfb701f2..9da92ae4bd2 100644
--- a/web-client/integration-tests/admissionsClerkPractitionerJourney.test.js
+++ b/web-client/integration-tests/admissionsClerkPractitionerJourney.test.js
@@ -1,4 +1,4 @@
-import { ContactFactory } from '../../shared/src/business/entities/contacts/ContactFactory';
+import { PARTY_TYPES } from '../../shared/src/business/entities/EntityConstants';
import { admissionsClerkAddsNewPractitioner } from './journey/admissionsClerkAddsNewPractitioner';
import { admissionsClerkEditsPractitionerInfo } from './journey/admissionsClerkEditsPractitionerInfo';
import { admissionsClerkSearchesForPractitionerByBarNumber } from './journey/admissionsClerkSearchesForPractitionerByBarNumber';
@@ -32,7 +32,7 @@ describe('admissions clerk practitioner journey', () => {
postalCode: '77546',
state: 'AZ',
},
- partyType: ContactFactory.PARTY_TYPES.petitionerSpouse,
+ partyType: PARTY_TYPES.petitionerSpouse,
});
expect(caseDetail.docketNumber).toBeDefined();
test.docketNumber = caseDetail.docketNumber;
diff --git a/web-client/integration-tests/docketClerkAddsCourtIssuedOrderToDocketRecord.test.js b/web-client/integration-tests/docketClerkAddsCourtIssuedOrderToDocketRecord.test.js
index ec13b48e9c1..442d1462555 100644
--- a/web-client/integration-tests/docketClerkAddsCourtIssuedOrderToDocketRecord.test.js
+++ b/web-client/integration-tests/docketClerkAddsCourtIssuedOrderToDocketRecord.test.js
@@ -5,9 +5,9 @@ import { docketClerkAddsDocketEntryFromOrder } from './journey/docketClerkAddsDo
import { docketClerkAddsDocketEntryFromOrderOfDismissal } from './journey/docketClerkAddsDocketEntryFromOrderOfDismissal';
import { docketClerkAddsDocketEntryFromOrderWithDate } from './journey/docketClerkAddsDocketEntryFromOrderWithDate';
import { docketClerkCancelsAddDocketEntryFromOrder } from './journey/docketClerkCancelsAddDocketEntryFromOrder';
+import { docketClerkConvertsAnOrderToAnOpinion } from './journey/docketClerkConvertsAnOrderToAnOpinion';
import { docketClerkCreatesAnOrder } from './journey/docketClerkCreatesAnOrder';
import { docketClerkEditsDocketEntryFromOrderTypeA } from './journey/docketClerkEditsDocketEntryFromOrderTypeA';
-import { docketClerkEditsDocketEntryFromOrderTypeB } from './journey/docketClerkEditsDocketEntryFromOrderTypeB';
import { docketClerkEditsDocketEntryFromOrderTypeC } from './journey/docketClerkEditsDocketEntryFromOrderTypeC';
import { docketClerkEditsDocketEntryFromOrderTypeD } from './journey/docketClerkEditsDocketEntryFromOrderTypeD';
import { docketClerkEditsDocketEntryFromOrderTypeE } from './journey/docketClerkEditsDocketEntryFromOrderTypeE';
@@ -64,7 +64,7 @@ describe('Docket Clerk Adds Court-Issued Order to Docket Record', () => {
docketClerkViewsDraftOrder(test, 0);
docketClerkAddsDocketEntryFromOrder(test, 0);
docketClerkEditsDocketEntryFromOrderTypeA(test, 0);
- docketClerkEditsDocketEntryFromOrderTypeB(test, 0);
+ docketClerkConvertsAnOrderToAnOpinion(test, 0);
docketClerkEditsDocketEntryFromOrderTypeC(test, 0);
docketClerkEditsDocketEntryFromOrderTypeD(test, 0);
docketClerkEditsDocketEntryFromOrderTypeE(test, 0);
diff --git a/web-client/integration-tests/docketClerkAddsTranscriptToDocketRecord.test.js b/web-client/integration-tests/docketClerkAddsTranscriptToDocketRecord.test.js
index 5f9b13bfa43..a98c673d8df 100644
--- a/web-client/integration-tests/docketClerkAddsTranscriptToDocketRecord.test.js
+++ b/web-client/integration-tests/docketClerkAddsTranscriptToDocketRecord.test.js
@@ -1,6 +1,6 @@
import { docketClerkAddsTranscriptDocketEntryFromOrder } from './journey/docketClerkAddsTranscriptDocketEntryFromOrder';
import { docketClerkCreatesAnOrder } from './journey/docketClerkCreatesAnOrder';
-import { docketClerkServesOrder } from './journey/docketClerkServesOrder';
+import { docketClerkServesDocument } from './journey/docketClerkServesDocument';
import { docketClerkViewsDraftOrder } from './journey/docketClerkViewsDraftOrder';
import { fakeFile, loginAs, setupTest } from './helpers';
import { formattedCaseDetail as formattedCaseDetailComputed } from '../src/presenter/computeds/formattedCaseDetail';
@@ -44,7 +44,7 @@ describe('Docket Clerk Adds Transcript to Docket Record', () => {
month: '01',
year: '2019',
});
- docketClerkServesOrder(test, 0);
+ docketClerkServesDocument(test, 0);
docketClerkCreatesAnOrder(test, {
documentTitle: 'Order to do something',
eventCode: 'O',
@@ -58,7 +58,7 @@ describe('Docket Clerk Adds Transcript to Docket Record', () => {
month: today.getMonth() + 1,
year: today.getFullYear(),
});
- docketClerkServesOrder(test, 1);
+ docketClerkServesDocument(test, 1);
loginAs(test, 'petitioner');
it('petitioner views transcript on docket record', async () => {
diff --git a/web-client/integration-tests/docketClerkCaseInventoryReport.test.js b/web-client/integration-tests/docketClerkCaseInventoryReport.test.js
index bb9a427c530..d2af90d805e 100644
--- a/web-client/integration-tests/docketClerkCaseInventoryReport.test.js
+++ b/web-client/integration-tests/docketClerkCaseInventoryReport.test.js
@@ -1,4 +1,4 @@
-import { Case } from '../../shared/src/business/entities/cases/Case';
+import { CASE_STATUS_TYPES } from '../../shared/src/business/entities/EntityConstants';
import { docketClerkCreatesATrialSession } from './journey/docketClerkCreatesATrialSession';
import { docketClerkViewsTrialSessionList } from './journey/docketClerkViewsTrialSessionList';
import {
@@ -30,7 +30,7 @@ describe('case inventory report journey', () => {
//New
await test.runSequence('updateScreenMetadataSequence', {
key: 'status',
- value: Case.STATUS_TYPES.new,
+ value: CASE_STATUS_TYPES.new,
});
await test.runSequence('submitCaseInventoryReportModalSequence');
initialCaseInventoryCounts.new = test.getState(
@@ -48,7 +48,7 @@ describe('case inventory report journey', () => {
//Calendared, Judge Armen
await test.runSequence('updateScreenMetadataSequence', {
key: 'status',
- value: Case.STATUS_TYPES.calendared,
+ value: CASE_STATUS_TYPES.calendared,
});
await test.runSequence('submitCaseInventoryReportModalSequence');
initialCaseInventoryCounts.calendaredArmen = test.getState(
@@ -120,7 +120,7 @@ describe('case inventory report journey', () => {
await test.runSequence('openCaseInventoryReportModalSequence');
await test.runSequence('updateScreenMetadataSequence', {
key: 'status',
- value: Case.STATUS_TYPES.new,
+ value: CASE_STATUS_TYPES.new,
});
await test.runSequence('submitCaseInventoryReportModalSequence');
let updatedCaseInventoryCount = test.getState(
@@ -144,7 +144,7 @@ describe('case inventory report journey', () => {
//Calendared, Judge Armen (+1 from initial)
await test.runSequence('updateScreenMetadataSequence', {
key: 'status',
- value: Case.STATUS_TYPES.calendared,
+ value: CASE_STATUS_TYPES.calendared,
});
await test.runSequence('submitCaseInventoryReportModalSequence');
updatedCaseInventoryCount = test.getState(
diff --git a/web-client/integration-tests/docketClerkCreatesDocketEntryFromScans.test.js b/web-client/integration-tests/docketClerkCreatesDocketEntryFromScans.test.js
index 41cb152849a..46d7fd7b247 100644
--- a/web-client/integration-tests/docketClerkCreatesDocketEntryFromScans.test.js
+++ b/web-client/integration-tests/docketClerkCreatesDocketEntryFromScans.test.js
@@ -1,80 +1,20 @@
-import { Case } from '../../shared/src/business/entities/cases/Case';
-import { CerebralTest } from 'cerebral/test';
-import { ContactFactory } from '../../shared/src/business/entities/contacts/ContactFactory';
-import { JSDOM } from 'jsdom';
-import { MAX_FILE_SIZE_MB } from '../../shared/src/persistence/s3/getUploadPolicy';
-import { TrialSession } from '../../shared/src/business/entities/trialSessions/TrialSession';
-import { User } from '../../shared/src/business/entities/User';
import {
addBatchesForScanning,
createPDFFromScannedBatches,
selectScannerSource,
-} from './scanHelpers.js';
-import { applicationContext } from '../src/applicationContext';
+} from './scanHelpers';
import { docketClerkAddsDocketEntryFile } from './journey/docketClerkAddsDocketEntryFile';
import { docketClerkAddsDocketEntryWithoutFile } from './journey/docketClerkAddsDocketEntryWithoutFile';
import { docketClerkSavesDocketEntry } from './journey/docketClerkSavesDocketEntry';
import { docketClerkViewsEditDocketRecord } from './journey/docketClerkViewsEditDocketRecord';
import { docketClerkViewsQCInProgress } from './journey/docketClerkViewsQCInProgress';
import { docketClerkViewsSectionQCInProgress } from './journey/docketClerkViewsSectionQCInProgress';
-import { getScannerInterface } from '../../shared/src/persistence/dynamsoft/getScannerMockInterface';
-import { isFunction, mapValues } from 'lodash';
-import { loginAs } from './helpers';
+import { fakeFile, loginAs, setupTest } from './helpers';
import { petitionerChoosesCaseType } from './journey/petitionerChoosesCaseType';
import { petitionerChoosesProcedureType } from './journey/petitionerChoosesProcedureType';
import { petitionerCreatesNewCase } from './journey/petitionerCreatesNewCase';
-import { presenter } from '../src/presenter/presenter';
-import { withAppContextDecorator } from '../src/withAppContext';
-import FormData from 'form-data';
-let test;
-global.FormData = FormData;
-presenter.providers.applicationContext = Object.assign(applicationContext, {
- getScanner: getScannerInterface,
-});
-presenter.providers.router = {
- createObjectURL: () => {},
- externalRoute: () => {},
- revokeObjectURL: () => {},
- route: async url => {
- if (url === `/case-detail/${test.docketNumber}`) {
- await test.runSequence('gotoCaseDetailSequence', {
- docketNumber: test.docketNumber,
- });
- }
-
- if (url === '/') {
- await test.runSequence('gotoDashboardSequence');
- }
-
- if (url === '/file-a-petition/success') {
- await test.runSequence('gotoFilePetitionSuccessSequence');
- }
- },
-};
-
-presenter.state = mapValues(presenter.state, value => {
- if (isFunction(value)) {
- return withAppContextDecorator(value, applicationContext);
- }
- return value;
-});
-
-const fakeData =
- 'JVBERi0xLjEKJcKlwrHDqwoKMSAwIG9iagogIDw8IC9UeXBlIC9DYXRhbG9nCiAgICAgL1BhZ2VzIDIgMCBSCiAgPj4KZW5kb2JqCgoyIDAgb2JqCiAgPDwgL1R5cGUgL1BhZ2VzCiAgICAgL0tpZHMgWzMgMCBSXQogICAgIC9Db3VudCAxCiAgICAgL01lZGlhQm94IFswIDAgMzAwIDE0NF0KICA+PgplbmRvYmoKCjMgMCBvYmoKICA8PCAgL1R5cGUgL1BhZ2UKICAgICAgL1BhcmVudCAyIDAgUgogICAgICAvUmVzb3VyY2VzCiAgICAgICA8PCAvRm9udAogICAgICAgICAgIDw8IC9GMQogICAgICAgICAgICAgICA8PCAvVHlwZSAvRm9udAogICAgICAgICAgICAgICAgICAvU3VidHlwZSAvVHlwZTEKICAgICAgICAgICAgICAgICAgL0Jhc2VGb250IC9UaW1lcy1Sb21hbgogICAgICAgICAgICAgICA+PgogICAgICAgICAgID4+CiAgICAgICA+PgogICAgICAvQ29udGVudHMgNCAwIFIKICA+PgplbmRvYmoKCjQgMCBvYmoKICA8PCAvTGVuZ3RoIDg0ID4+CnN0cmVhbQogIEJUCiAgICAvRjEgMTggVGYKICAgIDUgODAgVGQKICAgIChDb25ncmF0aW9ucywgeW91IGZvdW5kIHRoZSBFYXN0ZXIgRWdnLikgVGoKICBFVAplbmRzdHJlYW0KZW5kb2JqCgp4cmVmCjAgNQowMDAwMDAwMDAwIDY1NTM1IGYgCjAwMDAwMDAwMTggMDAwMDAgbiAKMDAwMDAwMDA3NyAwMDAwMCBuIAowMDAwMDAwMTc4IDAwMDAwIG4gCjAwMDAwMDA0NTcgMDAwMDAgbiAKdHJhaWxlcgogIDw8ICAvUm9vdCAxIDAgUgogICAgICAvU2l6ZSA1CiAgPj4Kc3RhcnR4cmVmCjU2NQolJUVPRgo=';
-
-const fakeFile = Buffer.from(fakeData, 'base64');
-fakeFile.name = 'fakeFile.pdf';
-
-const dom = new JSDOM(`
-
-
-`);
-
-const { window } = dom;
-const { Blob, File } = window;
-
-test = CerebralTest(presenter);
+const test = setupTest();
describe('Create Docket Entry From Scans', () => {
let scannerSourceIndex = 0;
@@ -82,44 +22,18 @@ describe('Create Docket Entry From Scans', () => {
beforeEach(() => {
jest.setTimeout(30000);
- global.alert = () => null;
- global.URL = {
- createObjectURL: () => {
- return fakeData;
- },
- revokeObjectURL: () => null,
- };
- global.window = {
- URL: global.URL,
- document: {},
- localStorage: {
- getItem: key => {
- if (key === 'scannerSourceIndex') {
- return `"${scannerSourceIndex}"`;
- }
- if (key === 'scannerSourceName') {
- return `"${scannerSourceName}"`;
- }
+ global.window.localStorage.getItem = key => {
+ if (key === 'scannerSourceIndex') {
+ return `"${scannerSourceIndex}"`;
+ }
- return null;
- },
- removeItem: () => null,
- setItem: () => null,
- },
- };
-
- global.File = File;
- global.Blob = Blob;
+ if (key === 'scannerSourceName') {
+ return `"${scannerSourceName}"`;
+ }
- test.setState('constants', {
- CASE_CAPTION_POSTFIX: Case.CASE_CAPTION_POSTFIX,
- COUNTRY_TYPES: ContactFactory.COUNTRY_TYPES,
- MAX_FILE_SIZE_MB,
- PARTY_TYPES: ContactFactory.PARTY_TYPES,
- TRIAL_CITIES: TrialSession.TRIAL_CITIES,
- USER_ROLES: User.ROLES,
- });
+ return null;
+ };
});
loginAs(test, 'petitioner');
diff --git a/web-client/integration-tests/docketClerkEditsDocketEntryMeta.test.js b/web-client/integration-tests/docketClerkEditsDocketEntryMeta.test.js
index 9d511e954ee..2b33b7793fc 100644
--- a/web-client/integration-tests/docketClerkEditsDocketEntryMeta.test.js
+++ b/web-client/integration-tests/docketClerkEditsDocketEntryMeta.test.js
@@ -7,7 +7,7 @@ import { docketClerkEditsDocketEntryMeta } from './journey/docketClerkEditsDocke
import { docketClerkNavigatesToEditDocketEntryMeta } from './journey/docketClerkNavigatesToEditDocketEntryMeta';
import { docketClerkNavigatesToEditDocketEntryMetaCourtIssued } from './journey/docketClerkNavigatesToEditDocketEntryMetaCourtIssued';
import { docketClerkQCsDocketEntry } from './journey/docketClerkQCsDocketEntry';
-import { docketClerkServesOrder } from './journey/docketClerkServesOrder';
+import { docketClerkServesDocument } from './journey/docketClerkServesDocument';
import { docketClerkVerifiesDocketEntryMetaUpdates } from './journey/docketClerkVerifiesDocketEntryMetaUpdates';
import { docketClerkVerifiesEditCourtIssuedNonstandardFields } from './journey/docketClerkVerifiesEditCourtIssuedNonstandardFields';
@@ -54,7 +54,7 @@ describe("Docket Clerk Edits a Docket Entry's Meta", () => {
expectedDocumentType: 'Order',
});
docketClerkAddsDocketEntryFromOrder(test, 0);
- docketClerkServesOrder(test, 0);
+ docketClerkServesDocument(test, 0);
docketClerkNavigatesToEditDocketEntryMetaCourtIssued(test, 4);
docketClerkEditsDocketEntryMetaCourtIssued(test);
docketClerkVerifiesDocketEntryMetaCourtIssuedUpdates(test, 4);
@@ -67,7 +67,7 @@ describe("Docket Clerk Edits a Docket Entry's Meta", () => {
expectedDocumentType: 'Order of Dismissal',
});
docketClerkAddsDocketEntryFromOrderOfDismissal(test, 1);
- docketClerkServesOrder(test, 1);
+ docketClerkServesDocument(test, 1);
docketClerkNavigatesToEditDocketEntryMetaCourtIssued(test, 5);
docketClerkVerifiesEditCourtIssuedNonstandardFieldsWithJudge(test);
});
diff --git a/web-client/integration-tests/docketClerkEditsPetitionPaymentFee.test.js b/web-client/integration-tests/docketClerkEditsPetitionPaymentFee.test.js
index 623002fa1a3..d262c346f8b 100644
--- a/web-client/integration-tests/docketClerkEditsPetitionPaymentFee.test.js
+++ b/web-client/integration-tests/docketClerkEditsPetitionPaymentFee.test.js
@@ -1,4 +1,5 @@
import { Case } from '../../shared/src/business/entities/cases/Case';
+import { PAYMENT_STATUS } from '../../shared/src/business/entities/EntityConstants';
import { loginAs, setupTest, uploadPetition } from './helpers';
const test = setupTest();
@@ -26,7 +27,7 @@ describe('docket clerk edits a petition payment fee', () => {
expect(test.getState('caseDetail.petitionPaymentDate')).toBeUndefined();
expect(test.getState('caseDetail.petitionPaymentStatus')).toEqual(
- Case.PAYMENT_STATUS.UNPAID,
+ PAYMENT_STATUS.UNPAID,
);
expect(test.getState('caseDetail.docketRecord')).not.toContainEqual({
description: 'Filing Fee Paid',
@@ -37,7 +38,7 @@ describe('docket clerk edits a petition payment fee', () => {
await test.runSequence('updateFormValueSequence', {
key: 'petitionPaymentStatus',
- value: Case.PAYMENT_STATUS.PAID,
+ value: PAYMENT_STATUS.PAID,
});
await test.runSequence('updatePetitionDetailsSequence');
@@ -71,7 +72,7 @@ describe('docket clerk edits a petition payment fee', () => {
expect(test.getState('validationErrors')).toEqual({});
expect(test.getState('caseDetail.petitionPaymentStatus')).toEqual(
- Case.PAYMENT_STATUS.PAID,
+ PAYMENT_STATUS.PAID,
);
expect(test.getState('caseDetail.petitionPaymentDate')).toEqual(
'2001-01-01T05:00:00.000Z',
diff --git a/web-client/integration-tests/docketClerkEditsPetitionerInformation.test.js b/web-client/integration-tests/docketClerkEditsPetitionerInformation.test.js
index 8042886a567..798fbe837b4 100644
--- a/web-client/integration-tests/docketClerkEditsPetitionerInformation.test.js
+++ b/web-client/integration-tests/docketClerkEditsPetitionerInformation.test.js
@@ -1,4 +1,4 @@
-import { ContactFactory } from '../../shared/src/business/entities/contacts/ContactFactory';
+import { PARTY_TYPES } from '../../shared/src/business/entities/EntityConstants';
import { loginAs, setupTest, uploadPetition } from './helpers';
const test = setupTest();
@@ -23,7 +23,7 @@ describe('docket clerk edits the petitioner information', () => {
postalCode: '77546',
state: 'CT',
},
- partyType: ContactFactory.PARTY_TYPES.petitionerSpouse,
+ partyType: PARTY_TYPES.petitionerSpouse,
});
expect(caseDetail.docketNumber).toBeDefined();
test.docketNumber = caseDetail.docketNumber;
diff --git a/web-client/integration-tests/docketClerkExternalDocumentQCWorkflow.test.js b/web-client/integration-tests/docketClerkExternalDocumentQCWorkflow.test.js
index d73fab3b8a9..b1d11403d66 100644
--- a/web-client/integration-tests/docketClerkExternalDocumentQCWorkflow.test.js
+++ b/web-client/integration-tests/docketClerkExternalDocumentQCWorkflow.test.js
@@ -1,4 +1,4 @@
-import { ContactFactory } from '../../shared/src/business/entities/contacts/ContactFactory';
+import { PARTY_TYPES } from '../../shared/src/business/entities/EntityConstants';
import {
assignWorkItems,
findWorkItemByCaseId,
@@ -50,7 +50,7 @@ describe('Create a work item', () => {
postalCode: '77546',
state: 'CT',
},
- partyType: ContactFactory.PARTY_TYPES.petitionerSpouse,
+ partyType: PARTY_TYPES.petitionerSpouse,
});
expect(caseDetail.docketNumber).toBeDefined();
});
diff --git a/web-client/integration-tests/docketClerkOrderAdvancedSearch.test.js b/web-client/integration-tests/docketClerkOrderAdvancedSearch.test.js
index ef897eba8d2..243ebf9afac 100644
--- a/web-client/integration-tests/docketClerkOrderAdvancedSearch.test.js
+++ b/web-client/integration-tests/docketClerkOrderAdvancedSearch.test.js
@@ -3,7 +3,7 @@ import { docketClerkAddsDocketEntryFromOrder } from './journey/docketClerkAddsDo
import { docketClerkAddsDocketEntryFromOrderOfDismissal } from './journey/docketClerkAddsDocketEntryFromOrderOfDismissal';
import { docketClerkCreatesAnOrder } from './journey/docketClerkCreatesAnOrder';
import { docketClerkSealsCase } from './journey/docketClerkSealsCase';
-import { docketClerkServesOrder } from './journey/docketClerkServesOrder';
+import { docketClerkServesDocument } from './journey/docketClerkServesDocument';
import {
loginAs,
refreshElasticsearchIndex,
@@ -65,7 +65,7 @@ describe('docket clerk order advanced search', () => {
signedAtFormatted: '01/02/2020',
});
docketClerkAddsDocketEntryFromOrder(test, 0);
- docketClerkServesOrder(test, 0);
+ docketClerkServesDocument(test, 0);
docketClerkCreatesAnOrder(test, {
documentTitle: 'Order of Dismissal',
@@ -80,7 +80,7 @@ describe('docket clerk order advanced search', () => {
expectedDocumentType: 'Order of Dismissal',
});
docketClerkAddsDocketEntryFromOrderOfDismissal(test, 2);
- docketClerkServesOrder(test, 2);
+ docketClerkServesDocument(test, 2);
docketClerkCreatesAnOrder(test, {
documentTitle: 'Order of something',
@@ -88,7 +88,7 @@ describe('docket clerk order advanced search', () => {
expectedDocumentType: 'Order',
});
docketClerkAddsDocketEntryFromOrder(test, 3);
- docketClerkServesOrder(test, 3);
+ docketClerkServesDocument(test, 3);
docketClerkSealsCase(test);
});
@@ -318,7 +318,7 @@ describe('docket clerk order advanced search', () => {
await test.runSequence('submitOrderAdvancedSearchSequence');
- await wait(1000);
+ await wait(2000);
expect(test.getState('searchResults')).toEqual(
expect.arrayContaining([
diff --git a/web-client/integration-tests/docketClerkSealsCase.test.js b/web-client/integration-tests/docketClerkSealsCase.test.js
index 2ee567200c1..c71e3555d73 100644
--- a/web-client/integration-tests/docketClerkSealsCase.test.js
+++ b/web-client/integration-tests/docketClerkSealsCase.test.js
@@ -1,9 +1,8 @@
-import { loginAs, setupTest, uploadPetition } from './helpers';
-
-import { ContactFactory } from '../../shared/src/business/entities/contacts/ContactFactory';
+import { PARTY_TYPES } from '../../shared/src/business/entities/EntityConstants';
import { associatedUserAdvancedSearchForSealedCase } from './journey/associatedUserAdvancedSearchForSealedCase';
import { associatedUserViewsCaseDetailForSealedCase } from './journey/associatedUserViewsCaseDetailForSealedCase';
import { docketClerkSealsCase } from './journey/docketClerkSealsCase';
+import { loginAs, setupTest, uploadPetition } from './helpers';
import { petitionsClerkAddsPractitionersToCase } from './journey/petitionsClerkAddsPractitionersToCase';
import { petitionsClerkAddsRespondentsToCase } from './journey/petitionsClerkAddsRespondentsToCase';
import { petitionsClerkViewsCaseDetail } from './journey/petitionsClerkViewsCaseDetail';
@@ -30,7 +29,7 @@ describe('Docket Clerk seals a case', () => {
postalCode: '77546',
state: 'CT',
},
- partyType: ContactFactory.PARTY_TYPES.petitionerSpouse,
+ partyType: PARTY_TYPES.petitionerSpouse,
});
expect(caseDetail.docketNumber).toBeDefined();
test.docketNumber = caseDetail.docketNumber;
diff --git a/web-client/integration-tests/docketClerkServesCourtIssuedDocument.test.js b/web-client/integration-tests/docketClerkServesCourtIssuedDocument.test.js
index 14fd3bb9b88..ef5250968f4 100644
--- a/web-client/integration-tests/docketClerkServesCourtIssuedDocument.test.js
+++ b/web-client/integration-tests/docketClerkServesCourtIssuedDocument.test.js
@@ -5,7 +5,7 @@ import { docketClerkAddsDocketEntryFromOrder } from './journey/docketClerkAddsDo
import { docketClerkAddsDocketEntryFromOrderOfDismissal } from './journey/docketClerkAddsDocketEntryFromOrderOfDismissal';
import { docketClerkCancelsAddDocketEntryFromOrder } from './journey/docketClerkCancelsAddDocketEntryFromOrder';
import { docketClerkCreatesAnOrder } from './journey/docketClerkCreatesAnOrder';
-import { docketClerkServesOrder } from './journey/docketClerkServesOrder';
+import { docketClerkServesDocument } from './journey/docketClerkServesDocument';
import { docketClerkViewsCaseDetailAfterServingCourtIssuedDocument } from './journey/docketClerkViewsCaseDetailAfterServingCourtIssuedDocument';
import { docketClerkViewsCaseDetailForCourtIssuedDocketEntry } from './journey/docketClerkViewsCaseDetailForCourtIssuedDocketEntry';
import { docketClerkViewsDraftOrder } from './journey/docketClerkViewsDraftOrder';
@@ -61,8 +61,8 @@ describe('Docket Clerk Adds Court-Issued Order to Docket Record', () => {
docketClerkViewsCaseDetailForCourtIssuedDocketEntry(test);
docketClerkViewsSavedCourtIssuedDocketEntryInProgress(test, 1);
docketClerkViewsCaseDetailForCourtIssuedDocketEntry(test);
- docketClerkServesOrder(test, 0);
+ docketClerkServesDocument(test, 0);
docketClerkViewsCaseDetailAfterServingCourtIssuedDocument(test, 0);
- docketClerkServesOrder(test, 1);
+ docketClerkServesDocument(test, 1);
docketClerkViewsCaseDetailAfterServingCourtIssuedDocument(test, 1);
});
diff --git a/web-client/integration-tests/docketClerkServesCourtIssuedDocumentForPaperCase.test.js b/web-client/integration-tests/docketClerkServesCourtIssuedDocumentForPaperCase.test.js
index 1811eb75a9c..c09375c9465 100644
--- a/web-client/integration-tests/docketClerkServesCourtIssuedDocumentForPaperCase.test.js
+++ b/web-client/integration-tests/docketClerkServesCourtIssuedDocumentForPaperCase.test.js
@@ -1,4 +1,4 @@
-import { Case } from '../../shared/src/business/entities/cases/Case';
+import { CASE_STATUS_TYPES } from '../../shared/src/business/entities/EntityConstants';
import { fakeFile, loginAs, setupTest } from './helpers';
// docketClerk
@@ -42,6 +42,6 @@ describe('Docket Clerk Adds Court-Issued Order to Docket Record', () => {
docketClerkViewsCaseDetailAfterServingCourtIssuedDocument(
test,
0,
- Case.STATUS_TYPES.generalDocket,
+ CASE_STATUS_TYPES.generalDocket,
);
});
diff --git a/web-client/integration-tests/docketClerkUpdatesDocketEntries.test.js b/web-client/integration-tests/docketClerkUpdatesDocketEntries.test.js
index 1de7bba48f9..bdc48d3813c 100644
--- a/web-client/integration-tests/docketClerkUpdatesDocketEntries.test.js
+++ b/web-client/integration-tests/docketClerkUpdatesDocketEntries.test.js
@@ -1,4 +1,4 @@
-import { ContactFactory } from '../../shared/src/business/entities/contacts/ContactFactory';
+import { PARTY_TYPES } from '../../shared/src/business/entities/EntityConstants';
import { docketClerkAddsDocketEntryWithoutFile } from './journey/docketClerkAddsDocketEntryWithoutFile';
import { docketClerkEditsDocketEntryNonstandardA } from './journey/docketClerkEditsDocketEntryNonstandardA';
import { docketClerkEditsDocketEntryNonstandardB } from './journey/docketClerkEditsDocketEntryNonstandardB';
@@ -32,7 +32,7 @@ describe('docket clerk updates docket entries', () => {
postalCode: '77546',
state: 'AZ',
},
- partyType: ContactFactory.PARTY_TYPES.petitionerSpouse,
+ partyType: PARTY_TYPES.petitionerSpouse,
});
expect(caseDetail.docketNumber).toBeDefined();
test.docketNumber = caseDetail.docketNumber;
diff --git a/web-client/integration-tests/documentServiceEmailSentOnServe.test.js b/web-client/integration-tests/documentServiceEmailSentOnServe.test.js
index 3ee6091ea07..449571e44a8 100644
--- a/web-client/integration-tests/documentServiceEmailSentOnServe.test.js
+++ b/web-client/integration-tests/documentServiceEmailSentOnServe.test.js
@@ -7,7 +7,7 @@ import {
import { docketClerkAddsDocketEntryFromOrder } from './journey/docketClerkAddsDocketEntryFromOrder';
import { docketClerkCreatesAnOrder } from './journey/docketClerkCreatesAnOrder';
-import { docketClerkServesOrder } from './journey/docketClerkServesOrder';
+import { docketClerkServesDocument } from './journey/docketClerkServesDocument';
import { docketClerkViewsCaseDetailForCourtIssuedDocketEntry } from './journey/docketClerkViewsCaseDetailForCourtIssuedDocketEntry';
import { docketClerkViewsDraftOrder } from './journey/docketClerkViewsDraftOrder';
@@ -38,7 +38,7 @@ describe.skip('Document Service Email Sent on Serve', () => {
docketClerkViewsCaseDetailForCourtIssuedDocketEntry(test);
docketClerkViewsDraftOrder(test, 0);
docketClerkAddsDocketEntryFromOrder(test, 0);
- docketClerkServesOrder(test, 0);
+ docketClerkServesDocument(test, 0);
it('should send the expected emails for parties', async () => {
const emails = await getEmailsForAddress('petitioner');
diff --git a/web-client/integration-tests/externalUserOrderAdvancedSearch.test.js b/web-client/integration-tests/externalUserOrderAdvancedSearch.test.js
index 923f866bd78..351106a3b3f 100644
--- a/web-client/integration-tests/externalUserOrderAdvancedSearch.test.js
+++ b/web-client/integration-tests/externalUserOrderAdvancedSearch.test.js
@@ -2,7 +2,7 @@ import { associatedUserSearchesForServedOrder } from './journey/associatedUserSe
import { docketClerkAddsDocketEntryFromOrder } from './journey/docketClerkAddsDocketEntryFromOrder';
import { docketClerkCreatesAnOrder } from './journey/docketClerkCreatesAnOrder';
import { docketClerkSealsCase } from './journey/docketClerkSealsCase';
-import { docketClerkServesOrder } from './journey/docketClerkServesOrder';
+import { docketClerkServesDocument } from './journey/docketClerkServesDocument';
import {
loginAs,
refreshElasticsearchIndex,
@@ -47,7 +47,7 @@ describe('external users perform an advanced search for orders', () => {
expectedDocumentType: 'Order',
});
docketClerkAddsDocketEntryFromOrder(test, 0);
- docketClerkServesOrder(test, 0);
+ docketClerkServesDocument(test, 0);
it('refresh elasticsearch index', async () => {
await refreshElasticsearchIndex();
});
diff --git a/web-client/integration-tests/externalUserViewsOpenAndClosedCases.test.js b/web-client/integration-tests/externalUserViewsOpenAndClosedCases.test.js
new file mode 100644
index 00000000000..8dacba4c4f2
--- /dev/null
+++ b/web-client/integration-tests/externalUserViewsOpenAndClosedCases.test.js
@@ -0,0 +1,33 @@
+import { docketClerkUpdatesCaseStatusToClosed } from './journey/docketClerkUpdatesCaseStatusToClosed';
+import { irsPractitionerViewsOpenAndClosedCases } from './journey/irsPractitionerViewsOpenAndClosedCases';
+import { loginAs, setupTest, uploadPetition } from './helpers';
+import { petitionerViewsOpenAndClosedCases } from './journey/petitionerViewsOpenAndClosedCases';
+import { privatePractitionerViewsOpenAndClosedCases } from './journey/privatePractitionerViewsOpenClosedCases';
+
+const test = setupTest();
+
+describe('external user views open and closed cases', () => {
+ beforeAll(() => {
+ jest.setTimeout(30000);
+ loginAs(test, 'docketclerk');
+ });
+
+ loginAs(test, 'petitioner');
+ it('login as a petitioner and create the case to close', async () => {
+ const caseDetail = await uploadPetition(test);
+ expect(caseDetail.docketNumber).toBeDefined();
+ test.docketNumber = caseDetail.docketNumber;
+ });
+
+ loginAs(test, 'docketclerk');
+ docketClerkUpdatesCaseStatusToClosed(test);
+
+ loginAs(test, 'petitioner');
+ petitionerViewsOpenAndClosedCases(test);
+
+ loginAs(test, 'privatePractitioner');
+ privatePractitionerViewsOpenAndClosedCases(test);
+
+ loginAs(test, 'irsPractitioner');
+ irsPractitionerViewsOpenAndClosedCases(test);
+});
diff --git a/web-client/integration-tests/helpers.js b/web-client/integration-tests/helpers.js
index dbf5ab39427..f5cf2473bec 100644
--- a/web-client/integration-tests/helpers.js
+++ b/web-client/integration-tests/helpers.js
@@ -1,6 +1,8 @@
/* eslint-disable jest/no-export */
-import { CerebralTest } from 'cerebral/test';
+import { CerebralTest, runCompute } from 'cerebral/test';
+import { DynamoDB } from 'aws-sdk';
import { JSDOM } from 'jsdom';
+import { PARTY_TYPES } from '../../shared/src/business/entities/EntityConstants';
import { applicationContext } from '../src/applicationContext';
import {
back,
@@ -10,8 +12,6 @@ import {
revokeObjectURL,
router,
} from '../src/router';
-
-import { DynamoDB } from 'aws-sdk';
import { formattedWorkQueue as formattedWorkQueueComputed } from '../src/presenter/computeds/formattedWorkQueue';
import { getScannerInterface } from '../../shared/src/persistence/dynamsoft/getScannerMockInterface';
import {
@@ -20,7 +20,6 @@ import {
} from '../../shared/src/business/useCases/scannerMockFiles';
import { isFunction, mapValues } from 'lodash';
import { presenter } from '../src/presenter/presenter';
-import { runCompute } from 'cerebral/test';
import { socketProvider } from '../src/providers/socket';
import { socketRouter } from '../src/providers/socketRouter';
import { userMap } from '../../shared/src/test/mockUserTokenMap';
@@ -31,9 +30,6 @@ import axios from 'axios';
import { workQueueHelper as workQueueHelperComputed } from '../src/presenter/computeds/workQueueHelper';
import FormData from 'form-data';
-const {
- ContactFactory,
-} = require('../../shared/src/business/entities/contacts/ContactFactory');
const formattedWorkQueue = withAppContextDecorator(formattedWorkQueueComputed);
const workQueueHelper = withAppContextDecorator(workQueueHelperComputed);
@@ -384,7 +380,7 @@ export const uploadPetition = async (
contactSecondary: overrides.contactSecondary || {},
filingType: 'Myself',
hasIrsNotice: false,
- partyType: overrides.partyType || ContactFactory.PARTY_TYPES.petitioner,
+ partyType: overrides.partyType || PARTY_TYPES.petitioner,
preferredTrialCity: overrides.preferredTrialCity || 'Seattle, Washington',
procedureType: overrides.procedureType || 'Regular',
};
@@ -562,6 +558,7 @@ export const setupTest = ({ useCases = {} } = {}) => {
export const gotoRoute = (routes, routeToGoTo) => {
for (let route of routes) {
+ // eslint-disable-next-line security/detect-non-literal-regexp
const regex = new RegExp(
route.route.replace(/\*/g, '([a-z\\-A-Z0-9]+)').replace(/\.\./g, '(.*)') +
'$',
diff --git a/web-client/integration-tests/journey/captureCreatedCase.js b/web-client/integration-tests/journey/captureCreatedCase.js
index 3d8a2bd21e2..0374a5bd230 100644
--- a/web-client/integration-tests/journey/captureCreatedCase.js
+++ b/web-client/integration-tests/journey/captureCreatedCase.js
@@ -5,7 +5,7 @@ export const captureCreatedCase = (
) => {
return it('Capture Created Case', async () => {
await test.runSequence('gotoDashboardSequence');
- createdCases.push(`${test.getState('cases.0.caseId')}`);
- createdDocketNumbers.push(`${test.getState('cases.0.docketNumber')}`);
+ createdCases.push(`${test.getState('openCases.0.caseId')}`);
+ createdDocketNumbers.push(`${test.getState('openCases.0.docketNumber')}`);
});
};
diff --git a/web-client/integration-tests/journey/chambersUserViewsCaseDetail.js b/web-client/integration-tests/journey/chambersUserViewsCaseDetail.js
index e851aae20f7..676d90a3248 100644
--- a/web-client/integration-tests/journey/chambersUserViewsCaseDetail.js
+++ b/web-client/integration-tests/journey/chambersUserViewsCaseDetail.js
@@ -1,4 +1,7 @@
-import { Case } from '../../../shared/src/business/entities/cases/Case';
+import {
+ CASE_STATUS_TYPES,
+ CHIEF_JUDGE,
+} from '../../../shared/src/business/entities/EntityConstants';
export const chambersUserViewsCaseDetail = (
test,
@@ -13,12 +16,10 @@ export const chambersUserViewsCaseDetail = (
expect(test.getState('currentPage')).toEqual('CaseDetailInternal');
expect(test.getState('caseDetail.docketNumber')).toEqual(test.docketNumber);
- expect(test.getState('caseDetail.status')).toEqual(Case.STATUS_TYPES.new);
+ expect(test.getState('caseDetail.status')).toEqual(CASE_STATUS_TYPES.new);
expect(test.getState('caseDetail.documents').length).toEqual(
expectedDocumentCount,
);
- expect(test.getState('caseDetail.associatedJudge')).toEqual(
- Case.CHIEF_JUDGE,
- );
+ expect(test.getState('caseDetail.associatedJudge')).toEqual(CHIEF_JUDGE);
});
};
diff --git a/web-client/integration-tests/journey/chambersUserViewsCaseDetailAfterAddingOrder.js b/web-client/integration-tests/journey/chambersUserViewsCaseDetailAfterAddingOrder.js
index 9c4e9dc8829..f65e6c19220 100644
--- a/web-client/integration-tests/journey/chambersUserViewsCaseDetailAfterAddingOrder.js
+++ b/web-client/integration-tests/journey/chambersUserViewsCaseDetailAfterAddingOrder.js
@@ -1,4 +1,4 @@
-import { Case } from '../../../shared/src/business/entities/cases/Case';
+import { CASE_STATUS_TYPES } from '../../../shared/src/business/entities/EntityConstants';
export const chambersUserViewsCaseDetailAfterAddingOrder = test => {
return it('Chambers user views case detail after adding order', async () => {
@@ -10,7 +10,7 @@ export const chambersUserViewsCaseDetailAfterAddingOrder = test => {
expect(test.getState('currentPage')).toEqual('CaseDetailInternal');
expect(test.getState('caseDetail.docketNumber')).toEqual(test.docketNumber);
- expect(test.getState('caseDetail.status')).toEqual(Case.STATUS_TYPES.new);
+ expect(test.getState('caseDetail.status')).toEqual(CASE_STATUS_TYPES.new);
expect(test.getState('caseDetail.documents').length).toEqual(3);
expect(
test
diff --git a/web-client/integration-tests/journey/docketClerkAddsDocketEntryFromOrderOfDismissal.js b/web-client/integration-tests/journey/docketClerkAddsDocketEntryFromOrderOfDismissal.js
index 7071da58c0f..99932332636 100644
--- a/web-client/integration-tests/journey/docketClerkAddsDocketEntryFromOrderOfDismissal.js
+++ b/web-client/integration-tests/journey/docketClerkAddsDocketEntryFromOrderOfDismissal.js
@@ -40,7 +40,7 @@ export const docketClerkAddsDocketEntryFromOrderOfDismissal = (
expect(test.getState('form.eventCode')).toEqual('OD');
expect(test.getState('form.documentType')).toEqual(
- 'OD - Order of Dismissal Entered,',
+ 'OD - Order of Dismissal Entered',
);
expect(helperComputed.showJudge).toBeTruthy();
expect(test.getState('form.judge')).toBeFalsy();
diff --git a/web-client/integration-tests/journey/docketClerkEditsDocketEntryFromOrderTypeB.js b/web-client/integration-tests/journey/docketClerkConvertsAnOrderToAnOpinion.js
similarity index 98%
rename from web-client/integration-tests/journey/docketClerkEditsDocketEntryFromOrderTypeB.js
rename to web-client/integration-tests/journey/docketClerkConvertsAnOrderToAnOpinion.js
index 20a5a4ea3b7..9b75a7ed2b1 100644
--- a/web-client/integration-tests/journey/docketClerkEditsDocketEntryFromOrderTypeB.js
+++ b/web-client/integration-tests/journey/docketClerkConvertsAnOrderToAnOpinion.js
@@ -3,7 +3,7 @@ import { formattedCaseDetail } from '../../src/presenter/computeds/formattedCase
import { runCompute } from 'cerebral/test';
import { withAppContextDecorator } from '../../src/withAppContext';
-export const docketClerkEditsDocketEntryFromOrderTypeB = (
+export const docketClerkConvertsAnOrderToAnOpinion = (
test,
draftOrderIndex,
) => {
diff --git a/web-client/integration-tests/journey/docketClerkEditsServiceIndicatorForPetitioner.js b/web-client/integration-tests/journey/docketClerkEditsServiceIndicatorForPetitioner.js
index b90c3d16205..fa6c6f550aa 100644
--- a/web-client/integration-tests/journey/docketClerkEditsServiceIndicatorForPetitioner.js
+++ b/web-client/integration-tests/journey/docketClerkEditsServiceIndicatorForPetitioner.js
@@ -1,4 +1,4 @@
-import { SERVICE_INDICATOR_TYPES } from '../../../shared/src/business/entities/cases/CaseConstants';
+import { SERVICE_INDICATOR_TYPES } from '../../../shared/src/business/entities/EntityConstants';
export const docketClerkEditsServiceIndicatorForPetitioner = test => {
return it('docket clerk edits service indicator for a petitioner', async () => {
diff --git a/web-client/integration-tests/journey/docketClerkEditsServiceIndicatorForPractitioner.js b/web-client/integration-tests/journey/docketClerkEditsServiceIndicatorForPractitioner.js
index 26dae8ab341..c5d9d2d0926 100644
--- a/web-client/integration-tests/journey/docketClerkEditsServiceIndicatorForPractitioner.js
+++ b/web-client/integration-tests/journey/docketClerkEditsServiceIndicatorForPractitioner.js
@@ -1,4 +1,4 @@
-import { SERVICE_INDICATOR_TYPES } from '../../../shared/src/business/entities/cases/CaseConstants';
+import { SERVICE_INDICATOR_TYPES } from '../../../shared/src/business/entities/EntityConstants';
export const docketClerkEditsServiceIndicatorForPractitioner = test => {
return it('docket clerk edits service indicator for a practitioner', async () => {
diff --git a/web-client/integration-tests/journey/docketClerkEditsServiceIndicatorForRespondent.js b/web-client/integration-tests/journey/docketClerkEditsServiceIndicatorForRespondent.js
index b1d4942d664..310f19ad0ae 100644
--- a/web-client/integration-tests/journey/docketClerkEditsServiceIndicatorForRespondent.js
+++ b/web-client/integration-tests/journey/docketClerkEditsServiceIndicatorForRespondent.js
@@ -1,4 +1,4 @@
-import { SERVICE_INDICATOR_TYPES } from '../../../shared/src/business/entities/cases/CaseConstants';
+import { SERVICE_INDICATOR_TYPES } from '../../../shared/src/business/entities/EntityConstants';
export const docketClerkEditsServiceIndicatorForRespondent = test => {
return it('docket clerk edits service indicator for a respondent', async () => {
diff --git a/web-client/integration-tests/journey/docketClerkServesOrder.js b/web-client/integration-tests/journey/docketClerkServesDocument.js
similarity index 93%
rename from web-client/integration-tests/journey/docketClerkServesOrder.js
rename to web-client/integration-tests/journey/docketClerkServesDocument.js
index dae03a377a9..edbc00ec9b3 100644
--- a/web-client/integration-tests/journey/docketClerkServesOrder.js
+++ b/web-client/integration-tests/journey/docketClerkServesDocument.js
@@ -2,7 +2,7 @@ import { formattedCaseDetail } from '../../src/presenter/computeds/formattedCase
import { runCompute } from 'cerebral/test';
import { withAppContextDecorator } from '../../src/withAppContext';
-export const docketClerkServesOrder = (test, draftOrderIndex) => {
+export const docketClerkServesDocument = (test, draftOrderIndex) => {
return it(`Docket Clerk serves the order after the docket entry has been created ${draftOrderIndex}`, async () => {
let caseDetailFormatted;
diff --git a/web-client/integration-tests/journey/docketClerkSetsCaseReadyForTrial.js b/web-client/integration-tests/journey/docketClerkSetsCaseReadyForTrial.js
index 8777425cadd..13e27d0878b 100644
--- a/web-client/integration-tests/journey/docketClerkSetsCaseReadyForTrial.js
+++ b/web-client/integration-tests/journey/docketClerkSetsCaseReadyForTrial.js
@@ -1,4 +1,6 @@
-const { Case } = require('../../../shared/src/business/entities/cases/Case');
+const {
+ CASE_STATUS_TYPES,
+} = require('../../../shared/src/business/entities/EntityConstants');
export const docketClerkSetsCaseReadyForTrial = test => {
return it('Docket clerk sets a case ready for trial', async () => {
@@ -8,21 +10,21 @@ export const docketClerkSetsCaseReadyForTrial = test => {
});
expect(test.getState('caseDetail.docketNumber')).toEqual(test.docketNumber);
expect(test.getState('caseDetail.status')).toEqual(
- Case.STATUS_TYPES.generalDocket,
+ CASE_STATUS_TYPES.generalDocket,
);
await test.runSequence('openUpdateCaseModalSequence');
await test.runSequence('updateModalValueSequence', {
key: 'caseStatus',
- value: Case.STATUS_TYPES.generalDocketReadyForTrial,
+ value: CASE_STATUS_TYPES.generalDocketReadyForTrial,
});
await test.runSequence('submitUpdateCaseModalSequence');
expect(test.getState('caseDetail.docketNumber')).toEqual(test.docketNumber);
expect(test.getState('caseDetail.status')).toEqual(
- Case.STATUS_TYPES.generalDocketReadyForTrial,
+ CASE_STATUS_TYPES.generalDocketReadyForTrial,
);
if (test.casesReadyForTrial) {
diff --git a/web-client/integration-tests/journey/docketClerkUpdatesCaseStatusFromCalendaredToSubmitted.js b/web-client/integration-tests/journey/docketClerkUpdatesCaseStatusFromCalendaredToSubmitted.js
index 4c7a3a95c6a..407cbad0ced 100644
--- a/web-client/integration-tests/journey/docketClerkUpdatesCaseStatusFromCalendaredToSubmitted.js
+++ b/web-client/integration-tests/journey/docketClerkUpdatesCaseStatusFromCalendaredToSubmitted.js
@@ -1,4 +1,4 @@
-import { Case } from '../../../shared/src/business/entities/cases/Case';
+import { CASE_STATUS_TYPES } from '../../../shared/src/business/entities/EntityConstants';
export const docketClerkUpdatesCaseStatusFromCalendaredToSubmitted = test => {
return it('Docket clerk updates case status from Calendared to Submitted with an associated judge', async () => {
@@ -9,7 +9,7 @@ export const docketClerkUpdatesCaseStatusFromCalendaredToSubmitted = test => {
});
expect(test.getState('caseDetail.status')).toEqual(
- Case.STATUS_TYPES.calendared,
+ CASE_STATUS_TYPES.calendared,
);
await test.runSequence('openUpdateCaseModalSequence');
@@ -17,16 +17,16 @@ export const docketClerkUpdatesCaseStatusFromCalendaredToSubmitted = test => {
expect(test.getState('modal.showModal')).toEqual('UpdateCaseModalDialog');
expect(test.getState('modal.caseStatus')).toEqual(
- Case.STATUS_TYPES.calendared,
+ CASE_STATUS_TYPES.calendared,
);
await test.runSequence('updateModalValueSequence', {
key: 'caseStatus',
- value: Case.STATUS_TYPES.submitted,
+ value: CASE_STATUS_TYPES.submitted,
});
expect(test.getState('modal.caseStatus')).toEqual(
- Case.STATUS_TYPES.submitted,
+ CASE_STATUS_TYPES.submitted,
);
// the current judge on the case is selected by default.
@@ -53,7 +53,7 @@ export const docketClerkUpdatesCaseStatusFromCalendaredToSubmitted = test => {
expect(test.getState('validationErrors')).toEqual({});
expect(test.getState('caseDetail.status')).toEqual(
- Case.STATUS_TYPES.submitted,
+ CASE_STATUS_TYPES.submitted,
);
expect(test.getState('caseDetail.associatedJudge')).toEqual('Judge Buch');
expect(test.getState('modal')).toEqual({});
diff --git a/web-client/integration-tests/journey/docketClerkUpdatesCaseStatusToClosed.js b/web-client/integration-tests/journey/docketClerkUpdatesCaseStatusToClosed.js
new file mode 100644
index 00000000000..11a1e277d65
--- /dev/null
+++ b/web-client/integration-tests/journey/docketClerkUpdatesCaseStatusToClosed.js
@@ -0,0 +1,35 @@
+import { CASE_STATUS_TYPES } from '../../../shared/src/business/entities/EntityConstants';
+import { refreshElasticsearchIndex } from '../helpers';
+
+export const docketClerkUpdatesCaseStatusToClosed = test => {
+ return it('Docket clerk updates case status to closed', async () => {
+ test.setState('caseDetail', {});
+
+ await test.runSequence('gotoCaseDetailSequence', {
+ docketNumber: test.docketNumber,
+ });
+
+ const currentStatus = test.getState('caseDetail.status');
+
+ await test.runSequence('openUpdateCaseModalSequence');
+
+ expect(test.getState('modal.showModal')).toEqual('UpdateCaseModalDialog');
+
+ expect(test.getState('modal.caseStatus')).toEqual(currentStatus);
+
+ await test.runSequence('updateModalValueSequence', {
+ key: 'caseStatus',
+ value: CASE_STATUS_TYPES.closed,
+ });
+
+ await test.runSequence('submitUpdateCaseModalSequence');
+
+ await refreshElasticsearchIndex();
+
+ expect(test.getState('caseDetail.status')).toEqual(
+ CASE_STATUS_TYPES.closed,
+ );
+
+ expect(test.getState('modal')).toEqual({});
+ });
+};
diff --git a/web-client/integration-tests/journey/docketClerkUpdatesCaseStatusToReadyForTrial.js b/web-client/integration-tests/journey/docketClerkUpdatesCaseStatusToReadyForTrial.js
index 41b5c5fbd3e..40ca168a127 100644
--- a/web-client/integration-tests/journey/docketClerkUpdatesCaseStatusToReadyForTrial.js
+++ b/web-client/integration-tests/journey/docketClerkUpdatesCaseStatusToReadyForTrial.js
@@ -1,4 +1,7 @@
-import { Case } from '../../../shared/src/business/entities/cases/Case';
+import {
+ CASE_STATUS_TYPES,
+ CHIEF_JUDGE,
+} from '../../../shared/src/business/entities/EntityConstants';
export const docketClerkUpdatesCaseStatusToReadyForTrial = test => {
return it('Docket clerk updates case status to General Docket - At Issue (Ready for Trial)', async () => {
@@ -18,7 +21,7 @@ export const docketClerkUpdatesCaseStatusToReadyForTrial = test => {
await test.runSequence('updateModalValueSequence', {
key: 'caseStatus',
- value: Case.STATUS_TYPES.generalDocket,
+ value: CASE_STATUS_TYPES.generalDocket,
});
await test.runSequence('clearModalSequence');
@@ -33,17 +36,15 @@ export const docketClerkUpdatesCaseStatusToReadyForTrial = test => {
await test.runSequence('updateModalValueSequence', {
key: 'caseStatus',
- value: Case.STATUS_TYPES.generalDocketReadyForTrial,
+ value: CASE_STATUS_TYPES.generalDocketReadyForTrial,
});
await test.runSequence('submitUpdateCaseModalSequence');
expect(test.getState('caseDetail.status')).toEqual(
- Case.STATUS_TYPES.generalDocketReadyForTrial,
- );
- expect(test.getState('caseDetail.associatedJudge')).toEqual(
- Case.CHIEF_JUDGE,
+ CASE_STATUS_TYPES.generalDocketReadyForTrial,
);
+ expect(test.getState('caseDetail.associatedJudge')).toEqual(CHIEF_JUDGE);
expect(test.getState('modal')).toEqual({});
});
};
diff --git a/web-client/integration-tests/journey/docketClerkViewsCaseDetailAfterServingCourtIssuedDocument.js b/web-client/integration-tests/journey/docketClerkViewsCaseDetailAfterServingCourtIssuedDocument.js
index ef86757fc78..cc4ed74bba5 100644
--- a/web-client/integration-tests/journey/docketClerkViewsCaseDetailAfterServingCourtIssuedDocument.js
+++ b/web-client/integration-tests/journey/docketClerkViewsCaseDetailAfterServingCourtIssuedDocument.js
@@ -1,4 +1,4 @@
-import { Case } from '../../../shared/src/business/entities/cases/Case';
+import { CASE_STATUS_TYPES } from '../../../shared/src/business/entities/EntityConstants';
export const docketClerkViewsCaseDetailAfterServingCourtIssuedDocument = (
test,
@@ -20,10 +20,10 @@ export const docketClerkViewsCaseDetailAfterServingCourtIssuedDocument = (
if (expectedCaseStatus) {
expect(test.getState('caseDetail.status')).toEqual(expectedCaseStatus);
} else if (orderDocument.eventCode === 'O') {
- expect(test.getState('caseDetail.status')).toEqual(Case.STATUS_TYPES.new);
+ expect(test.getState('caseDetail.status')).toEqual(CASE_STATUS_TYPES.new);
} else {
expect(test.getState('caseDetail.status')).toEqual(
- Case.STATUS_TYPES.closed,
+ CASE_STATUS_TYPES.closed,
);
expect(test.getState('caseDetail.highPriority')).toEqual(false);
}
diff --git a/web-client/integration-tests/journey/docketClerkViewsInactiveCasesForTrialSession.js b/web-client/integration-tests/journey/docketClerkViewsInactiveCasesForTrialSession.js
index 74a7dbf72af..f311e3f6235 100644
--- a/web-client/integration-tests/journey/docketClerkViewsInactiveCasesForTrialSession.js
+++ b/web-client/integration-tests/journey/docketClerkViewsInactiveCasesForTrialSession.js
@@ -1,4 +1,4 @@
-import { Case } from '../../../shared/src/business/entities/cases/Case';
+import { CASE_STATUS_TYPES } from '../../../shared/src/business/entities/EntityConstants';
import { formattedTrialSessionDetails as formattedTrialSessionDetailsComputed } from '../../src/presenter/computeds/formattedTrialSessionDetails';
import { runCompute } from 'cerebral/test';
import { withAppContextDecorator } from '../../src/withAppContext';
@@ -25,7 +25,7 @@ export const docketClerkViewsInactiveCasesForTrialSession = test => {
test.caseId,
);
expect(trialSessionDetailsFormatted.inactiveCases[0].disposition).toEqual(
- `Status was changed to ${Case.STATUS_TYPES.submitted}`,
+ `Status was changed to ${CASE_STATUS_TYPES.submitted}`,
);
});
};
diff --git a/web-client/integration-tests/journey/irsPractitionerViewsOpenAndClosedCases.js b/web-client/integration-tests/journey/irsPractitionerViewsOpenAndClosedCases.js
new file mode 100644
index 00000000000..4099c6ced3c
--- /dev/null
+++ b/web-client/integration-tests/journey/irsPractitionerViewsOpenAndClosedCases.js
@@ -0,0 +1,13 @@
+import { refreshElasticsearchIndex } from '../helpers';
+
+export const irsPractitionerViewsOpenAndClosedCases = test => {
+ return it('irs practitoner views open and closed cases', async () => {
+ await refreshElasticsearchIndex();
+
+ await test.runSequence('gotoDashboardSequence');
+
+ expect(test.getState('currentPage')).toEqual('DashboardRespondent');
+ expect(test.getState('openCases').length).toBeGreaterThan(0);
+ expect(test.getState('closedCases').length).toBeGreaterThan(0);
+ });
+};
diff --git a/web-client/integration-tests/journey/irsSuperuserAdvancedSearchForCase.js b/web-client/integration-tests/journey/irsSuperuserAdvancedSearchForCase.js
index baa8850828b..1d1c780b008 100644
--- a/web-client/integration-tests/journey/irsSuperuserAdvancedSearchForCase.js
+++ b/web-client/integration-tests/journey/irsSuperuserAdvancedSearchForCase.js
@@ -1,5 +1,5 @@
+import { COUNTRY_TYPES } from '../../../shared/src/business/entities/EntityConstants';
import { CaseSearch } from '../../../shared/src/business/entities/cases/CaseSearch';
-import { ContactFactory } from '../../../shared/src/business/entities/contacts/ContactFactory';
import { refreshElasticsearchIndex } from '../helpers';
export const irsSuperuserAdvancedSearchForCase = test => {
@@ -50,7 +50,7 @@ export const irsSuperuserAdvancedSearchForCase = test => {
await test.runSequence('updateAdvancedSearchFormValueSequence', {
formType: 'caseSearchByName',
key: 'countryType',
- value: ContactFactory.COUNTRY_TYPES.INTERNATIONAL,
+ value: COUNTRY_TYPES.INTERNATIONAL,
});
await test.runSequence('submitCaseAdvancedSearchSequence');
diff --git a/web-client/integration-tests/journey/petitionerCreatesNewCase.js b/web-client/integration-tests/journey/petitionerCreatesNewCase.js
index 0978f0ac21a..ac90069b4bd 100644
--- a/web-client/integration-tests/journey/petitionerCreatesNewCase.js
+++ b/web-client/integration-tests/journey/petitionerCreatesNewCase.js
@@ -122,6 +122,6 @@ export const petitionerCreatesNewCase = (test, fakeFile, overrides = {}) => {
expect(test.getState('currentPage')).toBe('DashboardPetitioner');
- test.docketNumber = test.getState('cases.0.docketNumber');
+ test.docketNumber = test.getState('openCases.0.docketNumber');
});
};
diff --git a/web-client/integration-tests/journey/petitionerCreatesNewCaseTestAllOptions.js b/web-client/integration-tests/journey/petitionerCreatesNewCaseTestAllOptions.js
index df3f9b5d321..6a3787b5488 100644
--- a/web-client/integration-tests/journey/petitionerCreatesNewCaseTestAllOptions.js
+++ b/web-client/integration-tests/journey/petitionerCreatesNewCaseTestAllOptions.js
@@ -1,5 +1,5 @@
import { Case } from '../../../shared/src/business/entities/cases/Case';
-import { ContactFactory } from '../../../shared/src/business/entities/contacts/ContactFactory';
+import { PARTY_TYPES } from '../../../shared/src/business/entities/EntityConstants';
import { runCompute } from 'cerebral/test';
import { startCaseHelper as startCaseHelperComputed } from '../../src/presenter/computeds/startCaseHelper';
import { withAppContextDecorator } from '../../src/withAppContext';
@@ -282,7 +282,7 @@ export const petitionerCreatesNewCaseTestAllOptions = (
await test.runSequence('updateStartCaseFormValueSequence', {
key: 'businessType',
- value: ContactFactory.PARTY_TYPES.partnershipOtherThanTaxMatters,
+ value: PARTY_TYPES.partnershipOtherThanTaxMatters,
});
result = runCompute(startCaseHelper, {
@@ -304,7 +304,7 @@ export const petitionerCreatesNewCaseTestAllOptions = (
await test.runSequence('updateStartCaseFormValueSequence', {
key: 'businessType',
- value: ContactFactory.PARTY_TYPES.partnershipBBA,
+ value: PARTY_TYPES.partnershipBBA,
});
result = runCompute(startCaseHelper, {
@@ -338,7 +338,7 @@ export const petitionerCreatesNewCaseTestAllOptions = (
await test.runSequence('updateStartCaseFormValueSequence', {
key: 'estateType',
- value: ContactFactory.PARTY_TYPES.estate,
+ value: PARTY_TYPES.estate,
});
result = runCompute(startCaseHelper, {
@@ -370,7 +370,7 @@ export const petitionerCreatesNewCaseTestAllOptions = (
await test.runSequence('updateStartCaseFormValueSequence', {
key: 'estateType',
- value: ContactFactory.PARTY_TYPES.estateWithoutExecutor,
+ value: PARTY_TYPES.estateWithoutExecutor,
});
result = runCompute(startCaseHelper, {
@@ -529,7 +529,7 @@ export const petitionerCreatesNewCaseTestAllOptions = (
await test.runSequence('updateStartCaseFormValueSequence', {
key: 'minorIncompetentType',
- value: ContactFactory.PARTY_TYPES.nextFriendForMinor,
+ value: PARTY_TYPES.nextFriendForMinor,
});
result = runCompute(startCaseHelper, {
@@ -561,7 +561,7 @@ export const petitionerCreatesNewCaseTestAllOptions = (
await test.runSequence('updateStartCaseFormValueSequence', {
key: 'minorIncompetentType',
- value: ContactFactory.PARTY_TYPES.nextFriendForIncompetentPerson,
+ value: PARTY_TYPES.nextFriendForIncompetentPerson,
});
result = runCompute(startCaseHelper, {
diff --git a/web-client/integration-tests/journey/petitionerVerifiesConsolidatedCases.js b/web-client/integration-tests/journey/petitionerVerifiesConsolidatedCases.js
index 20f37983281..51ef97fb080 100644
--- a/web-client/integration-tests/journey/petitionerVerifiesConsolidatedCases.js
+++ b/web-client/integration-tests/journey/petitionerVerifiesConsolidatedCases.js
@@ -1,6 +1,6 @@
export const petitionerVerifiesConsolidatedCases = test => {
return it('Petitioner verifies there are consolidated cases', async () => {
- const cases = test.getState('cases');
+ const cases = test.getState('openCases');
const casesWithConsolidation = cases.filter(
caseDetail => !!caseDetail.leadCaseId,
diff --git a/web-client/integration-tests/journey/petitionerVerifiesUnconsolidatedCases.js b/web-client/integration-tests/journey/petitionerVerifiesUnconsolidatedCases.js
index 71a4ee9f5f7..040d815dcef 100644
--- a/web-client/integration-tests/journey/petitionerVerifiesUnconsolidatedCases.js
+++ b/web-client/integration-tests/journey/petitionerVerifiesUnconsolidatedCases.js
@@ -1,6 +1,6 @@
export const petitionerVerifiesUnconsolidatedCases = test => {
return it('Petitioner verifies the cases were unconsolidated', async () => {
- const cases = test.getState('cases');
+ const cases = test.getState('openCases');
const casesWithConsolidation = cases.filter(
caseDetail => caseDetail.leadCaseId === test.leadCaseId,
diff --git a/web-client/integration-tests/journey/petitionerViewsDashboard.js b/web-client/integration-tests/journey/petitionerViewsDashboard.js
index 53869020d1d..c12cc577645 100644
--- a/web-client/integration-tests/journey/petitionerViewsDashboard.js
+++ b/web-client/integration-tests/journey/petitionerViewsDashboard.js
@@ -1,8 +1,13 @@
+import { refreshElasticsearchIndex } from '../helpers';
+
export const petitionerViewsDashboard = test => {
return it('petitioner views dashboard', async () => {
+ await refreshElasticsearchIndex();
+
await test.runSequence('gotoDashboardSequence');
+
expect(test.getState('currentPage')).toEqual('DashboardPetitioner');
- expect(test.getState('cases').length).toBeGreaterThan(0);
- test.docketNumber = test.getState('cases.0.docketNumber');
+ expect(test.getState('openCases').length).toBeGreaterThan(0);
+ test.docketNumber = test.getState('openCases.0.docketNumber');
});
};
diff --git a/web-client/integration-tests/journey/petitionerViewsOpenAndClosedCases.js b/web-client/integration-tests/journey/petitionerViewsOpenAndClosedCases.js
new file mode 100644
index 00000000000..b0251f8e9fe
--- /dev/null
+++ b/web-client/integration-tests/journey/petitionerViewsOpenAndClosedCases.js
@@ -0,0 +1,15 @@
+import { refreshElasticsearchIndex } from '../helpers';
+
+export const petitionerViewsOpenAndClosedCases = test => {
+ return it('petitioner views open and closed cases', async () => {
+ await refreshElasticsearchIndex();
+
+ await test.runSequence('gotoDashboardSequence');
+
+ expect(test.getState('currentPage')).toEqual('DashboardPetitioner');
+ expect(test.getState('openCases').length).toBeGreaterThan(0);
+ expect(test.getState('closedCases')[0]).toMatchObject({
+ docketNumber: test.docketNumber,
+ });
+ });
+};
diff --git a/web-client/integration-tests/journey/petitionsClerk1ViewsMessageDetail.js b/web-client/integration-tests/journey/petitionsClerk1ViewsMessageDetail.js
new file mode 100644
index 00000000000..079715a68c4
--- /dev/null
+++ b/web-client/integration-tests/journey/petitionsClerk1ViewsMessageDetail.js
@@ -0,0 +1,12 @@
+export const petitionsClerk1ViewsMessageDetail = test => {
+ return it('petitions clerk 1 views the message detail for the message they received', async () => {
+ await test.runSequence('gotoMessageDetailSequence', {
+ docketNumber: test.docketNumber,
+ messageId: test.messageId,
+ });
+
+ expect(test.getState('messageDetail')).toMatchObject({
+ messageId: test.messageId,
+ });
+ });
+};
diff --git a/web-client/integration-tests/journey/petitionsClerk1ViewsMessageInbox.js b/web-client/integration-tests/journey/petitionsClerk1ViewsMessageInbox.js
new file mode 100644
index 00000000000..3ba7e957e2d
--- /dev/null
+++ b/web-client/integration-tests/journey/petitionsClerk1ViewsMessageInbox.js
@@ -0,0 +1,18 @@
+export const petitionsClerk1ViewsMessageInbox = test => {
+ return it('petitions clerk 1 views their messages inbox', async () => {
+ await test.runSequence('gotoCaseMessagesSequence', {
+ box: 'inbox',
+ queue: 'my',
+ });
+
+ const messages = test.getState('messages');
+
+ const foundMessage = messages.find(
+ message => message.subject === test.testMessageSubject,
+ );
+
+ expect(foundMessage).toBeDefined();
+
+ test.messageId = foundMessage.messageId;
+ });
+};
diff --git a/web-client/integration-tests/journey/petitionsClerkAddsDeficiencyStatisticToCase.js b/web-client/integration-tests/journey/petitionsClerkAddsDeficiencyStatisticToCase.js
index cbf59e1027e..fbbb97947e8 100644
--- a/web-client/integration-tests/journey/petitionsClerkAddsDeficiencyStatisticToCase.js
+++ b/web-client/integration-tests/journey/petitionsClerkAddsDeficiencyStatisticToCase.js
@@ -1,4 +1,4 @@
-import { Case } from '../../../shared/src/business/entities/cases/Case';
+import { CASE_TYPES_MAP } from '../../../shared/src/business/entities/EntityConstants';
import { Statistic } from '../../../shared/src/business/entities/Statistic';
export const petitionsClerkAddsDeficiencyStatisticToCase = test => {
@@ -14,7 +14,7 @@ export const petitionsClerkAddsDeficiencyStatisticToCase = test => {
});
await test.runSequence('updateFormValueSequence', {
key: 'caseType',
- value: Case.CASE_TYPES_MAP.deficiency,
+ value: CASE_TYPES_MAP.deficiency,
});
await test.runSequence('refreshStatisticsSequence');
await test.runSequence('updateFormValueSequence', {
diff --git a/web-client/integration-tests/journey/petitionsClerkAdvancedSearchForCase.js b/web-client/integration-tests/journey/petitionsClerkAdvancedSearchForCase.js
index ffe9cf23ab6..c806ec7261c 100644
--- a/web-client/integration-tests/journey/petitionsClerkAdvancedSearchForCase.js
+++ b/web-client/integration-tests/journey/petitionsClerkAdvancedSearchForCase.js
@@ -1,5 +1,5 @@
+import { COUNTRY_TYPES } from '../../../shared/src/business/entities/EntityConstants';
import { CaseSearch } from '../../../shared/src/business/entities/cases/CaseSearch';
-import { ContactFactory } from '../../../shared/src/business/entities/contacts/ContactFactory';
import { refreshElasticsearchIndex } from '../helpers';
export const petitionsClerkAdvancedSearchForCase = test => {
@@ -50,7 +50,7 @@ export const petitionsClerkAdvancedSearchForCase = test => {
await test.runSequence('updateAdvancedSearchFormValueSequence', {
formType: 'caseSearchByName',
key: 'countryType',
- value: ContactFactory.COUNTRY_TYPES.INTERNATIONAL,
+ value: COUNTRY_TYPES.INTERNATIONAL,
});
await test.runSequence('submitCaseAdvancedSearchSequence');
diff --git a/web-client/integration-tests/journey/petitionsClerkBlocksCase.js b/web-client/integration-tests/journey/petitionsClerkBlocksCase.js
index 8c1eb1bbb89..08a49bfdb78 100644
--- a/web-client/integration-tests/journey/petitionsClerkBlocksCase.js
+++ b/web-client/integration-tests/journey/petitionsClerkBlocksCase.js
@@ -1,4 +1,4 @@
-import { Case } from '../../../shared/src/business/entities/cases/Case';
+import { CASE_STATUS_TYPES } from '../../../shared/src/business/entities/EntityConstants';
import { refreshElasticsearchIndex } from '../helpers';
export const petitionsClerkBlocksCase = (test, trialLocation) => {
@@ -45,7 +45,7 @@ export const petitionsClerkBlocksCase = (test, trialLocation) => {
'Daenerys Stormborn of the House Targaryen, First of Her Name, the Unburnt, Queen of the Andals and the First Men, Khaleesi of the Great Grass Sea, Breaker of Chains, and Mother of Dragons, Deceased, Daenerys Stormborn of the House Targaryen, First of Her Name, the Unburnt, Queen of the Andals and the First Men, Khaleesi of the Great Grass Sea, Breaker of Chains, and Mother of Dragons, Surviving Spouse, Petitioner',
docketNumber: test.docketNumber,
docketNumberSuffix: 'S',
- status: Case.STATUS_TYPES.generalDocketReadyForTrial,
+ status: CASE_STATUS_TYPES.generalDocketReadyForTrial,
}),
]),
);
diff --git a/web-client/integration-tests/journey/petitionsClerkCreatesNewCase.js b/web-client/integration-tests/journey/petitionsClerkCreatesNewCase.js
index 9283f88aa01..2462ca7417b 100644
--- a/web-client/integration-tests/journey/petitionsClerkCreatesNewCase.js
+++ b/web-client/integration-tests/journey/petitionsClerkCreatesNewCase.js
@@ -1,5 +1,5 @@
-import { Case } from '../../../shared/src/business/entities/cases/Case';
import { CaseInternal } from '../../../shared/src/business/entities/cases/CaseInternal';
+import { PAYMENT_STATUS } from '../../../shared/src/business/entities/EntityConstants';
const { VALIDATION_ERROR_MESSAGES } = CaseInternal;
@@ -183,7 +183,7 @@ export const petitionsClerkCreatesNewCase = (
await test.runSequence('updatePetitionPaymentFormValueSequence', {
key: 'petitionPaymentStatus',
- value: Case.PAYMENT_STATUS.UNPAID,
+ value: PAYMENT_STATUS.UNPAID,
});
await test.runSequence('validatePetitionFromPaperSequence');
diff --git a/web-client/integration-tests/journey/petitionsClerkCreatesNewCaseFromPaper.js b/web-client/integration-tests/journey/petitionsClerkCreatesNewCaseFromPaper.js
index 8870d363adb..2eb8c1b2964 100644
--- a/web-client/integration-tests/journey/petitionsClerkCreatesNewCaseFromPaper.js
+++ b/web-client/integration-tests/journey/petitionsClerkCreatesNewCaseFromPaper.js
@@ -1,6 +1,8 @@
-import { Case } from '../../../shared/src/business/entities/cases/Case';
import { CaseInternal } from '../../../shared/src/business/entities/cases/CaseInternal';
-import { ContactFactory } from '../../../shared/src/business/entities/contacts/ContactFactory';
+import {
+ PARTY_TYPES,
+ PAYMENT_STATUS,
+} from '../../../shared/src/business/entities/EntityConstants';
import { reviewSavedPetitionHelper as reviewSavedPetitionHelperComputed } from '../../src/presenter/computeds/reviewSavedPetitionHelper';
import { runCompute } from 'cerebral/test';
import { withAppContextDecorator } from '../../src/withAppContext';
@@ -90,7 +92,7 @@ export const petitionsClerkCreatesNewCaseFromPaper = (
},
{
key: 'partyType',
- value: ContactFactory.PARTY_TYPES.petitionerDeceasedSpouse,
+ value: PARTY_TYPES.petitionerDeceasedSpouse,
},
{
key: 'contactPrimary.countryType',
@@ -131,7 +133,7 @@ export const petitionsClerkCreatesNewCaseFromPaper = (
},
{
key: 'petitionPaymentStatus',
- value: Case.PAYMENT_STATUS.WAIVED,
+ value: PAYMENT_STATUS.WAIVED,
},
{
key: 'paymentDateWaivedDay',
diff --git a/web-client/integration-tests/journey/petitionsClerkCreatesNewMessageOnCase.js b/web-client/integration-tests/journey/petitionsClerkCreatesNewMessageOnCase.js
new file mode 100644
index 00000000000..6d86fb858ed
--- /dev/null
+++ b/web-client/integration-tests/journey/petitionsClerkCreatesNewMessageOnCase.js
@@ -0,0 +1,46 @@
+import { NewCaseMessage } from '../../../shared/src/business/entities/NewCaseMessage';
+import { refreshElasticsearchIndex } from '../helpers';
+
+export const petitionsClerkCreatesNewMessageOnCase = test => {
+ return it('petitions clerk creates new message on a case', async () => {
+ await test.runSequence('gotoCaseDetailSequence', {
+ docketNumber: test.docketNumber,
+ });
+
+ await test.runSequence('openCreateCaseMessageModalSequence');
+
+ await test.runSequence('updateCreateCaseMessageValueInModalSequence', {
+ key: 'toSection',
+ value: 'petitions',
+ });
+
+ await test.runSequence('updateCreateCaseMessageValueInModalSequence', {
+ key: 'toUserId',
+ value: '4805d1ab-18d0-43ec-bafb-654e83405416', //petitionsclerk1
+ });
+
+ test.testMessageSubject = `what kind of bear is best? ${Date.now()}`;
+
+ await test.runSequence('updateCreateCaseMessageValueInModalSequence', {
+ key: 'subject',
+ value: test.testMessageSubject,
+ });
+
+ await test.runSequence('createCaseMessageSequence');
+
+ expect(test.getState('validationErrors')).toEqual({
+ message: NewCaseMessage.VALIDATION_ERROR_MESSAGES.message,
+ });
+
+ await test.runSequence('updateCreateCaseMessageValueInModalSequence', {
+ key: 'message',
+ value: 'bears, beets, battlestar galactica',
+ });
+
+ await test.runSequence('createCaseMessageSequence');
+
+ expect(test.getState('validationErrors')).toEqual({});
+
+ await refreshElasticsearchIndex();
+ });
+};
diff --git a/web-client/integration-tests/journey/petitionsClerkSubmitsCaseToIrs.js b/web-client/integration-tests/journey/petitionsClerkSubmitsCaseToIrs.js
index b722e9bc95b..66866854aa0 100644
--- a/web-client/integration-tests/journey/petitionsClerkSubmitsCaseToIrs.js
+++ b/web-client/integration-tests/journey/petitionsClerkSubmitsCaseToIrs.js
@@ -1,3 +1,4 @@
+import { CASE_STATUS_TYPES } from '../../../shared/src/business/entities/EntityConstants';
import { Case } from '../../../shared/src/business/entities/cases/Case';
const { VALIDATION_ERROR_MESSAGES } = Case;
@@ -61,7 +62,7 @@ export const petitionsClerkSubmitsCaseToIrs = test => {
'2017-12-24T05:00:00.000Z',
);
expect(test.getState('caseDetail.status')).toEqual(
- Case.STATUS_TYPES.generalDocket,
+ CASE_STATUS_TYPES.generalDocket,
);
//check that documents were served
const documents = test.getState('caseDetail.documents');
diff --git a/web-client/integration-tests/journey/petitionsClerkSubmitsPaperCaseToIrs.js b/web-client/integration-tests/journey/petitionsClerkSubmitsPaperCaseToIrs.js
index c19d9fed6f9..c2a3cc3f3d8 100644
--- a/web-client/integration-tests/journey/petitionsClerkSubmitsPaperCaseToIrs.js
+++ b/web-client/integration-tests/journey/petitionsClerkSubmitsPaperCaseToIrs.js
@@ -1,5 +1,8 @@
+import {
+ CASE_STATUS_TYPES,
+ ROLES,
+} from '../../../shared/src/business/entities/EntityConstants';
import { Case } from '../../../shared/src/business/entities/cases/Case';
-import { User } from '../../../shared/src/business/entities/User';
const { VALIDATION_ERROR_MESSAGES } = Case;
@@ -64,14 +67,14 @@ export const petitionsClerkSubmitsPaperCaseToIrs = test => {
'2017-12-24T05:00:00.000Z',
);
expect(test.getState('caseDetail.status')).toEqual(
- Case.STATUS_TYPES.generalDocket,
+ CASE_STATUS_TYPES.generalDocket,
);
//check that documents were served
const documents = test.getState('caseDetail.documents');
for (const document of documents) {
expect(document.servedAt).toBeDefined();
expect(document.servedParties.length).toEqual(1);
- expect(document.servedParties[0].role).toEqual(User.ROLES.irsSuperuser);
+ expect(document.servedParties[0].role).toEqual(ROLES.irsSuperuser);
}
});
};
diff --git a/web-client/integration-tests/journey/petitionsClerkUpdatesCaseDetail.js b/web-client/integration-tests/journey/petitionsClerkUpdatesCaseDetail.js
index 7e2aca793b5..b8720a24db0 100644
--- a/web-client/integration-tests/journey/petitionsClerkUpdatesCaseDetail.js
+++ b/web-client/integration-tests/journey/petitionsClerkUpdatesCaseDetail.js
@@ -1,4 +1,5 @@
import { Case } from '../../../shared/src/business/entities/cases/Case';
+import { PAYMENT_STATUS } from '../../../shared/src/business/entities/EntityConstants';
const { VALIDATION_ERROR_MESSAGES } = Case;
@@ -125,7 +126,7 @@ export const petitionsClerkUpdatesCaseDetail = test => {
// petitionPaymentDate
await test.runSequence('updateFormValueSequence', {
key: 'petitionPaymentStatus',
- value: Case.PAYMENT_STATUS.PAID,
+ value: PAYMENT_STATUS.PAID,
});
await test.runSequence('saveSavedCaseForLaterSequence');
diff --git a/web-client/integration-tests/journey/petitionsClerkVerifiesOrderForOdsCheckbox.js b/web-client/integration-tests/journey/petitionsClerkVerifiesOrderForOdsCheckbox.js
index b54cbea1276..e68096be014 100644
--- a/web-client/integration-tests/journey/petitionsClerkVerifiesOrderForOdsCheckbox.js
+++ b/web-client/integration-tests/journey/petitionsClerkVerifiesOrderForOdsCheckbox.js
@@ -1,5 +1,5 @@
import { CaseInternal } from '../../../shared/src/business/entities/cases/CaseInternal';
-import { ContactFactory } from '../../../shared/src/business/entities/contacts/ContactFactory';
+import { PARTY_TYPES } from '../../../shared/src/business/entities/EntityConstants';
export const petitionsClerkVerifiesOrderForOdsCheckbox = (test, fakeFile) => {
return it('Petitions clerk verifies that the Order for ODS checkbox is correctly checked and unchecked', async () => {
@@ -9,14 +9,14 @@ export const petitionsClerkVerifiesOrderForOdsCheckbox = (test, fakeFile) => {
await test.runSequence('updateStartCaseInternalPartyTypeSequence', {
key: 'partyType',
- value: ContactFactory.PARTY_TYPES.petitioner,
+ value: PARTY_TYPES.petitioner,
});
expect(test.getState('form.orderForOds')).toBeFalsy();
await test.runSequence('updateStartCaseInternalPartyTypeSequence', {
key: 'partyType',
- value: ContactFactory.PARTY_TYPES.corporation,
+ value: PARTY_TYPES.corporation,
});
expect(test.getState('form.orderForOds')).toBeTruthy();
diff --git a/web-client/integration-tests/journey/petitionsClerkVerifiesPetitionPaymentFeeOptions.js b/web-client/integration-tests/journey/petitionsClerkVerifiesPetitionPaymentFeeOptions.js
index d033003fb2d..c2a6943b42b 100644
--- a/web-client/integration-tests/journey/petitionsClerkVerifiesPetitionPaymentFeeOptions.js
+++ b/web-client/integration-tests/journey/petitionsClerkVerifiesPetitionPaymentFeeOptions.js
@@ -1,5 +1,6 @@
import { Case } from '../../../shared/src/business/entities/cases/Case';
import { CaseInternal } from '../../../shared/src/business/entities/cases/CaseInternal';
+import { PAYMENT_STATUS } from '../../../shared/src/business/entities/EntityConstants';
export const petitionsClerkVerifiesPetitionPaymentFeeOptions = (
test,
@@ -14,7 +15,7 @@ export const petitionsClerkVerifiesPetitionPaymentFeeOptions = (
await test.runSequence('updatePetitionPaymentFormValueSequence', {
key: 'petitionPaymentStatus',
- value: Case.PAYMENT_STATUS.PAID,
+ value: PAYMENT_STATUS.PAID,
});
expect(test.getState('form.orderForFilingFee')).toEqual(false);
@@ -55,7 +56,7 @@ export const petitionsClerkVerifiesPetitionPaymentFeeOptions = (
await test.runSequence('updatePetitionPaymentFormValueSequence', {
key: 'petitionPaymentStatus',
- value: Case.PAYMENT_STATUS.UNPAID,
+ value: PAYMENT_STATUS.UNPAID,
});
expect(test.getState('form.orderForFilingFee')).toEqual(true);
@@ -71,7 +72,7 @@ export const petitionsClerkVerifiesPetitionPaymentFeeOptions = (
await test.runSequence('updatePetitionPaymentFormValueSequence', {
key: 'petitionPaymentStatus',
- value: Case.PAYMENT_STATUS.WAIVED,
+ value: PAYMENT_STATUS.WAIVED,
});
expect(test.getState('form.orderForFilingFee')).toEqual(false);
diff --git a/web-client/integration-tests/journey/petitionsClerkViewsCaseDetail.js b/web-client/integration-tests/journey/petitionsClerkViewsCaseDetail.js
index bd2700209eb..3c15675417b 100644
--- a/web-client/integration-tests/journey/petitionsClerkViewsCaseDetail.js
+++ b/web-client/integration-tests/journey/petitionsClerkViewsCaseDetail.js
@@ -1,4 +1,7 @@
-import { Case } from '../../../shared/src/business/entities/cases/Case';
+import {
+ CASE_STATUS_TYPES,
+ CHIEF_JUDGE,
+} from '../../../shared/src/business/entities/EntityConstants';
export const petitionsClerkViewsCaseDetail = (
test,
@@ -13,13 +16,11 @@ export const petitionsClerkViewsCaseDetail = (
expect(test.getState('currentPage')).toEqual('CaseDetailInternal');
expect(test.getState('caseDetail.docketNumber')).toEqual(test.docketNumber);
- expect(test.getState('caseDetail.status')).toEqual(Case.STATUS_TYPES.new);
+ expect(test.getState('caseDetail.status')).toEqual(CASE_STATUS_TYPES.new);
expect(test.getState('caseDetail.documents').length).toEqual(
expectedDocumentCount,
);
- expect(test.getState('caseDetail.associatedJudge')).toEqual(
- Case.CHIEF_JUDGE,
- );
+ expect(test.getState('caseDetail.associatedJudge')).toEqual(CHIEF_JUDGE);
const caseDetail = test.getState('caseDetail');
diff --git a/web-client/integration-tests/journey/petitionsClerkViewsCaseDetailAfterAddingNotice.js b/web-client/integration-tests/journey/petitionsClerkViewsCaseDetailAfterAddingNotice.js
index e7e917f039e..5b97bc60267 100644
--- a/web-client/integration-tests/journey/petitionsClerkViewsCaseDetailAfterAddingNotice.js
+++ b/web-client/integration-tests/journey/petitionsClerkViewsCaseDetailAfterAddingNotice.js
@@ -1,4 +1,4 @@
-import { Case } from '../../../shared/src/business/entities/cases/Case';
+import { CASE_STATUS_TYPES } from '../../../shared/src/business/entities/EntityConstants';
export const petitionsClerkViewsCaseDetailAfterAddingNotice = test => {
return it('Petitions clerk views case detail after adding notice', async () => {
@@ -8,7 +8,7 @@ export const petitionsClerkViewsCaseDetailAfterAddingNotice = test => {
});
expect(test.getState('currentPage')).toEqual('CaseDetailInternal');
expect(test.getState('caseDetail.docketNumber')).toEqual(test.docketNumber);
- expect(test.getState('caseDetail.status')).toEqual(Case.STATUS_TYPES.new);
+ expect(test.getState('caseDetail.status')).toEqual(CASE_STATUS_TYPES.new);
expect(test.getState('caseDetail.documents').length).toEqual(3);
expect(
test
diff --git a/web-client/integration-tests/journey/petitionsClerkViewsCaseDetailAfterAddingOrder.js b/web-client/integration-tests/journey/petitionsClerkViewsCaseDetailAfterAddingOrder.js
index ec1c9ede1a9..cbe84ac2986 100644
--- a/web-client/integration-tests/journey/petitionsClerkViewsCaseDetailAfterAddingOrder.js
+++ b/web-client/integration-tests/journey/petitionsClerkViewsCaseDetailAfterAddingOrder.js
@@ -1,4 +1,4 @@
-import { Case } from '../../../shared/src/business/entities/cases/Case';
+import { CASE_STATUS_TYPES } from '../../../shared/src/business/entities/EntityConstants';
export const petitionsClerkViewsCaseDetailAfterAddingOrder = test => {
return it('Petitions clerk views case detail after adding order', async () => {
@@ -8,7 +8,7 @@ export const petitionsClerkViewsCaseDetailAfterAddingOrder = test => {
});
expect(test.getState('currentPage')).toEqual('CaseDetailInternal');
expect(test.getState('caseDetail.docketNumber')).toEqual(test.docketNumber);
- expect(test.getState('caseDetail.status')).toEqual(Case.STATUS_TYPES.new);
+ expect(test.getState('caseDetail.status')).toEqual(CASE_STATUS_TYPES.new);
expect(test.getState('caseDetail.documents').length).toEqual(3);
expect(
test
diff --git a/web-client/integration-tests/journey/petitionsClerkViewsMessages.js b/web-client/integration-tests/journey/petitionsClerkViewsMessages.js
index dc5c563826f..95c7cfa6529 100644
--- a/web-client/integration-tests/journey/petitionsClerkViewsMessages.js
+++ b/web-client/integration-tests/journey/petitionsClerkViewsMessages.js
@@ -1,4 +1,4 @@
-import { Case } from '../../../shared/src/business/entities/cases/Case';
+import { CASE_STATUS_TYPES } from '../../../shared/src/business/entities/EntityConstants';
export const petitionsClerkViewsMessages = test => {
return it('Petitions clerk views messages', async () => {
@@ -19,7 +19,7 @@ export const petitionsClerkViewsMessages = test => {
workItem.document.documentType === 'Petition',
);
expect(workItem).toBeDefined();
- expect(workItem.caseStatus).toEqual(Case.STATUS_TYPES.new);
+ expect(workItem.caseStatus).toEqual(CASE_STATUS_TYPES.new);
expect(workItem.messages[0].message).toEqual(
'Petition filed by Daenerys Stormborn of the House Targaryen, First of Her Name, the Unburnt, Queen of the Andals and the First Men, Khaleesi of the Great Grass Sea, Breaker of Chains, and Mother of Dragons, Deceased, Daenerys Stormborn of the House Targaryen, First of Her Name, the Unburnt, Queen of the Andals and the First Men, Khaleesi of the Great Grass Sea, Breaker of Chains, and Mother of Dragons 2, Surviving Spouse is ready for review.',
);
diff --git a/web-client/integration-tests/journey/petitionsClerkViewsSentMessagesBox.js b/web-client/integration-tests/journey/petitionsClerkViewsSentMessagesBox.js
new file mode 100644
index 00000000000..a42ba012c8f
--- /dev/null
+++ b/web-client/integration-tests/journey/petitionsClerkViewsSentMessagesBox.js
@@ -0,0 +1,16 @@
+export const petitionsClerkViewsSentMessagesBox = test => {
+ return it('petitions clerk views their sent messages box', async () => {
+ await test.runSequence('gotoCaseMessagesSequence', {
+ box: 'outbox',
+ queue: 'my',
+ });
+
+ const messages = test.getState('messages');
+
+ const foundMessage = messages.find(
+ message => message.subject === test.testMessageSubject,
+ );
+
+ expect(foundMessage).toBeDefined();
+ });
+};
diff --git a/web-client/integration-tests/journey/practitionerCreatesNewCase.js b/web-client/integration-tests/journey/practitionerCreatesNewCase.js
index 1fdfa29eb77..ec1a13e866a 100644
--- a/web-client/integration-tests/journey/practitionerCreatesNewCase.js
+++ b/web-client/integration-tests/journey/practitionerCreatesNewCase.js
@@ -200,6 +200,6 @@ export const practitionerCreatesNewCase = (test, fakeFile) => {
expect(test.getState('currentPage')).toBe('DashboardPractitioner');
- test.docketNumber = test.getState('cases.0.docketNumber');
+ test.docketNumber = test.getState('openCases.0.docketNumber');
});
};
diff --git a/web-client/integration-tests/journey/practitionerRequestsPendingAccessToCase.js b/web-client/integration-tests/journey/practitionerRequestsPendingAccessToCase.js
index 148196e7b9e..5de962a0f05 100644
--- a/web-client/integration-tests/journey/practitionerRequestsPendingAccessToCase.js
+++ b/web-client/integration-tests/journey/practitionerRequestsPendingAccessToCase.js
@@ -83,6 +83,10 @@ export const practitionerRequestsPendingAccessToCase = (test, fakeFile) => {
);
expect(test.getState('validationErrors')).toEqual({});
+ expect(test.getState('wizardStep')).toBe('RequestAccessReview');
+
await test.runSequence('submitCaseAssociationRequestSequence');
+
+ expect(test.getState('wizardStep')).toBeUndefined();
});
};
diff --git a/web-client/integration-tests/journey/practitionerViewsDashboard.js b/web-client/integration-tests/journey/practitionerViewsDashboard.js
index cb3d2c53860..97f4fc2db11 100644
--- a/web-client/integration-tests/journey/practitionerViewsDashboard.js
+++ b/web-client/integration-tests/journey/practitionerViewsDashboard.js
@@ -2,8 +2,8 @@ export const practitionerViewsDashboard = test => {
return it('Practitioner views dashboard', async () => {
await test.runSequence('gotoDashboardSequence');
expect(test.getState('currentPage')).toEqual('DashboardPractitioner');
- expect(test.getState('cases').length).toBeGreaterThan(0);
- const latestDocketNumber = test.getState('cases.0.docketNumber');
+ expect(test.getState('openCases').length).toBeGreaterThan(0);
+ const latestDocketNumber = test.getState('openCases.0.docketNumber');
expect(test.docketNumber).toEqual(latestDocketNumber);
});
};
diff --git a/web-client/integration-tests/journey/privatePractitionerViewsOpenClosedCases.js b/web-client/integration-tests/journey/privatePractitionerViewsOpenClosedCases.js
new file mode 100644
index 00000000000..1ee4532c513
--- /dev/null
+++ b/web-client/integration-tests/journey/privatePractitionerViewsOpenClosedCases.js
@@ -0,0 +1,9 @@
+export const privatePractitionerViewsOpenAndClosedCases = test => {
+ return it('private practitioner views open and closed cases', async () => {
+ await test.runSequence('gotoDashboardSequence');
+
+ expect(test.getState('currentPage')).toEqual('DashboardPractitioner');
+ expect(test.getState('openCases').length).toBeGreaterThan(0);
+ expect(test.getState('closedCases').length).toBe(0);
+ });
+};
diff --git a/web-client/integration-tests/journey/respondentViewsCaseDetailOfBatchedCase.js b/web-client/integration-tests/journey/respondentViewsCaseDetailOfBatchedCase.js
index 618121b76b6..9b27acbc14c 100644
--- a/web-client/integration-tests/journey/respondentViewsCaseDetailOfBatchedCase.js
+++ b/web-client/integration-tests/journey/respondentViewsCaseDetailOfBatchedCase.js
@@ -1,4 +1,4 @@
-import { Case } from '../../../shared/src/business/entities/cases/Case';
+import { CASE_STATUS_TYPES } from '../../../shared/src/business/entities/EntityConstants';
export const respondentViewsCaseDetailOfBatchedCase = test => {
return it('Respondent views case detail', async () => {
@@ -9,7 +9,7 @@ export const respondentViewsCaseDetailOfBatchedCase = test => {
expect(test.getState('currentPage')).toEqual('CaseDetail');
expect(test.getState('caseDetail.docketNumber')).toEqual(test.docketNumber);
expect(test.getState('caseDetail.status')).toEqual(
- Case.STATUS_TYPES.generalDocket,
+ CASE_STATUS_TYPES.generalDocket,
);
expect(test.getState('caseDetail.documents').length).toEqual(2);
});
diff --git a/web-client/integration-tests/journey/respondentViewsDashboard.js b/web-client/integration-tests/journey/respondentViewsDashboard.js
index 42a1955df97..db2b0d53b7e 100644
--- a/web-client/integration-tests/journey/respondentViewsDashboard.js
+++ b/web-client/integration-tests/journey/respondentViewsDashboard.js
@@ -2,6 +2,6 @@ export const respondentViewsDashboard = test => {
return it('Respondent views dashboard', async () => {
await test.runSequence('gotoDashboardSequence');
expect(test.getState('currentPage')).toEqual('DashboardRespondent');
- expect(test.getState('cases').length).toBeGreaterThanOrEqual(0);
+ expect(test.getState('openCases').length).toBeGreaterThanOrEqual(0);
});
};
diff --git a/web-client/integration-tests/messagesJourney.test.js b/web-client/integration-tests/messagesJourney.test.js
new file mode 100644
index 00000000000..8b8c57882e1
--- /dev/null
+++ b/web-client/integration-tests/messagesJourney.test.js
@@ -0,0 +1,30 @@
+import { loginAs, setupTest, uploadPetition } from './helpers';
+import { petitionsClerk1ViewsMessageDetail } from './journey/petitionsClerk1ViewsMessageDetail';
+import { petitionsClerk1ViewsMessageInbox } from './journey/petitionsClerk1ViewsMessageInbox';
+import { petitionsClerkCreatesNewMessageOnCase } from './journey/petitionsClerkCreatesNewMessageOnCase';
+import { petitionsClerkViewsSentMessagesBox } from './journey/petitionsClerkViewsSentMessagesBox';
+
+const test = setupTest();
+
+describe('messages journey', () => {
+ beforeAll(() => {
+ jest.setTimeout(40000);
+ });
+
+ loginAs(test, 'petitioner');
+ it('Create test case to send messages', async () => {
+ const caseDetail = await uploadPetition(test);
+ expect(caseDetail.docketNumber).toBeDefined();
+ test.docketNumber = caseDetail.docketNumber;
+ test.documentId = caseDetail.documents[0].documentId;
+ test.caseId = caseDetail.caseId;
+ });
+
+ loginAs(test, 'petitionsclerk');
+ petitionsClerkCreatesNewMessageOnCase(test);
+ petitionsClerkViewsSentMessagesBox(test);
+
+ loginAs(test, 'petitionsclerk1');
+ petitionsClerk1ViewsMessageInbox(test);
+ petitionsClerk1ViewsMessageDetail(test);
+});
diff --git a/web-client/integration-tests/modifyContactInfo.test.js b/web-client/integration-tests/modifyContactInfo.test.js
index ddae5e200a0..28cff241f47 100644
--- a/web-client/integration-tests/modifyContactInfo.test.js
+++ b/web-client/integration-tests/modifyContactInfo.test.js
@@ -1,4 +1,4 @@
-import { ContactFactory } from '../../shared/src/business/entities/contacts/ContactFactory';
+import { PARTY_TYPES } from '../../shared/src/business/entities/EntityConstants';
import { docketClerkViewsNoticeOfChangeOfAddress } from './journey/docketClerkViewsNoticeOfChangeOfAddress';
import { loginAs, setupTest, uploadPetition } from './helpers';
import { petitionerEditsCasePrimaryContactAddress } from './journey/petitionerEditsCasePrimaryContactAddress';
@@ -33,7 +33,7 @@ describe('Modify Petitioner Contact Information', () => {
postalCode: '77546',
state: 'CT',
},
- partyType: ContactFactory.PARTY_TYPES.petitionerSpouse,
+ partyType: PARTY_TYPES.petitionerSpouse,
});
expect(caseDetail.docketNumber).toBeDefined();
test.docketNumber = caseDetail.docketNumber;
diff --git a/web-client/integration-tests/noticeOfTrialSessionWithPaperService.test.js b/web-client/integration-tests/noticeOfTrialSessionWithPaperService.test.js
index 94cff3752a4..83068f008a3 100644
--- a/web-client/integration-tests/noticeOfTrialSessionWithPaperService.test.js
+++ b/web-client/integration-tests/noticeOfTrialSessionWithPaperService.test.js
@@ -1,12 +1,12 @@
-import { ContactFactory } from '../../shared/src/business/entities/contacts/ContactFactory';
-
-import { loginAs, setupTest, uploadPetition } from './helpers';
-import { markAllCasesAsQCed } from './journey/markAllCasesAsQCed';
-
+import {
+ COUNTRY_TYPES,
+ PARTY_TYPES,
+} from '../../shared/src/business/entities/EntityConstants';
import { docketClerkCreatesAnIncompleteTrialSessionBeforeCalendaring } from './journey/docketClerkCreatesAnIncompleteTrialSessionBeforeCalendaring';
import { docketClerkSetsCaseReadyForTrial } from './journey/docketClerkSetsCaseReadyForTrial';
import { docketClerkViewsTrialSessionList } from './journey/docketClerkViewsTrialSessionList';
-
+import { loginAs, setupTest, uploadPetition } from './helpers';
+import { markAllCasesAsQCed } from './journey/markAllCasesAsQCed';
import { petitionsClerkCompletesAndSetsTrialSession } from './journey/petitionsClerkCompletesAndSetsTrialSession';
import { petitionsClerkSubmitsCaseToIrs } from './journey/petitionsClerkSubmitsCaseToIrs';
import { petitionsClerkViewsDocketRecordAfterSettingTrial } from './journey/petitionsClerkViewsDocketRecordAfterSettingTrial';
@@ -28,14 +28,14 @@ describe('Generate Notices of Trial Session with Paper Service', () => {
contactSecondary: {
address1: '123 Paper St.',
city: 'Paper City',
- countryType: ContactFactory.COUNTRY_TYPES.DOMESTIC,
+ countryType: COUNTRY_TYPES.DOMESTIC,
name: 'Richard Papers',
phone: '1231231234',
postalCode: '12345',
state: 'IA',
},
hasPaper: true,
- partyType: ContactFactory.PARTY_TYPES.petitionerSpouse,
+ partyType: PARTY_TYPES.petitionerSpouse,
preferredTrialCity: trialLocation,
procedureType: 'Small', // should generate a Standing Pretrial Notice
trialLocation,
diff --git a/web-client/integration-tests/petitionsClerkBlockCase.test.js b/web-client/integration-tests/petitionsClerkBlockCase.test.js
index 1327a004862..378aff31052 100644
--- a/web-client/integration-tests/petitionsClerkBlockCase.test.js
+++ b/web-client/integration-tests/petitionsClerkBlockCase.test.js
@@ -1,4 +1,4 @@
-import { Case } from '../../shared/src/business/entities/cases/Case';
+import { AUTOMATIC_BLOCKED_REASONS } from '../../shared/src/business/entities/EntityConstants';
import { docketClerkCreatesATrialSession } from './journey/docketClerkCreatesATrialSession';
import { docketClerkSetsCaseReadyForTrial } from './journey/docketClerkSetsCaseReadyForTrial';
import { docketClerkViewsTrialSessionList } from './journey/docketClerkViewsTrialSessionList';
@@ -68,7 +68,7 @@ describe('Blocking a Case', () => {
expect(test.getState('blockedCases')).toMatchObject([
{
automaticBlocked: true,
- automaticBlockedReason: Case.AUTOMATIC_BLOCKED_REASONS.dueDate,
+ automaticBlockedReason: AUTOMATIC_BLOCKED_REASONS.dueDate,
blocked: false,
docketNumber: test.docketNumber,
},
@@ -103,7 +103,7 @@ describe('Blocking a Case', () => {
expect(test.getState('blockedCases')).toMatchObject([
{
automaticBlocked: true,
- automaticBlockedReason: Case.AUTOMATIC_BLOCKED_REASONS.pending,
+ automaticBlockedReason: AUTOMATIC_BLOCKED_REASONS.pending,
blocked: false,
docketNumber: test.docketNumber,
},
@@ -129,7 +129,7 @@ describe('Blocking a Case', () => {
expect(test.getState('blockedCases')).toMatchObject([
{
automaticBlocked: true,
- automaticBlockedReason: Case.AUTOMATIC_BLOCKED_REASONS.dueDate,
+ automaticBlockedReason: AUTOMATIC_BLOCKED_REASONS.dueDate,
blocked: true,
blockedReason: 'just because',
docketNumber: test.docketNumber,
diff --git a/web-client/integration-tests/petitionsClerkCounselAssociationJourney.test.js b/web-client/integration-tests/petitionsClerkCounselAssociationJourney.test.js
index 19f40c34710..f69e42f9cfd 100644
--- a/web-client/integration-tests/petitionsClerkCounselAssociationJourney.test.js
+++ b/web-client/integration-tests/petitionsClerkCounselAssociationJourney.test.js
@@ -1,4 +1,4 @@
-import { ContactFactory } from '../../shared/src/business/entities/contacts/ContactFactory';
+import { PARTY_TYPES } from '../../shared/src/business/entities/EntityConstants';
import { loginAs, setupTest, uploadPetition } from './helpers';
import { petitionsClerkAddsPractitionersToCase } from './journey/petitionsClerkAddsPractitionersToCase';
import { petitionsClerkAddsRespondentsToCase } from './journey/petitionsClerkAddsRespondentsToCase';
@@ -26,7 +26,7 @@ describe('Petitions Clerk Counsel Association Journey', () => {
postalCode: '77546',
state: 'AZ',
},
- partyType: ContactFactory.PARTY_TYPES.petitionerSpouse,
+ partyType: PARTY_TYPES.petitionerSpouse,
});
expect(caseDetail.docketNumber).toBeDefined();
test.docketNumber = caseDetail.docketNumber;
diff --git a/web-client/integration-tests/practitionerCaseJourney.test.js b/web-client/integration-tests/practitionerCaseJourney.test.js
index 1fcb67f8b88..a963bb63db2 100644
--- a/web-client/integration-tests/practitionerCaseJourney.test.js
+++ b/web-client/integration-tests/practitionerCaseJourney.test.js
@@ -1,4 +1,4 @@
-import { ContactFactory } from '../../shared/src/business/entities/contacts/ContactFactory';
+import { PARTY_TYPES } from '../../shared/src/business/entities/EntityConstants';
import { fakeFile, loginAs, setupTest, uploadPetition } from './helpers';
import { practitionerCreatesNewCase } from './journey/practitionerCreatesNewCase';
import { practitionerFilesDocumentForOwnedCase } from './journey/practitionerFilesDocumentForOwnedCase';
@@ -38,7 +38,7 @@ describe('Practitioner requests access to case', () => {
postalCode: '77546',
state: 'AZ',
},
- partyType: ContactFactory.PARTY_TYPES.petitionerSpouse,
+ partyType: PARTY_TYPES.petitionerSpouse,
});
expect(caseDetail.docketNumber).toBeDefined();
test.docketNumber = caseDetail.docketNumber;
@@ -68,7 +68,7 @@ describe('Practitioner requests access to case', () => {
postalCode: '77546',
state: 'AZ',
},
- partyType: ContactFactory.PARTY_TYPES.petitionerSpouse,
+ partyType: PARTY_TYPES.petitionerSpouse,
});
expect(caseDetail.docketNumber).toBeDefined();
test.docketNumber = caseDetail.docketNumber;
diff --git a/web-client/integration-tests/scanHelpers.js b/web-client/integration-tests/scanHelpers.js
index 2ea23b17c9a..dbb27f42789 100644
--- a/web-client/integration-tests/scanHelpers.js
+++ b/web-client/integration-tests/scanHelpers.js
@@ -1,6 +1,6 @@
import { setBatchPages } from './helpers';
-exports.addBatchesForScanning = (
+export const addBatchesForScanning = (
test,
{ scannerSourceIndex, scannerSourceName },
) => {
@@ -22,8 +22,7 @@ exports.addBatchesForScanning = (
]);
});
};
-
-exports.createPDFFromScannedBatches = test => {
+export const createPDFFromScannedBatches = test => {
return it('Creates a PDF from added batches', async () => {
const selectedDocumentType = test.getState(
'currentViewMetadata.documentSelectedForScan',
@@ -43,7 +42,7 @@ exports.createPDFFromScannedBatches = test => {
});
};
-exports.selectScannerSource = (
+export const selectScannerSource = (
test,
{ scannerSourceIndex, scannerSourceName },
) => {
diff --git a/web-client/integration-tests/sentWorkItemsExpireAfter7Days.test.js b/web-client/integration-tests/sentWorkItemsExpireAfter7Days.test.js
index 180f4c4af83..2dc7efd7d8a 100644
--- a/web-client/integration-tests/sentWorkItemsExpireAfter7Days.test.js
+++ b/web-client/integration-tests/sentWorkItemsExpireAfter7Days.test.js
@@ -1,5 +1,7 @@
-import { Case } from '../../shared/src/business/entities/cases/Case';
-import { User } from '../../shared/src/business/entities/User';
+import {
+ CASE_STATUS_TYPES,
+ ROLES,
+} from '../../shared/src/business/entities/EntityConstants';
import {
getFormattedMyOutbox,
getFormattedSectionOutbox,
@@ -32,7 +34,7 @@ describe('verify old sent work items do not show up in the outbox', () => {
expect(caseDetail.docketNumber).toBeDefined();
const applicationContext = applicationContextFactory({
- role: User.ROLES.petitionsClerk,
+ role: ROLES.petitionsClerk,
section: 'petitions',
userId: '3805d1ab-18d0-43ec-bafb-654e83405416',
});
@@ -52,7 +54,7 @@ describe('verify old sent work items do not show up in the outbox', () => {
assigneeId: '3805d1ab-18d0-43ec-bafb-654e83405416',
assigneeName: 'Test petitionsclerk1',
caseId: 'd481929a-fb22-4800-900e-50b15ac55934',
- caseStatus: Case.STATUS_TYPES.new,
+ caseStatus: CASE_STATUS_TYPES.new,
createdAt: CREATED_8_DAYS_AGO.toISOString(),
docketNumber: caseDetail.docketNumber,
docketNumberSuffix: null,
diff --git a/web-client/integration-tests/servedWorkItemsExpireAfter7Days.test.js b/web-client/integration-tests/servedWorkItemsExpireAfter7Days.test.js
index 7b9f9384eba..7434e7ed4e1 100644
--- a/web-client/integration-tests/servedWorkItemsExpireAfter7Days.test.js
+++ b/web-client/integration-tests/servedWorkItemsExpireAfter7Days.test.js
@@ -1,5 +1,7 @@
-import { Case } from '../../shared/src/business/entities/cases/Case';
-import { User } from '../../shared/src/business/entities/User';
+import {
+ CASE_STATUS_TYPES,
+ ROLES,
+} from '../../shared/src/business/entities/EntityConstants';
import {
getFormattedDocumentQCMyOutbox,
getFormattedDocumentQCSectionOutbox,
@@ -33,7 +35,7 @@ describe('verify old served work items do not show up in the outbox', () => {
expect(caseDetail.docketNumber).toBeDefined();
const applicationContext = applicationContextFactory({
- role: User.ROLES.petitionsClerk,
+ role: ROLES.petitionsClerk,
section: 'petitions',
userId: '3805d1ab-18d0-43ec-bafb-654e83405416',
});
@@ -53,7 +55,7 @@ describe('verify old served work items do not show up in the outbox', () => {
assigneeId: '3805d1ab-18d0-43ec-bafb-654e83405416',
assigneeName: 'Test petitionsclerk1',
caseId: 'd481929a-fb22-4800-900e-50b15ac55934',
- caseStatus: Case.STATUS_TYPES.new,
+ caseStatus: CASE_STATUS_TYPES.new,
completedAt: '2019-06-26T16:31:17.643Z',
completedByUserId: '3805d1ab-18d0-43ec-bafb-654e83405416',
createdAt: CREATED_8_DAYS_AGO.toISOString(),
@@ -77,7 +79,7 @@ describe('verify old served work items do not show up in the outbox', () => {
toUserId: '3805d1ab-18d0-43ec-bafb-654e83405416',
},
],
- section: 'irsBatchSection',
+ section: 'irsSystem',
sentBy: 'Test petitionsclerk1',
sentBySection: 'petitions',
sentByUserId: '3805d1ab-18d0-43ec-bafb-654e83405416',
diff --git a/web-client/integration-tests/signAndServeStipulatedDecision.test.js b/web-client/integration-tests/signAndServeStipulatedDecision.test.js
index 20a29d7d167..99234f3bb69 100644
--- a/web-client/integration-tests/signAndServeStipulatedDecision.test.js
+++ b/web-client/integration-tests/signAndServeStipulatedDecision.test.js
@@ -1,4 +1,4 @@
-import { Case } from '../../shared/src/business/entities/cases/Case';
+import { CASE_STATUS_TYPES } from '../../shared/src/business/entities/EntityConstants';
import {
createCourtIssuedDocketEntry,
@@ -134,6 +134,6 @@ describe('a user signs and serves a stipulated decision', () => {
d => d.documentId === signedDocumentId,
);
expect(signedDocument.servedAt).toBeDefined();
- expect(caseDetail.status).toEqual(Case.STATUS_TYPES.closed);
+ expect(caseDetail.status).toEqual(CASE_STATUS_TYPES.closed);
});
});
diff --git a/web-client/integration-tests/trialSessionEligibleCasesJourney.test.js b/web-client/integration-tests/trialSessionEligibleCasesJourney.test.js
index 649a8bdbfde..b7ebcc6ea4d 100644
--- a/web-client/integration-tests/trialSessionEligibleCasesJourney.test.js
+++ b/web-client/integration-tests/trialSessionEligibleCasesJourney.test.js
@@ -1,4 +1,4 @@
-import { Case } from '../../shared/src/business/entities/cases/Case';
+import { CHIEF_JUDGE } from '../../shared/src/business/entities/EntityConstants';
import { docketClerkCreatesATrialSession } from './journey/docketClerkCreatesATrialSession';
import { docketClerkSetsCaseReadyForTrial } from './journey/docketClerkSetsCaseReadyForTrial';
import { docketClerkViewsNewTrialSession } from './journey/docketClerkViewsNewTrialSession';
@@ -294,9 +294,7 @@ describe('Trial Session Eligible Cases Journey', () => {
expect(test.getState('caseDetail.status')).not.toEqual('Calendared');
expect(test.getState('caseDetail.trialLocation')).toBeUndefined();
expect(test.getState('caseDetail.trialDate')).toBeUndefined();
- expect(test.getState('caseDetail.associatedJudge')).toEqual(
- Case.CHIEF_JUDGE,
- );
+ expect(test.getState('caseDetail.associatedJudge')).toEqual(CHIEF_JUDGE);
//Case #3 - not assigned
await test.runSequence('gotoCaseDetailSequence', {
diff --git a/web-client/pa11y/pa11y-docketclerk.js b/web-client/pa11y/pa11y-docketclerk.js
index 96ff7cc603f..8481318c26c 100644
--- a/web-client/pa11y/pa11y-docketclerk.js
+++ b/web-client/pa11y/pa11y-docketclerk.js
@@ -21,7 +21,7 @@ module.exports = [
notes:
'checks a11y of form when petition fee payment status paid is selected',
url:
- 'http://localhost:1234/mock-login?token=docketclerk&path=/case-detail/105-19/edit-details&info=paid',
+ 'http://localhost:1234/mock-login?token=docketclerk&path=/case-detail/101-19/edit-details&info=paid',
},
{
actions: [
@@ -32,7 +32,7 @@ module.exports = [
notes:
'checks a11y of form when petition fee payment status unpaid is selected',
url:
- 'http://localhost:1234/mock-login?token=docketclerk&path=/case-detail/105-19/edit-details&info=unpaid',
+ 'http://localhost:1234/mock-login?token=docketclerk&path=/case-detail/101-19/edit-details&info=unpaid',
},
{
actions: [
@@ -43,7 +43,7 @@ module.exports = [
notes:
'checks a11y of form when petition fee payment status waived is selected',
url:
- 'http://localhost:1234/mock-login?token=docketclerk&path=/case-detail/105-19/edit-details&info=waived',
+ 'http://localhost:1234/mock-login?token=docketclerk&path=/case-detail/101-19/edit-details&info=waived',
},
'http://localhost:1234/mock-login?token=docketclerk&path=/case-detail/101-19/documents/1f1aa3f7-e2e3-43e6-885d-4ce341588c76',
{
diff --git a/web-client/pa11y/pa11y-petitionsclerk.js b/web-client/pa11y/pa11y-petitionsclerk.js
index c3791590c98..92e37516d44 100644
--- a/web-client/pa11y/pa11y-petitionsclerk.js
+++ b/web-client/pa11y/pa11y-petitionsclerk.js
@@ -152,6 +152,20 @@ module.exports = [
url:
'http://localhost:1234/mock-login?token=petitionsclerk&path=/case-detail/101-19&info=edit-signed-order-confirm-modal',
},
+ {
+ actions: [
+ 'wait for #case-detail-menu-button to be visible',
+ 'wait for .progress-indicator to be hidden',
+ 'click element #case-detail-menu-button',
+ 'wait for #menu-button-add-new-message to be visible',
+ 'wait for .progress-indicator to be hidden',
+ 'click element #menu-button-add-new-message',
+ 'wait for .ustc-create-message-modal to be visible',
+ ],
+ notes: 'checks a11y of create message modal',
+ url:
+ 'http://localhost:1234/mock-login?token=petitionsclerk&path=/case-detail/105-19&info=create-message-modal',
+ },
{
actions: [
'wait for #case-detail-menu-button to be visible',
@@ -468,4 +482,10 @@ module.exports = [
'http://localhost:1234/mock-login?token=petitionsclerk&path=/search&info=practitioner-search-results',
},
'http://localhost:1234/mock-login?token=petitionsclerk&path=/practitioner-detail/PT1234',
+ /* case messages */
+ 'http://localhost:1234/mock-login?token=petitionsclerk&path=/case-messages/my/inbox&info=case-messages-inbox',
+ 'http://localhost:1234/mock-login?token=petitionsclerk&path=/case-messages/my/outbox&info=case-messages-outbox',
+ 'http://localhost:1234/mock-login?token=petitionsclerk&path=/case-messages/section/inbox&info=case-messages-section-inbox',
+ 'http://localhost:1234/mock-login?token=petitionsclerk&path=/case-messages/section/outbox&info=case-messages-section-outbox',
+ 'http://localhost:1234/mock-login?token=petitionsclerk&path=/case-messages/105-20/message-detail/eb0a139a-8951-4de1-8b83-f02a27504105&info=case-message-detail',
];
diff --git a/web-client/pa11y/pa11y-private-practitioner.js b/web-client/pa11y/pa11y-private-practitioner.js
index d7e3a89d487..30ec024adb0 100644
--- a/web-client/pa11y/pa11y-private-practitioner.js
+++ b/web-client/pa11y/pa11y-private-practitioner.js
@@ -5,4 +5,13 @@ module.exports = [
'http://localhost:1234/mock-login?token=privatePractitioner&path=/file-a-petition/step-1',
'http://localhost:1234/mock-login?token=privatePractitioner&path=/case-detail/102-19/request-access',
'http://localhost:1234/mock-login?token=privatePractitioner&path=/search/no-matches',
+ {
+ actions: [
+ 'wait for #tab-closed to be visible',
+ 'click element #tab-closed',
+ 'wait for element #tabContent-closed to be visible',
+ ],
+ notes: 'check the a11y of the Closed Cases tab',
+ url: 'http://localhost:1234/mock-login?token=privatePractitioner&path=/',
+ },
];
diff --git a/web-client/pa11y/pa11y-public-user.js b/web-client/pa11y/pa11y-public-user.js
index 3af6b6bd187..9fb8e4990db 100644
--- a/web-client/pa11y/pa11y-public-user.js
+++ b/web-client/pa11y/pa11y-public-user.js
@@ -45,4 +45,5 @@ module.exports = [
notes: 'checks a11y of advanced opinion search with results',
url: 'http://localhost:5678/',
},
+ 'http://localhost:5678/todays-opinions',
];
diff --git a/web-client/src/applicationContext.js b/web-client/src/applicationContext.js
index b869091b4f3..315ad0c05af 100644
--- a/web-client/src/applicationContext.js
+++ b/web-client/src/applicationContext.js
@@ -37,6 +37,18 @@ import { associatePrivatePractitionerWithCaseInteractor } from '../../shared/src
import { authorizeCodeInteractor } from '../../shared/src/business/useCases/authorizeCodeInteractor';
import { batchDownloadTrialSessionInteractor } from '../../shared/src/proxies/trialSessions/batchDownloadTrialSessionProxy';
import { blockCaseFromTrialInteractor } from '../../shared/src/proxies/blockCaseFromTrialProxy';
+import {
+ calculateISODate,
+ createISODateString,
+ createISODateStringFromObject,
+ dateStringsCompared,
+ deconstructDate,
+ formatDateString,
+ formatNow,
+ isStringISOFormatted,
+ isValidDateString,
+ prepareDateFromString,
+} from '../../shared/src/business/utilities/DateHandler';
import { canConsolidateInteractor } from '../../shared/src/business/useCases/caseConsolidation/canConsolidateInteractor';
import { canSetTrialSessionAsCalendaredInteractor } from '../../shared/src/business/useCases/trialSessions/canSetTrialSessionAsCalendaredInteractor';
import { caseAdvancedSearchInteractor } from '../../shared/src/proxies/caseAdvancedSearchProxy';
@@ -51,18 +63,8 @@ import { completeWorkItemInteractor } from '../../shared/src/proxies/workitems/c
import { createCaseDeadlineInteractor } from '../../shared/src/proxies/caseDeadline/createCaseDeadlineProxy';
import { createCaseFromPaperInteractor } from '../../shared/src/proxies/createCaseFromPaperProxy';
import { createCaseInteractor } from '../../shared/src/proxies/createCaseProxy';
+import { createCaseMessageInteractor } from '../../shared/src/proxies/messages/createCaseMessageProxy';
import { createCourtIssuedOrderPdfFromHtmlInteractor } from '../../shared/src/proxies/courtIssuedOrder/createCourtIssuedOrderPdfFromHtmlProxy';
-import {
- createISODateString,
- createISODateStringFromObject,
- dateStringsCompared,
- deconstructDate,
- formatDateString,
- formatNow,
- isStringISOFormatted,
- isValidDateString,
- prepareDateFromString,
-} from '../../shared/src/business/utilities/DateHandler';
import { createPractitionerUserInteractor } from '../../shared/src/proxies/practitioners/createPractitionerUserProxy';
import { createTrialSessionInteractor } from '../../shared/src/proxies/trialSessions/createTrialSessionProxy';
import { createWorkItemInteractor } from '../../shared/src/proxies/workitems/createWorkItemProxy';
@@ -105,15 +107,18 @@ import { getCalendaredCasesForTrialSessionInteractor } from '../../shared/src/pr
import { getCaseDeadlinesForCaseInteractor } from '../../shared/src/proxies/caseDeadline/getCaseDeadlinesForCaseProxy';
import { getCaseInteractor } from '../../shared/src/proxies/getCaseProxy';
import { getCaseInventoryReportInteractor } from '../../shared/src/proxies/reports/getCaseInventoryReportProxy';
+import { getCaseMessageInteractor } from '../../shared/src/proxies/messages/getCaseMessageProxy';
import { getCasesByUserInteractor } from '../../shared/src/proxies/getCasesByUserProxy';
+import { getClosedCasesInteractor } from '../../shared/src/proxies/getClosedCasesProxy';
import { getConsolidatedCasesByCaseInteractor } from '../../shared/src/proxies/getConsolidatedCasesByCaseProxy';
-import { getConsolidatedCasesByUserInteractor } from '../../shared/src/proxies/getConsolidatedCasesByUserProxy';
import { getDocument } from '../../shared/src/persistence/s3/getDocument';
import { getDocumentQCInboxForSectionInteractor } from '../../shared/src/proxies/workitems/getDocumentQCInboxForSectionProxy';
import { getDocumentQCInboxForUserInteractor } from '../../shared/src/proxies/workitems/getDocumentQCInboxForUserProxy';
import { getDocumentQCServedForSectionInteractor } from '../../shared/src/proxies/workitems/getDocumentQCServedForSectionProxy';
import { getDocumentQCServedForUserInteractor } from '../../shared/src/proxies/workitems/getDocumentQCServedForUserProxy';
import { getEligibleCasesForTrialSessionInteractor } from '../../shared/src/proxies/trialSessions/getEligibleCasesForTrialSessionProxy';
+import { getInboxCaseMessagesForSectionInteractor } from '../../shared/src/proxies/messages/getInboxCaseMessagesForSectionProxy';
+import { getInboxCaseMessagesForUserInteractor } from '../../shared/src/proxies/messages/getInboxCaseMessagesForUserProxy';
import { getInboxMessagesForSectionInteractor } from '../../shared/src/proxies/workitems/getInboxMessagesForSectionProxy';
import { getInboxMessagesForUserInteractor } from '../../shared/src/proxies/workitems/getInboxMessagesForUserProxy';
import { getInternalUsersInteractor } from '../../shared/src/proxies/users/getInternalUsersProxy';
@@ -121,7 +126,9 @@ import { getIrsPractitionersBySearchKeyInteractor } from '../../shared/src/proxi
import { getItem } from '../../shared/src/persistence/localStorage/getItem';
import { getItemInteractor } from '../../shared/src/business/useCases/getItemInteractor';
import { getNotificationsInteractor } from '../../shared/src/proxies/users/getNotificationsProxy';
-import { getOpenCasesInteractor } from '../../shared/src/proxies/getOpenCasesProxy';
+import { getOpenConsolidatedCasesInteractor } from '../../shared/src/proxies/getOpenConsolidatedCasesProxy';
+import { getOutboxCaseMessagesForSectionInteractor } from '../../shared/src/proxies/messages/getOutboxCaseMessagesForSectionProxy';
+import { getOutboxCaseMessagesForUserInteractor } from '../../shared/src/proxies/messages/getOutboxCaseMessagesForUserProxy';
import { getPdfFromUrl } from '../../shared/src/persistence/s3/getPdfFromUrl';
import { getPdfFromUrlInteractor } from '../../shared/src/business/useCases/document/getPdfFromUrlInteractor';
import { getPractitionerByBarNumberInteractor } from '../../shared/src/proxies/users/getPractitionerByBarNumberProxy';
@@ -204,6 +211,7 @@ import { validateCaseAssociationRequestInteractor } from '../../shared/src/busin
import { validateCaseDeadlineInteractor } from '../../shared/src/business/useCases/caseDeadline/validateCaseDeadlineInteractor';
import { validateCaseDetailInteractor } from '../../shared/src/business/useCases/validateCaseDetailInteractor';
import { validateCourtIssuedDocketEntryInteractor } from '../../shared/src/business/useCases/courtIssuedDocument/validateCourtIssuedDocketEntryInteractor';
+import { validateCreateCaseMessageInteractor } from '../../shared/src/business/useCases/messages/validateCreateCaseMessageInteractor';
import { validateDocketEntryInteractor } from '../../shared/src/business/useCases/docketEntry/validateDocketEntryInteractor';
import { validateEditPrivatePractitionerInteractor } from '../../shared/src/business/useCases/caseAssociation/validateEditPrivatePractitionerInteractor';
import { validateExternalDocumentInformationInteractor } from '../../shared/src/business/useCases/externalDocument/validateExternalDocumentInformationInteractor';
@@ -267,6 +275,7 @@ const allUseCases = {
createCaseDeadlineInteractor,
createCaseFromPaperInteractor,
createCaseInteractor,
+ createCaseMessageInteractor,
createCourtIssuedOrderPdfFromHtmlInteractor,
createPractitionerUserInteractor,
createTrialSessionInteractor,
@@ -304,14 +313,17 @@ const allUseCases = {
getCaseDeadlinesForCaseInteractor,
getCaseInteractor,
getCaseInventoryReportInteractor,
+ getCaseMessageInteractor,
getCasesByUserInteractor,
+ getClosedCasesInteractor,
getConsolidatedCasesByCaseInteractor,
- getConsolidatedCasesByUserInteractor,
getDocumentQCInboxForSectionInteractor,
getDocumentQCInboxForUserInteractor,
getDocumentQCServedForSectionInteractor,
getDocumentQCServedForUserInteractor,
getEligibleCasesForTrialSessionInteractor,
+ getInboxCaseMessagesForSectionInteractor,
+ getInboxCaseMessagesForUserInteractor,
getInboxMessagesForSectionInteractor,
getInboxMessagesForUserInteractor,
getInternalUsersInteractor,
@@ -319,7 +331,9 @@ const allUseCases = {
getItemInteractor,
getJudgeForUserChambersInteractor,
getNotificationsInteractor,
- getOpenCasesInteractor,
+ getOpenConsolidatedCasesInteractor,
+ getOutboxCaseMessagesForSectionInteractor,
+ getOutboxCaseMessagesForUserInteractor,
getPdfFromUrlInteractor,
getPractitionerByBarNumberInteractor,
getPractitionersByNameInteractor,
@@ -395,6 +409,7 @@ const allUseCases = {
validateCaseDeadlineInteractor,
validateCaseDetailInteractor,
validateCourtIssuedDocketEntryInteractor,
+ validateCreateCaseMessageInteractor,
validateDocketEntryInteractor,
validateDocketRecordInteractor,
validateEditPrivatePractitionerInteractor,
@@ -500,6 +515,7 @@ const applicationContext = {
getUserPermissions,
getUtilities: () => {
return {
+ calculateISODate,
compareCasesByDocketNumber,
compareISODateStrings,
compareStrings,
diff --git a/web-client/src/applicationContextPublic.js b/web-client/src/applicationContextPublic.js
index 3ad6cb15947..37ec3be2629 100644
--- a/web-client/src/applicationContextPublic.js
+++ b/web-client/src/applicationContextPublic.js
@@ -1,9 +1,16 @@
+import {
+ CASE_CAPTION_POSTFIX,
+ CASE_SEARCH_PAGE_SIZE,
+ COUNTRY_TYPES,
+ US_STATES,
+} from '../../shared/src/business/entities/EntityConstants';
import { Case } from '../../shared/src/business/entities/cases/Case';
-import { CaseSearch } from '../../shared/src/business/entities/cases/CaseSearch';
-import { ContactFactory } from '../../shared/src/business/entities/contacts/ContactFactory';
import { casePublicSearchInteractor } from '../../shared/src/proxies/casePublicSearchProxy';
import { compareCasesByDocketNumber } from '../../shared/src/business/utilities/getFormattedTrialSessionDetails';
-import { formatDateString } from '../../shared/src/business/utilities/DateHandler';
+import {
+ createISODateString,
+ formatDateString,
+} from '../../shared/src/business/utilities/DateHandler';
import {
formatDocketRecord,
formatDocketRecordWithDocument,
@@ -18,6 +25,7 @@ import {
import { getJudgeLastName } from '../../shared/src/business/utilities/getFormattedJudgeName';
import { getPublicCaseInteractor } from '../../shared/src/proxies/getPublicCaseProxy';
import { getPublicJudgesInteractor } from '../../shared/src/proxies/public/getPublicJudgesProxy';
+import { getTodaysOpinionsInteractor } from '../../shared/src/proxies/public/getTodaysOpinionsProxy';
import { opinionPublicSearchInteractor } from '../../shared/src/proxies/opinionPublicSearchProxy';
import { orderPublicSearchInteractor } from '../../shared/src/proxies/orderPublicSearchProxy';
import { validateCaseAdvancedSearchInteractor } from '../../shared/src/business/useCases/validateCaseAdvancedSearchInteractor';
@@ -41,10 +49,10 @@ const applicationContextPublic = {
getConstants: () =>
deepFreeze({
ADVANCED_SEARCH_TABS,
- CASE_CAPTION_POSTFIX: Case.CASE_CAPTION_POSTFIX,
- CASE_SEARCH_PAGE_SIZE: CaseSearch.CASE_SEARCH_PAGE_SIZE,
- COUNTRY_TYPES: ContactFactory.COUNTRY_TYPES,
- US_STATES: ContactFactory.US_STATES,
+ CASE_CAPTION_POSTFIX: CASE_CAPTION_POSTFIX,
+ CASE_SEARCH_PAGE_SIZE: CASE_SEARCH_PAGE_SIZE,
+ COUNTRY_TYPES: COUNTRY_TYPES,
+ US_STATES: US_STATES,
}),
getCurrentUserToken: () => null,
getHttpClient: () => axios,
@@ -55,6 +63,7 @@ const applicationContextPublic = {
getCaseForPublicDocketSearchInteractor,
getCaseInteractor: getPublicCaseInteractor,
getPublicJudgesInteractor,
+ getTodaysOpinionsInteractor,
opinionPublicSearchInteractor,
orderPublicSearchInteractor,
validateCaseAdvancedSearchInteractor,
@@ -64,6 +73,7 @@ const applicationContextPublic = {
getUtilities: () => {
return {
compareCasesByDocketNumber,
+ createISODateString,
formatDateString,
formatDocketRecord,
formatDocketRecordWithDocument,
diff --git a/web-client/src/getConstants.js b/web-client/src/getConstants.js
index 8ae6943d403..e57f1e327a3 100644
--- a/web-client/src/getConstants.js
+++ b/web-client/src/getConstants.js
@@ -1,27 +1,52 @@
import {
+ ADMISSIONS_STATUS_OPTIONS,
+ BUSINESS_TYPES,
+ CASE_CAPTION_POSTFIX,
+ CASE_SEARCH_PAGE_SIZE,
+ CASE_STATUS_TYPES,
+ CASE_TYPES,
+ CASE_TYPES_MAP,
CHAMBERS_SECTION,
CHAMBERS_SECTIONS,
- SECTIONS,
-} from '../../shared/src/business/entities/WorkQueue';
-import { Case } from '../../shared/src/business/entities/cases/Case';
-import { CaseInternal } from '../../shared/src/business/entities/cases/CaseInternal';
-import { CaseSearch } from '../../shared/src/business/entities/cases/CaseSearch';
-import { ContactFactory } from '../../shared/src/business/entities/contacts/ContactFactory';
-import { Document } from '../../shared/src/business/entities/Document';
-import { FORMATS } from '../../shared/src/business/utilities/DateHandler';
-import {
+ CHIEF_JUDGE,
+ CONTACT_CHANGE_DOCUMENT_TYPES,
+ COUNTRY_TYPES,
+ COURT_ISSUED_EVENT_CODES,
+ DEFAULT_PROCEDURE_TYPE,
+ DOCUMENT_CATEGORIES,
+ DOCUMENT_CATEGORY_MAP,
+ DOCUMENT_INTERNAL_CATEGORY_MAP,
+ DOCUMENT_NOTICE_EVENT_CODES,
+ EMPLOYER_OPTIONS,
+ ESTATE_TYPES,
+ FILING_TYPES,
+ INITIAL_DOCUMENT_TYPES,
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
-} from '../../shared/src/persistence/s3/getUploadPolicy';
-import { Order } from '../../shared/src/business/entities/orders/Order';
-import { Practitioner } from '../../shared/src/business/entities/Practitioner';
+ ORDER_TYPES,
+ OTHER_TYPES,
+ PARTY_TYPES,
+ PAYMENT_STATUS,
+ PRACTITIONER_TYPE_OPTIONS,
+ PROCEDURE_TYPES,
+ ROLES,
+ SCAN_MODES,
+ SECTIONS,
+ SERVICE_INDICATOR_TYPES,
+ SESSION_STATUS_GROUPS,
+ SESSION_TYPES,
+ SIGNED_DOCUMENT_TYPES,
+ STATUS_TYPES_MANUAL_UPDATE,
+ STATUS_TYPES_WITH_ASSOCIATED_JUDGE,
+ SYSTEM_GENERATED_DOCUMENT_TYPES,
+ TRANSCRIPT_EVENT_CODE,
+ TRIAL_CITIES,
+ TRIAL_STATUS_TYPES,
+ US_STATES,
+} from '../../shared/src/business/entities/EntityConstants';
+import { FORMATS } from '../../shared/src/business/utilities/DateHandler';
import { ROLE_PERMISSIONS } from '../../shared/src/authorization/authorizationClientService';
-import { SERVICE_INDICATOR_TYPES } from '../../shared/src/business/entities/cases/CaseConstants';
import { SERVICE_STAMP_OPTIONS } from '../../shared/src/business/entities/courtIssuedDocument/CourtIssuedDocumentConstants';
-import { Scan } from '../../shared/src/business/entities/Scan';
-import { TrialSession } from '../../shared/src/business/entities/trialSessions/TrialSession';
-import { TrialSessionWorkingCopy } from '../../shared/src/business/entities/trialSessions/TrialSessionWorkingCopy';
-import { User } from '../../shared/src/business/entities/User';
const MINUTES = 60 * 1000;
@@ -32,60 +57,67 @@ const ADVANCED_SEARCH_TABS = {
PRACTITIONER: 'practitioner',
};
+const EXTERNAL_USER_DASHBOARD_TABS = {
+ CLOSED: 'Closed',
+ OPEN: 'Open',
+};
+
export const getConstants = () => ({
- ADMISSIONS_STATUS_OPTIONS: Practitioner.ADMISSIONS_STATUS_OPTIONS,
+ ADMISSIONS_STATUS_OPTIONS,
ADVANCED_SEARCH_TABS,
- BUSINESS_TYPES: ContactFactory.BUSINESS_TYPES,
- CASE_CAPTION_POSTFIX: Case.CASE_CAPTION_POSTFIX,
+ BUSINESS_TYPES: BUSINESS_TYPES,
+ CASE_CAPTION_POSTFIX,
CASE_INVENTORY_PAGE_SIZE: 2,
- CASE_SEARCH_PAGE_SIZE: CaseSearch.CASE_SEARCH_PAGE_SIZE,
- CASE_TYPES: Case.CASE_TYPES,
- CASE_TYPES_MAP: Case.CASE_TYPES_MAP,
- CATEGORIES: Document.CATEGORIES,
- CATEGORY_MAP: Document.CATEGORY_MAP,
+ CASE_LIST_PAGE_SIZE: 20,
+ CASE_SEARCH_PAGE_SIZE,
+ CASE_TYPES,
+ CASE_TYPES_MAP,
+ CATEGORIES: DOCUMENT_CATEGORIES,
+ CATEGORY_MAP: DOCUMENT_CATEGORY_MAP,
CHAMBERS_SECTION,
CHAMBERS_SECTIONS,
- CHIEF_JUDGE: Case.CHIEF_JUDGE,
- CONTACT_CHANGE_DOCUMENT_TYPES: Document.CONTACT_CHANGE_DOCUMENT_TYPES,
- COUNTRY_TYPES: ContactFactory.COUNTRY_TYPES,
- COURT_ISSUED_EVENT_CODES: Document.COURT_ISSUED_EVENT_CODES,
+ CHIEF_JUDGE,
+ CONTACT_CHANGE_DOCUMENT_TYPES: CONTACT_CHANGE_DOCUMENT_TYPES,
+ COUNTRY_TYPES,
+ COURT_ISSUED_EVENT_CODES: COURT_ISSUED_EVENT_CODES,
DATE_FORMATS: FORMATS,
- DEFAULT_PROCEDURE_TYPE: CaseInternal.DEFAULT_PROCEDURE_TYPE,
- EMPLOYER_OPTIONS: Practitioner.EMPLOYER_OPTIONS,
- ESTATE_TYPES: ContactFactory.ESTATE_TYPES,
- FILING_TYPES: Case.FILING_TYPES,
- INITIAL_DOCUMENT_TYPES: Document.INITIAL_DOCUMENT_TYPES,
- INTERNAL_CATEGORY_MAP: Document.INTERNAL_CATEGORY_MAP,
+ DEFAULT_PROCEDURE_TYPE,
+ EMPLOYER_OPTIONS,
+ ESTATE_TYPES,
+ EXTERNAL_USER_DASHBOARD_TABS,
+ FILING_TYPES,
+ INITIAL_DOCUMENT_TYPES,
+ INTERNAL_CATEGORY_MAP: DOCUMENT_INTERNAL_CATEGORY_MAP,
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
- NOTICE_EVENT_CODES: Document.NOTICE_EVENT_CODES,
- ORDER_TYPES_MAP: Order.ORDER_TYPES,
- OTHER_TYPES: ContactFactory.OTHER_TYPES,
- PARTY_TYPES: ContactFactory.PARTY_TYPES,
- PAYMENT_STATUS: Case.PAYMENT_STATUS,
- PRACTITIONER_TYPE_OPTIONS: Practitioner.PRACTITIONER_TYPE_OPTIONS,
- PROCEDURE_TYPES: Case.PROCEDURE_TYPES,
+ NOTICE_EVENT_CODES: DOCUMENT_NOTICE_EVENT_CODES,
+ ORDER_TYPES_MAP: ORDER_TYPES,
+ OTHER_TYPES,
+ PARTY_TYPES,
+ PAYMENT_STATUS,
+ PRACTITIONER_TYPE_OPTIONS,
+ PROCEDURE_TYPES,
REFRESH_INTERVAL: 20 * MINUTES,
ROLE_PERMISSIONS,
- SCAN_MODES: Scan.SCAN_MODES,
+ SCAN_MODES,
SECTIONS,
SERVICE_INDICATOR_TYPES,
SERVICE_STAMP_OPTIONS,
SESSION_DEBOUNCE: 250,
SESSION_MODAL_TIMEOUT: 5 * MINUTES,
- SESSION_STATUS_GROUPS: TrialSession.SESSION_STATUS_GROUPS,
+ SESSION_STATUS_GROUPS,
SESSION_TIMEOUT:
(process.env.SESSION_TIMEOUT && parseInt(process.env.SESSION_TIMEOUT)) ||
55 * MINUTES,
- SIGNED_DOCUMENT_TYPES: Document.SIGNED_DOCUMENT_TYPES,
- STATUS_TYPES: Case.STATUS_TYPES,
- STATUS_TYPES_MANUAL_UPDATE: Case.STATUS_TYPES_MANUAL_UPDATE,
- STATUS_TYPES_WITH_ASSOCIATED_JUDGE: Case.STATUS_TYPES_WITH_ASSOCIATED_JUDGE,
- SYSTEM_GENERATED_DOCUMENT_TYPES: Document.SYSTEM_GENERATED_DOCUMENT_TYPES,
- TRANSCRIPT_EVENT_CODE: Document.TRANSCRIPT_EVENT_CODE,
- TRIAL_CITIES: TrialSession.TRIAL_CITIES,
- TRIAL_SESSION_TYPES: TrialSession.SESSION_TYPES,
- TRIAL_STATUS_TYPES: TrialSessionWorkingCopy.TRIAL_STATUS_TYPES,
- US_STATES: ContactFactory.US_STATES,
- USER_ROLES: User.ROLES,
+ SIGNED_DOCUMENT_TYPES: SIGNED_DOCUMENT_TYPES,
+ STATUS_TYPES: CASE_STATUS_TYPES,
+ STATUS_TYPES_MANUAL_UPDATE,
+ STATUS_TYPES_WITH_ASSOCIATED_JUDGE: STATUS_TYPES_WITH_ASSOCIATED_JUDGE,
+ SYSTEM_GENERATED_DOCUMENT_TYPES: SYSTEM_GENERATED_DOCUMENT_TYPES,
+ TRANSCRIPT_EVENT_CODE: TRANSCRIPT_EVENT_CODE,
+ TRIAL_CITIES: TRIAL_CITIES,
+ TRIAL_SESSION_TYPES: SESSION_TYPES,
+ TRIAL_STATUS_TYPES,
+ US_STATES,
+ USER_ROLES: ROLES,
});
diff --git a/web-client/src/index.pug b/web-client/src/index.pug
index d32f3fb05e6..daad13f706a 100644
--- a/web-client/src/index.pug
+++ b/web-client/src/index.pug
@@ -2,7 +2,6 @@ doctype html
html(lang="en")
head
meta(charset="utf-8")
- meta(built="" + (new Date()).toLocaleString('en-US', {weekday: 'short', year: 'numeric', month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric', timeZone: 'America/New_York'}) + " EST")
meta(revision="" + (process.env.CIRCLE_SHA1 || '').substr(0,7))
meta(name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no")
title U.S. Tax Court Electronic Filing and Case Management System
@@ -18,4 +17,6 @@ html(lang="en")
#app
#modal-root
#dwtcontrolContainer
+ footer.grid-container.position-fixed.bottom-0.right-0
+ p Deployed #{(new Date()).toLocaleString('en-US', {weekday: 'short', year: 'numeric', month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric', timeZone: 'America/New_York'})} EST
script(src="index." + process.env.USTC_ENV + ".js")
diff --git a/web-client/src/presenter/actions/AdvancedSearch/defaultAdvancedSearchFormAction.test.js b/web-client/src/presenter/actions/AdvancedSearch/defaultAdvancedSearchFormAction.test.js
index 53b1c29a7fa..8f055f5cd3e 100644
--- a/web-client/src/presenter/actions/AdvancedSearch/defaultAdvancedSearchFormAction.test.js
+++ b/web-client/src/presenter/actions/AdvancedSearch/defaultAdvancedSearchFormAction.test.js
@@ -1,4 +1,4 @@
-import { ContactFactory } from '../../../../../shared/src/business/entities/contacts/ContactFactory';
+import { COUNTRY_TYPES } from '../../../../../shared/src/business/entities/EntityConstants';
import { applicationContextForClient } from '../../../../../shared/src/business/test/createTestApplicationContext';
import { defaultAdvancedSearchFormAction } from './defaultAdvancedSearchFormAction';
import { presenter } from '../../presenter-mock';
@@ -18,7 +18,7 @@ describe('defaultAdvancedSearchFormAction', () => {
expect(result.state.advancedSearchForm).toEqual({
caseSearchByDocketNumber: {},
caseSearchByName: {
- countryType: ContactFactory.COUNTRY_TYPES.DOMESTIC,
+ countryType: COUNTRY_TYPES.DOMESTIC,
},
opinionSearch: {},
orderSearch: {},
@@ -46,7 +46,7 @@ describe('defaultAdvancedSearchFormAction', () => {
advancedSearchForm: {
caseSearchByDocketNumber: { yes: true },
caseSearchByName: {
- countryType: ContactFactory.COUNTRY_TYPES.INTERNATIONAL,
+ countryType: COUNTRY_TYPES.INTERNATIONAL,
no: false,
},
opinionSearch: {},
@@ -61,7 +61,7 @@ describe('defaultAdvancedSearchFormAction', () => {
expect(result.state.advancedSearchForm).toEqual({
caseSearchByDocketNumber: { yes: true },
caseSearchByName: {
- countryType: ContactFactory.COUNTRY_TYPES.INTERNATIONAL,
+ countryType: COUNTRY_TYPES.INTERNATIONAL,
no: false,
},
opinionSearch: {},
diff --git a/web-client/src/presenter/actions/CaseDetail/createCaseMessageAction.js b/web-client/src/presenter/actions/CaseDetail/createCaseMessageAction.js
new file mode 100644
index 00000000000..6334d6a75f3
--- /dev/null
+++ b/web-client/src/presenter/actions/CaseDetail/createCaseMessageAction.js
@@ -0,0 +1,19 @@
+import { state } from 'cerebral';
+
+export const createCaseMessageAction = async ({ applicationContext, get }) => {
+ const form = get(state.modal.form);
+
+ const { caseId } = get(state.caseDetail);
+
+ await applicationContext.getUseCases().createCaseMessageInteractor({
+ applicationContext,
+ caseId,
+ ...form,
+ });
+
+ return {
+ alertSuccess: {
+ message: 'Your message has been sent.',
+ },
+ };
+};
diff --git a/web-client/src/presenter/actions/CaseDetail/createCaseMessageAction.test.js b/web-client/src/presenter/actions/CaseDetail/createCaseMessageAction.test.js
new file mode 100644
index 00000000000..7391d264753
--- /dev/null
+++ b/web-client/src/presenter/actions/CaseDetail/createCaseMessageAction.test.js
@@ -0,0 +1,54 @@
+import { applicationContextForClient as applicationContext } from '../../../../../shared/src/business/test/createTestApplicationContext';
+import { createCaseMessageAction } from './createCaseMessageAction';
+import { presenter } from '../../presenter-mock';
+import { runAction } from 'cerebral/test';
+
+describe('createCaseMessageAction', () => {
+ beforeAll(() => {
+ presenter.providers.applicationContext = applicationContext;
+ });
+
+ it('should call createCaseMessageInteractor with the expected parameters and return the alertSuccess', async () => {
+ const result = await runAction(createCaseMessageAction, {
+ modules: {
+ presenter,
+ },
+ state: {
+ caseDetail: {
+ caseId: 'a7806fa0-ce6a-41ca-b66e-59438953f8bb',
+ },
+ modal: {
+ form: {
+ attachments: [
+ {
+ documentId: 'b1130321-0a76-43bc-b3eb-64a18f079873',
+ documentTitle: 'Petition',
+ },
+ ],
+ message: 'You there!',
+ subject: 'Hey!',
+ },
+ },
+ },
+ });
+
+ expect(
+ applicationContext.getUseCases().createCaseMessageInteractor,
+ ).toBeCalled();
+ expect(
+ applicationContext.getUseCases().createCaseMessageInteractor.mock
+ .calls[0][0],
+ ).toMatchObject({
+ attachments: [
+ {
+ documentId: 'b1130321-0a76-43bc-b3eb-64a18f079873',
+ documentTitle: 'Petition',
+ },
+ ],
+ caseId: 'a7806fa0-ce6a-41ca-b66e-59438953f8bb',
+ message: 'You there!',
+ subject: 'Hey!',
+ });
+ expect(result.output).toHaveProperty('alertSuccess');
+ });
+});
diff --git a/web-client/src/presenter/actions/CaseDetail/validateUpdateCaseModalAction.test.js b/web-client/src/presenter/actions/CaseDetail/validateUpdateCaseModalAction.test.js
index 8c4a854e3c5..36f2a09a5fa 100644
--- a/web-client/src/presenter/actions/CaseDetail/validateUpdateCaseModalAction.test.js
+++ b/web-client/src/presenter/actions/CaseDetail/validateUpdateCaseModalAction.test.js
@@ -1,4 +1,4 @@
-import { Case } from '../../../../../shared/src/business/entities/cases/Case';
+import { CASE_STATUS_TYPES } from '../../../../../shared/src/business/entities/EntityConstants';
import { applicationContextForClient } from '../../../../../shared/src/business/test/createTestApplicationContext';
import { presenter } from '../../presenter-mock';
import { runAction } from 'cerebral/test';
@@ -28,7 +28,7 @@ describe('validateUpdateCaseModalAction', () => {
state: {
modal: {
caseCaption: 'A case caption',
- caseStatus: Case.STATUS_TYPES.closed,
+ caseStatus: CASE_STATUS_TYPES.closed,
},
},
});
@@ -46,7 +46,7 @@ describe('validateUpdateCaseModalAction', () => {
modal: {
associatedJudge: 'Judge Armen',
caseCaption: 'A case caption',
- caseStatus: Case.STATUS_TYPES.submitted,
+ caseStatus: CASE_STATUS_TYPES.submitted,
},
},
});
@@ -63,7 +63,7 @@ describe('validateUpdateCaseModalAction', () => {
state: {
modal: {
associatedJudge: 'Judge Armen',
- caseStatus: Case.STATUS_TYPES.submitted,
+ caseStatus: CASE_STATUS_TYPES.submitted,
},
},
});
@@ -97,7 +97,7 @@ describe('validateUpdateCaseModalAction', () => {
state: {
modal: {
caseCaption: 'A case caption',
- caseStatus: Case.STATUS_TYPES.submitted,
+ caseStatus: CASE_STATUS_TYPES.submitted,
},
},
});
diff --git a/web-client/src/presenter/actions/CaseInventoryReport/generatePrintableCaseInventoryReportAction.js b/web-client/src/presenter/actions/CaseInventoryReport/generatePrintableCaseInventoryReportAction.js
index 9d5626f0fef..ebeccdc8798 100644
--- a/web-client/src/presenter/actions/CaseInventoryReport/generatePrintableCaseInventoryReportAction.js
+++ b/web-client/src/presenter/actions/CaseInventoryReport/generatePrintableCaseInventoryReportAction.js
@@ -6,6 +6,7 @@ import { state } from 'cerebral';
* @param {object} providers the providers object
* @param {object} providers.applicationContext the application context
* @param {Function} providers.get the cerebral get function
+ * @returns {Promise
);
},
diff --git a/web-client/src/views/CaseDetailEdit/ReviewSavedPetition.jsx b/web-client/src/views/CaseDetailEdit/ReviewSavedPetition.jsx
index 9f4ba15db22..c256f148441 100644
--- a/web-client/src/views/CaseDetailEdit/ReviewSavedPetition.jsx
+++ b/web-client/src/views/CaseDetailEdit/ReviewSavedPetition.jsx
@@ -4,6 +4,7 @@ import { CaseDetailHeader } from '../CaseDetail/CaseDetailHeader';
import { ConfirmModal } from '../../ustc-ui/Modal/ConfirmModal';
import { Focus } from '../../ustc-ui/Focus/Focus';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+import { FormCancelModalDialog } from '../FormCancelModalDialog';
import { OrdersNeededSummary } from '../StartCaseInternal/OrdersNeededSummary';
import { PDFPreviewButton } from '../PDFPreviewButton';
import { connect } from '@cerebral/react';
@@ -379,6 +380,7 @@ export const ReviewSavedPetition = connect(
{showModal == 'ConfirmServeToIrsModal' &&
}
+ {showModal == 'FormCancelModalDialog' && (
+
+ )}
>
);
},
diff --git a/web-client/src/views/CaseInventoryReport/CaseInventoryReport.jsx b/web-client/src/views/CaseInventoryReport/CaseInventoryReport.jsx
index 289bf4bbd92..4717915b4ad 100644
--- a/web-client/src/views/CaseInventoryReport/CaseInventoryReport.jsx
+++ b/web-client/src/views/CaseInventoryReport/CaseInventoryReport.jsx
@@ -140,7 +140,7 @@ export const CaseInventoryReport = connect(
)}
diff --git a/web-client/src/views/CaseListPetitioner.jsx b/web-client/src/views/CaseListPetitioner.jsx
index d974bf74d68..71200626580 100644
--- a/web-client/src/views/CaseListPetitioner.jsx
+++ b/web-client/src/views/CaseListPetitioner.jsx
@@ -9,12 +9,22 @@ import React from 'react';
export const CaseListPetitioner = connect(
{
- formattedCases: state.formattedCases,
- getCasesByStatusForUserSequence: sequences.getCasesByStatusForUserSequence,
+ caseType: state.openClosedCases.caseType,
+ closedTab: state.constants.EXTERNAL_USER_DASHBOARD_TABS.CLOSED,
+ externalUserCasesHelper: state.externalUserCasesHelper,
+ openTab: state.constants.EXTERNAL_USER_DASHBOARD_TABS.OPEN,
+ setCaseTypeToDisplaySequence: sequences.setCaseTypeToDisplaySequence,
+ showMoreClosedCasesSequence: sequences.showMoreClosedCasesSequence,
+ showMoreOpenCasesSequence: sequences.showMoreOpenCasesSequence,
},
function CaseListPetitioner({
- formattedCases,
- getCasesByStatusForUserSequence,
+ caseType,
+ closedTab,
+ externalUserCasesHelper,
+ openTab,
+ setCaseTypeToDisplaySequence,
+ showMoreClosedCasesSequence,
+ showMoreOpenCasesSequence,
}) {
const renderStartButton = () => (