major refactoring
parent
547c2e224f
commit
27e606d9f1
|
|
@ -0,0 +1,3 @@
|
||||||
|
export declare function moveContractTypePrintDown(contractTypeId: number | string, printEJS: string): Promise<boolean>;
|
||||||
|
export declare function moveContractTypePrintDownToBottom(contractTypeId: number | string, printEJS: string): Promise<boolean>;
|
||||||
|
export default moveContractTypePrintDown;
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { clearCacheByTableName } from '../helpers/functions.cache.js';
|
import { clearCacheByTableName } from '../helpers/functions.cache.js';
|
||||||
import { acquireConnection } from './pool.js';
|
import { acquireConnection } from './pool.js';
|
||||||
export async function moveOccupancyTypePrintDown(contractTypeId, printEJS) {
|
export async function moveContractTypePrintDown(contractTypeId, printEJS) {
|
||||||
const database = await acquireConnection();
|
const database = await acquireConnection();
|
||||||
const currentOrderNumber = database
|
const currentOrderNumber = database
|
||||||
.prepare('select orderNumber from ContractTypePrints where contractTypeId = ? and printEJS = ?')
|
.prepare('select orderNumber from ContractTypePrints where contractTypeId = ? and printEJS = ?')
|
||||||
|
|
@ -19,7 +19,7 @@ export async function moveOccupancyTypePrintDown(contractTypeId, printEJS) {
|
||||||
clearCacheByTableName('ContractTypePrints');
|
clearCacheByTableName('ContractTypePrints');
|
||||||
return result.changes > 0;
|
return result.changes > 0;
|
||||||
}
|
}
|
||||||
export async function moveOccupancyTypePrintDownToBottom(contractTypeId, printEJS) {
|
export async function moveContractTypePrintDownToBottom(contractTypeId, printEJS) {
|
||||||
const database = await acquireConnection();
|
const database = await acquireConnection();
|
||||||
const currentOrderNumber = database
|
const currentOrderNumber = database
|
||||||
.prepare('select orderNumber from ContractTypePrints where contractTypeId = ? and printEJS = ?')
|
.prepare('select orderNumber from ContractTypePrints where contractTypeId = ? and printEJS = ?')
|
||||||
|
|
@ -38,7 +38,7 @@ export async function moveOccupancyTypePrintDownToBottom(contractTypeId, printEJ
|
||||||
and printEJS = ?`)
|
and printEJS = ?`)
|
||||||
.run(maxOrderNumber, contractTypeId, printEJS);
|
.run(maxOrderNumber, contractTypeId, printEJS);
|
||||||
database
|
database
|
||||||
.prepare(`update ContractTypeFields
|
.prepare(`update ContractTypePrints
|
||||||
set orderNumber = orderNumber - 1
|
set orderNumber = orderNumber - 1
|
||||||
where recordDelete_timeMillis is null
|
where recordDelete_timeMillis is null
|
||||||
and contractTypeId = ?
|
and contractTypeId = ?
|
||||||
|
|
@ -49,4 +49,4 @@ export async function moveOccupancyTypePrintDownToBottom(contractTypeId, printEJ
|
||||||
clearCacheByTableName('ContractTypePrints');
|
clearCacheByTableName('ContractTypePrints');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
export default moveOccupancyTypePrintDown;
|
export default moveContractTypePrintDown;
|
||||||
|
|
@ -2,7 +2,7 @@ import { clearCacheByTableName } from '../helpers/functions.cache.js'
|
||||||
|
|
||||||
import { acquireConnection } from './pool.js'
|
import { acquireConnection } from './pool.js'
|
||||||
|
|
||||||
export async function moveOccupancyTypePrintDown(
|
export async function moveContractTypePrintDown(
|
||||||
contractTypeId: number | string,
|
contractTypeId: number | string,
|
||||||
printEJS: string
|
printEJS: string
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
|
|
@ -39,7 +39,7 @@ export async function moveOccupancyTypePrintDown(
|
||||||
return result.changes > 0
|
return result.changes > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function moveOccupancyTypePrintDownToBottom(
|
export async function moveContractTypePrintDownToBottom(
|
||||||
contractTypeId: number | string,
|
contractTypeId: number | string,
|
||||||
printEJS: string
|
printEJS: string
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
|
|
@ -76,7 +76,7 @@ export async function moveOccupancyTypePrintDownToBottom(
|
||||||
|
|
||||||
database
|
database
|
||||||
.prepare(
|
.prepare(
|
||||||
`update ContractTypeFields
|
`update ContractTypePrints
|
||||||
set orderNumber = orderNumber - 1
|
set orderNumber = orderNumber - 1
|
||||||
where recordDelete_timeMillis is null
|
where recordDelete_timeMillis is null
|
||||||
and contractTypeId = ?
|
and contractTypeId = ?
|
||||||
|
|
@ -92,4 +92,4 @@ export async function moveOccupancyTypePrintDownToBottom(
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
export default moveOccupancyTypePrintDown
|
export default moveContractTypePrintDown
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
export declare function moveContractTypePrintUp(contractTypeId: number | string, printEJS: string): Promise<boolean>;
|
||||||
|
export declare function moveContractTypePrintUpToTop(contractTypeId: number | string, printEJS: string): Promise<boolean>;
|
||||||
|
export default moveContractTypePrintUp;
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { clearCacheByTableName } from '../helpers/functions.cache.js';
|
import { clearCacheByTableName } from '../helpers/functions.cache.js';
|
||||||
import { acquireConnection } from './pool.js';
|
import { acquireConnection } from './pool.js';
|
||||||
export async function moveOccupancyTypePrintUp(contractTypeId, printEJS) {
|
export async function moveContractTypePrintUp(contractTypeId, printEJS) {
|
||||||
const database = await acquireConnection();
|
const database = await acquireConnection();
|
||||||
const currentOrderNumber = database
|
const currentOrderNumber = database
|
||||||
.prepare('select orderNumber from ContractTypePrints where contractTypeId = ? and printEJS = ?')
|
.prepare('select orderNumber from ContractTypePrints where contractTypeId = ? and printEJS = ?')
|
||||||
|
|
@ -23,7 +23,7 @@ export async function moveOccupancyTypePrintUp(contractTypeId, printEJS) {
|
||||||
clearCacheByTableName('ContractTypePrints');
|
clearCacheByTableName('ContractTypePrints');
|
||||||
return result.changes > 0;
|
return result.changes > 0;
|
||||||
}
|
}
|
||||||
export async function moveOccupancyTypePrintUpToTop(contractTypeId, printEJS) {
|
export async function moveContractTypePrintUpToTop(contractTypeId, printEJS) {
|
||||||
const database = await acquireConnection();
|
const database = await acquireConnection();
|
||||||
const currentOrderNumber = database
|
const currentOrderNumber = database
|
||||||
.prepare('select orderNumber from ContractTypePrints where contractTypeId = ? and printEJS = ?')
|
.prepare('select orderNumber from ContractTypePrints where contractTypeId = ? and printEJS = ?')
|
||||||
|
|
@ -47,4 +47,4 @@ export async function moveOccupancyTypePrintUpToTop(contractTypeId, printEJS) {
|
||||||
clearCacheByTableName('ContractTypePrints');
|
clearCacheByTableName('ContractTypePrints');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
export default moveOccupancyTypePrintUp;
|
export default moveContractTypePrintUp;
|
||||||
|
|
@ -2,7 +2,7 @@ import { clearCacheByTableName } from '../helpers/functions.cache.js'
|
||||||
|
|
||||||
import { acquireConnection } from './pool.js'
|
import { acquireConnection } from './pool.js'
|
||||||
|
|
||||||
export async function moveOccupancyTypePrintUp(
|
export async function moveContractTypePrintUp(
|
||||||
contractTypeId: number | string,
|
contractTypeId: number | string,
|
||||||
printEJS: string
|
printEJS: string
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
|
|
@ -44,7 +44,7 @@ export async function moveOccupancyTypePrintUp(
|
||||||
return result.changes > 0
|
return result.changes > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function moveOccupancyTypePrintUpToTop(
|
export async function moveContractTypePrintUpToTop(
|
||||||
contractTypeId: number | string,
|
contractTypeId: number | string,
|
||||||
printEJS: string
|
printEJS: string
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
|
|
@ -86,4 +86,4 @@ export async function moveOccupancyTypePrintUpToTop(
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
export default moveOccupancyTypePrintUp
|
export default moveContractTypePrintUp
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
export declare function moveOccupancyTypePrintDown(contractTypeId: number | string, printEJS: string): Promise<boolean>;
|
|
||||||
export declare function moveOccupancyTypePrintDownToBottom(contractTypeId: number | string, printEJS: string): Promise<boolean>;
|
|
||||||
export default moveOccupancyTypePrintDown;
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
export declare function moveOccupancyTypePrintUp(contractTypeId: number | string, printEJS: string): Promise<boolean>;
|
|
||||||
export declare function moveOccupancyTypePrintUpToTop(contractTypeId: number | string, printEJS: string): Promise<boolean>;
|
|
||||||
export default moveOccupancyTypePrintUp;
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
import { getBurialSiteTypes } from '../../helpers/functions.cache.js';
|
import { getBurialSiteTypes } from '../../helpers/functions.cache.js';
|
||||||
import { getConfigProperty } from '../../helpers/config.helpers.js';
|
|
||||||
export default async function handler(_request, response) {
|
export default async function handler(_request, response) {
|
||||||
const lotTypes = await getBurialSiteTypes();
|
const lotTypes = await getBurialSiteTypes();
|
||||||
response.render('admin-lotTypes', {
|
response.render('admin-burialSiteTypes', {
|
||||||
headTitle: `${getConfigProperty('aliases.lot')} Type Management`,
|
headTitle: `Burial Site Type Management`,
|
||||||
lotTypes
|
lotTypes
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import { getBurialSiteTypes } from '../../helpers/functions.cache.js'
|
import { getBurialSiteTypes } from '../../helpers/functions.cache.js'
|
||||||
import { getConfigProperty } from '../../helpers/config.helpers.js'
|
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
_request: Request,
|
_request: Request,
|
||||||
|
|
@ -9,8 +8,8 @@ export default async function handler(
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const lotTypes = await getBurialSiteTypes()
|
const lotTypes = await getBurialSiteTypes()
|
||||||
|
|
||||||
response.render('admin-lotTypes', {
|
response.render('admin-burialSiteTypes', {
|
||||||
headTitle: `${getConfigProperty('aliases.lot')} Type Management`,
|
headTitle: `Burial Site Type Management`,
|
||||||
lotTypes
|
lotTypes
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,20 @@
|
||||||
import { getAllContractTypeFields, getContractTypes } from '../../helpers/functions.cache.js';
|
|
||||||
import { getConfigProperty } from '../../helpers/config.helpers.js';
|
import { getConfigProperty } from '../../helpers/config.helpers.js';
|
||||||
|
import { getAllContractTypeFields, getContractTypes } from '../../helpers/functions.cache.js';
|
||||||
import { getPrintConfig } from '../../helpers/functions.print.js';
|
import { getPrintConfig } from '../../helpers/functions.print.js';
|
||||||
export default async function handler(_request, response) {
|
export default async function handler(_request, response) {
|
||||||
const occupancyTypes = await getContractTypes();
|
const contractTypes = await getContractTypes();
|
||||||
const allContractTypeFields = await getAllContractTypeFields();
|
const allContractTypeFields = await getAllContractTypeFields();
|
||||||
const ContractTypePrints = getConfigProperty('settings.lotOccupancy.prints');
|
const contractTypePrints = getConfigProperty('settings.contracts.prints');
|
||||||
const occupancyTypePrintTitles = {};
|
const occupancyTypePrintTitles = {};
|
||||||
for (const printEJS of ContractTypePrints) {
|
for (const printEJS of contractTypePrints) {
|
||||||
const printConfig = getPrintConfig(printEJS);
|
const printConfig = getPrintConfig(printEJS);
|
||||||
if (printConfig !== undefined) {
|
if (printConfig !== undefined) {
|
||||||
occupancyTypePrintTitles[printEJS] = printConfig.title;
|
occupancyTypePrintTitles[printEJS] = printConfig.title;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
response.render('admin-occupancyTypes', {
|
response.render('admin-contractTypes', {
|
||||||
headTitle: `${getConfigProperty('aliases.occupancy')} Type Management`,
|
headTitle: `Contract Type Management`,
|
||||||
occupancyTypes,
|
occupancyTypes: contractTypes,
|
||||||
allContractTypeFields,
|
allContractTypeFields,
|
||||||
occupancyTypePrintTitles
|
occupancyTypePrintTitles
|
||||||
});
|
});
|
||||||
|
|
@ -1,24 +1,24 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
|
import { getConfigProperty } from '../../helpers/config.helpers.js'
|
||||||
import {
|
import {
|
||||||
getAllContractTypeFields,
|
getAllContractTypeFields,
|
||||||
getContractTypes
|
getContractTypes
|
||||||
} from '../../helpers/functions.cache.js'
|
} from '../../helpers/functions.cache.js'
|
||||||
import { getConfigProperty } from '../../helpers/config.helpers.js'
|
|
||||||
import { getPrintConfig } from '../../helpers/functions.print.js'
|
import { getPrintConfig } from '../../helpers/functions.print.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
_request: Request,
|
_request: Request,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const occupancyTypes = await getContractTypes()
|
const contractTypes = await getContractTypes()
|
||||||
const allContractTypeFields = await getAllContractTypeFields()
|
const allContractTypeFields = await getAllContractTypeFields()
|
||||||
|
|
||||||
const ContractTypePrints = getConfigProperty('settings.lotOccupancy.prints')
|
const contractTypePrints = getConfigProperty('settings.contracts.prints')
|
||||||
|
|
||||||
const occupancyTypePrintTitles = {}
|
const occupancyTypePrintTitles = {}
|
||||||
|
|
||||||
for (const printEJS of ContractTypePrints) {
|
for (const printEJS of contractTypePrints) {
|
||||||
const printConfig = getPrintConfig(printEJS)
|
const printConfig = getPrintConfig(printEJS)
|
||||||
|
|
||||||
if (printConfig !== undefined) {
|
if (printConfig !== undefined) {
|
||||||
|
|
@ -26,9 +26,9 @@ export default async function handler(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
response.render('admin-occupancyTypes', {
|
response.render('admin-contractTypes', {
|
||||||
headTitle: `${getConfigProperty('aliases.occupancy')} Type Management`,
|
headTitle: `Contract Type Management`,
|
||||||
occupancyTypes,
|
occupancyTypes: contractTypes,
|
||||||
allContractTypeFields,
|
allContractTypeFields,
|
||||||
occupancyTypePrintTitles
|
occupancyTypePrintTitles
|
||||||
})
|
})
|
||||||
|
|
@ -4,12 +4,12 @@ export default async function handler(_request, response) {
|
||||||
const feeCategories = await getFeeCategories({}, {
|
const feeCategories = await getFeeCategories({}, {
|
||||||
includeFees: true
|
includeFees: true
|
||||||
});
|
});
|
||||||
const occupancyTypes = await getContractTypes();
|
const contractTypes = await getContractTypes();
|
||||||
const lotTypes = await getBurialSiteTypes();
|
const burialSiteTypes = await getBurialSiteTypes();
|
||||||
response.render('admin-fees', {
|
response.render('admin-fees', {
|
||||||
headTitle: 'Fee Management',
|
headTitle: 'Fee Management',
|
||||||
feeCategories,
|
feeCategories,
|
||||||
occupancyTypes,
|
contractTypes,
|
||||||
lotTypes
|
burialSiteTypes
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,13 +17,13 @@ export default async function handler(
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
const occupancyTypes = await getContractTypes()
|
const contractTypes = await getContractTypes()
|
||||||
const lotTypes = await getBurialSiteTypes()
|
const burialSiteTypes = await getBurialSiteTypes()
|
||||||
|
|
||||||
response.render('admin-fees', {
|
response.render('admin-fees', {
|
||||||
headTitle: 'Fee Management',
|
headTitle: 'Fee Management',
|
||||||
feeCategories,
|
feeCategories,
|
||||||
occupancyTypes,
|
contractTypes,
|
||||||
lotTypes
|
burialSiteTypes
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,15 @@
|
||||||
import { getSolidIconClasses } from '@cityssm/font-awesome-v5-iconclasses';
|
import { getSolidIconClasses } from '@cityssm/font-awesome-v5-iconclasses';
|
||||||
import { getLotOccupantTypes, getLotStatuses, getWorkOrderMilestoneTypes, getWorkOrderTypes } from '../../helpers/functions.cache.js';
|
import { getBurialSiteStatuses, getWorkOrderMilestoneTypes, getWorkOrderTypes } from '../../helpers/functions.cache.js';
|
||||||
export default async function handler(_request, response) {
|
export default async function handler(_request, response) {
|
||||||
const workOrderTypes = await getWorkOrderTypes();
|
const workOrderTypes = await getWorkOrderTypes();
|
||||||
const workOrderMilestoneTypes = await getWorkOrderMilestoneTypes();
|
const workOrderMilestoneTypes = await getWorkOrderMilestoneTypes();
|
||||||
const lotStatuses = await getLotStatuses();
|
const burialSiteStatuses = await getBurialSiteStatuses();
|
||||||
const lotOccupantTypes = await getLotOccupantTypes();
|
|
||||||
const fontAwesomeIconClasses = await getSolidIconClasses();
|
const fontAwesomeIconClasses = await getSolidIconClasses();
|
||||||
response.render('admin-tables', {
|
response.render('admin-tables', {
|
||||||
headTitle: 'Config Table Management',
|
headTitle: 'Config Table Management',
|
||||||
workOrderTypes,
|
workOrderTypes,
|
||||||
workOrderMilestoneTypes,
|
workOrderMilestoneTypes,
|
||||||
lotStatuses,
|
burialSiteStatuses,
|
||||||
lotOccupantTypes,
|
|
||||||
fontAwesomeIconClasses
|
fontAwesomeIconClasses
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,7 @@ import { getSolidIconClasses } from '@cityssm/font-awesome-v5-iconclasses'
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getLotOccupantTypes,
|
getBurialSiteStatuses,
|
||||||
getLotStatuses,
|
|
||||||
getWorkOrderMilestoneTypes,
|
getWorkOrderMilestoneTypes,
|
||||||
getWorkOrderTypes
|
getWorkOrderTypes
|
||||||
} from '../../helpers/functions.cache.js'
|
} from '../../helpers/functions.cache.js'
|
||||||
|
|
@ -14,8 +13,7 @@ export default async function handler(
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const workOrderTypes = await getWorkOrderTypes()
|
const workOrderTypes = await getWorkOrderTypes()
|
||||||
const workOrderMilestoneTypes = await getWorkOrderMilestoneTypes()
|
const workOrderMilestoneTypes = await getWorkOrderMilestoneTypes()
|
||||||
const lotStatuses = await getLotStatuses()
|
const burialSiteStatuses = await getBurialSiteStatuses()
|
||||||
const lotOccupantTypes = await getLotOccupantTypes()
|
|
||||||
|
|
||||||
const fontAwesomeIconClasses = await getSolidIconClasses()
|
const fontAwesomeIconClasses = await getSolidIconClasses()
|
||||||
|
|
||||||
|
|
@ -23,8 +21,7 @@ export default async function handler(
|
||||||
headTitle: 'Config Table Management',
|
headTitle: 'Config Table Management',
|
||||||
workOrderTypes,
|
workOrderTypes,
|
||||||
workOrderMilestoneTypes,
|
workOrderMilestoneTypes,
|
||||||
lotStatuses,
|
burialSiteStatuses,
|
||||||
lotOccupantTypes,
|
|
||||||
fontAwesomeIconClasses
|
fontAwesomeIconClasses
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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, {
|
||||||
lotOccupantTypeId: string;
|
burialSiteStatus: string;
|
||||||
moveToEnd: '0' | '1';
|
orderNumber?: string | number;
|
||||||
}>, response: Response): Promise<void>;
|
}>, response: Response): Promise<void>;
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
import addRecord from '../../database/addRecord.js';
|
||||||
|
import { getBurialSiteStatuses } from '../../helpers/functions.cache.js';
|
||||||
|
export default async function handler(request, response) {
|
||||||
|
const burialSiteStatusId = await addRecord('BurialSiteStatuses', request.body.burialSiteStatus, request.body.orderNumber ?? -1, request.session.user);
|
||||||
|
const burialSiteStatuses = await getBurialSiteStatuses();
|
||||||
|
response.json({
|
||||||
|
success: true,
|
||||||
|
burialSiteStatusId,
|
||||||
|
burialSiteStatuses
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
|
import addRecord from '../../database/addRecord.js'
|
||||||
|
import { getBurialSiteStatuses } from '../../helpers/functions.cache.js'
|
||||||
|
|
||||||
|
export default async function handler(
|
||||||
|
request: Request<
|
||||||
|
unknown,
|
||||||
|
unknown,
|
||||||
|
{ burialSiteStatus: string; orderNumber?: string | number }
|
||||||
|
>,
|
||||||
|
response: Response
|
||||||
|
): Promise<void> {
|
||||||
|
const burialSiteStatusId = await addRecord(
|
||||||
|
'BurialSiteStatuses',
|
||||||
|
request.body.burialSiteStatus,
|
||||||
|
request.body.orderNumber ?? -1,
|
||||||
|
request.session.user as User
|
||||||
|
)
|
||||||
|
|
||||||
|
const burialSiteStatuses = await getBurialSiteStatuses()
|
||||||
|
|
||||||
|
response.json({
|
||||||
|
success: true,
|
||||||
|
burialSiteStatusId,
|
||||||
|
burialSiteStatuses
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -1,4 +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, {
|
||||||
lotOccupantTypeId: string;
|
lotType: string;
|
||||||
|
orderNumber?: string | number;
|
||||||
}>, response: Response): Promise<void>;
|
}>, response: Response): Promise<void>;
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
import addRecord from '../../database/addRecord.js';
|
||||||
|
import { getBurialSiteTypes } from '../../helpers/functions.cache.js';
|
||||||
|
export default async function handler(request, response) {
|
||||||
|
const burialSiteTypeId = await addRecord('BurialSiteTypes', request.body.lotType, request.body.orderNumber ?? -1, request.session.user);
|
||||||
|
const burialSiteTypes = await getBurialSiteTypes();
|
||||||
|
response.json({
|
||||||
|
success: true,
|
||||||
|
burialSiteTypeId,
|
||||||
|
burialSiteTypes
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -1,24 +1,28 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import { addRecord } from '../../database/addRecord.js'
|
import addRecord from '../../database/addRecord.js'
|
||||||
import { getBurialSiteTypes } from '../../helpers/functions.cache.js'
|
import { getBurialSiteTypes } from '../../helpers/functions.cache.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request<
|
||||||
|
unknown,
|
||||||
|
unknown,
|
||||||
|
{ lotType: string; orderNumber?: string | number }
|
||||||
|
>,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const burialSiteTypeId = await addRecord(
|
const burialSiteTypeId = await addRecord(
|
||||||
'LotTypes',
|
'BurialSiteTypes',
|
||||||
request.body.lotType,
|
request.body.lotType,
|
||||||
request.body.orderNumber ?? -1,
|
request.body.orderNumber ?? -1,
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
const lotTypes = await getBurialSiteTypes()
|
const burialSiteTypes = await getBurialSiteTypes()
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
success: true,
|
success: true,
|
||||||
burialSiteTypeId,
|
burialSiteTypeId,
|
||||||
lotTypes
|
burialSiteTypes
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
import type { Request, Response } from 'express';
|
||||||
|
import { type AddBurialSiteTypeFieldForm } from '../../database/addBurialSiteTypeField.js';
|
||||||
|
export default function handler(request: Request<unknown, unknown, AddBurialSiteTypeFieldForm>, response: Response): Promise<void>;
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
import addBurialSiteTypeField from '../../database/addBurialSiteTypeField.js';
|
||||||
|
import { getBurialSiteTypes } from '../../helpers/functions.cache.js';
|
||||||
|
export default async function handler(request, response) {
|
||||||
|
const burialSiteTypeFieldId = await addBurialSiteTypeField(request.body, request.session.user);
|
||||||
|
const burialSiteTypes = await getBurialSiteTypes();
|
||||||
|
response.json({
|
||||||
|
success: true,
|
||||||
|
burialSiteTypeFieldId,
|
||||||
|
burialSiteTypes
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
|
import addBurialSiteTypeField, {
|
||||||
|
type AddBurialSiteTypeFieldForm
|
||||||
|
} from '../../database/addBurialSiteTypeField.js'
|
||||||
|
import { getBurialSiteTypes } from '../../helpers/functions.cache.js'
|
||||||
|
|
||||||
|
export default async function handler(
|
||||||
|
request: Request<unknown, unknown, AddBurialSiteTypeFieldForm>,
|
||||||
|
response: Response
|
||||||
|
): Promise<void> {
|
||||||
|
const burialSiteTypeFieldId = await addBurialSiteTypeField(
|
||||||
|
request.body,
|
||||||
|
request.session.user as User
|
||||||
|
)
|
||||||
|
|
||||||
|
const burialSiteTypes = await getBurialSiteTypes()
|
||||||
|
|
||||||
|
response.json({
|
||||||
|
success: true,
|
||||||
|
burialSiteTypeFieldId,
|
||||||
|
burialSiteTypes
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -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, {
|
||||||
lotOccupantTypeId: string;
|
contractType: string;
|
||||||
moveToEnd: '0' | '1';
|
orderNumber?: number | string;
|
||||||
}>, response: Response): Promise<void>;
|
}>, response: Response): Promise<void>;
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
import { addRecord } from '../../database/addRecord.js';
|
import addRecord from '../../database/addRecord.js';
|
||||||
import { getAllContractTypeFields, getContractTypes } from '../../helpers/functions.cache.js';
|
import { getAllContractTypeFields, getContractTypes } from '../../helpers/functions.cache.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const contractTypeId = await addRecord('OccupancyTypes', request.body.occupancyType, request.body.orderNumber ?? -1, request.session.user);
|
const contractTypeId = await addRecord('ContractTypes', request.body.contractType, request.body.orderNumber ?? -1, request.session.user);
|
||||||
const occupancyTypes = await getContractTypes();
|
const contractTypes = await getContractTypes();
|
||||||
const allContractTypeFields = await getAllContractTypeFields();
|
const allContractTypeFields = await getAllContractTypeFields();
|
||||||
response.json({
|
response.json({
|
||||||
success: true,
|
success: true,
|
||||||
contractTypeId,
|
contractTypeId,
|
||||||
occupancyTypes,
|
contractTypes,
|
||||||
allContractTypeFields
|
allContractTypeFields
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -1,29 +1,33 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import { addRecord } from '../../database/addRecord.js'
|
import addRecord from '../../database/addRecord.js'
|
||||||
import {
|
import {
|
||||||
getAllContractTypeFields,
|
getAllContractTypeFields,
|
||||||
getContractTypes
|
getContractTypes
|
||||||
} from '../../helpers/functions.cache.js'
|
} from '../../helpers/functions.cache.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request<
|
||||||
|
unknown,
|
||||||
|
unknown,
|
||||||
|
{ contractType: string; orderNumber?: number | string }
|
||||||
|
>,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const contractTypeId = await addRecord(
|
const contractTypeId = await addRecord(
|
||||||
'OccupancyTypes',
|
'ContractTypes',
|
||||||
request.body.occupancyType,
|
request.body.contractType,
|
||||||
request.body.orderNumber ?? -1,
|
request.body.orderNumber ?? -1,
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
const occupancyTypes = await getContractTypes()
|
const contractTypes = await getContractTypes()
|
||||||
const allContractTypeFields = await getAllContractTypeFields()
|
const allContractTypeFields = await getAllContractTypeFields()
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
success: true,
|
success: true,
|
||||||
contractTypeId,
|
contractTypeId,
|
||||||
occupancyTypes,
|
contractTypes,
|
||||||
allContractTypeFields
|
allContractTypeFields
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
import type { Request, Response } from 'express';
|
||||||
|
import { type AddContractTypeFieldForm } from '../../database/addContractTypeField.js';
|
||||||
|
export default function handler(request: Request<unknown, unknown, AddContractTypeFieldForm>, response: Response): Promise<void>;
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
import addOccupancyTypeField from '../../database/addOccupancyTypeField.js';
|
import addContractTypeField from '../../database/addContractTypeField.js';
|
||||||
import { getAllContractTypeFields, getContractTypes } from '../../helpers/functions.cache.js';
|
import { getAllContractTypeFields, getContractTypes } from '../../helpers/functions.cache.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const contractTypeFieldId = await addOccupancyTypeField(request.body, request.session.user);
|
const contractTypeFieldId = await addContractTypeField(request.body, request.session.user);
|
||||||
const occupancyTypes = await getContractTypes();
|
const contractTypes = await getContractTypes();
|
||||||
const allContractTypeFields = await getAllContractTypeFields();
|
const allContractTypeFields = await getAllContractTypeFields();
|
||||||
response.json({
|
response.json({
|
||||||
success: true,
|
success: true,
|
||||||
contractTypeFieldId,
|
contractTypeFieldId,
|
||||||
occupancyTypes,
|
contractTypes,
|
||||||
allContractTypeFields
|
allContractTypeFields
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -1,29 +1,29 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import addOccupancyTypeField, {
|
import addContractTypeField, {
|
||||||
type AddOccupancyTypeFieldForm
|
type AddContractTypeFieldForm
|
||||||
} from '../../database/addOccupancyTypeField.js'
|
} from '../../database/addContractTypeField.js'
|
||||||
import {
|
import {
|
||||||
getAllContractTypeFields,
|
getAllContractTypeFields,
|
||||||
getContractTypes
|
getContractTypes
|
||||||
} from '../../helpers/functions.cache.js'
|
} from '../../helpers/functions.cache.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request<unknown, unknown, AddContractTypeFieldForm>,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const contractTypeFieldId = await addOccupancyTypeField(
|
const contractTypeFieldId = await addContractTypeField(
|
||||||
request.body as AddOccupancyTypeFieldForm,
|
request.body,
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
const occupancyTypes = await getContractTypes()
|
const contractTypes = await getContractTypes()
|
||||||
const allContractTypeFields = await getAllContractTypeFields()
|
const allContractTypeFields = await getAllContractTypeFields()
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
success: true,
|
success: true,
|
||||||
contractTypeFieldId,
|
contractTypeFieldId,
|
||||||
occupancyTypes,
|
contractTypes,
|
||||||
allContractTypeFields
|
allContractTypeFields
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
import type { Request, Response } from 'express';
|
||||||
|
import { type AddContractTypePrintForm } from '../../database/addContractTypePrint.js';
|
||||||
|
export default function handler(request: Request<unknown, unknown, AddContractTypePrintForm>, response: Response): Promise<void>;
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
import addOccupancyTypePrint from '../../database/addOccupancyTypePrint.js';
|
import addContractTypePrint from '../../database/addContractTypePrint.js';
|
||||||
import { getAllContractTypeFields, getContractTypes } from '../../helpers/functions.cache.js';
|
import { getAllContractTypeFields, getContractTypes } from '../../helpers/functions.cache.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await addOccupancyTypePrint(request.body, request.session.user);
|
const success = await addContractTypePrint(request.body, request.session.user);
|
||||||
const occupancyTypes = await getContractTypes();
|
const contractTypes = await getContractTypes();
|
||||||
const allContractTypeFields = await getAllContractTypeFields();
|
const allContractTypeFields = await getAllContractTypeFields();
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
occupancyTypes,
|
contractTypes,
|
||||||
allContractTypeFields
|
allContractTypeFields
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -1,28 +1,28 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import addOccupancyTypePrint, {
|
import addContractTypePrint, {
|
||||||
type AddOccupancyTypePrintForm
|
type AddContractTypePrintForm
|
||||||
} from '../../database/addOccupancyTypePrint.js'
|
} from '../../database/addContractTypePrint.js'
|
||||||
import {
|
import {
|
||||||
getAllContractTypeFields,
|
getAllContractTypeFields,
|
||||||
getContractTypes
|
getContractTypes
|
||||||
} from '../../helpers/functions.cache.js'
|
} from '../../helpers/functions.cache.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request<unknown, unknown, AddContractTypePrintForm>,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success = await addOccupancyTypePrint(
|
const success = await addContractTypePrint(
|
||||||
request.body as AddOccupancyTypePrintForm,
|
request.body,
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
const occupancyTypes = await getContractTypes()
|
const contractTypes = await getContractTypes()
|
||||||
const allContractTypeFields = await getAllContractTypeFields()
|
const allContractTypeFields = await getAllContractTypeFields()
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
occupancyTypes,
|
contractTypes,
|
||||||
allContractTypeFields
|
allContractTypeFields
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
import type { Request, Response } from 'express';
|
|
||||||
export default function handler(request: Request, response: Response): Promise<void>;
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
import addLotOccupantType from '../../database/addLotOccupantType.js';
|
|
||||||
import { getLotOccupantTypes } from '../../helpers/functions.cache.js';
|
|
||||||
export default async function handler(request, response) {
|
|
||||||
const lotOccupantTypeId = await addLotOccupantType(request.body, request.session.user);
|
|
||||||
const lotOccupantTypes = await getLotOccupantTypes();
|
|
||||||
response.json({
|
|
||||||
success: true,
|
|
||||||
lotOccupantTypeId,
|
|
||||||
lotOccupantTypes
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
import type { Request, Response } from 'express'
|
|
||||||
|
|
||||||
import addLotOccupantType, {
|
|
||||||
type AddLotOccupantTypeForm
|
|
||||||
} from '../../database/addLotOccupantType.js'
|
|
||||||
import { getLotOccupantTypes } from '../../helpers/functions.cache.js'
|
|
||||||
|
|
||||||
export default async function handler(
|
|
||||||
request: Request,
|
|
||||||
response: Response
|
|
||||||
): Promise<void> {
|
|
||||||
const lotOccupantTypeId = await addLotOccupantType(
|
|
||||||
request.body as AddLotOccupantTypeForm,
|
|
||||||
request.session.user as User
|
|
||||||
)
|
|
||||||
|
|
||||||
const lotOccupantTypes = await getLotOccupantTypes()
|
|
||||||
|
|
||||||
response.json({
|
|
||||||
success: true,
|
|
||||||
lotOccupantTypeId,
|
|
||||||
lotOccupantTypes
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
import type { Request, Response } from 'express';
|
|
||||||
export default function handler(request: Request, response: Response): Promise<void>;
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
import { addRecord } from '../../database/addRecord.js';
|
|
||||||
import { getLotStatuses } from '../../helpers/functions.cache.js';
|
|
||||||
export default async function handler(request, response) {
|
|
||||||
const burialSiteStatusId = await addRecord('LotStatuses', request.body.lotStatus, request.body.orderNumber ?? -1, request.session.user);
|
|
||||||
const lotStatuses = await getLotStatuses();
|
|
||||||
response.json({
|
|
||||||
success: true,
|
|
||||||
burialSiteStatusId,
|
|
||||||
lotStatuses
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
import type { Request, Response } from 'express'
|
|
||||||
|
|
||||||
import { addRecord } from '../../database/addRecord.js'
|
|
||||||
import { getLotStatuses } from '../../helpers/functions.cache.js'
|
|
||||||
|
|
||||||
export default async function handler(
|
|
||||||
request: Request,
|
|
||||||
response: Response
|
|
||||||
): Promise<void> {
|
|
||||||
const burialSiteStatusId = await addRecord(
|
|
||||||
'LotStatuses',
|
|
||||||
request.body.lotStatus,
|
|
||||||
request.body.orderNumber ?? -1,
|
|
||||||
request.session.user as User
|
|
||||||
)
|
|
||||||
|
|
||||||
const lotStatuses = await getLotStatuses()
|
|
||||||
|
|
||||||
response.json({
|
|
||||||
success: true,
|
|
||||||
burialSiteStatusId,
|
|
||||||
lotStatuses
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
import type { Request, Response } from 'express';
|
|
||||||
export default function handler(request: Request, response: Response): Promise<void>;
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
import { addRecord } from '../../database/addRecord.js';
|
|
||||||
import { getBurialSiteTypes } from '../../helpers/functions.cache.js';
|
|
||||||
export default async function handler(request, response) {
|
|
||||||
const burialSiteTypeId = await addRecord('LotTypes', request.body.lotType, request.body.orderNumber ?? -1, request.session.user);
|
|
||||||
const lotTypes = await getBurialSiteTypes();
|
|
||||||
response.json({
|
|
||||||
success: true,
|
|
||||||
burialSiteTypeId,
|
|
||||||
lotTypes
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
import type { Request, Response } from 'express';
|
|
||||||
export default function handler(request: Request, response: Response): Promise<void>;
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
import addLotTypeField from '../../database/addLotTypeField.js';
|
|
||||||
import { getBurialSiteTypes } from '../../helpers/functions.cache.js';
|
|
||||||
export default async function handler(request, response) {
|
|
||||||
const lotTypeFieldId = await addLotTypeField(request.body, request.session.user);
|
|
||||||
const lotTypes = await getBurialSiteTypes();
|
|
||||||
response.json({
|
|
||||||
success: true,
|
|
||||||
lotTypeFieldId,
|
|
||||||
lotTypes
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
import type { Request, Response } from 'express'
|
|
||||||
|
|
||||||
import addLotTypeField, {
|
|
||||||
type AddLotTypeFieldForm
|
|
||||||
} from '../../database/addLotTypeField.js'
|
|
||||||
import { getBurialSiteTypes } from '../../helpers/functions.cache.js'
|
|
||||||
|
|
||||||
export default async function handler(
|
|
||||||
request: Request,
|
|
||||||
response: Response
|
|
||||||
): Promise<void> {
|
|
||||||
const lotTypeFieldId = await addLotTypeField(
|
|
||||||
request.body as AddLotTypeFieldForm,
|
|
||||||
request.session.user as User
|
|
||||||
)
|
|
||||||
|
|
||||||
const lotTypes = await getBurialSiteTypes()
|
|
||||||
|
|
||||||
response.json({
|
|
||||||
success: true,
|
|
||||||
lotTypeFieldId,
|
|
||||||
lotTypes
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
import type { Request, Response } from 'express';
|
|
||||||
export default function handler(request: Request, response: Response): Promise<void>;
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
import type { Request, Response } from 'express';
|
|
||||||
export default function handler(request: Request, response: Response): Promise<void>;
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
import type { Request, Response } from 'express';
|
|
||||||
export default function handler(request: Request, response: Response): Promise<void>;
|
|
||||||
|
|
@ -1,2 +1,5 @@
|
||||||
import type { Request, Response } from 'express';
|
import type { Request, Response } from 'express';
|
||||||
export default function handler(request: Request, response: Response): Promise<void>;
|
export default function handler(request: Request<unknown, unknown, {
|
||||||
|
workOrderMilestoneType: string;
|
||||||
|
orderNumber?: number | string;
|
||||||
|
}>, response: Response): Promise<void>;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { addRecord } from '../../database/addRecord.js';
|
import addRecord from '../../database/addRecord.js';
|
||||||
import { getWorkOrderMilestoneTypes } from '../../helpers/functions.cache.js';
|
import { getWorkOrderMilestoneTypes } from '../../helpers/functions.cache.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const workOrderMilestoneTypeId = await addRecord('WorkOrderMilestoneTypes', request.body.workOrderMilestoneType, request.body.orderNumber ?? -1, request.session.user);
|
const workOrderMilestoneTypeId = await addRecord('WorkOrderMilestoneTypes', request.body.workOrderMilestoneType, request.body.orderNumber ?? -1, request.session.user);
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,14 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import { addRecord } from '../../database/addRecord.js'
|
import addRecord from '../../database/addRecord.js'
|
||||||
import { getWorkOrderMilestoneTypes } from '../../helpers/functions.cache.js'
|
import { getWorkOrderMilestoneTypes } from '../../helpers/functions.cache.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request<
|
||||||
|
unknown,
|
||||||
|
unknown,
|
||||||
|
{ workOrderMilestoneType: string; orderNumber?: number | string }
|
||||||
|
>,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const workOrderMilestoneTypeId = await addRecord(
|
const workOrderMilestoneTypeId = await addRecord(
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,5 @@
|
||||||
import type { Request, Response } from 'express';
|
import type { Request, Response } from 'express';
|
||||||
export default function handler(request: Request, response: Response): Promise<void>;
|
export default function handler(request: Request<unknown, unknown, {
|
||||||
|
workOrderType: string;
|
||||||
|
orderNumber?: number | string;
|
||||||
|
}>, response: Response): Promise<void>;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { addRecord } from '../../database/addRecord.js';
|
import addRecord from '../../database/addRecord.js';
|
||||||
import { getWorkOrderTypes } from '../../helpers/functions.cache.js';
|
import { getWorkOrderTypes } from '../../helpers/functions.cache.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const workOrderTypeId = await addRecord('WorkOrderTypes', request.body.workOrderType, request.body.orderNumber ?? -1, request.session.user);
|
const workOrderTypeId = await addRecord('WorkOrderTypes', request.body.workOrderType, request.body.orderNumber ?? -1, request.session.user);
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,14 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import { addRecord } from '../../database/addRecord.js'
|
import addRecord from '../../database/addRecord.js'
|
||||||
import { getWorkOrderTypes } from '../../helpers/functions.cache.js'
|
import { getWorkOrderTypes } from '../../helpers/functions.cache.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request<
|
||||||
|
unknown,
|
||||||
|
unknown,
|
||||||
|
{ workOrderType: string; orderNumber?: number | string }
|
||||||
|
>,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const workOrderTypeId = await addRecord(
|
const workOrderTypeId = await addRecord(
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
import { deleteRecord } from '../../database/deleteRecord.js';
|
||||||
|
import { getBurialSiteStatuses } from '../../helpers/functions.cache.js';
|
||||||
|
export default async function handler(request, response) {
|
||||||
|
const success = await deleteRecord('BurialSiteStatuses', request.body.burialSiteStatusId, request.session.user);
|
||||||
|
const burialSiteStatuses = await getBurialSiteStatuses();
|
||||||
|
response.json({
|
||||||
|
success,
|
||||||
|
burialSiteStatuses
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -1,22 +1,22 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import { deleteRecord } from '../../database/deleteRecord.js'
|
import { deleteRecord } from '../../database/deleteRecord.js'
|
||||||
import { getLotStatuses } from '../../helpers/functions.cache.js'
|
import { getBurialSiteStatuses } from '../../helpers/functions.cache.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request<unknown, unknown, { burialSiteStatusId: string }>,
|
request: Request<unknown, unknown, { burialSiteStatusId: string }>,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success = await deleteRecord(
|
const success = await deleteRecord(
|
||||||
'LotStatuses',
|
'BurialSiteStatuses',
|
||||||
request.body.burialSiteStatusId,
|
request.body.burialSiteStatusId,
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
const lotStatuses = await getLotStatuses()
|
const burialSiteStatuses = await getBurialSiteStatuses()
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
lotStatuses
|
burialSiteStatuses
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import { deleteRecord } from '../../database/deleteRecord.js';
|
import { deleteRecord } from '../../database/deleteRecord.js';
|
||||||
import { getBurialSiteTypes } from '../../helpers/functions.cache.js';
|
import { getBurialSiteTypes } from '../../helpers/functions.cache.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await deleteRecord('LotTypes', request.body.burialSiteTypeId, request.session.user);
|
const success = await deleteRecord('BurialSiteTypes', request.body.burialSiteTypeId, request.session.user);
|
||||||
const lotTypes = await getBurialSiteTypes();
|
const burialSiteTypes = await getBurialSiteTypes();
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
lotTypes
|
burialSiteTypes
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -8,15 +8,15 @@ export default async function handler(
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success = await deleteRecord(
|
const success = await deleteRecord(
|
||||||
'LotTypes',
|
'BurialSiteTypes',
|
||||||
request.body.burialSiteTypeId as string,
|
request.body.burialSiteTypeId as string,
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
const lotTypes = await getBurialSiteTypes()
|
const burialSiteTypes = await getBurialSiteTypes()
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
lotTypes
|
burialSiteTypes
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -2,9 +2,9 @@ import { deleteRecord } from '../../database/deleteRecord.js';
|
||||||
import { getBurialSiteTypes } from '../../helpers/functions.cache.js';
|
import { getBurialSiteTypes } from '../../helpers/functions.cache.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await deleteRecord('BurialSiteTypeFields', request.body.lotTypeFieldId, request.session.user);
|
const success = await deleteRecord('BurialSiteTypeFields', request.body.lotTypeFieldId, request.session.user);
|
||||||
const lotTypes = await getBurialSiteTypes();
|
const burialSiteTypes = await getBurialSiteTypes();
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
lotTypes
|
burialSiteTypes
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -13,10 +13,10 @@ export default async function handler(
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
const lotTypes = await getBurialSiteTypes()
|
const burialSiteTypes = await getBurialSiteTypes()
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
lotTypes
|
burialSiteTypes
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
import { deleteRecord } from '../../database/deleteRecord.js';
|
import { deleteRecord } from '../../database/deleteRecord.js';
|
||||||
import { getAllContractTypeFields, getContractTypes } from '../../helpers/functions.cache.js';
|
import { getAllContractTypeFields, getContractTypes } from '../../helpers/functions.cache.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await deleteRecord('OccupancyTypes', request.body.contractTypeId, request.session.user);
|
const success = await deleteRecord('ContractTypes', request.body.contractTypeId, request.session.user);
|
||||||
const occupancyTypes = await getContractTypes();
|
const contractTypes = await getContractTypes();
|
||||||
const allContractTypeFields = await getAllContractTypeFields();
|
const allContractTypeFields = await getAllContractTypeFields();
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
occupancyTypes,
|
contractTypes,
|
||||||
allContractTypeFields
|
allContractTypeFields
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -11,17 +11,17 @@ export default async function handler(
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success = await deleteRecord(
|
const success = await deleteRecord(
|
||||||
'OccupancyTypes',
|
'ContractTypes',
|
||||||
request.body.contractTypeId as string,
|
request.body.contractTypeId as string,
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
const occupancyTypes = await getContractTypes()
|
const contractTypes = await getContractTypes()
|
||||||
const allContractTypeFields = await getAllContractTypeFields()
|
const allContractTypeFields = await getAllContractTypeFields()
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
occupancyTypes,
|
contractTypes,
|
||||||
allContractTypeFields
|
allContractTypeFields
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -2,11 +2,11 @@ import { deleteRecord } from '../../database/deleteRecord.js';
|
||||||
import { getAllContractTypeFields, getContractTypes } from '../../helpers/functions.cache.js';
|
import { getAllContractTypeFields, getContractTypes } from '../../helpers/functions.cache.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await deleteRecord('ContractTypeFields', request.body.contractTypeFieldId, request.session.user);
|
const success = await deleteRecord('ContractTypeFields', request.body.contractTypeFieldId, request.session.user);
|
||||||
const occupancyTypes = await getContractTypes();
|
const contractTypes = await getContractTypes();
|
||||||
const allContractTypeFields = await getAllContractTypeFields();
|
const allContractTypeFields = await getAllContractTypeFields();
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
occupancyTypes,
|
contractTypes,
|
||||||
allContractTypeFields
|
allContractTypeFields
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -16,12 +16,12 @@ export default async function handler(
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
const occupancyTypes = await getContractTypes()
|
const contractTypes = await getContractTypes()
|
||||||
const allContractTypeFields = await getAllContractTypeFields()
|
const allContractTypeFields = await getAllContractTypeFields()
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
occupancyTypes,
|
contractTypes,
|
||||||
allContractTypeFields
|
allContractTypeFields
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
import deleteOccupancyTypePrint from '../../database/deleteOccupancyTypePrint.js';
|
import deleteContractTypePrint from '../../database/deleteContractTypePrint.js';
|
||||||
import { getAllContractTypeFields, getContractTypes } from '../../helpers/functions.cache.js';
|
import { getAllContractTypeFields, getContractTypes } from '../../helpers/functions.cache.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await deleteOccupancyTypePrint(request.body.contractTypeId, request.body.printEJS, request.session.user);
|
const success = await deleteContractTypePrint(request.body.contractTypeId, request.body.printEJS, request.session.user);
|
||||||
const occupancyTypes = await getContractTypes();
|
const contractTypes = await getContractTypes();
|
||||||
const allContractTypeFields = await getAllContractTypeFields();
|
const allContractTypeFields = await getAllContractTypeFields();
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
occupancyTypes,
|
contractTypes,
|
||||||
allContractTypeFields
|
allContractTypeFields
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import deleteOccupancyTypePrint from '../../database/deleteOccupancyTypePrint.js'
|
import deleteContractTypePrint from '../../database/deleteContractTypePrint.js'
|
||||||
import {
|
import {
|
||||||
getAllContractTypeFields,
|
getAllContractTypeFields,
|
||||||
getContractTypes
|
getContractTypes
|
||||||
|
|
@ -14,18 +14,18 @@ export default async function handler(
|
||||||
>,
|
>,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success = await deleteOccupancyTypePrint(
|
const success = await deleteContractTypePrint(
|
||||||
request.body.contractTypeId,
|
request.body.contractTypeId,
|
||||||
request.body.printEJS,
|
request.body.printEJS,
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
const occupancyTypes = await getContractTypes()
|
const contractTypes = await getContractTypes()
|
||||||
const allContractTypeFields = await getAllContractTypeFields()
|
const allContractTypeFields = await getAllContractTypeFields()
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
occupancyTypes,
|
contractTypes,
|
||||||
allContractTypeFields
|
allContractTypeFields
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
import { deleteRecord } from '../../database/deleteRecord.js';
|
|
||||||
import { getLotOccupantTypes } from '../../helpers/functions.cache.js';
|
|
||||||
export default async function handler(request, response) {
|
|
||||||
const success = await deleteRecord('LotOccupantTypes', request.body.lotOccupantTypeId, request.session.user);
|
|
||||||
const lotOccupantTypes = await getLotOccupantTypes();
|
|
||||||
response.json({
|
|
||||||
success,
|
|
||||||
lotOccupantTypes
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
import type { Request, Response } from 'express'
|
|
||||||
|
|
||||||
import { deleteRecord } from '../../database/deleteRecord.js'
|
|
||||||
import { getLotOccupantTypes } from '../../helpers/functions.cache.js'
|
|
||||||
|
|
||||||
export default async function handler(
|
|
||||||
request: Request<unknown, unknown, { lotOccupantTypeId: string }>,
|
|
||||||
response: Response
|
|
||||||
): Promise<void> {
|
|
||||||
const success = await deleteRecord(
|
|
||||||
'LotOccupantTypes',
|
|
||||||
request.body.lotOccupantTypeId,
|
|
||||||
request.session.user as User
|
|
||||||
)
|
|
||||||
|
|
||||||
const lotOccupantTypes = await getLotOccupantTypes()
|
|
||||||
|
|
||||||
response.json({
|
|
||||||
success,
|
|
||||||
lotOccupantTypes
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
import { deleteRecord } from '../../database/deleteRecord.js';
|
|
||||||
import { getLotStatuses } from '../../helpers/functions.cache.js';
|
|
||||||
export default async function handler(request, response) {
|
|
||||||
const success = await deleteRecord('LotStatuses', request.body.burialSiteStatusId, request.session.user);
|
|
||||||
const lotStatuses = await getLotStatuses();
|
|
||||||
response.json({
|
|
||||||
success,
|
|
||||||
lotStatuses
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
import { moveRecordDown, moveRecordDownToBottom } from '../../database/moveRecord.js';
|
||||||
|
import { getBurialSiteStatuses } from '../../helpers/functions.cache.js';
|
||||||
|
export default async function handler(request, response) {
|
||||||
|
const success = request.body.moveToEnd === '1'
|
||||||
|
? await moveRecordDownToBottom('BurialSiteStatuses', request.body.burialSiteStatusId)
|
||||||
|
: await moveRecordDown('BurialSiteStatuses', request.body.burialSiteStatusId);
|
||||||
|
const burialSiteStatuses = await getBurialSiteStatuses();
|
||||||
|
response.json({
|
||||||
|
success,
|
||||||
|
burialSiteStatuses
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -4,7 +4,7 @@ import {
|
||||||
moveRecordDown,
|
moveRecordDown,
|
||||||
moveRecordDownToBottom
|
moveRecordDownToBottom
|
||||||
} from '../../database/moveRecord.js'
|
} from '../../database/moveRecord.js'
|
||||||
import { getLotStatuses } from '../../helpers/functions.cache.js'
|
import { getBurialSiteStatuses } from '../../helpers/functions.cache.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request<
|
request: Request<
|
||||||
|
|
@ -16,13 +16,19 @@ export default async function handler(
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success =
|
const success =
|
||||||
request.body.moveToEnd === '1'
|
request.body.moveToEnd === '1'
|
||||||
? await moveRecordDownToBottom('LotStatuses', request.body.burialSiteStatusId)
|
? await moveRecordDownToBottom(
|
||||||
: await moveRecordDown('LotStatuses', request.body.burialSiteStatusId)
|
'BurialSiteStatuses',
|
||||||
|
request.body.burialSiteStatusId
|
||||||
|
)
|
||||||
|
: await moveRecordDown(
|
||||||
|
'BurialSiteStatuses',
|
||||||
|
request.body.burialSiteStatusId
|
||||||
|
)
|
||||||
|
|
||||||
const lotStatuses = await getLotStatuses()
|
const burialSiteStatuses = await getBurialSiteStatuses()
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
lotStatuses
|
burialSiteStatuses
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
import { moveRecordUp, moveRecordUpToTop } from '../../database/moveRecord.js';
|
||||||
|
import { getBurialSiteStatuses } from '../../helpers/functions.cache.js';
|
||||||
|
export default async function handler(request, response) {
|
||||||
|
const success = request.body.moveToEnd === '1'
|
||||||
|
? await moveRecordUpToTop('BurialSiteStatuses', request.body.burialSiteStatusId)
|
||||||
|
: await moveRecordUp('BurialSiteStatuses', request.body.burialSiteStatusId);
|
||||||
|
const burialSiteStatuses = await getBurialSiteStatuses();
|
||||||
|
response.json({
|
||||||
|
success,
|
||||||
|
burialSiteStatuses
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import { moveRecordUp, moveRecordUpToTop } from '../../database/moveRecord.js'
|
import { moveRecordUp, moveRecordUpToTop } from '../../database/moveRecord.js'
|
||||||
import { getLotStatuses } from '../../helpers/functions.cache.js'
|
import { getBurialSiteStatuses } from '../../helpers/functions.cache.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request<
|
request: Request<
|
||||||
|
|
@ -13,13 +13,19 @@ export default async function handler(
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success =
|
const success =
|
||||||
request.body.moveToEnd === '1'
|
request.body.moveToEnd === '1'
|
||||||
? await moveRecordUpToTop('LotStatuses', request.body.burialSiteStatusId)
|
? await moveRecordUpToTop(
|
||||||
: await moveRecordUp('LotStatuses', request.body.burialSiteStatusId)
|
'BurialSiteStatuses',
|
||||||
|
request.body.burialSiteStatusId
|
||||||
|
)
|
||||||
|
: await moveRecordUp(
|
||||||
|
'BurialSiteStatuses',
|
||||||
|
request.body.burialSiteStatusId
|
||||||
|
)
|
||||||
|
|
||||||
const lotStatuses = await getLotStatuses()
|
const burialSiteStatuses = await getBurialSiteStatuses()
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
lotStatuses
|
burialSiteStatuses
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -2,11 +2,11 @@ import { moveRecordDown, moveRecordDownToBottom } from '../../database/moveRecor
|
||||||
import { getBurialSiteTypes } from '../../helpers/functions.cache.js';
|
import { getBurialSiteTypes } from '../../helpers/functions.cache.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = request.body.moveToEnd === '1'
|
const success = request.body.moveToEnd === '1'
|
||||||
? await moveRecordDownToBottom('LotTypes', request.body.burialSiteTypeId)
|
? await moveRecordDownToBottom('BurialSiteTypes', request.body.burialSiteTypeId)
|
||||||
: await moveRecordDown('LotTypes', request.body.burialSiteTypeId);
|
: await moveRecordDown('BurialSiteTypes', request.body.burialSiteTypeId);
|
||||||
const lotTypes = await getBurialSiteTypes();
|
const burialSiteTypes = await getBurialSiteTypes();
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
lotTypes
|
burialSiteTypes
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -16,13 +16,16 @@ export default async function handler(
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success =
|
const success =
|
||||||
request.body.moveToEnd === '1'
|
request.body.moveToEnd === '1'
|
||||||
? await moveRecordDownToBottom('LotTypes', request.body.burialSiteTypeId)
|
? await moveRecordDownToBottom(
|
||||||
: await moveRecordDown('LotTypes', request.body.burialSiteTypeId)
|
'BurialSiteTypes',
|
||||||
|
request.body.burialSiteTypeId
|
||||||
|
)
|
||||||
|
: await moveRecordDown('BurialSiteTypes', request.body.burialSiteTypeId)
|
||||||
|
|
||||||
const lotTypes = await getBurialSiteTypes()
|
const burialSiteTypes = await getBurialSiteTypes()
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
lotTypes
|
burialSiteTypes
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
import { moveBurialSiteTypeFieldDown, moveBurialSiteTypeFieldDownToBottom } from '../../database/moveBurialSiteTypeField.js';
|
||||||
|
import { getBurialSiteTypes } from '../../helpers/functions.cache.js';
|
||||||
|
export default async function handler(request, response) {
|
||||||
|
const success = request.body.moveToEnd === '1'
|
||||||
|
? await moveBurialSiteTypeFieldDownToBottom(request.body.lotTypeFieldId)
|
||||||
|
: await moveBurialSiteTypeFieldDown(request.body.lotTypeFieldId);
|
||||||
|
const burialSiteTypes = await getBurialSiteTypes();
|
||||||
|
response.json({
|
||||||
|
success,
|
||||||
|
burialSiteTypes
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
moveLotTypeFieldUp,
|
moveBurialSiteTypeFieldDown,
|
||||||
moveLotTypeFieldUpToTop
|
moveBurialSiteTypeFieldDownToBottom
|
||||||
} from '../../database/moveLotTypeField.js'
|
} from '../../database/moveBurialSiteTypeField.js'
|
||||||
import { getBurialSiteTypes } from '../../helpers/functions.cache.js'
|
import { getBurialSiteTypes } from '../../helpers/functions.cache.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
|
|
@ -16,13 +16,13 @@ export default async function handler(
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success =
|
const success =
|
||||||
request.body.moveToEnd === '1'
|
request.body.moveToEnd === '1'
|
||||||
? await moveLotTypeFieldUpToTop(request.body.lotTypeFieldId)
|
? await moveBurialSiteTypeFieldDownToBottom(request.body.lotTypeFieldId)
|
||||||
: await moveLotTypeFieldUp(request.body.lotTypeFieldId)
|
: await moveBurialSiteTypeFieldDown(request.body.lotTypeFieldId)
|
||||||
|
|
||||||
const lotTypes = await getBurialSiteTypes()
|
const burialSiteTypes = await getBurialSiteTypes()
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
lotTypes
|
burialSiteTypes
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
import { moveBurialSiteTypeFieldUp, moveBurialSiteTypeFieldUpToTop } from '../../database/moveBurialSiteTypeField.js';
|
||||||
|
import { getBurialSiteTypes } from '../../helpers/functions.cache.js';
|
||||||
|
export default async function handler(request, response) {
|
||||||
|
const success = request.body.moveToEnd === '1'
|
||||||
|
? await moveBurialSiteTypeFieldUpToTop(request.body.lotTypeFieldId)
|
||||||
|
: await moveBurialSiteTypeFieldUp(request.body.lotTypeFieldId);
|
||||||
|
const burialSiteTypes = await getBurialSiteTypes();
|
||||||
|
response.json({
|
||||||
|
success,
|
||||||
|
burialSiteTypes
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
moveLotTypeFieldDown,
|
moveBurialSiteTypeFieldUp,
|
||||||
moveLotTypeFieldDownToBottom
|
moveBurialSiteTypeFieldUpToTop
|
||||||
} from '../../database/moveLotTypeField.js'
|
} from '../../database/moveBurialSiteTypeField.js'
|
||||||
import { getBurialSiteTypes } from '../../helpers/functions.cache.js'
|
import { getBurialSiteTypes } from '../../helpers/functions.cache.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
|
|
@ -16,13 +16,13 @@ export default async function handler(
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success =
|
const success =
|
||||||
request.body.moveToEnd === '1'
|
request.body.moveToEnd === '1'
|
||||||
? await moveLotTypeFieldDownToBottom(request.body.lotTypeFieldId)
|
? await moveBurialSiteTypeFieldUpToTop(request.body.lotTypeFieldId)
|
||||||
: await moveLotTypeFieldDown(request.body.lotTypeFieldId)
|
: await moveBurialSiteTypeFieldUp(request.body.lotTypeFieldId)
|
||||||
|
|
||||||
const lotTypes = await getBurialSiteTypes()
|
const burialSiteTypes = await getBurialSiteTypes()
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
lotTypes
|
burialSiteTypes
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -2,11 +2,11 @@ import { moveRecordUp, moveRecordUpToTop } from '../../database/moveRecord.js';
|
||||||
import { getBurialSiteTypes } from '../../helpers/functions.cache.js';
|
import { getBurialSiteTypes } from '../../helpers/functions.cache.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = request.body.moveToEnd === '1'
|
const success = request.body.moveToEnd === '1'
|
||||||
? await moveRecordUpToTop('LotTypes', request.body.burialSiteTypeId)
|
? await moveRecordUpToTop('BurialSiteTypes', request.body.burialSiteTypeId)
|
||||||
: await moveRecordUp('LotTypes', request.body.burialSiteTypeId);
|
: await moveRecordUp('BurialSiteTypes', request.body.burialSiteTypeId);
|
||||||
const lotTypes = await getBurialSiteTypes();
|
const burialSiteTypes = await getBurialSiteTypes();
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
lotTypes
|
burialSiteTypes
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -13,13 +13,16 @@ export default async function handler(
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success =
|
const success =
|
||||||
request.body.moveToEnd === '1'
|
request.body.moveToEnd === '1'
|
||||||
? await moveRecordUpToTop('LotTypes', request.body.burialSiteTypeId)
|
? await moveRecordUpToTop(
|
||||||
: await moveRecordUp('LotTypes', request.body.burialSiteTypeId)
|
'BurialSiteTypes',
|
||||||
|
request.body.burialSiteTypeId
|
||||||
|
)
|
||||||
|
: await moveRecordUp('BurialSiteTypes', request.body.burialSiteTypeId)
|
||||||
|
|
||||||
const lotTypes = await getBurialSiteTypes()
|
const burialSiteTypes = await getBurialSiteTypes()
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
lotTypes
|
burialSiteTypes
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -2,13 +2,13 @@ import { moveRecordDown, moveRecordDownToBottom } from '../../database/moveRecor
|
||||||
import { getAllContractTypeFields, getContractTypes } from '../../helpers/functions.cache.js';
|
import { getAllContractTypeFields, getContractTypes } from '../../helpers/functions.cache.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = request.body.moveToEnd === '1'
|
const success = request.body.moveToEnd === '1'
|
||||||
? await moveRecordDownToBottom('OccupancyTypes', request.body.contractTypeId)
|
? await moveRecordDownToBottom('ContractTypes', request.body.contractTypeId)
|
||||||
: await moveRecordDown('OccupancyTypes', request.body.contractTypeId);
|
: await moveRecordDown('ContractTypes', request.body.contractTypeId);
|
||||||
const occupancyTypes = await getContractTypes();
|
const contractTypes = await getContractTypes();
|
||||||
const allContractTypeFields = await getAllContractTypeFields();
|
const allContractTypeFields = await getAllContractTypeFields();
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
occupancyTypes,
|
contractTypes,
|
||||||
allContractTypeFields
|
allContractTypeFields
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -20,17 +20,17 @@ export default async function handler(
|
||||||
const success =
|
const success =
|
||||||
request.body.moveToEnd === '1'
|
request.body.moveToEnd === '1'
|
||||||
? await moveRecordDownToBottom(
|
? await moveRecordDownToBottom(
|
||||||
'OccupancyTypes',
|
'ContractTypes',
|
||||||
request.body.contractTypeId
|
request.body.contractTypeId
|
||||||
)
|
)
|
||||||
: await moveRecordDown('OccupancyTypes', request.body.contractTypeId)
|
: await moveRecordDown('ContractTypes', request.body.contractTypeId)
|
||||||
|
|
||||||
const occupancyTypes = await getContractTypes()
|
const contractTypes = await getContractTypes()
|
||||||
const allContractTypeFields = await getAllContractTypeFields()
|
const allContractTypeFields = await getAllContractTypeFields()
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
occupancyTypes,
|
contractTypes,
|
||||||
allContractTypeFields
|
allContractTypeFields
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
import { moveContractTypeFieldDown, moveContractTypeFieldDownToBottom } from '../../database/moveContractTypeField.js';
|
||||||
|
import { getAllContractTypeFields, getContractTypes } from '../../helpers/functions.cache.js';
|
||||||
|
export default async function handler(request, response) {
|
||||||
|
const success = request.body.moveToEnd === '1'
|
||||||
|
? await moveContractTypeFieldDownToBottom(request.body.contractTypeFieldId)
|
||||||
|
: await moveContractTypeFieldDown(request.body.contractTypeFieldId);
|
||||||
|
const contractTypes = await getContractTypes();
|
||||||
|
const allContractTypeFields = await getAllContractTypeFields();
|
||||||
|
response.json({
|
||||||
|
success,
|
||||||
|
contractTypes,
|
||||||
|
allContractTypeFields
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
moveOccupancyTypeFieldDown,
|
moveContractTypeFieldDown,
|
||||||
moveOccupancyTypeFieldDownToBottom
|
moveContractTypeFieldDownToBottom
|
||||||
} from '../../database/moveOccupancyTypeField.js'
|
} from '../../database/moveContractTypeField.js'
|
||||||
import {
|
import {
|
||||||
getAllContractTypeFields,
|
getAllContractTypeFields,
|
||||||
getContractTypes
|
getContractTypes
|
||||||
|
|
@ -19,17 +19,17 @@ export default async function handler(
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success =
|
const success =
|
||||||
request.body.moveToEnd === '1'
|
request.body.moveToEnd === '1'
|
||||||
? await moveOccupancyTypeFieldDownToBottom(
|
? await moveContractTypeFieldDownToBottom(
|
||||||
request.body.contractTypeFieldId
|
request.body.contractTypeFieldId
|
||||||
)
|
)
|
||||||
: await moveOccupancyTypeFieldDown(request.body.contractTypeFieldId)
|
: await moveContractTypeFieldDown(request.body.contractTypeFieldId)
|
||||||
|
|
||||||
const occupancyTypes = await getContractTypes()
|
const contractTypes = await getContractTypes()
|
||||||
const allContractTypeFields = await getAllContractTypeFields()
|
const allContractTypeFields = await getAllContractTypeFields()
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
occupancyTypes,
|
contractTypes,
|
||||||
allContractTypeFields
|
allContractTypeFields
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue