diff --git a/webroot/src/components/Licensee/LicenseeList/LicenseeList.ts b/webroot/src/components/Licensee/LicenseeList/LicenseeList.ts index 810e97803b..535a43add0 100644 --- a/webroot/src/components/Licensee/LicenseeList/LicenseeList.ts +++ b/webroot/src/components/Licensee/LicenseeList/LicenseeList.ts @@ -242,14 +242,22 @@ class LicenseeList extends Vue { } get headerRecord() { + const cosmetologySpecificColumns = { + licenseNumber: this.$t('licensing.stateLicenseNumber'), + ...(this.isPublicSearch) + ? { + isPublicSearch: true, + eligibilityDisplay: () => this.$t('licensing.compactRestriction'), + isRestricted: () => false, + } + : {} + }; const record = { firstName: this.$t('common.firstName'), lastName: this.$t('common.lastName'), homeJurisdictionDisplay: () => this.$t('licensing.homeState'), ...(this.isAppModeCosmetology - ? { - licenseNumber: this.$t('licensing.stateLicenseNumber'), - } + ? { ...cosmetologySpecificColumns } : { privilegeStatesDisplay: () => this.$t('licensing.privileges'), } diff --git a/webroot/src/components/Licensee/LicenseeListLegacy/LicenseeListLegacy.ts b/webroot/src/components/Licensee/LicenseeListLegacy/LicenseeListLegacy.ts index 363a6cec41..5e21f97559 100644 --- a/webroot/src/components/Licensee/LicenseeListLegacy/LicenseeListLegacy.ts +++ b/webroot/src/components/Licensee/LicenseeListLegacy/LicenseeListLegacy.ts @@ -147,15 +147,29 @@ class LicenseeList extends Vue { return options; } + get listDescriptionText(): string { + return (this.isAppModeCosmetology) + ? this.$t('licensing.licensingListDescriptionCosm') + : this.$t('licensing.licensingListDescription'); + } + get headerRecord() { + const cosmetologySpecificColumns = { + licenseNumber: this.$t('licensing.stateLicenseNumber'), + ...(this.isPublicSearch) + ? { + isPublicSearch: true, + eligibilityDisplay: () => this.$t('licensing.compactRestriction'), + isRestricted: () => false, + } + : {} + }; const record = { firstName: this.$t('common.firstName'), lastName: this.$t('common.lastName'), homeJurisdictionDisplay: () => this.$t('licensing.homeState'), ...(this.isAppModeCosmetology - ? { - licenseNumber: this.$t('licensing.stateLicenseNumber'), - } + ? { ...cosmetologySpecificColumns } : { privilegeStatesDisplay: () => this.$t('licensing.privileges'), } diff --git a/webroot/src/components/Licensee/LicenseeListLegacy/LicenseeListLegacy.vue b/webroot/src/components/Licensee/LicenseeListLegacy/LicenseeListLegacy.vue index 402735aee6..7ea9c84c69 100644 --- a/webroot/src/components/Licensee/LicenseeListLegacy/LicenseeListLegacy.vue +++ b/webroot/src/components/Licensee/LicenseeListLegacy/LicenseeListLegacy.vue @@ -39,7 +39,7 @@ -
{{ $t('licensing.licensingListDescription')}}
+
{{ listDescriptionText }}
+
+ {{ $t('licensing.compactRestriction') }}: + {{ item.eligibilityDisplay() }} + +
diff --git a/webroot/src/locales/en.json b/webroot/src/locales/en.json index 9b83a4108a..4a3f1abfdb 100644 --- a/webroot/src/locales/en.json +++ b/webroot/src/locales/en.json @@ -695,6 +695,10 @@ "inactive": "Inactive", "initializing": "Initializing" }, + "restrictionOptions": { + "eligible": "No restrictions", + "ineligible": "Alert: Restricted" + }, "licenseActions": "License actions", "privilegeActions": "Privilege actions", "privilegeActionsNone": "No available actions", @@ -950,6 +954,7 @@ "personalInfoTitle": "Personal information", "eventNodeLabel": "Event: {eventNameDisplay} on {eventDate}", "statusBlockLabel": "{status} status block", + "compactRestriction": "Restriction", "compactEligible": "Compact Eligible", "notCompactEligible": "Not Compact Eligible", "privilegeVerification": "Privilege Verification", diff --git a/webroot/src/locales/es.json b/webroot/src/locales/es.json index cccbf3a044..833178b846 100644 --- a/webroot/src/locales/es.json +++ b/webroot/src/locales/es.json @@ -679,6 +679,10 @@ "inactive": "Inactivo", "initializing": "Inicializando" }, + "restrictionOptions": { + "eligible": "Sin restricciones", + "ineligible": "Alerta: Restringido" + }, "licenseActions": "Acciones de licencia", "privilegeActions": "Acciones de privilegio", "privilegeActionsNone": "No hay acciones disponibles", @@ -934,6 +938,7 @@ "personalInfoTitle": "Información personal", "eventNodeLabel": "Evento: {eventNameDisplay} en {eventDate}", "statusBlockLabel": "{status} bloque de estado", + "compactRestriction": "Restricción", "compactEligible": "Elegible Compacto", "notCompactEligible": "No Compacto Elegible", "privilegeVerification": "Verificación de privilegios", diff --git a/webroot/src/models/Licensee/Licensee.model.spec.ts b/webroot/src/models/Licensee/Licensee.model.spec.ts index 89614097f2..3b631cac01 100644 --- a/webroot/src/models/Licensee/Licensee.model.spec.ts +++ b/webroot/src/models/Licensee/Licensee.model.spec.ts @@ -9,7 +9,12 @@ import chai, { expect } from 'chai'; import chaiMatchPattern from 'chai-match-pattern'; import { serverDateFormat, serverDatetimeFormat, displayDateFormat } from '@/app.config'; import { CompactType } from '@models/Compact/Compact.model'; -import { Licensee, LicenseeStatus, LicenseeSerializer } from '@models/Licensee/Licensee.model'; +import { + Licensee, + LicenseeStatus, + LicenseeEligibility, + LicenseeSerializer +} from '@models/Licensee/Licensee.model'; import { Address } from '@models/Address/Address.model'; import { License, @@ -80,6 +85,8 @@ describe('Licensee model', () => { expect(licensee.privilegeStatesDisplay()).to.equal(''); expect(licensee.licenseTypeName()).to.equal(''); expect(licensee.statusDisplay()).to.equal('Inactive'); + expect(licensee.eligibilityDisplay()).to.equal(''); + expect(licensee.isRestricted()).to.equal(false); expect(licensee.phoneNumberDisplay()).to.equal(''); expect(licensee.isMilitaryStatusActive()).to.equal(false); expect(licensee.activeMilitaryAffiliation()).to.equal(null); @@ -156,6 +163,7 @@ describe('Licensee model', () => { adverseActions: [new AdverseAction()], lastUpdated: '2020-01-01', status: LicenseeStatus.ACTIVE, + eligibility: LicenseeEligibility.INELIGIBLE, }; const licensee = new Licensee(data); @@ -202,6 +210,8 @@ describe('Licensee model', () => { expect(licensee.privilegeStatesDisplay()).to.equal('Unknown'); expect(licensee.licenseTypeName()).to.equal('Audiologist'); expect(licensee.statusDisplay()).to.equal('Active'); + expect(licensee.eligibilityDisplay()).to.equal('Alert: Restricted'); + expect(licensee.isRestricted()).to.equal(true); expect(licensee.phoneNumberDisplay()).to.equal('+1 323-455-8990'); expect(licensee.isMilitaryStatusActive()).to.equal(false); expect(licensee.activeMilitaryAffiliation()).to.equal(null); @@ -429,6 +439,7 @@ describe('Licensee model', () => { ], dateOfUpdate: moment().format(serverDateFormat), licenseStatus: LicenseeStatus.ACTIVE, + licenseEligibility: LicenseeEligibility.ELIGIBLE, adverseActions: [ { adverseActionId: 'test-adverseAction-id', @@ -495,6 +506,8 @@ describe('Licensee model', () => { expect(licensee.privilegeStatesDisplay()).to.equal('Colorado'); expect(licensee.licenseTypeName()).to.equal('Audiologist'); expect(licensee.statusDisplay()).to.equal('Active'); + expect(licensee.eligibilityDisplay()).to.equal('No restrictions'); + expect(licensee.isRestricted()).to.equal(false); expect(licensee.phoneNumberDisplay()).to.equal('+1 323-455-8990'); expect(licensee.isMilitaryStatusActive()).to.equal(true); expect(licensee.activeMilitaryAffiliation()).to.matchPattern({ diff --git a/webroot/src/models/Licensee/Licensee.model.ts b/webroot/src/models/Licensee/Licensee.model.ts index aa7f55dc64..b3ab21177a 100644 --- a/webroot/src/models/Licensee/Licensee.model.ts +++ b/webroot/src/models/Licensee/Licensee.model.ts @@ -37,6 +37,11 @@ export enum LicenseeStatus { INACTIVE = 'inactive', } +export enum LicenseeEligibility { + ELIGIBLE = 'eligible', + INELIGIBLE = 'ineligible', +} + export interface InterfaceLicensee { id?: string | null; npi?: string | null; @@ -61,6 +66,7 @@ export interface InterfaceLicensee { adverseActions?: Array; lastUpdated?: string | null; status?: LicenseeStatus; + eligibility?: LicenseeEligibility | null; } // ======================================================== @@ -93,6 +99,7 @@ export class Licensee implements InterfaceLicensee { public adverseActions? = []; public lastUpdated? = null; public status? = LicenseeStatus.INACTIVE; + public eligibility? = null; constructor(data?: InterfaceLicensee) { const cleanDataObject = deleteUndefinedProperties(data); @@ -201,6 +208,14 @@ export class Licensee implements InterfaceLicensee { return this.$t(`licensing.statusOptions.${this.status}`); } + public eligibilityDisplay(): string { + return (this.eligibility) ? this.$t(`licensing.restrictionOptions.${this.eligibility}`) : ''; + } + + public isRestricted(): boolean { + return Boolean(this.eligibility && this.eligibility === LicenseeEligibility.INELIGIBLE); + } + public phoneNumberDisplay(): string { return this.phoneNumber ? formatPhoneNumber(stripPhoneNumber(this.phoneNumber)) : ''; } @@ -444,6 +459,7 @@ export class LicenseeSerializer { militaryStatus: json.militaryStatus, militaryStatusNote: json.militaryStatusNote, status: json.licenseStatus, + eligibility: json.licenseEligibility, lastUpdated: json.dateOfUpdate, }; diff --git a/webroot/src/network/mocks/mock.data.ts b/webroot/src/network/mocks/mock.data.ts index ec11721019..1467a81db4 100644 --- a/webroot/src/network/mocks/mock.data.ts +++ b/webroot/src/network/mocks/mock.data.ts @@ -541,6 +541,7 @@ export const licensees = { militaryStatus: 'approved', militaryStatusNote: 'All the docs look good!', licenseStatus: 'active', + licenseEligibility: 'eligible', // COSM list fetch licenseJurisdiction: 'co', currentHomeJurisdiction: 'co', npi: '1234567890', @@ -682,6 +683,7 @@ export const licensees = { militaryStatus: 'declined', militaryStatusNote: 'Could not view the required docs. Please upload new copies.', licenseStatus: 'active', + licenseEligibility: 'ineligible', // COSM list fetch licenseJurisdiction: 'co', currentHomeJurisdiction: 'co', npi: '6441445289', diff --git a/webroot/src/store/license/license.mutations.ts b/webroot/src/store/license/license.mutations.ts index 9631cefb3e..29e8892e2c 100644 --- a/webroot/src/store/license/license.mutations.ts +++ b/webroot/src/store/license/license.mutations.ts @@ -75,6 +75,19 @@ export default { .findIndex((p: any) => p.id === licensee.id); if (licenseeToUpdateIndex !== -1) { + const currentLicenseeRecord = state.model[licenseeToUpdateIndex]; + const listFetchOnlyProps = ['licenseNumber', 'eligibility']; + + // Some props are only returned on the list fetch, and we want to preserve those where possible. + listFetchOnlyProps.forEach((listFetchOnlyProp) => { + const isCurrentRecordIncludingProp = Object.hasOwn(currentLicenseeRecord, listFetchOnlyProp); + const isNewRecordMissingProp = Object.hasOwn(licensee, listFetchOnlyProp); + + if (isCurrentRecordIncludingProp && isNewRecordMissingProp) { + licensee[listFetchOnlyProp] = currentLicenseeRecord[listFetchOnlyProp]; + } + }); + state.model.splice(licenseeToUpdateIndex, 1, licensee); } else { state.model.push(licensee); diff --git a/webroot/src/styles.common/_lists.less b/webroot/src/styles.common/_lists.less index fe100ad470..89d60bbe74 100644 --- a/webroot/src/styles.common/_lists.less +++ b/webroot/src/styles.common/_lists.less @@ -168,6 +168,11 @@ margin-right: 0.4rem; font-weight: @fontWeightBold; } + + .alert { + color: @midRed; + font-weight: @fontWeightBold; + } } .sort-icon {