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