linting and polish
parent
43d70d8967
commit
f7ae72d40a
|
|
@ -8,8 +8,8 @@ export async function moveFeeDown(feeId) {
|
|||
.prepare(`update Fees
|
||||
set orderNumber = orderNumber - 1
|
||||
where recordDelete_timeMillis is null
|
||||
and feeCategoryId = ?
|
||||
and orderNumber = ? + 1`)
|
||||
and feeCategoryId = ?
|
||||
and orderNumber = ? + 1`)
|
||||
.run(currentFee.feeCategoryId, currentFee.orderNumber);
|
||||
const success = updateRecordOrderNumber('Fees', feeId, currentFee.orderNumber + 1, database);
|
||||
database.release();
|
||||
|
|
@ -20,9 +20,9 @@ export async function moveFeeDownToBottom(feeId) {
|
|||
const currentFee = (await getFee(feeId, database));
|
||||
const maxOrderNumber = database
|
||||
.prepare(`select max(orderNumber) as maxOrderNumber
|
||||
from Fees
|
||||
where recordDelete_timeMillis is null
|
||||
and feeCategoryId = ?`)
|
||||
from Fees
|
||||
where recordDelete_timeMillis is null
|
||||
and feeCategoryId = ?`)
|
||||
.get(currentFee.feeCategoryId).maxOrderNumber;
|
||||
if (currentFee.orderNumber !== maxOrderNumber) {
|
||||
updateRecordOrderNumber('Fees', feeId, maxOrderNumber + 1, database);
|
||||
|
|
@ -30,7 +30,7 @@ export async function moveFeeDownToBottom(feeId) {
|
|||
.prepare(`update Fees
|
||||
set orderNumber = orderNumber - 1
|
||||
where recordDelete_timeMillis is null
|
||||
and feeCategoryId = ? and orderNumber > ?`)
|
||||
and feeCategoryId = ? and orderNumber > ?`)
|
||||
.run(currentFee.feeCategoryId, currentFee.orderNumber);
|
||||
}
|
||||
database.release();
|
||||
|
|
@ -47,8 +47,8 @@ export async function moveFeeUp(feeId) {
|
|||
.prepare(`update Fees
|
||||
set orderNumber = orderNumber + 1
|
||||
where recordDelete_timeMillis is null
|
||||
and feeCategoryId = ?
|
||||
and orderNumber = ? - 1`)
|
||||
and feeCategoryId = ?
|
||||
and orderNumber = ? - 1`)
|
||||
.run(currentFee.feeCategoryId, currentFee.orderNumber);
|
||||
const success = updateRecordOrderNumber('Fees', feeId, currentFee.orderNumber - 1, database);
|
||||
database.release();
|
||||
|
|
@ -63,8 +63,8 @@ export async function moveFeeUpToTop(feeId) {
|
|||
.prepare(`update Fees
|
||||
set orderNumber = orderNumber + 1
|
||||
where recordDelete_timeMillis is null
|
||||
and feeCategoryId = ?
|
||||
and orderNumber < ?`)
|
||||
and feeCategoryId = ?
|
||||
and orderNumber < ?`)
|
||||
.run(currentFee.feeCategoryId, currentFee.orderNumber);
|
||||
}
|
||||
database.release();
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ export async function moveFeeDown(feeId: number | string): Promise<boolean> {
|
|||
`update Fees
|
||||
set orderNumber = orderNumber - 1
|
||||
where recordDelete_timeMillis is null
|
||||
and feeCategoryId = ?
|
||||
and orderNumber = ? + 1`
|
||||
and feeCategoryId = ?
|
||||
and orderNumber = ? + 1`
|
||||
)
|
||||
.run(currentFee.feeCategoryId, currentFee.orderNumber)
|
||||
|
||||
|
|
@ -42,9 +42,9 @@ export async function moveFeeDownToBottom(
|
|||
database
|
||||
.prepare(
|
||||
`select max(orderNumber) as maxOrderNumber
|
||||
from Fees
|
||||
where recordDelete_timeMillis is null
|
||||
and feeCategoryId = ?`
|
||||
from Fees
|
||||
where recordDelete_timeMillis is null
|
||||
and feeCategoryId = ?`
|
||||
)
|
||||
.get(currentFee.feeCategoryId) as { maxOrderNumber: number }
|
||||
).maxOrderNumber
|
||||
|
|
@ -57,7 +57,7 @@ export async function moveFeeDownToBottom(
|
|||
`update Fees
|
||||
set orderNumber = orderNumber - 1
|
||||
where recordDelete_timeMillis is null
|
||||
and feeCategoryId = ? and orderNumber > ?`
|
||||
and feeCategoryId = ? and orderNumber > ?`
|
||||
)
|
||||
.run(currentFee.feeCategoryId, currentFee.orderNumber)
|
||||
}
|
||||
|
|
@ -82,8 +82,8 @@ export async function moveFeeUp(feeId: number | string): Promise<boolean> {
|
|||
`update Fees
|
||||
set orderNumber = orderNumber + 1
|
||||
where recordDelete_timeMillis is null
|
||||
and feeCategoryId = ?
|
||||
and orderNumber = ? - 1`
|
||||
and feeCategoryId = ?
|
||||
and orderNumber = ? - 1`
|
||||
)
|
||||
.run(currentFee.feeCategoryId, currentFee.orderNumber)
|
||||
|
||||
|
|
@ -112,8 +112,8 @@ export async function moveFeeUpToTop(feeId: number | string): Promise<boolean> {
|
|||
`update Fees
|
||||
set orderNumber = orderNumber + 1
|
||||
where recordDelete_timeMillis is null
|
||||
and feeCategoryId = ?
|
||||
and orderNumber < ?`
|
||||
and feeCategoryId = ?
|
||||
and orderNumber < ?`
|
||||
)
|
||||
.run(currentFee.feeCategoryId, currentFee.orderNumber)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ the application peaked at the following:
|
|||
|
||||
- 512 MB of RAM
|
||||
- 1 GB of storage for application, dependencies, and data.
|
||||
- Active Directory for authentication.
|
||||
|
||||
## Step 1: Install Node.js 18 or better and npm
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ export const config = tseslint.config(...configWebApp, {
|
|||
'warn',
|
||||
{
|
||||
cspell: {
|
||||
words: [...cspellWords, 'autoincrement', 'ical', 'preneed', 'ntfy']
|
||||
words: [...cspellWords, 'autoincrement', 'fontawesome', 'ical', 'preneed', 'ntfy']
|
||||
}
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ export const config = tseslint.config(...configWebApp, {
|
|||
'warn',
|
||||
{
|
||||
cspell: {
|
||||
words: [...cspellWords, 'autoincrement', 'ical', 'preneed', 'ntfy']
|
||||
words: [...cspellWords, 'autoincrement', 'fontawesome', 'ical', 'preneed', 'ntfy']
|
||||
}
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ export default async function handler(
|
|||
|
||||
response.json({
|
||||
success: true,
|
||||
|
||||
burialSiteId
|
||||
})
|
||||
|
||||
|
|
@ -26,6 +27,7 @@ export default async function handler(
|
|||
} catch (error) {
|
||||
response.json({
|
||||
success: false,
|
||||
|
||||
errorMessage: (error as Error).message
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ export default async function handler(request, response) {
|
|||
const burialSiteId = Number.parseInt(request.body.burialSiteId, 10);
|
||||
const success = await deleteBurialSite(burialSiteId, request.session.user);
|
||||
response.json({
|
||||
success,
|
||||
errorMessage: success
|
||||
? ''
|
||||
: 'Note that burial sites with active contracts cannot be deleted.',
|
||||
success
|
||||
: 'Note that burial sites with active contracts cannot be deleted.'
|
||||
});
|
||||
if (success) {
|
||||
response.on('finish', () => {
|
||||
|
|
|
|||
|
|
@ -15,10 +15,11 @@ export default async function handler(
|
|||
)
|
||||
|
||||
response.json({
|
||||
success,
|
||||
|
||||
errorMessage: success
|
||||
? ''
|
||||
: 'Note that burial sites with active contracts cannot be deleted.',
|
||||
success
|
||||
: 'Note that burial sites with active contracts cannot be deleted.'
|
||||
})
|
||||
|
||||
if (success) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import type { Request, Response } from 'express';
|
||||
export default function handler(request: Request<unknown, unknown, {
|
||||
burialSiteId: string;
|
||||
burialSiteCommentId: string;
|
||||
burialSiteId: string;
|
||||
}>, response: Response): Promise<void>;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ export default async function handler(
|
|||
request: Request<
|
||||
unknown,
|
||||
unknown,
|
||||
{ burialSiteId: string; burialSiteCommentId: string }
|
||||
{ burialSiteCommentId: string; burialSiteId: string; }
|
||||
>,
|
||||
response: Response
|
||||
): Promise<void> {
|
||||
|
|
@ -23,6 +23,7 @@ export default async function handler(
|
|||
|
||||
response.json({
|
||||
success,
|
||||
|
||||
burialSiteComments
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ export default async function handler(
|
|||
const result = await getBurialSites(request.body, {
|
||||
limit: request.body.limit,
|
||||
offset: request.body.offset,
|
||||
|
||||
includeContractCount: true
|
||||
})
|
||||
|
||||
|
|
@ -25,6 +26,7 @@ export default async function handler(
|
|||
typeof request.body.offset === 'string'
|
||||
? Number.parseInt(request.body.offset, 10)
|
||||
: request.body.offset,
|
||||
|
||||
burialSites: result.burialSites
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ export default async function handler(
|
|||
|
||||
response.json({
|
||||
success,
|
||||
|
||||
burialSiteId
|
||||
})
|
||||
|
||||
|
|
@ -31,6 +32,7 @@ export default async function handler(
|
|||
} catch (error) {
|
||||
response.json({
|
||||
success: false,
|
||||
|
||||
errorMessage: (error as Error).message
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ export default async function handler(
|
|||
|
||||
response.json({
|
||||
success,
|
||||
|
||||
burialSiteComments
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ export default async function handler(
|
|||
|
||||
response.render('cemetery-search', {
|
||||
headTitle: "Cemetery Search",
|
||||
|
||||
cemeteries
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export default async function handler(request, response) {
|
|||
response.render('cemetery-view', {
|
||||
headTitle: cemetery.cemeteryName,
|
||||
cemetery,
|
||||
burialSiteTypeSummary,
|
||||
burialSiteStatusSummary
|
||||
burialSiteStatusSummary,
|
||||
burialSiteTypeSummary
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,8 +28,10 @@ export default async function handler(
|
|||
|
||||
response.render('cemetery-view', {
|
||||
headTitle: cemetery.cemeteryName,
|
||||
|
||||
cemetery,
|
||||
burialSiteTypeSummary,
|
||||
burialSiteStatusSummary
|
||||
|
||||
burialSiteStatusSummary,
|
||||
burialSiteTypeSummary
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ export default async function handler(
|
|||
|
||||
response.json({
|
||||
success: true,
|
||||
|
||||
cemeteryId
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ export default async function handler(_request, response) {
|
|||
workOrderMilestoneDateFilter: 'date',
|
||||
workOrderMilestoneDateString: currentDateString
|
||||
}, {
|
||||
orderBy: 'completion',
|
||||
includeWorkOrders: true
|
||||
includeWorkOrders: true,
|
||||
orderBy: 'completion'
|
||||
});
|
||||
response.render('dashboard', {
|
||||
headTitle: 'Dashboard',
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ export default async function handler(
|
|||
workOrderMilestoneDateString: currentDateString
|
||||
},
|
||||
{
|
||||
orderBy: 'completion',
|
||||
includeWorkOrders: true
|
||||
includeWorkOrders: true,
|
||||
orderBy: 'completion'
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ export default async function handler(
|
|||
|
||||
response.json({
|
||||
success: true,
|
||||
|
||||
funeralHomeId
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { Request, Response } from 'express';
|
||||
export default function handler(request: Request<unknown, unknown, {
|
||||
funeralHomeId: string | number;
|
||||
funeralHomeId: number | string;
|
||||
}>, response: Response): Promise<void>;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import type { Request, Response } from 'express'
|
|||
import { deleteRecord } from '../../database/deleteRecord.js'
|
||||
|
||||
export default async function handler(
|
||||
request: Request<unknown, unknown, { funeralHomeId: string | number }>,
|
||||
request: Request<unknown, unknown, { funeralHomeId: number | string }>,
|
||||
response: Response
|
||||
): Promise<void> {
|
||||
const success = await deleteRecord(
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ export default async function handler(
|
|||
|
||||
response.json({
|
||||
success,
|
||||
|
||||
funeralHomeId: request.body.funeralHomeId
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
import type { NextFunction, Request, Response } from 'express'
|
||||
|
||||
import path from 'node:path'
|
||||
|
||||
import { convertHTMLToPDF } from '@cityssm/pdf-puppeteer'
|
||||
import camelcase from 'camelcase'
|
||||
import { renderFile as renderEjsFile } from 'ejs'
|
||||
import type { NextFunction, Request, Response } from 'express'
|
||||
|
||||
import { getConfigProperty } from '../../helpers/config.helpers.js'
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ const cemeteryKeyToCemetery = {
|
|||
parentCemeteryId: ''
|
||||
},
|
||||
MN: {
|
||||
cemeteryName: 'Mausoleum Niche',
|
||||
cemeteryName: 'Holy Sepulchre - Mausoleum Niche',
|
||||
cemeteryDescription: 'At Holy Sepulchre Cemetery',
|
||||
cemeteryKey: 'MN',
|
||||
cemeterySvg: '',
|
||||
|
|
@ -109,7 +109,7 @@ const cemeteryKeyToCemetery = {
|
|||
parentCemeteryId: ''
|
||||
},
|
||||
NW: {
|
||||
cemeteryName: 'Niche Wall',
|
||||
cemeteryName: 'New Greenwood - Niche Wall',
|
||||
cemeteryDescription: 'At New Greenwood Cemetery',
|
||||
cemeteryKey: 'NW',
|
||||
cemeterySvg: '',
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ const cemeteryKeyToCemetery: Record<string, AddCemeteryForm> = {
|
|||
parentCemeteryId: ''
|
||||
},
|
||||
MN: {
|
||||
cemeteryName: 'Mausoleum Niche',
|
||||
cemeteryName: 'Holy Sepulchre - Mausoleum Niche',
|
||||
|
||||
cemeteryDescription: 'At Holy Sepulchre Cemetery',
|
||||
cemeteryKey: 'MN',
|
||||
|
|
@ -144,7 +144,7 @@ const cemeteryKeyToCemetery: Record<string, AddCemeteryForm> = {
|
|||
parentCemeteryId: ''
|
||||
},
|
||||
NW: {
|
||||
cemeteryName: 'Niche Wall',
|
||||
cemeteryName: 'New Greenwood - Niche Wall',
|
||||
|
||||
cemeteryDescription: 'At New Greenwood Cemetery',
|
||||
cemeteryKey: 'NW',
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
export declare function initializeFuneralHomes(user: User): Promise<void>;
|
||||
export declare function getFuneralHomeIdByKey(funeralHomeKey: string, user: User): Promise<number>;
|
||||
export declare function initializeFuneralHomes(user: User): Promise<void>;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import addFuneralHome from "../../database/addFuneralHome.js";
|
||||
import addFuneralHome from '../../database/addFuneralHome.js';
|
||||
const funeralHomes = [
|
||||
{
|
||||
funeralHomeKey: 'AR',
|
||||
|
|
@ -72,7 +72,7 @@ const funeralHomes = [
|
|||
},
|
||||
{
|
||||
funeralHomeKey: 'ME',
|
||||
funeralHomeName: "Menard Funeral Home",
|
||||
funeralHomeName: 'Menard Funeral Home',
|
||||
funeralHomeAddress1: '72 Lakeside Avenue',
|
||||
funeralHomeAddress2: '',
|
||||
funeralHomeCity: 'Blind River',
|
||||
|
|
@ -82,28 +82,13 @@ const funeralHomes = [
|
|||
}
|
||||
];
|
||||
const funeralHomeKeyToId = new Map();
|
||||
export async function initializeFuneralHomes(user) {
|
||||
for (const funeralHome of funeralHomes) {
|
||||
const funeralHomeId = await addFuneralHome({
|
||||
funeralHomeName: funeralHome.funeralHomeName ?? '',
|
||||
funeralHomeKey: funeralHome.funeralHomeKey ?? '',
|
||||
funeralHomeAddress1: funeralHome.funeralHomeAddress1 ?? '',
|
||||
funeralHomeAddress2: funeralHome.funeralHomeAddress2 ?? '',
|
||||
funeralHomeCity: funeralHome.funeralHomeCity ?? '',
|
||||
funeralHomeProvince: funeralHome.funeralHomeProvince ?? '',
|
||||
funeralHomePostalCode: funeralHome.funeralHomePostalCode ?? '',
|
||||
funeralHomePhoneNumber: funeralHome.funeralHomePhoneNumber ?? ''
|
||||
}, user);
|
||||
funeralHomeKeyToId.set(funeralHome.funeralHomeKey ?? '', funeralHomeId);
|
||||
}
|
||||
}
|
||||
export async function getFuneralHomeIdByKey(funeralHomeKey, user) {
|
||||
if (funeralHomeKeyToId.has(funeralHomeKey)) {
|
||||
return funeralHomeKeyToId.get(funeralHomeKey);
|
||||
}
|
||||
const funeralHomeId = await addFuneralHome({
|
||||
funeralHomeName: funeralHomeKey,
|
||||
funeralHomeKey,
|
||||
funeralHomeName: funeralHomeKey,
|
||||
funeralHomeAddress1: '',
|
||||
funeralHomeAddress2: '',
|
||||
funeralHomeCity: '',
|
||||
|
|
@ -114,3 +99,18 @@ export async function getFuneralHomeIdByKey(funeralHomeKey, user) {
|
|||
funeralHomeKeyToId.set(funeralHomeKey, funeralHomeId);
|
||||
return funeralHomeId;
|
||||
}
|
||||
export async function initializeFuneralHomes(user) {
|
||||
for (const funeralHome of funeralHomes) {
|
||||
const funeralHomeId = await addFuneralHome({
|
||||
funeralHomeKey: funeralHome.funeralHomeKey ?? '',
|
||||
funeralHomeName: funeralHome.funeralHomeName ?? '',
|
||||
funeralHomeAddress1: funeralHome.funeralHomeAddress1 ?? '',
|
||||
funeralHomeAddress2: funeralHome.funeralHomeAddress2 ?? '',
|
||||
funeralHomeCity: funeralHome.funeralHomeCity ?? '',
|
||||
funeralHomeProvince: funeralHome.funeralHomeProvince ?? '',
|
||||
funeralHomePostalCode: funeralHome.funeralHomePostalCode ?? '',
|
||||
funeralHomePhoneNumber: funeralHome.funeralHomePhoneNumber ?? ''
|
||||
}, user);
|
||||
funeralHomeKeyToId.set(funeralHome.funeralHomeKey ?? '', funeralHomeId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,111 +1,107 @@
|
|||
import addFuneralHome from "../../database/addFuneralHome.js"
|
||||
import type { FuneralHome } from "../../types/recordTypes.js"
|
||||
import addFuneralHome from '../../database/addFuneralHome.js'
|
||||
import type { FuneralHome } from '../../types/recordTypes.js'
|
||||
|
||||
const funeralHomes: FuneralHome[] = [
|
||||
{
|
||||
funeralHomeKey: 'AR',
|
||||
funeralHomeName: 'Arthur Funeral Home',
|
||||
|
||||
funeralHomeAddress1: '492 Wellington Street East',
|
||||
funeralHomeAddress2: '',
|
||||
funeralHomeCity: 'Sault Ste. Marie',
|
||||
funeralHomeProvince: 'ON',
|
||||
funeralHomePostalCode: 'P6A 2L9',
|
||||
|
||||
funeralHomePhoneNumber: '705-759-2522'
|
||||
},
|
||||
{
|
||||
funeralHomeKey: 'BG',
|
||||
funeralHomeName: 'Beggs Funeral Home',
|
||||
|
||||
funeralHomeAddress1: '175 Main Street',
|
||||
funeralHomeAddress2: 'P.O. Box 280',
|
||||
funeralHomeCity: 'Thessalon',
|
||||
funeralHomeProvince: 'ON',
|
||||
funeralHomePostalCode: 'P0R 1L0',
|
||||
|
||||
funeralHomePhoneNumber: '705-842-2520'
|
||||
},
|
||||
{
|
||||
funeralHomeKey: 'BK',
|
||||
funeralHomeName: 'Barton and Kiteley',
|
||||
|
||||
funeralHomeAddress1: '',
|
||||
funeralHomeAddress2: '',
|
||||
funeralHomeCity: 'Sault Ste. Marie',
|
||||
funeralHomeProvince: 'ON',
|
||||
funeralHomePostalCode: '',
|
||||
|
||||
funeralHomePhoneNumber: ''
|
||||
},
|
||||
{
|
||||
funeralHomeKey: 'DA',
|
||||
funeralHomeName: 'Damignani Burial, Cremation and Transfer Service',
|
||||
|
||||
funeralHomeAddress1: '215 St. James Street',
|
||||
funeralHomeAddress2: '',
|
||||
funeralHomeCity: 'Sault Ste. Marie',
|
||||
funeralHomeProvince: 'ON',
|
||||
funeralHomePostalCode: 'P6A 1P7',
|
||||
|
||||
funeralHomePhoneNumber: '705-759-8456'
|
||||
},
|
||||
{
|
||||
funeralHomeKey: 'GL',
|
||||
funeralHomeName: 'Gilmartin P.M. Funeral Home',
|
||||
|
||||
funeralHomeAddress1: '140 Churchill Avenue',
|
||||
funeralHomeAddress2: '',
|
||||
funeralHomeCity: 'Wawa',
|
||||
funeralHomeProvince: 'ON',
|
||||
funeralHomePostalCode: 'P0S 1K0',
|
||||
|
||||
funeralHomePhoneNumber: '705-856-7340'
|
||||
},
|
||||
{
|
||||
funeralHomeKey: 'NO',
|
||||
funeralHomeName: 'Northwood Funeral Home',
|
||||
|
||||
funeralHomeAddress1: '942 Great Northern Road',
|
||||
funeralHomeAddress2: '',
|
||||
funeralHomeCity: 'Sault Ste. Marie',
|
||||
funeralHomeProvince: 'ON',
|
||||
funeralHomePostalCode: 'P6B 0B6',
|
||||
|
||||
funeralHomePhoneNumber: '705-945-7758'
|
||||
},
|
||||
{
|
||||
funeralHomeKey: 'OS',
|
||||
funeralHomeName: "O'Sullivan Funeral Home",
|
||||
|
||||
funeralHomeAddress1: '215 St. James Street',
|
||||
funeralHomeAddress2: '',
|
||||
funeralHomeCity: 'Sault Ste. Marie',
|
||||
funeralHomeProvince: 'ON',
|
||||
funeralHomePostalCode: 'P6A 1P7',
|
||||
|
||||
funeralHomePhoneNumber: '705-759-8456'
|
||||
},
|
||||
{
|
||||
funeralHomeKey: 'ME',
|
||||
funeralHomeName: "Menard Funeral Home",
|
||||
funeralHomeName: 'Menard Funeral Home',
|
||||
|
||||
funeralHomeAddress1: '72 Lakeside Avenue',
|
||||
funeralHomeAddress2: '',
|
||||
funeralHomeCity: 'Blind River',
|
||||
funeralHomeProvince: 'ON',
|
||||
funeralHomePostalCode: 'P0R 1B0',
|
||||
|
||||
funeralHomePhoneNumber: '705-356-7151'
|
||||
}
|
||||
]
|
||||
|
||||
const funeralHomeKeyToId = new Map<string, number>()
|
||||
|
||||
export async function initializeFuneralHomes(user: User): Promise<void> {
|
||||
for (const funeralHome of funeralHomes) {
|
||||
const funeralHomeId = await addFuneralHome(
|
||||
{
|
||||
funeralHomeName: funeralHome.funeralHomeName ?? '',
|
||||
funeralHomeKey: funeralHome.funeralHomeKey ?? '',
|
||||
funeralHomeAddress1: funeralHome.funeralHomeAddress1 ?? '',
|
||||
funeralHomeAddress2: funeralHome.funeralHomeAddress2 ?? '',
|
||||
funeralHomeCity: funeralHome.funeralHomeCity ?? '',
|
||||
funeralHomeProvince: funeralHome.funeralHomeProvince ?? '',
|
||||
funeralHomePostalCode: funeralHome.funeralHomePostalCode ?? '',
|
||||
funeralHomePhoneNumber: funeralHome.funeralHomePhoneNumber ?? ''
|
||||
},
|
||||
user
|
||||
)
|
||||
|
||||
funeralHomeKeyToId.set(funeralHome.funeralHomeKey ?? '', funeralHomeId)
|
||||
}
|
||||
}
|
||||
|
||||
export async function getFuneralHomeIdByKey(
|
||||
funeralHomeKey: string,
|
||||
user: User
|
||||
|
|
@ -116,8 +112,9 @@ export async function getFuneralHomeIdByKey(
|
|||
|
||||
const funeralHomeId = await addFuneralHome(
|
||||
{
|
||||
funeralHomeName: funeralHomeKey,
|
||||
funeralHomeKey,
|
||||
funeralHomeName: funeralHomeKey,
|
||||
|
||||
funeralHomeAddress1: '',
|
||||
funeralHomeAddress2: '',
|
||||
funeralHomeCity: '',
|
||||
|
|
@ -132,3 +129,25 @@ export async function getFuneralHomeIdByKey(
|
|||
|
||||
return funeralHomeId
|
||||
}
|
||||
|
||||
export async function initializeFuneralHomes(user: User): Promise<void> {
|
||||
for (const funeralHome of funeralHomes) {
|
||||
const funeralHomeId = await addFuneralHome(
|
||||
{
|
||||
funeralHomeKey: funeralHome.funeralHomeKey ?? '',
|
||||
funeralHomeName: funeralHome.funeralHomeName ?? '',
|
||||
|
||||
funeralHomeAddress1: funeralHome.funeralHomeAddress1 ?? '',
|
||||
funeralHomeAddress2: funeralHome.funeralHomeAddress2 ?? '',
|
||||
funeralHomeCity: funeralHome.funeralHomeCity ?? '',
|
||||
funeralHomeProvince: funeralHome.funeralHomeProvince ?? '',
|
||||
funeralHomePostalCode: funeralHome.funeralHomePostalCode ?? '',
|
||||
|
||||
funeralHomePhoneNumber: funeralHome.funeralHomePhoneNumber ?? ''
|
||||
},
|
||||
user
|
||||
)
|
||||
|
||||
funeralHomeKeyToId.set(funeralHome.funeralHomeKey ?? '', funeralHomeId)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -204,17 +204,17 @@ async function importFromMasterCSV() {
|
|||
if (masterRow.CM_REMARK2 !== '') {
|
||||
await addContractComment({
|
||||
contractId: preneedContractId,
|
||||
comment: masterRow.CM_REMARK2,
|
||||
commentDateString: preneedContractStartDateString,
|
||||
commentTimeString: '00:00',
|
||||
comment: masterRow.CM_REMARK2
|
||||
commentTimeString: '00:00'
|
||||
}, user);
|
||||
}
|
||||
if (masterRow.CM_WORK_ORDER.trim() !== '') {
|
||||
await addContractComment({
|
||||
contractId: preneedContractId,
|
||||
comment: `Imported Contract #${masterRow.CM_WORK_ORDER}`,
|
||||
commentDateString: preneedContractStartDateString,
|
||||
commentTimeString: '00:00',
|
||||
comment: `Imported Contract #${masterRow.CM_WORK_ORDER}`
|
||||
commentTimeString: '00:00'
|
||||
}, user);
|
||||
}
|
||||
if (contractEndDateString === '') {
|
||||
|
|
@ -628,7 +628,7 @@ async function importFromWorkOrderCSV() {
|
|||
}, user);
|
||||
burialSite = await getBurialSite(burialSiteId);
|
||||
}
|
||||
const workOrderContainsLot = workOrder?.workOrderBurialSites?.find((possibleLot) => (possibleLot.burialSiteId === burialSite?.burialSiteId));
|
||||
const workOrderContainsLot = workOrder?.workOrderBurialSites?.find((possibleLot) => possibleLot.burialSiteId === burialSite?.burialSiteId);
|
||||
if (!workOrderContainsLot) {
|
||||
await addWorkOrderBurialSite({
|
||||
workOrderId: workOrder.workOrderId,
|
||||
|
|
|
|||
|
|
@ -452,9 +452,10 @@ async function importFromMasterCSV(): Promise<void> {
|
|||
await addContractComment(
|
||||
{
|
||||
contractId: preneedContractId,
|
||||
|
||||
comment: masterRow.CM_REMARK2,
|
||||
commentDateString: preneedContractStartDateString,
|
||||
commentTimeString: '00:00',
|
||||
comment: masterRow.CM_REMARK2
|
||||
commentTimeString: '00:00'
|
||||
},
|
||||
user
|
||||
)
|
||||
|
|
@ -464,9 +465,10 @@ async function importFromMasterCSV(): Promise<void> {
|
|||
await addContractComment(
|
||||
{
|
||||
contractId: preneedContractId,
|
||||
|
||||
comment: `Imported Contract #${masterRow.CM_WORK_ORDER}`,
|
||||
commentDateString: preneedContractStartDateString,
|
||||
commentTimeString: '00:00',
|
||||
comment: `Imported Contract #${masterRow.CM_WORK_ORDER}`
|
||||
commentTimeString: '00:00'
|
||||
},
|
||||
user
|
||||
)
|
||||
|
|
@ -1109,7 +1111,7 @@ async function importFromWorkOrderCSV(): Promise<void> {
|
|||
}
|
||||
|
||||
const workOrderContainsLot = workOrder?.workOrderBurialSites?.find(
|
||||
(possibleLot) => (possibleLot.burialSiteId === burialSite?.burialSiteId)
|
||||
(possibleLot) => possibleLot.burialSiteId === burialSite?.burialSiteId
|
||||
)
|
||||
|
||||
if (!workOrderContainsLot) {
|
||||
|
|
|
|||
|
|
@ -193,14 +193,16 @@
|
|||
<div class="control is-expanded">
|
||||
<input class="input" id="workOrderEdit--workOrderCloseDateString" name="workOrderCloseDateString" type="date" value="<%= workOrder.workOrderCloseDateString %>" disabled readonly />
|
||||
</div>
|
||||
<div class="control">
|
||||
<button class="button is-light is-success" id="button--closeWorkOrder" type="button">
|
||||
<span class="icon is-small"><i class="fas fa-stop-circle" aria-hidden="true"></i></span>
|
||||
<span>
|
||||
Close
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<% if (!isCreate) { %>
|
||||
<div class="control">
|
||||
<button class="button is-light is-success" id="button--closeWorkOrder" type="button">
|
||||
<span class="icon is-small"><i class="fas fa-stop-circle" aria-hidden="true"></i></span>
|
||||
<span>
|
||||
Close
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue