diff --git a/temp/legacyImportFromCsv/data.burialSiteTypes.js b/temp/legacyImportFromCsv/data.burialSiteTypes.js index d5d05edb..4a5d1d15 100644 --- a/temp/legacyImportFromCsv/data.burialSiteTypes.js +++ b/temp/legacyImportFromCsv/data.burialSiteTypes.js @@ -1,10 +1,16 @@ import * as cacheFunctions from '../../helpers/functions.cache.js'; -const inGroundBurialSiteTypeId = cacheFunctions.getBurialSiteTypesByBurialSiteType('In-Ground Grave').burialSiteTypeId; -const columbariumBurialSiteTypeId = cacheFunctions.getBurialSiteTypesByBurialSiteType('Columbarium').burialSiteTypeId; -const cremationBurialSiteTypeId = cacheFunctions.getBurialSiteTypesByBurialSiteType('Crematorium').burialSiteTypeId; -const mausoleumBurialSiteTypeId = cacheFunctions.getBurialSiteTypesByBurialSiteType('Mausoleum').burialSiteTypeId; -const nicheWallBurialSiteTypeId = cacheFunctions.getBurialSiteTypesByBurialSiteType('Niche Wall').burialSiteTypeId; -const urnGardenBurialSiteTypeId = cacheFunctions.getBurialSiteTypesByBurialSiteType('Urn Garden').burialSiteTypeId; +const inGroundBurialSiteTypeId = cacheFunctions.getBurialSiteTypesByBurialSiteType('In-Ground Grave') + ?.burialSiteTypeId; +const columbariumBurialSiteTypeId = cacheFunctions.getBurialSiteTypesByBurialSiteType('Columbarium') + ?.burialSiteTypeId; +const cremationBurialSiteTypeId = cacheFunctions.getBurialSiteTypesByBurialSiteType('Crematorium') + ?.burialSiteTypeId; +const mausoleumBurialSiteTypeId = cacheFunctions.getBurialSiteTypesByBurialSiteType('Mausoleum') + ?.burialSiteTypeId; +const nicheWallBurialSiteTypeId = cacheFunctions.getBurialSiteTypesByBurialSiteType('Niche Wall') + ?.burialSiteTypeId; +const urnGardenBurialSiteTypeId = cacheFunctions.getBurialSiteTypesByBurialSiteType('Urn Garden') + ?.burialSiteTypeId; export function getBurialSiteTypeId(cemeteryKey) { switch (cemeteryKey) { case '00': { diff --git a/temp/legacyImportFromCsv/data.burialSiteTypes.ts b/temp/legacyImportFromCsv/data.burialSiteTypes.ts index 02fcce49..78638544 100644 --- a/temp/legacyImportFromCsv/data.burialSiteTypes.ts +++ b/temp/legacyImportFromCsv/data.burialSiteTypes.ts @@ -1,30 +1,28 @@ import * as cacheFunctions from '../../helpers/functions.cache.js' const inGroundBurialSiteTypeId = - cacheFunctions.getBurialSiteTypesByBurialSiteType( - 'In-Ground Grave' - )!.burialSiteTypeId + cacheFunctions.getBurialSiteTypesByBurialSiteType('In-Ground Grave') + ?.burialSiteTypeId as number const columbariumBurialSiteTypeId = - cacheFunctions.getBurialSiteTypesByBurialSiteType( - 'Columbarium' - )!.burialSiteTypeId + cacheFunctions.getBurialSiteTypesByBurialSiteType('Columbarium') + ?.burialSiteTypeId as number + const cremationBurialSiteTypeId = - cacheFunctions.getBurialSiteTypesByBurialSiteType( - 'Crematorium' - )!.burialSiteTypeId + cacheFunctions.getBurialSiteTypesByBurialSiteType('Crematorium') + ?.burialSiteTypeId as number + const mausoleumBurialSiteTypeId = - cacheFunctions.getBurialSiteTypesByBurialSiteType( - 'Mausoleum' - )!.burialSiteTypeId + cacheFunctions.getBurialSiteTypesByBurialSiteType('Mausoleum') + ?.burialSiteTypeId as number + const nicheWallBurialSiteTypeId = - cacheFunctions.getBurialSiteTypesByBurialSiteType( - 'Niche Wall' - )!.burialSiteTypeId + cacheFunctions.getBurialSiteTypesByBurialSiteType('Niche Wall') + ?.burialSiteTypeId as number + const urnGardenBurialSiteTypeId = - cacheFunctions.getBurialSiteTypesByBurialSiteType( - 'Urn Garden' - )!.burialSiteTypeId + cacheFunctions.getBurialSiteTypesByBurialSiteType('Urn Garden') + ?.burialSiteTypeId as number export function getBurialSiteTypeId(cemeteryKey: string): number { switch (cemeteryKey) { diff --git a/temp/legacyImportFromCsv/data.committalTypes.js b/temp/legacyImportFromCsv/data.committalTypes.js index 562622c0..d3ccbb71 100644 --- a/temp/legacyImportFromCsv/data.committalTypes.js +++ b/temp/legacyImportFromCsv/data.committalTypes.js @@ -5,8 +5,8 @@ export function getCommittalTypeIdByKey(committalTypeKey, user) { const committalType = committalTypes.find((committalType) => committalType.committalTypeKey === committalTypeKey); if (committalType === undefined) { const committalTypeId = addCommittalType({ - committalTypeKey, - committalType: committalTypeKey + committalType: committalTypeKey, + committalTypeKey }, user); committalTypes = getCommittalTypes(); return committalTypeId; diff --git a/temp/legacyImportFromCsv/data.committalTypes.ts b/temp/legacyImportFromCsv/data.committalTypes.ts index 6fc1a52d..13c5e72c 100644 --- a/temp/legacyImportFromCsv/data.committalTypes.ts +++ b/temp/legacyImportFromCsv/data.committalTypes.ts @@ -14,8 +14,8 @@ export function getCommittalTypeIdByKey( if (committalType === undefined) { const committalTypeId = addCommittalType( { - committalTypeKey, - committalType: committalTypeKey + committalType: committalTypeKey, + committalTypeKey }, user ) diff --git a/temp/legacyImportFromCsv/data.intermentContainerTypes.js b/temp/legacyImportFromCsv/data.intermentContainerTypes.js index 065a40eb..f66286f2 100644 --- a/temp/legacyImportFromCsv/data.intermentContainerTypes.js +++ b/temp/legacyImportFromCsv/data.intermentContainerTypes.js @@ -6,8 +6,8 @@ export function getIntermentContainerTypeIdByKey(intermentContainerTypeKey, user intermentContainerTypeKey); if (intermentContainerType === undefined) { const intermentContainerTypeId = addIntermentContainerType({ - intermentContainerTypeKey, - intermentContainerType: intermentContainerTypeKey + intermentContainerType: intermentContainerTypeKey, + intermentContainerTypeKey }, user); intermentContainerTypes = getIntermentContainerTypes(true); return intermentContainerTypeId; diff --git a/temp/legacyImportFromCsv/data.intermentContainerTypes.ts b/temp/legacyImportFromCsv/data.intermentContainerTypes.ts index 14890153..71bc525d 100644 --- a/temp/legacyImportFromCsv/data.intermentContainerTypes.ts +++ b/temp/legacyImportFromCsv/data.intermentContainerTypes.ts @@ -16,8 +16,8 @@ export function getIntermentContainerTypeIdByKey( if (intermentContainerType === undefined) { const intermentContainerTypeId = addIntermentContainerType( { - intermentContainerTypeKey, - intermentContainerType: intermentContainerTypeKey + intermentContainerType: intermentContainerTypeKey, + intermentContainerTypeKey }, user )