Skip to content

Commit

Permalink
feat(PRL-6319): Integrate CAN6 Service of docs notification (#1696)
Browse files Browse the repository at this point in the history
Co-authored-by: Channabasappagouda Patil <109162337+channa-patil@users.noreply.github.com>
  • Loading branch information
vivek-sekhar and channa-patil authored Oct 31, 2024
1 parent 7a2b507 commit 808667a
Show file tree
Hide file tree
Showing 16 changed files with 216 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,9 @@ export const NOTIFICATION_BASE_CONFIG = [
content: getNotificationContent,
show: () => false,
},
{
id: NotificationType.SERVE_DOCUMENTS,
content: getNotificationContent,
show: () => false,
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('ca_applicant', () => {
],
} as CaseWithId);

expect(ca_applicantNotifications).toHaveLength(15);
expect(ca_applicantNotifications).toHaveLength(16);
expect(ca_applicantNotifications[0].id).toBe('applicationNotStarted');
expect(ca_applicantNotifications[1].id).toBe('applicationInProgress');
expect(ca_applicantNotifications[2].id).toBe('applicationSubmitted');
Expand All @@ -30,5 +30,6 @@ describe('ca_applicant', () => {
expect(ca_applicantNotifications[12].id).toBe('orderSOSPersonalServiceByCourtAdminBailiff');
expect(ca_applicantNotifications[13].id).toBe('orderNonPersonalService');
expect(ca_applicantNotifications[14].id).toBe('orderPersonalService');
expect(ca_applicantNotifications[15].id).toBe('serveDocuments');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ export const CA_APPLICANT_CONFIG = (userCase: CaseWithId): NotificationBannerPro
});
},
},
{
id: NotificationType.SERVE_DOCUMENTS,
show: showNotification,
},
];

const generateRespondentRelatedNotifications = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { CA_RESPONDENT_CONFIG } from './ca_respondent';
describe('ca_respondent', () => {
test('should have correct notification ids', () => {
const ca_respondentNotifications = CA_RESPONDENT_CONFIG();
expect(ca_respondentNotifications).toHaveLength(3);
expect(ca_respondentNotifications).toHaveLength(4);
expect(ca_respondentNotifications[0].id).toBe('applicationServedByCourtToRespondent');
expect(ca_respondentNotifications[1].id).toBe('submitFM5');
expect(ca_respondentNotifications[2].id).toBe('orderNonPersonalService');
expect(ca_respondentNotifications[3].id).toBe('serveDocuments');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ export const CA_RESPONDENT_CONFIG = (): NotificationBannerProps[] => [
});
},
},
{
id: NotificationType.SERVE_DOCUMENTS,
show: showNotification,
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ describe('da_applicant', () => {
test('should have correct notification ids', () => {
const da_applicantNotifications = DA_APPLICANT_CONFIG();

expect(da_applicantNotifications).toHaveLength(6);
expect(da_applicantNotifications).toHaveLength(7);
expect(da_applicantNotifications[0].id).toBe('applicantToPersonallyServeDARespondent');
expect(da_applicantNotifications[1].id).toBe('applicationServedByCourtAdminBailiffToDARespondent');
expect(da_applicantNotifications[2].id).toBe('orderNonPersonalService');
expect(da_applicantNotifications[3].id).toBe('orderPersonalService');
expect(da_applicantNotifications[4].id).toBe('applicationServedByCourtPersonalNonPersonalServiceToDAApplicant');
expect(da_applicantNotifications[5].id).toBe('orderSOSPersonalServiceByCourtAdminBailiffToDARespondent');
expect(da_applicantNotifications[6].id).toBe('serveDocuments');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,8 @@ export const DA_APPLICANT_CONFIG = (): NotificationBannerProps[] => [
id: NotificationType.ORDER_SOS_PERSONAL_SERVICE_BY_COURT_ADMIN_BAILIFF_TO_DA_RESPONDENT,
show: showNotification,
},
{
id: NotificationType.SERVE_DOCUMENTS,
show: showNotification,
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ describe('da_respondent', () => {
test('should have correct notification ids', () => {
const da_respondentNotifications = DA_RESPONDENT_CONFIG();

expect(da_respondentNotifications).toHaveLength(2);
expect(da_respondentNotifications).toHaveLength(3);
expect(da_respondentNotifications[0].id).toBe('applicationServedByCourtToDARespondent');
expect(da_respondentNotifications[1].id).toBe('orderNonPersonalService');
expect(da_respondentNotifications[2].id).toBe('serveDocuments');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ export const DA_RESPONDENT_CONFIG = (): NotificationBannerProps[] => [
});
},
},
{
id: NotificationType.SERVE_DOCUMENTS,
show: showNotification,
},
];
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CaseWithId } from '../../../../../../app/case/case';
import { PartyType } from '../../../../../../app/case/definition';
import { UploadDocumentCategory } from '../../../../../../steps/common/documents/definitions';
import { DocumentPartyType, UploadDocumentCategory } from '../../../../../../steps/common/documents/definitions';
import { interpolate } from '../../../../../../steps/common/string-parser';
import { applyParms } from '../../../../../../steps/common/url-parser';
import {
Expand All @@ -10,6 +10,7 @@ import {
VIEW_ALL_DOCUMENT_TYPES,
VIEW_ALL_ORDERS,
VIEW_APPLICATION_PACK_DOCUMENTS,
VIEW_TYPE_DOCUMENT,
} from '../../../../../../steps/urls';
import { NotificationBannerContent, NotificationBannerContentConfig, NotificationID } from '../definitions';
import {
Expand Down Expand Up @@ -494,6 +495,27 @@ const en: NotificationBannerContentConfig = {
},
],
},
serveDocuments: {
heading: 'You have new document(s) to view',
sections: [
{
contents: [
{
text: 'New document(s) has been added to your case.',
},
],
links: [
{
text: 'Link to the new document(s)',
href: applyParms(VIEW_TYPE_DOCUMENT, {
partyType: PartyType.APPLICANT,
type: DocumentPartyType.OTHER,
}),
},
],
},
],
},
};

const cy: typeof en = {
Expand Down Expand Up @@ -964,6 +986,27 @@ const cy: typeof en = {
},
],
},
serveDocuments: {
heading: 'Mae genncyh ddogfen(nau) newydd i’w gweld',
sections: [
{
contents: [
{
text: 'Mae ddogfen(nau) newydd wedi’u hychwanegu at eich achos',
},
],
links: [
{
text: 'Dolen i’r ddogfen(nau) newydd',
href: applyParms(VIEW_TYPE_DOCUMENT, {
partyType: PartyType.APPLICANT,
type: DocumentPartyType.OTHER,
}),
},
],
},
],
},
};

export const CA_APPLICANT_CONTENT = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import {
UPLOAD_DOCUMENT_DOCUMENT_SHARING_DETAILS,
VIEW_ALL_ORDERS,
VIEW_APPLICATION_PACK_DOCUMENTS,
VIEW_TYPE_DOCUMENT,
} from '../../../../../urls';
import { UploadDocumentCategory } from '../../../../documents/definitions';
import { DocumentPartyType, UploadDocumentCategory } from '../../../../documents/definitions';
import { interpolate } from '../../../../string-parser';
import { applyParms } from '../../../../url-parser';
import { NotificationBannerContent, NotificationBannerContentConfig, NotificationID } from '../definitions';
Expand Down Expand Up @@ -159,6 +160,27 @@ const en: NotificationBannerContentConfig = {
},
],
},
serveDocuments: {
heading: 'You have new document(s) to view',
sections: [
{
contents: [
{
text: 'New document(s) has been added to your case.',
},
],
links: [
{
text: 'Link to the new document(s)',
href: applyParms(VIEW_TYPE_DOCUMENT, {
partyType: PartyType.RESPONDENT,
type: DocumentPartyType.OTHER,
}),
},
],
},
],
},
};

const cy: typeof en = {
Expand Down Expand Up @@ -300,6 +322,27 @@ const cy: typeof en = {
},
],
},
serveDocuments: {
heading: 'Mae genncyh ddogfen(nau) newydd i’w gweld',
sections: [
{
contents: [
{
text: 'Mae ddogfen(nau) newydd wedi’u hychwanegu at eich achos',
},
],
links: [
{
text: 'Dolen i’r ddogfen(nau) newydd',
href: applyParms(VIEW_TYPE_DOCUMENT, {
partyType: PartyType.RESPONDENT,
type: DocumentPartyType.OTHER,
}),
},
],
},
],
},
};

export const CA_RESPONDENT_CONTENT = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { CaseWithId } from '../../../../../../app/case/case';
import { PartyType } from '../../../../../../app/case/definition';
import { DocumentPartyType } from '../../../../../../steps/common/documents/definitions';
import { interpolate } from '../../../../../../steps/common/string-parser';
import {
STATEMENT_OF_SERVICE_WHO_WAS_SERVED,
VIEW_ALL_ORDERS,
VIEW_APPLICATION_PACK_DOCUMENTS,
VIEW_TYPE_DOCUMENT,
} from '../../../../../urls';
import { applyParms } from '../../../../url-parser';
import { NotificationBannerContent, NotificationBannerContentConfig, NotificationID } from '../definitions';
Expand Down Expand Up @@ -222,6 +224,27 @@ const en: NotificationBannerContentConfig = {
},
],
},
serveDocuments: {
heading: 'You have new document(s) to view',
sections: [
{
contents: [
{
text: 'New document(s) has been added to your case.',
},
],
links: [
{
text: 'Link to the new document(s)',
href: applyParms(VIEW_TYPE_DOCUMENT, {
partyType: PartyType.APPLICANT,
type: DocumentPartyType.OTHER,
}),
},
],
},
],
},
};

const cy: typeof en = {
Expand Down Expand Up @@ -431,6 +454,27 @@ const cy: typeof en = {
},
],
},
serveDocuments: {
heading: 'Mae genncyh ddogfen(nau) newydd i’w gweld',
sections: [
{
contents: [
{
text: 'Mae ddogfen(nau) newydd wedi’u hychwanegu at eich achos',
},
],
links: [
{
text: 'Dolen i’r ddogfen(nau) newydd',
href: applyParms(VIEW_TYPE_DOCUMENT, {
partyType: PartyType.APPLICANT,
type: DocumentPartyType.OTHER,
}),
},
],
},
],
},
};

export const DA_APPLICANT_CONTENT = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { CaseWithId } from '../../../../../../app/case/case';
import { PartyType } from '../../../../../../app/case/definition';
import { DocumentPartyType } from '../../../../../../steps/common/documents/definitions';
import { interpolate } from '../../../../../../steps/common/string-parser';
import { VIEW_ALL_ORDERS, VIEW_APPLICATION_PACK_DOCUMENTS } from '../../../../../urls';
import { VIEW_ALL_ORDERS, VIEW_APPLICATION_PACK_DOCUMENTS, VIEW_TYPE_DOCUMENT } from '../../../../../urls';
import { applyParms } from '../../../../url-parser';
import { NotificationBannerContent, NotificationBannerContentConfig, NotificationID } from '../definitions';
import { findNotification, getOrderNotificationHeading } from '../utils';
Expand Down Expand Up @@ -75,6 +76,27 @@ const en: NotificationBannerContentConfig = {
},
],
},
serveDocuments: {
heading: 'You have new document(s) to view',
sections: [
{
contents: [
{
text: 'New document(s) has been added to your case.',
},
],
links: [
{
text: 'Link to the new document(s)',
href: applyParms(VIEW_TYPE_DOCUMENT, {
partyType: PartyType.RESPONDENT,
type: DocumentPartyType.OTHER,
}),
},
],
},
],
},
};

const cy: typeof en = {
Expand Down Expand Up @@ -146,6 +168,27 @@ const cy: typeof en = {
},
],
},
serveDocuments: {
heading: 'Mae genncyh ddogfen(nau) newydd i’w gweld',
sections: [
{
contents: [
{
text: 'Mae ddogfen(nau) newydd wedi’u hychwanegu at eich achos',
},
],
links: [
{
text: 'Dolen i’r ddogfen(nau) newydd',
href: applyParms(VIEW_TYPE_DOCUMENT, {
partyType: PartyType.RESPONDENT,
type: DocumentPartyType.OTHER,
}),
},
],
},
],
},
};

export const DA_RESPONDENT_CONTENT = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export enum NotificationType {
ORDER_NON_PERSONAL_SERVICE = 'orderNonPersonalService',
ORDER_PERSONAL_SERVICE = 'orderPersonalService',
ORDER_SOS_PERSONAL_SERVICE_BY_COURT_ADMIN_BAILIFF_TO_DA_RESPONDENT = 'orderSOSPersonalServiceByCourtAdminBailiffToDARespondent',
SERVE_DOCUMENTS = 'serveDocuments',
}

export type NotificationBannerProps = {
Expand Down Expand Up @@ -140,6 +141,7 @@ export enum NotificationID {
ORDER_NON_PERSONAL_SERVICE = 'CRNF2_APPLICANT_RESPONDENT',
ORDER_PERSONAL_SERVICE = 'CRNF3_PERSONAL_SERV_APPLICANT',
ORDER_SOS_PERSONAL_SERVICE_BY_COURT_ADMIN_BAILIFF_TO_DA_RESPONDENT = 'DN6_ORDER_SOS_CA_CB',
SERVE_DOCUMENTS = 'CRNF6_SOD_APPLICANT_RESPONDENT',
}

export enum OrderTypeId {
Expand Down
Loading

0 comments on commit 808667a

Please sign in to comment.