linting
parent
2c506711fb
commit
3c1d023ccd
|
|
@ -12,7 +12,7 @@ import { getConfigProperty } from '../helpers/config.helpers.js';
|
||||||
import version from '../version.js';
|
import version from '../version.js';
|
||||||
const debug = Debug(`${DEBUG_NAMESPACE}:www:${process.pid}`);
|
const debug = Debug(`${DEBUG_NAMESPACE}:www:${process.pid}`);
|
||||||
// INITIALIZE THE DATABASE
|
// INITIALIZE THE DATABASE
|
||||||
await initializeDatabase();
|
initializeDatabase();
|
||||||
const directoryName = path.dirname(fileURLToPath(import.meta.url));
|
const directoryName = path.dirname(fileURLToPath(import.meta.url));
|
||||||
const processCount = Math.min(getConfigProperty('application.maximumProcesses'), os.cpus().length * 2);
|
const processCount = Math.min(getConfigProperty('application.maximumProcesses'), os.cpus().length * 2);
|
||||||
const applicationName = getConfigProperty('application.applicationName');
|
const applicationName = getConfigProperty('application.applicationName');
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import version from '../version.js'
|
||||||
const debug = Debug(`${DEBUG_NAMESPACE}:www:${process.pid}`)
|
const debug = Debug(`${DEBUG_NAMESPACE}:www:${process.pid}`)
|
||||||
|
|
||||||
// INITIALIZE THE DATABASE
|
// INITIALIZE THE DATABASE
|
||||||
await initializeDatabase()
|
initializeDatabase()
|
||||||
|
|
||||||
const directoryName = path.dirname(fileURLToPath(import.meta.url))
|
const directoryName = path.dirname(fileURLToPath(import.meta.url))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import { getConfigProperty } from '../helpers/config.helpers.js';
|
||||||
const debug = Debug(`${DEBUG_NAMESPACE}:wwwProcess:${process.pid.toString().padEnd(5)}`);
|
const debug = Debug(`${DEBUG_NAMESPACE}:wwwProcess:${process.pid.toString().padEnd(5)}`);
|
||||||
if (process.send === undefined) {
|
if (process.send === undefined) {
|
||||||
// INITIALIZE THE DATABASE
|
// INITIALIZE THE DATABASE
|
||||||
await initializeDatabase();
|
initializeDatabase();
|
||||||
}
|
}
|
||||||
function onError(error) {
|
function onError(error) {
|
||||||
if (error.syscall !== 'listen') {
|
if (error.syscall !== 'listen') {
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ const debug = Debug(`${DEBUG_NAMESPACE}:wwwProcess:${process.pid.toString().padE
|
||||||
|
|
||||||
if (process.send === undefined) {
|
if (process.send === undefined) {
|
||||||
// INITIALIZE THE DATABASE
|
// INITIALIZE THE DATABASE
|
||||||
await initializeDatabase()
|
initializeDatabase()
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ServerError extends Error {
|
interface ServerError extends Error {
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@ export interface GetContractsFilters {
|
||||||
contractEffectiveDateString?: string;
|
contractEffectiveDateString?: string;
|
||||||
contractStartDateString?: DateString;
|
contractStartDateString?: DateString;
|
||||||
contractTime?: '' | 'current' | 'future' | 'past';
|
contractTime?: '' | 'current' | 'future' | 'past';
|
||||||
deceasedName?: string;
|
|
||||||
contractTypeId?: number | string;
|
|
||||||
cemeteryId?: number | string;
|
cemeteryId?: number | string;
|
||||||
|
contractTypeId?: number | string;
|
||||||
|
deceasedName?: string;
|
||||||
burialSiteName?: string;
|
burialSiteName?: string;
|
||||||
burialSiteNameSearchType?: '' | 'endsWith' | 'startsWith';
|
burialSiteNameSearchType?: '' | 'endsWith' | 'startsWith';
|
||||||
burialSiteTypeId?: number | string;
|
burialSiteTypeId?: number | string;
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,9 @@ export interface GetContractsFilters {
|
||||||
contractStartDateString?: DateString
|
contractStartDateString?: DateString
|
||||||
contractTime?: '' | 'current' | 'future' | 'past'
|
contractTime?: '' | 'current' | 'future' | 'past'
|
||||||
|
|
||||||
deceasedName?: string
|
|
||||||
contractTypeId?: number | string
|
|
||||||
cemeteryId?: number | string
|
cemeteryId?: number | string
|
||||||
|
contractTypeId?: number | string
|
||||||
|
deceasedName?: string
|
||||||
|
|
||||||
burialSiteName?: string
|
burialSiteName?: string
|
||||||
burialSiteNameSearchType?: '' | 'endsWith' | 'startsWith'
|
burialSiteNameSearchType?: '' | 'endsWith' | 'startsWith'
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ await describe('Initialize Database', async () => {
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
||||||
await fs.unlink(databasePath);
|
await fs.unlink(databasePath);
|
||||||
const success = await initializeDatabase();
|
const success = initializeDatabase();
|
||||||
assert.ok(success);
|
assert.ok(success);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ await describe('Initialize Database', async () => {
|
||||||
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
||||||
await fs.unlink(databasePath)
|
await fs.unlink(databasePath)
|
||||||
|
|
||||||
const success = await initializeDatabase()
|
const success = initializeDatabase()
|
||||||
|
|
||||||
assert.ok(success)
|
assert.ok(success)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -6,107 +6,107 @@ import * as sqlFilterFunctions from '../helpers/functions.sqlFilters.js';
|
||||||
import * as userFunctions from '../helpers/functions.user.js';
|
import * as userFunctions from '../helpers/functions.user.js';
|
||||||
await describe('functions.cache', async () => {
|
await describe('functions.cache', async () => {
|
||||||
const badId = -3;
|
const badId = -3;
|
||||||
// eslint-disable-next-line no-secrets/no-secrets
|
// eslint-disable-next-line no-secrets/no-secrets, @cspell/spellchecker
|
||||||
const badName = 'qwertyuiopasdfghjklzxcvbnm';
|
const badName = 'qwertyuiopasdfghjklzxcvbnm';
|
||||||
before(() => {
|
before(() => {
|
||||||
cacheFunctions.clearCaches();
|
cacheFunctions.clearCaches();
|
||||||
});
|
});
|
||||||
await describe('Burial Site Statuses', async () => {
|
await describe('Burial Site Statuses', async () => {
|
||||||
await it('returns Burial Site Statuses', async () => {
|
await it('returns Burial Site Statuses', () => {
|
||||||
cacheFunctions.clearCacheByTableName('BurialSiteStatuses');
|
cacheFunctions.clearCacheByTableName('BurialSiteStatuses');
|
||||||
const burialSiteStatuses = await cacheFunctions.getBurialSiteStatuses();
|
const burialSiteStatuses = cacheFunctions.getBurialSiteStatuses();
|
||||||
assert.ok(burialSiteStatuses.length > 0);
|
assert.ok(burialSiteStatuses.length > 0);
|
||||||
for (const burialSiteStatus of burialSiteStatuses) {
|
for (const burialSiteStatus of burialSiteStatuses) {
|
||||||
const byId = await cacheFunctions.getBurialSiteStatusById(burialSiteStatus.burialSiteStatusId);
|
const byId = cacheFunctions.getBurialSiteStatusById(burialSiteStatus.burialSiteStatusId);
|
||||||
assert.strictEqual(burialSiteStatus.burialSiteStatusId, byId?.burialSiteStatusId);
|
assert.strictEqual(burialSiteStatus.burialSiteStatusId, byId?.burialSiteStatusId);
|
||||||
const byName = await cacheFunctions.getBurialSiteStatusByBurialSiteStatus(burialSiteStatus.burialSiteStatus);
|
const byName = cacheFunctions.getBurialSiteStatusByBurialSiteStatus(burialSiteStatus.burialSiteStatus);
|
||||||
assert.strictEqual(burialSiteStatus.burialSiteStatus, byName?.burialSiteStatus);
|
assert.strictEqual(burialSiteStatus.burialSiteStatus, byName?.burialSiteStatus);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
await it('returns undefined with a bad burialSiteStatusId', async () => {
|
await it('returns undefined with a bad burialSiteStatusId', () => {
|
||||||
const byBadId = await cacheFunctions.getBurialSiteStatusById(badId);
|
const byBadId = cacheFunctions.getBurialSiteStatusById(badId);
|
||||||
assert.ok(byBadId === undefined);
|
assert.ok(byBadId === undefined);
|
||||||
});
|
});
|
||||||
await it('returns undefined with a bad lotStatus', async () => {
|
await it('returns undefined with a bad lotStatus', () => {
|
||||||
const byBadName = await cacheFunctions.getBurialSiteStatusByBurialSiteStatus(badName);
|
const byBadName = cacheFunctions.getBurialSiteStatusByBurialSiteStatus(badName);
|
||||||
assert.ok(byBadName === undefined);
|
assert.ok(byBadName === undefined);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
await describe('Burial Site Types', async () => {
|
await describe('Burial Site Types', async () => {
|
||||||
await it('returns Burial Site Types', async () => {
|
await it('returns Burial Site Types', () => {
|
||||||
cacheFunctions.clearCacheByTableName('BurialSiteTypes');
|
cacheFunctions.clearCacheByTableName('BurialSiteTypes');
|
||||||
const burialSiteTypes = await cacheFunctions.getBurialSiteTypes();
|
const burialSiteTypes = cacheFunctions.getBurialSiteTypes();
|
||||||
assert.ok(burialSiteTypes.length > 0);
|
assert.ok(burialSiteTypes.length > 0);
|
||||||
for (const burialSiteType of burialSiteTypes) {
|
for (const burialSiteType of burialSiteTypes) {
|
||||||
const byId = await cacheFunctions.getBurialSiteTypeById(burialSiteType.burialSiteTypeId);
|
const byId = cacheFunctions.getBurialSiteTypeById(burialSiteType.burialSiteTypeId);
|
||||||
assert.strictEqual(burialSiteType.burialSiteTypeId, byId?.burialSiteTypeId);
|
assert.strictEqual(burialSiteType.burialSiteTypeId, byId?.burialSiteTypeId);
|
||||||
const byName = await cacheFunctions.getBurialSiteTypesByBurialSiteType(burialSiteType.burialSiteType);
|
const byName = cacheFunctions.getBurialSiteTypesByBurialSiteType(burialSiteType.burialSiteType);
|
||||||
assert.strictEqual(burialSiteType.burialSiteType, byName?.burialSiteType);
|
assert.strictEqual(burialSiteType.burialSiteType, byName?.burialSiteType);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
await it('returns undefined with a bad burialSiteTypeId', async () => {
|
await it('returns undefined with a bad burialSiteTypeId', () => {
|
||||||
const byBadId = await cacheFunctions.getBurialSiteTypeById(badId);
|
const byBadId = cacheFunctions.getBurialSiteTypeById(badId);
|
||||||
assert.ok(byBadId === undefined);
|
assert.ok(byBadId === undefined);
|
||||||
});
|
});
|
||||||
await it('returns undefined with a bad lotType', async () => {
|
await it('returns undefined with a bad lotType', () => {
|
||||||
const byBadName = await cacheFunctions.getBurialSiteTypesByBurialSiteType(badName);
|
const byBadName = cacheFunctions.getBurialSiteTypesByBurialSiteType(badName);
|
||||||
assert.ok(byBadName === undefined);
|
assert.ok(byBadName === undefined);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
await describe('Contract Types', async () => {
|
await describe('Contract Types', async () => {
|
||||||
await it('returns Contract Types', async () => {
|
await it('returns Contract Types', () => {
|
||||||
cacheFunctions.clearCacheByTableName('ContractTypes');
|
cacheFunctions.clearCacheByTableName('ContractTypes');
|
||||||
const contractTypes = await cacheFunctions.getContractTypes();
|
const contractTypes = cacheFunctions.getContractTypes();
|
||||||
assert.ok(contractTypes.length > 0);
|
assert.ok(contractTypes.length > 0);
|
||||||
for (const contractType of contractTypes) {
|
for (const contractType of contractTypes) {
|
||||||
const byId = await cacheFunctions.getContractTypeById(contractType.contractTypeId);
|
const byId = cacheFunctions.getContractTypeById(contractType.contractTypeId);
|
||||||
assert.strictEqual(contractType.contractTypeId, byId?.contractTypeId);
|
assert.strictEqual(contractType.contractTypeId, byId?.contractTypeId);
|
||||||
const byName = await cacheFunctions.getContractTypeByContractType(contractType.contractType);
|
const byName = cacheFunctions.getContractTypeByContractType(contractType.contractType);
|
||||||
assert.strictEqual(contractType.contractType, byName?.contractType);
|
assert.strictEqual(contractType.contractType, byName?.contractType);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
await it('returns undefined with a bad contractTypeId', async () => {
|
await it('returns undefined with a bad contractTypeId', () => {
|
||||||
const byBadId = await cacheFunctions.getContractTypeById(badId);
|
const byBadId = cacheFunctions.getContractTypeById(badId);
|
||||||
assert.ok(byBadId === undefined);
|
assert.ok(byBadId === undefined);
|
||||||
});
|
});
|
||||||
await it('returns undefined with a bad contractType', async () => {
|
await it('returns undefined with a bad contractType', () => {
|
||||||
const byBadName = await cacheFunctions.getContractTypeByContractType(badName);
|
const byBadName = cacheFunctions.getContractTypeByContractType(badName);
|
||||||
assert.ok(byBadName === undefined);
|
assert.ok(byBadName === undefined);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
await describe('Work Order Types', async () => {
|
await describe('Work Order Types', async () => {
|
||||||
await it('returns Work Order Types', async () => {
|
await it('returns Work Order Types', () => {
|
||||||
cacheFunctions.clearCacheByTableName('WorkOrderTypes');
|
cacheFunctions.clearCacheByTableName('WorkOrderTypes');
|
||||||
const workOrderTypes = await cacheFunctions.getWorkOrderTypes();
|
const workOrderTypes = cacheFunctions.getWorkOrderTypes();
|
||||||
assert.ok(workOrderTypes.length > 0);
|
assert.ok(workOrderTypes.length > 0);
|
||||||
for (const workOrderType of workOrderTypes) {
|
for (const workOrderType of workOrderTypes) {
|
||||||
const byId = await cacheFunctions.getWorkOrderTypeById(workOrderType.workOrderTypeId);
|
const byId = cacheFunctions.getWorkOrderTypeById(workOrderType.workOrderTypeId);
|
||||||
assert.strictEqual(workOrderType.workOrderTypeId, byId?.workOrderTypeId);
|
assert.strictEqual(workOrderType.workOrderTypeId, byId?.workOrderTypeId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
await it('returns undefined with a bad workOrderTypeId', async () => {
|
await it('returns undefined with a bad workOrderTypeId', () => {
|
||||||
const byBadId = await cacheFunctions.getWorkOrderTypeById(badId);
|
const byBadId = cacheFunctions.getWorkOrderTypeById(badId);
|
||||||
assert.ok(byBadId === undefined);
|
assert.ok(byBadId === undefined);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
await describe('Work Order Milestone Types', async () => {
|
await describe('Work Order Milestone Types', async () => {
|
||||||
await it('returns Work Order Milestone Types', async () => {
|
await it('returns Work Order Milestone Types', () => {
|
||||||
cacheFunctions.clearCacheByTableName('WorkOrderMilestoneTypes');
|
cacheFunctions.clearCacheByTableName('WorkOrderMilestoneTypes');
|
||||||
const workOrderMilestoneTypes = await cacheFunctions.getWorkOrderMilestoneTypes();
|
const workOrderMilestoneTypes = cacheFunctions.getWorkOrderMilestoneTypes();
|
||||||
assert.ok(workOrderMilestoneTypes.length > 0);
|
assert.ok(workOrderMilestoneTypes.length > 0);
|
||||||
for (const workOrderMilestoneType of workOrderMilestoneTypes) {
|
for (const workOrderMilestoneType of workOrderMilestoneTypes) {
|
||||||
const byId = await cacheFunctions.getWorkOrderMilestoneTypeById(workOrderMilestoneType.workOrderMilestoneTypeId);
|
const byId = cacheFunctions.getWorkOrderMilestoneTypeById(workOrderMilestoneType.workOrderMilestoneTypeId);
|
||||||
assert.strictEqual(workOrderMilestoneType.workOrderMilestoneTypeId, byId?.workOrderMilestoneTypeId);
|
assert.strictEqual(workOrderMilestoneType.workOrderMilestoneTypeId, byId?.workOrderMilestoneTypeId);
|
||||||
const byName = await cacheFunctions.getWorkOrderMilestoneTypeByWorkOrderMilestoneType(workOrderMilestoneType.workOrderMilestoneType);
|
const byName = cacheFunctions.getWorkOrderMilestoneTypeByWorkOrderMilestoneType(workOrderMilestoneType.workOrderMilestoneType);
|
||||||
assert.strictEqual(workOrderMilestoneType.workOrderMilestoneType, byName?.workOrderMilestoneType);
|
assert.strictEqual(workOrderMilestoneType.workOrderMilestoneType, byName?.workOrderMilestoneType);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
await it('returns undefined with a bad workOrderMilestoneTypeId', async () => {
|
await it('returns undefined with a bad workOrderMilestoneTypeId', () => {
|
||||||
const byBadId = await cacheFunctions.getWorkOrderMilestoneTypeById(badId);
|
const byBadId = cacheFunctions.getWorkOrderMilestoneTypeById(badId);
|
||||||
assert.ok(byBadId === undefined);
|
assert.ok(byBadId === undefined);
|
||||||
});
|
});
|
||||||
await it('returns undefined with a bad workOrderMilestoneType', async () => {
|
await it('returns undefined with a bad workOrderMilestoneType', () => {
|
||||||
const byBadName = await cacheFunctions.getWorkOrderMilestoneTypeByWorkOrderMilestoneType(badName);
|
const byBadName = cacheFunctions.getWorkOrderMilestoneTypeByWorkOrderMilestoneType(badName);
|
||||||
assert.ok(byBadName === undefined);
|
assert.ok(byBadName === undefined);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import * as userFunctions from '../helpers/functions.user.js'
|
||||||
|
|
||||||
await describe('functions.cache', async () => {
|
await describe('functions.cache', async () => {
|
||||||
const badId = -3
|
const badId = -3
|
||||||
// eslint-disable-next-line no-secrets/no-secrets
|
// eslint-disable-next-line no-secrets/no-secrets, @cspell/spellchecker
|
||||||
const badName = 'qwertyuiopasdfghjklzxcvbnm'
|
const badName = 'qwertyuiopasdfghjklzxcvbnm'
|
||||||
|
|
||||||
before(() => {
|
before(() => {
|
||||||
|
|
@ -16,15 +16,15 @@ await describe('functions.cache', async () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
await describe('Burial Site Statuses', async () => {
|
await describe('Burial Site Statuses', async () => {
|
||||||
await it('returns Burial Site Statuses', async () => {
|
await it('returns Burial Site Statuses', () => {
|
||||||
cacheFunctions.clearCacheByTableName('BurialSiteStatuses')
|
cacheFunctions.clearCacheByTableName('BurialSiteStatuses')
|
||||||
|
|
||||||
const burialSiteStatuses = await cacheFunctions.getBurialSiteStatuses()
|
const burialSiteStatuses = cacheFunctions.getBurialSiteStatuses()
|
||||||
|
|
||||||
assert.ok(burialSiteStatuses.length > 0)
|
assert.ok(burialSiteStatuses.length > 0)
|
||||||
|
|
||||||
for (const burialSiteStatus of burialSiteStatuses) {
|
for (const burialSiteStatus of burialSiteStatuses) {
|
||||||
const byId = await cacheFunctions.getBurialSiteStatusById(
|
const byId = cacheFunctions.getBurialSiteStatusById(
|
||||||
burialSiteStatus.burialSiteStatusId
|
burialSiteStatus.burialSiteStatusId
|
||||||
)
|
)
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
|
|
@ -33,7 +33,7 @@ await describe('functions.cache', async () => {
|
||||||
)
|
)
|
||||||
|
|
||||||
const byName =
|
const byName =
|
||||||
await cacheFunctions.getBurialSiteStatusByBurialSiteStatus(
|
cacheFunctions.getBurialSiteStatusByBurialSiteStatus(
|
||||||
burialSiteStatus.burialSiteStatus
|
burialSiteStatus.burialSiteStatus
|
||||||
)
|
)
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
|
|
@ -43,28 +43,28 @@ await describe('functions.cache', async () => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
await it('returns undefined with a bad burialSiteStatusId', async () => {
|
await it('returns undefined with a bad burialSiteStatusId', () => {
|
||||||
const byBadId = await cacheFunctions.getBurialSiteStatusById(badId)
|
const byBadId = cacheFunctions.getBurialSiteStatusById(badId)
|
||||||
assert.ok(byBadId === undefined)
|
assert.ok(byBadId === undefined)
|
||||||
})
|
})
|
||||||
|
|
||||||
await it('returns undefined with a bad lotStatus', async () => {
|
await it('returns undefined with a bad lotStatus', () => {
|
||||||
const byBadName =
|
const byBadName =
|
||||||
await cacheFunctions.getBurialSiteStatusByBurialSiteStatus(badName)
|
cacheFunctions.getBurialSiteStatusByBurialSiteStatus(badName)
|
||||||
assert.ok(byBadName === undefined)
|
assert.ok(byBadName === undefined)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
await describe('Burial Site Types', async () => {
|
await describe('Burial Site Types', async () => {
|
||||||
await it('returns Burial Site Types', async () => {
|
await it('returns Burial Site Types', () => {
|
||||||
cacheFunctions.clearCacheByTableName('BurialSiteTypes')
|
cacheFunctions.clearCacheByTableName('BurialSiteTypes')
|
||||||
|
|
||||||
const burialSiteTypes = await cacheFunctions.getBurialSiteTypes()
|
const burialSiteTypes = cacheFunctions.getBurialSiteTypes()
|
||||||
|
|
||||||
assert.ok(burialSiteTypes.length > 0)
|
assert.ok(burialSiteTypes.length > 0)
|
||||||
|
|
||||||
for (const burialSiteType of burialSiteTypes) {
|
for (const burialSiteType of burialSiteTypes) {
|
||||||
const byId = await cacheFunctions.getBurialSiteTypeById(
|
const byId = cacheFunctions.getBurialSiteTypeById(
|
||||||
burialSiteType.burialSiteTypeId
|
burialSiteType.burialSiteTypeId
|
||||||
)
|
)
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
|
|
@ -72,7 +72,7 @@ await describe('functions.cache', async () => {
|
||||||
byId?.burialSiteTypeId
|
byId?.burialSiteTypeId
|
||||||
)
|
)
|
||||||
|
|
||||||
const byName = await cacheFunctions.getBurialSiteTypesByBurialSiteType(
|
const byName = cacheFunctions.getBurialSiteTypesByBurialSiteType(
|
||||||
burialSiteType.burialSiteType
|
burialSiteType.burialSiteType
|
||||||
)
|
)
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
|
|
@ -82,84 +82,84 @@ await describe('functions.cache', async () => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
await it('returns undefined with a bad burialSiteTypeId', async () => {
|
await it('returns undefined with a bad burialSiteTypeId', () => {
|
||||||
const byBadId = await cacheFunctions.getBurialSiteTypeById(badId)
|
const byBadId = cacheFunctions.getBurialSiteTypeById(badId)
|
||||||
assert.ok(byBadId === undefined)
|
assert.ok(byBadId === undefined)
|
||||||
})
|
})
|
||||||
|
|
||||||
await it('returns undefined with a bad lotType', async () => {
|
await it('returns undefined with a bad lotType', () => {
|
||||||
const byBadName =
|
const byBadName =
|
||||||
await cacheFunctions.getBurialSiteTypesByBurialSiteType(badName)
|
cacheFunctions.getBurialSiteTypesByBurialSiteType(badName)
|
||||||
assert.ok(byBadName === undefined)
|
assert.ok(byBadName === undefined)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
await describe('Contract Types', async () => {
|
await describe('Contract Types', async () => {
|
||||||
await it('returns Contract Types', async () => {
|
await it('returns Contract Types', () => {
|
||||||
cacheFunctions.clearCacheByTableName('ContractTypes')
|
cacheFunctions.clearCacheByTableName('ContractTypes')
|
||||||
|
|
||||||
const contractTypes = await cacheFunctions.getContractTypes()
|
const contractTypes = cacheFunctions.getContractTypes()
|
||||||
|
|
||||||
assert.ok(contractTypes.length > 0)
|
assert.ok(contractTypes.length > 0)
|
||||||
|
|
||||||
for (const contractType of contractTypes) {
|
for (const contractType of contractTypes) {
|
||||||
const byId = await cacheFunctions.getContractTypeById(
|
const byId = cacheFunctions.getContractTypeById(
|
||||||
contractType.contractTypeId
|
contractType.contractTypeId
|
||||||
)
|
)
|
||||||
assert.strictEqual(contractType.contractTypeId, byId?.contractTypeId)
|
assert.strictEqual(contractType.contractTypeId, byId?.contractTypeId)
|
||||||
|
|
||||||
const byName = await cacheFunctions.getContractTypeByContractType(
|
const byName = cacheFunctions.getContractTypeByContractType(
|
||||||
contractType.contractType
|
contractType.contractType
|
||||||
)
|
)
|
||||||
assert.strictEqual(contractType.contractType, byName?.contractType)
|
assert.strictEqual(contractType.contractType, byName?.contractType)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
await it('returns undefined with a bad contractTypeId', async () => {
|
await it('returns undefined with a bad contractTypeId', () => {
|
||||||
const byBadId = await cacheFunctions.getContractTypeById(badId)
|
const byBadId = cacheFunctions.getContractTypeById(badId)
|
||||||
assert.ok(byBadId === undefined)
|
assert.ok(byBadId === undefined)
|
||||||
})
|
})
|
||||||
|
|
||||||
await it('returns undefined with a bad contractType', async () => {
|
await it('returns undefined with a bad contractType', () => {
|
||||||
const byBadName =
|
const byBadName =
|
||||||
await cacheFunctions.getContractTypeByContractType(badName)
|
cacheFunctions.getContractTypeByContractType(badName)
|
||||||
assert.ok(byBadName === undefined)
|
assert.ok(byBadName === undefined)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
await describe('Work Order Types', async () => {
|
await describe('Work Order Types', async () => {
|
||||||
await it('returns Work Order Types', async () => {
|
await it('returns Work Order Types', () => {
|
||||||
cacheFunctions.clearCacheByTableName('WorkOrderTypes')
|
cacheFunctions.clearCacheByTableName('WorkOrderTypes')
|
||||||
|
|
||||||
const workOrderTypes = await cacheFunctions.getWorkOrderTypes()
|
const workOrderTypes = cacheFunctions.getWorkOrderTypes()
|
||||||
|
|
||||||
assert.ok(workOrderTypes.length > 0)
|
assert.ok(workOrderTypes.length > 0)
|
||||||
|
|
||||||
for (const workOrderType of workOrderTypes) {
|
for (const workOrderType of workOrderTypes) {
|
||||||
const byId = await cacheFunctions.getWorkOrderTypeById(
|
const byId = cacheFunctions.getWorkOrderTypeById(
|
||||||
workOrderType.workOrderTypeId
|
workOrderType.workOrderTypeId
|
||||||
)
|
)
|
||||||
assert.strictEqual(workOrderType.workOrderTypeId, byId?.workOrderTypeId)
|
assert.strictEqual(workOrderType.workOrderTypeId, byId?.workOrderTypeId)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
await it('returns undefined with a bad workOrderTypeId', async () => {
|
await it('returns undefined with a bad workOrderTypeId', () => {
|
||||||
const byBadId = await cacheFunctions.getWorkOrderTypeById(badId)
|
const byBadId = cacheFunctions.getWorkOrderTypeById(badId)
|
||||||
assert.ok(byBadId === undefined)
|
assert.ok(byBadId === undefined)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
await describe('Work Order Milestone Types', async () => {
|
await describe('Work Order Milestone Types', async () => {
|
||||||
await it('returns Work Order Milestone Types', async () => {
|
await it('returns Work Order Milestone Types', () => {
|
||||||
cacheFunctions.clearCacheByTableName('WorkOrderMilestoneTypes')
|
cacheFunctions.clearCacheByTableName('WorkOrderMilestoneTypes')
|
||||||
|
|
||||||
const workOrderMilestoneTypes =
|
const workOrderMilestoneTypes =
|
||||||
await cacheFunctions.getWorkOrderMilestoneTypes()
|
cacheFunctions.getWorkOrderMilestoneTypes()
|
||||||
|
|
||||||
assert.ok(workOrderMilestoneTypes.length > 0)
|
assert.ok(workOrderMilestoneTypes.length > 0)
|
||||||
|
|
||||||
for (const workOrderMilestoneType of workOrderMilestoneTypes) {
|
for (const workOrderMilestoneType of workOrderMilestoneTypes) {
|
||||||
const byId = await cacheFunctions.getWorkOrderMilestoneTypeById(
|
const byId = cacheFunctions.getWorkOrderMilestoneTypeById(
|
||||||
workOrderMilestoneType.workOrderMilestoneTypeId
|
workOrderMilestoneType.workOrderMilestoneTypeId
|
||||||
)
|
)
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
|
|
@ -168,7 +168,7 @@ await describe('functions.cache', async () => {
|
||||||
)
|
)
|
||||||
|
|
||||||
const byName =
|
const byName =
|
||||||
await cacheFunctions.getWorkOrderMilestoneTypeByWorkOrderMilestoneType(
|
cacheFunctions.getWorkOrderMilestoneTypeByWorkOrderMilestoneType(
|
||||||
workOrderMilestoneType.workOrderMilestoneType
|
workOrderMilestoneType.workOrderMilestoneType
|
||||||
)
|
)
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
|
|
@ -178,14 +178,14 @@ await describe('functions.cache', async () => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
await it('returns undefined with a bad workOrderMilestoneTypeId', async () => {
|
await it('returns undefined with a bad workOrderMilestoneTypeId', () => {
|
||||||
const byBadId = await cacheFunctions.getWorkOrderMilestoneTypeById(badId)
|
const byBadId = cacheFunctions.getWorkOrderMilestoneTypeById(badId)
|
||||||
assert.ok(byBadId === undefined)
|
assert.ok(byBadId === undefined)
|
||||||
})
|
})
|
||||||
|
|
||||||
await it('returns undefined with a bad workOrderMilestoneType', async () => {
|
await it('returns undefined with a bad workOrderMilestoneType', () => {
|
||||||
const byBadName =
|
const byBadName =
|
||||||
await cacheFunctions.getWorkOrderMilestoneTypeByWorkOrderMilestoneType(
|
cacheFunctions.getWorkOrderMilestoneTypeByWorkOrderMilestoneType(
|
||||||
badName
|
badName
|
||||||
)
|
)
|
||||||
assert.ok(byBadName === undefined)
|
assert.ok(byBadName === undefined)
|
||||||
|
|
|
||||||
|
|
@ -470,31 +470,31 @@
|
||||||
Contracts
|
Contracts
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<% if (activeCount > 0) { %>
|
<div class="level-item">
|
||||||
<div class="level-item">
|
<div class="tags">
|
||||||
<span class="tag is-success">
|
<% if (activeCount > 0) { %>
|
||||||
<span class="icon is-small">
|
<span class="tag is-success">
|
||||||
<i class="fas fa-play" aria-hidden="true"></i>
|
<span class="icon is-small">
|
||||||
|
<i class="fas fa-play" aria-hidden="true"></i>
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<%= activeCount %>
|
||||||
|
Active
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<% } %>
|
||||||
<%= activeCount %>
|
<% if (pastCount > 0) { %>
|
||||||
Active
|
<span class="tag">
|
||||||
|
<span class="icon is-small">
|
||||||
|
<i class="fas fa-stop" aria-hidden="true"></i>
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<%= pastCount %> Past
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
<% } %>
|
</div>
|
||||||
<% if (pastCount > 0) { %>
|
|
||||||
<div class="level-item">
|
|
||||||
<span class="tag">
|
|
||||||
<span class="icon is-small">
|
|
||||||
<i class="fas fa-stop" aria-hidden="true"></i>
|
|
||||||
</span>
|
|
||||||
<span>
|
|
||||||
<%= pastCount %> Past
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<% } %>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="level-right">
|
<div class="level-right">
|
||||||
<div class="level-item">
|
<div class="level-item">
|
||||||
|
|
@ -526,7 +526,7 @@
|
||||||
<table class="table is-fullwidth is-striped is-hoverable has-sticky-header">
|
<table class="table is-fullwidth is-striped is-hoverable has-sticky-header">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="has-width-10"> </th>
|
<th class="has-width-1"> </th>
|
||||||
<th>Contract Type</th>
|
<th>Contract Type</th>
|
||||||
<th>Contract Date</th>
|
<th>Contract Date</th>
|
||||||
<th>End Date</th>
|
<th>End Date</th>
|
||||||
|
|
|
||||||
|
|
@ -221,43 +221,41 @@
|
||||||
<div class="level-item">
|
<div class="level-item">
|
||||||
<h2 class="has-text-weight-bold">Contracts</h2>
|
<h2 class="has-text-weight-bold">Contracts</h2>
|
||||||
</div>
|
</div>
|
||||||
<% if (activeCount > 0) { %>
|
<div class="level-item">
|
||||||
<div class="level-item">
|
<div class="tags">
|
||||||
<span class="tag is-success">
|
<% if (activeCount > 0) { %>
|
||||||
<span class="icon is-small">
|
<span class="tag is-success">
|
||||||
<i class="fas fa-play" aria-hidden="true"></i>
|
<span class="icon is-small">
|
||||||
|
<i class="fas fa-play" aria-hidden="true"></i>
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<%= activeCount %>
|
||||||
|
Active
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<% } %>
|
||||||
<%= activeCount %>
|
<% if (pastCount > 0) { %>
|
||||||
Active
|
<span class="tag">
|
||||||
|
<span class="icon is-small">
|
||||||
|
<i class="fas fa-stop" aria-hidden="true"></i>
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<%= pastCount %> Past
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
<% } %>
|
||||||
</div>
|
|
||||||
<% } %>
|
|
||||||
<% if (pastCount > 0) { %>
|
|
||||||
<div class="level-item">
|
|
||||||
<span class="tag">
|
|
||||||
<span class="icon is-small">
|
|
||||||
<i class="fas fa-stop" aria-hidden="true"></i>
|
|
||||||
</span>
|
|
||||||
<span>
|
|
||||||
<%= pastCount %> Past
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<% } %>
|
|
||||||
</div>
|
|
||||||
<% if (burialSite.contracts.length > 0) { %>
|
|
||||||
<div class="level-right">
|
|
||||||
<div class="level-item">
|
|
||||||
<button class="button is-info is-small"
|
|
||||||
id="burialSite--contractsToggle" type="button">
|
|
||||||
<span class="icon"><i class="fas fa-eye" aria-hidden="true"></i></span>
|
|
||||||
<span>Show/Hide Past Contracts</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% } %>
|
</div>
|
||||||
|
<div class="level-right">
|
||||||
|
<div class="level-item">
|
||||||
|
<button class="button is-info is-small"
|
||||||
|
id="burialSite--contractsToggle" type="button">
|
||||||
|
<span class="icon"><i class="fas fa-eye" aria-hidden="true"></i></span>
|
||||||
|
<span>Show/Hide Past Contracts</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-block is-block">
|
<div class="panel-block is-block">
|
||||||
|
|
@ -271,7 +269,7 @@
|
||||||
<table class="table is-fullwidth is-striped is-hoverable has-sticky-header">
|
<table class="table is-fullwidth is-striped is-hoverable has-sticky-header">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="has-width-10"> </th>
|
<th class="has-width-1"> </th>
|
||||||
<th>Contract Type</th>
|
<th>Contract Type</th>
|
||||||
<th>Contract Date</th>
|
<th>Contract Date</th>
|
||||||
<th>End Date</th>
|
<th>End Date</th>
|
||||||
|
|
|
||||||
|
|
@ -216,7 +216,7 @@
|
||||||
<div class="level is-mobile">
|
<div class="level is-mobile">
|
||||||
<div class="level-left">
|
<div class="level-left">
|
||||||
<div class="level-item">
|
<div class="level-item">
|
||||||
<h2 class="title is-5 has-text-weight-bold has-text-white">Related Burial Sites</h2>
|
<h2 class="title is-5 has-text-weight-bold has-text-white">Related Contracts</h2>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="level-right">
|
<div class="level-right">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue