track burial site capacities
alter table BurialSiteTypes add bodyCapacityMax smallint alter table BurialSiteTypes add crematedCapacityMax smallint alter table BurialSites add bodyCapacity smallint alter table BurialSites add crematedCapacity smallintpull/11/head
parent
9c47b48abc
commit
db05999c72
|
|
@ -6,6 +6,7 @@ export const config = {
|
||||||
settings: {
|
settings: {
|
||||||
adminCleanup: {},
|
adminCleanup: {},
|
||||||
burialSites: {},
|
burialSites: {},
|
||||||
|
burialSiteTypes: {},
|
||||||
cemeteries: {},
|
cemeteries: {},
|
||||||
contracts: {},
|
contracts: {},
|
||||||
dynamicsGP: {
|
dynamicsGP: {
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ export const config: Config = {
|
||||||
settings: {
|
settings: {
|
||||||
adminCleanup: {},
|
adminCleanup: {},
|
||||||
burialSites: {},
|
burialSites: {},
|
||||||
|
burialSiteTypes: {},
|
||||||
cemeteries: {},
|
cemeteries: {},
|
||||||
contracts: {},
|
contracts: {},
|
||||||
dynamicsGP: {
|
dynamicsGP: {
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@ export declare const configDefaultValues: {
|
||||||
'settings.longitudeMax': number;
|
'settings.longitudeMax': number;
|
||||||
'settings.longitudeMin': number;
|
'settings.longitudeMin': number;
|
||||||
'settings.cemeteries.refreshImageChanges': boolean;
|
'settings.cemeteries.refreshImageChanges': boolean;
|
||||||
|
'settings.burialSiteTypes.bodyCapacityMaxDefault': number;
|
||||||
|
'settings.burialSiteTypes.crematedCapacityMaxDefault': number;
|
||||||
'settings.burialSites.burialSiteNameSegments': ConfigBurialSiteNameSegments;
|
'settings.burialSites.burialSiteNameSegments': ConfigBurialSiteNameSegments;
|
||||||
'settings.burialSites.burialSiteNameSegments.includeCemeteryKey': boolean;
|
'settings.burialSites.burialSiteNameSegments.includeCemeteryKey': boolean;
|
||||||
'settings.burialSites.refreshImageChanges': boolean;
|
'settings.burialSites.refreshImageChanges': boolean;
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,10 @@ export const configDefaultValues = {
|
||||||
'settings.longitudeMax': 180,
|
'settings.longitudeMax': 180,
|
||||||
'settings.longitudeMin': -180,
|
'settings.longitudeMin': -180,
|
||||||
'settings.cemeteries.refreshImageChanges': false,
|
'settings.cemeteries.refreshImageChanges': false,
|
||||||
|
// eslint-disable-next-line no-secrets/no-secrets
|
||||||
|
'settings.burialSiteTypes.bodyCapacityMaxDefault': 2,
|
||||||
|
// eslint-disable-next-line no-secrets/no-secrets
|
||||||
|
'settings.burialSiteTypes.crematedCapacityMaxDefault': 6,
|
||||||
'settings.burialSites.burialSiteNameSegments': {
|
'settings.burialSites.burialSiteNameSegments': {
|
||||||
includeCemeteryKey: false,
|
includeCemeteryKey: false,
|
||||||
separator: '-',
|
separator: '-',
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import type { config as MSSQLConfig } from 'mssql'
|
|
||||||
|
|
||||||
import { hoursToMillis } from '@cityssm/to-millis'
|
import { hoursToMillis } from '@cityssm/to-millis'
|
||||||
|
import type { config as MSSQLConfig } from 'mssql'
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ConfigActiveDirectory,
|
ConfigActiveDirectory,
|
||||||
|
|
@ -52,6 +51,12 @@ export const configDefaultValues = {
|
||||||
|
|
||||||
'settings.cemeteries.refreshImageChanges': false,
|
'settings.cemeteries.refreshImageChanges': false,
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-secrets/no-secrets
|
||||||
|
'settings.burialSiteTypes.bodyCapacityMaxDefault': 2,
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-secrets/no-secrets
|
||||||
|
'settings.burialSiteTypes.crematedCapacityMaxDefault': 6,
|
||||||
|
|
||||||
'settings.burialSites.burialSiteNameSegments': {
|
'settings.burialSites.burialSiteNameSegments': {
|
||||||
includeCemeteryKey: false,
|
includeCemeteryKey: false,
|
||||||
separator: '-',
|
separator: '-',
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ export interface AddBurialSiteForm {
|
||||||
burialSiteNameSegment5?: string;
|
burialSiteNameSegment5?: string;
|
||||||
burialSiteStatusId: number | string;
|
burialSiteStatusId: number | string;
|
||||||
burialSiteTypeId: number | string;
|
burialSiteTypeId: number | string;
|
||||||
|
bodyCapacity?: number | string;
|
||||||
|
crematedCapacity?: number | string;
|
||||||
burialSiteImage?: string;
|
burialSiteImage?: string;
|
||||||
cemeteryId: number | string;
|
cemeteryId: number | string;
|
||||||
cemeterySvgId?: string;
|
cemeterySvgId?: string;
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import getCemetery from './getCemetery.js';
|
||||||
* @returns The new burial site's id.
|
* @returns The new burial site's id.
|
||||||
* @throws If an active burial site with the same name already exists.
|
* @throws If an active burial site with the same name already exists.
|
||||||
*/
|
*/
|
||||||
|
// eslint-disable-next-line complexity
|
||||||
export default function addBurialSite(burialSiteForm, user) {
|
export default function addBurialSite(burialSiteForm, user) {
|
||||||
const database = sqlite(sunriseDB);
|
const database = sqlite(sunriseDB);
|
||||||
const rightNowMillis = Date.now();
|
const rightNowMillis = Date.now();
|
||||||
|
|
@ -38,17 +39,22 @@ export default function addBurialSite(burialSiteForm, user) {
|
||||||
burialSiteNameSegment5,
|
burialSiteNameSegment5,
|
||||||
burialSiteName,
|
burialSiteName,
|
||||||
burialSiteTypeId, burialSiteStatusId,
|
burialSiteTypeId, burialSiteStatusId,
|
||||||
|
bodyCapacity, crematedCapacity,
|
||||||
cemeteryId, cemeterySvgId, burialSiteImage,
|
cemeteryId, cemeterySvgId, burialSiteImage,
|
||||||
burialSiteLatitude, burialSiteLongitude,
|
burialSiteLatitude, burialSiteLongitude,
|
||||||
|
|
||||||
recordCreate_userName, recordCreate_timeMillis,
|
recordCreate_userName, recordCreate_timeMillis,
|
||||||
recordUpdate_userName, recordUpdate_timeMillis)
|
recordUpdate_userName, recordUpdate_timeMillis)
|
||||||
values (?, ?, ?,
|
values (?, ?, ?, ?, ?,
|
||||||
?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
|
?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
|
||||||
?, ?, ?, ?)`)
|
?, ?, ?, ?)`)
|
||||||
.run(burialSiteForm.burialSiteNameSegment1 ?? '', burialSiteForm.burialSiteNameSegment2 ?? '', burialSiteForm.burialSiteNameSegment3 ?? '', burialSiteForm.burialSiteNameSegment4 ?? '', burialSiteForm.burialSiteNameSegment5 ?? '', burialSiteName, burialSiteForm.burialSiteTypeId, burialSiteForm.burialSiteStatusId === ''
|
.run(burialSiteForm.burialSiteNameSegment1 ?? '', burialSiteForm.burialSiteNameSegment2 ?? '', burialSiteForm.burialSiteNameSegment3 ?? '', burialSiteForm.burialSiteNameSegment4 ?? '', burialSiteForm.burialSiteNameSegment5 ?? '', burialSiteName, burialSiteForm.burialSiteTypeId, burialSiteForm.burialSiteStatusId === ''
|
||||||
? undefined
|
? undefined
|
||||||
: burialSiteForm.burialSiteStatusId, burialSiteForm.cemeteryId === '' ? undefined : burialSiteForm.cemeteryId, burialSiteForm.cemeterySvgId, burialSiteForm.burialSiteImage ?? '', burialSiteForm.burialSiteLatitude === ''
|
: burialSiteForm.burialSiteStatusId, burialSiteForm.bodyCapacity === ''
|
||||||
|
? undefined
|
||||||
|
: burialSiteForm.bodyCapacity, burialSiteForm.crematedCapacity === ''
|
||||||
|
? undefined
|
||||||
|
: burialSiteForm.crematedCapacity, burialSiteForm.cemeteryId === '' ? undefined : burialSiteForm.cemeteryId, burialSiteForm.cemeterySvgId, burialSiteForm.burialSiteImage ?? '', burialSiteForm.burialSiteLatitude === ''
|
||||||
? undefined
|
? undefined
|
||||||
: burialSiteForm.burialSiteLatitude, burialSiteForm.burialSiteLongitude === ''
|
: burialSiteForm.burialSiteLatitude, burialSiteForm.burialSiteLongitude === ''
|
||||||
? undefined
|
? undefined
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,9 @@ export interface AddBurialSiteForm {
|
||||||
burialSiteStatusId: number | string
|
burialSiteStatusId: number | string
|
||||||
burialSiteTypeId: number | string
|
burialSiteTypeId: number | string
|
||||||
|
|
||||||
|
bodyCapacity?: number | string
|
||||||
|
crematedCapacity?: number | string
|
||||||
|
|
||||||
burialSiteImage?: string
|
burialSiteImage?: string
|
||||||
cemeteryId: number | string
|
cemeteryId: number | string
|
||||||
cemeterySvgId?: string
|
cemeterySvgId?: string
|
||||||
|
|
@ -35,6 +38,7 @@ export interface AddBurialSiteForm {
|
||||||
* @returns The new burial site's id.
|
* @returns The new burial site's id.
|
||||||
* @throws If an active burial site with the same name already exists.
|
* @throws If an active burial site with the same name already exists.
|
||||||
*/
|
*/
|
||||||
|
// eslint-disable-next-line complexity
|
||||||
export default function addBurialSite(
|
export default function addBurialSite(
|
||||||
burialSiteForm: AddBurialSiteForm,
|
burialSiteForm: AddBurialSiteForm,
|
||||||
user: User
|
user: User
|
||||||
|
|
@ -80,12 +84,13 @@ export default function addBurialSite(
|
||||||
burialSiteNameSegment5,
|
burialSiteNameSegment5,
|
||||||
burialSiteName,
|
burialSiteName,
|
||||||
burialSiteTypeId, burialSiteStatusId,
|
burialSiteTypeId, burialSiteStatusId,
|
||||||
|
bodyCapacity, crematedCapacity,
|
||||||
cemeteryId, cemeterySvgId, burialSiteImage,
|
cemeteryId, cemeterySvgId, burialSiteImage,
|
||||||
burialSiteLatitude, burialSiteLongitude,
|
burialSiteLatitude, burialSiteLongitude,
|
||||||
|
|
||||||
recordCreate_userName, recordCreate_timeMillis,
|
recordCreate_userName, recordCreate_timeMillis,
|
||||||
recordUpdate_userName, recordUpdate_timeMillis)
|
recordUpdate_userName, recordUpdate_timeMillis)
|
||||||
values (?, ?, ?,
|
values (?, ?, ?, ?, ?,
|
||||||
?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
|
?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
|
||||||
?, ?, ?, ?)`
|
?, ?, ?, ?)`
|
||||||
)
|
)
|
||||||
|
|
@ -100,6 +105,15 @@ export default function addBurialSite(
|
||||||
burialSiteForm.burialSiteStatusId === ''
|
burialSiteForm.burialSiteStatusId === ''
|
||||||
? undefined
|
? undefined
|
||||||
: burialSiteForm.burialSiteStatusId,
|
: burialSiteForm.burialSiteStatusId,
|
||||||
|
|
||||||
|
burialSiteForm.bodyCapacity === ''
|
||||||
|
? undefined
|
||||||
|
: burialSiteForm.bodyCapacity,
|
||||||
|
|
||||||
|
burialSiteForm.crematedCapacity === ''
|
||||||
|
? undefined
|
||||||
|
: burialSiteForm.crematedCapacity,
|
||||||
|
|
||||||
burialSiteForm.cemeteryId === '' ? undefined : burialSiteForm.cemeteryId,
|
burialSiteForm.cemeteryId === '' ? undefined : burialSiteForm.cemeteryId,
|
||||||
burialSiteForm.cemeterySvgId,
|
burialSiteForm.cemeterySvgId,
|
||||||
burialSiteForm.burialSiteImage ?? '',
|
burialSiteForm.burialSiteImage ?? '',
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
export interface AddBurialSiteTypeForm {
|
||||||
|
burialSiteType: string;
|
||||||
|
bodyCapacityMax: number | string;
|
||||||
|
crematedCapacityMax: number | string;
|
||||||
|
orderNumber?: number | string;
|
||||||
|
}
|
||||||
|
export default function addBurialSiteType(addForm: AddBurialSiteTypeForm, user: User): number;
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
import sqlite from 'better-sqlite3';
|
||||||
|
import { sunriseDB } from '../helpers/database.helpers.js';
|
||||||
|
import { clearCacheByTableName } from '../helpers/functions.cache.js';
|
||||||
|
export default function addBurialSiteType(addForm, user) {
|
||||||
|
const database = sqlite(sunriseDB);
|
||||||
|
const rightNowMillis = Date.now();
|
||||||
|
const result = database
|
||||||
|
.prepare(`insert into BurialSiteTypes (
|
||||||
|
burialSiteType, bodyCapacityMax, crematedCapacityMax,
|
||||||
|
orderNumber,
|
||||||
|
recordCreate_userName, recordCreate_timeMillis,
|
||||||
|
recordUpdate_userName, recordUpdate_timeMillis)
|
||||||
|
values (?, ?, ?, ?, ?, ?, ?, ?)`)
|
||||||
|
.run(addForm.burialSiteType, addForm.bodyCapacityMax === '' ? undefined : addForm.bodyCapacityMax, addForm.crematedCapacityMax === ''
|
||||||
|
? undefined
|
||||||
|
: addForm.crematedCapacityMax, addForm.orderNumber ?? -1, user.userName, rightNowMillis, user.userName, rightNowMillis);
|
||||||
|
database.close();
|
||||||
|
clearCacheByTableName('BurialSiteTypes');
|
||||||
|
return result.lastInsertRowid;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
import sqlite from 'better-sqlite3'
|
||||||
|
|
||||||
|
import { sunriseDB } from '../helpers/database.helpers.js'
|
||||||
|
import { clearCacheByTableName } from '../helpers/functions.cache.js'
|
||||||
|
|
||||||
|
export interface AddBurialSiteTypeForm {
|
||||||
|
burialSiteType: string
|
||||||
|
|
||||||
|
bodyCapacityMax: number | string
|
||||||
|
crematedCapacityMax: number | string
|
||||||
|
|
||||||
|
orderNumber?: number | string
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function addBurialSiteType(
|
||||||
|
addForm: AddBurialSiteTypeForm,
|
||||||
|
user: User
|
||||||
|
): number {
|
||||||
|
const database = sqlite(sunriseDB)
|
||||||
|
|
||||||
|
const rightNowMillis = Date.now()
|
||||||
|
|
||||||
|
const result = database
|
||||||
|
.prepare(
|
||||||
|
`insert into BurialSiteTypes (
|
||||||
|
burialSiteType, bodyCapacityMax, crematedCapacityMax,
|
||||||
|
orderNumber,
|
||||||
|
recordCreate_userName, recordCreate_timeMillis,
|
||||||
|
recordUpdate_userName, recordUpdate_timeMillis)
|
||||||
|
values (?, ?, ?, ?, ?, ?, ?, ?)`
|
||||||
|
)
|
||||||
|
.run(
|
||||||
|
addForm.burialSiteType,
|
||||||
|
addForm.bodyCapacityMax === '' ? undefined : addForm.bodyCapacityMax,
|
||||||
|
addForm.crematedCapacityMax === ''
|
||||||
|
? undefined
|
||||||
|
: addForm.crematedCapacityMax,
|
||||||
|
addForm.orderNumber ?? -1,
|
||||||
|
user.userName,
|
||||||
|
rightNowMillis,
|
||||||
|
user.userName,
|
||||||
|
rightNowMillis
|
||||||
|
)
|
||||||
|
|
||||||
|
database.close()
|
||||||
|
|
||||||
|
clearCacheByTableName('BurialSiteTypes')
|
||||||
|
|
||||||
|
return result.lastInsertRowid as number
|
||||||
|
}
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
type RecordTable = 'BurialSiteStatuses' | 'BurialSiteTypes' | 'WorkOrderMilestoneTypes' | 'WorkOrderTypes';
|
type RecordTable = 'BurialSiteStatuses' | 'WorkOrderMilestoneTypes' | 'WorkOrderTypes';
|
||||||
export default function addRecord(recordTable: RecordTable, recordName: string, orderNumber: number | string, user: User): number;
|
export default function addRecord(recordTable: RecordTable, recordName: string, orderNumber: number | string, user: User): number;
|
||||||
export {};
|
export {};
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import { sunriseDB } from '../helpers/database.helpers.js';
|
||||||
import { clearCacheByTableName } from '../helpers/functions.cache.js';
|
import { clearCacheByTableName } from '../helpers/functions.cache.js';
|
||||||
const recordNameColumns = new Map([
|
const recordNameColumns = new Map([
|
||||||
['BurialSiteStatuses', 'burialSiteStatus'],
|
['BurialSiteStatuses', 'burialSiteStatus'],
|
||||||
['BurialSiteTypes', 'burialSiteType'],
|
|
||||||
['WorkOrderMilestoneTypes', 'workOrderMilestoneType'],
|
['WorkOrderMilestoneTypes', 'workOrderMilestoneType'],
|
||||||
['WorkOrderTypes', 'workOrderType']
|
['WorkOrderTypes', 'workOrderType']
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,11 @@ import { clearCacheByTableName } from '../helpers/functions.cache.js'
|
||||||
|
|
||||||
type RecordTable =
|
type RecordTable =
|
||||||
| 'BurialSiteStatuses'
|
| 'BurialSiteStatuses'
|
||||||
| 'BurialSiteTypes'
|
|
||||||
| 'WorkOrderMilestoneTypes'
|
| 'WorkOrderMilestoneTypes'
|
||||||
| 'WorkOrderTypes'
|
| 'WorkOrderTypes'
|
||||||
|
|
||||||
const recordNameColumns = new Map<RecordTable, string>([
|
const recordNameColumns = new Map<RecordTable, string>([
|
||||||
['BurialSiteStatuses', 'burialSiteStatus'],
|
['BurialSiteStatuses', 'burialSiteStatus'],
|
||||||
['BurialSiteTypes', 'burialSiteType'],
|
|
||||||
['WorkOrderMilestoneTypes', 'workOrderMilestoneType'],
|
['WorkOrderMilestoneTypes', 'workOrderMilestoneType'],
|
||||||
['WorkOrderTypes', 'workOrderType']
|
['WorkOrderTypes', 'workOrderType']
|
||||||
])
|
])
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,9 @@ const baseSQL = `select l.burialSiteId,
|
||||||
l.burialSiteName,
|
l.burialSiteName,
|
||||||
l.burialSiteStatusId, s.burialSiteStatus,
|
l.burialSiteStatusId, s.burialSiteStatus,
|
||||||
|
|
||||||
|
l.bodyCapacity, l.crematedCapacity,
|
||||||
|
t.bodyCapacityMax, t.crematedCapacityMax,
|
||||||
|
|
||||||
l.cemeteryId, m.cemeteryName,
|
l.cemeteryId, m.cemeteryName,
|
||||||
m.cemeteryLatitude, m.cemeteryLongitude,
|
m.cemeteryLatitude, m.cemeteryLongitude,
|
||||||
m.cemeterySvg, l.cemeterySvgId, l.burialSiteImage,
|
m.cemeterySvg, l.cemeterySvgId, l.burialSiteImage,
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,9 @@ const baseSQL = `select l.burialSiteId,
|
||||||
l.burialSiteName,
|
l.burialSiteName,
|
||||||
l.burialSiteStatusId, s.burialSiteStatus,
|
l.burialSiteStatusId, s.burialSiteStatus,
|
||||||
|
|
||||||
|
l.bodyCapacity, l.crematedCapacity,
|
||||||
|
t.bodyCapacityMax, t.crematedCapacityMax,
|
||||||
|
|
||||||
l.cemeteryId, m.cemeteryName,
|
l.cemeteryId, m.cemeteryName,
|
||||||
m.cemeteryLatitude, m.cemeteryLongitude,
|
m.cemeteryLatitude, m.cemeteryLongitude,
|
||||||
m.cemeterySvg, l.cemeterySvgId, l.burialSiteImage,
|
m.cemeterySvg, l.cemeterySvgId, l.burialSiteImage,
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,11 @@ import getBurialSiteTypeFields from './getBurialSiteTypeFields.js';
|
||||||
import { updateRecordOrderNumber } from './updateRecordOrderNumber.js';
|
import { updateRecordOrderNumber } from './updateRecordOrderNumber.js';
|
||||||
export default function getBurialSiteTypes(includeDeleted = false) {
|
export default function getBurialSiteTypes(includeDeleted = false) {
|
||||||
const database = sqlite(sunriseDB);
|
const database = sqlite(sunriseDB);
|
||||||
const updateOrderNumbers = !database.readonly && !includeDeleted;
|
const updateOrderNumbers = !includeDeleted;
|
||||||
const burialSiteTypes = database
|
const burialSiteTypes = database
|
||||||
.prepare(`select burialSiteTypeId, burialSiteType, orderNumber
|
.prepare(`select burialSiteTypeId, burialSiteType,
|
||||||
|
bodyCapacityMax, crematedCapacityMax,
|
||||||
|
orderNumber
|
||||||
from BurialSiteTypes
|
from BurialSiteTypes
|
||||||
${includeDeleted ? '' : ' where recordDelete_timeMillis is null '}
|
${includeDeleted ? '' : ' where recordDelete_timeMillis is null '}
|
||||||
order by orderNumber, burialSiteType`)
|
order by orderNumber, burialSiteType`)
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,13 @@ export default function getBurialSiteTypes(
|
||||||
): BurialSiteType[] {
|
): BurialSiteType[] {
|
||||||
const database = sqlite(sunriseDB)
|
const database = sqlite(sunriseDB)
|
||||||
|
|
||||||
const updateOrderNumbers = !database.readonly && !includeDeleted
|
const updateOrderNumbers = !includeDeleted
|
||||||
|
|
||||||
const burialSiteTypes = database
|
const burialSiteTypes = database
|
||||||
.prepare(
|
.prepare(
|
||||||
`select burialSiteTypeId, burialSiteType, orderNumber
|
`select burialSiteTypeId, burialSiteType,
|
||||||
|
bodyCapacityMax, crematedCapacityMax,
|
||||||
|
orderNumber
|
||||||
from BurialSiteTypes
|
from BurialSiteTypes
|
||||||
${includeDeleted ? '' : ' where recordDelete_timeMillis is null '}
|
${includeDeleted ? '' : ' where recordDelete_timeMillis is null '}
|
||||||
order by orderNumber, burialSiteType`
|
order by orderNumber, burialSiteType`
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ export interface GetBurialSitesFilters {
|
||||||
burialSiteNameSearchType?: '' | 'endsWith' | 'startsWith';
|
burialSiteNameSearchType?: '' | 'endsWith' | 'startsWith';
|
||||||
burialSiteName?: string;
|
burialSiteName?: string;
|
||||||
cemeteryId?: number | string;
|
cemeteryId?: number | string;
|
||||||
burialSiteTypeId?: number | string;
|
|
||||||
burialSiteStatusId?: number | string;
|
burialSiteStatusId?: number | string;
|
||||||
|
burialSiteTypeId?: number | string;
|
||||||
contractStatus?: '' | 'occupied' | 'unoccupied';
|
contractStatus?: '' | 'occupied' | 'unoccupied';
|
||||||
workOrderId?: number | string;
|
workOrderId?: number | string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ export default function getBurialSites(filters, options, connectedDatabase) {
|
||||||
l.burialSiteNameSegment5,
|
l.burialSiteNameSegment5,
|
||||||
l.burialSiteName,
|
l.burialSiteName,
|
||||||
t.burialSiteType,
|
t.burialSiteType,
|
||||||
|
l.bodyCapacity, l.crematedCapacity,
|
||||||
l.cemeteryId, m.cemeteryName, l.cemeterySvgId,
|
l.cemeteryId, m.cemeteryName, l.cemeterySvgId,
|
||||||
l.burialSiteStatusId, s.burialSiteStatus
|
l.burialSiteStatusId, s.burialSiteStatus
|
||||||
${includeContractCount
|
${includeContractCount
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,9 @@ export interface GetBurialSitesFilters {
|
||||||
burialSiteNameSearchType?: '' | 'endsWith' | 'startsWith'
|
burialSiteNameSearchType?: '' | 'endsWith' | 'startsWith'
|
||||||
burialSiteName?: string
|
burialSiteName?: string
|
||||||
cemeteryId?: number | string
|
cemeteryId?: number | string
|
||||||
burialSiteTypeId?: number | string
|
|
||||||
burialSiteStatusId?: number | string
|
burialSiteStatusId?: number | string
|
||||||
|
burialSiteTypeId?: number | string
|
||||||
contractStatus?: '' | 'occupied' | 'unoccupied'
|
contractStatus?: '' | 'occupied' | 'unoccupied'
|
||||||
workOrderId?: number | string
|
workOrderId?: number | string
|
||||||
}
|
}
|
||||||
|
|
@ -75,6 +76,7 @@ export default function getBurialSites(
|
||||||
l.burialSiteNameSegment5,
|
l.burialSiteNameSegment5,
|
||||||
l.burialSiteName,
|
l.burialSiteName,
|
||||||
t.burialSiteType,
|
t.burialSiteType,
|
||||||
|
l.bodyCapacity, l.crematedCapacity,
|
||||||
l.cemeteryId, m.cemeteryName, l.cemeterySvgId,
|
l.cemeteryId, m.cemeteryName, l.cemeterySvgId,
|
||||||
l.burialSiteStatusId, s.burialSiteStatus
|
l.burialSiteStatusId, s.burialSiteStatus
|
||||||
${
|
${
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import sqlite from 'better-sqlite3';
|
||||||
import Debug from 'debug';
|
import Debug from 'debug';
|
||||||
import { DEBUG_NAMESPACE } from '../debug.config.js';
|
import { DEBUG_NAMESPACE } from '../debug.config.js';
|
||||||
import { sunriseDB as databasePath } from '../helpers/database.helpers.js';
|
import { sunriseDB as databasePath } from '../helpers/database.helpers.js';
|
||||||
|
import addBurialSiteType from './addBurialSiteType.js';
|
||||||
import addCommittalType from './addCommittalType.js';
|
import addCommittalType from './addCommittalType.js';
|
||||||
import addContractType from './addContractType.js';
|
import addContractType from './addContractType.js';
|
||||||
import addFeeCategory from './addFeeCategory.js';
|
import addFeeCategory from './addFeeCategory.js';
|
||||||
|
|
@ -23,6 +24,8 @@ const createStatements = [
|
||||||
`create table if not exists BurialSiteTypes (
|
`create table if not exists BurialSiteTypes (
|
||||||
burialSiteTypeId integer not null primary key autoincrement,
|
burialSiteTypeId integer not null primary key autoincrement,
|
||||||
burialSiteType varchar(100) not null,
|
burialSiteType varchar(100) not null,
|
||||||
|
bodyCapacityMax smallint,
|
||||||
|
crematedCapacityMax smallint,
|
||||||
orderNumber smallint not null default 0,
|
orderNumber smallint not null default 0,
|
||||||
${recordColumns})`,
|
${recordColumns})`,
|
||||||
`create index if not exists idx_BurialSiteTypes_orderNumber
|
`create index if not exists idx_BurialSiteTypes_orderNumber
|
||||||
|
|
@ -94,6 +97,9 @@ const createStatements = [
|
||||||
burialSiteNameSegment5 varchar(20) not null,
|
burialSiteNameSegment5 varchar(20) not null,
|
||||||
burialSiteName varchar(200) not null,
|
burialSiteName varchar(200) not null,
|
||||||
|
|
||||||
|
bodyCapacity smallint,
|
||||||
|
crematedCapacity smallint,
|
||||||
|
|
||||||
cemeteryId integer,
|
cemeteryId integer,
|
||||||
cemeterySvgId varchar(100),
|
cemeterySvgId varchar(100),
|
||||||
burialSiteImage varchar(100) not null default '',
|
burialSiteImage varchar(100) not null default '',
|
||||||
|
|
@ -412,12 +418,42 @@ export function initializeDatabase() {
|
||||||
}
|
}
|
||||||
function initializeData() {
|
function initializeData() {
|
||||||
debug('Initializing data...');
|
debug('Initializing data...');
|
||||||
addRecord('BurialSiteTypes', 'Casket Grave', 1, initializingUser);
|
addBurialSiteType({
|
||||||
addRecord('BurialSiteTypes', 'Columbarium', 2, initializingUser);
|
burialSiteType: 'In-Ground Grave',
|
||||||
addRecord('BurialSiteTypes', 'Mausoleum', 2, initializingUser);
|
bodyCapacityMax: 2,
|
||||||
addRecord('BurialSiteTypes', 'Niche Wall', 2, initializingUser);
|
crematedCapacityMax: 6,
|
||||||
addRecord('BurialSiteTypes', 'Urn Garden', 2, initializingUser);
|
orderNumber: 1
|
||||||
addRecord('BurialSiteTypes', 'Crematorium', 2, initializingUser);
|
}, initializingUser);
|
||||||
|
addBurialSiteType({
|
||||||
|
burialSiteType: 'Columbarium',
|
||||||
|
bodyCapacityMax: 0,
|
||||||
|
crematedCapacityMax: '',
|
||||||
|
orderNumber: 2
|
||||||
|
}, initializingUser);
|
||||||
|
addBurialSiteType({
|
||||||
|
burialSiteType: 'Mausoleum',
|
||||||
|
bodyCapacityMax: 2,
|
||||||
|
crematedCapacityMax: 0,
|
||||||
|
orderNumber: 2
|
||||||
|
}, initializingUser);
|
||||||
|
addBurialSiteType({
|
||||||
|
burialSiteType: 'Niche Wall',
|
||||||
|
bodyCapacityMax: 0,
|
||||||
|
crematedCapacityMax: 1,
|
||||||
|
orderNumber: 2
|
||||||
|
}, initializingUser);
|
||||||
|
addBurialSiteType({
|
||||||
|
burialSiteType: 'Urn Garden',
|
||||||
|
bodyCapacityMax: 0,
|
||||||
|
crematedCapacityMax: 1,
|
||||||
|
orderNumber: 2
|
||||||
|
}, initializingUser);
|
||||||
|
addBurialSiteType({
|
||||||
|
burialSiteType: 'Crematorium',
|
||||||
|
bodyCapacityMax: 0,
|
||||||
|
crematedCapacityMax: 1,
|
||||||
|
orderNumber: 2
|
||||||
|
}, initializingUser);
|
||||||
addRecord('BurialSiteStatuses', 'Available', 1, initializingUser);
|
addRecord('BurialSiteStatuses', 'Available', 1, initializingUser);
|
||||||
addRecord('BurialSiteStatuses', 'Reserved', 2, initializingUser);
|
addRecord('BurialSiteStatuses', 'Reserved', 2, initializingUser);
|
||||||
addRecord('BurialSiteStatuses', 'Taken', 3, initializingUser);
|
addRecord('BurialSiteStatuses', 'Taken', 3, initializingUser);
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import Debug from 'debug'
|
||||||
import { DEBUG_NAMESPACE } from '../debug.config.js'
|
import { DEBUG_NAMESPACE } from '../debug.config.js'
|
||||||
import { sunriseDB as databasePath } from '../helpers/database.helpers.js'
|
import { sunriseDB as databasePath } from '../helpers/database.helpers.js'
|
||||||
|
|
||||||
|
import addBurialSiteType from './addBurialSiteType.js'
|
||||||
import addCommittalType from './addCommittalType.js'
|
import addCommittalType from './addCommittalType.js'
|
||||||
import addContractType from './addContractType.js'
|
import addContractType from './addContractType.js'
|
||||||
import addFeeCategory from './addFeeCategory.js'
|
import addFeeCategory from './addFeeCategory.js'
|
||||||
|
|
@ -30,6 +31,8 @@ const createStatements = [
|
||||||
`create table if not exists BurialSiteTypes (
|
`create table if not exists BurialSiteTypes (
|
||||||
burialSiteTypeId integer not null primary key autoincrement,
|
burialSiteTypeId integer not null primary key autoincrement,
|
||||||
burialSiteType varchar(100) not null,
|
burialSiteType varchar(100) not null,
|
||||||
|
bodyCapacityMax smallint,
|
||||||
|
crematedCapacityMax smallint,
|
||||||
orderNumber smallint not null default 0,
|
orderNumber smallint not null default 0,
|
||||||
${recordColumns})`,
|
${recordColumns})`,
|
||||||
|
|
||||||
|
|
@ -112,6 +115,9 @@ const createStatements = [
|
||||||
burialSiteNameSegment5 varchar(20) not null,
|
burialSiteNameSegment5 varchar(20) not null,
|
||||||
burialSiteName varchar(200) not null,
|
burialSiteName varchar(200) not null,
|
||||||
|
|
||||||
|
bodyCapacity smallint,
|
||||||
|
crematedCapacity smallint,
|
||||||
|
|
||||||
cemeteryId integer,
|
cemeteryId integer,
|
||||||
cemeterySvgId varchar(100),
|
cemeterySvgId varchar(100),
|
||||||
burialSiteImage varchar(100) not null default '',
|
burialSiteImage varchar(100) not null default '',
|
||||||
|
|
@ -482,12 +488,71 @@ export function initializeDatabase(): boolean {
|
||||||
function initializeData(): void {
|
function initializeData(): void {
|
||||||
debug('Initializing data...')
|
debug('Initializing data...')
|
||||||
|
|
||||||
addRecord('BurialSiteTypes', 'Casket Grave', 1, initializingUser)
|
addBurialSiteType(
|
||||||
addRecord('BurialSiteTypes', 'Columbarium', 2, initializingUser)
|
{
|
||||||
addRecord('BurialSiteTypes', 'Mausoleum', 2, initializingUser)
|
burialSiteType: 'In-Ground Grave',
|
||||||
addRecord('BurialSiteTypes', 'Niche Wall', 2, initializingUser)
|
|
||||||
addRecord('BurialSiteTypes', 'Urn Garden', 2, initializingUser)
|
bodyCapacityMax: 2,
|
||||||
addRecord('BurialSiteTypes', 'Crematorium', 2, initializingUser)
|
crematedCapacityMax: 6,
|
||||||
|
orderNumber: 1
|
||||||
|
},
|
||||||
|
initializingUser
|
||||||
|
)
|
||||||
|
|
||||||
|
addBurialSiteType(
|
||||||
|
{
|
||||||
|
burialSiteType: 'Columbarium',
|
||||||
|
|
||||||
|
bodyCapacityMax: 0,
|
||||||
|
crematedCapacityMax: '',
|
||||||
|
orderNumber: 2
|
||||||
|
},
|
||||||
|
initializingUser
|
||||||
|
)
|
||||||
|
|
||||||
|
addBurialSiteType(
|
||||||
|
{
|
||||||
|
burialSiteType: 'Mausoleum',
|
||||||
|
|
||||||
|
bodyCapacityMax: 2,
|
||||||
|
crematedCapacityMax: 0,
|
||||||
|
orderNumber: 2
|
||||||
|
},
|
||||||
|
initializingUser
|
||||||
|
)
|
||||||
|
|
||||||
|
addBurialSiteType(
|
||||||
|
{
|
||||||
|
burialSiteType: 'Niche Wall',
|
||||||
|
|
||||||
|
bodyCapacityMax: 0,
|
||||||
|
crematedCapacityMax: 1,
|
||||||
|
orderNumber: 2
|
||||||
|
},
|
||||||
|
initializingUser
|
||||||
|
)
|
||||||
|
|
||||||
|
addBurialSiteType(
|
||||||
|
{
|
||||||
|
burialSiteType: 'Urn Garden',
|
||||||
|
|
||||||
|
bodyCapacityMax: 0,
|
||||||
|
crematedCapacityMax: 1,
|
||||||
|
orderNumber: 2
|
||||||
|
},
|
||||||
|
initializingUser
|
||||||
|
)
|
||||||
|
|
||||||
|
addBurialSiteType(
|
||||||
|
{
|
||||||
|
burialSiteType: 'Crematorium',
|
||||||
|
|
||||||
|
bodyCapacityMax: 0,
|
||||||
|
crematedCapacityMax: 1,
|
||||||
|
orderNumber: 2
|
||||||
|
},
|
||||||
|
initializingUser
|
||||||
|
)
|
||||||
|
|
||||||
addRecord('BurialSiteStatuses', 'Available', 1, initializingUser)
|
addRecord('BurialSiteStatuses', 'Available', 1, initializingUser)
|
||||||
addRecord('BurialSiteStatuses', 'Reserved', 2, initializingUser)
|
addRecord('BurialSiteStatuses', 'Reserved', 2, initializingUser)
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ export interface UpdateBurialSiteForm {
|
||||||
burialSiteNameSegment5?: string;
|
burialSiteNameSegment5?: string;
|
||||||
burialSiteStatusId: number | string;
|
burialSiteStatusId: number | string;
|
||||||
burialSiteTypeId: number | string;
|
burialSiteTypeId: number | string;
|
||||||
|
bodyCapacity?: number | string;
|
||||||
|
crematedCapacity?: number | string;
|
||||||
burialSiteImage: string;
|
burialSiteImage: string;
|
||||||
cemeteryId: number | string;
|
cemeteryId: number | string;
|
||||||
cemeterySvgId: string;
|
cemeterySvgId: string;
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import getCemetery from './getCemetery.js';
|
||||||
* @returns True if the burial site was updated.
|
* @returns True if the burial site was updated.
|
||||||
* @throws If an active burial site with the same name already exists.
|
* @throws If an active burial site with the same name already exists.
|
||||||
*/
|
*/
|
||||||
|
// eslint-disable-next-line complexity
|
||||||
export default function updateBurialSite(updateForm, user) {
|
export default function updateBurialSite(updateForm, user) {
|
||||||
const database = sqlite(sunriseDB);
|
const database = sqlite(sunriseDB);
|
||||||
const cemetery = updateForm.cemeteryId === ''
|
const cemetery = updateForm.cemeteryId === ''
|
||||||
|
|
@ -40,6 +41,8 @@ export default function updateBurialSite(updateForm, user) {
|
||||||
burialSiteName = ?,
|
burialSiteName = ?,
|
||||||
burialSiteTypeId = ?,
|
burialSiteTypeId = ?,
|
||||||
burialSiteStatusId = ?,
|
burialSiteStatusId = ?,
|
||||||
|
bodyCapacity = ?,
|
||||||
|
crematedCapacity = ?,
|
||||||
cemeteryId = ?,
|
cemeteryId = ?,
|
||||||
cemeterySvgId = ?,
|
cemeterySvgId = ?,
|
||||||
burialSiteImage = ?,
|
burialSiteImage = ?,
|
||||||
|
|
@ -51,7 +54,9 @@ export default function updateBurialSite(updateForm, user) {
|
||||||
and recordDelete_timeMillis is null`)
|
and recordDelete_timeMillis is null`)
|
||||||
.run(updateForm.burialSiteNameSegment1 ?? '', updateForm.burialSiteNameSegment2 ?? '', updateForm.burialSiteNameSegment3 ?? '', updateForm.burialSiteNameSegment4 ?? '', updateForm.burialSiteNameSegment5 ?? '', burialSiteName, updateForm.burialSiteTypeId, updateForm.burialSiteStatusId === ''
|
.run(updateForm.burialSiteNameSegment1 ?? '', updateForm.burialSiteNameSegment2 ?? '', updateForm.burialSiteNameSegment3 ?? '', updateForm.burialSiteNameSegment4 ?? '', updateForm.burialSiteNameSegment5 ?? '', burialSiteName, updateForm.burialSiteTypeId, updateForm.burialSiteStatusId === ''
|
||||||
? undefined
|
? undefined
|
||||||
: updateForm.burialSiteStatusId, updateForm.cemeteryId === '' ? undefined : updateForm.cemeteryId, updateForm.cemeterySvgId, updateForm.burialSiteImage, updateForm.burialSiteLatitude === ''
|
: updateForm.burialSiteStatusId, updateForm.bodyCapacity === '' ? undefined : updateForm.bodyCapacity, updateForm.crematedCapacity === ''
|
||||||
|
? undefined
|
||||||
|
: updateForm.crematedCapacity, updateForm.cemeteryId === '' ? undefined : updateForm.cemeteryId, updateForm.cemeterySvgId, updateForm.burialSiteImage, updateForm.burialSiteLatitude === ''
|
||||||
? undefined
|
? undefined
|
||||||
: updateForm.burialSiteLatitude, updateForm.burialSiteLongitude === ''
|
: updateForm.burialSiteLatitude, updateForm.burialSiteLongitude === ''
|
||||||
? undefined
|
? undefined
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,9 @@ export interface UpdateBurialSiteForm {
|
||||||
burialSiteStatusId: number | string
|
burialSiteStatusId: number | string
|
||||||
burialSiteTypeId: number | string
|
burialSiteTypeId: number | string
|
||||||
|
|
||||||
|
bodyCapacity?: number | string
|
||||||
|
crematedCapacity?: number | string
|
||||||
|
|
||||||
burialSiteImage: string
|
burialSiteImage: string
|
||||||
cemeteryId: number | string
|
cemeteryId: number | string
|
||||||
cemeterySvgId: string
|
cemeterySvgId: string
|
||||||
|
|
@ -37,6 +40,7 @@ export interface UpdateBurialSiteForm {
|
||||||
* @returns True if the burial site was updated.
|
* @returns True if the burial site was updated.
|
||||||
* @throws If an active burial site with the same name already exists.
|
* @throws If an active burial site with the same name already exists.
|
||||||
*/
|
*/
|
||||||
|
// eslint-disable-next-line complexity
|
||||||
export default function updateBurialSite(
|
export default function updateBurialSite(
|
||||||
updateForm: UpdateBurialSiteForm,
|
updateForm: UpdateBurialSiteForm,
|
||||||
user: User
|
user: User
|
||||||
|
|
@ -79,6 +83,8 @@ export default function updateBurialSite(
|
||||||
burialSiteName = ?,
|
burialSiteName = ?,
|
||||||
burialSiteTypeId = ?,
|
burialSiteTypeId = ?,
|
||||||
burialSiteStatusId = ?,
|
burialSiteStatusId = ?,
|
||||||
|
bodyCapacity = ?,
|
||||||
|
crematedCapacity = ?,
|
||||||
cemeteryId = ?,
|
cemeteryId = ?,
|
||||||
cemeterySvgId = ?,
|
cemeterySvgId = ?,
|
||||||
burialSiteImage = ?,
|
burialSiteImage = ?,
|
||||||
|
|
@ -100,6 +106,13 @@ export default function updateBurialSite(
|
||||||
updateForm.burialSiteStatusId === ''
|
updateForm.burialSiteStatusId === ''
|
||||||
? undefined
|
? undefined
|
||||||
: updateForm.burialSiteStatusId,
|
: updateForm.burialSiteStatusId,
|
||||||
|
|
||||||
|
updateForm.bodyCapacity === '' ? undefined : updateForm.bodyCapacity,
|
||||||
|
|
||||||
|
updateForm.crematedCapacity === ''
|
||||||
|
? undefined
|
||||||
|
: updateForm.crematedCapacity,
|
||||||
|
|
||||||
updateForm.cemeteryId === '' ? undefined : updateForm.cemeteryId,
|
updateForm.cemeteryId === '' ? undefined : updateForm.cemeteryId,
|
||||||
updateForm.cemeterySvgId,
|
updateForm.cemeterySvgId,
|
||||||
updateForm.burialSiteImage,
|
updateForm.burialSiteImage,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
export interface UpdateBurialSiteTypeForm {
|
||||||
|
burialSiteTypeId: number | string;
|
||||||
|
burialSiteType: string;
|
||||||
|
bodyCapacityMax: number | string;
|
||||||
|
crematedCapacityMax: number | string;
|
||||||
|
}
|
||||||
|
export default function updateBurialSiteType(updateForm: UpdateBurialSiteTypeForm, user: User): boolean;
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
import sqlite from 'better-sqlite3';
|
||||||
|
import { sunriseDB } from '../helpers/database.helpers.js';
|
||||||
|
import { clearCacheByTableName } from '../helpers/functions.cache.js';
|
||||||
|
export default function updateBurialSiteType(updateForm, user) {
|
||||||
|
const database = sqlite(sunriseDB);
|
||||||
|
const rightNowMillis = Date.now();
|
||||||
|
const result = database
|
||||||
|
.prepare(`update BurialSiteTypes
|
||||||
|
set burialSiteType = ?,
|
||||||
|
bodyCapacityMax = ?,
|
||||||
|
crematedCapacityMax = ?,
|
||||||
|
recordUpdate_userName = ?, recordUpdate_timeMillis = ?
|
||||||
|
where recordDelete_timeMillis is null
|
||||||
|
and burialSiteTypeId = ?`)
|
||||||
|
.run(updateForm.burialSiteType, updateForm.bodyCapacityMax === ''
|
||||||
|
? undefined
|
||||||
|
: updateForm.bodyCapacityMax, updateForm.crematedCapacityMax === ''
|
||||||
|
? undefined
|
||||||
|
: updateForm.crematedCapacityMax, user.userName, rightNowMillis, updateForm.burialSiteTypeId);
|
||||||
|
database.close();
|
||||||
|
clearCacheByTableName('BurialSiteTypes');
|
||||||
|
return result.changes > 0;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
import sqlite from 'better-sqlite3'
|
||||||
|
|
||||||
|
import { sunriseDB } from '../helpers/database.helpers.js'
|
||||||
|
import { clearCacheByTableName } from '../helpers/functions.cache.js'
|
||||||
|
|
||||||
|
export interface UpdateBurialSiteTypeForm {
|
||||||
|
burialSiteTypeId: number | string
|
||||||
|
|
||||||
|
burialSiteType: string
|
||||||
|
|
||||||
|
bodyCapacityMax: number | string
|
||||||
|
crematedCapacityMax: number | string
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function updateBurialSiteType(
|
||||||
|
updateForm: UpdateBurialSiteTypeForm,
|
||||||
|
user: User
|
||||||
|
): boolean {
|
||||||
|
const database = sqlite(sunriseDB)
|
||||||
|
|
||||||
|
const rightNowMillis = Date.now()
|
||||||
|
|
||||||
|
const result = database
|
||||||
|
.prepare(
|
||||||
|
`update BurialSiteTypes
|
||||||
|
set burialSiteType = ?,
|
||||||
|
bodyCapacityMax = ?,
|
||||||
|
crematedCapacityMax = ?,
|
||||||
|
recordUpdate_userName = ?, recordUpdate_timeMillis = ?
|
||||||
|
where recordDelete_timeMillis is null
|
||||||
|
and burialSiteTypeId = ?`
|
||||||
|
)
|
||||||
|
.run(
|
||||||
|
updateForm.burialSiteType,
|
||||||
|
updateForm.bodyCapacityMax === ''
|
||||||
|
? undefined
|
||||||
|
: updateForm.bodyCapacityMax,
|
||||||
|
updateForm.crematedCapacityMax === ''
|
||||||
|
? undefined
|
||||||
|
: updateForm.crematedCapacityMax,
|
||||||
|
|
||||||
|
user.userName,
|
||||||
|
rightNowMillis,
|
||||||
|
updateForm.burialSiteTypeId
|
||||||
|
)
|
||||||
|
|
||||||
|
database.close()
|
||||||
|
|
||||||
|
clearCacheByTableName('BurialSiteTypes')
|
||||||
|
|
||||||
|
return result.changes > 0
|
||||||
|
}
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
type RecordTable = 'BurialSiteStatuses' | 'BurialSiteTypes' | 'CommittalTypes' | 'WorkOrderMilestoneTypes' | 'WorkOrderTypes';
|
type RecordTable = 'BurialSiteStatuses' | 'CommittalTypes' | 'WorkOrderMilestoneTypes' | 'WorkOrderTypes';
|
||||||
export declare function updateRecord(recordTable: RecordTable, recordId: number | string, recordName: string, user: User): boolean;
|
export declare function updateRecord(recordTable: RecordTable, recordId: number | string, recordName: string, user: User): boolean;
|
||||||
export {};
|
export {};
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import { sunriseDB } from '../helpers/database.helpers.js';
|
||||||
import { clearCacheByTableName } from '../helpers/functions.cache.js';
|
import { clearCacheByTableName } from '../helpers/functions.cache.js';
|
||||||
const recordNameIdColumns = new Map([
|
const recordNameIdColumns = new Map([
|
||||||
['BurialSiteStatuses', ['burialSiteStatus', 'burialSiteStatusId']],
|
['BurialSiteStatuses', ['burialSiteStatus', 'burialSiteStatusId']],
|
||||||
['BurialSiteTypes', ['burialSiteType', 'burialSiteTypeId']],
|
|
||||||
['CommittalTypes', ['committalType', 'committalTypeId']],
|
['CommittalTypes', ['committalType', 'committalTypeId']],
|
||||||
[
|
[
|
||||||
'WorkOrderMilestoneTypes',
|
'WorkOrderMilestoneTypes',
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,12 @@ import { clearCacheByTableName } from '../helpers/functions.cache.js'
|
||||||
|
|
||||||
type RecordTable =
|
type RecordTable =
|
||||||
| 'BurialSiteStatuses'
|
| 'BurialSiteStatuses'
|
||||||
| 'BurialSiteTypes'
|
|
||||||
| 'CommittalTypes'
|
| 'CommittalTypes'
|
||||||
| 'WorkOrderMilestoneTypes'
|
| 'WorkOrderMilestoneTypes'
|
||||||
| 'WorkOrderTypes'
|
| 'WorkOrderTypes'
|
||||||
|
|
||||||
const recordNameIdColumns = new Map<RecordTable, string[]>([
|
const recordNameIdColumns = new Map<RecordTable, string[]>([
|
||||||
['BurialSiteStatuses', ['burialSiteStatus', 'burialSiteStatusId']],
|
['BurialSiteStatuses', ['burialSiteStatus', 'burialSiteStatusId']],
|
||||||
['BurialSiteTypes', ['burialSiteType', 'burialSiteTypeId']],
|
|
||||||
['CommittalTypes', ['committalType', 'committalTypeId']],
|
['CommittalTypes', ['committalType', 'committalTypeId']],
|
||||||
[
|
[
|
||||||
'WorkOrderMilestoneTypes',
|
'WorkOrderMilestoneTypes',
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
import type { Request, Response } from 'express';
|
import type { Request, Response } from 'express';
|
||||||
export default function handler(request: Request<unknown, unknown, {
|
import { type AddBurialSiteTypeForm } from '../../database/addBurialSiteType.js';
|
||||||
burialSiteType: string;
|
export default function handler(request: Request<unknown, unknown, AddBurialSiteTypeForm>, response: Response): void;
|
||||||
orderNumber?: number | string;
|
|
||||||
}>, response: Response): void;
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import addRecord from '../../database/addRecord.js';
|
import addBurialSiteType from '../../database/addBurialSiteType.js';
|
||||||
import { getBurialSiteTypes } from '../../helpers/functions.cache.js';
|
import { getBurialSiteTypes } from '../../helpers/functions.cache.js';
|
||||||
export default function handler(request, response) {
|
export default function handler(request, response) {
|
||||||
const burialSiteTypeId = addRecord('BurialSiteTypes', request.body.burialSiteType, request.body.orderNumber ?? -1, request.session.user);
|
const burialSiteTypeId = addBurialSiteType(request.body, request.session.user);
|
||||||
const burialSiteTypes = getBurialSiteTypes();
|
const burialSiteTypes = getBurialSiteTypes();
|
||||||
response.json({
|
response.json({
|
||||||
success: true,
|
success: true,
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,16 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import addRecord from '../../database/addRecord.js'
|
import addBurialSiteType, {
|
||||||
|
type AddBurialSiteTypeForm
|
||||||
|
} from '../../database/addBurialSiteType.js'
|
||||||
import { getBurialSiteTypes } from '../../helpers/functions.cache.js'
|
import { getBurialSiteTypes } from '../../helpers/functions.cache.js'
|
||||||
|
|
||||||
export default function handler(
|
export default function handler(
|
||||||
request: Request<
|
request: Request<unknown, unknown, AddBurialSiteTypeForm>,
|
||||||
unknown,
|
|
||||||
unknown,
|
|
||||||
{ burialSiteType: string; orderNumber?: number | string }
|
|
||||||
>,
|
|
||||||
response: Response
|
response: Response
|
||||||
): void {
|
): void {
|
||||||
const burialSiteTypeId = addRecord(
|
const burialSiteTypeId = addBurialSiteType(
|
||||||
'BurialSiteTypes',
|
request.body,
|
||||||
request.body.burialSiteType,
|
|
||||||
request.body.orderNumber ?? -1,
|
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
import type { Request, Response } from 'express';
|
import type { Request, Response } from 'express';
|
||||||
export default function handler(request: Request<unknown, unknown, {
|
import { type UpdateBurialSiteTypeForm } from '../../database/updateBurialSiteType.js';
|
||||||
burialSiteTypeId: string;
|
export default function handler(request: Request<unknown, unknown, UpdateBurialSiteTypeForm>, response: Response): void;
|
||||||
burialSiteType: string;
|
|
||||||
}>, response: Response): void;
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { updateRecord } from '../../database/updateRecord.js';
|
import updateBurialSiteType from '../../database/updateBurialSiteType.js';
|
||||||
import { getBurialSiteTypes } from '../../helpers/functions.cache.js';
|
import { getBurialSiteTypes } from '../../helpers/functions.cache.js';
|
||||||
export default function handler(request, response) {
|
export default function handler(request, response) {
|
||||||
const success = updateRecord('BurialSiteTypes', request.body.burialSiteTypeId, request.body.burialSiteType, request.session.user);
|
const success = updateBurialSiteType(request.body, request.session.user);
|
||||||
const burialSiteTypes = getBurialSiteTypes();
|
const burialSiteTypes = getBurialSiteTypes();
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,16 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import { updateRecord } from '../../database/updateRecord.js'
|
import updateBurialSiteType, {
|
||||||
|
type UpdateBurialSiteTypeForm
|
||||||
|
} from '../../database/updateBurialSiteType.js'
|
||||||
import { getBurialSiteTypes } from '../../helpers/functions.cache.js'
|
import { getBurialSiteTypes } from '../../helpers/functions.cache.js'
|
||||||
|
|
||||||
export default function handler(
|
export default function handler(
|
||||||
request: Request<
|
request: Request<unknown, unknown, UpdateBurialSiteTypeForm>,
|
||||||
unknown,
|
|
||||||
unknown,
|
|
||||||
{ burialSiteTypeId: string; burialSiteType: string }
|
|
||||||
>,
|
|
||||||
response: Response
|
response: Response
|
||||||
): void {
|
): void {
|
||||||
const success = updateRecord(
|
const success = updateBurialSiteType(
|
||||||
'BurialSiteTypes',
|
request.body,
|
||||||
request.body.burialSiteTypeId,
|
|
||||||
request.body.burialSiteType,
|
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,11 @@ import { getBurialSiteImages } from '../../helpers/images.helpers.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const burialSite = {
|
const burialSite = {
|
||||||
burialSiteId: -1,
|
burialSiteId: -1,
|
||||||
contracts: []
|
contracts: [],
|
||||||
|
// eslint-disable-next-line unicorn/no-null
|
||||||
|
bodyCapacity: null,
|
||||||
|
// eslint-disable-next-line unicorn/no-null
|
||||||
|
crematedCapacity: null
|
||||||
};
|
};
|
||||||
const cemeteries = getCemeteries();
|
const cemeteries = getCemeteries();
|
||||||
if (request.query.cemeteryId !== undefined) {
|
if (request.query.cemeteryId !== undefined) {
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,13 @@ export default async function handler(
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const burialSite: BurialSite = {
|
const burialSite: BurialSite = {
|
||||||
burialSiteId: -1,
|
burialSiteId: -1,
|
||||||
contracts: []
|
contracts: [],
|
||||||
|
|
||||||
|
// eslint-disable-next-line unicorn/no-null
|
||||||
|
bodyCapacity: null,
|
||||||
|
|
||||||
|
// eslint-disable-next-line unicorn/no-null
|
||||||
|
crematedCapacity: null
|
||||||
}
|
}
|
||||||
|
|
||||||
const cemeteries = getCemeteries()
|
const cemeteries = getCemeteries()
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,43 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="columns">
|
||||||
|
<div class="column">
|
||||||
|
<div class="field">
|
||||||
|
<label class="label" for="burialSiteTypeAdd--bodyCapacityMax"
|
||||||
|
>Body Capacity Max</label
|
||||||
|
>
|
||||||
|
<div class="control">
|
||||||
|
<input
|
||||||
|
class="input has-text-right"
|
||||||
|
id="burialSiteTypeAdd--bodyCapacityMax"
|
||||||
|
name="bodyCapacityMax"
|
||||||
|
type="number"
|
||||||
|
min="0"
|
||||||
|
max="100"
|
||||||
|
step="1"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="column">
|
||||||
|
<div class="field">
|
||||||
|
<label class="label" for="burialSiteTypeAdd--crematedCapacityMax"
|
||||||
|
>Cremated Capacity Max</label
|
||||||
|
>
|
||||||
|
<div class="control">
|
||||||
|
<input
|
||||||
|
class="input has-text-right"
|
||||||
|
id="burialSiteTypeAdd--crematedCapacityMax"
|
||||||
|
name="crematedCapacityMax"
|
||||||
|
type="number"
|
||||||
|
min="0"
|
||||||
|
max="100"
|
||||||
|
step="1"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
<footer class="modal-card-foot is-justify-content-right">
|
<footer class="modal-card-foot is-justify-content-right">
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,44 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="columns">
|
||||||
|
<div class="column">
|
||||||
|
<div class="field">
|
||||||
|
<label class="label" for="burialSiteTypeEdit--bodyCapacityMax"
|
||||||
|
>Body Capacity Max</label
|
||||||
|
>
|
||||||
|
<div class="control">
|
||||||
|
<input
|
||||||
|
class="input has-text-right"
|
||||||
|
id="burialSiteTypeEdit--bodyCapacityMax"
|
||||||
|
name="bodyCapacityMax"
|
||||||
|
type="number"
|
||||||
|
min="0"
|
||||||
|
max="100"
|
||||||
|
step="1"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="column">
|
||||||
|
<div class="field">
|
||||||
|
<label class="label" for="burialSiteTypeEdit--crematedCapacityMax"
|
||||||
|
>Cremated Capacity Max</label
|
||||||
|
>
|
||||||
|
<div class="control">
|
||||||
|
<input
|
||||||
|
class="input has-text-right"
|
||||||
|
id="burialSiteTypeEdit--crematedCapacityMax"
|
||||||
|
name="crematedCapacityMax"
|
||||||
|
type="number"
|
||||||
|
min="0"
|
||||||
|
max="100"
|
||||||
|
step="1"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
<footer class="modal-card-foot is-justify-content-right">
|
<footer class="modal-card-foot is-justify-content-right">
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
});
|
});
|
||||||
// Burial Site Type
|
// Burial Site Type
|
||||||
const burialSiteTypeIdElement = document.querySelector('#burialSite--burialSiteTypeId');
|
const burialSiteTypeIdElement = document.querySelector('#burialSite--burialSiteTypeId');
|
||||||
|
function updateCapacities() {
|
||||||
|
const bodyCapacityMax = burialSiteTypeIdElement.selectedOptions[0].dataset.bodyCapacityMax;
|
||||||
|
const bodyCapacityElement = document.querySelector('#burialSite--bodyCapacity');
|
||||||
|
bodyCapacityElement.max =
|
||||||
|
bodyCapacityMax === ''
|
||||||
|
? exports.bodyCapacityMaxDefault
|
||||||
|
: bodyCapacityMax ?? '';
|
||||||
|
bodyCapacityElement.placeholder =
|
||||||
|
bodyCapacityMax === ''
|
||||||
|
? exports.bodyCapacityMaxDefault
|
||||||
|
: bodyCapacityMax ?? '';
|
||||||
|
const crematedCapacityMax = burialSiteTypeIdElement.selectedOptions[0].dataset.crematedCapacityMax;
|
||||||
|
const crematedCapacityElement = document.querySelector('#burialSite--crematedCapacity');
|
||||||
|
crematedCapacityElement.max =
|
||||||
|
crematedCapacityMax === ''
|
||||||
|
? exports.crematedCapacityMaxDefault
|
||||||
|
: crematedCapacityMax ?? '';
|
||||||
|
crematedCapacityElement.placeholder =
|
||||||
|
crematedCapacityMax === ''
|
||||||
|
? exports.crematedCapacityMaxDefault
|
||||||
|
: crematedCapacityMax ?? '';
|
||||||
|
}
|
||||||
if (isCreate) {
|
if (isCreate) {
|
||||||
const burialSiteFieldsContainerElement = document.querySelector('#container--burialSiteFields');
|
const burialSiteFieldsContainerElement = document.querySelector('#container--burialSiteFields');
|
||||||
burialSiteTypeIdElement.addEventListener('change', () => {
|
burialSiteTypeIdElement.addEventListener('change', () => {
|
||||||
|
|
@ -177,12 +199,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
text: 'Revert the Change',
|
text: 'Revert the Change',
|
||||||
callbackFunction() {
|
callbackFunction() {
|
||||||
burialSiteTypeIdElement.value = originalBurialSiteTypeId;
|
burialSiteTypeIdElement.value = originalBurialSiteTypeId;
|
||||||
|
updateCapacities();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
burialSiteTypeIdElement.addEventListener('change', updateCapacities);
|
||||||
// Leaflet Map
|
// Leaflet Map
|
||||||
document
|
document
|
||||||
.querySelector('#button--selectCoordinate')
|
.querySelector('#button--selectCoordinate')
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,14 @@ import type { Sunrise } from './types.js'
|
||||||
declare const cityssm: cityssmGlobal
|
declare const cityssm: cityssmGlobal
|
||||||
declare const bulmaJS: BulmaJS
|
declare const bulmaJS: BulmaJS
|
||||||
|
|
||||||
declare const exports: Record<string, unknown>
|
declare const exports: {
|
||||||
|
sunrise: Sunrise
|
||||||
|
|
||||||
|
burialSiteComments?: BurialSiteComment[]
|
||||||
|
|
||||||
|
bodyCapacityMaxDefault: string
|
||||||
|
crematedCapacityMaxDefault: string
|
||||||
|
}
|
||||||
;(() => {
|
;(() => {
|
||||||
const sunrise = exports.sunrise as Sunrise
|
const sunrise = exports.sunrise as Sunrise
|
||||||
|
|
||||||
|
|
@ -142,6 +149,42 @@ declare const exports: Record<string, unknown>
|
||||||
'#burialSite--burialSiteTypeId'
|
'#burialSite--burialSiteTypeId'
|
||||||
) as HTMLSelectElement
|
) as HTMLSelectElement
|
||||||
|
|
||||||
|
function updateCapacities(): void {
|
||||||
|
const bodyCapacityMax =
|
||||||
|
burialSiteTypeIdElement.selectedOptions[0].dataset.bodyCapacityMax
|
||||||
|
|
||||||
|
const bodyCapacityElement = document.querySelector(
|
||||||
|
'#burialSite--bodyCapacity'
|
||||||
|
) as HTMLInputElement
|
||||||
|
|
||||||
|
bodyCapacityElement.max =
|
||||||
|
bodyCapacityMax === ''
|
||||||
|
? exports.bodyCapacityMaxDefault
|
||||||
|
: bodyCapacityMax ?? ''
|
||||||
|
|
||||||
|
bodyCapacityElement.placeholder =
|
||||||
|
bodyCapacityMax === ''
|
||||||
|
? exports.bodyCapacityMaxDefault
|
||||||
|
: bodyCapacityMax ?? ''
|
||||||
|
|
||||||
|
const crematedCapacityMax =
|
||||||
|
burialSiteTypeIdElement.selectedOptions[0].dataset.crematedCapacityMax
|
||||||
|
|
||||||
|
const crematedCapacityElement = document.querySelector(
|
||||||
|
'#burialSite--crematedCapacity'
|
||||||
|
) as HTMLInputElement
|
||||||
|
|
||||||
|
crematedCapacityElement.max =
|
||||||
|
crematedCapacityMax === ''
|
||||||
|
? exports.crematedCapacityMaxDefault
|
||||||
|
: crematedCapacityMax ?? ''
|
||||||
|
|
||||||
|
crematedCapacityElement.placeholder =
|
||||||
|
crematedCapacityMax === ''
|
||||||
|
? exports.crematedCapacityMaxDefault
|
||||||
|
: crematedCapacityMax ?? ''
|
||||||
|
}
|
||||||
|
|
||||||
if (isCreate) {
|
if (isCreate) {
|
||||||
const burialSiteFieldsContainerElement = document.querySelector(
|
const burialSiteFieldsContainerElement = document.querySelector(
|
||||||
'#container--burialSiteFields'
|
'#container--burialSiteFields'
|
||||||
|
|
@ -265,16 +308,19 @@ declare const exports: Record<string, unknown>
|
||||||
message: `Are you sure you want to change the burial site type?\n
|
message: `Are you sure you want to change the burial site type?\n
|
||||||
This change affects the additional fields associated with this record.`,
|
This change affects the additional fields associated with this record.`,
|
||||||
contextualColorName: 'warning',
|
contextualColorName: 'warning',
|
||||||
|
|
||||||
okButton: {
|
okButton: {
|
||||||
text: 'Yes, Keep the Change',
|
text: 'Yes, Keep the Change',
|
||||||
callbackFunction() {
|
callbackFunction() {
|
||||||
refreshAfterSave = true
|
refreshAfterSave = true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
cancelButton: {
|
cancelButton: {
|
||||||
text: 'Revert the Change',
|
text: 'Revert the Change',
|
||||||
callbackFunction() {
|
callbackFunction() {
|
||||||
burialSiteTypeIdElement.value = originalBurialSiteTypeId
|
burialSiteTypeIdElement.value = originalBurialSiteTypeId
|
||||||
|
updateCapacities()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -282,6 +328,8 @@ declare const exports: Record<string, unknown>
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
burialSiteTypeIdElement.addEventListener('change', updateCapacities)
|
||||||
|
|
||||||
// Leaflet Map
|
// Leaflet Map
|
||||||
|
|
||||||
document
|
document
|
||||||
|
|
@ -564,7 +612,7 @@ declare const exports: Record<string, unknown>
|
||||||
) as HTMLTextAreaElement
|
) as HTMLTextAreaElement
|
||||||
).focus()
|
).focus()
|
||||||
},
|
},
|
||||||
|
|
||||||
onremoved() {
|
onremoved() {
|
||||||
bulmaJS.toggleHtmlClipped()
|
bulmaJS.toggleHtmlClipped()
|
||||||
;(
|
;(
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: "Error Updating Burial Site Type",
|
title: 'Error Updating Burial Site Type',
|
||||||
message: responseJSON.errorMessage ?? '',
|
message: responseJSON.errorMessage ?? '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
});
|
});
|
||||||
|
|
@ -49,11 +49,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
}, burialSiteTypeResponseHandler);
|
}, burialSiteTypeResponseHandler);
|
||||||
}
|
}
|
||||||
bulmaJS.confirm({
|
bulmaJS.confirm({
|
||||||
title: "Delete Burial Site Type",
|
title: 'Delete Burial Site Type',
|
||||||
message: "Are you sure you want to delete this burial site type?",
|
message: 'Are you sure you want to delete this burial site type?',
|
||||||
contextualColorName: 'warning',
|
contextualColorName: 'warning',
|
||||||
okButton: {
|
okButton: {
|
||||||
text: "Yes, Delete Burial Site Type",
|
text: 'Yes, Delete Burial Site Type',
|
||||||
callbackFunction: doDelete
|
callbackFunction: doDelete
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -77,6 +77,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
sunrise.populateAliases(modalElement);
|
sunrise.populateAliases(modalElement);
|
||||||
modalElement.querySelector('#burialSiteTypeEdit--burialSiteTypeId').value = burialSiteTypeId.toString();
|
modalElement.querySelector('#burialSiteTypeEdit--burialSiteTypeId').value = burialSiteTypeId.toString();
|
||||||
modalElement.querySelector('#burialSiteTypeEdit--burialSiteType').value = burialSiteType.burialSiteType;
|
modalElement.querySelector('#burialSiteTypeEdit--burialSiteType').value = burialSiteType.burialSiteType;
|
||||||
|
modalElement.querySelector('#burialSiteTypeEdit--bodyCapacityMax').value = burialSiteType.bodyCapacityMax?.toString() ?? '';
|
||||||
|
modalElement.querySelector('#burialSiteTypeEdit--crematedCapacityMax').value = burialSiteType.crematedCapacityMax?.toString() ?? '';
|
||||||
},
|
},
|
||||||
onshown(modalElement, closeModalFunction) {
|
onshown(modalElement, closeModalFunction) {
|
||||||
editCloseModalFunction = closeModalFunction;
|
editCloseModalFunction = closeModalFunction;
|
||||||
|
|
@ -331,6 +333,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
<div class="level-item">
|
<div class="level-item">
|
||||||
<h2 class="title is-5 has-text-white">${cityssm.escapeHTML(burialSiteType.burialSiteType)}</h2>
|
<h2 class="title is-5 has-text-white">${cityssm.escapeHTML(burialSiteType.burialSiteType)}</h2>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="level-item">
|
||||||
|
<div class="tags">
|
||||||
|
${burialSiteType.bodyCapacityMax === null
|
||||||
|
? ''
|
||||||
|
: `<span class="tag is-info">
|
||||||
|
Bodies: ${cityssm.escapeHTML(burialSiteType.bodyCapacityMax.toString())}
|
||||||
|
</span>`}
|
||||||
|
${burialSiteType.crematedCapacityMax === null
|
||||||
|
? ''
|
||||||
|
: `<span class="tag is-info">
|
||||||
|
Cremains: ${cityssm.escapeHTML(burialSiteType.crematedCapacityMax.toString())}
|
||||||
|
</span>`}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="level-right is-hidden-print">
|
<div class="level-right is-hidden-print">
|
||||||
<div class="level-item">
|
<div class="level-item">
|
||||||
|
|
@ -390,7 +406,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: "Error Adding Burial Site Type",
|
title: 'Error Adding Burial Site Type',
|
||||||
message: responseJSON.errorMessage ?? '',
|
message: responseJSON.errorMessage ?? '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
});
|
});
|
||||||
|
|
@ -400,6 +416,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
cityssm.openHtmlModal('adminBurialSiteTypes-add', {
|
cityssm.openHtmlModal('adminBurialSiteTypes-add', {
|
||||||
onshow(modalElement) {
|
onshow(modalElement) {
|
||||||
sunrise.populateAliases(modalElement);
|
sunrise.populateAliases(modalElement);
|
||||||
|
modalElement.querySelector('#burialSiteTypeAdd--bodyCapacityMax').value = exports.bodyCapacityMaxDefault.toString();
|
||||||
|
modalElement.querySelector('#burialSiteTypeAdd--crematedCapacityMax').value = exports.crematedCapacityMaxDefault.toString();
|
||||||
},
|
},
|
||||||
onshown(modalElement, closeModalFunction) {
|
onshown(modalElement, closeModalFunction) {
|
||||||
addCloseModalFunction = closeModalFunction;
|
addCloseModalFunction = closeModalFunction;
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,14 @@ import type { Sunrise } from './types.js'
|
||||||
declare const cityssm: cityssmGlobal
|
declare const cityssm: cityssmGlobal
|
||||||
declare const bulmaJS: BulmaJS
|
declare const bulmaJS: BulmaJS
|
||||||
|
|
||||||
declare const exports: Record<string, unknown>
|
declare const exports: {
|
||||||
|
sunrise: Sunrise
|
||||||
|
|
||||||
|
burialSiteTypes?: BurialSiteType[]
|
||||||
|
|
||||||
|
bodyCapacityMaxDefault: number
|
||||||
|
crematedCapacityMaxDefault: number
|
||||||
|
}
|
||||||
|
|
||||||
type ResponseJSON =
|
type ResponseJSON =
|
||||||
| {
|
| {
|
||||||
|
|
@ -81,7 +88,7 @@ type ResponseJSON =
|
||||||
renderBurialSiteTypes()
|
renderBurialSiteTypes()
|
||||||
} else {
|
} else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: "Error Updating Burial Site Type",
|
title: 'Error Updating Burial Site Type',
|
||||||
message: responseJSON.errorMessage ?? '',
|
message: responseJSON.errorMessage ?? '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
})
|
})
|
||||||
|
|
@ -109,11 +116,11 @@ type ResponseJSON =
|
||||||
}
|
}
|
||||||
|
|
||||||
bulmaJS.confirm({
|
bulmaJS.confirm({
|
||||||
title: "Delete Burial Site Type",
|
title: 'Delete Burial Site Type',
|
||||||
message: "Are you sure you want to delete this burial site type?",
|
message: 'Are you sure you want to delete this burial site type?',
|
||||||
contextualColorName: 'warning',
|
contextualColorName: 'warning',
|
||||||
okButton: {
|
okButton: {
|
||||||
text: "Yes, Delete Burial Site Type",
|
text: 'Yes, Delete Burial Site Type',
|
||||||
callbackFunction: doDelete
|
callbackFunction: doDelete
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -165,6 +172,16 @@ type ResponseJSON =
|
||||||
'#burialSiteTypeEdit--burialSiteType'
|
'#burialSiteTypeEdit--burialSiteType'
|
||||||
) as HTMLInputElement
|
) as HTMLInputElement
|
||||||
).value = burialSiteType.burialSiteType
|
).value = burialSiteType.burialSiteType
|
||||||
|
;(
|
||||||
|
modalElement.querySelector(
|
||||||
|
'#burialSiteTypeEdit--bodyCapacityMax'
|
||||||
|
) as HTMLInputElement
|
||||||
|
).value = burialSiteType.bodyCapacityMax?.toString() ?? ''
|
||||||
|
;(
|
||||||
|
modalElement.querySelector(
|
||||||
|
'#burialSiteTypeEdit--crematedCapacityMax'
|
||||||
|
) as HTMLInputElement
|
||||||
|
).value = burialSiteType.crematedCapacityMax?.toString() ?? ''
|
||||||
},
|
},
|
||||||
onshown(modalElement, closeModalFunction) {
|
onshown(modalElement, closeModalFunction) {
|
||||||
editCloseModalFunction = closeModalFunction
|
editCloseModalFunction = closeModalFunction
|
||||||
|
|
@ -244,7 +261,7 @@ type ResponseJSON =
|
||||||
|
|
||||||
bulmaJS.toggleHtmlClipped()
|
bulmaJS.toggleHtmlClipped()
|
||||||
},
|
},
|
||||||
|
|
||||||
onremoved() {
|
onremoved() {
|
||||||
bulmaJS.toggleHtmlClipped()
|
bulmaJS.toggleHtmlClipped()
|
||||||
}
|
}
|
||||||
|
|
@ -363,8 +380,7 @@ type ResponseJSON =
|
||||||
function confirmDoDelete(): void {
|
function confirmDoDelete(): void {
|
||||||
bulmaJS.confirm({
|
bulmaJS.confirm({
|
||||||
title: 'Delete Field',
|
title: 'Delete Field',
|
||||||
message:
|
message: `Are you sure you want to delete this field?
|
||||||
`Are you sure you want to delete this field?
|
|
||||||
Note that historical records that make use of this field will not be affected.`,
|
Note that historical records that make use of this field will not be affected.`,
|
||||||
contextualColorName: 'warning',
|
contextualColorName: 'warning',
|
||||||
okButton: {
|
okButton: {
|
||||||
|
|
@ -603,6 +619,28 @@ type ResponseJSON =
|
||||||
<div class="level-item">
|
<div class="level-item">
|
||||||
<h2 class="title is-5 has-text-white">${cityssm.escapeHTML(burialSiteType.burialSiteType)}</h2>
|
<h2 class="title is-5 has-text-white">${cityssm.escapeHTML(burialSiteType.burialSiteType)}</h2>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="level-item">
|
||||||
|
<div class="tags">
|
||||||
|
${
|
||||||
|
burialSiteType.bodyCapacityMax === null
|
||||||
|
? ''
|
||||||
|
: `<span class="tag is-info">
|
||||||
|
Bodies: ${cityssm.escapeHTML(
|
||||||
|
burialSiteType.bodyCapacityMax.toString()
|
||||||
|
)}
|
||||||
|
</span>`
|
||||||
|
}
|
||||||
|
${
|
||||||
|
burialSiteType.crematedCapacityMax === null
|
||||||
|
? ''
|
||||||
|
: `<span class="tag is-info">
|
||||||
|
Cremains: ${cityssm.escapeHTML(
|
||||||
|
burialSiteType.crematedCapacityMax.toString()
|
||||||
|
)}
|
||||||
|
</span>`
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="level-right is-hidden-print">
|
<div class="level-right is-hidden-print">
|
||||||
<div class="level-item">
|
<div class="level-item">
|
||||||
|
|
@ -689,7 +727,7 @@ type ResponseJSON =
|
||||||
renderBurialSiteTypes()
|
renderBurialSiteTypes()
|
||||||
} else {
|
} else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: "Error Adding Burial Site Type",
|
title: 'Error Adding Burial Site Type',
|
||||||
message: responseJSON.errorMessage ?? '',
|
message: responseJSON.errorMessage ?? '',
|
||||||
contextualColorName: 'danger'
|
contextualColorName: 'danger'
|
||||||
})
|
})
|
||||||
|
|
@ -701,6 +739,16 @@ type ResponseJSON =
|
||||||
cityssm.openHtmlModal('adminBurialSiteTypes-add', {
|
cityssm.openHtmlModal('adminBurialSiteTypes-add', {
|
||||||
onshow(modalElement) {
|
onshow(modalElement) {
|
||||||
sunrise.populateAliases(modalElement)
|
sunrise.populateAliases(modalElement)
|
||||||
|
;(
|
||||||
|
modalElement.querySelector(
|
||||||
|
'#burialSiteTypeAdd--bodyCapacityMax'
|
||||||
|
) as HTMLInputElement
|
||||||
|
).value = exports.bodyCapacityMaxDefault.toString()
|
||||||
|
;(
|
||||||
|
modalElement.querySelector(
|
||||||
|
'#burialSiteTypeAdd--crematedCapacityMax'
|
||||||
|
) as HTMLInputElement
|
||||||
|
).value = exports.crematedCapacityMaxDefault.toString()
|
||||||
},
|
},
|
||||||
onshown(modalElement, closeModalFunction) {
|
onshown(modalElement, closeModalFunction) {
|
||||||
addCloseModalFunction = closeModalFunction
|
addCloseModalFunction = closeModalFunction
|
||||||
|
|
@ -714,7 +762,7 @@ type ResponseJSON =
|
||||||
|
|
||||||
bulmaJS.toggleHtmlClipped()
|
bulmaJS.toggleHtmlClipped()
|
||||||
},
|
},
|
||||||
|
|
||||||
onremoved() {
|
onremoved() {
|
||||||
bulmaJS.toggleHtmlClipped()
|
bulmaJS.toggleHtmlClipped()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -223,8 +223,9 @@ async function importFromMasterCSV() {
|
||||||
const deathDateString = masterRow.CM_DEATH_YR === ''
|
const deathDateString = masterRow.CM_DEATH_YR === ''
|
||||||
? ''
|
? ''
|
||||||
: formatDateString(masterRow.CM_DEATH_YR, masterRow.CM_DEATH_MON, masterRow.CM_DEATH_DAY);
|
: formatDateString(masterRow.CM_DEATH_YR, masterRow.CM_DEATH_MON, masterRow.CM_DEATH_DAY);
|
||||||
const intermentContainerTypeKey = contractType.contractType === 'Cremation' &&
|
const intermentContainerTypeKey = masterRow.CM_CONTAINER_TYPE === '' &&
|
||||||
masterRow.CM_CONTAINER_TYPE !== ''
|
(contractType.contractType === 'Cremation' ||
|
||||||
|
masterRow.CM_CREMATION === 'Y')
|
||||||
? 'U'
|
? 'U'
|
||||||
: masterRow.CM_CONTAINER_TYPE;
|
: masterRow.CM_CONTAINER_TYPE;
|
||||||
const intermentContainerTypeId = intermentContainerTypeKey === ''
|
const intermentContainerTypeId = intermentContainerTypeKey === ''
|
||||||
|
|
@ -623,7 +624,7 @@ async function importFromWorkOrderCSV() {
|
||||||
? ''
|
? ''
|
||||||
: getCommittalTypeIdByKey(workOrderRow.WO_COMMITTAL_TYPE, user);
|
: getCommittalTypeIdByKey(workOrderRow.WO_COMMITTAL_TYPE, user);
|
||||||
const intermentContainerTypeKey = contractType.contractType === 'Cremation' &&
|
const intermentContainerTypeKey = contractType.contractType === 'Cremation' &&
|
||||||
workOrderRow.WO_CONTAINER_TYPE !== ''
|
workOrderRow.WO_CONTAINER_TYPE === ''
|
||||||
? 'U'
|
? 'U'
|
||||||
: workOrderRow.WO_CONTAINER_TYPE;
|
: workOrderRow.WO_CONTAINER_TYPE;
|
||||||
const intermentContainerTypeId = intermentContainerTypeKey === ''
|
const intermentContainerTypeId = intermentContainerTypeKey === ''
|
||||||
|
|
|
||||||
|
|
@ -381,8 +381,9 @@ async function importFromMasterCSV(): Promise<void> {
|
||||||
)
|
)
|
||||||
|
|
||||||
const intermentContainerTypeKey =
|
const intermentContainerTypeKey =
|
||||||
contractType.contractType === 'Cremation' &&
|
masterRow.CM_CONTAINER_TYPE === '' &&
|
||||||
masterRow.CM_CONTAINER_TYPE !== ''
|
(contractType.contractType === 'Cremation' ||
|
||||||
|
masterRow.CM_CREMATION === 'Y')
|
||||||
? 'U'
|
? 'U'
|
||||||
: masterRow.CM_CONTAINER_TYPE
|
: masterRow.CM_CONTAINER_TYPE
|
||||||
|
|
||||||
|
|
@ -997,7 +998,7 @@ async function importFromWorkOrderCSV(): Promise<void> {
|
||||||
|
|
||||||
const intermentContainerTypeKey =
|
const intermentContainerTypeKey =
|
||||||
contractType.contractType === 'Cremation' &&
|
contractType.contractType === 'Cremation' &&
|
||||||
workOrderRow.WO_CONTAINER_TYPE !== ''
|
workOrderRow.WO_CONTAINER_TYPE === ''
|
||||||
? 'U'
|
? 'U'
|
||||||
: workOrderRow.WO_CONTAINER_TYPE
|
: workOrderRow.WO_CONTAINER_TYPE
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,10 @@ export interface Config {
|
||||||
cemeteries: {
|
cemeteries: {
|
||||||
refreshImageChanges?: boolean;
|
refreshImageChanges?: boolean;
|
||||||
};
|
};
|
||||||
|
burialSiteTypes: {
|
||||||
|
bodyCapacityMaxDefault?: number;
|
||||||
|
crematedCapacityMaxDefault?: number;
|
||||||
|
};
|
||||||
burialSites: {
|
burialSites: {
|
||||||
burialSiteNameSegments?: ConfigBurialSiteNameSegments;
|
burialSiteNameSegments?: ConfigBurialSiteNameSegments;
|
||||||
refreshImageChanges?: boolean;
|
refreshImageChanges?: boolean;
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,11 @@ export interface Config {
|
||||||
refreshImageChanges?: boolean
|
refreshImageChanges?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
burialSiteTypes: {
|
||||||
|
bodyCapacityMaxDefault?: number
|
||||||
|
crematedCapacityMaxDefault?: number
|
||||||
|
}
|
||||||
|
|
||||||
burialSites: {
|
burialSites: {
|
||||||
burialSiteNameSegments?: ConfigBurialSiteNameSegments
|
burialSiteNameSegments?: ConfigBurialSiteNameSegments
|
||||||
refreshImageChanges?: boolean
|
refreshImageChanges?: boolean
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,10 @@ export interface BurialSite extends Record {
|
||||||
burialSiteNameSegment5?: string;
|
burialSiteNameSegment5?: string;
|
||||||
burialSiteType?: string;
|
burialSiteType?: string;
|
||||||
burialSiteTypeId?: number;
|
burialSiteTypeId?: number;
|
||||||
|
bodyCapacity: number | null;
|
||||||
|
bodyCapacityMax?: number | null;
|
||||||
|
crematedCapacity: number | null;
|
||||||
|
crematedCapacityMax?: number | null;
|
||||||
cemetery?: Cemetery;
|
cemetery?: Cemetery;
|
||||||
cemeteryId?: number | null;
|
cemeteryId?: number | null;
|
||||||
cemeteryName?: string;
|
cemeteryName?: string;
|
||||||
|
|
@ -49,6 +53,8 @@ export interface BurialSiteStatus extends Record {
|
||||||
export interface BurialSiteType extends Record {
|
export interface BurialSiteType extends Record {
|
||||||
burialSiteTypeId: number;
|
burialSiteTypeId: number;
|
||||||
burialSiteType: string;
|
burialSiteType: string;
|
||||||
|
bodyCapacityMax: number | null;
|
||||||
|
crematedCapacityMax: number | null;
|
||||||
burialSiteTypeFields?: BurialSiteTypeField[];
|
burialSiteTypeFields?: BurialSiteTypeField[];
|
||||||
orderNumber?: number;
|
orderNumber?: number;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,11 @@ export interface BurialSite extends Record {
|
||||||
burialSiteType?: string
|
burialSiteType?: string
|
||||||
burialSiteTypeId?: number
|
burialSiteTypeId?: number
|
||||||
|
|
||||||
|
bodyCapacity: number | null
|
||||||
|
bodyCapacityMax?: number | null
|
||||||
|
crematedCapacity: number | null
|
||||||
|
crematedCapacityMax?: number | null
|
||||||
|
|
||||||
cemetery?: Cemetery
|
cemetery?: Cemetery
|
||||||
cemeteryId?: number | null
|
cemeteryId?: number | null
|
||||||
cemeteryName?: string
|
cemeteryName?: string
|
||||||
|
|
@ -70,6 +75,10 @@ export interface BurialSiteType extends Record {
|
||||||
burialSiteTypeId: number
|
burialSiteTypeId: number
|
||||||
|
|
||||||
burialSiteType: string
|
burialSiteType: string
|
||||||
|
|
||||||
|
bodyCapacityMax: number | null
|
||||||
|
crematedCapacityMax: number | null
|
||||||
|
|
||||||
burialSiteTypeFields?: BurialSiteTypeField[]
|
burialSiteTypeFields?: BurialSiteTypeField[]
|
||||||
orderNumber?: number
|
orderNumber?: number
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,8 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
exports.burialSiteTypes = <%- JSON.stringify(burialSiteTypes) %>;
|
exports.burialSiteTypes = <%- JSON.stringify(burialSiteTypes) %>;
|
||||||
|
exports.bodyCapacityMaxDefault = <%- JSON.stringify(configFunctions.getConfigProperty('settings.burialSiteTypes.bodyCapacityMaxDefault')) %>
|
||||||
|
exports.crematedCapacityMaxDefault = <%- JSON.stringify(configFunctions.getConfigProperty('settings.burialSiteTypes.crematedCapacityMaxDefault')) %>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script src="<%= urlPrefix %>/javascripts/burialSiteTypes.admin.js"></script>
|
<script src="<%= urlPrefix %>/javascripts/burialSiteTypes.admin.js"></script>
|
||||||
|
|
|
||||||
|
|
@ -195,7 +195,11 @@
|
||||||
<% } %>
|
<% } %>
|
||||||
id="burialSite--burialSiteTypeId" name="burialSiteTypeId" required>
|
id="burialSite--burialSiteTypeId" name="burialSiteTypeId" required>
|
||||||
<% if (isCreate) { %>
|
<% if (isCreate) { %>
|
||||||
<option value="">(Select a Type)</option>
|
<option value=""
|
||||||
|
data-body-capacity-max="<%= configFunctions.getConfigProperty('settings.burialSiteTypes.bodyCapacityMaxDefault') %>"
|
||||||
|
data-cremated-capacity-max="<%= configFunctions.getConfigProperty('settings.burialSiteTypes.crematedCapacityMaxDefault') %>">
|
||||||
|
(Select a Type)
|
||||||
|
</option>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% let typeIsFound = false; %>
|
<% let typeIsFound = false; %>
|
||||||
<% for (const burialSiteType of burialSiteTypes) { %>
|
<% for (const burialSiteType of burialSiteTypes) { %>
|
||||||
|
|
@ -205,13 +209,18 @@
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
<option value="<%= burialSiteType.burialSiteTypeId %>"
|
<option value="<%= burialSiteType.burialSiteTypeId %>"
|
||||||
|
data-body-capacity-max="<%= burialSiteType.bodyCapacityMax %>"
|
||||||
|
data-cremated-capacity-max="<%= burialSiteType.crematedCapacityMax %>"
|
||||||
<%= (burialSite.burialSiteTypeId === burialSiteType.burialSiteTypeId ? " selected" : "") %>
|
<%= (burialSite.burialSiteTypeId === burialSiteType.burialSiteTypeId ? " selected" : "") %>
|
||||||
<%= (!isCreate && burialSite.burialSiteTypeId !== burialSiteType.burialSiteTypeId ? " disabled" : "") %>>
|
<%= (!isCreate && burialSite.burialSiteTypeId !== burialSiteType.burialSiteTypeId ? " disabled" : "") %>>
|
||||||
<%= burialSiteType.burialSiteType %>
|
<%= burialSiteType.burialSiteType %>
|
||||||
</option>
|
</option>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% if (burialSite.burialSiteTypeId && !typeIsFound) { %>
|
<% if (burialSite.burialSiteTypeId && !typeIsFound) { %>
|
||||||
<option value="<%= burialSite.burialSiteTypeId %>" selected>
|
<option value="<%= burialSite.burialSiteTypeId %>"
|
||||||
|
data-body-capacity-max="<%= burialSite.bodyCapacityMax %>"
|
||||||
|
data-cremated-capacity-max="<%= burialSite.crematedCapacityMax %>"
|
||||||
|
selected>
|
||||||
<%= burialSite.burialSiteType %>
|
<%= burialSite.burialSiteType %>
|
||||||
</option>
|
</option>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
@ -224,6 +233,38 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="columns">
|
||||||
|
<div class="column">
|
||||||
|
<div class="field">
|
||||||
|
<label class="label" for="burialSite--bodyCapacity">Body Capacity</label>
|
||||||
|
<div class="control">
|
||||||
|
<input class="input has-text-right"
|
||||||
|
id="burialSite--bodyCapacity" name="bodyCapacity" type="number"
|
||||||
|
min="0"
|
||||||
|
max="<%= burialSite.bodyCapacityMax ?? configFunctions.getConfigProperty('settings.burialSiteTypes.bodyCapacityMaxDefault') %>"
|
||||||
|
step="1"
|
||||||
|
placeholder="<%= burialSite.bodyCapacityMax ?? configFunctions.getConfigProperty('settings.burialSiteTypes.bodyCapacityMaxDefault') %>"
|
||||||
|
value="<%= burialSite.bodyCapacity %>"
|
||||||
|
onwheel="return false" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="column">
|
||||||
|
<div class="field">
|
||||||
|
<label class="label" for="burialSite--crematedCapacity">Cremated Capacity</label>
|
||||||
|
<div class="control">
|
||||||
|
<input class="input has-text-right"
|
||||||
|
id="burialSite--crematedCapacity" name="crematedCapacity" type="number"
|
||||||
|
min="0"
|
||||||
|
max="<%= burialSite.crematedCapacityMax ?? configFunctions.getConfigProperty('settings.burialSiteTypes.crematedCapacityMaxDefault') %>"
|
||||||
|
step="1"
|
||||||
|
placeholder="<%= burialSite.crematedCapacityMax ?? configFunctions.getConfigProperty('settings.burialSiteTypes.crematedCapacityMaxDefault') %>"
|
||||||
|
value="<%= burialSite.crematedCapacity %>"
|
||||||
|
onwheel="return false" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<label class="label" for="burialSite--burialSiteStatusId">
|
<label class="label" for="burialSite--burialSiteStatusId">
|
||||||
Burial Site Status
|
Burial Site Status
|
||||||
</label>
|
</label>
|
||||||
|
|
@ -581,10 +622,14 @@
|
||||||
|
|
||||||
<%- include('_footerA'); -%>
|
<%- include('_footerA'); -%>
|
||||||
|
|
||||||
<% if (!isCreate) { %>
|
|
||||||
<script>
|
<script>
|
||||||
exports.burialSiteComments = <%- JSON.stringify(burialSite.burialSiteComments) %>;
|
exports.bodyCapacityMaxDefault = <%- JSON.stringify(configFunctions.getConfigProperty('settings.burialSiteTypes.bodyCapacityMaxDefault')) %>;
|
||||||
|
exports.crematedCapacityMaxDefault = <%- JSON.stringify(configFunctions.getConfigProperty('settings.burialSiteTypes.crematedCapacityMaxDefault')) %>;
|
||||||
</script>
|
</script>
|
||||||
|
<% if (!isCreate) { %>
|
||||||
|
<script>
|
||||||
|
exports.burialSiteComments = <%- JSON.stringify(burialSite.burialSiteComments) %>;
|
||||||
|
</script>
|
||||||
<% } %>
|
<% } %>
|
||||||
<script src="<%= urlPrefix %>/javascripts/burialSite.edit.js"></script>
|
<script src="<%= urlPrefix %>/javascripts/burialSite.edit.js"></script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue