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