Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions webroot/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ VUE_APP_API_STATE_ROOT=https://api.test.jcc.iaapi.io
VUE_APP_API_LICENSE_ROOT=https://api.test.jcc.iaapi.io
VUE_APP_API_SEARCH_ROOT=https://search.test.jcc.iaapi.io
VUE_APP_API_USER_ROOT=https://api.test.jcc.iaapi.io
VUE_APP_API_STATE_ROOT_COSMO=https://api.test.cosmo.iaapi.io
VUE_APP_API_LICENSE_ROOT_COSMO=https://api.test.cosmo.iaapi.io
VUE_APP_API_SEARCH_ROOT_COSMO=https://search.test.cosmo.iaapi.io
VUE_APP_API_USER_ROOT_COSMO=https://api.test.cosmo.iaapi.io
VUE_APP_API_STATE_ROOT_COSMO=https://api.test.cosmetology.jcc.iaapi.io
VUE_APP_API_LICENSE_ROOT_COSMO=https://api.test.cosmetology.jcc.iaapi.io
VUE_APP_API_SEARCH_ROOT_COSMO=https://search.test.cosmetology.jcc.iaapi.io
VUE_APP_API_USER_ROOT_COSMO=https://api.test.cosmetology.jcc.iaapi.io
VUE_APP_COGNITO_REGION=us-east-1
VUE_APP_COGNITO_AUTH_DOMAIN_STAFF=https://staff-auth.test.jcc.iaapi.io
VUE_APP_COGNITO_CLIENT_ID_STAFF=15mh24ea4af3of8jcnv8h2ic10
Expand Down
2 changes: 2 additions & 0 deletions webroot/src/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export const tokens = {
export const AUTH_TYPE = 'auth_type';
export const AUTH_LOGIN_GOTO_PATH = 'login_goto';
export const AUTH_LOGIN_GOTO_PATH_AUTH_TYPE = 'login_goto_auth_type';
export const AUTH_LOGIN_GOTO_COMPACT = 'login_goto_compact';

// ====================
// = Auto logout =
Expand Down Expand Up @@ -357,6 +358,7 @@ export default {
authStorage,
tokens,
AUTH_LOGIN_GOTO_PATH,
AUTH_LOGIN_GOTO_COMPACT,
languagesEnabled,
defaultLanguage,
serverDateFormat,
Expand Down
14 changes: 11 additions & 3 deletions webroot/src/components/App/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import {
AppModes,
AuthTypes,
relativeTimeFormats,
AUTH_TYPE
AUTH_TYPE,
AUTH_LOGIN_GOTO_COMPACT
} from '@/app.config';
import { CompactType } from '@models/Compact/Compact.model';
import PageContainer from '@components/Page/PageContainer/PageContainer.vue';
Expand Down Expand Up @@ -187,19 +188,26 @@ class App extends Vue {
async setCurrentCompact(): Promise<void> {
const { authType } = this.globalStore;
const { currentCompact, model: user } = this.userStore;
const preLoginCompactType = authStorage.getItem(AUTH_LOGIN_GOTO_COMPACT);
let userDefaultCompact;
let isCompactPartOfUserPermissions;

authStorage.removeItem(AUTH_LOGIN_GOTO_COMPACT);

if (authType === AuthTypes.STAFF) {
const { permissions = [] } = user || {};
const preLoginCompact = permissions?.find((permission) =>
permission.compact.type === preLoginCompactType)?.compact || null;
const firstCompactFromServer = permissions?.[0]?.compact || null;

userDefaultCompact = permissions?.[0]?.compact || null;
userDefaultCompact = preLoginCompact || firstCompactFromServer;
isCompactPartOfUserPermissions = permissions.some((permission) =>
permission.compact.type === currentCompact?.type);
} else if (authType === AuthTypes.LICENSEE) {
const { licenses = [] } = user?.licensee || {};
const firstCompactFromServer = licenses?.[0]?.compact || null;

userDefaultCompact = licenses?.[0]?.compact || null;
userDefaultCompact = firstCompactFromServer;
isCompactPartOfUserPermissions = licenses.some((license) => license.compact.type === currentCompact?.type);
}

Expand Down
6 changes: 4 additions & 2 deletions webroot/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,9 @@
"licensingListDescription": "Click on a licensee to view the status of their privilege(s). The “Privileges” column includes both past and active privileges.",
"attestation": "Attestation",
"stateProvidedEmail": "State-provided email",
"stateEmail": "State email",
"accountEmail": "Account email",
"registrationEmail": "Registration email",
"searchTitle": "Begin a search",
"searchTitlePublic": "Verify a compact privilege",
"searchSubtext": "Enter at least one field to search for licensing data.",
Expand All @@ -604,7 +606,7 @@
"searchPlaceholderNpi": "Enter NPI",
"licenseExpirationDate": "License expiration date",
"residenceLocation": "Residence location",
"generateVerification": "Generate verification doc",
"generateVerification": "Generate verification document",
"generateVerificationSubtext": "Printer-friendly view",
"provider": "Provider",
"providers": "Providers",
Expand Down Expand Up @@ -945,7 +947,7 @@
"practitionerName": "Practitioner name",
"homeStateLicenses": "Home State Licenses",
"activeDate": "Active",
"privilegeProofFooter": "This document is issued by Compact Connect as official proof of the practitioner’s current privileges to practice.<br/>It confirms privilege-to-practice status only and is not intended to be a verification of state licensure.",
"privilegeProofFooter": "This document is issued by CompactConnect as official proof of the practitioner’s current privileges to practice.<br/>It confirms privilege-to-practice status only and is not intended to be a verification of state licensure.",
"publicProfileLink": "View public profile at",
"qrCodeAlt": "QR code linking to public profile",
"licenseDeactivationNote": "Deactivated due to associated license being deactivated",
Expand Down
4 changes: 3 additions & 1 deletion webroot/src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,9 @@
"searchTitlePublic": "Verificar un privilegio compacto",
"attestation": "Atestación",
"stateProvidedEmail": "Correo electrónico proporcionado por el estado",
"stateEmail": "Correo electrónico estatal",
"accountEmail": "Correo electrónico de la cuenta",
"registrationEmail": "Correo electrónico de registro",
"searchSubtext": "Introduzca al menos un campo para buscar datos de licencia.",
"searchStateDisabled": "Por favor, primero seleccione un tipo de profesión",
"searchTypeTitle": "Buscar",
Expand Down Expand Up @@ -929,7 +931,7 @@
"practitionerName": "Nombre del profesional",
"homeStateLicenses": "Licencias del estado de origen",
"activeDate": "Activa",
"privilegeProofFooter": "Este documento es emitido por Compact Connect como prueba oficial de los privilegios actuales del profesional para practicar.<br/>Confirma el estado de privilegio-a-practicar solo y no está destinado a ser una verificación de la licencia estatal.",
"privilegeProofFooter": "Este documento es emitido por CompactConnect como prueba oficial de los privilegios actuales del profesional para practicar.<br/>Confirma el estado de privilegio-a-practicar solo y no está destinado a ser una verificación de la licencia estatal.",
"publicProfileLink": "Ver perfil público en",
"licenseDeactivationNote": "Desactivado debido a que la licencia asociada está desactivada",
"homeStateChangeNote": "Desactivado debido al cambio de estado de origen",
Expand Down
5 changes: 5 additions & 0 deletions webroot/src/models/License/License.model.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ describe('License model', () => {
expect(license.licenseNumber).to.equal(null);
expect(license.privilegeId).to.equal(null);
expect(license.mailingAddress).to.be.an.instanceof(Address);
expect(license.email).to.equal(null);
expect(license.licenseType).to.equal(null);
expect(license.history).to.matchPattern([]);
expect(license.status).to.equal(LicenseStatus.INACTIVE);
Expand Down Expand Up @@ -95,6 +96,7 @@ describe('License model', () => {
licenseNumber: 'test-license-number',
privilegeId: 'privilegeId',
mailingAddress: new Address(),
email: 'test@example.com',
npi: 'test-npi',
licenseType: LicenseType.AUDIOLOGIST,
history: [new LicenseHistoryItem()],
Expand All @@ -118,6 +120,7 @@ describe('License model', () => {
expect(license.renewalDate).to.equal(data.renewalDate);
expect(license.expireDate).to.equal(data.expireDate);
expect(license.mailingAddress).to.be.an.instanceof(Address);
expect(license.email).to.equal(data.email);
expect(license.npi).to.equal(data.npi);
expect(license.licenseNumber).to.equal(data.licenseNumber);
expect(license.privilegeId).to.equal(data.privilegeId);
Expand Down Expand Up @@ -175,6 +178,7 @@ describe('License model', () => {
homeAddressCity: 'test-city',
homeAddressState: 'co',
homeAddressPostalCode: 'test-zip',
emailAddress: 'test@example.com',
licenseType: LicenseType.AUDIOLOGIST,
history: [],
licenseStatus: LicenseStatus.ACTIVE,
Expand Down Expand Up @@ -209,6 +213,7 @@ describe('License model', () => {
expect(license.licenseeId).to.equal(data.providerId);
expect(license.issueState).to.be.an.instanceof(State);
expect(license.mailingAddress).to.be.an.instanceof(Address);
expect(license.email).to.equal(data.emailAddress);
expect(license.issueState.abbrev).to.equal(data.jurisdiction);
expect(license.issueDate).to.equal(data.dateOfIssuance);
expect(license.renewalDate).to.equal(data.dateOfRenewal);
Expand Down
3 changes: 3 additions & 0 deletions webroot/src/models/License/License.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export interface InterfaceLicense {
renewalDate?: string | null;
activeFromDate?: string | null;
mailingAddress?: Address;
email?: string | null;
expireDate?: string | null;
npi?: string | null;
licenseNumber?: string | null;
Expand Down Expand Up @@ -82,6 +83,7 @@ export class License implements InterfaceLicense {
public issueDate? = null;
public activeFromDate? = null;
public mailingAddress? = new Address();
public email? = null;
public renewalDate? = null;
public npi? = null;
public licenseNumber? = null;
Expand Down Expand Up @@ -209,6 +211,7 @@ export class LicenseSerializer {
state: json.homeAddressState,
zip: json.homeAddressPostalCode,
}),
email: json.emailAddress,
issueState: new State({ abbrev: json.jurisdiction || json.licenseJurisdiction }),
issueDate: json.dateOfIssuance,
activeFromDate: json.activeSince,
Expand Down
5 changes: 5 additions & 0 deletions webroot/src/models/Licensee/Licensee.model.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ describe('Licensee model', () => {
expect(licensee.firstName).to.equal(null);
expect(licensee.middleName).to.equal(null);
expect(licensee.lastName).to.equal(null);
expect(licensee.compactConnectEmail).to.equal(null);
expect(licensee.dob).to.equal(null);
expect(licensee.birthMonthDay).to.equal(null);
expect(licensee.licenseType).to.equal(null);
Expand Down Expand Up @@ -110,6 +111,7 @@ describe('Licensee model', () => {
address: new Address(),
phoneNumber: '+13234558990',
homeJurisdiction: new State({ abbrev: 'ma' }),
compactConnectEmail: 'test@example.com',
dob: '2020-01-01',
birthMonthDay: '01-16',
ssnLastFour: '0000',
Expand Down Expand Up @@ -165,6 +167,7 @@ describe('Licensee model', () => {
expect(licensee.lastName).to.equal(data.lastName);
expect(licensee.phoneNumber).to.equal(data.phoneNumber);
expect(licensee.homeJurisdiction).to.be.an.instanceof(State);
expect(licensee.compactConnectEmail).to.equal(data.compactConnectEmail);
expect(licensee.dob).to.equal(data.dob);
expect(licensee.birthMonthDay).to.equal(data.birthMonthDay);
expect(licensee.ssnLastFour).to.equal(data.ssnLastFour);
Expand Down Expand Up @@ -311,6 +314,7 @@ describe('Licensee model', () => {
dateOfBirth: moment().format(serverDateFormat),
phoneNumber: '+13234558990',
currentHomeJurisdiction: 'co',
compactConnectRegisteredEmailAddress: 'test@example.com',
ssnLastFour: '0000',
licenseType: LicenseType.AUDIOLOGIST,
licenseJurisdiction: 'co',
Expand Down Expand Up @@ -430,6 +434,7 @@ describe('Licensee model', () => {
expect(licensee.firstName).to.equal(data.givenName);
expect(licensee.middleName).to.equal(data.middleName);
expect(licensee.lastName).to.equal(data.familyName);
expect(licensee.compactConnectEmail).to.equal(data.compactConnectRegisteredEmailAddress);
expect(licensee.birthMonthDay).to.equal(data.birthMonthDay);
expect(licensee.dob).to.equal(data.dateOfBirth);
expect(licensee.ssnLastFour).to.equal(data.ssnLastFour);
Expand Down
3 changes: 3 additions & 0 deletions webroot/src/models/Licensee/Licensee.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export interface InterfaceLicensee {
middleName?: string | null;
lastName?: string | null;
homeJurisdiction?: State;
compactConnectEmail?: string | null;
dob?: string | null;
birthMonthDay?: string | null;
ssnLastFour?: string | null;
Expand Down Expand Up @@ -74,6 +75,7 @@ export class Licensee implements InterfaceLicensee {
public middleName? = null;
public lastName? = null;
public homeJurisdiction? = new State();
public compactConnectEmail? = null;
public dob? = null;
public birthMonthDay? = null;
public ssnLastFour? = null;
Expand Down Expand Up @@ -424,6 +426,7 @@ export class LicenseeSerializer {
homeJurisdiction: (json.currentHomeJurisdiction && json.currentHomeJurisdiction.trim().toLowerCase() !== 'unknown')
? new State({ abbrev: json.currentHomeJurisdiction })
: new State({ abbrev: json.licenseJurisdiction }),
compactConnectEmail: json.compactConnectRegisteredEmailAddress,
dob: json.dateOfBirth,
birthMonthDay: json.birthMonthDay,
ssnLastFour: json.ssnLastFour,
Expand Down
13 changes: 2 additions & 11 deletions webroot/src/network/mocks/mock.data.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import { config as envConfig } from '@plugins/EnvConfig/envConfig.plugin';
import { AppModes, FeatureGates } from '@/app.config';
import { FeatureGates } from '@/app.config';
import { LicenseeSerializer } from '@models/Licensee/Licensee.model';
import { LicenseHistoryItem, LicenseHistoryItemSerializer } from '@/models/LicenseHistoryItem/LicenseHistoryItem.model';
import { LicenseeUserSerializer } from '@models/LicenseeUser/LicenseeUser.model';
Expand Down Expand Up @@ -603,16 +603,7 @@ export class DataApi {

// Get Authenticated Staff User
public getAuthenticatedStaffUser() {
const account = JSON.parse(JSON.stringify(staffAccount));

if (mockStore?.state?.appMode === AppModes.COSMETOLOGY) {
console.log(`deleting non-cosm staff user compacts`);
delete account.permissions.octp;
delete account.permissions.aslp;
delete account.permissions.coun;
}

return wait(500).then(() => StaffUserSerializer.fromServer(account));
return wait(500).then(() => StaffUserSerializer.fromServer(staffAccount));
}

// Update Authenticated Staff User
Expand Down
Loading
Loading