pull/11/head
Dan Gowans 2025-04-30 10:00:59 -04:00
parent 18edc57f70
commit 7887230c86
7 changed files with 76 additions and 66 deletions

View File

@ -16,6 +16,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
}
const resultsTbodyElement = document.createElement('tbody');
for (const burialSite of responseJSON.burialSites) {
const cemeteryNameHtml = burialSite.cemeteryName === ''
? '<span class="has-text-grey">(No Name)</span>'
: cityssm.escapeHTML(burialSite.cemeteryName ?? '');
// eslint-disable-next-line no-unsanitized/method
resultsTbodyElement.insertAdjacentHTML('beforeend', `<tr>
<td>
@ -26,16 +29,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
${burialSite.cemeteryId === null
? '<span class="has-text-grey">(No Cemetery)</span>'
: `<a href="${sunrise.getCemeteryURL(burialSite.cemeteryId)}">
${burialSite.cemeteryName === ''
? '<span class="has-text-grey">(No Name)</span>'
: cityssm.escapeHTML(burialSite.cemeteryName)}
</a>`}
${cemeteryNameHtml}
</a>`}
</td><td>
${cityssm.escapeHTML(burialSite.burialSiteType ?? '')}
</td><td>
${burialSite.burialSiteStatusId
? cityssm.escapeHTML(burialSite.burialSiteStatus ?? '')
: '<span class="has-text-grey">(No Status)</span>'}<br />
${burialSite.burialSiteStatusId === null ||
burialSite.burialSiteStatusId === undefined
? '<span class="has-text-grey">(No Status)</span>'
: cityssm.escapeHTML(burialSite.burialSiteStatus ?? '')}<br />
${(burialSite.contractCount ?? 0) > 0
? '<span class="is-size-7">Has Current Contracts</span>'
: ''}

View File

@ -44,6 +44,11 @@ declare const exports: Record<string, unknown>
const resultsTbodyElement = document.createElement('tbody')
for (const burialSite of responseJSON.burialSites) {
const cemeteryNameHtml =
burialSite.cemeteryName === ''
? '<span class="has-text-grey">(No Name)</span>'
: cityssm.escapeHTML(burialSite.cemeteryName ?? '')
// eslint-disable-next-line no-unsanitized/method
resultsTbodyElement.insertAdjacentHTML(
'beforeend',
@ -57,20 +62,17 @@ declare const exports: Record<string, unknown>
burialSite.cemeteryId === null
? '<span class="has-text-grey">(No Cemetery)</span>'
: `<a href="${sunrise.getCemeteryURL(burialSite.cemeteryId)}">
${
burialSite.cemeteryName === ''
? '<span class="has-text-grey">(No Name)</span>'
: cityssm.escapeHTML(burialSite.cemeteryName)
}
</a>`
${cemeteryNameHtml}
</a>`
}
</td><td>
${cityssm.escapeHTML(burialSite.burialSiteType ?? '')}
</td><td>
${
burialSite.burialSiteStatusId
? cityssm.escapeHTML(burialSite.burialSiteStatus ?? '')
: '<span class="has-text-grey">(No Status)</span>'
burialSite.burialSiteStatusId === null ||
burialSite.burialSiteStatusId === undefined
? '<span class="has-text-grey">(No Status)</span>'
: cityssm.escapeHTML(burialSite.burialSiteStatus ?? '')
}<br />
${
(burialSite.contractCount ?? 0) > 0

View File

@ -243,7 +243,7 @@ const cemeteryKeyToCemetery: Record<string, AddCemeteryForm> = {
},
WS: {
cemeteryName: 'West Section',
cemeteryDescription: 'At Old Greenwood Cemetery',
cemeteryKey: 'WS',
cemeterySvg: '',
@ -282,7 +282,7 @@ export function getCemeteryIdByKey(
}
console.log(`Cemetery cache miss: ${cemeteryKey}`)
const cemetery = getCemeteryByKey(cemeteryKey)
console.log(`Cemetery found: ${cemeteryKey}`)
@ -295,6 +295,7 @@ export function getCemeteryIdByKey(
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
addForm ??= {
cemeteryName: cemeteryKey,
cemeteryDescription: '',
cemeteryKey,

View File

@ -373,8 +373,8 @@ async function importFromPrepaidCSV() {
deceasedName: prepaidRow.CMPP_PREPAID_FOR_NAME,
contractStartDateString
}, {
includeInterments: false,
includeFees: false,
includeInterments: false,
includeTransactions: false,
limit: -1,
offset: 0
@ -386,15 +386,15 @@ async function importFromPrepaidCSV() {
contractId ||= addContract({
burialSiteId: burialSite ? burialSite.burialSiteId : '',
contractTypeId: importIds.preneedContractType.contractTypeId,
contractStartDateString,
contractEndDateString: '',
contractStartDateString,
purchaserName: prepaidRow.CMPP_ARRANGED_BY_NAME,
deceasedName: prepaidRow.CMPP_PREPAID_FOR_NAME,
deceasedAddress1: prepaidRow.CMPP_ADDRESS,
deceasedAddress2: '',
deceasedCity: prepaidRow.CMPP_CITY,
deceasedProvince: prepaidRow.CMPP_PROV.slice(0, 2),
deceasedPostalCode: `${prepaidRow.CMPP_POSTAL1} ${prepaidRow.CMPP_POSTAL2}`
deceasedPostalCode: `${prepaidRow.CMPP_POSTAL1} ${prepaidRow.CMPP_POSTAL2}`,
deceasedProvince: prepaidRow.CMPP_PROV.slice(0, 2)
}, user);
if (prepaidRow.CMPP_FEE_GRAV_SD !== '0.0') {
await addContractFee({
@ -499,15 +499,15 @@ async function importFromPrepaidCSV() {
if (prepaidRow.CMPP_REMARK1 !== '') {
addContractComment({
contractId,
commentDateString: contractStartDateString,
comment: prepaidRow.CMPP_REMARK1
comment: prepaidRow.CMPP_REMARK1,
commentDateString: contractStartDateString
}, user);
}
if (prepaidRow.CMPP_REMARK2 !== '') {
addContractComment({
contractId,
commentDateString: contractStartDateString,
comment: prepaidRow.CMPP_REMARK2
comment: prepaidRow.CMPP_REMARK2,
commentDateString: contractStartDateString
}, user);
}
}
@ -602,10 +602,10 @@ async function importFromWorkOrderCSV() {
const workOrderContainsBurialSite = workOrder?.workOrderBurialSites?.find((possibleLot) => possibleLot.burialSiteId === burialSite?.burialSiteId);
if (!workOrderContainsBurialSite) {
addWorkOrderBurialSite({
workOrderId: workOrder.workOrderId,
burialSiteId: burialSite.burialSiteId
workOrderId: workOrder?.workOrderId,
burialSiteId: burialSite?.burialSiteId
}, user);
workOrder.workOrderBurialSites.push(burialSite);
workOrder?.workOrderBurialSites?.push(burialSite);
}
}
let contractStartDateString = workOrderOpenDateString;
@ -655,7 +655,7 @@ async function importFromWorkOrderCSV() {
intermentContainerTypeId
}, user);
addWorkOrderContract({
workOrderId: workOrder.workOrderId,
workOrderId: workOrder?.workOrderId,
contractId
}, user);
// Milestones
@ -663,7 +663,7 @@ async function importFromWorkOrderCSV() {
let maxMilestoneCompletionDateString = workOrderOpenDateString;
if (importIds.acknowledgedWorkOrderMilestoneTypeId) {
addWorkOrderMilestone({
workOrderId: workOrder.workOrderId,
workOrderId: workOrder?.workOrderId,
workOrderMilestoneTypeId: importIds.acknowledgedWorkOrderMilestoneTypeId,
workOrderMilestoneDateString: workOrderOpenDateString,
workOrderMilestoneDescription: '',
@ -677,7 +677,7 @@ async function importFromWorkOrderCSV() {
const workOrderMilestoneDateString = formatDateString(workOrderRow.WO_DEATH_YR, workOrderRow.WO_DEATH_MON, workOrderRow.WO_DEATH_DAY);
if (importIds.deathWorkOrderMilestoneTypeId) {
addWorkOrderMilestone({
workOrderId: workOrder.workOrderId,
workOrderId: workOrder?.workOrderId,
workOrderMilestoneTypeId: importIds.deathWorkOrderMilestoneTypeId,
workOrderMilestoneDateString,
workOrderMilestoneDescription: `Death Place: ${workOrderRow.WO_DEATH_PLACE}`,
@ -705,7 +705,7 @@ async function importFromWorkOrderCSV() {
const workOrderMilestoneTimeString = formatTimeString(funeralHour.toString(), workOrderRow.WO_FUNERAL_MIN === '' ? '0' : workOrderRow.WO_FUNERAL_MIN);
if (importIds.funeralWorkOrderMilestoneTypeId) {
addWorkOrderMilestone({
workOrderId: workOrder.workOrderId,
workOrderId: workOrder?.workOrderId,
workOrderMilestoneTypeId: importIds.funeralWorkOrderMilestoneTypeId,
workOrderMilestoneDateString,
workOrderMilestoneTimeString,
@ -728,7 +728,7 @@ async function importFromWorkOrderCSV() {
if (workOrderRow.WO_CREMATION === 'Y' &&
importIds.cremationWorkOrderMilestoneTypeId) {
addWorkOrderMilestone({
workOrderId: workOrder.workOrderId,
workOrderId: workOrder?.workOrderId,
workOrderMilestoneTypeId: importIds.cremationWorkOrderMilestoneTypeId,
workOrderMilestoneDateString: maxMilestoneCompletionDateString,
workOrderMilestoneDescription: '',
@ -744,7 +744,7 @@ async function importFromWorkOrderCSV() {
const workOrderMilestoneDateString = formatDateString(workOrderRow.WO_INTERMENT_YR, workOrderRow.WO_INTERMENT_MON, workOrderRow.WO_INTERMENT_DAY);
if (importIds.intermentWorkOrderMilestoneTypeId) {
addWorkOrderMilestone({
workOrderId: workOrder.workOrderId,
workOrderId: workOrder?.workOrderId,
workOrderMilestoneTypeId: importIds.intermentWorkOrderMilestoneTypeId,
workOrderMilestoneDateString,
workOrderMilestoneDescription: `Depth: ${workOrderRow.WO_DEPTH}`,
@ -765,7 +765,7 @@ async function importFromWorkOrderCSV() {
}
if (!hasIncompleteMilestones) {
closeWorkOrder({
workOrderId: workOrder.workOrderId,
workOrderId: workOrder?.workOrderId,
workOrderCloseDateString: maxMilestoneCompletionDateString
}, user);
}

View File

@ -612,8 +612,8 @@ async function importFromPrepaidCSV(): Promise<void> {
contractStartDateString
},
{
includeInterments: false,
includeFees: false,
includeInterments: false,
includeTransactions: false,
limit: -1,
offset: 0
@ -629,17 +629,19 @@ async function importFromPrepaidCSV(): Promise<void> {
{
burialSiteId: burialSite ? burialSite.burialSiteId : '',
contractTypeId: importIds.preneedContractType.contractTypeId,
contractStartDateString,
contractEndDateString: '',
contractStartDateString,
purchaserName: prepaidRow.CMPP_ARRANGED_BY_NAME,
deceasedName: prepaidRow.CMPP_PREPAID_FOR_NAME,
deceasedAddress1: prepaidRow.CMPP_ADDRESS,
deceasedAddress2: '',
deceasedCity: prepaidRow.CMPP_CITY,
deceasedProvince: prepaidRow.CMPP_PROV.slice(0, 2),
deceasedPostalCode: `${prepaidRow.CMPP_POSTAL1} ${prepaidRow.CMPP_POSTAL2}`
deceasedPostalCode: `${prepaidRow.CMPP_POSTAL1} ${prepaidRow.CMPP_POSTAL2}`,
deceasedProvince: prepaidRow.CMPP_PROV.slice(0, 2)
},
user
)
@ -801,8 +803,8 @@ async function importFromPrepaidCSV(): Promise<void> {
{
contractId,
commentDateString: contractStartDateString,
comment: prepaidRow.CMPP_REMARK1
comment: prepaidRow.CMPP_REMARK1,
commentDateString: contractStartDateString
},
user
)
@ -813,8 +815,8 @@ async function importFromPrepaidCSV(): Promise<void> {
{
contractId,
commentDateString: contractStartDateString,
comment: prepaidRow.CMPP_REMARK2
comment: prepaidRow.CMPP_REMARK2,
commentDateString: contractStartDateString
},
user
)
@ -956,13 +958,15 @@ async function importFromWorkOrderCSV(): Promise<void> {
if (!workOrderContainsBurialSite) {
addWorkOrderBurialSite(
{
workOrderId: workOrder.workOrderId!,
burialSiteId: burialSite.burialSiteId
workOrderId: workOrder?.workOrderId as number,
burialSiteId: burialSite?.burialSiteId as number
},
user
)
workOrder.workOrderBurialSites!.push(burialSite)
workOrder?.workOrderBurialSites?.push(
burialSite as recordTypes.BurialSite
)
}
}
@ -1047,7 +1051,7 @@ async function importFromWorkOrderCSV(): Promise<void> {
addWorkOrderContract(
{
workOrderId: workOrder.workOrderId!,
workOrderId: workOrder?.workOrderId as number,
contractId
},
user
@ -1061,7 +1065,7 @@ async function importFromWorkOrderCSV(): Promise<void> {
if (importIds.acknowledgedWorkOrderMilestoneTypeId) {
addWorkOrderMilestone(
{
workOrderId: workOrder.workOrderId!,
workOrderId: workOrder?.workOrderId as number,
workOrderMilestoneTypeId:
importIds.acknowledgedWorkOrderMilestoneTypeId,
workOrderMilestoneDateString: workOrderOpenDateString,
@ -1087,7 +1091,7 @@ async function importFromWorkOrderCSV(): Promise<void> {
if (importIds.deathWorkOrderMilestoneTypeId) {
addWorkOrderMilestone(
{
workOrderId: workOrder.workOrderId!,
workOrderId: workOrder?.workOrderId as number,
workOrderMilestoneTypeId: importIds.deathWorkOrderMilestoneTypeId,
workOrderMilestoneDateString,
workOrderMilestoneDescription: `Death Place: ${workOrderRow.WO_DEATH_PLACE}`,
@ -1136,7 +1140,7 @@ async function importFromWorkOrderCSV(): Promise<void> {
if (importIds.funeralWorkOrderMilestoneTypeId) {
addWorkOrderMilestone(
{
workOrderId: workOrder.workOrderId!,
workOrderId: workOrder?.workOrderId as number,
workOrderMilestoneTypeId:
importIds.funeralWorkOrderMilestoneTypeId,
workOrderMilestoneDateString,
@ -1170,7 +1174,7 @@ async function importFromWorkOrderCSV(): Promise<void> {
) {
addWorkOrderMilestone(
{
workOrderId: workOrder.workOrderId!,
workOrderId: workOrder?.workOrderId as number,
workOrderMilestoneTypeId:
importIds.cremationWorkOrderMilestoneTypeId,
workOrderMilestoneDateString: maxMilestoneCompletionDateString,
@ -1198,7 +1202,7 @@ async function importFromWorkOrderCSV(): Promise<void> {
if (importIds.intermentWorkOrderMilestoneTypeId) {
addWorkOrderMilestone(
{
workOrderId: workOrder.workOrderId!,
workOrderId: workOrder?.workOrderId as number,
workOrderMilestoneTypeId:
importIds.intermentWorkOrderMilestoneTypeId,
workOrderMilestoneDateString,
@ -1228,7 +1232,8 @@ async function importFromWorkOrderCSV(): Promise<void> {
if (!hasIncompleteMilestones) {
closeWorkOrder(
{
workOrderId: workOrder.workOrderId!,
workOrderId: workOrder?.workOrderId as number,
workOrderCloseDateString: maxMilestoneCompletionDateString
},
user

View File

@ -21,7 +21,7 @@ export interface BurialSite extends Record {
burialSiteLatitude?: number;
burialSiteLongitude?: number;
burialSiteStatus?: string;
burialSiteStatusId?: number;
burialSiteStatusId?: number | null;
burialSiteFields?: BurialSiteField[];
contractCount?: number;
contracts?: Contract[];
@ -306,8 +306,8 @@ export interface WorkOrderComment extends Record {
commentDate?: number;
commentDateString?: string;
commentTime?: number;
commentTimeString?: string;
commentTimePeriodString?: string;
commentTimeString?: string;
comment?: string;
}
export interface WorkOrderMilestone extends Record, WorkOrder {
@ -317,23 +317,23 @@ export interface WorkOrderMilestone extends Record, WorkOrder {
workOrderMilestoneDate?: number;
workOrderMilestoneDateString?: string;
workOrderMilestoneTime?: number;
workOrderMilestoneTimeString?: string;
workOrderMilestoneTimePeriodString?: string;
workOrderMilestoneTimeString?: string;
workOrderMilestoneDescription?: string;
workOrderMilestoneCompletionDate?: number;
workOrderMilestoneCompletionDateString?: string;
workOrderMilestoneCompletionTime?: number;
workOrderMilestoneCompletionTimeString?: string;
workOrderMilestoneCompletionTimePeriodString?: string;
workOrderMilestoneCompletionTimeString?: string;
workOrderRecordUpdate_timeMillis?: number;
}
export interface WorkOrderMilestoneType extends Record {
workOrderMilestoneTypeId: number;
workOrderMilestoneType: string;
workOrderMilestoneTypeId: number;
orderNumber?: number;
}
export interface WorkOrderType extends Record {
workOrderTypeId: number;
workOrderType?: string;
workOrderTypeId: number;
orderNumber?: number;
}

View File

@ -30,7 +30,7 @@ export interface BurialSite extends Record {
burialSiteLongitude?: number
burialSiteStatus?: string
burialSiteStatusId?: number
burialSiteStatusId?: number | null
burialSiteFields?: BurialSiteField[]
@ -427,8 +427,8 @@ export interface WorkOrderComment extends Record {
commentDateString?: string
commentTime?: number
commentTimeString?: string
commentTimePeriodString?: string
commentTimeString?: string
comment?: string
}
@ -443,8 +443,8 @@ export interface WorkOrderMilestone extends Record, WorkOrder {
workOrderMilestoneDateString?: string
workOrderMilestoneTime?: number
workOrderMilestoneTimeString?: string
workOrderMilestoneTimePeriodString?: string
workOrderMilestoneTimeString?: string
workOrderMilestoneDescription?: string
@ -452,22 +452,22 @@ export interface WorkOrderMilestone extends Record, WorkOrder {
workOrderMilestoneCompletionDateString?: string
workOrderMilestoneCompletionTime?: number
workOrderMilestoneCompletionTimeString?: string
workOrderMilestoneCompletionTimePeriodString?: string
workOrderMilestoneCompletionTimeString?: string
workOrderRecordUpdate_timeMillis?: number
}
export interface WorkOrderMilestoneType extends Record {
workOrderMilestoneTypeId: number
workOrderMilestoneType: string
workOrderMilestoneTypeId: number
orderNumber?: number
}
export interface WorkOrderType extends Record {
workOrderTypeId: number
workOrderType?: string
workOrderTypeId: number
orderNumber?: number
}