diff --git a/bin/www.js b/bin/www.js index 90162a28..cf6aef6f 100644 --- a/bin/www.js +++ b/bin/www.js @@ -23,8 +23,8 @@ for (let index = 0; index < processCount; index += 1) { activeWorkers.set(worker.process.pid, worker); } cluster.on('message', (worker, message) => { - for (const [pid, worker] of activeWorkers.entries()) { - if (worker === undefined || pid === message.pid) { + for (const [pid, activeWorker] of activeWorkers.entries()) { + if (activeWorker === undefined || pid === message.pid) { continue; } debug(`Relaying message to worker: ${pid}`); diff --git a/bin/www.ts b/bin/www.ts index 5d293c0b..ef779364 100644 --- a/bin/www.ts +++ b/bin/www.ts @@ -41,8 +41,8 @@ for (let index = 0; index < processCount; index += 1) { } cluster.on('message', (worker, message: WorkerMessage) => { - for (const [pid, worker] of activeWorkers.entries()) { - if (worker === undefined || pid === message.pid) { + for (const [pid, activeWorker] of activeWorkers.entries()) { + if (activeWorker === undefined || pid === message.pid) { continue } diff --git a/helpers/lotOccupancyDB/addFee.d.ts b/database/addFee.d.ts similarity index 100% rename from helpers/lotOccupancyDB/addFee.d.ts rename to database/addFee.d.ts diff --git a/helpers/lotOccupancyDB/addFee.js b/database/addFee.js similarity index 100% rename from helpers/lotOccupancyDB/addFee.js rename to database/addFee.js diff --git a/helpers/lotOccupancyDB/addFee.ts b/database/addFee.ts similarity index 100% rename from helpers/lotOccupancyDB/addFee.ts rename to database/addFee.ts diff --git a/helpers/lotOccupancyDB/addLot.d.ts b/database/addLot.d.ts similarity index 100% rename from helpers/lotOccupancyDB/addLot.d.ts rename to database/addLot.d.ts diff --git a/helpers/lotOccupancyDB/addLot.js b/database/addLot.js similarity index 100% rename from helpers/lotOccupancyDB/addLot.js rename to database/addLot.js diff --git a/helpers/lotOccupancyDB/addLot.ts b/database/addLot.ts similarity index 100% rename from helpers/lotOccupancyDB/addLot.ts rename to database/addLot.ts diff --git a/helpers/lotOccupancyDB/addLotComment.d.ts b/database/addLotComment.d.ts similarity index 100% rename from helpers/lotOccupancyDB/addLotComment.d.ts rename to database/addLotComment.d.ts diff --git a/helpers/lotOccupancyDB/addLotComment.js b/database/addLotComment.js similarity index 100% rename from helpers/lotOccupancyDB/addLotComment.js rename to database/addLotComment.js diff --git a/helpers/lotOccupancyDB/addLotComment.ts b/database/addLotComment.ts similarity index 100% rename from helpers/lotOccupancyDB/addLotComment.ts rename to database/addLotComment.ts diff --git a/helpers/lotOccupancyDB/addLotOccupancy.d.ts b/database/addLotOccupancy.d.ts similarity index 100% rename from helpers/lotOccupancyDB/addLotOccupancy.d.ts rename to database/addLotOccupancy.d.ts diff --git a/helpers/lotOccupancyDB/addLotOccupancy.js b/database/addLotOccupancy.js similarity index 100% rename from helpers/lotOccupancyDB/addLotOccupancy.js rename to database/addLotOccupancy.js diff --git a/helpers/lotOccupancyDB/addLotOccupancy.ts b/database/addLotOccupancy.ts similarity index 100% rename from helpers/lotOccupancyDB/addLotOccupancy.ts rename to database/addLotOccupancy.ts diff --git a/helpers/lotOccupancyDB/addLotOccupancyComment.d.ts b/database/addLotOccupancyComment.d.ts similarity index 100% rename from helpers/lotOccupancyDB/addLotOccupancyComment.d.ts rename to database/addLotOccupancyComment.d.ts diff --git a/helpers/lotOccupancyDB/addLotOccupancyComment.js b/database/addLotOccupancyComment.js similarity index 100% rename from helpers/lotOccupancyDB/addLotOccupancyComment.js rename to database/addLotOccupancyComment.js diff --git a/helpers/lotOccupancyDB/addLotOccupancyComment.ts b/database/addLotOccupancyComment.ts similarity index 100% rename from helpers/lotOccupancyDB/addLotOccupancyComment.ts rename to database/addLotOccupancyComment.ts diff --git a/helpers/lotOccupancyDB/addLotOccupancyFee.d.ts b/database/addLotOccupancyFee.d.ts similarity index 100% rename from helpers/lotOccupancyDB/addLotOccupancyFee.d.ts rename to database/addLotOccupancyFee.d.ts diff --git a/helpers/lotOccupancyDB/addLotOccupancyFee.js b/database/addLotOccupancyFee.js similarity index 97% rename from helpers/lotOccupancyDB/addLotOccupancyFee.js rename to database/addLotOccupancyFee.js index 51142574..f5eb60ab 100644 --- a/helpers/lotOccupancyDB/addLotOccupancyFee.js +++ b/database/addLotOccupancyFee.js @@ -1,4 +1,4 @@ -import { calculateFeeAmount, calculateTaxAmount } from '../functions.fee.js'; +import { calculateFeeAmount, calculateTaxAmount } from '../helpers/functions.fee.js'; import { getFee } from './getFee.js'; import { getLotOccupancy } from './getLotOccupancy.js'; import { acquireConnection } from './pool.js'; diff --git a/helpers/lotOccupancyDB/addLotOccupancyFee.ts b/database/addLotOccupancyFee.ts similarity index 96% rename from helpers/lotOccupancyDB/addLotOccupancyFee.ts rename to database/addLotOccupancyFee.ts index dc59b796..74843b92 100644 --- a/helpers/lotOccupancyDB/addLotOccupancyFee.ts +++ b/database/addLotOccupancyFee.ts @@ -1,5 +1,5 @@ -import type { LotOccupancy } from '../../types/recordTypes.js' -import { calculateFeeAmount, calculateTaxAmount } from '../functions.fee.js' +import type { LotOccupancy } from '../types/recordTypes.js' +import { calculateFeeAmount, calculateTaxAmount } from '../helpers/functions.fee.js' import { getFee } from './getFee.js' import { getLotOccupancy } from './getLotOccupancy.js' diff --git a/helpers/lotOccupancyDB/addLotOccupancyOccupant.d.ts b/database/addLotOccupancyOccupant.d.ts similarity index 100% rename from helpers/lotOccupancyDB/addLotOccupancyOccupant.d.ts rename to database/addLotOccupancyOccupant.d.ts diff --git a/helpers/lotOccupancyDB/addLotOccupancyOccupant.js b/database/addLotOccupancyOccupant.js similarity index 100% rename from helpers/lotOccupancyDB/addLotOccupancyOccupant.js rename to database/addLotOccupancyOccupant.js diff --git a/helpers/lotOccupancyDB/addLotOccupancyOccupant.ts b/database/addLotOccupancyOccupant.ts similarity index 100% rename from helpers/lotOccupancyDB/addLotOccupancyOccupant.ts rename to database/addLotOccupancyOccupant.ts diff --git a/helpers/lotOccupancyDB/addLotOccupancyTransaction.d.ts b/database/addLotOccupancyTransaction.d.ts similarity index 100% rename from helpers/lotOccupancyDB/addLotOccupancyTransaction.d.ts rename to database/addLotOccupancyTransaction.d.ts diff --git a/helpers/lotOccupancyDB/addLotOccupancyTransaction.js b/database/addLotOccupancyTransaction.js similarity index 100% rename from helpers/lotOccupancyDB/addLotOccupancyTransaction.js rename to database/addLotOccupancyTransaction.js diff --git a/helpers/lotOccupancyDB/addLotOccupancyTransaction.ts b/database/addLotOccupancyTransaction.ts similarity index 100% rename from helpers/lotOccupancyDB/addLotOccupancyTransaction.ts rename to database/addLotOccupancyTransaction.ts diff --git a/helpers/lotOccupancyDB/addLotOccupantType.d.ts b/database/addLotOccupantType.d.ts similarity index 100% rename from helpers/lotOccupancyDB/addLotOccupantType.d.ts rename to database/addLotOccupantType.d.ts diff --git a/helpers/lotOccupancyDB/addLotOccupantType.js b/database/addLotOccupantType.js similarity index 92% rename from helpers/lotOccupancyDB/addLotOccupantType.js rename to database/addLotOccupantType.js index 1f629ce4..a8034b1f 100644 --- a/helpers/lotOccupancyDB/addLotOccupantType.js +++ b/database/addLotOccupantType.js @@ -1,4 +1,4 @@ -import { clearCacheByTableName } from '../functions.cache.js'; +import { clearCacheByTableName } from '../helpers/functions.cache.js'; import { acquireConnection } from './pool.js'; export async function addLotOccupantType(lotOccupantTypeForm, user) { const database = await acquireConnection(); diff --git a/helpers/lotOccupancyDB/addLotOccupantType.ts b/database/addLotOccupantType.ts similarity index 94% rename from helpers/lotOccupancyDB/addLotOccupantType.ts rename to database/addLotOccupantType.ts index ad7fede7..25d6b4fe 100644 --- a/helpers/lotOccupancyDB/addLotOccupantType.ts +++ b/database/addLotOccupantType.ts @@ -1,4 +1,4 @@ -import { clearCacheByTableName } from '../functions.cache.js' +import { clearCacheByTableName } from '../helpers/functions.cache.js' import { acquireConnection } from './pool.js' diff --git a/helpers/lotOccupancyDB/addLotTypeField.d.ts b/database/addLotTypeField.d.ts similarity index 100% rename from helpers/lotOccupancyDB/addLotTypeField.d.ts rename to database/addLotTypeField.d.ts diff --git a/helpers/lotOccupancyDB/addLotTypeField.js b/database/addLotTypeField.js similarity index 93% rename from helpers/lotOccupancyDB/addLotTypeField.js rename to database/addLotTypeField.js index 7a4cc3a8..8c822082 100644 --- a/helpers/lotOccupancyDB/addLotTypeField.js +++ b/database/addLotTypeField.js @@ -1,4 +1,4 @@ -import { clearCacheByTableName } from '../functions.cache.js'; +import { clearCacheByTableName } from '../helpers/functions.cache.js'; import { acquireConnection } from './pool.js'; export async function addLotTypeField(lotTypeFieldForm, user) { const database = await acquireConnection(); diff --git a/helpers/lotOccupancyDB/addLotTypeField.ts b/database/addLotTypeField.ts similarity index 95% rename from helpers/lotOccupancyDB/addLotTypeField.ts rename to database/addLotTypeField.ts index 41164bc6..54766c13 100644 --- a/helpers/lotOccupancyDB/addLotTypeField.ts +++ b/database/addLotTypeField.ts @@ -1,4 +1,4 @@ -import { clearCacheByTableName } from '../functions.cache.js' +import { clearCacheByTableName } from '../helpers/functions.cache.js' import { acquireConnection } from './pool.js' diff --git a/helpers/lotOccupancyDB/addMap.d.ts b/database/addMap.d.ts similarity index 100% rename from helpers/lotOccupancyDB/addMap.d.ts rename to database/addMap.d.ts diff --git a/helpers/lotOccupancyDB/addMap.js b/database/addMap.js similarity index 100% rename from helpers/lotOccupancyDB/addMap.js rename to database/addMap.js diff --git a/helpers/lotOccupancyDB/addMap.ts b/database/addMap.ts similarity index 100% rename from helpers/lotOccupancyDB/addMap.ts rename to database/addMap.ts diff --git a/helpers/lotOccupancyDB/addOccupancyTypeField.d.ts b/database/addOccupancyTypeField.d.ts similarity index 100% rename from helpers/lotOccupancyDB/addOccupancyTypeField.d.ts rename to database/addOccupancyTypeField.d.ts diff --git a/helpers/lotOccupancyDB/addOccupancyTypeField.js b/database/addOccupancyTypeField.js similarity index 94% rename from helpers/lotOccupancyDB/addOccupancyTypeField.js rename to database/addOccupancyTypeField.js index 3375a136..51d9571d 100644 --- a/helpers/lotOccupancyDB/addOccupancyTypeField.js +++ b/database/addOccupancyTypeField.js @@ -1,4 +1,4 @@ -import { clearCacheByTableName } from '../functions.cache.js'; +import { clearCacheByTableName } from '../helpers/functions.cache.js'; import { acquireConnection } from './pool.js'; export async function addOccupancyTypeField(occupancyTypeFieldForm, user) { const database = await acquireConnection(); diff --git a/helpers/lotOccupancyDB/addOccupancyTypeField.ts b/database/addOccupancyTypeField.ts similarity index 95% rename from helpers/lotOccupancyDB/addOccupancyTypeField.ts rename to database/addOccupancyTypeField.ts index 0ef36bd2..d1580eb1 100644 --- a/helpers/lotOccupancyDB/addOccupancyTypeField.ts +++ b/database/addOccupancyTypeField.ts @@ -1,4 +1,4 @@ -import { clearCacheByTableName } from '../functions.cache.js' +import { clearCacheByTableName } from '../helpers/functions.cache.js' import { acquireConnection } from './pool.js' diff --git a/helpers/lotOccupancyDB/addOccupancyTypePrint.d.ts b/database/addOccupancyTypePrint.d.ts similarity index 100% rename from helpers/lotOccupancyDB/addOccupancyTypePrint.d.ts rename to database/addOccupancyTypePrint.d.ts diff --git a/helpers/lotOccupancyDB/addOccupancyTypePrint.js b/database/addOccupancyTypePrint.js similarity index 94% rename from helpers/lotOccupancyDB/addOccupancyTypePrint.js rename to database/addOccupancyTypePrint.js index 3e33279d..fb23d4be 100644 --- a/helpers/lotOccupancyDB/addOccupancyTypePrint.js +++ b/database/addOccupancyTypePrint.js @@ -1,4 +1,4 @@ -import { clearCacheByTableName } from '../functions.cache.js'; +import { clearCacheByTableName } from '../helpers/functions.cache.js'; import { acquireConnection } from './pool.js'; export async function addOccupancyTypePrint(occupancyTypePrintForm, user) { const database = await acquireConnection(); diff --git a/helpers/lotOccupancyDB/addOccupancyTypePrint.ts b/database/addOccupancyTypePrint.ts similarity index 95% rename from helpers/lotOccupancyDB/addOccupancyTypePrint.ts rename to database/addOccupancyTypePrint.ts index 26c990c0..e88a6855 100644 --- a/helpers/lotOccupancyDB/addOccupancyTypePrint.ts +++ b/database/addOccupancyTypePrint.ts @@ -1,4 +1,4 @@ -import { clearCacheByTableName } from '../functions.cache.js' +import { clearCacheByTableName } from '../helpers/functions.cache.js' import { acquireConnection } from './pool.js' diff --git a/helpers/lotOccupancyDB/addOrUpdateLotField.d.ts b/database/addOrUpdateLotField.d.ts similarity index 100% rename from helpers/lotOccupancyDB/addOrUpdateLotField.d.ts rename to database/addOrUpdateLotField.d.ts diff --git a/helpers/lotOccupancyDB/addOrUpdateLotField.js b/database/addOrUpdateLotField.js similarity index 100% rename from helpers/lotOccupancyDB/addOrUpdateLotField.js rename to database/addOrUpdateLotField.js diff --git a/helpers/lotOccupancyDB/addOrUpdateLotField.ts b/database/addOrUpdateLotField.ts similarity index 100% rename from helpers/lotOccupancyDB/addOrUpdateLotField.ts rename to database/addOrUpdateLotField.ts diff --git a/helpers/lotOccupancyDB/addOrUpdateLotOccupancyField.d.ts b/database/addOrUpdateLotOccupancyField.d.ts similarity index 100% rename from helpers/lotOccupancyDB/addOrUpdateLotOccupancyField.d.ts rename to database/addOrUpdateLotOccupancyField.d.ts diff --git a/helpers/lotOccupancyDB/addOrUpdateLotOccupancyField.js b/database/addOrUpdateLotOccupancyField.js similarity index 100% rename from helpers/lotOccupancyDB/addOrUpdateLotOccupancyField.js rename to database/addOrUpdateLotOccupancyField.js diff --git a/helpers/lotOccupancyDB/addOrUpdateLotOccupancyField.ts b/database/addOrUpdateLotOccupancyField.ts similarity index 100% rename from helpers/lotOccupancyDB/addOrUpdateLotOccupancyField.ts rename to database/addOrUpdateLotOccupancyField.ts diff --git a/helpers/lotOccupancyDB/addRecord.d.ts b/database/addRecord.d.ts similarity index 100% rename from helpers/lotOccupancyDB/addRecord.d.ts rename to database/addRecord.d.ts diff --git a/helpers/lotOccupancyDB/addRecord.js b/database/addRecord.js similarity index 93% rename from helpers/lotOccupancyDB/addRecord.js rename to database/addRecord.js index e4b58064..65541592 100644 --- a/helpers/lotOccupancyDB/addRecord.js +++ b/database/addRecord.js @@ -1,4 +1,4 @@ -import { clearCacheByTableName } from '../functions.cache.js'; +import { clearCacheByTableName } from '../helpers/functions.cache.js'; import { acquireConnection } from './pool.js'; const recordNameColumns = new Map(); recordNameColumns.set('FeeCategories', 'feeCategory'); diff --git a/helpers/lotOccupancyDB/addRecord.ts b/database/addRecord.ts similarity index 95% rename from helpers/lotOccupancyDB/addRecord.ts rename to database/addRecord.ts index ffda80c8..7c5f307a 100644 --- a/helpers/lotOccupancyDB/addRecord.ts +++ b/database/addRecord.ts @@ -1,4 +1,4 @@ -import { clearCacheByTableName } from '../functions.cache.js' +import { clearCacheByTableName } from '../helpers/functions.cache.js' import { acquireConnection } from './pool.js' diff --git a/helpers/lotOccupancyDB/addWorkOrder.d.ts b/database/addWorkOrder.d.ts similarity index 100% rename from helpers/lotOccupancyDB/addWorkOrder.d.ts rename to database/addWorkOrder.d.ts diff --git a/helpers/lotOccupancyDB/addWorkOrder.js b/database/addWorkOrder.js similarity index 100% rename from helpers/lotOccupancyDB/addWorkOrder.js rename to database/addWorkOrder.js diff --git a/helpers/lotOccupancyDB/addWorkOrder.ts b/database/addWorkOrder.ts similarity index 100% rename from helpers/lotOccupancyDB/addWorkOrder.ts rename to database/addWorkOrder.ts diff --git a/helpers/lotOccupancyDB/addWorkOrderComment.d.ts b/database/addWorkOrderComment.d.ts similarity index 100% rename from helpers/lotOccupancyDB/addWorkOrderComment.d.ts rename to database/addWorkOrderComment.d.ts diff --git a/helpers/lotOccupancyDB/addWorkOrderComment.js b/database/addWorkOrderComment.js similarity index 100% rename from helpers/lotOccupancyDB/addWorkOrderComment.js rename to database/addWorkOrderComment.js diff --git a/helpers/lotOccupancyDB/addWorkOrderComment.ts b/database/addWorkOrderComment.ts similarity index 100% rename from helpers/lotOccupancyDB/addWorkOrderComment.ts rename to database/addWorkOrderComment.ts diff --git a/helpers/lotOccupancyDB/addWorkOrderLot.d.ts b/database/addWorkOrderLot.d.ts similarity index 100% rename from helpers/lotOccupancyDB/addWorkOrderLot.d.ts rename to database/addWorkOrderLot.d.ts diff --git a/helpers/lotOccupancyDB/addWorkOrderLot.js b/database/addWorkOrderLot.js similarity index 100% rename from helpers/lotOccupancyDB/addWorkOrderLot.js rename to database/addWorkOrderLot.js diff --git a/helpers/lotOccupancyDB/addWorkOrderLot.ts b/database/addWorkOrderLot.ts similarity index 100% rename from helpers/lotOccupancyDB/addWorkOrderLot.ts rename to database/addWorkOrderLot.ts diff --git a/helpers/lotOccupancyDB/addWorkOrderLotOccupancy.d.ts b/database/addWorkOrderLotOccupancy.d.ts similarity index 100% rename from helpers/lotOccupancyDB/addWorkOrderLotOccupancy.d.ts rename to database/addWorkOrderLotOccupancy.d.ts diff --git a/helpers/lotOccupancyDB/addWorkOrderLotOccupancy.js b/database/addWorkOrderLotOccupancy.js similarity index 100% rename from helpers/lotOccupancyDB/addWorkOrderLotOccupancy.js rename to database/addWorkOrderLotOccupancy.js diff --git a/helpers/lotOccupancyDB/addWorkOrderLotOccupancy.ts b/database/addWorkOrderLotOccupancy.ts similarity index 100% rename from helpers/lotOccupancyDB/addWorkOrderLotOccupancy.ts rename to database/addWorkOrderLotOccupancy.ts diff --git a/helpers/lotOccupancyDB/addWorkOrderMilestone.d.ts b/database/addWorkOrderMilestone.d.ts similarity index 100% rename from helpers/lotOccupancyDB/addWorkOrderMilestone.d.ts rename to database/addWorkOrderMilestone.d.ts diff --git a/helpers/lotOccupancyDB/addWorkOrderMilestone.js b/database/addWorkOrderMilestone.js similarity index 100% rename from helpers/lotOccupancyDB/addWorkOrderMilestone.js rename to database/addWorkOrderMilestone.js diff --git a/helpers/lotOccupancyDB/addWorkOrderMilestone.ts b/database/addWorkOrderMilestone.ts similarity index 100% rename from helpers/lotOccupancyDB/addWorkOrderMilestone.ts rename to database/addWorkOrderMilestone.ts diff --git a/helpers/lotOccupancyDB/cleanupDatabase.d.ts b/database/cleanupDatabase.d.ts similarity index 100% rename from helpers/lotOccupancyDB/cleanupDatabase.d.ts rename to database/cleanupDatabase.d.ts diff --git a/helpers/lotOccupancyDB/cleanupDatabase.js b/database/cleanupDatabase.js similarity index 99% rename from helpers/lotOccupancyDB/cleanupDatabase.js rename to database/cleanupDatabase.js index 9b3b36ce..4b41b534 100644 --- a/helpers/lotOccupancyDB/cleanupDatabase.js +++ b/database/cleanupDatabase.js @@ -1,4 +1,4 @@ -import * as configFunctions from '../functions.config.js'; +import * as configFunctions from '../helpers/functions.config.js'; import { acquireConnection } from './pool.js'; export async function cleanupDatabase(user) { const database = await acquireConnection(); diff --git a/helpers/lotOccupancyDB/cleanupDatabase.ts b/database/cleanupDatabase.ts similarity index 99% rename from helpers/lotOccupancyDB/cleanupDatabase.ts rename to database/cleanupDatabase.ts index 64b3c292..840ba7f5 100644 --- a/helpers/lotOccupancyDB/cleanupDatabase.ts +++ b/database/cleanupDatabase.ts @@ -1,4 +1,4 @@ -import * as configFunctions from '../functions.config.js' +import * as configFunctions from '../helpers/functions.config.js' import { acquireConnection } from './pool.js' diff --git a/helpers/lotOccupancyDB/closeWorkOrder.d.ts b/database/closeWorkOrder.d.ts similarity index 100% rename from helpers/lotOccupancyDB/closeWorkOrder.d.ts rename to database/closeWorkOrder.d.ts diff --git a/helpers/lotOccupancyDB/closeWorkOrder.js b/database/closeWorkOrder.js similarity index 100% rename from helpers/lotOccupancyDB/closeWorkOrder.js rename to database/closeWorkOrder.js diff --git a/helpers/lotOccupancyDB/closeWorkOrder.ts b/database/closeWorkOrder.ts similarity index 100% rename from helpers/lotOccupancyDB/closeWorkOrder.ts rename to database/closeWorkOrder.ts diff --git a/helpers/lotOccupancyDB/completeWorkOrderMilestone.d.ts b/database/completeWorkOrderMilestone.d.ts similarity index 100% rename from helpers/lotOccupancyDB/completeWorkOrderMilestone.d.ts rename to database/completeWorkOrderMilestone.d.ts diff --git a/helpers/lotOccupancyDB/completeWorkOrderMilestone.js b/database/completeWorkOrderMilestone.js similarity index 100% rename from helpers/lotOccupancyDB/completeWorkOrderMilestone.js rename to database/completeWorkOrderMilestone.js diff --git a/helpers/lotOccupancyDB/completeWorkOrderMilestone.ts b/database/completeWorkOrderMilestone.ts similarity index 100% rename from helpers/lotOccupancyDB/completeWorkOrderMilestone.ts rename to database/completeWorkOrderMilestone.ts diff --git a/helpers/lotOccupancyDB/copyLotOccupancy.d.ts b/database/copyLotOccupancy.d.ts similarity index 100% rename from helpers/lotOccupancyDB/copyLotOccupancy.d.ts rename to database/copyLotOccupancy.d.ts diff --git a/helpers/lotOccupancyDB/copyLotOccupancy.js b/database/copyLotOccupancy.js similarity index 100% rename from helpers/lotOccupancyDB/copyLotOccupancy.js rename to database/copyLotOccupancy.js diff --git a/helpers/lotOccupancyDB/copyLotOccupancy.ts b/database/copyLotOccupancy.ts similarity index 100% rename from helpers/lotOccupancyDB/copyLotOccupancy.ts rename to database/copyLotOccupancy.ts diff --git a/helpers/lotOccupancyDB/deleteLotField.d.ts b/database/deleteLotField.d.ts similarity index 100% rename from helpers/lotOccupancyDB/deleteLotField.d.ts rename to database/deleteLotField.d.ts diff --git a/helpers/lotOccupancyDB/deleteLotField.js b/database/deleteLotField.js similarity index 100% rename from helpers/lotOccupancyDB/deleteLotField.js rename to database/deleteLotField.js diff --git a/helpers/lotOccupancyDB/deleteLotField.ts b/database/deleteLotField.ts similarity index 100% rename from helpers/lotOccupancyDB/deleteLotField.ts rename to database/deleteLotField.ts diff --git a/helpers/lotOccupancyDB/deleteLotOccupancyFee.d.ts b/database/deleteLotOccupancyFee.d.ts similarity index 100% rename from helpers/lotOccupancyDB/deleteLotOccupancyFee.d.ts rename to database/deleteLotOccupancyFee.d.ts diff --git a/helpers/lotOccupancyDB/deleteLotOccupancyFee.js b/database/deleteLotOccupancyFee.js similarity index 100% rename from helpers/lotOccupancyDB/deleteLotOccupancyFee.js rename to database/deleteLotOccupancyFee.js diff --git a/helpers/lotOccupancyDB/deleteLotOccupancyFee.ts b/database/deleteLotOccupancyFee.ts similarity index 100% rename from helpers/lotOccupancyDB/deleteLotOccupancyFee.ts rename to database/deleteLotOccupancyFee.ts diff --git a/helpers/lotOccupancyDB/deleteLotOccupancyField.d.ts b/database/deleteLotOccupancyField.d.ts similarity index 100% rename from helpers/lotOccupancyDB/deleteLotOccupancyField.d.ts rename to database/deleteLotOccupancyField.d.ts diff --git a/helpers/lotOccupancyDB/deleteLotOccupancyField.js b/database/deleteLotOccupancyField.js similarity index 100% rename from helpers/lotOccupancyDB/deleteLotOccupancyField.js rename to database/deleteLotOccupancyField.js diff --git a/helpers/lotOccupancyDB/deleteLotOccupancyField.ts b/database/deleteLotOccupancyField.ts similarity index 100% rename from helpers/lotOccupancyDB/deleteLotOccupancyField.ts rename to database/deleteLotOccupancyField.ts diff --git a/helpers/lotOccupancyDB/deleteLotOccupancyOccupant.d.ts b/database/deleteLotOccupancyOccupant.d.ts similarity index 100% rename from helpers/lotOccupancyDB/deleteLotOccupancyOccupant.d.ts rename to database/deleteLotOccupancyOccupant.d.ts diff --git a/helpers/lotOccupancyDB/deleteLotOccupancyOccupant.js b/database/deleteLotOccupancyOccupant.js similarity index 100% rename from helpers/lotOccupancyDB/deleteLotOccupancyOccupant.js rename to database/deleteLotOccupancyOccupant.js diff --git a/helpers/lotOccupancyDB/deleteLotOccupancyOccupant.ts b/database/deleteLotOccupancyOccupant.ts similarity index 100% rename from helpers/lotOccupancyDB/deleteLotOccupancyOccupant.ts rename to database/deleteLotOccupancyOccupant.ts diff --git a/helpers/lotOccupancyDB/deleteLotOccupancyTransaction.d.ts b/database/deleteLotOccupancyTransaction.d.ts similarity index 100% rename from helpers/lotOccupancyDB/deleteLotOccupancyTransaction.d.ts rename to database/deleteLotOccupancyTransaction.d.ts diff --git a/helpers/lotOccupancyDB/deleteLotOccupancyTransaction.js b/database/deleteLotOccupancyTransaction.js similarity index 100% rename from helpers/lotOccupancyDB/deleteLotOccupancyTransaction.js rename to database/deleteLotOccupancyTransaction.js diff --git a/helpers/lotOccupancyDB/deleteLotOccupancyTransaction.ts b/database/deleteLotOccupancyTransaction.ts similarity index 100% rename from helpers/lotOccupancyDB/deleteLotOccupancyTransaction.ts rename to database/deleteLotOccupancyTransaction.ts diff --git a/helpers/lotOccupancyDB/deleteOccupancyTypePrint.d.ts b/database/deleteOccupancyTypePrint.d.ts similarity index 100% rename from helpers/lotOccupancyDB/deleteOccupancyTypePrint.d.ts rename to database/deleteOccupancyTypePrint.d.ts diff --git a/helpers/lotOccupancyDB/deleteOccupancyTypePrint.js b/database/deleteOccupancyTypePrint.js similarity index 89% rename from helpers/lotOccupancyDB/deleteOccupancyTypePrint.js rename to database/deleteOccupancyTypePrint.js index aa508fb3..476cd3ae 100644 --- a/helpers/lotOccupancyDB/deleteOccupancyTypePrint.js +++ b/database/deleteOccupancyTypePrint.js @@ -1,4 +1,4 @@ -import { clearCacheByTableName } from '../functions.cache.js'; +import { clearCacheByTableName } from '../helpers/functions.cache.js'; import { acquireConnection } from './pool.js'; export async function deleteOccupancyTypePrint(occupancyTypeId, printEJS, user) { const database = await acquireConnection(); diff --git a/helpers/lotOccupancyDB/deleteOccupancyTypePrint.ts b/database/deleteOccupancyTypePrint.ts similarity index 90% rename from helpers/lotOccupancyDB/deleteOccupancyTypePrint.ts rename to database/deleteOccupancyTypePrint.ts index 8aed5861..7f865f73 100644 --- a/helpers/lotOccupancyDB/deleteOccupancyTypePrint.ts +++ b/database/deleteOccupancyTypePrint.ts @@ -1,4 +1,4 @@ -import { clearCacheByTableName } from '../functions.cache.js' +import { clearCacheByTableName } from '../helpers/functions.cache.js' import { acquireConnection } from './pool.js' diff --git a/helpers/lotOccupancyDB/deleteRecord.d.ts b/database/deleteRecord.d.ts similarity index 100% rename from helpers/lotOccupancyDB/deleteRecord.d.ts rename to database/deleteRecord.d.ts diff --git a/helpers/lotOccupancyDB/deleteRecord.js b/database/deleteRecord.js similarity index 97% rename from helpers/lotOccupancyDB/deleteRecord.js rename to database/deleteRecord.js index c2da0dcd..5102341a 100644 --- a/helpers/lotOccupancyDB/deleteRecord.js +++ b/database/deleteRecord.js @@ -1,4 +1,4 @@ -import { clearCacheByTableName } from '../functions.cache.js'; +import { clearCacheByTableName } from '../helpers/functions.cache.js'; import { acquireConnection } from './pool.js'; const recordIdColumns = new Map(); recordIdColumns.set('FeeCategories', 'feeCategoryId'); diff --git a/helpers/lotOccupancyDB/deleteRecord.ts b/database/deleteRecord.ts similarity index 97% rename from helpers/lotOccupancyDB/deleteRecord.ts rename to database/deleteRecord.ts index 627bbeaf..f8d02017 100644 --- a/helpers/lotOccupancyDB/deleteRecord.ts +++ b/database/deleteRecord.ts @@ -1,4 +1,4 @@ -import { clearCacheByTableName } from '../functions.cache.js' +import { clearCacheByTableName } from '../helpers/functions.cache.js' import { acquireConnection } from './pool.js' diff --git a/helpers/lotOccupancyDB/deleteWorkOrderLot.d.ts b/database/deleteWorkOrderLot.d.ts similarity index 100% rename from helpers/lotOccupancyDB/deleteWorkOrderLot.d.ts rename to database/deleteWorkOrderLot.d.ts diff --git a/helpers/lotOccupancyDB/deleteWorkOrderLot.js b/database/deleteWorkOrderLot.js similarity index 100% rename from helpers/lotOccupancyDB/deleteWorkOrderLot.js rename to database/deleteWorkOrderLot.js diff --git a/helpers/lotOccupancyDB/deleteWorkOrderLot.ts b/database/deleteWorkOrderLot.ts similarity index 100% rename from helpers/lotOccupancyDB/deleteWorkOrderLot.ts rename to database/deleteWorkOrderLot.ts diff --git a/helpers/lotOccupancyDB/deleteWorkOrderLotOccupancy.d.ts b/database/deleteWorkOrderLotOccupancy.d.ts similarity index 100% rename from helpers/lotOccupancyDB/deleteWorkOrderLotOccupancy.d.ts rename to database/deleteWorkOrderLotOccupancy.d.ts diff --git a/helpers/lotOccupancyDB/deleteWorkOrderLotOccupancy.js b/database/deleteWorkOrderLotOccupancy.js similarity index 100% rename from helpers/lotOccupancyDB/deleteWorkOrderLotOccupancy.js rename to database/deleteWorkOrderLotOccupancy.js diff --git a/helpers/lotOccupancyDB/deleteWorkOrderLotOccupancy.ts b/database/deleteWorkOrderLotOccupancy.ts similarity index 100% rename from helpers/lotOccupancyDB/deleteWorkOrderLotOccupancy.ts rename to database/deleteWorkOrderLotOccupancy.ts diff --git a/helpers/lotOccupancyDB/getFee.d.ts b/database/getFee.d.ts similarity index 76% rename from helpers/lotOccupancyDB/getFee.d.ts rename to database/getFee.d.ts index cf569cba..dc33cf18 100644 --- a/helpers/lotOccupancyDB/getFee.d.ts +++ b/database/getFee.d.ts @@ -1,4 +1,4 @@ import type { PoolConnection } from 'better-sqlite-pool'; -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; export declare function getFee(feeId: number | string, connectedDatabase?: PoolConnection): Promise; export default getFee; diff --git a/helpers/lotOccupancyDB/getFee.js b/database/getFee.js similarity index 100% rename from helpers/lotOccupancyDB/getFee.js rename to database/getFee.js diff --git a/helpers/lotOccupancyDB/getFee.ts b/database/getFee.ts similarity index 95% rename from helpers/lotOccupancyDB/getFee.ts rename to database/getFee.ts index dc0c6ce1..639bdedd 100644 --- a/helpers/lotOccupancyDB/getFee.ts +++ b/database/getFee.ts @@ -1,7 +1,7 @@ import { acquireConnection } from './pool.js' import type { PoolConnection } from 'better-sqlite-pool' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' export async function getFee( feeId: number | string, diff --git a/helpers/lotOccupancyDB/getFeeCategories.d.ts b/database/getFeeCategories.d.ts similarity index 85% rename from helpers/lotOccupancyDB/getFeeCategories.d.ts rename to database/getFeeCategories.d.ts index 2db23c54..47c673f6 100644 --- a/helpers/lotOccupancyDB/getFeeCategories.d.ts +++ b/database/getFeeCategories.d.ts @@ -1,4 +1,4 @@ -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; interface GetFeeCategoriesFilters { occupancyTypeId?: number | string; lotTypeId?: number | string; diff --git a/helpers/lotOccupancyDB/getFeeCategories.js b/database/getFeeCategories.js similarity index 100% rename from helpers/lotOccupancyDB/getFeeCategories.js rename to database/getFeeCategories.js diff --git a/helpers/lotOccupancyDB/getFeeCategories.ts b/database/getFeeCategories.ts similarity index 97% rename from helpers/lotOccupancyDB/getFeeCategories.ts rename to database/getFeeCategories.ts index 40e76a76..8946fde8 100644 --- a/helpers/lotOccupancyDB/getFeeCategories.ts +++ b/database/getFeeCategories.ts @@ -3,7 +3,7 @@ import { acquireConnection } from './pool.js' import { getFees } from './getFees.js' import { updateRecordOrderNumber } from './updateRecordOrderNumber.js' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' interface GetFeeCategoriesFilters { occupancyTypeId?: number | string diff --git a/helpers/lotOccupancyDB/getFees.d.ts b/database/getFees.d.ts similarity index 84% rename from helpers/lotOccupancyDB/getFees.d.ts rename to database/getFees.d.ts index b4c16202..a1a40a05 100644 --- a/helpers/lotOccupancyDB/getFees.d.ts +++ b/database/getFees.d.ts @@ -1,5 +1,5 @@ import type { PoolConnection } from 'better-sqlite-pool'; -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; interface GetFeesFilters { occupancyTypeId?: number | string; lotTypeId?: number | string; diff --git a/helpers/lotOccupancyDB/getFees.js b/database/getFees.js similarity index 100% rename from helpers/lotOccupancyDB/getFees.js rename to database/getFees.js diff --git a/helpers/lotOccupancyDB/getFees.ts b/database/getFees.ts similarity index 97% rename from helpers/lotOccupancyDB/getFees.ts rename to database/getFees.ts index 92a47083..36a7cc94 100644 --- a/helpers/lotOccupancyDB/getFees.ts +++ b/database/getFees.ts @@ -3,7 +3,7 @@ import type { PoolConnection } from 'better-sqlite-pool' import { updateRecordOrderNumber } from './updateRecordOrderNumber.js' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' interface GetFeesFilters { occupancyTypeId?: number | string diff --git a/helpers/lotOccupancyDB/getLot.d.ts b/database/getLot.d.ts similarity index 77% rename from helpers/lotOccupancyDB/getLot.d.ts rename to database/getLot.d.ts index 414535be..a3214b1f 100644 --- a/helpers/lotOccupancyDB/getLot.d.ts +++ b/database/getLot.d.ts @@ -1,4 +1,4 @@ -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; export declare function getLotByLotName(lotName: string): Promise; export declare function getLot(lotId: number | string): Promise; export default getLot; diff --git a/helpers/lotOccupancyDB/getLot.js b/database/getLot.js similarity index 100% rename from helpers/lotOccupancyDB/getLot.js rename to database/getLot.js diff --git a/helpers/lotOccupancyDB/getLot.ts b/database/getLot.ts similarity index 96% rename from helpers/lotOccupancyDB/getLot.ts rename to database/getLot.ts index 66fd5384..57d12899 100644 --- a/helpers/lotOccupancyDB/getLot.ts +++ b/database/getLot.ts @@ -6,7 +6,7 @@ import { getLotComments } from './getLotComments.js' import { getLotOccupancies } from './getLotOccupancies.js' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' const baseSQL = `select l.lotId, l.lotTypeId, t.lotType, l.lotName, l.lotStatusId, s.lotStatus, l.mapId, m.mapName, m.mapSVG, l.mapKey, diff --git a/helpers/lotOccupancyDB/getLotComments.d.ts b/database/getLotComments.d.ts similarity index 78% rename from helpers/lotOccupancyDB/getLotComments.d.ts rename to database/getLotComments.d.ts index b120a0e2..03c723e8 100644 --- a/helpers/lotOccupancyDB/getLotComments.d.ts +++ b/database/getLotComments.d.ts @@ -1,4 +1,4 @@ import type { PoolConnection } from 'better-sqlite-pool'; -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; export declare function getLotComments(lotId: number | string, connectedDatabase?: PoolConnection): Promise; export default getLotComments; diff --git a/helpers/lotOccupancyDB/getLotComments.js b/database/getLotComments.js similarity index 100% rename from helpers/lotOccupancyDB/getLotComments.js rename to database/getLotComments.js diff --git a/helpers/lotOccupancyDB/getLotComments.ts b/database/getLotComments.ts similarity index 95% rename from helpers/lotOccupancyDB/getLotComments.ts rename to database/getLotComments.ts index 72ae21fa..8120ca18 100644 --- a/helpers/lotOccupancyDB/getLotComments.ts +++ b/database/getLotComments.ts @@ -7,7 +7,7 @@ import { timeIntegerToPeriodString } from '@cityssm/utils-datetime' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' export async function getLotComments( lotId: number | string, diff --git a/helpers/lotOccupancyDB/getLotFields.d.ts b/database/getLotFields.d.ts similarity index 78% rename from helpers/lotOccupancyDB/getLotFields.d.ts rename to database/getLotFields.d.ts index b3fd6500..63c16e0c 100644 --- a/helpers/lotOccupancyDB/getLotFields.d.ts +++ b/database/getLotFields.d.ts @@ -1,4 +1,4 @@ import type { PoolConnection } from 'better-sqlite-pool'; -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; export declare function getLotFields(lotId: number | string, connectedDatabase?: PoolConnection): Promise; export default getLotFields; diff --git a/helpers/lotOccupancyDB/getLotFields.js b/database/getLotFields.js similarity index 100% rename from helpers/lotOccupancyDB/getLotFields.js rename to database/getLotFields.js diff --git a/helpers/lotOccupancyDB/getLotFields.ts b/database/getLotFields.ts similarity index 96% rename from helpers/lotOccupancyDB/getLotFields.ts rename to database/getLotFields.ts index 948a2482..fdeead1f 100644 --- a/helpers/lotOccupancyDB/getLotFields.ts +++ b/database/getLotFields.ts @@ -1,7 +1,7 @@ import { acquireConnection } from './pool.js' import type { PoolConnection } from 'better-sqlite-pool' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' export async function getLotFields( lotId: number | string, diff --git a/helpers/lotOccupancyDB/getLotOccupancies.d.ts b/database/getLotOccupancies.d.ts similarity index 94% rename from helpers/lotOccupancyDB/getLotOccupancies.d.ts rename to database/getLotOccupancies.d.ts index bf117c42..cae71dc7 100644 --- a/helpers/lotOccupancyDB/getLotOccupancies.d.ts +++ b/database/getLotOccupancies.d.ts @@ -1,5 +1,5 @@ import type { PoolConnection } from 'better-sqlite-pool'; -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; interface GetLotOccupanciesFilters { lotId?: number | string; occupancyTime?: '' | 'past' | 'current' | 'future'; diff --git a/helpers/lotOccupancyDB/getLotOccupancies.js b/database/getLotOccupancies.js similarity index 96% rename from helpers/lotOccupancyDB/getLotOccupancies.js rename to database/getLotOccupancies.js index 12a21eee..66a1aee3 100644 --- a/helpers/lotOccupancyDB/getLotOccupancies.js +++ b/database/getLotOccupancies.js @@ -1,11 +1,11 @@ import { acquireConnection } from './pool.js'; import { dateIntegerToString, dateStringToInteger } from '@cityssm/utils-datetime'; -import * as configFunctions from '../functions.config.js'; -import { getOccupancyTypeById } from '../functions.cache.js'; +import * as configFunctions from '../helpers/functions.config.js'; +import { getOccupancyTypeById } from '../helpers/functions.cache.js'; import { getLotOccupancyOccupants } from './getLotOccupancyOccupants.js'; import { getLotOccupancyFees } from './getLotOccupancyFees.js'; import { getLotOccupancyTransactions } from './getLotOccupancyTransactions.js'; -import { getLotNameWhereClause, getOccupancyTimeWhereClause, getOccupantNameWhereClause } from '../functions.sqlFilters.js'; +import { getLotNameWhereClause, getOccupancyTimeWhereClause, getOccupantNameWhereClause } from '../helpers/functions.sqlFilters.js'; function buildWhereClause(filters) { let sqlWhereClause = ' where o.recordDelete_timeMillis is null'; const sqlParameters = []; diff --git a/helpers/lotOccupancyDB/getLotOccupancies.ts b/database/getLotOccupancies.ts similarity index 96% rename from helpers/lotOccupancyDB/getLotOccupancies.ts rename to database/getLotOccupancies.ts index ce1d17b5..1e525ea9 100644 --- a/helpers/lotOccupancyDB/getLotOccupancies.ts +++ b/database/getLotOccupancies.ts @@ -8,9 +8,9 @@ import { dateStringToInteger } from '@cityssm/utils-datetime' -import * as configFunctions from '../functions.config.js' +import * as configFunctions from '../helpers/functions.config.js' -import { getOccupancyTypeById } from '../functions.cache.js' +import { getOccupancyTypeById } from '../helpers/functions.cache.js' import { getLotOccupancyOccupants } from './getLotOccupancyOccupants.js' import { getLotOccupancyFees } from './getLotOccupancyFees.js' @@ -20,9 +20,9 @@ import { getLotNameWhereClause, getOccupancyTimeWhereClause, getOccupantNameWhereClause -} from '../functions.sqlFilters.js' +} from '../helpers/functions.sqlFilters.js' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' interface GetLotOccupanciesFilters { lotId?: number | string diff --git a/helpers/lotOccupancyDB/getLotOccupancy.d.ts b/database/getLotOccupancy.d.ts similarity index 80% rename from helpers/lotOccupancyDB/getLotOccupancy.d.ts rename to database/getLotOccupancy.d.ts index 866c7cfb..2b1b2a54 100644 --- a/helpers/lotOccupancyDB/getLotOccupancy.d.ts +++ b/database/getLotOccupancy.d.ts @@ -1,4 +1,4 @@ import type { PoolConnection } from 'better-sqlite-pool'; -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; export declare function getLotOccupancy(lotOccupancyId: number | string, connectedDatabase?: PoolConnection): Promise; export default getLotOccupancy; diff --git a/helpers/lotOccupancyDB/getLotOccupancy.js b/database/getLotOccupancy.js similarity index 100% rename from helpers/lotOccupancyDB/getLotOccupancy.js rename to database/getLotOccupancy.js diff --git a/helpers/lotOccupancyDB/getLotOccupancy.ts b/database/getLotOccupancy.ts similarity index 97% rename from helpers/lotOccupancyDB/getLotOccupancy.ts rename to database/getLotOccupancy.ts index 1187fec6..f7ac26ff 100644 --- a/helpers/lotOccupancyDB/getLotOccupancy.ts +++ b/database/getLotOccupancy.ts @@ -10,7 +10,7 @@ import { getLotOccupancyFees } from './getLotOccupancyFees.js' import { getLotOccupancyTransactions } from './getLotOccupancyTransactions.js' import { getWorkOrders } from './getWorkOrders.js' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' export async function getLotOccupancy( lotOccupancyId: number | string, diff --git a/helpers/lotOccupancyDB/getLotOccupancyComments.d.ts b/database/getLotOccupancyComments.d.ts similarity index 80% rename from helpers/lotOccupancyDB/getLotOccupancyComments.d.ts rename to database/getLotOccupancyComments.d.ts index 0b5a02f0..157b3711 100644 --- a/helpers/lotOccupancyDB/getLotOccupancyComments.d.ts +++ b/database/getLotOccupancyComments.d.ts @@ -1,4 +1,4 @@ import type { PoolConnection } from 'better-sqlite-pool'; -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; export declare function getLotOccupancyComments(lotOccupancyId: number | string, connectedDatabase?: PoolConnection): Promise; export default getLotOccupancyComments; diff --git a/helpers/lotOccupancyDB/getLotOccupancyComments.js b/database/getLotOccupancyComments.js similarity index 100% rename from helpers/lotOccupancyDB/getLotOccupancyComments.js rename to database/getLotOccupancyComments.js diff --git a/helpers/lotOccupancyDB/getLotOccupancyComments.ts b/database/getLotOccupancyComments.ts similarity index 96% rename from helpers/lotOccupancyDB/getLotOccupancyComments.ts rename to database/getLotOccupancyComments.ts index ac41f74a..b806be1e 100644 --- a/helpers/lotOccupancyDB/getLotOccupancyComments.ts +++ b/database/getLotOccupancyComments.ts @@ -7,7 +7,7 @@ import { timeIntegerToPeriodString } from '@cityssm/utils-datetime' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' export async function getLotOccupancyComments( lotOccupancyId: number | string, diff --git a/helpers/lotOccupancyDB/getLotOccupancyFees.d.ts b/database/getLotOccupancyFees.d.ts similarity index 80% rename from helpers/lotOccupancyDB/getLotOccupancyFees.d.ts rename to database/getLotOccupancyFees.d.ts index f91255b4..30efe82e 100644 --- a/helpers/lotOccupancyDB/getLotOccupancyFees.d.ts +++ b/database/getLotOccupancyFees.d.ts @@ -1,4 +1,4 @@ import type { PoolConnection } from 'better-sqlite-pool'; -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; export declare function getLotOccupancyFees(lotOccupancyId: number | string, connectedDatabase?: PoolConnection): Promise; export default getLotOccupancyFees; diff --git a/helpers/lotOccupancyDB/getLotOccupancyFees.js b/database/getLotOccupancyFees.js similarity index 100% rename from helpers/lotOccupancyDB/getLotOccupancyFees.js rename to database/getLotOccupancyFees.js diff --git a/helpers/lotOccupancyDB/getLotOccupancyFees.ts b/database/getLotOccupancyFees.ts similarity index 94% rename from helpers/lotOccupancyDB/getLotOccupancyFees.ts rename to database/getLotOccupancyFees.ts index 972a666a..d7af227e 100644 --- a/helpers/lotOccupancyDB/getLotOccupancyFees.ts +++ b/database/getLotOccupancyFees.ts @@ -1,7 +1,7 @@ import { acquireConnection } from './pool.js' import type { PoolConnection } from 'better-sqlite-pool' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' export async function getLotOccupancyFees( lotOccupancyId: number | string, diff --git a/helpers/lotOccupancyDB/getLotOccupancyFields.d.ts b/database/getLotOccupancyFields.d.ts similarity index 80% rename from helpers/lotOccupancyDB/getLotOccupancyFields.d.ts rename to database/getLotOccupancyFields.d.ts index 54c77f0f..27298500 100644 --- a/helpers/lotOccupancyDB/getLotOccupancyFields.d.ts +++ b/database/getLotOccupancyFields.d.ts @@ -1,4 +1,4 @@ import type { PoolConnection } from 'better-sqlite-pool'; -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; export declare function getLotOccupancyFields(lotOccupancyId: number | string, connectedDatabase?: PoolConnection): Promise; export default getLotOccupancyFields; diff --git a/helpers/lotOccupancyDB/getLotOccupancyFields.js b/database/getLotOccupancyFields.js similarity index 100% rename from helpers/lotOccupancyDB/getLotOccupancyFields.js rename to database/getLotOccupancyFields.js diff --git a/helpers/lotOccupancyDB/getLotOccupancyFields.ts b/database/getLotOccupancyFields.ts similarity index 97% rename from helpers/lotOccupancyDB/getLotOccupancyFields.ts rename to database/getLotOccupancyFields.ts index 79f6d4b0..9427cc10 100644 --- a/helpers/lotOccupancyDB/getLotOccupancyFields.ts +++ b/database/getLotOccupancyFields.ts @@ -1,7 +1,7 @@ import { acquireConnection } from './pool.js' import type { PoolConnection } from 'better-sqlite-pool' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' export async function getLotOccupancyFields( lotOccupancyId: number | string, diff --git a/helpers/lotOccupancyDB/getLotOccupancyOccupants.d.ts b/database/getLotOccupancyOccupants.d.ts similarity index 81% rename from helpers/lotOccupancyDB/getLotOccupancyOccupants.d.ts rename to database/getLotOccupancyOccupants.d.ts index 2c256ef5..8133f9fd 100644 --- a/helpers/lotOccupancyDB/getLotOccupancyOccupants.d.ts +++ b/database/getLotOccupancyOccupants.d.ts @@ -1,4 +1,4 @@ import type { PoolConnection } from 'better-sqlite-pool'; -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; export declare function getLotOccupancyOccupants(lotOccupancyId: number | string, connectedDatabase?: PoolConnection): Promise; export default getLotOccupancyOccupants; diff --git a/helpers/lotOccupancyDB/getLotOccupancyOccupants.js b/database/getLotOccupancyOccupants.js similarity index 100% rename from helpers/lotOccupancyDB/getLotOccupancyOccupants.js rename to database/getLotOccupancyOccupants.js diff --git a/helpers/lotOccupancyDB/getLotOccupancyOccupants.ts b/database/getLotOccupancyOccupants.ts similarity index 95% rename from helpers/lotOccupancyDB/getLotOccupancyOccupants.ts rename to database/getLotOccupancyOccupants.ts index 23efff92..3ef5fdfe 100644 --- a/helpers/lotOccupancyDB/getLotOccupancyOccupants.ts +++ b/database/getLotOccupancyOccupants.ts @@ -1,7 +1,7 @@ import { acquireConnection } from './pool.js' import type { PoolConnection } from 'better-sqlite-pool' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' export async function getLotOccupancyOccupants( lotOccupancyId: number | string, diff --git a/helpers/lotOccupancyDB/getLotOccupancyTransactions.d.ts b/database/getLotOccupancyTransactions.d.ts similarity index 83% rename from helpers/lotOccupancyDB/getLotOccupancyTransactions.d.ts rename to database/getLotOccupancyTransactions.d.ts index 6eae95f8..6271fff3 100644 --- a/helpers/lotOccupancyDB/getLotOccupancyTransactions.d.ts +++ b/database/getLotOccupancyTransactions.d.ts @@ -1,5 +1,5 @@ import type { PoolConnection } from 'better-sqlite-pool'; -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; export declare function getLotOccupancyTransactions(lotOccupancyId: number | string, options: { includeIntegrations: boolean; }, connectedDatabase?: PoolConnection): Promise; diff --git a/helpers/lotOccupancyDB/getLotOccupancyTransactions.js b/database/getLotOccupancyTransactions.js similarity index 92% rename from helpers/lotOccupancyDB/getLotOccupancyTransactions.js rename to database/getLotOccupancyTransactions.js index badc944d..a57cdf8e 100644 --- a/helpers/lotOccupancyDB/getLotOccupancyTransactions.js +++ b/database/getLotOccupancyTransactions.js @@ -1,7 +1,7 @@ import { acquireConnection } from './pool.js'; import { dateIntegerToString, timeIntegerToString } from '@cityssm/utils-datetime'; -import * as configFunctions from '../functions.config.js'; -import * as gpFunctions from '../functions.dynamicsGP.js'; +import * as configFunctions from '../helpers/functions.config.js'; +import * as gpFunctions from '../helpers/functions.dynamicsGP.js'; export async function getLotOccupancyTransactions(lotOccupancyId, options, connectedDatabase) { const database = connectedDatabase ?? (await acquireConnection()); database.function('userFn_dateIntegerToString', dateIntegerToString); diff --git a/helpers/lotOccupancyDB/getLotOccupancyTransactions.ts b/database/getLotOccupancyTransactions.ts similarity index 90% rename from helpers/lotOccupancyDB/getLotOccupancyTransactions.ts rename to database/getLotOccupancyTransactions.ts index 85785277..a750cc43 100644 --- a/helpers/lotOccupancyDB/getLotOccupancyTransactions.ts +++ b/database/getLotOccupancyTransactions.ts @@ -6,10 +6,10 @@ import { timeIntegerToString } from '@cityssm/utils-datetime' -import * as configFunctions from '../functions.config.js' -import * as gpFunctions from '../functions.dynamicsGP.js' +import * as configFunctions from '../helpers/functions.config.js' +import * as gpFunctions from '../helpers/functions.dynamicsGP.js' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' export async function getLotOccupancyTransactions( lotOccupancyId: number | string, diff --git a/helpers/lotOccupancyDB/getLotOccupantTypes.d.ts b/database/getLotOccupantTypes.d.ts similarity index 66% rename from helpers/lotOccupancyDB/getLotOccupantTypes.d.ts rename to database/getLotOccupantTypes.d.ts index 89794dc6..34383f3e 100644 --- a/helpers/lotOccupancyDB/getLotOccupantTypes.d.ts +++ b/database/getLotOccupantTypes.d.ts @@ -1,3 +1,3 @@ -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; export declare function getLotOccupantTypes(): Promise; export default getLotOccupantTypes; diff --git a/helpers/lotOccupancyDB/getLotOccupantTypes.js b/database/getLotOccupantTypes.js similarity index 100% rename from helpers/lotOccupancyDB/getLotOccupantTypes.js rename to database/getLotOccupantTypes.js diff --git a/helpers/lotOccupancyDB/getLotOccupantTypes.ts b/database/getLotOccupantTypes.ts similarity index 94% rename from helpers/lotOccupancyDB/getLotOccupantTypes.ts rename to database/getLotOccupantTypes.ts index d3da9c0c..3cc4d91e 100644 --- a/helpers/lotOccupancyDB/getLotOccupantTypes.ts +++ b/database/getLotOccupantTypes.ts @@ -4,7 +4,7 @@ import { acquireConnection } from './pool.js' import { updateRecordOrderNumber } from './updateRecordOrderNumber.js' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' export async function getLotOccupantTypes(): Promise< recordTypes.LotOccupantType[] diff --git a/helpers/lotOccupancyDB/getLotStatusSummary.d.ts b/database/getLotStatusSummary.d.ts similarity index 81% rename from helpers/lotOccupancyDB/getLotStatusSummary.d.ts rename to database/getLotStatusSummary.d.ts index c51780b6..64fc175d 100644 --- a/helpers/lotOccupancyDB/getLotStatusSummary.d.ts +++ b/database/getLotStatusSummary.d.ts @@ -1,4 +1,4 @@ -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; interface GetFilters { mapId?: number | string; } diff --git a/helpers/lotOccupancyDB/getLotStatusSummary.js b/database/getLotStatusSummary.js similarity index 100% rename from helpers/lotOccupancyDB/getLotStatusSummary.js rename to database/getLotStatusSummary.js diff --git a/helpers/lotOccupancyDB/getLotStatusSummary.ts b/database/getLotStatusSummary.ts similarity index 94% rename from helpers/lotOccupancyDB/getLotStatusSummary.ts rename to database/getLotStatusSummary.ts index 67d92ded..77640df2 100644 --- a/helpers/lotOccupancyDB/getLotStatusSummary.ts +++ b/database/getLotStatusSummary.ts @@ -1,6 +1,6 @@ import { acquireConnection } from './pool.js' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' interface GetFilters { mapId?: number | string diff --git a/helpers/lotOccupancyDB/getLotStatuses.d.ts b/database/getLotStatuses.d.ts similarity index 63% rename from helpers/lotOccupancyDB/getLotStatuses.d.ts rename to database/getLotStatuses.d.ts index 4bd0086d..550ec7ff 100644 --- a/helpers/lotOccupancyDB/getLotStatuses.d.ts +++ b/database/getLotStatuses.d.ts @@ -1,3 +1,3 @@ -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; export declare function getLotStatuses(): Promise; export default getLotStatuses; diff --git a/helpers/lotOccupancyDB/getLotStatuses.js b/database/getLotStatuses.js similarity index 100% rename from helpers/lotOccupancyDB/getLotStatuses.js rename to database/getLotStatuses.js diff --git a/helpers/lotOccupancyDB/getLotStatuses.ts b/database/getLotStatuses.ts similarity index 93% rename from helpers/lotOccupancyDB/getLotStatuses.ts rename to database/getLotStatuses.ts index aae1f5de..52e0d4ef 100644 --- a/helpers/lotOccupancyDB/getLotStatuses.ts +++ b/database/getLotStatuses.ts @@ -2,7 +2,7 @@ import { acquireConnection } from './pool.js' import { updateRecordOrderNumber } from './updateRecordOrderNumber.js' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' export async function getLotStatuses(): Promise { const database = await acquireConnection() diff --git a/helpers/lotOccupancyDB/getLotTypeFields.d.ts b/database/getLotTypeFields.d.ts similarity index 78% rename from helpers/lotOccupancyDB/getLotTypeFields.d.ts rename to database/getLotTypeFields.d.ts index a211bbba..0a06bee9 100644 --- a/helpers/lotOccupancyDB/getLotTypeFields.d.ts +++ b/database/getLotTypeFields.d.ts @@ -1,4 +1,4 @@ import type { PoolConnection } from 'better-sqlite-pool'; -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; export declare function getLotTypeFields(lotTypeId: number, connectedDatabase?: PoolConnection): Promise; export default getLotTypeFields; diff --git a/helpers/lotOccupancyDB/getLotTypeFields.js b/database/getLotTypeFields.js similarity index 100% rename from helpers/lotOccupancyDB/getLotTypeFields.js rename to database/getLotTypeFields.js diff --git a/helpers/lotOccupancyDB/getLotTypeFields.ts b/database/getLotTypeFields.ts similarity index 95% rename from helpers/lotOccupancyDB/getLotTypeFields.ts rename to database/getLotTypeFields.ts index 4f842462..fd57881a 100644 --- a/helpers/lotOccupancyDB/getLotTypeFields.ts +++ b/database/getLotTypeFields.ts @@ -1,7 +1,7 @@ import { acquireConnection } from './pool.js' import type { PoolConnection } from 'better-sqlite-pool' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' import { updateRecordOrderNumber } from './updateRecordOrderNumber.js' export async function getLotTypeFields( diff --git a/helpers/lotOccupancyDB/getLotTypeSummary.d.ts b/database/getLotTypeSummary.d.ts similarity index 80% rename from helpers/lotOccupancyDB/getLotTypeSummary.d.ts rename to database/getLotTypeSummary.d.ts index d40095a7..f027fd07 100644 --- a/helpers/lotOccupancyDB/getLotTypeSummary.d.ts +++ b/database/getLotTypeSummary.d.ts @@ -1,4 +1,4 @@ -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; interface GetFilters { mapId?: number | string; } diff --git a/helpers/lotOccupancyDB/getLotTypeSummary.js b/database/getLotTypeSummary.js similarity index 100% rename from helpers/lotOccupancyDB/getLotTypeSummary.js rename to database/getLotTypeSummary.js diff --git a/helpers/lotOccupancyDB/getLotTypeSummary.ts b/database/getLotTypeSummary.ts similarity index 94% rename from helpers/lotOccupancyDB/getLotTypeSummary.ts rename to database/getLotTypeSummary.ts index de432c10..4ef1cb0d 100644 --- a/helpers/lotOccupancyDB/getLotTypeSummary.ts +++ b/database/getLotTypeSummary.ts @@ -1,6 +1,6 @@ import { acquireConnection } from './pool.js' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' interface GetFilters { mapId?: number | string diff --git a/helpers/lotOccupancyDB/getLotTypes.d.ts b/database/getLotTypes.d.ts similarity index 61% rename from helpers/lotOccupancyDB/getLotTypes.d.ts rename to database/getLotTypes.d.ts index 6c343514..d5875daf 100644 --- a/helpers/lotOccupancyDB/getLotTypes.d.ts +++ b/database/getLotTypes.d.ts @@ -1,3 +1,3 @@ -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; export declare function getLotTypes(): Promise; export default getLotTypes; diff --git a/helpers/lotOccupancyDB/getLotTypes.js b/database/getLotTypes.js similarity index 100% rename from helpers/lotOccupancyDB/getLotTypes.js rename to database/getLotTypes.js diff --git a/helpers/lotOccupancyDB/getLotTypes.ts b/database/getLotTypes.ts similarity index 94% rename from helpers/lotOccupancyDB/getLotTypes.ts rename to database/getLotTypes.ts index 4450cd9f..10f4b285 100644 --- a/helpers/lotOccupancyDB/getLotTypes.ts +++ b/database/getLotTypes.ts @@ -2,7 +2,7 @@ import { acquireConnection } from './pool.js' import { getLotTypeFields } from './getLotTypeFields.js' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' import { updateRecordOrderNumber } from './updateRecordOrderNumber.js' export async function getLotTypes(): Promise { diff --git a/helpers/lotOccupancyDB/getLots.d.ts b/database/getLots.d.ts similarity index 91% rename from helpers/lotOccupancyDB/getLots.d.ts rename to database/getLots.d.ts index 37072e12..29da2440 100644 --- a/helpers/lotOccupancyDB/getLots.d.ts +++ b/database/getLots.d.ts @@ -1,5 +1,5 @@ import type { PoolConnection } from 'better-sqlite-pool'; -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; interface GetLotsFilters { lotNameSearchType?: '' | 'startsWith' | 'endsWith'; lotName?: string; diff --git a/helpers/lotOccupancyDB/getLots.js b/database/getLots.js similarity index 96% rename from helpers/lotOccupancyDB/getLots.js rename to database/getLots.js index e80ea64b..c01ef2f6 100644 --- a/helpers/lotOccupancyDB/getLots.js +++ b/database/getLots.js @@ -1,7 +1,7 @@ import { acquireConnection } from './pool.js'; import { dateToInteger } from '@cityssm/utils-datetime'; -import * as configFunctions from '../functions.config.js'; -import { getLotNameWhereClause } from '../functions.sqlFilters.js'; +import * as configFunctions from '../helpers/functions.config.js'; +import { getLotNameWhereClause } from '../helpers/functions.sqlFilters.js'; function buildWhereClause(filters) { let sqlWhereClause = ' where l.recordDelete_timeMillis is null'; const sqlParameters = []; diff --git a/helpers/lotOccupancyDB/getLots.ts b/database/getLots.ts similarity index 96% rename from helpers/lotOccupancyDB/getLots.ts rename to database/getLots.ts index d2d6763c..e301a316 100644 --- a/helpers/lotOccupancyDB/getLots.ts +++ b/database/getLots.ts @@ -5,10 +5,10 @@ import type { PoolConnection } from 'better-sqlite-pool' import { dateToInteger } from '@cityssm/utils-datetime' -import * as configFunctions from '../functions.config.js' +import * as configFunctions from '../helpers/functions.config.js' -import type * as recordTypes from '../../types/recordTypes' -import { getLotNameWhereClause } from '../functions.sqlFilters.js' +import type * as recordTypes from '../types/recordTypes.js' +import { getLotNameWhereClause } from '../helpers/functions.sqlFilters.js' interface GetLotsFilters { lotNameSearchType?: '' | 'startsWith' | 'endsWith' diff --git a/helpers/lotOccupancyDB/getMap.d.ts b/database/getMap.d.ts similarity index 64% rename from helpers/lotOccupancyDB/getMap.d.ts rename to database/getMap.d.ts index 6d1c3db1..10028360 100644 --- a/helpers/lotOccupancyDB/getMap.d.ts +++ b/database/getMap.d.ts @@ -1,3 +1,3 @@ -import type { MapRecord } from '../../types/recordTypes.js'; +import type { MapRecord } from '../types/recordTypes.js'; export declare function getMap(mapId: number | string): Promise; export default getMap; diff --git a/helpers/lotOccupancyDB/getMap.js b/database/getMap.js similarity index 100% rename from helpers/lotOccupancyDB/getMap.js rename to database/getMap.js diff --git a/helpers/lotOccupancyDB/getMap.ts b/database/getMap.ts similarity index 95% rename from helpers/lotOccupancyDB/getMap.ts rename to database/getMap.ts index 5374e524..3a4346fd 100644 --- a/helpers/lotOccupancyDB/getMap.ts +++ b/database/getMap.ts @@ -1,4 +1,4 @@ -import type { MapRecord } from '../../types/recordTypes.js' +import type { MapRecord } from '../types/recordTypes.js' import { acquireConnection } from './pool.js' diff --git a/helpers/lotOccupancyDB/getMaps.d.ts b/database/getMaps.d.ts similarity index 57% rename from helpers/lotOccupancyDB/getMaps.d.ts rename to database/getMaps.d.ts index 285099a3..2ee4b0e6 100644 --- a/helpers/lotOccupancyDB/getMaps.d.ts +++ b/database/getMaps.d.ts @@ -1,3 +1,3 @@ -import type { MapRecord } from '../../types/recordTypes.js'; +import type { MapRecord } from '../types/recordTypes.js'; export declare function getMaps(): Promise; export default getMaps; diff --git a/helpers/lotOccupancyDB/getMaps.js b/database/getMaps.js similarity index 100% rename from helpers/lotOccupancyDB/getMaps.js rename to database/getMaps.js diff --git a/helpers/lotOccupancyDB/getMaps.ts b/database/getMaps.ts similarity index 93% rename from helpers/lotOccupancyDB/getMaps.ts rename to database/getMaps.ts index 27d6a4d2..8722898e 100644 --- a/helpers/lotOccupancyDB/getMaps.ts +++ b/database/getMaps.ts @@ -1,4 +1,4 @@ -import type { MapRecord } from '../../types/recordTypes.js' +import type { MapRecord } from '../types/recordTypes.js' import { acquireConnection } from './pool.js' diff --git a/helpers/lotOccupancyDB/getNextLotId.d.ts b/database/getNextLotId.d.ts similarity index 100% rename from helpers/lotOccupancyDB/getNextLotId.d.ts rename to database/getNextLotId.d.ts diff --git a/helpers/lotOccupancyDB/getNextLotId.js b/database/getNextLotId.js similarity index 91% rename from helpers/lotOccupancyDB/getNextLotId.js rename to database/getNextLotId.js index 51dfa6b0..eb4273cc 100644 --- a/helpers/lotOccupancyDB/getNextLotId.js +++ b/database/getNextLotId.js @@ -1,5 +1,5 @@ import { acquireConnection } from './pool.js'; -import * as configFunctions from '../functions.config.js'; +import * as configFunctions from '../helpers/functions.config.js'; export async function getNextLotId(lotId) { const database = await acquireConnection(); database.function('userFn_lotNameSortName', configFunctions.getProperty('settings.lot.lotNameSortNameFunction')); diff --git a/helpers/lotOccupancyDB/getNextLotId.ts b/database/getNextLotId.ts similarity index 92% rename from helpers/lotOccupancyDB/getNextLotId.ts rename to database/getNextLotId.ts index 2d600bf5..65db0b7d 100644 --- a/helpers/lotOccupancyDB/getNextLotId.ts +++ b/database/getNextLotId.ts @@ -1,6 +1,6 @@ import { acquireConnection } from './pool.js' -import * as configFunctions from '../functions.config.js' +import * as configFunctions from '../helpers/functions.config.js' export async function getNextLotId( lotId: number | string diff --git a/helpers/lotOccupancyDB/getNextMapId.d.ts b/database/getNextMapId.d.ts similarity index 100% rename from helpers/lotOccupancyDB/getNextMapId.d.ts rename to database/getNextMapId.d.ts diff --git a/helpers/lotOccupancyDB/getNextMapId.js b/database/getNextMapId.js similarity index 100% rename from helpers/lotOccupancyDB/getNextMapId.js rename to database/getNextMapId.js diff --git a/helpers/lotOccupancyDB/getNextMapId.ts b/database/getNextMapId.ts similarity index 100% rename from helpers/lotOccupancyDB/getNextMapId.ts rename to database/getNextMapId.ts diff --git a/helpers/lotOccupancyDB/getNextWorkOrderNumber.d.ts b/database/getNextWorkOrderNumber.d.ts similarity index 100% rename from helpers/lotOccupancyDB/getNextWorkOrderNumber.d.ts rename to database/getNextWorkOrderNumber.d.ts diff --git a/helpers/lotOccupancyDB/getNextWorkOrderNumber.js b/database/getNextWorkOrderNumber.js similarity index 95% rename from helpers/lotOccupancyDB/getNextWorkOrderNumber.js rename to database/getNextWorkOrderNumber.js index a0fc649d..425f1e44 100644 --- a/helpers/lotOccupancyDB/getNextWorkOrderNumber.js +++ b/database/getNextWorkOrderNumber.js @@ -1,5 +1,5 @@ import { acquireConnection } from './pool.js'; -import * as configFunctions from '../functions.config.js'; +import * as configFunctions from '../helpers/functions.config.js'; export async function getNextWorkOrderNumber(connectedDatabase) { const database = connectedDatabase ?? (await acquireConnection()); const paddingLength = configFunctions.getProperty('settings.workOrders.workOrderNumberLength'); diff --git a/helpers/lotOccupancyDB/getNextWorkOrderNumber.ts b/database/getNextWorkOrderNumber.ts similarity index 95% rename from helpers/lotOccupancyDB/getNextWorkOrderNumber.ts rename to database/getNextWorkOrderNumber.ts index b53cd78e..bba0e278 100644 --- a/helpers/lotOccupancyDB/getNextWorkOrderNumber.ts +++ b/database/getNextWorkOrderNumber.ts @@ -1,7 +1,7 @@ import { acquireConnection } from './pool.js' import type { PoolConnection } from 'better-sqlite-pool' -import * as configFunctions from '../functions.config.js' +import * as configFunctions from '../helpers/functions.config.js' export async function getNextWorkOrderNumber( connectedDatabase?: PoolConnection diff --git a/helpers/lotOccupancyDB/getOccupancyTypeFields.d.ts b/database/getOccupancyTypeFields.d.ts similarity index 80% rename from helpers/lotOccupancyDB/getOccupancyTypeFields.d.ts rename to database/getOccupancyTypeFields.d.ts index eaa8cac9..bf52cf84 100644 --- a/helpers/lotOccupancyDB/getOccupancyTypeFields.d.ts +++ b/database/getOccupancyTypeFields.d.ts @@ -1,4 +1,4 @@ import type { PoolConnection } from 'better-sqlite-pool'; -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; export declare function getOccupancyTypeFields(occupancyTypeId?: number, connectedDatabase?: PoolConnection): Promise; export default getOccupancyTypeFields; diff --git a/helpers/lotOccupancyDB/getOccupancyTypeFields.js b/database/getOccupancyTypeFields.js similarity index 100% rename from helpers/lotOccupancyDB/getOccupancyTypeFields.js rename to database/getOccupancyTypeFields.js diff --git a/helpers/lotOccupancyDB/getOccupancyTypeFields.ts b/database/getOccupancyTypeFields.ts similarity index 96% rename from helpers/lotOccupancyDB/getOccupancyTypeFields.ts rename to database/getOccupancyTypeFields.ts index d57e8dd4..825fba43 100644 --- a/helpers/lotOccupancyDB/getOccupancyTypeFields.ts +++ b/database/getOccupancyTypeFields.ts @@ -1,7 +1,7 @@ import { acquireConnection } from './pool.js' import type { PoolConnection } from 'better-sqlite-pool' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' import { updateRecordOrderNumber } from './updateRecordOrderNumber.js' export async function getOccupancyTypeFields( diff --git a/helpers/lotOccupancyDB/getOccupancyTypePrints.d.ts b/database/getOccupancyTypePrints.d.ts similarity index 100% rename from helpers/lotOccupancyDB/getOccupancyTypePrints.d.ts rename to database/getOccupancyTypePrints.d.ts diff --git a/helpers/lotOccupancyDB/getOccupancyTypePrints.js b/database/getOccupancyTypePrints.js similarity index 95% rename from helpers/lotOccupancyDB/getOccupancyTypePrints.js rename to database/getOccupancyTypePrints.js index 8743683b..1fb5b79c 100644 --- a/helpers/lotOccupancyDB/getOccupancyTypePrints.js +++ b/database/getOccupancyTypePrints.js @@ -1,5 +1,5 @@ import { acquireConnection } from './pool.js'; -import * as configFunctions from '../functions.config.js'; +import * as configFunctions from '../helpers/functions.config.js'; const availablePrints = configFunctions.getProperty('settings.lotOccupancy.prints'); const userFunction_configContainsPrintEJS = (printEJS) => { if (printEJS === '*' || availablePrints.includes(printEJS)) { diff --git a/helpers/lotOccupancyDB/getOccupancyTypePrints.ts b/database/getOccupancyTypePrints.ts similarity index 96% rename from helpers/lotOccupancyDB/getOccupancyTypePrints.ts rename to database/getOccupancyTypePrints.ts index 77d8c6b8..41d53853 100644 --- a/helpers/lotOccupancyDB/getOccupancyTypePrints.ts +++ b/database/getOccupancyTypePrints.ts @@ -1,7 +1,7 @@ import { acquireConnection } from './pool.js' import type { PoolConnection } from 'better-sqlite-pool' -import * as configFunctions from '../functions.config.js' +import * as configFunctions from '../helpers/functions.config.js' const availablePrints = configFunctions.getProperty( 'settings.lotOccupancy.prints' diff --git a/helpers/lotOccupancyDB/getOccupancyTypes.d.ts b/database/getOccupancyTypes.d.ts similarity index 65% rename from helpers/lotOccupancyDB/getOccupancyTypes.d.ts rename to database/getOccupancyTypes.d.ts index b67eb358..0d27d8fb 100644 --- a/helpers/lotOccupancyDB/getOccupancyTypes.d.ts +++ b/database/getOccupancyTypes.d.ts @@ -1,3 +1,3 @@ -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; export declare function getOccupancyTypes(): Promise; export default getOccupancyTypes; diff --git a/helpers/lotOccupancyDB/getOccupancyTypes.js b/database/getOccupancyTypes.js similarity index 100% rename from helpers/lotOccupancyDB/getOccupancyTypes.js rename to database/getOccupancyTypes.js diff --git a/helpers/lotOccupancyDB/getOccupancyTypes.ts b/database/getOccupancyTypes.ts similarity index 96% rename from helpers/lotOccupancyDB/getOccupancyTypes.ts rename to database/getOccupancyTypes.ts index feb2f85c..2a36981f 100644 --- a/helpers/lotOccupancyDB/getOccupancyTypes.ts +++ b/database/getOccupancyTypes.ts @@ -5,7 +5,7 @@ import { acquireConnection } from './pool.js' import { getOccupancyTypeFields } from './getOccupancyTypeFields.js' import { getOccupancyTypePrints } from './getOccupancyTypePrints.js' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' import { updateRecordOrderNumber } from './updateRecordOrderNumber.js' export async function getOccupancyTypes(): Promise< diff --git a/helpers/lotOccupancyDB/getPastLotOccupancyOccupants.d.ts b/database/getPastLotOccupancyOccupants.d.ts similarity index 86% rename from helpers/lotOccupancyDB/getPastLotOccupancyOccupants.d.ts rename to database/getPastLotOccupancyOccupants.d.ts index 2ab8b0ce..e2e075e8 100644 --- a/helpers/lotOccupancyDB/getPastLotOccupancyOccupants.d.ts +++ b/database/getPastLotOccupancyOccupants.d.ts @@ -1,4 +1,4 @@ -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; interface GetPastLotOccupancyOccupantsFilters { searchFilter: string; } diff --git a/helpers/lotOccupancyDB/getPastLotOccupancyOccupants.js b/database/getPastLotOccupancyOccupants.js similarity index 100% rename from helpers/lotOccupancyDB/getPastLotOccupancyOccupants.js rename to database/getPastLotOccupancyOccupants.js diff --git a/helpers/lotOccupancyDB/getPastLotOccupancyOccupants.ts b/database/getPastLotOccupancyOccupants.ts similarity index 97% rename from helpers/lotOccupancyDB/getPastLotOccupancyOccupants.ts rename to database/getPastLotOccupancyOccupants.ts index 5170ed2c..de9655eb 100644 --- a/helpers/lotOccupancyDB/getPastLotOccupancyOccupants.ts +++ b/database/getPastLotOccupancyOccupants.ts @@ -1,6 +1,6 @@ import { acquireConnection } from './pool.js' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' interface GetPastLotOccupancyOccupantsFilters { searchFilter: string diff --git a/helpers/lotOccupancyDB/getPreviousLotId.d.ts b/database/getPreviousLotId.d.ts similarity index 100% rename from helpers/lotOccupancyDB/getPreviousLotId.d.ts rename to database/getPreviousLotId.d.ts diff --git a/helpers/lotOccupancyDB/getPreviousLotId.js b/database/getPreviousLotId.js similarity index 91% rename from helpers/lotOccupancyDB/getPreviousLotId.js rename to database/getPreviousLotId.js index 108f37ff..51728e43 100644 --- a/helpers/lotOccupancyDB/getPreviousLotId.js +++ b/database/getPreviousLotId.js @@ -1,5 +1,5 @@ import { acquireConnection } from './pool.js'; -import * as configFunctions from '../functions.config.js'; +import * as configFunctions from '../helpers/functions.config.js'; export async function getPreviousLotId(lotId) { const database = await acquireConnection(); database.function('userFn_lotNameSortName', configFunctions.getProperty('settings.lot.lotNameSortNameFunction')); diff --git a/helpers/lotOccupancyDB/getPreviousLotId.ts b/database/getPreviousLotId.ts similarity index 92% rename from helpers/lotOccupancyDB/getPreviousLotId.ts rename to database/getPreviousLotId.ts index edaa441c..019b3d1a 100644 --- a/helpers/lotOccupancyDB/getPreviousLotId.ts +++ b/database/getPreviousLotId.ts @@ -1,6 +1,6 @@ import { acquireConnection } from './pool.js' -import * as configFunctions from '../functions.config.js' +import * as configFunctions from '../helpers/functions.config.js' export async function getPreviousLotId( lotId: number | string diff --git a/helpers/lotOccupancyDB/getPreviousMapId.d.ts b/database/getPreviousMapId.d.ts similarity index 100% rename from helpers/lotOccupancyDB/getPreviousMapId.d.ts rename to database/getPreviousMapId.d.ts diff --git a/helpers/lotOccupancyDB/getPreviousMapId.js b/database/getPreviousMapId.js similarity index 100% rename from helpers/lotOccupancyDB/getPreviousMapId.js rename to database/getPreviousMapId.js diff --git a/helpers/lotOccupancyDB/getPreviousMapId.ts b/database/getPreviousMapId.ts similarity index 100% rename from helpers/lotOccupancyDB/getPreviousMapId.ts rename to database/getPreviousMapId.ts diff --git a/helpers/lotOccupancyDB/getReportData.d.ts b/database/getReportData.d.ts similarity index 100% rename from helpers/lotOccupancyDB/getReportData.d.ts rename to database/getReportData.d.ts diff --git a/helpers/lotOccupancyDB/getReportData.js b/database/getReportData.js similarity index 99% rename from helpers/lotOccupancyDB/getReportData.js rename to database/getReportData.js index 221b040a..68a37f40 100644 --- a/helpers/lotOccupancyDB/getReportData.js +++ b/database/getReportData.js @@ -1,5 +1,5 @@ import { acquireConnection } from './pool.js'; -import * as configFunctions from '../functions.config.js'; +import * as configFunctions from '../helpers/functions.config.js'; import * as dateTimeFunctions from '@cityssm/utils-datetime'; import camelCase from 'camelcase'; const mapCamelCase = camelCase(configFunctions.getProperty('aliases.map')); diff --git a/helpers/lotOccupancyDB/getReportData.ts b/database/getReportData.ts similarity index 99% rename from helpers/lotOccupancyDB/getReportData.ts rename to database/getReportData.ts index 8ecfcd99..751a416b 100644 --- a/helpers/lotOccupancyDB/getReportData.ts +++ b/database/getReportData.ts @@ -2,7 +2,7 @@ import { acquireConnection } from './pool.js' -import * as configFunctions from '../functions.config.js' +import * as configFunctions from '../helpers/functions.config.js' import * as dateTimeFunctions from '@cityssm/utils-datetime' import camelCase from 'camelcase' diff --git a/helpers/lotOccupancyDB/getWorkOrder.d.ts b/database/getWorkOrder.d.ts similarity index 89% rename from helpers/lotOccupancyDB/getWorkOrder.d.ts rename to database/getWorkOrder.d.ts index 3a867ed5..393fba4a 100644 --- a/helpers/lotOccupancyDB/getWorkOrder.d.ts +++ b/database/getWorkOrder.d.ts @@ -1,5 +1,5 @@ import type { PoolConnection } from 'better-sqlite-pool'; -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; interface WorkOrderOptions { includeLotsAndLotOccupancies: boolean; includeComments: boolean; diff --git a/helpers/lotOccupancyDB/getWorkOrder.js b/database/getWorkOrder.js similarity index 100% rename from helpers/lotOccupancyDB/getWorkOrder.js rename to database/getWorkOrder.js diff --git a/helpers/lotOccupancyDB/getWorkOrder.ts b/database/getWorkOrder.ts similarity index 98% rename from helpers/lotOccupancyDB/getWorkOrder.ts rename to database/getWorkOrder.ts index 8dcb7ab9..06b0d8fd 100644 --- a/helpers/lotOccupancyDB/getWorkOrder.ts +++ b/database/getWorkOrder.ts @@ -11,7 +11,7 @@ import { getWorkOrderComments } from './getWorkOrderComments.js' import { getWorkOrderMilestones } from './getWorkOrderMilestones.js' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' interface WorkOrderOptions { includeLotsAndLotOccupancies: boolean diff --git a/helpers/lotOccupancyDB/getWorkOrderComments.d.ts b/database/getWorkOrderComments.d.ts similarity index 80% rename from helpers/lotOccupancyDB/getWorkOrderComments.d.ts rename to database/getWorkOrderComments.d.ts index b84115fd..90e99750 100644 --- a/helpers/lotOccupancyDB/getWorkOrderComments.d.ts +++ b/database/getWorkOrderComments.d.ts @@ -1,4 +1,4 @@ import type { PoolConnection } from 'better-sqlite-pool'; -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; export declare function getWorkOrderComments(workOrderId: number | string, connectedDatabase?: PoolConnection): Promise; export default getWorkOrderComments; diff --git a/helpers/lotOccupancyDB/getWorkOrderComments.js b/database/getWorkOrderComments.js similarity index 100% rename from helpers/lotOccupancyDB/getWorkOrderComments.js rename to database/getWorkOrderComments.js diff --git a/helpers/lotOccupancyDB/getWorkOrderComments.ts b/database/getWorkOrderComments.ts similarity index 96% rename from helpers/lotOccupancyDB/getWorkOrderComments.ts rename to database/getWorkOrderComments.ts index f5264ce9..9e2324b8 100644 --- a/helpers/lotOccupancyDB/getWorkOrderComments.ts +++ b/database/getWorkOrderComments.ts @@ -7,7 +7,7 @@ import { timeIntegerToPeriodString } from '@cityssm/utils-datetime' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' export async function getWorkOrderComments( workOrderId: number | string, diff --git a/helpers/lotOccupancyDB/getWorkOrderMilestoneTypes.d.ts b/database/getWorkOrderMilestoneTypes.d.ts similarity index 70% rename from helpers/lotOccupancyDB/getWorkOrderMilestoneTypes.d.ts rename to database/getWorkOrderMilestoneTypes.d.ts index 3f12f1cb..b0f8a236 100644 --- a/helpers/lotOccupancyDB/getWorkOrderMilestoneTypes.d.ts +++ b/database/getWorkOrderMilestoneTypes.d.ts @@ -1,3 +1,3 @@ -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; export declare function getWorkOrderMilestoneTypes(): Promise; export default getWorkOrderMilestoneTypes; diff --git a/helpers/lotOccupancyDB/getWorkOrderMilestoneTypes.js b/database/getWorkOrderMilestoneTypes.js similarity index 100% rename from helpers/lotOccupancyDB/getWorkOrderMilestoneTypes.js rename to database/getWorkOrderMilestoneTypes.js diff --git a/helpers/lotOccupancyDB/getWorkOrderMilestoneTypes.ts b/database/getWorkOrderMilestoneTypes.ts similarity index 95% rename from helpers/lotOccupancyDB/getWorkOrderMilestoneTypes.ts rename to database/getWorkOrderMilestoneTypes.ts index 068dba8c..2c7e6d3b 100644 --- a/helpers/lotOccupancyDB/getWorkOrderMilestoneTypes.ts +++ b/database/getWorkOrderMilestoneTypes.ts @@ -2,7 +2,7 @@ import { acquireConnection } from './pool.js' import { updateRecordOrderNumber } from './updateRecordOrderNumber.js' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' export async function getWorkOrderMilestoneTypes(): Promise { const database = await acquireConnection() diff --git a/helpers/lotOccupancyDB/getWorkOrderMilestones.d.ts b/database/getWorkOrderMilestones.d.ts similarity index 91% rename from helpers/lotOccupancyDB/getWorkOrderMilestones.d.ts rename to database/getWorkOrderMilestones.d.ts index 62eca364..56b62250 100644 --- a/helpers/lotOccupancyDB/getWorkOrderMilestones.d.ts +++ b/database/getWorkOrderMilestones.d.ts @@ -1,5 +1,5 @@ import type { PoolConnection } from 'better-sqlite-pool'; -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; export interface WorkOrderMilestoneFilters { workOrderId?: number | string; workOrderMilestoneDateFilter?: 'upcomingMissed' | 'recent' | 'date' | 'blank' | 'notBlank'; diff --git a/helpers/lotOccupancyDB/getWorkOrderMilestones.js b/database/getWorkOrderMilestones.js similarity index 99% rename from helpers/lotOccupancyDB/getWorkOrderMilestones.js rename to database/getWorkOrderMilestones.js index 513ef5c6..c2484fc3 100644 --- a/helpers/lotOccupancyDB/getWorkOrderMilestones.js +++ b/database/getWorkOrderMilestones.js @@ -1,6 +1,6 @@ import { acquireConnection } from './pool.js'; import { dateIntegerToString, dateStringToInteger, dateToInteger, timeIntegerToString, timeIntegerToPeriodString } from '@cityssm/utils-datetime'; -import * as configFunctions from '../functions.config.js'; +import * as configFunctions from '../helpers/functions.config.js'; import { getLots } from './getLots.js'; import { getLotOccupancies } from './getLotOccupancies.js'; const commaSeparatedNumbersRegex = /^\d+(,\d+)*$/; diff --git a/helpers/lotOccupancyDB/getWorkOrderMilestones.ts b/database/getWorkOrderMilestones.ts similarity index 98% rename from helpers/lotOccupancyDB/getWorkOrderMilestones.ts rename to database/getWorkOrderMilestones.ts index 265ed414..84891795 100644 --- a/helpers/lotOccupancyDB/getWorkOrderMilestones.ts +++ b/database/getWorkOrderMilestones.ts @@ -11,12 +11,12 @@ import { timeIntegerToPeriodString } from '@cityssm/utils-datetime' -import * as configFunctions from '../functions.config.js' +import * as configFunctions from '../helpers/functions.config.js' import { getLots } from './getLots.js' import { getLotOccupancies } from './getLotOccupancies.js' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' export interface WorkOrderMilestoneFilters { workOrderId?: number | string diff --git a/helpers/lotOccupancyDB/getWorkOrderTypes.d.ts b/database/getWorkOrderTypes.d.ts similarity index 65% rename from helpers/lotOccupancyDB/getWorkOrderTypes.d.ts rename to database/getWorkOrderTypes.d.ts index 7a961a0f..81a4667e 100644 --- a/helpers/lotOccupancyDB/getWorkOrderTypes.d.ts +++ b/database/getWorkOrderTypes.d.ts @@ -1,3 +1,3 @@ -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; export declare function getWorkOrderTypes(): Promise; export default getWorkOrderTypes; diff --git a/helpers/lotOccupancyDB/getWorkOrderTypes.js b/database/getWorkOrderTypes.js similarity index 100% rename from helpers/lotOccupancyDB/getWorkOrderTypes.js rename to database/getWorkOrderTypes.js diff --git a/helpers/lotOccupancyDB/getWorkOrderTypes.ts b/database/getWorkOrderTypes.ts similarity index 94% rename from helpers/lotOccupancyDB/getWorkOrderTypes.ts rename to database/getWorkOrderTypes.ts index 371df6c9..298356a6 100644 --- a/helpers/lotOccupancyDB/getWorkOrderTypes.ts +++ b/database/getWorkOrderTypes.ts @@ -4,7 +4,7 @@ import { acquireConnection } from './pool.js' import { updateRecordOrderNumber } from './updateRecordOrderNumber.js' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' export async function getWorkOrderTypes(): Promise< recordTypes.WorkOrderType[] diff --git a/helpers/lotOccupancyDB/getWorkOrders.d.ts b/database/getWorkOrders.d.ts similarity index 92% rename from helpers/lotOccupancyDB/getWorkOrders.d.ts rename to database/getWorkOrders.d.ts index 9be82739..84c57d95 100644 --- a/helpers/lotOccupancyDB/getWorkOrders.d.ts +++ b/database/getWorkOrders.d.ts @@ -1,5 +1,5 @@ import type { PoolConnection } from 'better-sqlite-pool'; -import type * as recordTypes from '../../types/recordTypes'; +import type * as recordTypes from '../types/recordTypes.js'; interface GetWorkOrdersFilters { workOrderTypeId?: number | string; workOrderOpenStatus?: '' | 'open' | 'closed'; diff --git a/helpers/lotOccupancyDB/getWorkOrders.js b/database/getWorkOrders.js similarity index 99% rename from helpers/lotOccupancyDB/getWorkOrders.js rename to database/getWorkOrders.js index c02d2522..d2ee7585 100644 --- a/helpers/lotOccupancyDB/getWorkOrders.js +++ b/database/getWorkOrders.js @@ -4,7 +4,7 @@ import { getWorkOrderComments } from './getWorkOrderComments.js'; import { getLots } from './getLots.js'; import { getLotOccupancies } from './getLotOccupancies.js'; import { getWorkOrderMilestones } from './getWorkOrderMilestones.js'; -import { getLotNameWhereClause, getOccupantNameWhereClause } from '../functions.sqlFilters.js'; +import { getLotNameWhereClause, getOccupantNameWhereClause } from '../helpers/functions.sqlFilters.js'; function buildWhereClause(filters) { let sqlWhereClause = ' where w.recordDelete_timeMillis is null'; const sqlParameters = []; diff --git a/helpers/lotOccupancyDB/getWorkOrders.ts b/database/getWorkOrders.ts similarity index 98% rename from helpers/lotOccupancyDB/getWorkOrders.ts rename to database/getWorkOrders.ts index a685ef94..612ca4d5 100644 --- a/helpers/lotOccupancyDB/getWorkOrders.ts +++ b/database/getWorkOrders.ts @@ -13,11 +13,11 @@ import { getLots } from './getLots.js' import { getLotOccupancies } from './getLotOccupancies.js' import { getWorkOrderMilestones } from './getWorkOrderMilestones.js' -import type * as recordTypes from '../../types/recordTypes' +import type * as recordTypes from '../types/recordTypes.js' import { getLotNameWhereClause, getOccupantNameWhereClause -} from '../functions.sqlFilters.js' +} from '../helpers/functions.sqlFilters.js' interface GetWorkOrdersFilters { workOrderTypeId?: number | string diff --git a/helpers/lotOccupancyDB/moveFee.d.ts b/database/moveFee.d.ts similarity index 100% rename from helpers/lotOccupancyDB/moveFee.d.ts rename to database/moveFee.d.ts diff --git a/helpers/lotOccupancyDB/moveFee.js b/database/moveFee.js similarity index 100% rename from helpers/lotOccupancyDB/moveFee.js rename to database/moveFee.js diff --git a/helpers/lotOccupancyDB/moveFee.ts b/database/moveFee.ts similarity index 100% rename from helpers/lotOccupancyDB/moveFee.ts rename to database/moveFee.ts diff --git a/helpers/lotOccupancyDB/moveLotTypeField.d.ts b/database/moveLotTypeField.d.ts similarity index 100% rename from helpers/lotOccupancyDB/moveLotTypeField.d.ts rename to database/moveLotTypeField.d.ts diff --git a/helpers/lotOccupancyDB/moveLotTypeField.js b/database/moveLotTypeField.js similarity index 97% rename from helpers/lotOccupancyDB/moveLotTypeField.js rename to database/moveLotTypeField.js index d559339d..994b6f65 100644 --- a/helpers/lotOccupancyDB/moveLotTypeField.js +++ b/database/moveLotTypeField.js @@ -1,5 +1,5 @@ import { acquireConnection } from './pool.js'; -import { clearCacheByTableName } from '../functions.cache.js'; +import { clearCacheByTableName } from '../helpers/functions.cache.js'; import { updateRecordOrderNumber } from './updateRecordOrderNumber.js'; function getCurrentField(lotTypeFieldId, connectedDatabase) { const currentField = connectedDatabase diff --git a/helpers/lotOccupancyDB/moveLotTypeField.ts b/database/moveLotTypeField.ts similarity index 98% rename from helpers/lotOccupancyDB/moveLotTypeField.ts rename to database/moveLotTypeField.ts index 6092386f..4a2e7d38 100644 --- a/helpers/lotOccupancyDB/moveLotTypeField.ts +++ b/database/moveLotTypeField.ts @@ -1,7 +1,7 @@ import { acquireConnection } from './pool.js' import type { PoolConnection } from 'better-sqlite-pool' -import { clearCacheByTableName } from '../functions.cache.js' +import { clearCacheByTableName } from '../helpers/functions.cache.js' import { updateRecordOrderNumber } from './updateRecordOrderNumber.js' function getCurrentField( diff --git a/helpers/lotOccupancyDB/moveOccupancyTypeField.d.ts b/database/moveOccupancyTypeField.d.ts similarity index 100% rename from helpers/lotOccupancyDB/moveOccupancyTypeField.d.ts rename to database/moveOccupancyTypeField.d.ts diff --git a/helpers/lotOccupancyDB/moveOccupancyTypeField.js b/database/moveOccupancyTypeField.js similarity index 98% rename from helpers/lotOccupancyDB/moveOccupancyTypeField.js rename to database/moveOccupancyTypeField.js index 0acc8fbd..b73aa22e 100644 --- a/helpers/lotOccupancyDB/moveOccupancyTypeField.js +++ b/database/moveOccupancyTypeField.js @@ -1,5 +1,5 @@ import { acquireConnection } from './pool.js'; -import { clearCacheByTableName } from '../functions.cache.js'; +import { clearCacheByTableName } from '../helpers/functions.cache.js'; import { updateRecordOrderNumber } from './updateRecordOrderNumber.js'; function getCurrentField(occupancyTypeFieldId, connectedDatabase) { const currentField = connectedDatabase diff --git a/helpers/lotOccupancyDB/moveOccupancyTypeField.ts b/database/moveOccupancyTypeField.ts similarity index 98% rename from helpers/lotOccupancyDB/moveOccupancyTypeField.ts rename to database/moveOccupancyTypeField.ts index e8205063..9d8d4031 100644 --- a/helpers/lotOccupancyDB/moveOccupancyTypeField.ts +++ b/database/moveOccupancyTypeField.ts @@ -1,7 +1,7 @@ import { acquireConnection } from './pool.js' import type { PoolConnection } from 'better-sqlite-pool' -import { clearCacheByTableName } from '../functions.cache.js' +import { clearCacheByTableName } from '../helpers/functions.cache.js' import { updateRecordOrderNumber } from './updateRecordOrderNumber.js' function getCurrentField( diff --git a/helpers/lotOccupancyDB/moveOccupancyTypePrintDown.d.ts b/database/moveOccupancyTypePrintDown.d.ts similarity index 100% rename from helpers/lotOccupancyDB/moveOccupancyTypePrintDown.d.ts rename to database/moveOccupancyTypePrintDown.d.ts diff --git a/helpers/lotOccupancyDB/moveOccupancyTypePrintDown.js b/database/moveOccupancyTypePrintDown.js similarity index 96% rename from helpers/lotOccupancyDB/moveOccupancyTypePrintDown.js rename to database/moveOccupancyTypePrintDown.js index 40583e5b..fb6d19af 100644 --- a/helpers/lotOccupancyDB/moveOccupancyTypePrintDown.js +++ b/database/moveOccupancyTypePrintDown.js @@ -1,5 +1,5 @@ import { acquireConnection } from './pool.js'; -import { clearCacheByTableName } from '../functions.cache.js'; +import { clearCacheByTableName } from '../helpers/functions.cache.js'; export async function moveOccupancyTypePrintDown(occupancyTypeId, printEJS) { const database = await acquireConnection(); const currentOrderNumber = database diff --git a/helpers/lotOccupancyDB/moveOccupancyTypePrintDown.ts b/database/moveOccupancyTypePrintDown.ts similarity index 97% rename from helpers/lotOccupancyDB/moveOccupancyTypePrintDown.ts rename to database/moveOccupancyTypePrintDown.ts index 6c9ca543..62b2c544 100644 --- a/helpers/lotOccupancyDB/moveOccupancyTypePrintDown.ts +++ b/database/moveOccupancyTypePrintDown.ts @@ -1,6 +1,6 @@ import { acquireConnection } from './pool.js' -import { clearCacheByTableName } from '../functions.cache.js' +import { clearCacheByTableName } from '../helpers/functions.cache.js' export async function moveOccupancyTypePrintDown( occupancyTypeId: number | string, diff --git a/helpers/lotOccupancyDB/moveOccupancyTypePrintUp.d.ts b/database/moveOccupancyTypePrintUp.d.ts similarity index 100% rename from helpers/lotOccupancyDB/moveOccupancyTypePrintUp.d.ts rename to database/moveOccupancyTypePrintUp.d.ts diff --git a/helpers/lotOccupancyDB/moveOccupancyTypePrintUp.js b/database/moveOccupancyTypePrintUp.js similarity index 96% rename from helpers/lotOccupancyDB/moveOccupancyTypePrintUp.js rename to database/moveOccupancyTypePrintUp.js index 317559d1..9cf51f96 100644 --- a/helpers/lotOccupancyDB/moveOccupancyTypePrintUp.js +++ b/database/moveOccupancyTypePrintUp.js @@ -1,5 +1,5 @@ import { acquireConnection } from './pool.js'; -import { clearCacheByTableName } from '../functions.cache.js'; +import { clearCacheByTableName } from '../helpers/functions.cache.js'; export async function moveOccupancyTypePrintUp(occupancyTypeId, printEJS) { const database = await acquireConnection(); const currentOrderNumber = database diff --git a/helpers/lotOccupancyDB/moveOccupancyTypePrintUp.ts b/database/moveOccupancyTypePrintUp.ts similarity index 96% rename from helpers/lotOccupancyDB/moveOccupancyTypePrintUp.ts rename to database/moveOccupancyTypePrintUp.ts index d5284681..f2aba430 100644 --- a/helpers/lotOccupancyDB/moveOccupancyTypePrintUp.ts +++ b/database/moveOccupancyTypePrintUp.ts @@ -1,6 +1,6 @@ import { acquireConnection } from './pool.js' -import { clearCacheByTableName } from '../functions.cache.js' +import { clearCacheByTableName } from '../helpers/functions.cache.js' export async function moveOccupancyTypePrintUp( occupancyTypeId: number | string, diff --git a/helpers/lotOccupancyDB/moveRecord.d.ts b/database/moveRecord.d.ts similarity index 100% rename from helpers/lotOccupancyDB/moveRecord.d.ts rename to database/moveRecord.d.ts diff --git a/helpers/lotOccupancyDB/moveRecord.js b/database/moveRecord.js similarity index 98% rename from helpers/lotOccupancyDB/moveRecord.js rename to database/moveRecord.js index 85b045e2..39d09b7d 100644 --- a/helpers/lotOccupancyDB/moveRecord.js +++ b/database/moveRecord.js @@ -1,5 +1,5 @@ import { acquireConnection } from './pool.js'; -import { clearCacheByTableName } from '../functions.cache.js'; +import { clearCacheByTableName } from '../helpers/functions.cache.js'; import { updateRecordOrderNumber } from './updateRecordOrderNumber.js'; const recordIdColumns = new Map(); recordIdColumns.set('FeeCategories', 'feeCategoryId'); diff --git a/helpers/lotOccupancyDB/moveRecord.ts b/database/moveRecord.ts similarity index 98% rename from helpers/lotOccupancyDB/moveRecord.ts rename to database/moveRecord.ts index c4eb3456..14c277d8 100644 --- a/helpers/lotOccupancyDB/moveRecord.ts +++ b/database/moveRecord.ts @@ -1,7 +1,7 @@ import type sqlite from 'better-sqlite3' import { acquireConnection } from './pool.js' -import { clearCacheByTableName } from '../functions.cache.js' +import { clearCacheByTableName } from '../helpers/functions.cache.js' import { updateRecordOrderNumber } from './updateRecordOrderNumber.js' type RecordTable = diff --git a/helpers/lotOccupancyDB/pool.d.ts b/database/pool.d.ts similarity index 100% rename from helpers/lotOccupancyDB/pool.d.ts rename to database/pool.d.ts diff --git a/helpers/lotOccupancyDB/pool.js b/database/pool.js similarity index 83% rename from helpers/lotOccupancyDB/pool.js rename to database/pool.js index 1d841475..6b55c6f2 100644 --- a/helpers/lotOccupancyDB/pool.js +++ b/database/pool.js @@ -1,5 +1,5 @@ import { Pool } from 'better-sqlite-pool'; -import { lotOccupancyDB as databasePath } from '../../data/databasePaths.js'; +import { lotOccupancyDB as databasePath } from '../data/databasePaths.js'; import exitHook from 'exit-hook'; import Debug from 'debug'; const debug = Debug('lot-occupancy-system:lotOccupancyDB:pool'); diff --git a/helpers/lotOccupancyDB/pool.ts b/database/pool.ts similarity index 84% rename from helpers/lotOccupancyDB/pool.ts rename to database/pool.ts index 1bfa25b4..95078de6 100644 --- a/helpers/lotOccupancyDB/pool.ts +++ b/database/pool.ts @@ -1,6 +1,6 @@ import { Pool, type PoolConnection } from 'better-sqlite-pool' -import { lotOccupancyDB as databasePath } from '../../data/databasePaths.js' +import { lotOccupancyDB as databasePath } from '../data/databasePaths.js' import exitHook from 'exit-hook' diff --git a/helpers/lotOccupancyDB/reopenWorkOrder.d.ts b/database/reopenWorkOrder.d.ts similarity index 100% rename from helpers/lotOccupancyDB/reopenWorkOrder.d.ts rename to database/reopenWorkOrder.d.ts diff --git a/helpers/lotOccupancyDB/reopenWorkOrder.js b/database/reopenWorkOrder.js similarity index 100% rename from helpers/lotOccupancyDB/reopenWorkOrder.js rename to database/reopenWorkOrder.js diff --git a/helpers/lotOccupancyDB/reopenWorkOrder.ts b/database/reopenWorkOrder.ts similarity index 100% rename from helpers/lotOccupancyDB/reopenWorkOrder.ts rename to database/reopenWorkOrder.ts diff --git a/helpers/lotOccupancyDB/reopenWorkOrderMilestone.d.ts b/database/reopenWorkOrderMilestone.d.ts similarity index 100% rename from helpers/lotOccupancyDB/reopenWorkOrderMilestone.d.ts rename to database/reopenWorkOrderMilestone.d.ts diff --git a/helpers/lotOccupancyDB/reopenWorkOrderMilestone.js b/database/reopenWorkOrderMilestone.js similarity index 100% rename from helpers/lotOccupancyDB/reopenWorkOrderMilestone.js rename to database/reopenWorkOrderMilestone.js diff --git a/helpers/lotOccupancyDB/reopenWorkOrderMilestone.ts b/database/reopenWorkOrderMilestone.ts similarity index 100% rename from helpers/lotOccupancyDB/reopenWorkOrderMilestone.ts rename to database/reopenWorkOrderMilestone.ts diff --git a/helpers/lotOccupancyDB/updateFee.d.ts b/database/updateFee.d.ts similarity index 100% rename from helpers/lotOccupancyDB/updateFee.d.ts rename to database/updateFee.d.ts diff --git a/helpers/lotOccupancyDB/updateFee.js b/database/updateFee.js similarity index 100% rename from helpers/lotOccupancyDB/updateFee.js rename to database/updateFee.js diff --git a/helpers/lotOccupancyDB/updateFee.ts b/database/updateFee.ts similarity index 100% rename from helpers/lotOccupancyDB/updateFee.ts rename to database/updateFee.ts diff --git a/helpers/lotOccupancyDB/updateFeeCategory.d.ts b/database/updateFeeCategory.d.ts similarity index 100% rename from helpers/lotOccupancyDB/updateFeeCategory.d.ts rename to database/updateFeeCategory.d.ts diff --git a/helpers/lotOccupancyDB/updateFeeCategory.js b/database/updateFeeCategory.js similarity index 100% rename from helpers/lotOccupancyDB/updateFeeCategory.js rename to database/updateFeeCategory.js diff --git a/helpers/lotOccupancyDB/updateFeeCategory.ts b/database/updateFeeCategory.ts similarity index 100% rename from helpers/lotOccupancyDB/updateFeeCategory.ts rename to database/updateFeeCategory.ts diff --git a/helpers/lotOccupancyDB/updateLot.d.ts b/database/updateLot.d.ts similarity index 100% rename from helpers/lotOccupancyDB/updateLot.d.ts rename to database/updateLot.d.ts diff --git a/helpers/lotOccupancyDB/updateLot.js b/database/updateLot.js similarity index 100% rename from helpers/lotOccupancyDB/updateLot.js rename to database/updateLot.js diff --git a/helpers/lotOccupancyDB/updateLot.ts b/database/updateLot.ts similarity index 100% rename from helpers/lotOccupancyDB/updateLot.ts rename to database/updateLot.ts diff --git a/helpers/lotOccupancyDB/updateLotComment.d.ts b/database/updateLotComment.d.ts similarity index 100% rename from helpers/lotOccupancyDB/updateLotComment.d.ts rename to database/updateLotComment.d.ts diff --git a/helpers/lotOccupancyDB/updateLotComment.js b/database/updateLotComment.js similarity index 100% rename from helpers/lotOccupancyDB/updateLotComment.js rename to database/updateLotComment.js diff --git a/helpers/lotOccupancyDB/updateLotComment.ts b/database/updateLotComment.ts similarity index 100% rename from helpers/lotOccupancyDB/updateLotComment.ts rename to database/updateLotComment.ts diff --git a/helpers/lotOccupancyDB/updateLotOccupancy.d.ts b/database/updateLotOccupancy.d.ts similarity index 100% rename from helpers/lotOccupancyDB/updateLotOccupancy.d.ts rename to database/updateLotOccupancy.d.ts diff --git a/helpers/lotOccupancyDB/updateLotOccupancy.js b/database/updateLotOccupancy.js similarity index 100% rename from helpers/lotOccupancyDB/updateLotOccupancy.js rename to database/updateLotOccupancy.js diff --git a/helpers/lotOccupancyDB/updateLotOccupancy.ts b/database/updateLotOccupancy.ts similarity index 100% rename from helpers/lotOccupancyDB/updateLotOccupancy.ts rename to database/updateLotOccupancy.ts diff --git a/helpers/lotOccupancyDB/updateLotOccupancyComment.d.ts b/database/updateLotOccupancyComment.d.ts similarity index 100% rename from helpers/lotOccupancyDB/updateLotOccupancyComment.d.ts rename to database/updateLotOccupancyComment.d.ts diff --git a/helpers/lotOccupancyDB/updateLotOccupancyComment.js b/database/updateLotOccupancyComment.js similarity index 100% rename from helpers/lotOccupancyDB/updateLotOccupancyComment.js rename to database/updateLotOccupancyComment.js diff --git a/helpers/lotOccupancyDB/updateLotOccupancyComment.ts b/database/updateLotOccupancyComment.ts similarity index 100% rename from helpers/lotOccupancyDB/updateLotOccupancyComment.ts rename to database/updateLotOccupancyComment.ts diff --git a/helpers/lotOccupancyDB/updateLotOccupancyFeeQuantity.d.ts b/database/updateLotOccupancyFeeQuantity.d.ts similarity index 100% rename from helpers/lotOccupancyDB/updateLotOccupancyFeeQuantity.d.ts rename to database/updateLotOccupancyFeeQuantity.d.ts diff --git a/helpers/lotOccupancyDB/updateLotOccupancyFeeQuantity.js b/database/updateLotOccupancyFeeQuantity.js similarity index 100% rename from helpers/lotOccupancyDB/updateLotOccupancyFeeQuantity.js rename to database/updateLotOccupancyFeeQuantity.js diff --git a/helpers/lotOccupancyDB/updateLotOccupancyFeeQuantity.ts b/database/updateLotOccupancyFeeQuantity.ts similarity index 100% rename from helpers/lotOccupancyDB/updateLotOccupancyFeeQuantity.ts rename to database/updateLotOccupancyFeeQuantity.ts diff --git a/helpers/lotOccupancyDB/updateLotOccupancyOccupant.d.ts b/database/updateLotOccupancyOccupant.d.ts similarity index 100% rename from helpers/lotOccupancyDB/updateLotOccupancyOccupant.d.ts rename to database/updateLotOccupancyOccupant.d.ts diff --git a/helpers/lotOccupancyDB/updateLotOccupancyOccupant.js b/database/updateLotOccupancyOccupant.js similarity index 100% rename from helpers/lotOccupancyDB/updateLotOccupancyOccupant.js rename to database/updateLotOccupancyOccupant.js diff --git a/helpers/lotOccupancyDB/updateLotOccupancyOccupant.ts b/database/updateLotOccupancyOccupant.ts similarity index 100% rename from helpers/lotOccupancyDB/updateLotOccupancyOccupant.ts rename to database/updateLotOccupancyOccupant.ts diff --git a/helpers/lotOccupancyDB/updateLotOccupancyTransaction.d.ts b/database/updateLotOccupancyTransaction.d.ts similarity index 100% rename from helpers/lotOccupancyDB/updateLotOccupancyTransaction.d.ts rename to database/updateLotOccupancyTransaction.d.ts diff --git a/helpers/lotOccupancyDB/updateLotOccupancyTransaction.js b/database/updateLotOccupancyTransaction.js similarity index 100% rename from helpers/lotOccupancyDB/updateLotOccupancyTransaction.js rename to database/updateLotOccupancyTransaction.js diff --git a/helpers/lotOccupancyDB/updateLotOccupancyTransaction.ts b/database/updateLotOccupancyTransaction.ts similarity index 100% rename from helpers/lotOccupancyDB/updateLotOccupancyTransaction.ts rename to database/updateLotOccupancyTransaction.ts diff --git a/helpers/lotOccupancyDB/updateLotOccupantType.d.ts b/database/updateLotOccupantType.d.ts similarity index 100% rename from helpers/lotOccupancyDB/updateLotOccupantType.d.ts rename to database/updateLotOccupantType.d.ts diff --git a/helpers/lotOccupancyDB/updateLotOccupantType.js b/database/updateLotOccupantType.js similarity index 92% rename from helpers/lotOccupancyDB/updateLotOccupantType.js rename to database/updateLotOccupantType.js index a24afdc9..7b57ab06 100644 --- a/helpers/lotOccupancyDB/updateLotOccupantType.js +++ b/database/updateLotOccupantType.js @@ -1,4 +1,4 @@ -import { clearCacheByTableName } from '../functions.cache.js'; +import { clearCacheByTableName } from '../helpers/functions.cache.js'; import { acquireConnection } from './pool.js'; export async function updateLotOccupantType(lotOccupantTypeForm, user) { const database = await acquireConnection(); diff --git a/helpers/lotOccupancyDB/updateLotOccupantType.ts b/database/updateLotOccupantType.ts similarity index 93% rename from helpers/lotOccupancyDB/updateLotOccupantType.ts rename to database/updateLotOccupantType.ts index 91ce1ebd..bd2d8aa4 100644 --- a/helpers/lotOccupancyDB/updateLotOccupantType.ts +++ b/database/updateLotOccupantType.ts @@ -1,4 +1,4 @@ -import { clearCacheByTableName } from '../functions.cache.js' +import { clearCacheByTableName } from '../helpers/functions.cache.js' import { acquireConnection } from './pool.js' diff --git a/helpers/lotOccupancyDB/updateLotTypeField.d.ts b/database/updateLotTypeField.d.ts similarity index 100% rename from helpers/lotOccupancyDB/updateLotTypeField.d.ts rename to database/updateLotTypeField.d.ts diff --git a/helpers/lotOccupancyDB/updateLotTypeField.js b/database/updateLotTypeField.js similarity index 93% rename from helpers/lotOccupancyDB/updateLotTypeField.js rename to database/updateLotTypeField.js index 1dd6303f..b1369ab5 100644 --- a/helpers/lotOccupancyDB/updateLotTypeField.js +++ b/database/updateLotTypeField.js @@ -1,4 +1,4 @@ -import { clearCacheByTableName } from '../functions.cache.js'; +import { clearCacheByTableName } from '../helpers/functions.cache.js'; import { acquireConnection } from './pool.js'; export async function updateLotTypeField(lotTypeFieldForm, user) { const database = await acquireConnection(); diff --git a/helpers/lotOccupancyDB/updateLotTypeField.ts b/database/updateLotTypeField.ts similarity index 94% rename from helpers/lotOccupancyDB/updateLotTypeField.ts rename to database/updateLotTypeField.ts index 42b10284..736932e2 100644 --- a/helpers/lotOccupancyDB/updateLotTypeField.ts +++ b/database/updateLotTypeField.ts @@ -1,4 +1,4 @@ -import { clearCacheByTableName } from '../functions.cache.js' +import { clearCacheByTableName } from '../helpers/functions.cache.js' import { acquireConnection } from './pool.js' diff --git a/helpers/lotOccupancyDB/updateMap.d.ts b/database/updateMap.d.ts similarity index 100% rename from helpers/lotOccupancyDB/updateMap.d.ts rename to database/updateMap.d.ts diff --git a/helpers/lotOccupancyDB/updateMap.js b/database/updateMap.js similarity index 100% rename from helpers/lotOccupancyDB/updateMap.js rename to database/updateMap.js diff --git a/helpers/lotOccupancyDB/updateMap.ts b/database/updateMap.ts similarity index 100% rename from helpers/lotOccupancyDB/updateMap.ts rename to database/updateMap.ts diff --git a/helpers/lotOccupancyDB/updateOccupancyTypeField.d.ts b/database/updateOccupancyTypeField.d.ts similarity index 100% rename from helpers/lotOccupancyDB/updateOccupancyTypeField.d.ts rename to database/updateOccupancyTypeField.d.ts diff --git a/helpers/lotOccupancyDB/updateOccupancyTypeField.js b/database/updateOccupancyTypeField.js similarity index 93% rename from helpers/lotOccupancyDB/updateOccupancyTypeField.js rename to database/updateOccupancyTypeField.js index 6bc7d9f9..736d62c9 100644 --- a/helpers/lotOccupancyDB/updateOccupancyTypeField.js +++ b/database/updateOccupancyTypeField.js @@ -1,4 +1,4 @@ -import { clearCacheByTableName } from '../functions.cache.js'; +import { clearCacheByTableName } from '../helpers/functions.cache.js'; import { acquireConnection } from './pool.js'; export async function updateOccupancyTypeField(occupancyTypeFieldForm, user) { const database = await acquireConnection(); diff --git a/helpers/lotOccupancyDB/updateOccupancyTypeField.ts b/database/updateOccupancyTypeField.ts similarity index 95% rename from helpers/lotOccupancyDB/updateOccupancyTypeField.ts rename to database/updateOccupancyTypeField.ts index 2bcc9e85..6f8a4bf7 100644 --- a/helpers/lotOccupancyDB/updateOccupancyTypeField.ts +++ b/database/updateOccupancyTypeField.ts @@ -1,4 +1,4 @@ -import { clearCacheByTableName } from '../functions.cache.js' +import { clearCacheByTableName } from '../helpers/functions.cache.js' import { acquireConnection } from './pool.js' diff --git a/helpers/lotOccupancyDB/updateRecord.d.ts b/database/updateRecord.d.ts similarity index 100% rename from helpers/lotOccupancyDB/updateRecord.d.ts rename to database/updateRecord.d.ts diff --git a/helpers/lotOccupancyDB/updateRecord.js b/database/updateRecord.js similarity index 94% rename from helpers/lotOccupancyDB/updateRecord.js rename to database/updateRecord.js index 55940af1..ff1677f3 100644 --- a/helpers/lotOccupancyDB/updateRecord.js +++ b/database/updateRecord.js @@ -1,4 +1,4 @@ -import { clearCacheByTableName } from '../functions.cache.js'; +import { clearCacheByTableName } from '../helpers/functions.cache.js'; import { acquireConnection } from './pool.js'; const recordNameIdColumns = new Map(); recordNameIdColumns.set('FeeCategories', ['feeCategory', 'feeCategoryId']); diff --git a/helpers/lotOccupancyDB/updateRecord.ts b/database/updateRecord.ts similarity index 95% rename from helpers/lotOccupancyDB/updateRecord.ts rename to database/updateRecord.ts index add0d563..2f8ed4d2 100644 --- a/helpers/lotOccupancyDB/updateRecord.ts +++ b/database/updateRecord.ts @@ -1,4 +1,4 @@ -import { clearCacheByTableName } from '../functions.cache.js' +import { clearCacheByTableName } from '../helpers/functions.cache.js' import { acquireConnection } from './pool.js' diff --git a/helpers/lotOccupancyDB/updateRecordOrderNumber.d.ts b/database/updateRecordOrderNumber.d.ts similarity index 100% rename from helpers/lotOccupancyDB/updateRecordOrderNumber.d.ts rename to database/updateRecordOrderNumber.d.ts diff --git a/helpers/lotOccupancyDB/updateRecordOrderNumber.js b/database/updateRecordOrderNumber.js similarity index 100% rename from helpers/lotOccupancyDB/updateRecordOrderNumber.js rename to database/updateRecordOrderNumber.js diff --git a/helpers/lotOccupancyDB/updateRecordOrderNumber.ts b/database/updateRecordOrderNumber.ts similarity index 100% rename from helpers/lotOccupancyDB/updateRecordOrderNumber.ts rename to database/updateRecordOrderNumber.ts diff --git a/helpers/lotOccupancyDB/updateWorkOrder.d.ts b/database/updateWorkOrder.d.ts similarity index 100% rename from helpers/lotOccupancyDB/updateWorkOrder.d.ts rename to database/updateWorkOrder.d.ts diff --git a/helpers/lotOccupancyDB/updateWorkOrder.js b/database/updateWorkOrder.js similarity index 100% rename from helpers/lotOccupancyDB/updateWorkOrder.js rename to database/updateWorkOrder.js diff --git a/helpers/lotOccupancyDB/updateWorkOrder.ts b/database/updateWorkOrder.ts similarity index 100% rename from helpers/lotOccupancyDB/updateWorkOrder.ts rename to database/updateWorkOrder.ts diff --git a/helpers/lotOccupancyDB/updateWorkOrderComment.d.ts b/database/updateWorkOrderComment.d.ts similarity index 100% rename from helpers/lotOccupancyDB/updateWorkOrderComment.d.ts rename to database/updateWorkOrderComment.d.ts diff --git a/helpers/lotOccupancyDB/updateWorkOrderComment.js b/database/updateWorkOrderComment.js similarity index 100% rename from helpers/lotOccupancyDB/updateWorkOrderComment.js rename to database/updateWorkOrderComment.js diff --git a/helpers/lotOccupancyDB/updateWorkOrderComment.ts b/database/updateWorkOrderComment.ts similarity index 100% rename from helpers/lotOccupancyDB/updateWorkOrderComment.ts rename to database/updateWorkOrderComment.ts diff --git a/helpers/lotOccupancyDB/updateWorkOrderMilestone.d.ts b/database/updateWorkOrderMilestone.d.ts similarity index 100% rename from helpers/lotOccupancyDB/updateWorkOrderMilestone.d.ts rename to database/updateWorkOrderMilestone.d.ts diff --git a/helpers/lotOccupancyDB/updateWorkOrderMilestone.js b/database/updateWorkOrderMilestone.js similarity index 100% rename from helpers/lotOccupancyDB/updateWorkOrderMilestone.js rename to database/updateWorkOrderMilestone.js diff --git a/helpers/lotOccupancyDB/updateWorkOrderMilestone.ts b/database/updateWorkOrderMilestone.ts similarity index 100% rename from helpers/lotOccupancyDB/updateWorkOrderMilestone.ts rename to database/updateWorkOrderMilestone.ts diff --git a/handlers/admin-get/fees.js b/handlers/admin-get/fees.js index 59599e20..a8248271 100644 --- a/handlers/admin-get/fees.js +++ b/handlers/admin-get/fees.js @@ -1,5 +1,5 @@ +import { getFeeCategories } from '../../database/getFeeCategories.js'; import { getLotTypes, getOccupancyTypes } from '../../helpers/functions.cache.js'; -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js'; export async function handler(_request, response) { const feeCategories = await getFeeCategories({}, { includeFees: true diff --git a/handlers/admin-get/fees.ts b/handlers/admin-get/fees.ts index 0585798c..3978677f 100644 --- a/handlers/admin-get/fees.ts +++ b/handlers/admin-get/fees.ts @@ -1,12 +1,11 @@ import type { Request, Response } from 'express' +import { getFeeCategories } from '../../database/getFeeCategories.js' import { getLotTypes, getOccupancyTypes } from '../../helpers/functions.cache.js' -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js' - export async function handler( _request: Request, response: Response diff --git a/handlers/admin-get/lotTypes.js b/handlers/admin-get/lotTypes.js index 8738301e..dc606cf6 100644 --- a/handlers/admin-get/lotTypes.js +++ b/handlers/admin-get/lotTypes.js @@ -3,7 +3,7 @@ import * as configFunctions from '../../helpers/functions.config.js'; export async function handler(_request, response) { const lotTypes = await getLotTypes(); response.render('admin-lotTypes', { - headTitle: configFunctions.getProperty('aliases.lot') + ' Type Management', + headTitle: `${configFunctions.getProperty('aliases.lot')} Type Management`, lotTypes }); } diff --git a/handlers/admin-get/lotTypes.ts b/handlers/admin-get/lotTypes.ts index 1d0e92aa..9fd7fd98 100644 --- a/handlers/admin-get/lotTypes.ts +++ b/handlers/admin-get/lotTypes.ts @@ -1,7 +1,6 @@ import type { Request, Response } from 'express' import { getLotTypes } from '../../helpers/functions.cache.js' - import * as configFunctions from '../../helpers/functions.config.js' export async function handler( @@ -11,7 +10,7 @@ export async function handler( const lotTypes = await getLotTypes() response.render('admin-lotTypes', { - headTitle: configFunctions.getProperty('aliases.lot') + ' Type Management', + headTitle: `${configFunctions.getProperty('aliases.lot')} Type Management`, lotTypes }) } diff --git a/handlers/admin-get/occupancyTypes.js b/handlers/admin-get/occupancyTypes.js index 9ece2e01..b534c672 100644 --- a/handlers/admin-get/occupancyTypes.js +++ b/handlers/admin-get/occupancyTypes.js @@ -1,6 +1,6 @@ +import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js'; import * as configFunctions from '../../helpers/functions.config.js'; import * as printFunctions from '../../helpers/functions.print.js'; -import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js'; export async function handler(_request, response) { const occupancyTypes = await getOccupancyTypes(); const allOccupancyTypeFields = await getAllOccupancyTypeFields(); @@ -13,7 +13,7 @@ export async function handler(_request, response) { } } response.render('admin-occupancyTypes', { - headTitle: configFunctions.getProperty('aliases.occupancy') + ' Type Management', + headTitle: `${configFunctions.getProperty('aliases.occupancy')} Type Management`, occupancyTypes, allOccupancyTypeFields, occupancyTypePrintTitles diff --git a/handlers/admin-get/occupancyTypes.ts b/handlers/admin-get/occupancyTypes.ts index 27ad0c30..9667b6e4 100644 --- a/handlers/admin-get/occupancyTypes.ts +++ b/handlers/admin-get/occupancyTypes.ts @@ -1,12 +1,11 @@ import type { Request, Response } from 'express' -import * as configFunctions from '../../helpers/functions.config.js' -import * as printFunctions from '../../helpers/functions.print.js' - import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js' +import * as configFunctions from '../../helpers/functions.config.js' +import * as printFunctions from '../../helpers/functions.print.js' export async function handler( _request: Request, @@ -31,7 +30,7 @@ export async function handler( response.render('admin-occupancyTypes', { headTitle: - configFunctions.getProperty('aliases.occupancy') + ' Type Management', + `${configFunctions.getProperty('aliases.occupancy')} Type Management`, occupancyTypes, allOccupancyTypeFields, occupancyTypePrintTitles diff --git a/handlers/admin-get/tables.ts b/handlers/admin-get/tables.ts index 26a0cb89..9898c9c7 100644 --- a/handlers/admin-get/tables.ts +++ b/handlers/admin-get/tables.ts @@ -6,7 +6,6 @@ import { getWorkOrderMilestoneTypes, getWorkOrderTypes } from '../../helpers/functions.cache.js' - import { getSolidIconClasses } from '../../helpers/functions.icons.js' export async function handler(_request: Request, response: Response): Promise { diff --git a/handlers/admin-post/doAddFee.js b/handlers/admin-post/doAddFee.js index 66ca8996..2a9e218b 100644 --- a/handlers/admin-post/doAddFee.js +++ b/handlers/admin-post/doAddFee.js @@ -1,5 +1,5 @@ -import { addFee } from '../../helpers/lotOccupancyDB/addFee.js'; -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js'; +import { addFee } from '../../database/addFee.js'; +import { getFeeCategories } from '../../database/getFeeCategories.js'; export async function handler(request, response) { const feeId = await addFee(request.body, request.session.user); const feeCategories = await getFeeCategories({}, { diff --git a/handlers/admin-post/doAddFee.ts b/handlers/admin-post/doAddFee.ts index 73ae8bab..14896d9f 100644 --- a/handlers/admin-post/doAddFee.ts +++ b/handlers/admin-post/doAddFee.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { addFee } from '../../helpers/lotOccupancyDB/addFee.js' -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js' +import { addFee } from '../../database/addFee.js' +import { getFeeCategories } from '../../database/getFeeCategories.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doAddFeeCategory.js b/handlers/admin-post/doAddFeeCategory.js index 25d45708..14331237 100644 --- a/handlers/admin-post/doAddFeeCategory.js +++ b/handlers/admin-post/doAddFeeCategory.js @@ -1,5 +1,5 @@ -import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js'; -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js'; +import { addRecord } from '../../database/addRecord.js'; +import { getFeeCategories } from '../../database/getFeeCategories.js'; export async function handler(request, response) { const feeCategoryId = await addRecord('FeeCategories', request.body.feeCategory, request.body.orderNumber ?? -1, request.session.user); const feeCategories = await getFeeCategories({}, { diff --git a/handlers/admin-post/doAddFeeCategory.ts b/handlers/admin-post/doAddFeeCategory.ts index be9602cf..6029b11f 100644 --- a/handlers/admin-post/doAddFeeCategory.ts +++ b/handlers/admin-post/doAddFeeCategory.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js' -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js' +import { addRecord } from '../../database/addRecord.js' +import { getFeeCategories } from '../../database/getFeeCategories.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doAddLotOccupantType.js b/handlers/admin-post/doAddLotOccupantType.js index 2eeed1cb..63e3111c 100644 --- a/handlers/admin-post/doAddLotOccupantType.js +++ b/handlers/admin-post/doAddLotOccupantType.js @@ -1,5 +1,5 @@ import { getLotOccupantTypes } from '../../helpers/functions.cache.js'; -import { addLotOccupantType } from '../../helpers/lotOccupancyDB/addLotOccupantType.js'; +import { addLotOccupantType } from '../../database/addLotOccupantType.js'; export async function handler(request, response) { const lotOccupantTypeId = await addLotOccupantType(request.body, request.session.user); const lotOccupantTypes = await getLotOccupantTypes(); diff --git a/handlers/admin-post/doAddLotOccupantType.ts b/handlers/admin-post/doAddLotOccupantType.ts index 4d2909e3..ea2f4136 100644 --- a/handlers/admin-post/doAddLotOccupantType.ts +++ b/handlers/admin-post/doAddLotOccupantType.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' import { getLotOccupantTypes } from '../../helpers/functions.cache.js' -import { addLotOccupantType } from '../../helpers/lotOccupancyDB/addLotOccupantType.js' +import { addLotOccupantType } from '../../database/addLotOccupantType.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doAddLotStatus.js b/handlers/admin-post/doAddLotStatus.js index 0cd26202..e047fab8 100644 --- a/handlers/admin-post/doAddLotStatus.js +++ b/handlers/admin-post/doAddLotStatus.js @@ -1,5 +1,5 @@ import { getLotStatuses } from '../../helpers/functions.cache.js'; -import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js'; +import { addRecord } from '../../database/addRecord.js'; export async function handler(request, response) { const lotStatusId = await addRecord('LotStatuses', request.body.lotStatus, request.body.orderNumber ?? -1, request.session.user); const lotStatuses = await getLotStatuses(); diff --git a/handlers/admin-post/doAddLotStatus.ts b/handlers/admin-post/doAddLotStatus.ts index 9a7b61c2..04579683 100644 --- a/handlers/admin-post/doAddLotStatus.ts +++ b/handlers/admin-post/doAddLotStatus.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' import { getLotStatuses } from '../../helpers/functions.cache.js' -import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js' +import { addRecord } from '../../database/addRecord.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doAddLotType.js b/handlers/admin-post/doAddLotType.js index 1acd3159..77574def 100644 --- a/handlers/admin-post/doAddLotType.js +++ b/handlers/admin-post/doAddLotType.js @@ -1,5 +1,5 @@ import { getLotTypes } from '../../helpers/functions.cache.js'; -import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js'; +import { addRecord } from '../../database/addRecord.js'; export async function handler(request, response) { const lotTypeId = await addRecord('LotTypes', request.body.lotType, request.body.orderNumber ?? -1, request.session.user); const lotTypes = await getLotTypes(); diff --git a/handlers/admin-post/doAddLotType.ts b/handlers/admin-post/doAddLotType.ts index 83447846..fbf50ae0 100644 --- a/handlers/admin-post/doAddLotType.ts +++ b/handlers/admin-post/doAddLotType.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' import { getLotTypes } from '../../helpers/functions.cache.js' -import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js' +import { addRecord } from '../../database/addRecord.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doAddLotTypeField.js b/handlers/admin-post/doAddLotTypeField.js index 26a6349b..705f43fd 100644 --- a/handlers/admin-post/doAddLotTypeField.js +++ b/handlers/admin-post/doAddLotTypeField.js @@ -1,5 +1,5 @@ import { getLotTypes } from '../../helpers/functions.cache.js'; -import { addLotTypeField } from '../../helpers/lotOccupancyDB/addLotTypeField.js'; +import { addLotTypeField } from '../../database/addLotTypeField.js'; export async function handler(request, response) { const lotTypeFieldId = await addLotTypeField(request.body, request.session.user); const lotTypes = await getLotTypes(); diff --git a/handlers/admin-post/doAddLotTypeField.ts b/handlers/admin-post/doAddLotTypeField.ts index 3468f8a7..967b238d 100644 --- a/handlers/admin-post/doAddLotTypeField.ts +++ b/handlers/admin-post/doAddLotTypeField.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' import { getLotTypes } from '../../helpers/functions.cache.js' -import { addLotTypeField } from '../../helpers/lotOccupancyDB/addLotTypeField.js' +import { addLotTypeField } from '../../database/addLotTypeField.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doAddOccupancyType.js b/handlers/admin-post/doAddOccupancyType.js index a6b6067c..8a047bf9 100644 --- a/handlers/admin-post/doAddOccupancyType.js +++ b/handlers/admin-post/doAddOccupancyType.js @@ -1,5 +1,5 @@ import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js'; -import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js'; +import { addRecord } from '../../database/addRecord.js'; export async function handler(request, response) { const occupancyTypeId = await addRecord('OccupancyTypes', request.body.occupancyType, request.body.orderNumber ?? -1, request.session.user); const occupancyTypes = await getOccupancyTypes(); diff --git a/handlers/admin-post/doAddOccupancyType.ts b/handlers/admin-post/doAddOccupancyType.ts index 2ab35bd5..6aebe123 100644 --- a/handlers/admin-post/doAddOccupancyType.ts +++ b/handlers/admin-post/doAddOccupancyType.ts @@ -4,7 +4,7 @@ import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js' -import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js' +import { addRecord } from '../../database/addRecord.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doAddOccupancyTypeField.js b/handlers/admin-post/doAddOccupancyTypeField.js index 8e4e291f..9e579943 100644 --- a/handlers/admin-post/doAddOccupancyTypeField.js +++ b/handlers/admin-post/doAddOccupancyTypeField.js @@ -1,5 +1,5 @@ import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js'; -import { addOccupancyTypeField } from '../../helpers/lotOccupancyDB/addOccupancyTypeField.js'; +import { addOccupancyTypeField } from '../../database/addOccupancyTypeField.js'; export async function handler(request, response) { const occupancyTypeFieldId = await addOccupancyTypeField(request.body, request.session.user); const occupancyTypes = await getOccupancyTypes(); diff --git a/handlers/admin-post/doAddOccupancyTypeField.ts b/handlers/admin-post/doAddOccupancyTypeField.ts index 882bc74d..36e2402a 100644 --- a/handlers/admin-post/doAddOccupancyTypeField.ts +++ b/handlers/admin-post/doAddOccupancyTypeField.ts @@ -4,7 +4,7 @@ import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js' -import { addOccupancyTypeField } from '../../helpers/lotOccupancyDB/addOccupancyTypeField.js' +import { addOccupancyTypeField } from '../../database/addOccupancyTypeField.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doAddOccupancyTypePrint.js b/handlers/admin-post/doAddOccupancyTypePrint.js index a9481b63..b371bb75 100644 --- a/handlers/admin-post/doAddOccupancyTypePrint.js +++ b/handlers/admin-post/doAddOccupancyTypePrint.js @@ -1,5 +1,5 @@ import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js'; -import { addOccupancyTypePrint } from '../../helpers/lotOccupancyDB/addOccupancyTypePrint.js'; +import { addOccupancyTypePrint } from '../../database/addOccupancyTypePrint.js'; export async function handler(request, response) { const success = await addOccupancyTypePrint(request.body, request.session.user); const occupancyTypes = await getOccupancyTypes(); diff --git a/handlers/admin-post/doAddOccupancyTypePrint.ts b/handlers/admin-post/doAddOccupancyTypePrint.ts index bffd7e35..008ed9e8 100644 --- a/handlers/admin-post/doAddOccupancyTypePrint.ts +++ b/handlers/admin-post/doAddOccupancyTypePrint.ts @@ -4,7 +4,7 @@ import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js' -import { addOccupancyTypePrint } from '../../helpers/lotOccupancyDB/addOccupancyTypePrint.js' +import { addOccupancyTypePrint } from '../../database/addOccupancyTypePrint.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doAddWorkOrderMilestoneType.js b/handlers/admin-post/doAddWorkOrderMilestoneType.js index 0ee468dd..293e70bb 100644 --- a/handlers/admin-post/doAddWorkOrderMilestoneType.js +++ b/handlers/admin-post/doAddWorkOrderMilestoneType.js @@ -1,5 +1,5 @@ import { getWorkOrderMilestoneTypes } from '../../helpers/functions.cache.js'; -import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js'; +import { addRecord } from '../../database/addRecord.js'; export async function handler(request, response) { const workOrderMilestoneTypeId = await addRecord('WorkOrderMilestoneTypes', request.body.workOrderMilestoneType, request.body.orderNumber ?? -1, request.session.user); const workOrderMilestoneTypes = await getWorkOrderMilestoneTypes(); diff --git a/handlers/admin-post/doAddWorkOrderMilestoneType.ts b/handlers/admin-post/doAddWorkOrderMilestoneType.ts index 2d25d1dc..263cfc2c 100644 --- a/handlers/admin-post/doAddWorkOrderMilestoneType.ts +++ b/handlers/admin-post/doAddWorkOrderMilestoneType.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' import { getWorkOrderMilestoneTypes } from '../../helpers/functions.cache.js' -import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js' +import { addRecord } from '../../database/addRecord.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doAddWorkOrderType.js b/handlers/admin-post/doAddWorkOrderType.js index fcd78ace..8d2900b3 100644 --- a/handlers/admin-post/doAddWorkOrderType.js +++ b/handlers/admin-post/doAddWorkOrderType.js @@ -1,5 +1,5 @@ import { getWorkOrderTypes } from '../../helpers/functions.cache.js'; -import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js'; +import { addRecord } from '../../database/addRecord.js'; export async function handler(request, response) { const workOrderTypeId = await addRecord('WorkOrderTypes', request.body.workOrderType, request.body.orderNumber ?? -1, request.session.user); const workOrderTypes = await getWorkOrderTypes(); diff --git a/handlers/admin-post/doAddWorkOrderType.ts b/handlers/admin-post/doAddWorkOrderType.ts index 714a9994..f440f76f 100644 --- a/handlers/admin-post/doAddWorkOrderType.ts +++ b/handlers/admin-post/doAddWorkOrderType.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' import { getWorkOrderTypes } from '../../helpers/functions.cache.js' -import { addRecord } from '../../helpers/lotOccupancyDB/addRecord.js' +import { addRecord } from '../../database/addRecord.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doCleanupDatabase.js b/handlers/admin-post/doCleanupDatabase.js index 4ba5699f..6b20366e 100644 --- a/handlers/admin-post/doCleanupDatabase.js +++ b/handlers/admin-post/doCleanupDatabase.js @@ -1,4 +1,4 @@ -import { cleanupDatabase } from '../../helpers/lotOccupancyDB/cleanupDatabase.js'; +import { cleanupDatabase } from '../../database/cleanupDatabase.js'; export async function handler(request, response) { const recordCounts = await cleanupDatabase(request.session.user); response.json({ diff --git a/handlers/admin-post/doCleanupDatabase.ts b/handlers/admin-post/doCleanupDatabase.ts index 819e532d..5899b119 100644 --- a/handlers/admin-post/doCleanupDatabase.ts +++ b/handlers/admin-post/doCleanupDatabase.ts @@ -1,6 +1,6 @@ import type { Request, Response } from 'express' -import { cleanupDatabase } from '../../helpers/lotOccupancyDB/cleanupDatabase.js' +import { cleanupDatabase } from '../../database/cleanupDatabase.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doDeleteFee.js b/handlers/admin-post/doDeleteFee.js index 4a74948c..0c8d3ef0 100644 --- a/handlers/admin-post/doDeleteFee.js +++ b/handlers/admin-post/doDeleteFee.js @@ -1,5 +1,5 @@ -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'; -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js'; +import { deleteRecord } from '../../database/deleteRecord.js'; +import { getFeeCategories } from '../../database/getFeeCategories.js'; export async function handler(request, response) { const success = await deleteRecord('Fees', request.body.feeId, request.session.user); const feeCategories = await getFeeCategories({}, { diff --git a/handlers/admin-post/doDeleteFee.ts b/handlers/admin-post/doDeleteFee.ts index 6339c164..6d43139a 100644 --- a/handlers/admin-post/doDeleteFee.ts +++ b/handlers/admin-post/doDeleteFee.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js' -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js' +import { deleteRecord } from '../../database/deleteRecord.js' +import { getFeeCategories } from '../../database/getFeeCategories.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doDeleteFeeCategory.js b/handlers/admin-post/doDeleteFeeCategory.js index de4e9034..168e7616 100644 --- a/handlers/admin-post/doDeleteFeeCategory.js +++ b/handlers/admin-post/doDeleteFeeCategory.js @@ -1,5 +1,5 @@ -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'; -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js'; +import { deleteRecord } from '../../database/deleteRecord.js'; +import { getFeeCategories } from '../../database/getFeeCategories.js'; export async function handler(request, response) { const success = await deleteRecord('FeeCategories', request.body.feeCategoryId, request.session.user); const feeCategories = await getFeeCategories({}, { diff --git a/handlers/admin-post/doDeleteFeeCategory.ts b/handlers/admin-post/doDeleteFeeCategory.ts index 0ed29494..a99e7f89 100644 --- a/handlers/admin-post/doDeleteFeeCategory.ts +++ b/handlers/admin-post/doDeleteFeeCategory.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js' -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js' +import { deleteRecord } from '../../database/deleteRecord.js' +import { getFeeCategories } from '../../database/getFeeCategories.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doDeleteLotOccupantType.js b/handlers/admin-post/doDeleteLotOccupantType.js index 2d6ad4a0..695ba655 100644 --- a/handlers/admin-post/doDeleteLotOccupantType.js +++ b/handlers/admin-post/doDeleteLotOccupantType.js @@ -1,5 +1,5 @@ import { getLotOccupantTypes } from '../../helpers/functions.cache.js'; -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'; +import { deleteRecord } from '../../database/deleteRecord.js'; export async function handler(request, response) { const success = await deleteRecord('LotOccupantTypes', request.body.lotOccupantTypeId, request.session.user); const lotOccupantTypes = await getLotOccupantTypes(); diff --git a/handlers/admin-post/doDeleteLotOccupantType.ts b/handlers/admin-post/doDeleteLotOccupantType.ts index 2f44d760..c5ce4f1a 100644 --- a/handlers/admin-post/doDeleteLotOccupantType.ts +++ b/handlers/admin-post/doDeleteLotOccupantType.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' import { getLotOccupantTypes } from '../../helpers/functions.cache.js' -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js' +import { deleteRecord } from '../../database/deleteRecord.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doDeleteLotStatus.js b/handlers/admin-post/doDeleteLotStatus.js index 00ad05bc..797d6d98 100644 --- a/handlers/admin-post/doDeleteLotStatus.js +++ b/handlers/admin-post/doDeleteLotStatus.js @@ -1,5 +1,5 @@ import { getLotStatuses } from '../../helpers/functions.cache.js'; -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'; +import { deleteRecord } from '../../database/deleteRecord.js'; export async function handler(request, response) { const success = await deleteRecord('LotStatuses', request.body.lotStatusId, request.session.user); const lotStatuses = await getLotStatuses(); diff --git a/handlers/admin-post/doDeleteLotStatus.ts b/handlers/admin-post/doDeleteLotStatus.ts index 89d80d1c..41ec8d29 100644 --- a/handlers/admin-post/doDeleteLotStatus.ts +++ b/handlers/admin-post/doDeleteLotStatus.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' import { getLotStatuses } from '../../helpers/functions.cache.js' -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js' +import { deleteRecord } from '../../database/deleteRecord.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doDeleteLotType.js b/handlers/admin-post/doDeleteLotType.js index 8d27981f..fe33a32d 100644 --- a/handlers/admin-post/doDeleteLotType.js +++ b/handlers/admin-post/doDeleteLotType.js @@ -1,5 +1,5 @@ import { getLotTypes } from '../../helpers/functions.cache.js'; -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'; +import { deleteRecord } from '../../database/deleteRecord.js'; export async function handler(request, response) { const success = await deleteRecord('LotTypes', request.body.lotTypeId, request.session.user); const lotTypes = await getLotTypes(); diff --git a/handlers/admin-post/doDeleteLotType.ts b/handlers/admin-post/doDeleteLotType.ts index 2cf25534..5657792f 100644 --- a/handlers/admin-post/doDeleteLotType.ts +++ b/handlers/admin-post/doDeleteLotType.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' import { getLotTypes } from '../../helpers/functions.cache.js' -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js' +import { deleteRecord } from '../../database/deleteRecord.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doDeleteLotTypeField.js b/handlers/admin-post/doDeleteLotTypeField.js index c31defc9..27e1c146 100644 --- a/handlers/admin-post/doDeleteLotTypeField.js +++ b/handlers/admin-post/doDeleteLotTypeField.js @@ -1,5 +1,5 @@ import { getLotTypes } from '../../helpers/functions.cache.js'; -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'; +import { deleteRecord } from '../../database/deleteRecord.js'; export async function handler(request, response) { const success = await deleteRecord('LotTypeFields', request.body.lotTypeFieldId, request.session.user); const lotTypes = await getLotTypes(); diff --git a/handlers/admin-post/doDeleteLotTypeField.ts b/handlers/admin-post/doDeleteLotTypeField.ts index fad540ca..431c15d0 100644 --- a/handlers/admin-post/doDeleteLotTypeField.ts +++ b/handlers/admin-post/doDeleteLotTypeField.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' import { getLotTypes } from '../../helpers/functions.cache.js' -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js' +import { deleteRecord } from '../../database/deleteRecord.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doDeleteOccupancyType.js b/handlers/admin-post/doDeleteOccupancyType.js index 54b2d874..7054a031 100644 --- a/handlers/admin-post/doDeleteOccupancyType.js +++ b/handlers/admin-post/doDeleteOccupancyType.js @@ -1,5 +1,5 @@ import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js'; -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'; +import { deleteRecord } from '../../database/deleteRecord.js'; export async function handler(request, response) { const success = await deleteRecord('OccupancyTypes', request.body.occupancyTypeId, request.session.user); const occupancyTypes = await getOccupancyTypes(); diff --git a/handlers/admin-post/doDeleteOccupancyType.ts b/handlers/admin-post/doDeleteOccupancyType.ts index 7c1b0969..f359523d 100644 --- a/handlers/admin-post/doDeleteOccupancyType.ts +++ b/handlers/admin-post/doDeleteOccupancyType.ts @@ -4,7 +4,7 @@ import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js' -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js' +import { deleteRecord } from '../../database/deleteRecord.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doDeleteOccupancyTypeField.js b/handlers/admin-post/doDeleteOccupancyTypeField.js index 847cb448..aba43698 100644 --- a/handlers/admin-post/doDeleteOccupancyTypeField.js +++ b/handlers/admin-post/doDeleteOccupancyTypeField.js @@ -1,5 +1,5 @@ import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js'; -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'; +import { deleteRecord } from '../../database/deleteRecord.js'; export async function handler(request, response) { const success = await deleteRecord('OccupancyTypeFields', request.body.occupancyTypeFieldId, request.session.user); const occupancyTypes = await getOccupancyTypes(); diff --git a/handlers/admin-post/doDeleteOccupancyTypeField.ts b/handlers/admin-post/doDeleteOccupancyTypeField.ts index 01fabbf7..75ccac01 100644 --- a/handlers/admin-post/doDeleteOccupancyTypeField.ts +++ b/handlers/admin-post/doDeleteOccupancyTypeField.ts @@ -4,7 +4,7 @@ import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js' -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js' +import { deleteRecord } from '../../database/deleteRecord.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doDeleteOccupancyTypePrint.js b/handlers/admin-post/doDeleteOccupancyTypePrint.js index 272102e6..688518ce 100644 --- a/handlers/admin-post/doDeleteOccupancyTypePrint.js +++ b/handlers/admin-post/doDeleteOccupancyTypePrint.js @@ -1,5 +1,5 @@ import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js'; -import { deleteOccupancyTypePrint } from '../../helpers/lotOccupancyDB/deleteOccupancyTypePrint.js'; +import { deleteOccupancyTypePrint } from '../../database/deleteOccupancyTypePrint.js'; export async function handler(request, response) { const success = await deleteOccupancyTypePrint(request.body.occupancyTypeId, request.body.printEJS, request.session.user); const occupancyTypes = await getOccupancyTypes(); diff --git a/handlers/admin-post/doDeleteOccupancyTypePrint.ts b/handlers/admin-post/doDeleteOccupancyTypePrint.ts index 3ad4bbfd..a36e5e4c 100644 --- a/handlers/admin-post/doDeleteOccupancyTypePrint.ts +++ b/handlers/admin-post/doDeleteOccupancyTypePrint.ts @@ -4,7 +4,7 @@ import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js' -import { deleteOccupancyTypePrint } from '../../helpers/lotOccupancyDB/deleteOccupancyTypePrint.js' +import { deleteOccupancyTypePrint } from '../../database/deleteOccupancyTypePrint.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doDeleteWorkOrderMilestoneType.js b/handlers/admin-post/doDeleteWorkOrderMilestoneType.js index 94a0e3b3..c2a00567 100644 --- a/handlers/admin-post/doDeleteWorkOrderMilestoneType.js +++ b/handlers/admin-post/doDeleteWorkOrderMilestoneType.js @@ -1,5 +1,5 @@ import { getWorkOrderMilestoneTypes } from '../../helpers/functions.cache.js'; -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'; +import { deleteRecord } from '../../database/deleteRecord.js'; export async function handler(request, response) { const success = await deleteRecord('WorkOrderMilestoneTypes', request.body.workOrderMilestoneTypeId, request.session.user); const workOrderMilestoneTypes = await getWorkOrderMilestoneTypes(); diff --git a/handlers/admin-post/doDeleteWorkOrderMilestoneType.ts b/handlers/admin-post/doDeleteWorkOrderMilestoneType.ts index e07ce12e..129963e5 100644 --- a/handlers/admin-post/doDeleteWorkOrderMilestoneType.ts +++ b/handlers/admin-post/doDeleteWorkOrderMilestoneType.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' import { getWorkOrderMilestoneTypes } from '../../helpers/functions.cache.js' -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js' +import { deleteRecord } from '../../database/deleteRecord.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doDeleteWorkOrderType.js b/handlers/admin-post/doDeleteWorkOrderType.js index 1076920b..f1f7b78b 100644 --- a/handlers/admin-post/doDeleteWorkOrderType.js +++ b/handlers/admin-post/doDeleteWorkOrderType.js @@ -1,5 +1,5 @@ import { getWorkOrderTypes } from '../../helpers/functions.cache.js'; -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'; +import { deleteRecord } from '../../database/deleteRecord.js'; export async function handler(request, response) { const success = await deleteRecord('WorkOrderTypes', request.body.workOrderTypeId, request.session.user); const workOrderTypes = await getWorkOrderTypes(); diff --git a/handlers/admin-post/doDeleteWorkOrderType.ts b/handlers/admin-post/doDeleteWorkOrderType.ts index bbf1f5d4..2991dfb5 100644 --- a/handlers/admin-post/doDeleteWorkOrderType.ts +++ b/handlers/admin-post/doDeleteWorkOrderType.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' import { getWorkOrderTypes } from '../../helpers/functions.cache.js' -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js' +import { deleteRecord } from '../../database/deleteRecord.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doMoveFeeCategoryDown.js b/handlers/admin-post/doMoveFeeCategoryDown.js index eb6a89f5..17d496a8 100644 --- a/handlers/admin-post/doMoveFeeCategoryDown.js +++ b/handlers/admin-post/doMoveFeeCategoryDown.js @@ -1,5 +1,5 @@ -import { moveRecordDown, moveRecordDownToBottom } from '../../helpers/lotOccupancyDB/moveRecord.js'; -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js'; +import { moveRecordDown, moveRecordDownToBottom } from '../../database/moveRecord.js'; +import { getFeeCategories } from '../../database/getFeeCategories.js'; export async function handler(request, response) { const success = request.body.moveToEnd === '1' ? await moveRecordDownToBottom('FeeCategories', request.body.feeCategoryId) diff --git a/handlers/admin-post/doMoveFeeCategoryDown.ts b/handlers/admin-post/doMoveFeeCategoryDown.ts index aa8c6666..bd71638a 100644 --- a/handlers/admin-post/doMoveFeeCategoryDown.ts +++ b/handlers/admin-post/doMoveFeeCategoryDown.ts @@ -3,9 +3,9 @@ import type { Request, Response } from 'express' import { moveRecordDown, moveRecordDownToBottom -} from '../../helpers/lotOccupancyDB/moveRecord.js' +} from '../../database/moveRecord.js' -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js' +import { getFeeCategories } from '../../database/getFeeCategories.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doMoveFeeCategoryUp.js b/handlers/admin-post/doMoveFeeCategoryUp.js index 5b74e18c..f60bb3e5 100644 --- a/handlers/admin-post/doMoveFeeCategoryUp.js +++ b/handlers/admin-post/doMoveFeeCategoryUp.js @@ -1,5 +1,5 @@ -import { moveRecordUp, moveRecordUpToTop } from '../../helpers/lotOccupancyDB/moveRecord.js'; -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js'; +import { moveRecordUp, moveRecordUpToTop } from '../../database/moveRecord.js'; +import { getFeeCategories } from '../../database/getFeeCategories.js'; export async function handler(request, response) { const success = request.body.moveToEnd === '1' ? await moveRecordUpToTop('FeeCategories', request.body.feeCategoryId) diff --git a/handlers/admin-post/doMoveFeeCategoryUp.ts b/handlers/admin-post/doMoveFeeCategoryUp.ts index 0e002fd6..8148d0b0 100644 --- a/handlers/admin-post/doMoveFeeCategoryUp.ts +++ b/handlers/admin-post/doMoveFeeCategoryUp.ts @@ -3,8 +3,8 @@ import type { Request, Response } from 'express' import { moveRecordUp, moveRecordUpToTop -} from '../../helpers/lotOccupancyDB/moveRecord.js' -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js' +} from '../../database/moveRecord.js' +import { getFeeCategories } from '../../database/getFeeCategories.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doMoveFeeDown.js b/handlers/admin-post/doMoveFeeDown.js index 99548257..847cf893 100644 --- a/handlers/admin-post/doMoveFeeDown.js +++ b/handlers/admin-post/doMoveFeeDown.js @@ -1,5 +1,5 @@ -import { moveFeeDown, moveFeeDownToBottom } from '../../helpers/lotOccupancyDB/moveFee.js'; -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js'; +import { moveFeeDown, moveFeeDownToBottom } from '../../database/moveFee.js'; +import { getFeeCategories } from '../../database/getFeeCategories.js'; export async function handler(request, response) { const success = request.body.moveToEnd === '1' ? await moveFeeDownToBottom(request.body.feeId) diff --git a/handlers/admin-post/doMoveFeeDown.ts b/handlers/admin-post/doMoveFeeDown.ts index c115f031..6c6c59e6 100644 --- a/handlers/admin-post/doMoveFeeDown.ts +++ b/handlers/admin-post/doMoveFeeDown.ts @@ -3,9 +3,9 @@ import type { Request, Response } from 'express' import { moveFeeDown, moveFeeDownToBottom -} from '../../helpers/lotOccupancyDB/moveFee.js' +} from '../../database/moveFee.js' -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js' +import { getFeeCategories } from '../../database/getFeeCategories.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doMoveFeeUp.js b/handlers/admin-post/doMoveFeeUp.js index c9662df2..d376f31d 100644 --- a/handlers/admin-post/doMoveFeeUp.js +++ b/handlers/admin-post/doMoveFeeUp.js @@ -1,5 +1,5 @@ -import { moveFeeUp, moveFeeUpToTop } from '../../helpers/lotOccupancyDB/moveFee.js'; -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js'; +import { moveFeeUp, moveFeeUpToTop } from '../../database/moveFee.js'; +import { getFeeCategories } from '../../database/getFeeCategories.js'; export async function handler(request, response) { const success = request.body.moveToEnd === '1' ? await moveFeeUpToTop(request.body.feeId) diff --git a/handlers/admin-post/doMoveFeeUp.ts b/handlers/admin-post/doMoveFeeUp.ts index 49c445d4..0a354a37 100644 --- a/handlers/admin-post/doMoveFeeUp.ts +++ b/handlers/admin-post/doMoveFeeUp.ts @@ -3,9 +3,9 @@ import type { Request, Response } from 'express' import { moveFeeUp, moveFeeUpToTop -} from '../../helpers/lotOccupancyDB/moveFee.js' +} from '../../database/moveFee.js' -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js' +import { getFeeCategories } from '../../database/getFeeCategories.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doMoveLotOccupantTypeDown.js b/handlers/admin-post/doMoveLotOccupantTypeDown.js index f3809cc3..1616ed6b 100644 --- a/handlers/admin-post/doMoveLotOccupantTypeDown.js +++ b/handlers/admin-post/doMoveLotOccupantTypeDown.js @@ -1,4 +1,4 @@ -import { moveRecordDown, moveRecordDownToBottom } from '../../helpers/lotOccupancyDB/moveRecord.js'; +import { moveRecordDown, moveRecordDownToBottom } from '../../database/moveRecord.js'; import { getLotOccupantTypes } from '../../helpers/functions.cache.js'; export async function handler(request, response) { const success = request.body.moveToEnd === '1' diff --git a/handlers/admin-post/doMoveLotOccupantTypeDown.ts b/handlers/admin-post/doMoveLotOccupantTypeDown.ts index 584062b6..7ae8f163 100644 --- a/handlers/admin-post/doMoveLotOccupantTypeDown.ts +++ b/handlers/admin-post/doMoveLotOccupantTypeDown.ts @@ -5,7 +5,7 @@ import type { Request, Response } from 'express' import { moveRecordDown, moveRecordDownToBottom -} from '../../helpers/lotOccupancyDB/moveRecord.js' +} from '../../database/moveRecord.js' import { getLotOccupantTypes } from '../../helpers/functions.cache.js' export async function handler( diff --git a/handlers/admin-post/doMoveLotOccupantTypeUp.js b/handlers/admin-post/doMoveLotOccupantTypeUp.js index 80133e3b..cae8c902 100644 --- a/handlers/admin-post/doMoveLotOccupantTypeUp.js +++ b/handlers/admin-post/doMoveLotOccupantTypeUp.js @@ -1,4 +1,4 @@ -import { moveRecordUp, moveRecordUpToTop } from '../../helpers/lotOccupancyDB/moveRecord.js'; +import { moveRecordUp, moveRecordUpToTop } from '../../database/moveRecord.js'; import { getLotOccupantTypes } from '../../helpers/functions.cache.js'; export async function handler(request, response) { const success = request.body.moveToEnd === '1' diff --git a/handlers/admin-post/doMoveLotOccupantTypeUp.ts b/handlers/admin-post/doMoveLotOccupantTypeUp.ts index e0d195af..c948c41f 100644 --- a/handlers/admin-post/doMoveLotOccupantTypeUp.ts +++ b/handlers/admin-post/doMoveLotOccupantTypeUp.ts @@ -3,7 +3,7 @@ import type { Request, Response } from 'express' import { moveRecordUp, moveRecordUpToTop -} from '../../helpers/lotOccupancyDB/moveRecord.js' +} from '../../database/moveRecord.js' import { getLotOccupantTypes } from '../../helpers/functions.cache.js' export async function handler( diff --git a/handlers/admin-post/doMoveLotStatusDown.js b/handlers/admin-post/doMoveLotStatusDown.js index ba063df0..bcbc44df 100644 --- a/handlers/admin-post/doMoveLotStatusDown.js +++ b/handlers/admin-post/doMoveLotStatusDown.js @@ -1,4 +1,4 @@ -import { moveRecordDown, moveRecordDownToBottom } from '../../helpers/lotOccupancyDB/moveRecord.js'; +import { moveRecordDown, moveRecordDownToBottom } from '../../database/moveRecord.js'; import { getLotStatuses } from '../../helpers/functions.cache.js'; export async function handler(request, response) { const success = request.body.moveToEnd === '1' diff --git a/handlers/admin-post/doMoveLotStatusDown.ts b/handlers/admin-post/doMoveLotStatusDown.ts index b9435ca5..489dc3da 100644 --- a/handlers/admin-post/doMoveLotStatusDown.ts +++ b/handlers/admin-post/doMoveLotStatusDown.ts @@ -3,7 +3,7 @@ import type { Request, Response } from 'express' import { moveRecordDown, moveRecordDownToBottom -} from '../../helpers/lotOccupancyDB/moveRecord.js' +} from '../../database/moveRecord.js' import { getLotStatuses } from '../../helpers/functions.cache.js' export async function handler( diff --git a/handlers/admin-post/doMoveLotStatusUp.js b/handlers/admin-post/doMoveLotStatusUp.js index 076c66e2..b82750b2 100644 --- a/handlers/admin-post/doMoveLotStatusUp.js +++ b/handlers/admin-post/doMoveLotStatusUp.js @@ -1,4 +1,4 @@ -import { moveRecordUp, moveRecordUpToTop } from '../../helpers/lotOccupancyDB/moveRecord.js'; +import { moveRecordUp, moveRecordUpToTop } from '../../database/moveRecord.js'; import { getLotStatuses } from '../../helpers/functions.cache.js'; export async function handler(request, response) { const success = request.body.moveToEnd === '1' diff --git a/handlers/admin-post/doMoveLotStatusUp.ts b/handlers/admin-post/doMoveLotStatusUp.ts index b81fc1cc..162faf61 100644 --- a/handlers/admin-post/doMoveLotStatusUp.ts +++ b/handlers/admin-post/doMoveLotStatusUp.ts @@ -3,7 +3,7 @@ import type { Request, Response } from 'express' import { moveRecordUp, moveRecordUpToTop -} from '../../helpers/lotOccupancyDB/moveRecord.js' +} from '../../database/moveRecord.js' import { getLotStatuses } from '../../helpers/functions.cache.js' export async function handler( diff --git a/handlers/admin-post/doMoveLotTypeDown.js b/handlers/admin-post/doMoveLotTypeDown.js index 5e1b0752..20d8fb26 100644 --- a/handlers/admin-post/doMoveLotTypeDown.js +++ b/handlers/admin-post/doMoveLotTypeDown.js @@ -1,4 +1,4 @@ -import { moveRecordDown, moveRecordDownToBottom } from '../../helpers/lotOccupancyDB/moveRecord.js'; +import { moveRecordDown, moveRecordDownToBottom } from '../../database/moveRecord.js'; import { getLotTypes } from '../../helpers/functions.cache.js'; export async function handler(request, response) { const success = request.body.moveToEnd === '1' diff --git a/handlers/admin-post/doMoveLotTypeDown.ts b/handlers/admin-post/doMoveLotTypeDown.ts index d207875c..fdf2781a 100644 --- a/handlers/admin-post/doMoveLotTypeDown.ts +++ b/handlers/admin-post/doMoveLotTypeDown.ts @@ -3,7 +3,7 @@ import type { Request, Response } from 'express' import { moveRecordDown, moveRecordDownToBottom -} from '../../helpers/lotOccupancyDB/moveRecord.js' +} from '../../database/moveRecord.js' import { getLotTypes } from '../../helpers/functions.cache.js' export async function handler( diff --git a/handlers/admin-post/doMoveLotTypeFieldDown.js b/handlers/admin-post/doMoveLotTypeFieldDown.js index 8838e6c8..48514498 100644 --- a/handlers/admin-post/doMoveLotTypeFieldDown.js +++ b/handlers/admin-post/doMoveLotTypeFieldDown.js @@ -1,4 +1,4 @@ -import { moveLotTypeFieldDown, moveLotTypeFieldDownToBottom } from '../../helpers/lotOccupancyDB/moveLotTypeField.js'; +import { moveLotTypeFieldDown, moveLotTypeFieldDownToBottom } from '../../database/moveLotTypeField.js'; import { getLotTypes } from '../../helpers/functions.cache.js'; export async function handler(request, response) { const success = request.body.moveToEnd === '1' diff --git a/handlers/admin-post/doMoveLotTypeFieldDown.ts b/handlers/admin-post/doMoveLotTypeFieldDown.ts index 0ec2c3e5..55b71f81 100644 --- a/handlers/admin-post/doMoveLotTypeFieldDown.ts +++ b/handlers/admin-post/doMoveLotTypeFieldDown.ts @@ -3,7 +3,7 @@ import type { Request, Response } from 'express' import { moveLotTypeFieldDown, moveLotTypeFieldDownToBottom -} from '../../helpers/lotOccupancyDB/moveLotTypeField.js' +} from '../../database/moveLotTypeField.js' import { getLotTypes } from '../../helpers/functions.cache.js' diff --git a/handlers/admin-post/doMoveLotTypeFieldUp.js b/handlers/admin-post/doMoveLotTypeFieldUp.js index 9bbc761c..a5b2aeb1 100644 --- a/handlers/admin-post/doMoveLotTypeFieldUp.js +++ b/handlers/admin-post/doMoveLotTypeFieldUp.js @@ -1,4 +1,4 @@ -import { moveLotTypeFieldUp, moveLotTypeFieldUpToTop } from '../../helpers/lotOccupancyDB/moveLotTypeField.js'; +import { moveLotTypeFieldUp, moveLotTypeFieldUpToTop } from '../../database/moveLotTypeField.js'; import { getLotTypes } from '../../helpers/functions.cache.js'; export async function handler(request, response) { const success = request.body.moveToEnd === '1' diff --git a/handlers/admin-post/doMoveLotTypeFieldUp.ts b/handlers/admin-post/doMoveLotTypeFieldUp.ts index 67bf45de..fc2a4392 100644 --- a/handlers/admin-post/doMoveLotTypeFieldUp.ts +++ b/handlers/admin-post/doMoveLotTypeFieldUp.ts @@ -3,7 +3,7 @@ import type { Request, Response } from 'express' import { moveLotTypeFieldUp, moveLotTypeFieldUpToTop -} from '../../helpers/lotOccupancyDB/moveLotTypeField.js' +} from '../../database/moveLotTypeField.js' import { getLotTypes } from '../../helpers/functions.cache.js' diff --git a/handlers/admin-post/doMoveLotTypeUp.js b/handlers/admin-post/doMoveLotTypeUp.js index e633007c..d304a6a4 100644 --- a/handlers/admin-post/doMoveLotTypeUp.js +++ b/handlers/admin-post/doMoveLotTypeUp.js @@ -1,4 +1,4 @@ -import { moveRecordUp, moveRecordUpToTop } from '../../helpers/lotOccupancyDB/moveRecord.js'; +import { moveRecordUp, moveRecordUpToTop } from '../../database/moveRecord.js'; import { getLotTypes } from '../../helpers/functions.cache.js'; export async function handler(request, response) { const success = request.body.moveToEnd === '1' diff --git a/handlers/admin-post/doMoveLotTypeUp.ts b/handlers/admin-post/doMoveLotTypeUp.ts index aac886b8..5b55f4ba 100644 --- a/handlers/admin-post/doMoveLotTypeUp.ts +++ b/handlers/admin-post/doMoveLotTypeUp.ts @@ -3,7 +3,7 @@ import type { Request, Response } from 'express' import { moveRecordUp, moveRecordUpToTop -} from '../../helpers/lotOccupancyDB/moveRecord.js' +} from '../../database/moveRecord.js' import { getLotTypes } from '../../helpers/functions.cache.js' export async function handler( diff --git a/handlers/admin-post/doMoveOccupancyTypeDown.js b/handlers/admin-post/doMoveOccupancyTypeDown.js index 26988295..6db8512e 100644 --- a/handlers/admin-post/doMoveOccupancyTypeDown.js +++ b/handlers/admin-post/doMoveOccupancyTypeDown.js @@ -1,4 +1,4 @@ -import { moveRecordDown, moveRecordDownToBottom } from '../../helpers/lotOccupancyDB/moveRecord.js'; +import { moveRecordDown, moveRecordDownToBottom } from '../../database/moveRecord.js'; import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js'; export async function handler(request, response) { const success = request.body.moveToEnd === '1' diff --git a/handlers/admin-post/doMoveOccupancyTypeDown.ts b/handlers/admin-post/doMoveOccupancyTypeDown.ts index 69f1def1..0f757c69 100644 --- a/handlers/admin-post/doMoveOccupancyTypeDown.ts +++ b/handlers/admin-post/doMoveOccupancyTypeDown.ts @@ -3,7 +3,7 @@ import type { Request, Response } from 'express' import { moveRecordDown, moveRecordDownToBottom -} from '../../helpers/lotOccupancyDB/moveRecord.js' +} from '../../database/moveRecord.js' import { getAllOccupancyTypeFields, getOccupancyTypes diff --git a/handlers/admin-post/doMoveOccupancyTypeFieldDown.js b/handlers/admin-post/doMoveOccupancyTypeFieldDown.js index 09a41bf2..f5af1537 100644 --- a/handlers/admin-post/doMoveOccupancyTypeFieldDown.js +++ b/handlers/admin-post/doMoveOccupancyTypeFieldDown.js @@ -1,4 +1,4 @@ -import { moveOccupancyTypeFieldDown, moveOccupancyTypeFieldDownToBottom } from '../../helpers/lotOccupancyDB/moveOccupancyTypeField.js'; +import { moveOccupancyTypeFieldDown, moveOccupancyTypeFieldDownToBottom } from '../../database/moveOccupancyTypeField.js'; import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js'; export async function handler(request, response) { const occupancyTypeFieldId = Number.parseInt(request.body.occupancyTypeFieldId, 10); diff --git a/handlers/admin-post/doMoveOccupancyTypeFieldDown.ts b/handlers/admin-post/doMoveOccupancyTypeFieldDown.ts index 93031bd3..a02db92d 100644 --- a/handlers/admin-post/doMoveOccupancyTypeFieldDown.ts +++ b/handlers/admin-post/doMoveOccupancyTypeFieldDown.ts @@ -3,7 +3,7 @@ import type { Request, Response } from 'express' import { moveOccupancyTypeFieldDown, moveOccupancyTypeFieldDownToBottom -} from '../../helpers/lotOccupancyDB/moveOccupancyTypeField.js' +} from '../../database/moveOccupancyTypeField.js' import { getAllOccupancyTypeFields, diff --git a/handlers/admin-post/doMoveOccupancyTypeFieldUp.js b/handlers/admin-post/doMoveOccupancyTypeFieldUp.js index 81f119e7..b768b696 100644 --- a/handlers/admin-post/doMoveOccupancyTypeFieldUp.js +++ b/handlers/admin-post/doMoveOccupancyTypeFieldUp.js @@ -1,4 +1,4 @@ -import { moveOccupancyTypeFieldUp, moveOccupancyTypeFieldUpToTop } from '../../helpers/lotOccupancyDB/moveOccupancyTypeField.js'; +import { moveOccupancyTypeFieldUp, moveOccupancyTypeFieldUpToTop } from '../../database/moveOccupancyTypeField.js'; import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js'; export async function handler(request, response) { const occupancyTypeFieldId = Number.parseInt(request.body.occupancyTypeFieldId, 10); diff --git a/handlers/admin-post/doMoveOccupancyTypeFieldUp.ts b/handlers/admin-post/doMoveOccupancyTypeFieldUp.ts index ea6f751c..ab459bca 100644 --- a/handlers/admin-post/doMoveOccupancyTypeFieldUp.ts +++ b/handlers/admin-post/doMoveOccupancyTypeFieldUp.ts @@ -3,7 +3,7 @@ import type { Request, Response } from 'express' import { moveOccupancyTypeFieldUp, moveOccupancyTypeFieldUpToTop -} from '../../helpers/lotOccupancyDB/moveOccupancyTypeField.js' +} from '../../database/moveOccupancyTypeField.js' import { getAllOccupancyTypeFields, diff --git a/handlers/admin-post/doMoveOccupancyTypePrintDown.js b/handlers/admin-post/doMoveOccupancyTypePrintDown.js index 92ca69a9..af35ba89 100644 --- a/handlers/admin-post/doMoveOccupancyTypePrintDown.js +++ b/handlers/admin-post/doMoveOccupancyTypePrintDown.js @@ -1,4 +1,4 @@ -import { moveOccupancyTypePrintDown, moveOccupancyTypePrintDownToBottom } from '../../helpers/lotOccupancyDB/moveOccupancyTypePrintDown.js'; +import { moveOccupancyTypePrintDown, moveOccupancyTypePrintDownToBottom } from '../../database/moveOccupancyTypePrintDown.js'; import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js'; export async function handler(request, response) { const success = request.body.moveToEnd === '1' diff --git a/handlers/admin-post/doMoveOccupancyTypePrintDown.ts b/handlers/admin-post/doMoveOccupancyTypePrintDown.ts index 235b1c77..e44c1909 100644 --- a/handlers/admin-post/doMoveOccupancyTypePrintDown.ts +++ b/handlers/admin-post/doMoveOccupancyTypePrintDown.ts @@ -5,7 +5,7 @@ import type { Request, Response } from 'express' import { moveOccupancyTypePrintDown, moveOccupancyTypePrintDownToBottom -} from '../../helpers/lotOccupancyDB/moveOccupancyTypePrintDown.js' +} from '../../database/moveOccupancyTypePrintDown.js' import { getAllOccupancyTypeFields, diff --git a/handlers/admin-post/doMoveOccupancyTypePrintUp.js b/handlers/admin-post/doMoveOccupancyTypePrintUp.js index 3dc8c462..2be7c697 100644 --- a/handlers/admin-post/doMoveOccupancyTypePrintUp.js +++ b/handlers/admin-post/doMoveOccupancyTypePrintUp.js @@ -1,4 +1,4 @@ -import { moveOccupancyTypePrintUp, moveOccupancyTypePrintUpToTop } from '../../helpers/lotOccupancyDB/moveOccupancyTypePrintUp.js'; +import { moveOccupancyTypePrintUp, moveOccupancyTypePrintUpToTop } from '../../database/moveOccupancyTypePrintUp.js'; import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js'; export async function handler(request, response) { const success = request.body.moveToEnd === '1' diff --git a/handlers/admin-post/doMoveOccupancyTypePrintUp.ts b/handlers/admin-post/doMoveOccupancyTypePrintUp.ts index e5de4772..f2b7bf7d 100644 --- a/handlers/admin-post/doMoveOccupancyTypePrintUp.ts +++ b/handlers/admin-post/doMoveOccupancyTypePrintUp.ts @@ -5,7 +5,7 @@ import type { Request, Response } from 'express' import { moveOccupancyTypePrintUp, moveOccupancyTypePrintUpToTop -} from '../../helpers/lotOccupancyDB/moveOccupancyTypePrintUp.js' +} from '../../database/moveOccupancyTypePrintUp.js' import { getAllOccupancyTypeFields, diff --git a/handlers/admin-post/doMoveOccupancyTypeUp.js b/handlers/admin-post/doMoveOccupancyTypeUp.js index b16848ef..ce854e5c 100644 --- a/handlers/admin-post/doMoveOccupancyTypeUp.js +++ b/handlers/admin-post/doMoveOccupancyTypeUp.js @@ -1,4 +1,4 @@ -import { moveRecordUp, moveRecordUpToTop } from '../../helpers/lotOccupancyDB/moveRecord.js'; +import { moveRecordUp, moveRecordUpToTop } from '../../database/moveRecord.js'; import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js'; export async function handler(request, response) { const success = request.body.moveToEnd === '1' diff --git a/handlers/admin-post/doMoveOccupancyTypeUp.ts b/handlers/admin-post/doMoveOccupancyTypeUp.ts index e35fdcca..d7eaa281 100644 --- a/handlers/admin-post/doMoveOccupancyTypeUp.ts +++ b/handlers/admin-post/doMoveOccupancyTypeUp.ts @@ -3,7 +3,7 @@ import type { Request, Response } from 'express' import { moveRecordUp, moveRecordUpToTop -} from '../../helpers/lotOccupancyDB/moveRecord.js' +} from '../../database/moveRecord.js' import { getAllOccupancyTypeFields, getOccupancyTypes diff --git a/handlers/admin-post/doMoveWorkOrderMilestoneTypeDown.js b/handlers/admin-post/doMoveWorkOrderMilestoneTypeDown.js index 614481af..48f938f5 100644 --- a/handlers/admin-post/doMoveWorkOrderMilestoneTypeDown.js +++ b/handlers/admin-post/doMoveWorkOrderMilestoneTypeDown.js @@ -1,4 +1,4 @@ -import { moveRecordDown, moveRecordDownToBottom } from '../../helpers/lotOccupancyDB/moveRecord.js'; +import { moveRecordDown, moveRecordDownToBottom } from '../../database/moveRecord.js'; import { getWorkOrderMilestoneTypes } from '../../helpers/functions.cache.js'; export async function handler(request, response) { const success = request.body.moveToEnd === '1' diff --git a/handlers/admin-post/doMoveWorkOrderMilestoneTypeDown.ts b/handlers/admin-post/doMoveWorkOrderMilestoneTypeDown.ts index 81f2dd7f..a1c864c1 100644 --- a/handlers/admin-post/doMoveWorkOrderMilestoneTypeDown.ts +++ b/handlers/admin-post/doMoveWorkOrderMilestoneTypeDown.ts @@ -5,7 +5,7 @@ import type { Request, Response } from 'express' import { moveRecordDown, moveRecordDownToBottom -} from '../../helpers/lotOccupancyDB/moveRecord.js' +} from '../../database/moveRecord.js' import { getWorkOrderMilestoneTypes } from '../../helpers/functions.cache.js' export async function handler( diff --git a/handlers/admin-post/doMoveWorkOrderMilestoneTypeUp.js b/handlers/admin-post/doMoveWorkOrderMilestoneTypeUp.js index fba6f841..da2af1f5 100644 --- a/handlers/admin-post/doMoveWorkOrderMilestoneTypeUp.js +++ b/handlers/admin-post/doMoveWorkOrderMilestoneTypeUp.js @@ -1,4 +1,4 @@ -import { moveRecordUp, moveRecordUpToTop } from '../../helpers/lotOccupancyDB/moveRecord.js'; +import { moveRecordUp, moveRecordUpToTop } from '../../database/moveRecord.js'; import { getWorkOrderMilestoneTypes } from '../../helpers/functions.cache.js'; export async function handler(request, response) { const success = request.body.moveToEnd === '1' diff --git a/handlers/admin-post/doMoveWorkOrderMilestoneTypeUp.ts b/handlers/admin-post/doMoveWorkOrderMilestoneTypeUp.ts index c1837e6c..6cdea0cb 100644 --- a/handlers/admin-post/doMoveWorkOrderMilestoneTypeUp.ts +++ b/handlers/admin-post/doMoveWorkOrderMilestoneTypeUp.ts @@ -5,7 +5,7 @@ import type { Request, Response } from 'express' import { moveRecordUp, moveRecordUpToTop -} from '../../helpers/lotOccupancyDB/moveRecord.js' +} from '../../database/moveRecord.js' import { getWorkOrderMilestoneTypes } from '../../helpers/functions.cache.js' export async function handler( diff --git a/handlers/admin-post/doMoveWorkOrderTypeDown.js b/handlers/admin-post/doMoveWorkOrderTypeDown.js index b0f84d52..f2c653c7 100644 --- a/handlers/admin-post/doMoveWorkOrderTypeDown.js +++ b/handlers/admin-post/doMoveWorkOrderTypeDown.js @@ -1,4 +1,4 @@ -import { moveRecordDown, moveRecordDownToBottom } from '../../helpers/lotOccupancyDB/moveRecord.js'; +import { moveRecordDown, moveRecordDownToBottom } from '../../database/moveRecord.js'; import { getWorkOrderTypes } from '../../helpers/functions.cache.js'; export async function handler(request, response) { const success = request.body.moveToEnd === '1' diff --git a/handlers/admin-post/doMoveWorkOrderTypeDown.ts b/handlers/admin-post/doMoveWorkOrderTypeDown.ts index c422e44e..ee548785 100644 --- a/handlers/admin-post/doMoveWorkOrderTypeDown.ts +++ b/handlers/admin-post/doMoveWorkOrderTypeDown.ts @@ -3,7 +3,7 @@ import type { Request, Response } from 'express' import { moveRecordDown, moveRecordDownToBottom -} from '../../helpers/lotOccupancyDB/moveRecord.js' +} from '../../database/moveRecord.js' import { getWorkOrderTypes } from '../../helpers/functions.cache.js' export async function handler( diff --git a/handlers/admin-post/doMoveWorkOrderTypeUp.js b/handlers/admin-post/doMoveWorkOrderTypeUp.js index 4deb6db8..359451de 100644 --- a/handlers/admin-post/doMoveWorkOrderTypeUp.js +++ b/handlers/admin-post/doMoveWorkOrderTypeUp.js @@ -1,4 +1,4 @@ -import { moveRecordUp, moveRecordUpToTop } from '../../helpers/lotOccupancyDB/moveRecord.js'; +import { moveRecordUp, moveRecordUpToTop } from '../../database/moveRecord.js'; import { getWorkOrderTypes } from '../../helpers/functions.cache.js'; export async function handler(request, response) { const success = request.body.moveToEnd === '1' diff --git a/handlers/admin-post/doMoveWorkOrderTypeUp.ts b/handlers/admin-post/doMoveWorkOrderTypeUp.ts index a8babbcb..caabae46 100644 --- a/handlers/admin-post/doMoveWorkOrderTypeUp.ts +++ b/handlers/admin-post/doMoveWorkOrderTypeUp.ts @@ -3,7 +3,7 @@ import type { Request, Response } from 'express' import { moveRecordUp, moveRecordUpToTop -} from '../../helpers/lotOccupancyDB/moveRecord.js' +} from '../../database/moveRecord.js' import { getWorkOrderTypes } from '../../helpers/functions.cache.js' export async function handler( diff --git a/handlers/admin-post/doUpdateFee.js b/handlers/admin-post/doUpdateFee.js index d7a2977c..408b8057 100644 --- a/handlers/admin-post/doUpdateFee.js +++ b/handlers/admin-post/doUpdateFee.js @@ -1,5 +1,5 @@ -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js'; -import { updateFee } from '../../helpers/lotOccupancyDB/updateFee.js'; +import { getFeeCategories } from '../../database/getFeeCategories.js'; +import { updateFee } from '../../database/updateFee.js'; export async function handler(request, response) { const success = await updateFee(request.body, request.session.user); const feeCategories = await getFeeCategories({}, { diff --git a/handlers/admin-post/doUpdateFee.ts b/handlers/admin-post/doUpdateFee.ts index 74b7a117..52863a2d 100644 --- a/handlers/admin-post/doUpdateFee.ts +++ b/handlers/admin-post/doUpdateFee.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js' -import { updateFee } from '../../helpers/lotOccupancyDB/updateFee.js' +import { getFeeCategories } from '../../database/getFeeCategories.js' +import { updateFee } from '../../database/updateFee.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doUpdateFeeCategory.js b/handlers/admin-post/doUpdateFeeCategory.js index beaca921..249d0072 100644 --- a/handlers/admin-post/doUpdateFeeCategory.js +++ b/handlers/admin-post/doUpdateFeeCategory.js @@ -1,5 +1,5 @@ -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js'; -import { updateFeeCategory } from '../../helpers/lotOccupancyDB/updateFeeCategory.js'; +import { getFeeCategories } from '../../database/getFeeCategories.js'; +import { updateFeeCategory } from '../../database/updateFeeCategory.js'; export async function handler(request, response) { const success = await updateFeeCategory(request.body, request.session.user); const feeCategories = await getFeeCategories({}, { diff --git a/handlers/admin-post/doUpdateFeeCategory.ts b/handlers/admin-post/doUpdateFeeCategory.ts index 1204e8fa..305fd1de 100644 --- a/handlers/admin-post/doUpdateFeeCategory.ts +++ b/handlers/admin-post/doUpdateFeeCategory.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js' -import { updateFeeCategory } from '../../helpers/lotOccupancyDB/updateFeeCategory.js' +import { getFeeCategories } from '../../database/getFeeCategories.js' +import { updateFeeCategory } from '../../database/updateFeeCategory.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doUpdateLotOccupantType.js b/handlers/admin-post/doUpdateLotOccupantType.js index f4114652..5c75e9f7 100644 --- a/handlers/admin-post/doUpdateLotOccupantType.js +++ b/handlers/admin-post/doUpdateLotOccupantType.js @@ -1,5 +1,5 @@ import { getLotOccupantTypes } from '../../helpers/functions.cache.js'; -import { updateLotOccupantType } from '../../helpers/lotOccupancyDB/updateLotOccupantType.js'; +import { updateLotOccupantType } from '../../database/updateLotOccupantType.js'; export async function handler(request, response) { const success = await updateLotOccupantType(request.body, request.session.user); const lotOccupantTypes = await getLotOccupantTypes(); diff --git a/handlers/admin-post/doUpdateLotOccupantType.ts b/handlers/admin-post/doUpdateLotOccupantType.ts index 44a7ca5b..62bca0d9 100644 --- a/handlers/admin-post/doUpdateLotOccupantType.ts +++ b/handlers/admin-post/doUpdateLotOccupantType.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' import { getLotOccupantTypes } from '../../helpers/functions.cache.js' -import { updateLotOccupantType } from '../../helpers/lotOccupancyDB/updateLotOccupantType.js' +import { updateLotOccupantType } from '../../database/updateLotOccupantType.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doUpdateLotStatus.js b/handlers/admin-post/doUpdateLotStatus.js index 7ab5c84f..23912fde 100644 --- a/handlers/admin-post/doUpdateLotStatus.js +++ b/handlers/admin-post/doUpdateLotStatus.js @@ -1,5 +1,5 @@ import { getLotStatuses } from '../../helpers/functions.cache.js'; -import { updateRecord } from '../../helpers/lotOccupancyDB/updateRecord.js'; +import { updateRecord } from '../../database/updateRecord.js'; export async function handler(request, response) { const success = await updateRecord('LotStatuses', request.body.lotStatusId, request.body.lotStatus, request.session.user); const lotStatuses = await getLotStatuses(); diff --git a/handlers/admin-post/doUpdateLotStatus.ts b/handlers/admin-post/doUpdateLotStatus.ts index 9d5e48b2..be3d65eb 100644 --- a/handlers/admin-post/doUpdateLotStatus.ts +++ b/handlers/admin-post/doUpdateLotStatus.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' import { getLotStatuses } from '../../helpers/functions.cache.js' -import { updateRecord } from '../../helpers/lotOccupancyDB/updateRecord.js' +import { updateRecord } from '../../database/updateRecord.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doUpdateLotType.js b/handlers/admin-post/doUpdateLotType.js index 3ea08b08..620a8549 100644 --- a/handlers/admin-post/doUpdateLotType.js +++ b/handlers/admin-post/doUpdateLotType.js @@ -1,5 +1,5 @@ import { getLotTypes } from '../../helpers/functions.cache.js'; -import { updateRecord } from '../../helpers/lotOccupancyDB/updateRecord.js'; +import { updateRecord } from '../../database/updateRecord.js'; export async function handler(request, response) { const success = await updateRecord('LotTypes', request.body.lotTypeId, request.body.lotType, request.session.user); const lotTypes = await getLotTypes(); diff --git a/handlers/admin-post/doUpdateLotType.ts b/handlers/admin-post/doUpdateLotType.ts index 03dcdf30..9ca2f8f7 100644 --- a/handlers/admin-post/doUpdateLotType.ts +++ b/handlers/admin-post/doUpdateLotType.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' import { getLotTypes } from '../../helpers/functions.cache.js' -import { updateRecord } from '../../helpers/lotOccupancyDB/updateRecord.js' +import { updateRecord } from '../../database/updateRecord.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doUpdateLotTypeField.js b/handlers/admin-post/doUpdateLotTypeField.js index 9d942e62..98e21682 100644 --- a/handlers/admin-post/doUpdateLotTypeField.js +++ b/handlers/admin-post/doUpdateLotTypeField.js @@ -1,5 +1,5 @@ import { getLotTypes } from '../../helpers/functions.cache.js'; -import { updateLotTypeField } from '../../helpers/lotOccupancyDB/updateLotTypeField.js'; +import { updateLotTypeField } from '../../database/updateLotTypeField.js'; export async function handler(request, response) { const success = await updateLotTypeField(request.body, request.session.user); const lotTypes = await getLotTypes(); diff --git a/handlers/admin-post/doUpdateLotTypeField.ts b/handlers/admin-post/doUpdateLotTypeField.ts index 8d7b2c7e..24233d30 100644 --- a/handlers/admin-post/doUpdateLotTypeField.ts +++ b/handlers/admin-post/doUpdateLotTypeField.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' import { getLotTypes } from '../../helpers/functions.cache.js' -import { updateLotTypeField } from '../../helpers/lotOccupancyDB/updateLotTypeField.js' +import { updateLotTypeField } from '../../database/updateLotTypeField.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doUpdateOccupancyType.js b/handlers/admin-post/doUpdateOccupancyType.js index 4f07dc7f..fac736e9 100644 --- a/handlers/admin-post/doUpdateOccupancyType.js +++ b/handlers/admin-post/doUpdateOccupancyType.js @@ -1,5 +1,5 @@ import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js'; -import { updateRecord } from '../../helpers/lotOccupancyDB/updateRecord.js'; +import { updateRecord } from '../../database/updateRecord.js'; export async function handler(request, response) { const success = await updateRecord('OccupancyTypes', request.body.occupancyTypeId, request.body.occupancyType, request.session.user); const occupancyTypes = await getOccupancyTypes(); diff --git a/handlers/admin-post/doUpdateOccupancyType.ts b/handlers/admin-post/doUpdateOccupancyType.ts index e6cf7747..0abe5750 100644 --- a/handlers/admin-post/doUpdateOccupancyType.ts +++ b/handlers/admin-post/doUpdateOccupancyType.ts @@ -4,7 +4,7 @@ import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js' -import { updateRecord } from '../../helpers/lotOccupancyDB/updateRecord.js' +import { updateRecord } from '../../database/updateRecord.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doUpdateOccupancyTypeField.js b/handlers/admin-post/doUpdateOccupancyTypeField.js index b404488a..b24b2c45 100644 --- a/handlers/admin-post/doUpdateOccupancyTypeField.js +++ b/handlers/admin-post/doUpdateOccupancyTypeField.js @@ -1,5 +1,5 @@ import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js'; -import { updateOccupancyTypeField } from '../../helpers/lotOccupancyDB/updateOccupancyTypeField.js'; +import { updateOccupancyTypeField } from '../../database/updateOccupancyTypeField.js'; export async function handler(request, response) { const success = await updateOccupancyTypeField(request.body, request.session.user); const occupancyTypes = await getOccupancyTypes(); diff --git a/handlers/admin-post/doUpdateOccupancyTypeField.ts b/handlers/admin-post/doUpdateOccupancyTypeField.ts index 27cffa9e..dba515b5 100644 --- a/handlers/admin-post/doUpdateOccupancyTypeField.ts +++ b/handlers/admin-post/doUpdateOccupancyTypeField.ts @@ -4,7 +4,7 @@ import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js' -import { updateOccupancyTypeField } from '../../helpers/lotOccupancyDB/updateOccupancyTypeField.js' +import { updateOccupancyTypeField } from '../../database/updateOccupancyTypeField.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doUpdateWorkOrderMilestoneType.js b/handlers/admin-post/doUpdateWorkOrderMilestoneType.js index 6616d32c..a6187222 100644 --- a/handlers/admin-post/doUpdateWorkOrderMilestoneType.js +++ b/handlers/admin-post/doUpdateWorkOrderMilestoneType.js @@ -1,5 +1,5 @@ import { getWorkOrderMilestoneTypes } from '../../helpers/functions.cache.js'; -import { updateRecord } from '../../helpers/lotOccupancyDB/updateRecord.js'; +import { updateRecord } from '../../database/updateRecord.js'; export async function handler(request, response) { const success = await updateRecord('WorkOrderMilestoneTypes', request.body.workOrderMilestoneTypeId, request.body.workOrderMilestoneType, request.session.user); const workOrderMilestoneTypes = await getWorkOrderMilestoneTypes(); diff --git a/handlers/admin-post/doUpdateWorkOrderMilestoneType.ts b/handlers/admin-post/doUpdateWorkOrderMilestoneType.ts index c21b59e3..07820a67 100644 --- a/handlers/admin-post/doUpdateWorkOrderMilestoneType.ts +++ b/handlers/admin-post/doUpdateWorkOrderMilestoneType.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' import { getWorkOrderMilestoneTypes } from '../../helpers/functions.cache.js' -import { updateRecord } from '../../helpers/lotOccupancyDB/updateRecord.js' +import { updateRecord } from '../../database/updateRecord.js' export async function handler( request: Request, diff --git a/handlers/admin-post/doUpdateWorkOrderType.js b/handlers/admin-post/doUpdateWorkOrderType.js index 629ec072..c2e754d0 100644 --- a/handlers/admin-post/doUpdateWorkOrderType.js +++ b/handlers/admin-post/doUpdateWorkOrderType.js @@ -1,5 +1,5 @@ import { getWorkOrderTypes } from '../../helpers/functions.cache.js'; -import { updateRecord } from '../../helpers/lotOccupancyDB/updateRecord.js'; +import { updateRecord } from '../../database/updateRecord.js'; export async function handler(request, response) { const success = await updateRecord('WorkOrderTypes', request.body.workOrderTypeId, request.body.workOrderType, request.session.user); const workOrderTypes = await getWorkOrderTypes(); diff --git a/handlers/admin-post/doUpdateWorkOrderType.ts b/handlers/admin-post/doUpdateWorkOrderType.ts index c9463510..96551ccc 100644 --- a/handlers/admin-post/doUpdateWorkOrderType.ts +++ b/handlers/admin-post/doUpdateWorkOrderType.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' import { getWorkOrderTypes } from '../../helpers/functions.cache.js' -import { updateRecord } from '../../helpers/lotOccupancyDB/updateRecord.js' +import { updateRecord } from '../../database/updateRecord.js' export async function handler( request: Request, diff --git a/handlers/api-get/milestoneICS.js b/handlers/api-get/milestoneICS.js index 4886ece0..678b9fe2 100644 --- a/handlers/api-get/milestoneICS.js +++ b/handlers/api-get/milestoneICS.js @@ -1,7 +1,7 @@ import ical, { ICalEventStatus } from 'ical-generator'; import * as configFunctions from '../../helpers/functions.config.js'; import { getPrintConfig } from '../../helpers/functions.print.js'; -import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js'; +import { getWorkOrderMilestones } from '../../database/getWorkOrderMilestones.js'; const calendarCompany = 'cityssm.github.io'; const calendarProduct = configFunctions.getProperty('application.applicationName'); const timeStringSplitRegex = /[ :-]/; diff --git a/handlers/api-get/milestoneICS.ts b/handlers/api-get/milestoneICS.ts index b7bfa23b..9270ffa3 100644 --- a/handlers/api-get/milestoneICS.ts +++ b/handlers/api-get/milestoneICS.ts @@ -8,7 +8,7 @@ import { getPrintConfig } from '../../helpers/functions.print.js' import { getWorkOrderMilestones, type WorkOrderMilestoneFilters -} from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js' +} from '../../database/getWorkOrderMilestones.js' import type { WorkOrderMilestone } from '../../types/recordTypes.js' const calendarCompany = 'cityssm.github.io' diff --git a/handlers/dashboard-get/dashboard.js b/handlers/dashboard-get/dashboard.js index 644b2aec..a2b2df12 100644 --- a/handlers/dashboard-get/dashboard.js +++ b/handlers/dashboard-get/dashboard.js @@ -1,7 +1,7 @@ import { dateToString } from '@cityssm/utils-datetime'; -import { getLotOccupancies } from '../../helpers/lotOccupancyDB/getLotOccupancies.js'; -import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js'; -import { getWorkOrders } from '../../helpers/lotOccupancyDB/getWorkOrders.js'; +import { getLotOccupancies } from '../../database/getLotOccupancies.js'; +import { getWorkOrderMilestones } from '../../database/getWorkOrderMilestones.js'; +import { getWorkOrders } from '../../database/getWorkOrders.js'; export async function handler(_request, response) { const currentDateString = dateToString(new Date()); const workOrderMilestones = await getWorkOrderMilestones({ diff --git a/handlers/dashboard-get/dashboard.ts b/handlers/dashboard-get/dashboard.ts index ea70d553..7b185588 100644 --- a/handlers/dashboard-get/dashboard.ts +++ b/handlers/dashboard-get/dashboard.ts @@ -1,9 +1,9 @@ import { dateToString } from '@cityssm/utils-datetime' import type { Request, Response } from 'express' -import { getLotOccupancies } from '../../helpers/lotOccupancyDB/getLotOccupancies.js' -import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js' -import { getWorkOrders } from '../../helpers/lotOccupancyDB/getWorkOrders.js' +import { getLotOccupancies } from '../../database/getLotOccupancies.js' +import { getWorkOrderMilestones } from '../../database/getWorkOrderMilestones.js' +import { getWorkOrders } from '../../database/getWorkOrders.js' export async function handler( _request: Request, diff --git a/handlers/lotOccupancies-get/edit.js b/handlers/lotOccupancies-get/edit.js index 93f96a07..04441bbc 100644 --- a/handlers/lotOccupancies-get/edit.js +++ b/handlers/lotOccupancies-get/edit.js @@ -1,7 +1,7 @@ +import { getLotOccupancy } from '../../database/getLotOccupancy.js'; +import { getMaps } from '../../database/getMaps.js'; import { getLotOccupantTypes, getLotStatuses, getLotTypes, getOccupancyTypePrintsById, getOccupancyTypes, getWorkOrderTypes } from '../../helpers/functions.cache.js'; import * as configFunctions from '../../helpers/functions.config.js'; -import { getLotOccupancy } from '../../helpers/lotOccupancyDB/getLotOccupancy.js'; -import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js'; export async function handler(request, response) { const lotOccupancy = await getLotOccupancy(request.params.lotOccupancyId); if (lotOccupancy === undefined) { diff --git a/handlers/lotOccupancies-get/edit.ts b/handlers/lotOccupancies-get/edit.ts index c8ea7f6b..9545c4fc 100644 --- a/handlers/lotOccupancies-get/edit.ts +++ b/handlers/lotOccupancies-get/edit.ts @@ -1,5 +1,7 @@ import type { Request, Response } from 'express' +import { getLotOccupancy } from '../../database/getLotOccupancy.js' +import { getMaps } from '../../database/getMaps.js' import { getLotOccupantTypes, getLotStatuses, @@ -9,8 +11,6 @@ import { getWorkOrderTypes } from '../../helpers/functions.cache.js' import * as configFunctions from '../../helpers/functions.config.js' -import { getLotOccupancy } from '../../helpers/lotOccupancyDB/getLotOccupancy.js' -import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js' export async function handler(request: Request, response: Response): Promise { const lotOccupancy = await getLotOccupancy(request.params.lotOccupancyId) diff --git a/handlers/lotOccupancies-get/new.js b/handlers/lotOccupancies-get/new.js index 8d31ae37..63efa959 100644 --- a/handlers/lotOccupancies-get/new.js +++ b/handlers/lotOccupancies-get/new.js @@ -1,8 +1,8 @@ import { dateToInteger, dateToString } from '@cityssm/utils-datetime'; +import { getLot } from '../../database/getLot.js'; +import { getMaps } from '../../database/getMaps.js'; import { getLotOccupantTypes, getLotStatuses, getLotTypes, getOccupancyTypes } from '../../helpers/functions.cache.js'; import * as configFunctions from '../../helpers/functions.config.js'; -import { getLot } from '../../helpers/lotOccupancyDB/getLot.js'; -import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js'; export async function handler(request, response) { const startDate = new Date(); const lotOccupancy = { diff --git a/handlers/lotOccupancies-get/new.ts b/handlers/lotOccupancies-get/new.ts index bd20d7a6..6a1c6400 100644 --- a/handlers/lotOccupancies-get/new.ts +++ b/handlers/lotOccupancies-get/new.ts @@ -4,6 +4,8 @@ import { } from '@cityssm/utils-datetime' import type { Request, Response } from 'express' +import { getLot } from '../../database/getLot.js' +import { getMaps } from '../../database/getMaps.js' import { getLotOccupantTypes, getLotStatuses, @@ -11,8 +13,6 @@ import { getOccupancyTypes } from '../../helpers/functions.cache.js' import * as configFunctions from '../../helpers/functions.config.js' -import { getLot } from '../../helpers/lotOccupancyDB/getLot.js' -import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js' import type { LotOccupancy } from '../../types/recordTypes.js' export async function handler( diff --git a/handlers/lotOccupancies-get/search.js b/handlers/lotOccupancies-get/search.js index 0f8f083b..d39b7e5c 100644 --- a/handlers/lotOccupancies-get/search.js +++ b/handlers/lotOccupancies-get/search.js @@ -1,6 +1,6 @@ +import { getMaps } from '../../database/getMaps.js'; import { getLotTypes, getOccupancyTypes } from '../../helpers/functions.cache.js'; import * as configFunctions from '../../helpers/functions.config.js'; -import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js'; export async function handler(request, response) { const maps = await getMaps(); const lotTypes = await getLotTypes(); diff --git a/handlers/lotOccupancies-get/search.ts b/handlers/lotOccupancies-get/search.ts index 1f222051..d0834f1f 100644 --- a/handlers/lotOccupancies-get/search.ts +++ b/handlers/lotOccupancies-get/search.ts @@ -1,11 +1,11 @@ import type { Request, Response } from 'express' +import { getMaps } from '../../database/getMaps.js' import { getLotTypes, getOccupancyTypes } from '../../helpers/functions.cache.js' import * as configFunctions from '../../helpers/functions.config.js' -import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js' export async function handler( request: Request, diff --git a/handlers/lotOccupancies-get/view.js b/handlers/lotOccupancies-get/view.js index 4380626c..a955722d 100644 --- a/handlers/lotOccupancies-get/view.js +++ b/handlers/lotOccupancies-get/view.js @@ -1,6 +1,6 @@ +import { getLotOccupancy } from '../../database/getLotOccupancy.js'; import { getOccupancyTypePrintsById } from '../../helpers/functions.cache.js'; import * as configFunctions from '../../helpers/functions.config.js'; -import { getLotOccupancy } from '../../helpers/lotOccupancyDB/getLotOccupancy.js'; export async function handler(request, response) { const lotOccupancy = await getLotOccupancy(request.params.lotOccupancyId); if (lotOccupancy === undefined) { diff --git a/handlers/lotOccupancies-get/view.ts b/handlers/lotOccupancies-get/view.ts index 964efd20..4e6a00d9 100644 --- a/handlers/lotOccupancies-get/view.ts +++ b/handlers/lotOccupancies-get/view.ts @@ -1,8 +1,8 @@ import type { Request, Response } from 'express' +import { getLotOccupancy } from '../../database/getLotOccupancy.js' import { getOccupancyTypePrintsById } from '../../helpers/functions.cache.js' import * as configFunctions from '../../helpers/functions.config.js' -import { getLotOccupancy } from '../../helpers/lotOccupancyDB/getLotOccupancy.js' export async function handler( request: Request, diff --git a/handlers/lotOccupancies-post/doAddLotOccupancyComment.js b/handlers/lotOccupancies-post/doAddLotOccupancyComment.js index e7774b57..a7eff080 100644 --- a/handlers/lotOccupancies-post/doAddLotOccupancyComment.js +++ b/handlers/lotOccupancies-post/doAddLotOccupancyComment.js @@ -1,5 +1,5 @@ -import { addLotOccupancyComment } from '../../helpers/lotOccupancyDB/addLotOccupancyComment.js'; -import { getLotOccupancyComments } from '../../helpers/lotOccupancyDB/getLotOccupancyComments.js'; +import { addLotOccupancyComment } from '../../database/addLotOccupancyComment.js'; +import { getLotOccupancyComments } from '../../database/getLotOccupancyComments.js'; export async function handler(request, response) { await addLotOccupancyComment(request.body, request.session.user); const lotOccupancyComments = await getLotOccupancyComments(request.body.lotOccupancyId); diff --git a/handlers/lotOccupancies-post/doAddLotOccupancyComment.ts b/handlers/lotOccupancies-post/doAddLotOccupancyComment.ts index 18e14ce5..85ef4bf2 100644 --- a/handlers/lotOccupancies-post/doAddLotOccupancyComment.ts +++ b/handlers/lotOccupancies-post/doAddLotOccupancyComment.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { addLotOccupancyComment } from '../../helpers/lotOccupancyDB/addLotOccupancyComment.js' -import { getLotOccupancyComments } from '../../helpers/lotOccupancyDB/getLotOccupancyComments.js' +import { addLotOccupancyComment } from '../../database/addLotOccupancyComment.js' +import { getLotOccupancyComments } from '../../database/getLotOccupancyComments.js' export async function handler( request: Request, diff --git a/handlers/lotOccupancies-post/doAddLotOccupancyFee.js b/handlers/lotOccupancies-post/doAddLotOccupancyFee.js index 12bc8424..dad42ed6 100644 --- a/handlers/lotOccupancies-post/doAddLotOccupancyFee.js +++ b/handlers/lotOccupancies-post/doAddLotOccupancyFee.js @@ -1,5 +1,5 @@ -import { addLotOccupancyFee } from '../../helpers/lotOccupancyDB/addLotOccupancyFee.js'; -import { getLotOccupancyFees } from '../../helpers/lotOccupancyDB/getLotOccupancyFees.js'; +import { addLotOccupancyFee } from '../../database/addLotOccupancyFee.js'; +import { getLotOccupancyFees } from '../../database/getLotOccupancyFees.js'; export async function handler(request, response) { await addLotOccupancyFee(request.body, request.session.user); const lotOccupancyFees = await getLotOccupancyFees(request.body.lotOccupancyId); diff --git a/handlers/lotOccupancies-post/doAddLotOccupancyFee.ts b/handlers/lotOccupancies-post/doAddLotOccupancyFee.ts index d0b2726e..9a5d7335 100644 --- a/handlers/lotOccupancies-post/doAddLotOccupancyFee.ts +++ b/handlers/lotOccupancies-post/doAddLotOccupancyFee.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { addLotOccupancyFee } from '../../helpers/lotOccupancyDB/addLotOccupancyFee.js' -import { getLotOccupancyFees } from '../../helpers/lotOccupancyDB/getLotOccupancyFees.js' +import { addLotOccupancyFee } from '../../database/addLotOccupancyFee.js' +import { getLotOccupancyFees } from '../../database/getLotOccupancyFees.js' export async function handler( request: Request, diff --git a/handlers/lotOccupancies-post/doAddLotOccupancyOccupant.js b/handlers/lotOccupancies-post/doAddLotOccupancyOccupant.js index 4fad34eb..9349ce30 100644 --- a/handlers/lotOccupancies-post/doAddLotOccupancyOccupant.js +++ b/handlers/lotOccupancies-post/doAddLotOccupancyOccupant.js @@ -1,5 +1,5 @@ -import { addLotOccupancyOccupant } from '../../helpers/lotOccupancyDB/addLotOccupancyOccupant.js'; -import { getLotOccupancyOccupants } from '../../helpers/lotOccupancyDB/getLotOccupancyOccupants.js'; +import { addLotOccupancyOccupant } from '../../database/addLotOccupancyOccupant.js'; +import { getLotOccupancyOccupants } from '../../database/getLotOccupancyOccupants.js'; export async function handler(request, response) { await addLotOccupancyOccupant(request.body, request.session.user); const lotOccupancyOccupants = await getLotOccupancyOccupants(request.body.lotOccupancyId); diff --git a/handlers/lotOccupancies-post/doAddLotOccupancyOccupant.ts b/handlers/lotOccupancies-post/doAddLotOccupancyOccupant.ts index 276eff3f..ed04d148 100644 --- a/handlers/lotOccupancies-post/doAddLotOccupancyOccupant.ts +++ b/handlers/lotOccupancies-post/doAddLotOccupancyOccupant.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { addLotOccupancyOccupant } from '../../helpers/lotOccupancyDB/addLotOccupancyOccupant.js' -import { getLotOccupancyOccupants } from '../../helpers/lotOccupancyDB/getLotOccupancyOccupants.js' +import { addLotOccupancyOccupant } from '../../database/addLotOccupancyOccupant.js' +import { getLotOccupancyOccupants } from '../../database/getLotOccupancyOccupants.js' export async function handler( request: Request, diff --git a/handlers/lotOccupancies-post/doAddLotOccupancyTransaction.js b/handlers/lotOccupancies-post/doAddLotOccupancyTransaction.js index 2813d46f..34d799b8 100644 --- a/handlers/lotOccupancies-post/doAddLotOccupancyTransaction.js +++ b/handlers/lotOccupancies-post/doAddLotOccupancyTransaction.js @@ -1,5 +1,5 @@ -import { addLotOccupancyTransaction } from '../../helpers/lotOccupancyDB/addLotOccupancyTransaction.js'; -import { getLotOccupancyTransactions } from '../../helpers/lotOccupancyDB/getLotOccupancyTransactions.js'; +import { addLotOccupancyTransaction } from '../../database/addLotOccupancyTransaction.js'; +import { getLotOccupancyTransactions } from '../../database/getLotOccupancyTransactions.js'; export async function handler(request, response) { await addLotOccupancyTransaction(request.body, request.session.user); const lotOccupancyTransactions = await getLotOccupancyTransactions(request.body.lotOccupancyId, { includeIntegrations: true }); diff --git a/handlers/lotOccupancies-post/doAddLotOccupancyTransaction.ts b/handlers/lotOccupancies-post/doAddLotOccupancyTransaction.ts index 6483b0c0..3eb29205 100644 --- a/handlers/lotOccupancies-post/doAddLotOccupancyTransaction.ts +++ b/handlers/lotOccupancies-post/doAddLotOccupancyTransaction.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { addLotOccupancyTransaction } from '../../helpers/lotOccupancyDB/addLotOccupancyTransaction.js' -import { getLotOccupancyTransactions } from '../../helpers/lotOccupancyDB/getLotOccupancyTransactions.js' +import { addLotOccupancyTransaction } from '../../database/addLotOccupancyTransaction.js' +import { getLotOccupancyTransactions } from '../../database/getLotOccupancyTransactions.js' export async function handler( request: Request, diff --git a/handlers/lotOccupancies-post/doCopyLotOccupancy.js b/handlers/lotOccupancies-post/doCopyLotOccupancy.js index 5f0eec9a..f8db0fcc 100644 --- a/handlers/lotOccupancies-post/doCopyLotOccupancy.js +++ b/handlers/lotOccupancies-post/doCopyLotOccupancy.js @@ -1,4 +1,4 @@ -import { copyLotOccupancy } from '../../helpers/lotOccupancyDB/copyLotOccupancy.js'; +import { copyLotOccupancy } from '../../database/copyLotOccupancy.js'; export async function handler(request, response) { const lotOccupancyId = await copyLotOccupancy(request.body.lotOccupancyId, request.session.user); response.json({ diff --git a/handlers/lotOccupancies-post/doCopyLotOccupancy.ts b/handlers/lotOccupancies-post/doCopyLotOccupancy.ts index 1de6cc26..83cca149 100644 --- a/handlers/lotOccupancies-post/doCopyLotOccupancy.ts +++ b/handlers/lotOccupancies-post/doCopyLotOccupancy.ts @@ -1,6 +1,6 @@ import type { Request, Response } from 'express' -import { copyLotOccupancy } from '../../helpers/lotOccupancyDB/copyLotOccupancy.js' +import { copyLotOccupancy } from '../../database/copyLotOccupancy.js' export async function handler( request: Request, diff --git a/handlers/lotOccupancies-post/doCreateLotOccupancy.js b/handlers/lotOccupancies-post/doCreateLotOccupancy.js index dc43b1ae..a1e823cf 100644 --- a/handlers/lotOccupancies-post/doCreateLotOccupancy.js +++ b/handlers/lotOccupancies-post/doCreateLotOccupancy.js @@ -1,4 +1,4 @@ -import { addLotOccupancy } from '../../helpers/lotOccupancyDB/addLotOccupancy.js'; +import { addLotOccupancy } from '../../database/addLotOccupancy.js'; export async function handler(request, response) { const lotOccupancyId = await addLotOccupancy(request.body, request.session.user); response.json({ diff --git a/handlers/lotOccupancies-post/doCreateLotOccupancy.ts b/handlers/lotOccupancies-post/doCreateLotOccupancy.ts index 46e9f0dd..5da7164c 100644 --- a/handlers/lotOccupancies-post/doCreateLotOccupancy.ts +++ b/handlers/lotOccupancies-post/doCreateLotOccupancy.ts @@ -1,6 +1,6 @@ import type { Request, Response } from 'express' -import { addLotOccupancy } from '../../helpers/lotOccupancyDB/addLotOccupancy.js' +import { addLotOccupancy } from '../../database/addLotOccupancy.js' export async function handler( request: Request, diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancy.js b/handlers/lotOccupancies-post/doDeleteLotOccupancy.js index 778a9053..17a79b4c 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancy.js +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancy.js @@ -1,4 +1,4 @@ -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'; +import { deleteRecord } from '../../database/deleteRecord.js'; export async function handler(request, response) { const success = await deleteRecord('LotOccupancies', request.body.lotOccupancyId, request.session.user); response.json({ diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancy.ts b/handlers/lotOccupancies-post/doDeleteLotOccupancy.ts index 7ac3f53f..a5b49a29 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancy.ts +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancy.ts @@ -1,6 +1,6 @@ import type { Request, Response } from 'express' -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js' +import { deleteRecord } from '../../database/deleteRecord.js' export async function handler( request: Request, diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancyComment.js b/handlers/lotOccupancies-post/doDeleteLotOccupancyComment.js index f599793c..6b8d3d11 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancyComment.js +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancyComment.js @@ -1,5 +1,5 @@ -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'; -import { getLotOccupancyComments } from '../../helpers/lotOccupancyDB/getLotOccupancyComments.js'; +import { deleteRecord } from '../../database/deleteRecord.js'; +import { getLotOccupancyComments } from '../../database/getLotOccupancyComments.js'; export async function handler(request, response) { const success = await deleteRecord('LotOccupancyComments', request.body.lotOccupancyCommentId, request.session.user); const lotOccupancyComments = await getLotOccupancyComments(request.body.lotOccupancyId); diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancyComment.ts b/handlers/lotOccupancies-post/doDeleteLotOccupancyComment.ts index de132af6..8a22d58c 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancyComment.ts +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancyComment.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js' -import { getLotOccupancyComments } from '../../helpers/lotOccupancyDB/getLotOccupancyComments.js' +import { deleteRecord } from '../../database/deleteRecord.js' +import { getLotOccupancyComments } from '../../database/getLotOccupancyComments.js' export async function handler( request: Request, diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancyFee.js b/handlers/lotOccupancies-post/doDeleteLotOccupancyFee.js index 42cedfcd..eebc98b7 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancyFee.js +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancyFee.js @@ -1,5 +1,5 @@ -import { deleteLotOccupancyFee } from '../../helpers/lotOccupancyDB/deleteLotOccupancyFee.js'; -import { getLotOccupancyFees } from '../../helpers/lotOccupancyDB/getLotOccupancyFees.js'; +import { deleteLotOccupancyFee } from '../../database/deleteLotOccupancyFee.js'; +import { getLotOccupancyFees } from '../../database/getLotOccupancyFees.js'; export async function handler(request, response) { const success = await deleteLotOccupancyFee(request.body.lotOccupancyId, request.body.feeId, request.session.user); const lotOccupancyFees = await getLotOccupancyFees(request.body.lotOccupancyId); diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancyFee.ts b/handlers/lotOccupancies-post/doDeleteLotOccupancyFee.ts index 93d3943b..4ec06420 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancyFee.ts +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancyFee.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { deleteLotOccupancyFee } from '../../helpers/lotOccupancyDB/deleteLotOccupancyFee.js' -import { getLotOccupancyFees } from '../../helpers/lotOccupancyDB/getLotOccupancyFees.js' +import { deleteLotOccupancyFee } from '../../database/deleteLotOccupancyFee.js' +import { getLotOccupancyFees } from '../../database/getLotOccupancyFees.js' export async function handler( request: Request, diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancyOccupant.js b/handlers/lotOccupancies-post/doDeleteLotOccupancyOccupant.js index d1452aac..06022355 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancyOccupant.js +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancyOccupant.js @@ -1,5 +1,5 @@ -import { deleteLotOccupancyOccupant } from '../../helpers/lotOccupancyDB/deleteLotOccupancyOccupant.js'; -import { getLotOccupancyOccupants } from '../../helpers/lotOccupancyDB/getLotOccupancyOccupants.js'; +import { deleteLotOccupancyOccupant } from '../../database/deleteLotOccupancyOccupant.js'; +import { getLotOccupancyOccupants } from '../../database/getLotOccupancyOccupants.js'; export async function handler(request, response) { const success = await deleteLotOccupancyOccupant(request.body.lotOccupancyId, request.body.lotOccupantIndex, request.session.user); const lotOccupancyOccupants = await getLotOccupancyOccupants(request.body.lotOccupancyId); diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancyOccupant.ts b/handlers/lotOccupancies-post/doDeleteLotOccupancyOccupant.ts index 638cadbc..cec0cce0 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancyOccupant.ts +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancyOccupant.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { deleteLotOccupancyOccupant } from '../../helpers/lotOccupancyDB/deleteLotOccupancyOccupant.js' -import { getLotOccupancyOccupants } from '../../helpers/lotOccupancyDB/getLotOccupancyOccupants.js' +import { deleteLotOccupancyOccupant } from '../../database/deleteLotOccupancyOccupant.js' +import { getLotOccupancyOccupants } from '../../database/getLotOccupancyOccupants.js' export async function handler( request: Request, diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancyTransaction.js b/handlers/lotOccupancies-post/doDeleteLotOccupancyTransaction.js index 82d7b897..f0d6a1a0 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancyTransaction.js +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancyTransaction.js @@ -1,5 +1,5 @@ -import { deleteLotOccupancyTransaction } from '../../helpers/lotOccupancyDB/deleteLotOccupancyTransaction.js'; -import { getLotOccupancyTransactions } from '../../helpers/lotOccupancyDB/getLotOccupancyTransactions.js'; +import { deleteLotOccupancyTransaction } from '../../database/deleteLotOccupancyTransaction.js'; +import { getLotOccupancyTransactions } from '../../database/getLotOccupancyTransactions.js'; export async function handler(request, response) { const success = await deleteLotOccupancyTransaction(request.body.lotOccupancyId, request.body.transactionIndex, request.session.user); const lotOccupancyTransactions = await getLotOccupancyTransactions(request.body.lotOccupancyId, { includeIntegrations: true }); diff --git a/handlers/lotOccupancies-post/doDeleteLotOccupancyTransaction.ts b/handlers/lotOccupancies-post/doDeleteLotOccupancyTransaction.ts index d28cf8d8..5243ec84 100644 --- a/handlers/lotOccupancies-post/doDeleteLotOccupancyTransaction.ts +++ b/handlers/lotOccupancies-post/doDeleteLotOccupancyTransaction.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { deleteLotOccupancyTransaction } from '../../helpers/lotOccupancyDB/deleteLotOccupancyTransaction.js' -import { getLotOccupancyTransactions } from '../../helpers/lotOccupancyDB/getLotOccupancyTransactions.js' +import { deleteLotOccupancyTransaction } from '../../database/deleteLotOccupancyTransaction.js' +import { getLotOccupancyTransactions } from '../../database/getLotOccupancyTransactions.js' export async function handler( request: Request, diff --git a/handlers/lotOccupancies-post/doGetFees.js b/handlers/lotOccupancies-post/doGetFees.js index fbd4dc8f..c3e7ace7 100644 --- a/handlers/lotOccupancies-post/doGetFees.js +++ b/handlers/lotOccupancies-post/doGetFees.js @@ -1,5 +1,5 @@ -import { getLotOccupancy } from '../../helpers/lotOccupancyDB/getLotOccupancy.js'; -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js'; +import { getLotOccupancy } from '../../database/getLotOccupancy.js'; +import { getFeeCategories } from '../../database/getFeeCategories.js'; export async function handler(request, response) { const lotOccupancyId = request.body.lotOccupancyId; const lotOccupancy = (await getLotOccupancy(lotOccupancyId)); diff --git a/handlers/lotOccupancies-post/doGetFees.ts b/handlers/lotOccupancies-post/doGetFees.ts index 22ba6c49..016911ec 100644 --- a/handlers/lotOccupancies-post/doGetFees.ts +++ b/handlers/lotOccupancies-post/doGetFees.ts @@ -1,8 +1,8 @@ import type { Request, Response } from 'express' -import { getLotOccupancy } from '../../helpers/lotOccupancyDB/getLotOccupancy.js' +import { getLotOccupancy } from '../../database/getLotOccupancy.js' -import { getFeeCategories } from '../../helpers/lotOccupancyDB/getFeeCategories.js' +import { getFeeCategories } from '../../database/getFeeCategories.js' export async function handler( request: Request, diff --git a/handlers/lotOccupancies-post/doSearchLotOccupancies.js b/handlers/lotOccupancies-post/doSearchLotOccupancies.js index ced835e7..c6b8a43a 100644 --- a/handlers/lotOccupancies-post/doSearchLotOccupancies.js +++ b/handlers/lotOccupancies-post/doSearchLotOccupancies.js @@ -1,4 +1,4 @@ -import { getLotOccupancies } from '../../helpers/lotOccupancyDB/getLotOccupancies.js'; +import { getLotOccupancies } from '../../database/getLotOccupancies.js'; export async function handler(request, response) { const result = await getLotOccupancies(request.body, { limit: request.body.limit, diff --git a/handlers/lotOccupancies-post/doSearchLotOccupancies.ts b/handlers/lotOccupancies-post/doSearchLotOccupancies.ts index 06c903c9..cb25a0e7 100644 --- a/handlers/lotOccupancies-post/doSearchLotOccupancies.ts +++ b/handlers/lotOccupancies-post/doSearchLotOccupancies.ts @@ -1,6 +1,6 @@ import type { Request, Response } from 'express' -import { getLotOccupancies } from '../../helpers/lotOccupancyDB/getLotOccupancies.js' +import { getLotOccupancies } from '../../database/getLotOccupancies.js' export async function handler( request: Request, diff --git a/handlers/lotOccupancies-post/doSearchPastOccupants.js b/handlers/lotOccupancies-post/doSearchPastOccupants.js index ce348943..9da595e8 100644 --- a/handlers/lotOccupancies-post/doSearchPastOccupants.js +++ b/handlers/lotOccupancies-post/doSearchPastOccupants.js @@ -1,4 +1,4 @@ -import { getPastLotOccupancyOccupants } from '../../helpers/lotOccupancyDB/getPastLotOccupancyOccupants.js'; +import { getPastLotOccupancyOccupants } from '../../database/getPastLotOccupancyOccupants.js'; export async function handler(request, response) { const occupants = await getPastLotOccupancyOccupants(request.body, { limit: Number.parseInt(request.body.limit, 10) diff --git a/handlers/lotOccupancies-post/doSearchPastOccupants.ts b/handlers/lotOccupancies-post/doSearchPastOccupants.ts index 7980d57f..c811a179 100644 --- a/handlers/lotOccupancies-post/doSearchPastOccupants.ts +++ b/handlers/lotOccupancies-post/doSearchPastOccupants.ts @@ -1,6 +1,6 @@ import type { Request, Response } from 'express' -import { getPastLotOccupancyOccupants } from '../../helpers/lotOccupancyDB/getPastLotOccupancyOccupants.js' +import { getPastLotOccupancyOccupants } from '../../database/getPastLotOccupancyOccupants.js' export async function handler( request: Request, diff --git a/handlers/lotOccupancies-post/doUpdateLotOccupancy.js b/handlers/lotOccupancies-post/doUpdateLotOccupancy.js index 3712e13e..a1578c5d 100644 --- a/handlers/lotOccupancies-post/doUpdateLotOccupancy.js +++ b/handlers/lotOccupancies-post/doUpdateLotOccupancy.js @@ -1,4 +1,4 @@ -import { updateLotOccupancy } from '../../helpers/lotOccupancyDB/updateLotOccupancy.js'; +import { updateLotOccupancy } from '../../database/updateLotOccupancy.js'; export async function handler(request, response) { const success = await updateLotOccupancy(request.body, request.session.user); response.json({ diff --git a/handlers/lotOccupancies-post/doUpdateLotOccupancy.ts b/handlers/lotOccupancies-post/doUpdateLotOccupancy.ts index c22e8913..df2dfd51 100644 --- a/handlers/lotOccupancies-post/doUpdateLotOccupancy.ts +++ b/handlers/lotOccupancies-post/doUpdateLotOccupancy.ts @@ -1,6 +1,6 @@ import type { Request, Response } from 'express' -import { updateLotOccupancy } from '../../helpers/lotOccupancyDB/updateLotOccupancy.js' +import { updateLotOccupancy } from '../../database/updateLotOccupancy.js' export async function handler( request: Request, diff --git a/handlers/lotOccupancies-post/doUpdateLotOccupancyComment.js b/handlers/lotOccupancies-post/doUpdateLotOccupancyComment.js index b029bedb..d864fa77 100644 --- a/handlers/lotOccupancies-post/doUpdateLotOccupancyComment.js +++ b/handlers/lotOccupancies-post/doUpdateLotOccupancyComment.js @@ -1,5 +1,5 @@ -import { getLotOccupancyComments } from '../../helpers/lotOccupancyDB/getLotOccupancyComments.js'; -import { updateLotOccupancyComment } from '../../helpers/lotOccupancyDB/updateLotOccupancyComment.js'; +import { getLotOccupancyComments } from '../../database/getLotOccupancyComments.js'; +import { updateLotOccupancyComment } from '../../database/updateLotOccupancyComment.js'; export async function handler(request, response) { const success = await updateLotOccupancyComment(request.body, request.session.user); const lotOccupancyComments = await getLotOccupancyComments(request.body.lotOccupancyId); diff --git a/handlers/lotOccupancies-post/doUpdateLotOccupancyComment.ts b/handlers/lotOccupancies-post/doUpdateLotOccupancyComment.ts index ef8ff9ab..202f7e57 100644 --- a/handlers/lotOccupancies-post/doUpdateLotOccupancyComment.ts +++ b/handlers/lotOccupancies-post/doUpdateLotOccupancyComment.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { getLotOccupancyComments } from '../../helpers/lotOccupancyDB/getLotOccupancyComments.js' -import { updateLotOccupancyComment } from '../../helpers/lotOccupancyDB/updateLotOccupancyComment.js' +import { getLotOccupancyComments } from '../../database/getLotOccupancyComments.js' +import { updateLotOccupancyComment } from '../../database/updateLotOccupancyComment.js' export async function handler( request: Request, diff --git a/handlers/lotOccupancies-post/doUpdateLotOccupancyFeeQuantity.js b/handlers/lotOccupancies-post/doUpdateLotOccupancyFeeQuantity.js index e4d9db0d..c2f8182d 100644 --- a/handlers/lotOccupancies-post/doUpdateLotOccupancyFeeQuantity.js +++ b/handlers/lotOccupancies-post/doUpdateLotOccupancyFeeQuantity.js @@ -1,5 +1,5 @@ -import { getLotOccupancyFees } from '../../helpers/lotOccupancyDB/getLotOccupancyFees.js'; -import { updateLotOccupancyFeeQuantity } from '../../helpers/lotOccupancyDB/updateLotOccupancyFeeQuantity.js'; +import { getLotOccupancyFees } from '../../database/getLotOccupancyFees.js'; +import { updateLotOccupancyFeeQuantity } from '../../database/updateLotOccupancyFeeQuantity.js'; export async function handler(request, response) { const success = await updateLotOccupancyFeeQuantity(request.body, request.session.user); const lotOccupancyFees = await getLotOccupancyFees(request.body.lotOccupancyId); diff --git a/handlers/lotOccupancies-post/doUpdateLotOccupancyFeeQuantity.ts b/handlers/lotOccupancies-post/doUpdateLotOccupancyFeeQuantity.ts index 43d15382..6b14bccf 100644 --- a/handlers/lotOccupancies-post/doUpdateLotOccupancyFeeQuantity.ts +++ b/handlers/lotOccupancies-post/doUpdateLotOccupancyFeeQuantity.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { getLotOccupancyFees } from '../../helpers/lotOccupancyDB/getLotOccupancyFees.js' -import { updateLotOccupancyFeeQuantity } from '../../helpers/lotOccupancyDB/updateLotOccupancyFeeQuantity.js' +import { getLotOccupancyFees } from '../../database/getLotOccupancyFees.js' +import { updateLotOccupancyFeeQuantity } from '../../database/updateLotOccupancyFeeQuantity.js' export async function handler( request: Request, diff --git a/handlers/lotOccupancies-post/doUpdateLotOccupancyOccupant.js b/handlers/lotOccupancies-post/doUpdateLotOccupancyOccupant.js index 55002820..a841f05c 100644 --- a/handlers/lotOccupancies-post/doUpdateLotOccupancyOccupant.js +++ b/handlers/lotOccupancies-post/doUpdateLotOccupancyOccupant.js @@ -1,5 +1,5 @@ -import { getLotOccupancyOccupants } from '../../helpers/lotOccupancyDB/getLotOccupancyOccupants.js'; -import { updateLotOccupancyOccupant } from '../../helpers/lotOccupancyDB/updateLotOccupancyOccupant.js'; +import { getLotOccupancyOccupants } from '../../database/getLotOccupancyOccupants.js'; +import { updateLotOccupancyOccupant } from '../../database/updateLotOccupancyOccupant.js'; export async function handler(request, response) { const success = await updateLotOccupancyOccupant(request.body, request.session.user); const lotOccupancyOccupants = await getLotOccupancyOccupants(request.body.lotOccupancyId); diff --git a/handlers/lotOccupancies-post/doUpdateLotOccupancyOccupant.ts b/handlers/lotOccupancies-post/doUpdateLotOccupancyOccupant.ts index b67b0e6e..e6366eb8 100644 --- a/handlers/lotOccupancies-post/doUpdateLotOccupancyOccupant.ts +++ b/handlers/lotOccupancies-post/doUpdateLotOccupancyOccupant.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { getLotOccupancyOccupants } from '../../helpers/lotOccupancyDB/getLotOccupancyOccupants.js' -import { updateLotOccupancyOccupant } from '../../helpers/lotOccupancyDB/updateLotOccupancyOccupant.js' +import { getLotOccupancyOccupants } from '../../database/getLotOccupancyOccupants.js' +import { updateLotOccupancyOccupant } from '../../database/updateLotOccupancyOccupant.js' export async function handler( request: Request, diff --git a/handlers/lotOccupancies-post/doUpdateLotOccupancyTransaction.js b/handlers/lotOccupancies-post/doUpdateLotOccupancyTransaction.js index 41d435cb..096e457d 100644 --- a/handlers/lotOccupancies-post/doUpdateLotOccupancyTransaction.js +++ b/handlers/lotOccupancies-post/doUpdateLotOccupancyTransaction.js @@ -1,5 +1,5 @@ -import { getLotOccupancyTransactions } from '../../helpers/lotOccupancyDB/getLotOccupancyTransactions.js'; -import { updateLotOccupancyTransaction } from '../../helpers/lotOccupancyDB/updateLotOccupancyTransaction.js'; +import { getLotOccupancyTransactions } from '../../database/getLotOccupancyTransactions.js'; +import { updateLotOccupancyTransaction } from '../../database/updateLotOccupancyTransaction.js'; export async function handler(request, response) { await updateLotOccupancyTransaction(request.body, request.session.user); const lotOccupancyTransactions = await getLotOccupancyTransactions(request.body.lotOccupancyId, { includeIntegrations: true }); diff --git a/handlers/lotOccupancies-post/doUpdateLotOccupancyTransaction.ts b/handlers/lotOccupancies-post/doUpdateLotOccupancyTransaction.ts index 101063af..e4ff1730 100644 --- a/handlers/lotOccupancies-post/doUpdateLotOccupancyTransaction.ts +++ b/handlers/lotOccupancies-post/doUpdateLotOccupancyTransaction.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { getLotOccupancyTransactions } from '../../helpers/lotOccupancyDB/getLotOccupancyTransactions.js' -import { updateLotOccupancyTransaction } from '../../helpers/lotOccupancyDB/updateLotOccupancyTransaction.js' +import { getLotOccupancyTransactions } from '../../database/getLotOccupancyTransactions.js' +import { updateLotOccupancyTransaction } from '../../database/updateLotOccupancyTransaction.js' export async function handler( request: Request, diff --git a/handlers/lots-get/edit.js b/handlers/lots-get/edit.js index d58aeb88..e8f7703c 100644 --- a/handlers/lots-get/edit.js +++ b/handlers/lots-get/edit.js @@ -1,7 +1,7 @@ +import { getLot } from '../../database/getLot.js'; +import { getMaps } from '../../database/getMaps.js'; import * as cacheFunctions from '../../helpers/functions.cache.js'; import * as configFunctions from '../../helpers/functions.config.js'; -import { getLot } from '../../helpers/lotOccupancyDB/getLot.js'; -import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js'; export async function handler(request, response) { const lot = await getLot(request.params.lotId); if (lot === undefined) { diff --git a/handlers/lots-get/edit.ts b/handlers/lots-get/edit.ts index 343a346d..faca40c6 100644 --- a/handlers/lots-get/edit.ts +++ b/handlers/lots-get/edit.ts @@ -1,9 +1,9 @@ import type { Request, Response } from 'express' +import { getLot } from '../../database/getLot.js' +import { getMaps } from '../../database/getMaps.js' import * as cacheFunctions from '../../helpers/functions.cache.js' import * as configFunctions from '../../helpers/functions.config.js' -import { getLot } from '../../helpers/lotOccupancyDB/getLot.js' -import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js' export async function handler( request: Request, diff --git a/handlers/lots-get/new.js b/handlers/lots-get/new.js index 11397b92..16e43897 100644 --- a/handlers/lots-get/new.js +++ b/handlers/lots-get/new.js @@ -1,6 +1,6 @@ +import { getMaps } from '../../database/getMaps.js'; import * as cacheFunctions from '../../helpers/functions.cache.js'; import * as configFunctions from '../../helpers/functions.config.js'; -import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js'; export async function handler(request, response) { const lot = { lotId: -1, @@ -20,7 +20,7 @@ export async function handler(request, response) { const lotTypes = await cacheFunctions.getLotTypes(); const lotStatuses = await cacheFunctions.getLotStatuses(); response.render('lot-edit', { - headTitle: 'Create a New ' + configFunctions.getProperty('aliases.lot'), + headTitle: `Create a New ${configFunctions.getProperty('aliases.lot')}`, lot, isCreate: true, maps, diff --git a/handlers/lots-get/new.ts b/handlers/lots-get/new.ts index 5b820cb2..c98f6057 100644 --- a/handlers/lots-get/new.ts +++ b/handlers/lots-get/new.ts @@ -1,8 +1,8 @@ import type { Request, Response } from 'express' +import { getMaps } from '../../database/getMaps.js' import * as cacheFunctions from '../../helpers/functions.cache.js' import * as configFunctions from '../../helpers/functions.config.js' -import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js' import type { Lot } from '../../types/recordTypes.js' export async function handler( @@ -33,7 +33,7 @@ export async function handler( const lotStatuses = await cacheFunctions.getLotStatuses() response.render('lot-edit', { - headTitle: 'Create a New ' + configFunctions.getProperty('aliases.lot'), + headTitle: `Create a New ${configFunctions.getProperty('aliases.lot')}`, lot, isCreate: true, maps, diff --git a/handlers/lots-get/next.js b/handlers/lots-get/next.js index 226d2810..b8012993 100644 --- a/handlers/lots-get/next.js +++ b/handlers/lots-get/next.js @@ -4,12 +4,9 @@ export async function handler(request, response) { const lotId = Number.parseInt(request.params.lotId, 10); const nextLotId = await getNextLotId(lotId); if (nextLotId === undefined) { - response.redirect(configFunctions.getProperty('reverseProxy.urlPrefix') + - '/lots/?error=noNextLotIdFound'); + response.redirect(`${configFunctions.getProperty('reverseProxy.urlPrefix')}/lots/?error=noNextLotIdFound`); return; } - response.redirect(configFunctions.getProperty('reverseProxy.urlPrefix') + - '/lots/' + - nextLotId.toString()); + response.redirect(`${configFunctions.getProperty('reverseProxy.urlPrefix')}/lots/${nextLotId.toString()}`); } export default handler; diff --git a/handlers/lots-get/next.ts b/handlers/lots-get/next.ts index 0ff067a3..44e05886 100644 --- a/handlers/lots-get/next.ts +++ b/handlers/lots-get/next.ts @@ -13,16 +13,17 @@ export async function handler( if (nextLotId === undefined) { response.redirect( - configFunctions.getProperty('reverseProxy.urlPrefix') + - '/lots/?error=noNextLotIdFound' + `${configFunctions.getProperty( + 'reverseProxy.urlPrefix' + )}/lots/?error=noNextLotIdFound` ) return } response.redirect( - configFunctions.getProperty('reverseProxy.urlPrefix') + - '/lots/' + - nextLotId.toString() + `${configFunctions.getProperty( + 'reverseProxy.urlPrefix' + )}/lots/${nextLotId.toString()}` ) } diff --git a/handlers/lots-get/previous.js b/handlers/lots-get/previous.js index 649b15d3..20dcf88d 100644 --- a/handlers/lots-get/previous.js +++ b/handlers/lots-get/previous.js @@ -4,12 +4,9 @@ export async function handler(request, response) { const lotId = Number.parseInt(request.params.lotId, 10); const previousLotId = await getPreviousLotId(lotId); if (previousLotId === undefined) { - response.redirect(configFunctions.getProperty('reverseProxy.urlPrefix') + - '/lots/?error=noPreviousLotIdFound'); + response.redirect(`${configFunctions.getProperty('reverseProxy.urlPrefix')}/lots/?error=noPreviousLotIdFound`); return; } - response.redirect(configFunctions.getProperty('reverseProxy.urlPrefix') + - '/lots/' + - previousLotId.toString()); + response.redirect(`${configFunctions.getProperty('reverseProxy.urlPrefix')}/lots/${previousLotId.toString()}`); } export default handler; diff --git a/handlers/lots-get/previous.ts b/handlers/lots-get/previous.ts index 45ffb669..051c40b0 100644 --- a/handlers/lots-get/previous.ts +++ b/handlers/lots-get/previous.ts @@ -13,16 +13,17 @@ export async function handler( if (previousLotId === undefined) { response.redirect( - configFunctions.getProperty('reverseProxy.urlPrefix') + - '/lots/?error=noPreviousLotIdFound' + `${configFunctions.getProperty( + 'reverseProxy.urlPrefix' + )}/lots/?error=noPreviousLotIdFound` ) return } response.redirect( - configFunctions.getProperty('reverseProxy.urlPrefix') + - '/lots/' + - previousLotId.toString() + `${configFunctions.getProperty( + 'reverseProxy.urlPrefix' + )}/lots/${previousLotId.toString()}` ) } diff --git a/handlers/lots-get/search.js b/handlers/lots-get/search.js index 61b61188..27afdb0b 100644 --- a/handlers/lots-get/search.js +++ b/handlers/lots-get/search.js @@ -1,12 +1,12 @@ +import { getMaps } from '../../database/getMaps.js'; import { getLotTypes, getLotStatuses } from '../../helpers/functions.cache.js'; import * as configFunctions from '../../helpers/functions.config.js'; -import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js'; export async function handler(request, response) { const maps = await getMaps(); const lotTypes = await getLotTypes(); const lotStatuses = await getLotStatuses(); response.render('lot-search', { - headTitle: configFunctions.getProperty('aliases.lot') + ' Search', + headTitle: `${configFunctions.getProperty('aliases.lot')} Search`, maps, lotTypes, lotStatuses, diff --git a/handlers/lots-get/search.ts b/handlers/lots-get/search.ts index bcc63ff3..1de9af25 100644 --- a/handlers/lots-get/search.ts +++ b/handlers/lots-get/search.ts @@ -1,8 +1,8 @@ import type { Request, Response } from 'express' +import { getMaps } from '../../database/getMaps.js' import { getLotTypes, getLotStatuses } from '../../helpers/functions.cache.js' import * as configFunctions from '../../helpers/functions.config.js' -import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js' export async function handler( request: Request, @@ -13,7 +13,7 @@ export async function handler( const lotStatuses = await getLotStatuses() response.render('lot-search', { - headTitle: configFunctions.getProperty('aliases.lot') + ' Search', + headTitle: `${configFunctions.getProperty('aliases.lot')} Search`, maps, lotTypes, lotStatuses, diff --git a/handlers/lots-get/view.js b/handlers/lots-get/view.js index 891e8c43..2a457dd4 100644 --- a/handlers/lots-get/view.js +++ b/handlers/lots-get/view.js @@ -1,6 +1,6 @@ +import { getLot } from '../../database/getLot.js'; import * as configFunctions from '../../helpers/functions.config.js'; import { getNextLotId, getPreviousLotId } from '../../helpers/functions.lots.js'; -import { getLot } from '../../helpers/lotOccupancyDB/getLot.js'; export async function handler(request, response) { const lot = await getLot(request.params.lotId); if (lot === undefined) { diff --git a/handlers/lots-get/view.ts b/handlers/lots-get/view.ts index 2fb20bb9..aabae21c 100644 --- a/handlers/lots-get/view.ts +++ b/handlers/lots-get/view.ts @@ -1,8 +1,8 @@ import type { Request, Response } from 'express' +import { getLot } from '../../database/getLot.js' import * as configFunctions from '../../helpers/functions.config.js' import { getNextLotId, getPreviousLotId } from '../../helpers/functions.lots.js' -import { getLot } from '../../helpers/lotOccupancyDB/getLot.js' export async function handler( request: Request, diff --git a/handlers/lots-post/doAddLotComment.js b/handlers/lots-post/doAddLotComment.js index 45011e98..f49c9d20 100644 --- a/handlers/lots-post/doAddLotComment.js +++ b/handlers/lots-post/doAddLotComment.js @@ -1,5 +1,5 @@ -import { addLotComment } from '../../helpers/lotOccupancyDB/addLotComment.js'; -import { getLotComments } from '../../helpers/lotOccupancyDB/getLotComments.js'; +import { addLotComment } from '../../database/addLotComment.js'; +import { getLotComments } from '../../database/getLotComments.js'; export async function handler(request, response) { await addLotComment(request.body, request.session.user); const lotComments = await getLotComments(request.body.lotId); diff --git a/handlers/lots-post/doAddLotComment.ts b/handlers/lots-post/doAddLotComment.ts index edf4f7fb..04a18191 100644 --- a/handlers/lots-post/doAddLotComment.ts +++ b/handlers/lots-post/doAddLotComment.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { addLotComment } from '../../helpers/lotOccupancyDB/addLotComment.js' -import { getLotComments } from '../../helpers/lotOccupancyDB/getLotComments.js' +import { addLotComment } from '../../database/addLotComment.js' +import { getLotComments } from '../../database/getLotComments.js' export async function handler( request: Request, diff --git a/handlers/lots-post/doCreateLot.js b/handlers/lots-post/doCreateLot.js index d7975f06..cf92e541 100644 --- a/handlers/lots-post/doCreateLot.js +++ b/handlers/lots-post/doCreateLot.js @@ -1,5 +1,5 @@ import { clearNextPreviousLotIdCache } from '../../helpers/functions.lots.js'; -import { addLot } from '../../helpers/lotOccupancyDB/addLot.js'; +import { addLot } from '../../database/addLot.js'; export async function handler(request, response) { const lotId = await addLot(request.body, request.session.user); response.json({ diff --git a/handlers/lots-post/doCreateLot.ts b/handlers/lots-post/doCreateLot.ts index 5ffa31ed..91431b2e 100644 --- a/handlers/lots-post/doCreateLot.ts +++ b/handlers/lots-post/doCreateLot.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' import { clearNextPreviousLotIdCache } from '../../helpers/functions.lots.js' -import { addLot } from '../../helpers/lotOccupancyDB/addLot.js' +import { addLot } from '../../database/addLot.js' export async function handler( request: Request, diff --git a/handlers/lots-post/doDeleteLot.js b/handlers/lots-post/doDeleteLot.js index 3b87b124..0469b4bd 100644 --- a/handlers/lots-post/doDeleteLot.js +++ b/handlers/lots-post/doDeleteLot.js @@ -1,5 +1,5 @@ import { clearNextPreviousLotIdCache } from '../../helpers/functions.lots.js'; -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'; +import { deleteRecord } from '../../database/deleteRecord.js'; export async function handler(request, response) { const lotId = Number.parseInt(request.body.lotId, 10); const success = await deleteRecord('Lots', lotId, request.session.user); diff --git a/handlers/lots-post/doDeleteLot.ts b/handlers/lots-post/doDeleteLot.ts index 301ec1e6..a16a9132 100644 --- a/handlers/lots-post/doDeleteLot.ts +++ b/handlers/lots-post/doDeleteLot.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' import { clearNextPreviousLotIdCache } from '../../helpers/functions.lots.js' -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js' +import { deleteRecord } from '../../database/deleteRecord.js' export async function handler( request: Request, diff --git a/handlers/lots-post/doDeleteLotComment.js b/handlers/lots-post/doDeleteLotComment.js index 2f8ea4ba..87cf4e6a 100644 --- a/handlers/lots-post/doDeleteLotComment.js +++ b/handlers/lots-post/doDeleteLotComment.js @@ -1,5 +1,5 @@ -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'; -import { getLotComments } from '../../helpers/lotOccupancyDB/getLotComments.js'; +import { deleteRecord } from '../../database/deleteRecord.js'; +import { getLotComments } from '../../database/getLotComments.js'; export async function handler(request, response) { const success = await deleteRecord('LotComments', request.body.lotCommentId, request.session.user); const lotComments = await getLotComments(request.body.lotId); diff --git a/handlers/lots-post/doDeleteLotComment.ts b/handlers/lots-post/doDeleteLotComment.ts index cf2dd999..a0421ffa 100644 --- a/handlers/lots-post/doDeleteLotComment.ts +++ b/handlers/lots-post/doDeleteLotComment.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js' -import { getLotComments } from '../../helpers/lotOccupancyDB/getLotComments.js' +import { deleteRecord } from '../../database/deleteRecord.js' +import { getLotComments } from '../../database/getLotComments.js' export async function handler( request: Request, diff --git a/handlers/lots-post/doSearchLots.js b/handlers/lots-post/doSearchLots.js index 1577d0a0..215fd56d 100644 --- a/handlers/lots-post/doSearchLots.js +++ b/handlers/lots-post/doSearchLots.js @@ -1,4 +1,4 @@ -import { getLots } from '../../helpers/lotOccupancyDB/getLots.js'; +import { getLots } from '../../database/getLots.js'; export async function handler(request, response) { const result = await getLots(request.body, { limit: request.body.limit, diff --git a/handlers/lots-post/doSearchLots.ts b/handlers/lots-post/doSearchLots.ts index 93b549b1..e0b5e494 100644 --- a/handlers/lots-post/doSearchLots.ts +++ b/handlers/lots-post/doSearchLots.ts @@ -1,6 +1,6 @@ import type { Request, Response } from 'express' -import { getLots } from '../../helpers/lotOccupancyDB/getLots.js' +import { getLots } from '../../database/getLots.js' export async function handler(request: Request, response: Response): Promise { const result = await getLots(request.body, { diff --git a/handlers/lots-post/doUpdateLot.js b/handlers/lots-post/doUpdateLot.js index 430b9034..1dc2a970 100644 --- a/handlers/lots-post/doUpdateLot.js +++ b/handlers/lots-post/doUpdateLot.js @@ -1,5 +1,5 @@ import { clearNextPreviousLotIdCache } from '../../helpers/functions.lots.js'; -import { updateLot } from '../../helpers/lotOccupancyDB/updateLot.js'; +import { updateLot } from '../../database/updateLot.js'; export async function handler(request, response) { const lotId = Number.parseInt(request.body.lotId, 10); const success = await updateLot(request.body, request.session.user); diff --git a/handlers/lots-post/doUpdateLot.ts b/handlers/lots-post/doUpdateLot.ts index d196ef09..b4668fbc 100644 --- a/handlers/lots-post/doUpdateLot.ts +++ b/handlers/lots-post/doUpdateLot.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' import { clearNextPreviousLotIdCache } from '../../helpers/functions.lots.js' -import { updateLot } from '../../helpers/lotOccupancyDB/updateLot.js' +import { updateLot } from '../../database/updateLot.js' export async function handler( request: Request, diff --git a/handlers/lots-post/doUpdateLotComment.js b/handlers/lots-post/doUpdateLotComment.js index 24dc4b51..ecf659b3 100644 --- a/handlers/lots-post/doUpdateLotComment.js +++ b/handlers/lots-post/doUpdateLotComment.js @@ -1,5 +1,5 @@ -import { getLotComments } from '../../helpers/lotOccupancyDB/getLotComments.js'; -import { updateLotComment } from '../../helpers/lotOccupancyDB/updateLotComment.js'; +import { getLotComments } from '../../database/getLotComments.js'; +import { updateLotComment } from '../../database/updateLotComment.js'; export async function handler(request, response) { const success = await updateLotComment(request.body, request.session.user); const lotComments = await getLotComments(request.body.lotId); diff --git a/handlers/lots-post/doUpdateLotComment.ts b/handlers/lots-post/doUpdateLotComment.ts index 70a37758..10ded0a7 100644 --- a/handlers/lots-post/doUpdateLotComment.ts +++ b/handlers/lots-post/doUpdateLotComment.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { getLotComments } from '../../helpers/lotOccupancyDB/getLotComments.js' -import { updateLotComment } from '../../helpers/lotOccupancyDB/updateLotComment.js' +import { getLotComments } from '../../database/getLotComments.js' +import { updateLotComment } from '../../database/updateLotComment.js' export async function handler( request: Request, diff --git a/handlers/maps-get/edit.js b/handlers/maps-get/edit.js index be5e1f38..508af48a 100644 --- a/handlers/maps-get/edit.js +++ b/handlers/maps-get/edit.js @@ -1,13 +1,12 @@ +import { getLotStatusSummary } from '../../database/getLotStatusSummary.js'; +import { getLotTypeSummary } from '../../database/getLotTypeSummary.js'; +import { getMap } from '../../database/getMap.js'; import * as configFunctions from '../../helpers/functions.config.js'; import { getMapSVGs } from '../../helpers/functions.map.js'; -import { getLotStatusSummary } from '../../helpers/lotOccupancyDB/getLotStatusSummary.js'; -import { getLotTypeSummary } from '../../helpers/lotOccupancyDB/getLotTypeSummary.js'; -import { getMap } from '../../helpers/lotOccupancyDB/getMap.js'; export async function handler(request, response) { const map = await getMap(request.params.mapId); if (map === undefined) { - response.redirect(configFunctions.getProperty('reverseProxy.urlPrefix') + - '/maps/?error=mapIdNotFound'); + response.redirect(`${configFunctions.getProperty('reverseProxy.urlPrefix')}/maps/?error=mapIdNotFound`); return; } const mapSVGs = await getMapSVGs(); diff --git a/handlers/maps-get/edit.ts b/handlers/maps-get/edit.ts index ea7f6055..66534e29 100644 --- a/handlers/maps-get/edit.ts +++ b/handlers/maps-get/edit.ts @@ -1,10 +1,10 @@ import type { Request, Response } from 'express' +import { getLotStatusSummary } from '../../database/getLotStatusSummary.js' +import { getLotTypeSummary } from '../../database/getLotTypeSummary.js' +import { getMap } from '../../database/getMap.js' import * as configFunctions from '../../helpers/functions.config.js' import { getMapSVGs } from '../../helpers/functions.map.js' -import { getLotStatusSummary } from '../../helpers/lotOccupancyDB/getLotStatusSummary.js' -import { getLotTypeSummary } from '../../helpers/lotOccupancyDB/getLotTypeSummary.js' -import { getMap } from '../../helpers/lotOccupancyDB/getMap.js' export async function handler( request: Request, @@ -14,8 +14,9 @@ export async function handler( if (map === undefined) { response.redirect( - configFunctions.getProperty('reverseProxy.urlPrefix') + - '/maps/?error=mapIdNotFound' + `${configFunctions.getProperty( + 'reverseProxy.urlPrefix' + )}/maps/?error=mapIdNotFound` ) return } diff --git a/handlers/maps-get/next.js b/handlers/maps-get/next.js index 335a90ef..dc871d13 100644 --- a/handlers/maps-get/next.js +++ b/handlers/maps-get/next.js @@ -1,5 +1,5 @@ +import { getNextMapId } from '../../database/getNextMapId.js'; import * as configFunctions from '../../helpers/functions.config.js'; -import { getNextMapId } from '../../helpers/lotOccupancyDB/getNextMapId.js'; export async function handler(request, response) { const mapId = Number.parseInt(request.params.mapId, 10); const nextMapId = await getNextMapId(mapId); diff --git a/handlers/maps-get/next.ts b/handlers/maps-get/next.ts index 37dbae58..4cef210a 100644 --- a/handlers/maps-get/next.ts +++ b/handlers/maps-get/next.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' +import { getNextMapId } from '../../database/getNextMapId.js' import * as configFunctions from '../../helpers/functions.config.js' -import { getNextMapId } from '../../helpers/lotOccupancyDB/getNextMapId.js' export async function handler( request: Request, diff --git a/handlers/maps-get/previous.js b/handlers/maps-get/previous.js index 8a26df20..80154cc9 100644 --- a/handlers/maps-get/previous.js +++ b/handlers/maps-get/previous.js @@ -1,5 +1,5 @@ +import { getPreviousMapId } from '../../database/getPreviousMapId.js'; import * as configFunctions from '../../helpers/functions.config.js'; -import { getPreviousMapId } from '../../helpers/lotOccupancyDB/getPreviousMapId.js'; export async function handler(request, response) { const mapId = Number.parseInt(request.params.mapId, 10); const previousMapId = await getPreviousMapId(mapId); diff --git a/handlers/maps-get/previous.ts b/handlers/maps-get/previous.ts index ae487e8d..de8f73b5 100644 --- a/handlers/maps-get/previous.ts +++ b/handlers/maps-get/previous.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' +import { getPreviousMapId } from '../../database/getPreviousMapId.js' import * as configFunctions from '../../helpers/functions.config.js' -import { getPreviousMapId } from '../../helpers/lotOccupancyDB/getPreviousMapId.js' export async function handler( request: Request, diff --git a/handlers/maps-get/search.js b/handlers/maps-get/search.js index 0fa9962c..029705d7 100644 --- a/handlers/maps-get/search.js +++ b/handlers/maps-get/search.js @@ -1,5 +1,5 @@ +import { getMaps } from '../../database/getMaps.js'; import * as configFunctions from '../../helpers/functions.config.js'; -import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js'; export async function handler(_request, response) { const maps = await getMaps(); response.render('map-search', { diff --git a/handlers/maps-get/search.ts b/handlers/maps-get/search.ts index 8bcd3a5b..3b9dfb0b 100644 --- a/handlers/maps-get/search.ts +++ b/handlers/maps-get/search.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' +import { getMaps } from '../../database/getMaps.js' import * as configFunctions from '../../helpers/functions.config.js' -import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js' export async function handler(_request: Request, response: Response): Promise { const maps = await getMaps() diff --git a/handlers/maps-get/view.js b/handlers/maps-get/view.js index 3dd53a91..c55071c8 100644 --- a/handlers/maps-get/view.js +++ b/handlers/maps-get/view.js @@ -1,7 +1,7 @@ +import { getLotStatusSummary } from '../../database/getLotStatusSummary.js'; +import { getLotTypeSummary } from '../../database/getLotTypeSummary.js'; +import { getMap } from '../../database/getMap.js'; import * as configFunctions from '../../helpers/functions.config.js'; -import { getLotStatusSummary } from '../../helpers/lotOccupancyDB/getLotStatusSummary.js'; -import { getLotTypeSummary } from '../../helpers/lotOccupancyDB/getLotTypeSummary.js'; -import { getMap } from '../../helpers/lotOccupancyDB/getMap.js'; export async function handler(request, response) { const map = await getMap(request.params.mapId); if (map === undefined) { diff --git a/handlers/maps-get/view.ts b/handlers/maps-get/view.ts index 50fd94d4..ac26ff4e 100644 --- a/handlers/maps-get/view.ts +++ b/handlers/maps-get/view.ts @@ -1,9 +1,9 @@ import type { Request, Response } from 'express' +import { getLotStatusSummary } from '../../database/getLotStatusSummary.js' +import { getLotTypeSummary } from '../../database/getLotTypeSummary.js' +import { getMap } from '../../database/getMap.js' import * as configFunctions from '../../helpers/functions.config.js' -import { getLotStatusSummary } from '../../helpers/lotOccupancyDB/getLotStatusSummary.js' -import { getLotTypeSummary } from '../../helpers/lotOccupancyDB/getLotTypeSummary.js' -import { getMap } from '../../helpers/lotOccupancyDB/getMap.js' export async function handler( request: Request, diff --git a/handlers/maps-post/doCreateMap.js b/handlers/maps-post/doCreateMap.js index 329e8f28..6ff0160e 100644 --- a/handlers/maps-post/doCreateMap.js +++ b/handlers/maps-post/doCreateMap.js @@ -1,4 +1,4 @@ -import { addMap } from '../../helpers/lotOccupancyDB/addMap.js'; +import { addMap } from '../../database/addMap.js'; export async function handler(request, response) { const mapId = await addMap(request.body, request.session.user); response.json({ diff --git a/handlers/maps-post/doCreateMap.ts b/handlers/maps-post/doCreateMap.ts index 237d0812..55e33a36 100644 --- a/handlers/maps-post/doCreateMap.ts +++ b/handlers/maps-post/doCreateMap.ts @@ -1,6 +1,6 @@ import type { Request, Response } from 'express' -import { addMap } from '../../helpers/lotOccupancyDB/addMap.js' +import { addMap } from '../../database/addMap.js' export async function handler( request: Request, diff --git a/handlers/maps-post/doDeleteMap.js b/handlers/maps-post/doDeleteMap.js index 69f7310b..29725032 100644 --- a/handlers/maps-post/doDeleteMap.js +++ b/handlers/maps-post/doDeleteMap.js @@ -1,5 +1,5 @@ import { clearNextPreviousLotIdCache } from '../../helpers/functions.lots.js'; -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'; +import { deleteRecord } from '../../database/deleteRecord.js'; export async function handler(request, response) { const success = await deleteRecord('Maps', request.body.mapId, request.session.user); response.json({ diff --git a/handlers/maps-post/doDeleteMap.ts b/handlers/maps-post/doDeleteMap.ts index 6772dd10..89c6d5a9 100644 --- a/handlers/maps-post/doDeleteMap.ts +++ b/handlers/maps-post/doDeleteMap.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' import { clearNextPreviousLotIdCache } from '../../helpers/functions.lots.js' -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js' +import { deleteRecord } from '../../database/deleteRecord.js' export async function handler( request: Request, diff --git a/handlers/maps-post/doUpdateMap.js b/handlers/maps-post/doUpdateMap.js index e29c3b3e..f5084416 100644 --- a/handlers/maps-post/doUpdateMap.js +++ b/handlers/maps-post/doUpdateMap.js @@ -1,4 +1,4 @@ -import { updateMap } from '../../helpers/lotOccupancyDB/updateMap.js'; +import { updateMap } from '../../database/updateMap.js'; export async function handler(request, response) { const success = await updateMap(request.body, request.session.user); response.json({ diff --git a/handlers/maps-post/doUpdateMap.ts b/handlers/maps-post/doUpdateMap.ts index b93ab97b..1c94d79a 100644 --- a/handlers/maps-post/doUpdateMap.ts +++ b/handlers/maps-post/doUpdateMap.ts @@ -1,6 +1,6 @@ import type { Request, Response } from 'express' -import { updateMap } from '../../helpers/lotOccupancyDB/updateMap.js' +import { updateMap } from '../../database/updateMap.js' export async function handler( request: Request, diff --git a/handlers/print-get/pdf.js b/handlers/print-get/pdf.js index 5708a3a8..4b0b6f2e 100644 --- a/handlers/print-get/pdf.js +++ b/handlers/print-get/pdf.js @@ -1,22 +1,21 @@ import path from 'node:path'; +import { convertHTMLToPDF } from '@cityssm/pdf-puppeteer'; +import * as dateTimeFunctions from '@cityssm/utils-datetime'; +import camelcase from 'camelcase'; import * as ejs from 'ejs'; import * as configFunctions from '../../helpers/functions.config.js'; -import * as dateTimeFunctions from '@cityssm/utils-datetime'; import * as lotOccupancyFunctions from '../../helpers/functions.lotOccupancy.js'; import { getReportData, getPdfPrintConfig } from '../../helpers/functions.print.js'; -import { convertHTMLToPDF } from '@cityssm/pdf-puppeteer'; -import camelcase from 'camelcase'; const attachmentOrInline = configFunctions.getProperty('settings.printPdf.contentDisposition'); export async function handler(request, response, next) { const printName = request.params.printName; if (!configFunctions .getProperty('settings.lotOccupancy.prints') - .includes('pdf/' + printName) && + .includes(`pdf/${printName}`) && !configFunctions .getProperty('settings.workOrders.prints') - .includes('pdf/' + printName)) { - response.redirect(configFunctions.getProperty('reverseProxy.urlPrefix') + - '/dashboard/?error=printConfigNotAllowed'); + .includes(`pdf/${printName}`)) { + response.redirect(`${configFunctions.getProperty('reverseProxy.urlPrefix')}/dashboard/?error=printConfigNotAllowed`); return; } const printConfig = getPdfPrintConfig(printName); @@ -26,7 +25,7 @@ export async function handler(request, response, next) { return; } const reportData = await getReportData(printConfig, request.query); - const reportPath = path.join('views', 'print', 'pdf', printName + '.ejs'); + const reportPath = path.join('views', 'print', 'pdf', `${printName}.ejs`); function pdfCallbackFunction(pdf) { response.setHeader('Content-Disposition', `${attachmentOrInline}; filename=${camelcase(printConfig.title)}.pdf`); response.setHeader('Content-Type', 'application/pdf'); diff --git a/handlers/print-get/pdf.ts b/handlers/print-get/pdf.ts index 262c5162..89cf4555 100644 --- a/handlers/print-get/pdf.ts +++ b/handlers/print-get/pdf.ts @@ -1,20 +1,18 @@ +import path from 'node:path' + +import { convertHTMLToPDF } from '@cityssm/pdf-puppeteer' +import * as dateTimeFunctions from '@cityssm/utils-datetime' +import camelcase from 'camelcase' +import * as ejs from 'ejs' import type { Request, Response, NextFunction } from 'express' -import path from 'node:path' -import * as ejs from 'ejs' - import * as configFunctions from '../../helpers/functions.config.js' -import * as dateTimeFunctions from '@cityssm/utils-datetime' import * as lotOccupancyFunctions from '../../helpers/functions.lotOccupancy.js' - import { getReportData, getPdfPrintConfig } from '../../helpers/functions.print.js' -import { convertHTMLToPDF } from '@cityssm/pdf-puppeteer' -import camelcase from 'camelcase' - const attachmentOrInline = configFunctions.getProperty( 'settings.printPdf.contentDisposition' ) @@ -29,14 +27,15 @@ export async function handler( if ( !configFunctions .getProperty('settings.lotOccupancy.prints') - .includes('pdf/' + printName) && + .includes(`pdf/${printName}`) && !configFunctions .getProperty('settings.workOrders.prints') - .includes('pdf/' + printName) + .includes(`pdf/${printName}`) ) { response.redirect( - configFunctions.getProperty('reverseProxy.urlPrefix') + - '/dashboard/?error=printConfigNotAllowed' + `${configFunctions.getProperty( + 'reverseProxy.urlPrefix' + )}/dashboard/?error=printConfigNotAllowed` ) return } @@ -53,7 +52,7 @@ export async function handler( const reportData = await getReportData(printConfig, request.query) - const reportPath = path.join('views', 'print', 'pdf', printName + '.ejs') + const reportPath = path.join('views', 'print', 'pdf', `${printName}.ejs`) function pdfCallbackFunction(pdf: Buffer): void { response.setHeader( diff --git a/handlers/print-get/screen.js b/handlers/print-get/screen.js index 72d54225..ed372389 100644 --- a/handlers/print-get/screen.js +++ b/handlers/print-get/screen.js @@ -4,12 +4,11 @@ export async function handler(request, response) { const printName = request.params.printName; if (!configFunctions .getProperty('settings.lotOccupancy.prints') - .includes('screen/' + printName) && + .includes(`screen/${printName}`) && !configFunctions .getProperty('settings.workOrders.prints') - .includes('screen/' + printName)) { - response.redirect(configFunctions.getProperty('reverseProxy.urlPrefix') + - '/dashboard/?error=printConfigNotAllowed'); + .includes(`screen/${printName}`)) { + response.redirect(`${configFunctions.getProperty('reverseProxy.urlPrefix')}/dashboard/?error=printConfigNotAllowed`); return; } const printConfig = getScreenPrintConfig(printName); @@ -19,6 +18,6 @@ export async function handler(request, response) { return; } const reportData = await getReportData(printConfig, request.query); - response.render('print/screen/' + printName, reportData); + response.render(`print/screen/${printName}`, reportData); } export default handler; diff --git a/handlers/print-get/screen.ts b/handlers/print-get/screen.ts index eca73951..61b5df5b 100644 --- a/handlers/print-get/screen.ts +++ b/handlers/print-get/screen.ts @@ -15,14 +15,15 @@ export async function handler( if ( !configFunctions .getProperty('settings.lotOccupancy.prints') - .includes('screen/' + printName) && + .includes(`screen/${printName}`) && !configFunctions .getProperty('settings.workOrders.prints') - .includes('screen/' + printName) + .includes(`screen/${printName}`) ) { response.redirect( - configFunctions.getProperty('reverseProxy.urlPrefix') + - '/dashboard/?error=printConfigNotAllowed' + `${configFunctions.getProperty( + 'reverseProxy.urlPrefix' + )}/dashboard/?error=printConfigNotAllowed` ) return } @@ -39,7 +40,7 @@ export async function handler( const reportData = await getReportData(printConfig, request.query) - response.render('print/screen/' + printName, reportData) + response.render(`print/screen/${printName}`, reportData) } export default handler diff --git a/handlers/reports-get/reportName.js b/handlers/reports-get/reportName.js index fce3d9f9..9fd3e8e1 100644 --- a/handlers/reports-get/reportName.js +++ b/handlers/reports-get/reportName.js @@ -1,5 +1,5 @@ import papaparse from 'papaparse'; -import { getReportData } from '../../helpers/lotOccupancyDB/getReportData.js'; +import { getReportData } from '../../database/getReportData.js'; export async function handler(request, response) { const reportName = request.params.reportName; const rows = await getReportData(reportName, request.query); diff --git a/handlers/reports-get/reportName.ts b/handlers/reports-get/reportName.ts index c4392909..8bd8e41c 100644 --- a/handlers/reports-get/reportName.ts +++ b/handlers/reports-get/reportName.ts @@ -4,7 +4,7 @@ import papaparse from 'papaparse' import { getReportData, type ReportParameters -} from '../../helpers/lotOccupancyDB/getReportData.js' +} from '../../database/getReportData.js' export async function handler( request: Request, diff --git a/handlers/reports-get/search.js b/handlers/reports-get/search.js index 18a971d2..40f6f021 100644 --- a/handlers/reports-get/search.js +++ b/handlers/reports-get/search.js @@ -1,6 +1,6 @@ import * as dateTimeFunctions from '@cityssm/utils-datetime'; import { getLotStatuses, getLotTypes } from '../../helpers/functions.cache.js'; -import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js'; +import { getMaps } from '../../database/getMaps.js'; export async function handler(_request, response) { const rightNow = new Date(); const maps = await getMaps(); diff --git a/handlers/reports-get/search.ts b/handlers/reports-get/search.ts index 3e82e89c..5560d902 100644 --- a/handlers/reports-get/search.ts +++ b/handlers/reports-get/search.ts @@ -2,7 +2,7 @@ import * as dateTimeFunctions from '@cityssm/utils-datetime' import type { Request, Response } from 'express' import { getLotStatuses, getLotTypes } from '../../helpers/functions.cache.js' -import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js' +import { getMaps } from '../../database/getMaps.js' export async function handler(_request: Request, response: Response): Promise { const rightNow = new Date() diff --git a/handlers/workOrders-get/edit.js b/handlers/workOrders-get/edit.js index e57b723d..ac93e6d5 100644 --- a/handlers/workOrders-get/edit.js +++ b/handlers/workOrders-get/edit.js @@ -1,6 +1,6 @@ import { getLotStatuses, getWorkOrderMilestoneTypes, getWorkOrderTypes } from '../../helpers/functions.cache.js'; import * as configFunctions from '../../helpers/functions.config.js'; -import { getWorkOrder } from '../../helpers/lotOccupancyDB/getWorkOrder.js'; +import { getWorkOrder } from '../../database/getWorkOrder.js'; export async function handler(request, response) { const workOrder = await getWorkOrder(request.params.workOrderId, { includeLotsAndLotOccupancies: true, diff --git a/handlers/workOrders-get/edit.ts b/handlers/workOrders-get/edit.ts index aae6623f..f394c7af 100644 --- a/handlers/workOrders-get/edit.ts +++ b/handlers/workOrders-get/edit.ts @@ -6,7 +6,7 @@ import { getWorkOrderTypes } from '../../helpers/functions.cache.js' import * as configFunctions from '../../helpers/functions.config.js' -import { getWorkOrder } from '../../helpers/lotOccupancyDB/getWorkOrder.js' +import { getWorkOrder } from '../../database/getWorkOrder.js' export async function handler( request: Request, diff --git a/handlers/workOrders-get/view.js b/handlers/workOrders-get/view.js index 702cbf30..409a4128 100644 --- a/handlers/workOrders-get/view.js +++ b/handlers/workOrders-get/view.js @@ -1,5 +1,5 @@ import * as configFunctions from '../../helpers/functions.config.js'; -import { getWorkOrder } from '../../helpers/lotOccupancyDB/getWorkOrder.js'; +import { getWorkOrder } from '../../database/getWorkOrder.js'; export async function handler(request, response) { const workOrder = await getWorkOrder(request.params.workOrderId, { includeLotsAndLotOccupancies: true, diff --git a/handlers/workOrders-get/view.ts b/handlers/workOrders-get/view.ts index 93fc5768..e2e5115d 100644 --- a/handlers/workOrders-get/view.ts +++ b/handlers/workOrders-get/view.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' import * as configFunctions from '../../helpers/functions.config.js' -import { getWorkOrder } from '../../helpers/lotOccupancyDB/getWorkOrder.js' +import { getWorkOrder } from '../../database/getWorkOrder.js' export async function handler( request: Request, diff --git a/handlers/workOrders-post/doAddWorkOrderComment.js b/handlers/workOrders-post/doAddWorkOrderComment.js index 9e5c24b3..aecc97e7 100644 --- a/handlers/workOrders-post/doAddWorkOrderComment.js +++ b/handlers/workOrders-post/doAddWorkOrderComment.js @@ -1,5 +1,5 @@ -import { addWorkOrderComment } from '../../helpers/lotOccupancyDB/addWorkOrderComment.js'; -import { getWorkOrderComments } from '../../helpers/lotOccupancyDB/getWorkOrderComments.js'; +import { addWorkOrderComment } from '../../database/addWorkOrderComment.js'; +import { getWorkOrderComments } from '../../database/getWorkOrderComments.js'; export async function handler(request, response) { await addWorkOrderComment(request.body, request.session.user); const workOrderComments = await getWorkOrderComments(request.body.workOrderId); diff --git a/handlers/workOrders-post/doAddWorkOrderComment.ts b/handlers/workOrders-post/doAddWorkOrderComment.ts index fbfeaaff..16fd804a 100644 --- a/handlers/workOrders-post/doAddWorkOrderComment.ts +++ b/handlers/workOrders-post/doAddWorkOrderComment.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { addWorkOrderComment } from '../../helpers/lotOccupancyDB/addWorkOrderComment.js' -import { getWorkOrderComments } from '../../helpers/lotOccupancyDB/getWorkOrderComments.js' +import { addWorkOrderComment } from '../../database/addWorkOrderComment.js' +import { getWorkOrderComments } from '../../database/getWorkOrderComments.js' export async function handler( request: Request, diff --git a/handlers/workOrders-post/doAddWorkOrderLot.js b/handlers/workOrders-post/doAddWorkOrderLot.js index 5d5797f9..8cf38503 100644 --- a/handlers/workOrders-post/doAddWorkOrderLot.js +++ b/handlers/workOrders-post/doAddWorkOrderLot.js @@ -1,5 +1,5 @@ -import { addWorkOrderLot } from '../../helpers/lotOccupancyDB/addWorkOrderLot.js'; -import { getLots } from '../../helpers/lotOccupancyDB/getLots.js'; +import { addWorkOrderLot } from '../../database/addWorkOrderLot.js'; +import { getLots } from '../../database/getLots.js'; export async function handler(request, response) { const success = await addWorkOrderLot({ workOrderId: request.body.workOrderId, diff --git a/handlers/workOrders-post/doAddWorkOrderLot.ts b/handlers/workOrders-post/doAddWorkOrderLot.ts index 03b6886a..1d3b7743 100644 --- a/handlers/workOrders-post/doAddWorkOrderLot.ts +++ b/handlers/workOrders-post/doAddWorkOrderLot.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { addWorkOrderLot } from '../../helpers/lotOccupancyDB/addWorkOrderLot.js' -import { getLots } from '../../helpers/lotOccupancyDB/getLots.js' +import { addWorkOrderLot } from '../../database/addWorkOrderLot.js' +import { getLots } from '../../database/getLots.js' export async function handler( request: Request, diff --git a/handlers/workOrders-post/doAddWorkOrderLotOccupancy.js b/handlers/workOrders-post/doAddWorkOrderLotOccupancy.js index 78c665d5..6099d70b 100644 --- a/handlers/workOrders-post/doAddWorkOrderLotOccupancy.js +++ b/handlers/workOrders-post/doAddWorkOrderLotOccupancy.js @@ -1,5 +1,5 @@ -import { addWorkOrderLotOccupancy } from '../../helpers/lotOccupancyDB/addWorkOrderLotOccupancy.js'; -import { getLotOccupancies } from '../../helpers/lotOccupancyDB/getLotOccupancies.js'; +import { addWorkOrderLotOccupancy } from '../../database/addWorkOrderLotOccupancy.js'; +import { getLotOccupancies } from '../../database/getLotOccupancies.js'; export async function handler(request, response) { const success = await addWorkOrderLotOccupancy({ workOrderId: request.body.workOrderId, diff --git a/handlers/workOrders-post/doAddWorkOrderLotOccupancy.ts b/handlers/workOrders-post/doAddWorkOrderLotOccupancy.ts index e89b1e0c..cb54d09d 100644 --- a/handlers/workOrders-post/doAddWorkOrderLotOccupancy.ts +++ b/handlers/workOrders-post/doAddWorkOrderLotOccupancy.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { addWorkOrderLotOccupancy } from '../../helpers/lotOccupancyDB/addWorkOrderLotOccupancy.js' -import { getLotOccupancies } from '../../helpers/lotOccupancyDB/getLotOccupancies.js' +import { addWorkOrderLotOccupancy } from '../../database/addWorkOrderLotOccupancy.js' +import { getLotOccupancies } from '../../database/getLotOccupancies.js' export async function handler( request: Request, diff --git a/handlers/workOrders-post/doAddWorkOrderMilestone.js b/handlers/workOrders-post/doAddWorkOrderMilestone.js index abfb77aa..c5e670c3 100644 --- a/handlers/workOrders-post/doAddWorkOrderMilestone.js +++ b/handlers/workOrders-post/doAddWorkOrderMilestone.js @@ -1,5 +1,5 @@ -import { addWorkOrderMilestone } from '../../helpers/lotOccupancyDB/addWorkOrderMilestone.js'; -import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js'; +import { addWorkOrderMilestone } from '../../database/addWorkOrderMilestone.js'; +import { getWorkOrderMilestones } from '../../database/getWorkOrderMilestones.js'; export async function handler(request, response) { const success = await addWorkOrderMilestone(request.body, request.session.user); const workOrderMilestones = await getWorkOrderMilestones({ diff --git a/handlers/workOrders-post/doAddWorkOrderMilestone.ts b/handlers/workOrders-post/doAddWorkOrderMilestone.ts index 6012a109..20ce3c1c 100644 --- a/handlers/workOrders-post/doAddWorkOrderMilestone.ts +++ b/handlers/workOrders-post/doAddWorkOrderMilestone.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { addWorkOrderMilestone } from '../../helpers/lotOccupancyDB/addWorkOrderMilestone.js' -import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js' +import { addWorkOrderMilestone } from '../../database/addWorkOrderMilestone.js' +import { getWorkOrderMilestones } from '../../database/getWorkOrderMilestones.js' export async function handler( request: Request, diff --git a/handlers/workOrders-post/doCloseWorkOrder.js b/handlers/workOrders-post/doCloseWorkOrder.js index bd56e5bd..92c3081f 100644 --- a/handlers/workOrders-post/doCloseWorkOrder.js +++ b/handlers/workOrders-post/doCloseWorkOrder.js @@ -1,4 +1,4 @@ -import { closeWorkOrder } from '../../helpers/lotOccupancyDB/closeWorkOrder.js'; +import { closeWorkOrder } from '../../database/closeWorkOrder.js'; export async function handler(request, response) { const success = await closeWorkOrder(request.body, request.session.user); response.json({ diff --git a/handlers/workOrders-post/doCloseWorkOrder.ts b/handlers/workOrders-post/doCloseWorkOrder.ts index 2211be19..fc832f19 100644 --- a/handlers/workOrders-post/doCloseWorkOrder.ts +++ b/handlers/workOrders-post/doCloseWorkOrder.ts @@ -1,6 +1,6 @@ import type { Request, Response } from 'express' -import { closeWorkOrder } from '../../helpers/lotOccupancyDB/closeWorkOrder.js' +import { closeWorkOrder } from '../../database/closeWorkOrder.js' export async function handler( request: Request, diff --git a/handlers/workOrders-post/doCompleteWorkOrderMilestone.js b/handlers/workOrders-post/doCompleteWorkOrderMilestone.js index 3df97fe1..0566fc93 100644 --- a/handlers/workOrders-post/doCompleteWorkOrderMilestone.js +++ b/handlers/workOrders-post/doCompleteWorkOrderMilestone.js @@ -1,5 +1,5 @@ -import { completeWorkOrderMilestone } from '../../helpers/lotOccupancyDB/completeWorkOrderMilestone.js'; -import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js'; +import { completeWorkOrderMilestone } from '../../database/completeWorkOrderMilestone.js'; +import { getWorkOrderMilestones } from '../../database/getWorkOrderMilestones.js'; export async function handler(request, response) { const success = await completeWorkOrderMilestone({ workOrderMilestoneId: request.body.workOrderMilestoneId diff --git a/handlers/workOrders-post/doCompleteWorkOrderMilestone.ts b/handlers/workOrders-post/doCompleteWorkOrderMilestone.ts index 5c65bc76..49666e7b 100644 --- a/handlers/workOrders-post/doCompleteWorkOrderMilestone.ts +++ b/handlers/workOrders-post/doCompleteWorkOrderMilestone.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { completeWorkOrderMilestone } from '../../helpers/lotOccupancyDB/completeWorkOrderMilestone.js' -import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js' +import { completeWorkOrderMilestone } from '../../database/completeWorkOrderMilestone.js' +import { getWorkOrderMilestones } from '../../database/getWorkOrderMilestones.js' export async function handler( request: Request, diff --git a/handlers/workOrders-post/doCreateWorkOrder.js b/handlers/workOrders-post/doCreateWorkOrder.js index 4cc1defc..1d6b19cf 100644 --- a/handlers/workOrders-post/doCreateWorkOrder.js +++ b/handlers/workOrders-post/doCreateWorkOrder.js @@ -1,4 +1,4 @@ -import { addWorkOrder } from '../../helpers/lotOccupancyDB/addWorkOrder.js'; +import { addWorkOrder } from '../../database/addWorkOrder.js'; export async function handler(request, response) { const workOrderId = await addWorkOrder(request.body, request.session.user); response.json({ diff --git a/handlers/workOrders-post/doCreateWorkOrder.ts b/handlers/workOrders-post/doCreateWorkOrder.ts index 7aafa442..53fa32c7 100644 --- a/handlers/workOrders-post/doCreateWorkOrder.ts +++ b/handlers/workOrders-post/doCreateWorkOrder.ts @@ -1,6 +1,6 @@ import type { Request, Response } from 'express' -import { addWorkOrder } from '../../helpers/lotOccupancyDB/addWorkOrder.js' +import { addWorkOrder } from '../../database/addWorkOrder.js' export async function handler( request: Request, diff --git a/handlers/workOrders-post/doDeleteWorkOrder.js b/handlers/workOrders-post/doDeleteWorkOrder.js index 993d634a..ea2fd912 100644 --- a/handlers/workOrders-post/doDeleteWorkOrder.js +++ b/handlers/workOrders-post/doDeleteWorkOrder.js @@ -1,4 +1,4 @@ -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'; +import { deleteRecord } from '../../database/deleteRecord.js'; export async function handler(request, response) { const success = await deleteRecord('WorkOrders', request.body.workOrderId, request.session.user); response.json({ diff --git a/handlers/workOrders-post/doDeleteWorkOrder.ts b/handlers/workOrders-post/doDeleteWorkOrder.ts index b020b0c2..6fcc1883 100644 --- a/handlers/workOrders-post/doDeleteWorkOrder.ts +++ b/handlers/workOrders-post/doDeleteWorkOrder.ts @@ -1,6 +1,6 @@ import type { Request, Response } from 'express' -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js' +import { deleteRecord } from '../../database/deleteRecord.js' export async function handler( request: Request, diff --git a/handlers/workOrders-post/doDeleteWorkOrderComment.js b/handlers/workOrders-post/doDeleteWorkOrderComment.js index 9b526a8e..0072c6ac 100644 --- a/handlers/workOrders-post/doDeleteWorkOrderComment.js +++ b/handlers/workOrders-post/doDeleteWorkOrderComment.js @@ -1,5 +1,5 @@ -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'; -import { getWorkOrderComments } from '../../helpers/lotOccupancyDB/getWorkOrderComments.js'; +import { deleteRecord } from '../../database/deleteRecord.js'; +import { getWorkOrderComments } from '../../database/getWorkOrderComments.js'; export async function handler(request, response) { const success = await deleteRecord('WorkOrderComments', request.body.workOrderCommentId, request.session.user); const workOrderComments = await getWorkOrderComments(request.body.workOrderId); diff --git a/handlers/workOrders-post/doDeleteWorkOrderComment.ts b/handlers/workOrders-post/doDeleteWorkOrderComment.ts index 025b96c0..320b7de8 100644 --- a/handlers/workOrders-post/doDeleteWorkOrderComment.ts +++ b/handlers/workOrders-post/doDeleteWorkOrderComment.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js' -import { getWorkOrderComments } from '../../helpers/lotOccupancyDB/getWorkOrderComments.js' +import { deleteRecord } from '../../database/deleteRecord.js' +import { getWorkOrderComments } from '../../database/getWorkOrderComments.js' export async function handler( request: Request, diff --git a/handlers/workOrders-post/doDeleteWorkOrderLot.js b/handlers/workOrders-post/doDeleteWorkOrderLot.js index cfdc3235..624382e5 100644 --- a/handlers/workOrders-post/doDeleteWorkOrderLot.js +++ b/handlers/workOrders-post/doDeleteWorkOrderLot.js @@ -1,5 +1,5 @@ -import { deleteWorkOrderLot } from '../../helpers/lotOccupancyDB/deleteWorkOrderLot.js'; -import { getLots } from '../../helpers/lotOccupancyDB/getLots.js'; +import { deleteWorkOrderLot } from '../../database/deleteWorkOrderLot.js'; +import { getLots } from '../../database/getLots.js'; export async function handler(request, response) { const success = await deleteWorkOrderLot(request.body.workOrderId, request.body.lotId, request.session.user); const workOrderLotsResults = await getLots({ diff --git a/handlers/workOrders-post/doDeleteWorkOrderLot.ts b/handlers/workOrders-post/doDeleteWorkOrderLot.ts index 2b86968c..d119dd50 100644 --- a/handlers/workOrders-post/doDeleteWorkOrderLot.ts +++ b/handlers/workOrders-post/doDeleteWorkOrderLot.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { deleteWorkOrderLot } from '../../helpers/lotOccupancyDB/deleteWorkOrderLot.js' -import { getLots } from '../../helpers/lotOccupancyDB/getLots.js' +import { deleteWorkOrderLot } from '../../database/deleteWorkOrderLot.js' +import { getLots } from '../../database/getLots.js' export async function handler( request: Request, diff --git a/handlers/workOrders-post/doDeleteWorkOrderLotOccupancy.js b/handlers/workOrders-post/doDeleteWorkOrderLotOccupancy.js index a994f4ef..138dbd1a 100644 --- a/handlers/workOrders-post/doDeleteWorkOrderLotOccupancy.js +++ b/handlers/workOrders-post/doDeleteWorkOrderLotOccupancy.js @@ -1,5 +1,5 @@ -import { deleteWorkOrderLotOccupancy } from '../../helpers/lotOccupancyDB/deleteWorkOrderLotOccupancy.js'; -import { getLotOccupancies } from '../../helpers/lotOccupancyDB/getLotOccupancies.js'; +import { deleteWorkOrderLotOccupancy } from '../../database/deleteWorkOrderLotOccupancy.js'; +import { getLotOccupancies } from '../../database/getLotOccupancies.js'; export async function handler(request, response) { const success = await deleteWorkOrderLotOccupancy(request.body.workOrderId, request.body.lotOccupancyId, request.session.user); const workOrderLotOccupancies = await getLotOccupancies({ diff --git a/handlers/workOrders-post/doDeleteWorkOrderLotOccupancy.ts b/handlers/workOrders-post/doDeleteWorkOrderLotOccupancy.ts index ef65ffbe..abe045b3 100644 --- a/handlers/workOrders-post/doDeleteWorkOrderLotOccupancy.ts +++ b/handlers/workOrders-post/doDeleteWorkOrderLotOccupancy.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { deleteWorkOrderLotOccupancy } from '../../helpers/lotOccupancyDB/deleteWorkOrderLotOccupancy.js' -import { getLotOccupancies } from '../../helpers/lotOccupancyDB/getLotOccupancies.js' +import { deleteWorkOrderLotOccupancy } from '../../database/deleteWorkOrderLotOccupancy.js' +import { getLotOccupancies } from '../../database/getLotOccupancies.js' export async function handler(request: Request, response: Response): Promise { const success = await deleteWorkOrderLotOccupancy( diff --git a/handlers/workOrders-post/doDeleteWorkOrderMilestone.js b/handlers/workOrders-post/doDeleteWorkOrderMilestone.js index dfd8abd1..7885f02d 100644 --- a/handlers/workOrders-post/doDeleteWorkOrderMilestone.js +++ b/handlers/workOrders-post/doDeleteWorkOrderMilestone.js @@ -1,5 +1,5 @@ -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'; -import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js'; +import { deleteRecord } from '../../database/deleteRecord.js'; +import { getWorkOrderMilestones } from '../../database/getWorkOrderMilestones.js'; export async function handler(request, response) { const success = await deleteRecord('WorkOrderMilestones', request.body.workOrderMilestoneId, request.session.user); const workOrderMilestones = await getWorkOrderMilestones({ diff --git a/handlers/workOrders-post/doDeleteWorkOrderMilestone.ts b/handlers/workOrders-post/doDeleteWorkOrderMilestone.ts index 5a627a6c..21c0c46b 100644 --- a/handlers/workOrders-post/doDeleteWorkOrderMilestone.ts +++ b/handlers/workOrders-post/doDeleteWorkOrderMilestone.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js' -import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js' +import { deleteRecord } from '../../database/deleteRecord.js' +import { getWorkOrderMilestones } from '../../database/getWorkOrderMilestones.js' export async function handler( request: Request, diff --git a/handlers/workOrders-post/doGetWorkOrderMilestones.js b/handlers/workOrders-post/doGetWorkOrderMilestones.js index 53302b74..efda465f 100644 --- a/handlers/workOrders-post/doGetWorkOrderMilestones.js +++ b/handlers/workOrders-post/doGetWorkOrderMilestones.js @@ -1,4 +1,4 @@ -import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js'; +import { getWorkOrderMilestones } from '../../database/getWorkOrderMilestones.js'; export async function handler(request, response) { const workOrderMilestones = await getWorkOrderMilestones(request.body, { includeWorkOrders: true, diff --git a/handlers/workOrders-post/doGetWorkOrderMilestones.ts b/handlers/workOrders-post/doGetWorkOrderMilestones.ts index cd29d112..06f91d0c 100644 --- a/handlers/workOrders-post/doGetWorkOrderMilestones.ts +++ b/handlers/workOrders-post/doGetWorkOrderMilestones.ts @@ -1,6 +1,6 @@ import type { Request, Response } from 'express' -import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js' +import { getWorkOrderMilestones } from '../../database/getWorkOrderMilestones.js' export async function handler( request: Request, diff --git a/handlers/workOrders-post/doReopenWorkOrder.js b/handlers/workOrders-post/doReopenWorkOrder.js index 310f5390..cfd9d6e5 100644 --- a/handlers/workOrders-post/doReopenWorkOrder.js +++ b/handlers/workOrders-post/doReopenWorkOrder.js @@ -1,4 +1,4 @@ -import { reopenWorkOrder } from '../../helpers/lotOccupancyDB/reopenWorkOrder.js'; +import { reopenWorkOrder } from '../../database/reopenWorkOrder.js'; export async function handler(request, response) { const success = await reopenWorkOrder(request.body.workOrderId, request.session.user); response.json({ diff --git a/handlers/workOrders-post/doReopenWorkOrder.ts b/handlers/workOrders-post/doReopenWorkOrder.ts index 2250471a..ff54a7a1 100644 --- a/handlers/workOrders-post/doReopenWorkOrder.ts +++ b/handlers/workOrders-post/doReopenWorkOrder.ts @@ -1,6 +1,6 @@ import type { Request, Response } from 'express' -import { reopenWorkOrder } from '../../helpers/lotOccupancyDB/reopenWorkOrder.js' +import { reopenWorkOrder } from '../../database/reopenWorkOrder.js' export async function handler( request: Request, diff --git a/handlers/workOrders-post/doReopenWorkOrderMilestone.js b/handlers/workOrders-post/doReopenWorkOrderMilestone.js index 3c0e75bf..8bb000a4 100644 --- a/handlers/workOrders-post/doReopenWorkOrderMilestone.js +++ b/handlers/workOrders-post/doReopenWorkOrderMilestone.js @@ -1,5 +1,5 @@ -import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js'; -import { reopenWorkOrderMilestone } from '../../helpers/lotOccupancyDB/reopenWorkOrderMilestone.js'; +import { getWorkOrderMilestones } from '../../database/getWorkOrderMilestones.js'; +import { reopenWorkOrderMilestone } from '../../database/reopenWorkOrderMilestone.js'; export async function handler(request, response) { const success = await reopenWorkOrderMilestone(request.body.workOrderMilestoneId, request.session.user); const workOrderMilestones = await getWorkOrderMilestones({ diff --git a/handlers/workOrders-post/doReopenWorkOrderMilestone.ts b/handlers/workOrders-post/doReopenWorkOrderMilestone.ts index 95cf66dc..0021e5a1 100644 --- a/handlers/workOrders-post/doReopenWorkOrderMilestone.ts +++ b/handlers/workOrders-post/doReopenWorkOrderMilestone.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js' -import { reopenWorkOrderMilestone } from '../../helpers/lotOccupancyDB/reopenWorkOrderMilestone.js' +import { getWorkOrderMilestones } from '../../database/getWorkOrderMilestones.js' +import { reopenWorkOrderMilestone } from '../../database/reopenWorkOrderMilestone.js' export async function handler( request: Request, diff --git a/handlers/workOrders-post/doSearchWorkOrders.js b/handlers/workOrders-post/doSearchWorkOrders.js index 1134dff0..657d9ad2 100644 --- a/handlers/workOrders-post/doSearchWorkOrders.js +++ b/handlers/workOrders-post/doSearchWorkOrders.js @@ -1,4 +1,4 @@ -import { getWorkOrders } from '../../helpers/lotOccupancyDB/getWorkOrders.js'; +import { getWorkOrders } from '../../database/getWorkOrders.js'; export async function handler(request, response) { const result = await getWorkOrders(request.body, { limit: request.body.limit, diff --git a/handlers/workOrders-post/doSearchWorkOrders.ts b/handlers/workOrders-post/doSearchWorkOrders.ts index 813d6e6e..8c13f7cf 100644 --- a/handlers/workOrders-post/doSearchWorkOrders.ts +++ b/handlers/workOrders-post/doSearchWorkOrders.ts @@ -1,6 +1,6 @@ import type { Request, Response } from 'express' -import { getWorkOrders } from '../../helpers/lotOccupancyDB/getWorkOrders.js' +import { getWorkOrders } from '../../database/getWorkOrders.js' export async function handler( request: Request, diff --git a/handlers/workOrders-post/doUpdateLotStatus.js b/handlers/workOrders-post/doUpdateLotStatus.js index edfa6623..f525c055 100644 --- a/handlers/workOrders-post/doUpdateLotStatus.js +++ b/handlers/workOrders-post/doUpdateLotStatus.js @@ -1,5 +1,5 @@ -import { getLots } from '../../helpers/lotOccupancyDB/getLots.js'; -import { updateLotStatus } from '../../helpers/lotOccupancyDB/updateLot.js'; +import { getLots } from '../../database/getLots.js'; +import { updateLotStatus } from '../../database/updateLot.js'; export async function handler(request, response) { const success = await updateLotStatus(request.body.lotId, request.body.lotStatusId, request.session.user); const workOrderLotsResults = await getLots({ diff --git a/handlers/workOrders-post/doUpdateLotStatus.ts b/handlers/workOrders-post/doUpdateLotStatus.ts index 942c870a..dd3379ca 100644 --- a/handlers/workOrders-post/doUpdateLotStatus.ts +++ b/handlers/workOrders-post/doUpdateLotStatus.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { getLots } from '../../helpers/lotOccupancyDB/getLots.js' -import { updateLotStatus } from '../../helpers/lotOccupancyDB/updateLot.js' +import { getLots } from '../../database/getLots.js' +import { updateLotStatus } from '../../database/updateLot.js' export async function handler( request: Request, diff --git a/handlers/workOrders-post/doUpdateWorkOrder.js b/handlers/workOrders-post/doUpdateWorkOrder.js index e2014299..985ed602 100644 --- a/handlers/workOrders-post/doUpdateWorkOrder.js +++ b/handlers/workOrders-post/doUpdateWorkOrder.js @@ -1,4 +1,4 @@ -import { updateWorkOrder } from '../../helpers/lotOccupancyDB/updateWorkOrder.js'; +import { updateWorkOrder } from '../../database/updateWorkOrder.js'; export async function handler(request, response) { const success = await updateWorkOrder(request.body, request.session.user); response.json({ diff --git a/handlers/workOrders-post/doUpdateWorkOrder.ts b/handlers/workOrders-post/doUpdateWorkOrder.ts index e845e2c6..c614c9cd 100644 --- a/handlers/workOrders-post/doUpdateWorkOrder.ts +++ b/handlers/workOrders-post/doUpdateWorkOrder.ts @@ -1,6 +1,6 @@ import type { Request, Response } from 'express' -import { updateWorkOrder } from '../../helpers/lotOccupancyDB/updateWorkOrder.js' +import { updateWorkOrder } from '../../database/updateWorkOrder.js' export async function handler( request: Request, diff --git a/handlers/workOrders-post/doUpdateWorkOrderComment.js b/handlers/workOrders-post/doUpdateWorkOrderComment.js index c1e5084c..6d1a9da9 100644 --- a/handlers/workOrders-post/doUpdateWorkOrderComment.js +++ b/handlers/workOrders-post/doUpdateWorkOrderComment.js @@ -1,5 +1,5 @@ -import { getWorkOrderComments } from '../../helpers/lotOccupancyDB/getWorkOrderComments.js'; -import { updateWorkOrderComment } from '../../helpers/lotOccupancyDB/updateWorkOrderComment.js'; +import { getWorkOrderComments } from '../../database/getWorkOrderComments.js'; +import { updateWorkOrderComment } from '../../database/updateWorkOrderComment.js'; export async function handler(request, response) { const success = await updateWorkOrderComment(request.body, request.session.user); const workOrderComments = await getWorkOrderComments(request.body.workOrderId); diff --git a/handlers/workOrders-post/doUpdateWorkOrderComment.ts b/handlers/workOrders-post/doUpdateWorkOrderComment.ts index 46d0a018..b8e36ae0 100644 --- a/handlers/workOrders-post/doUpdateWorkOrderComment.ts +++ b/handlers/workOrders-post/doUpdateWorkOrderComment.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { getWorkOrderComments } from '../../helpers/lotOccupancyDB/getWorkOrderComments.js' -import { updateWorkOrderComment } from '../../helpers/lotOccupancyDB/updateWorkOrderComment.js' +import { getWorkOrderComments } from '../../database/getWorkOrderComments.js' +import { updateWorkOrderComment } from '../../database/updateWorkOrderComment.js' export async function handler( request: Request, diff --git a/handlers/workOrders-post/doUpdateWorkOrderMilestone.js b/handlers/workOrders-post/doUpdateWorkOrderMilestone.js index a5a24f8c..e396e1e2 100644 --- a/handlers/workOrders-post/doUpdateWorkOrderMilestone.js +++ b/handlers/workOrders-post/doUpdateWorkOrderMilestone.js @@ -1,5 +1,5 @@ -import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js'; -import { updateWorkOrderMilestone } from '../../helpers/lotOccupancyDB/updateWorkOrderMilestone.js'; +import { getWorkOrderMilestones } from '../../database/getWorkOrderMilestones.js'; +import { updateWorkOrderMilestone } from '../../database/updateWorkOrderMilestone.js'; export async function handler(request, response) { const success = await updateWorkOrderMilestone(request.body, request.session.user); const workOrderMilestones = await getWorkOrderMilestones({ diff --git a/handlers/workOrders-post/doUpdateWorkOrderMilestone.ts b/handlers/workOrders-post/doUpdateWorkOrderMilestone.ts index 541dc3e5..87e4966d 100644 --- a/handlers/workOrders-post/doUpdateWorkOrderMilestone.ts +++ b/handlers/workOrders-post/doUpdateWorkOrderMilestone.ts @@ -1,7 +1,7 @@ import type { Request, Response } from 'express' -import { getWorkOrderMilestones } from '../../helpers/lotOccupancyDB/getWorkOrderMilestones.js' -import { updateWorkOrderMilestone } from '../../helpers/lotOccupancyDB/updateWorkOrderMilestone.js' +import { getWorkOrderMilestones } from '../../database/getWorkOrderMilestones.js' +import { updateWorkOrderMilestone } from '../../database/updateWorkOrderMilestone.js' export async function handler( request: Request, diff --git a/helpers/functions.cache.js b/helpers/functions.cache.js index 653769a3..79570261 100644 --- a/helpers/functions.cache.js +++ b/helpers/functions.cache.js @@ -1,13 +1,13 @@ import cluster from 'node:cluster'; import Debug from 'debug'; import * as configFunctions from './functions.config.js'; -import { getLotOccupantTypes as getLotOccupantTypesFromDatabase } from './lotOccupancyDB/getLotOccupantTypes.js'; -import { getLotStatuses as getLotStatusesFromDatabase } from './lotOccupancyDB/getLotStatuses.js'; -import { getLotTypes as getLotTypesFromDatabase } from './lotOccupancyDB/getLotTypes.js'; -import { getOccupancyTypeFields as getOccupancyTypeFieldsFromDatabase } from './lotOccupancyDB/getOccupancyTypeFields.js'; -import { getOccupancyTypes as getOccupancyTypesFromDatabase } from './lotOccupancyDB/getOccupancyTypes.js'; -import { getWorkOrderMilestoneTypes as getWorkOrderMilestoneTypesFromDatabase } from './lotOccupancyDB/getWorkOrderMilestoneTypes.js'; -import { getWorkOrderTypes as getWorkOrderTypesFromDatabase } from './lotOccupancyDB/getWorkOrderTypes.js'; +import { getLotOccupantTypes as getLotOccupantTypesFromDatabase } from '../database/getLotOccupantTypes.js'; +import { getLotStatuses as getLotStatusesFromDatabase } from '../database/getLotStatuses.js'; +import { getLotTypes as getLotTypesFromDatabase } from '../database/getLotTypes.js'; +import { getOccupancyTypeFields as getOccupancyTypeFieldsFromDatabase } from '../database/getOccupancyTypeFields.js'; +import { getOccupancyTypes as getOccupancyTypesFromDatabase } from '../database/getOccupancyTypes.js'; +import { getWorkOrderMilestoneTypes as getWorkOrderMilestoneTypesFromDatabase } from '../database/getWorkOrderMilestoneTypes.js'; +import { getWorkOrderTypes as getWorkOrderTypesFromDatabase } from '../database/getWorkOrderTypes.js'; const debug = Debug(`lot-occupancy-system:functions.cache:${process.pid}`); let lotOccupantTypes; export async function getLotOccupantTypes() { diff --git a/helpers/functions.cache.ts b/helpers/functions.cache.ts index c5e60982..d99b27f0 100644 --- a/helpers/functions.cache.ts +++ b/helpers/functions.cache.ts @@ -10,13 +10,13 @@ import type { ClearCacheWorkerMessage } from '../types/applicationTypes.js' import type * as recordTypes from '../types/recordTypes.js' import * as configFunctions from './functions.config.js' -import { getLotOccupantTypes as getLotOccupantTypesFromDatabase } from './lotOccupancyDB/getLotOccupantTypes.js' -import { getLotStatuses as getLotStatusesFromDatabase } from './lotOccupancyDB/getLotStatuses.js' -import { getLotTypes as getLotTypesFromDatabase } from './lotOccupancyDB/getLotTypes.js' -import { getOccupancyTypeFields as getOccupancyTypeFieldsFromDatabase } from './lotOccupancyDB/getOccupancyTypeFields.js' -import { getOccupancyTypes as getOccupancyTypesFromDatabase } from './lotOccupancyDB/getOccupancyTypes.js' -import { getWorkOrderMilestoneTypes as getWorkOrderMilestoneTypesFromDatabase } from './lotOccupancyDB/getWorkOrderMilestoneTypes.js' -import { getWorkOrderTypes as getWorkOrderTypesFromDatabase } from './lotOccupancyDB/getWorkOrderTypes.js' +import { getLotOccupantTypes as getLotOccupantTypesFromDatabase } from '../database/getLotOccupantTypes.js' +import { getLotStatuses as getLotStatusesFromDatabase } from '../database/getLotStatuses.js' +import { getLotTypes as getLotTypesFromDatabase } from '../database/getLotTypes.js' +import { getOccupancyTypeFields as getOccupancyTypeFieldsFromDatabase } from '../database/getOccupancyTypeFields.js' +import { getOccupancyTypes as getOccupancyTypesFromDatabase } from '../database/getOccupancyTypes.js' +import { getWorkOrderMilestoneTypes as getWorkOrderMilestoneTypesFromDatabase } from '../database/getWorkOrderMilestoneTypes.js' +import { getWorkOrderTypes as getWorkOrderTypesFromDatabase } from '../database/getWorkOrderTypes.js' const debug = Debug(`lot-occupancy-system:functions.cache:${process.pid}`) diff --git a/helpers/functions.lots.js b/helpers/functions.lots.js index 061e7681..fc43e23d 100644 --- a/helpers/functions.lots.js +++ b/helpers/functions.lots.js @@ -1,7 +1,7 @@ import cluster from 'node:cluster'; import NodeCache from 'node-cache'; -import getPreviousLotIdFromDatabase from './lotOccupancyDB/getPreviousLotId.js'; -import getNextLotIdFromDatabase from './lotOccupancyDB/getNextLotId.js'; +import getPreviousLotIdFromDatabase from '../database/getPreviousLotId.js'; +import getNextLotIdFromDatabase from '../database/getNextLotId.js'; import Debug from 'debug'; const debug = Debug(`lot-occupancy-system:functions.lots:${process.pid}`); const cacheOptions = { diff --git a/helpers/functions.lots.ts b/helpers/functions.lots.ts index e43fe688..c13eb3d9 100644 --- a/helpers/functions.lots.ts +++ b/helpers/functions.lots.ts @@ -4,8 +4,8 @@ import cluster from 'node:cluster' import NodeCache from 'node-cache' -import getPreviousLotIdFromDatabase from './lotOccupancyDB/getPreviousLotId.js' -import getNextLotIdFromDatabase from './lotOccupancyDB/getNextLotId.js' +import getPreviousLotIdFromDatabase from '../database/getPreviousLotId.js' +import getNextLotIdFromDatabase from '../database/getNextLotId.js' import type { CacheLotIdsWorkerMessage, diff --git a/helpers/functions.print.js b/helpers/functions.print.js index fd4b5ea5..593be019 100644 --- a/helpers/functions.print.js +++ b/helpers/functions.print.js @@ -1,7 +1,7 @@ import * as configFunctions from './functions.config.js'; -import { getLot } from './lotOccupancyDB/getLot.js'; -import { getLotOccupancy } from './lotOccupancyDB/getLotOccupancy.js'; -import { getWorkOrder } from './lotOccupancyDB/getWorkOrder.js'; +import { getLot } from '../database/getLot.js'; +import { getLotOccupancy } from '../database/getLotOccupancy.js'; +import { getWorkOrder } from '../database/getWorkOrder.js'; const screenPrintConfigs = { lotOccupancy: { title: `${configFunctions.getProperty('aliases.lot')} ${configFunctions.getProperty('aliases.occupancy')} Print`, diff --git a/helpers/functions.print.ts b/helpers/functions.print.ts index ca8556b4..9de0c784 100644 --- a/helpers/functions.print.ts +++ b/helpers/functions.print.ts @@ -1,8 +1,8 @@ import * as configFunctions from './functions.config.js' -import { getLot } from './lotOccupancyDB/getLot.js' -import { getLotOccupancy } from './lotOccupancyDB/getLotOccupancy.js' -import { getWorkOrder } from './lotOccupancyDB/getWorkOrder.js' +import { getLot } from '../database/getLot.js' +import { getLotOccupancy } from '../database/getLotOccupancy.js' +import { getWorkOrder } from '../database/getWorkOrder.js' interface PrintConfig { title: string diff --git a/helpers/initializer.database.cemetery.js b/helpers/initializer.database.cemetery.js index 0e6ef27d..505e4f0f 100644 --- a/helpers/initializer.database.cemetery.js +++ b/helpers/initializer.database.cemetery.js @@ -1,9 +1,9 @@ import Debug from 'debug'; import { lotOccupancyDB as databasePath } from '../data/databasePaths.js'; +import { addLotOccupantType } from '../database/addLotOccupantType.js'; +import { addOccupancyTypeField } from '../database/addOccupancyTypeField.js'; +import { addRecord } from '../database/addRecord.js'; import { initializeDatabase } from './initializer.database.js'; -import { addLotOccupantType } from './lotOccupancyDB/addLotOccupantType.js'; -import { addOccupancyTypeField } from './lotOccupancyDB/addOccupancyTypeField.js'; -import { addRecord } from './lotOccupancyDB/addRecord.js'; const debug = Debug('lot-occupancy-system:initialize'); const user = { userName: 'init.cemetery', diff --git a/helpers/initializer.database.cemetery.ts b/helpers/initializer.database.cemetery.ts index 433edfd2..033a26b5 100644 --- a/helpers/initializer.database.cemetery.ts +++ b/helpers/initializer.database.cemetery.ts @@ -1,11 +1,11 @@ import Debug from 'debug' import { lotOccupancyDB as databasePath } from '../data/databasePaths.js' +import { addLotOccupantType } from '../database/addLotOccupantType.js' +import { addOccupancyTypeField } from '../database/addOccupancyTypeField.js' +import { addRecord } from '../database/addRecord.js' import { initializeDatabase } from './initializer.database.js' -import { addLotOccupantType } from './lotOccupancyDB/addLotOccupantType.js' -import { addOccupancyTypeField } from './lotOccupancyDB/addOccupancyTypeField.js' -import { addRecord } from './lotOccupancyDB/addRecord.js' const debug = Debug('lot-occupancy-system:initialize') diff --git a/temp/legacy.importFromCSV.js b/temp/legacy.importFromCSV.js index 388d9bf3..d76bbd0c 100644 --- a/temp/legacy.importFromCSV.js +++ b/temp/legacy.importFromCSV.js @@ -3,25 +3,25 @@ import { dateIntegerToString, dateToString } from '@cityssm/utils-datetime'; import sqlite from 'better-sqlite3'; import papa from 'papaparse'; import { lotOccupancyDB as databasePath } from '../data/databasePaths.js'; -import { addLot } from '../helpers/lotOccupancyDB/addLot.js'; -import { addLotOccupancy } from '../helpers/lotOccupancyDB/addLotOccupancy.js'; -import { addLotOccupancyComment } from '../helpers/lotOccupancyDB/addLotOccupancyComment.js'; -import { addLotOccupancyFee } from '../helpers/lotOccupancyDB/addLotOccupancyFee.js'; -import { addLotOccupancyOccupant } from '../helpers/lotOccupancyDB/addLotOccupancyOccupant.js'; -import { addLotOccupancyTransaction } from '../helpers/lotOccupancyDB/addLotOccupancyTransaction.js'; -import { addMap } from '../helpers/lotOccupancyDB/addMap.js'; -import { addOrUpdateLotOccupancyField } from '../helpers/lotOccupancyDB/addOrUpdateLotOccupancyField.js'; -import { addWorkOrder } from '../helpers/lotOccupancyDB/addWorkOrder.js'; -import { addWorkOrderLot } from '../helpers/lotOccupancyDB/addWorkOrderLot.js'; -import { addWorkOrderLotOccupancy } from '../helpers/lotOccupancyDB/addWorkOrderLotOccupancy.js'; -import { addWorkOrderMilestone } from '../helpers/lotOccupancyDB/addWorkOrderMilestone.js'; -import { closeWorkOrder } from '../helpers/lotOccupancyDB/closeWorkOrder.js'; -import { getLot, getLotByLotName } from '../helpers/lotOccupancyDB/getLot.js'; -import { getLotOccupancies } from '../helpers/lotOccupancyDB/getLotOccupancies.js'; -import { getMap as getMapFromDatabase } from '../helpers/lotOccupancyDB/getMap.js'; -import { getWorkOrder, getWorkOrderByWorkOrderNumber } from '../helpers/lotOccupancyDB/getWorkOrder.js'; -import { reopenWorkOrder } from '../helpers/lotOccupancyDB/reopenWorkOrder.js'; -import { updateLotStatus } from '../helpers/lotOccupancyDB/updateLot.js'; +import { addLot } from '../database/addLot.js'; +import { addLotOccupancy } from '../database/addLotOccupancy.js'; +import { addLotOccupancyComment } from '../database/addLotOccupancyComment.js'; +import { addLotOccupancyFee } from '../database/addLotOccupancyFee.js'; +import { addLotOccupancyOccupant } from '../database/addLotOccupancyOccupant.js'; +import { addLotOccupancyTransaction } from '../database/addLotOccupancyTransaction.js'; +import { addMap } from '../database/addMap.js'; +import { addOrUpdateLotOccupancyField } from '../database/addOrUpdateLotOccupancyField.js'; +import { addWorkOrder } from '../database/addWorkOrder.js'; +import { addWorkOrderLot } from '../database/addWorkOrderLot.js'; +import { addWorkOrderLotOccupancy } from '../database/addWorkOrderLotOccupancy.js'; +import { addWorkOrderMilestone } from '../database/addWorkOrderMilestone.js'; +import { closeWorkOrder } from '../database/closeWorkOrder.js'; +import { getLot, getLotByLotName } from '../database/getLot.js'; +import { getLotOccupancies } from '../database/getLotOccupancies.js'; +import { getMap as getMapFromDatabase } from '../database/getMap.js'; +import { getWorkOrder, getWorkOrderByWorkOrderNumber } from '../database/getWorkOrder.js'; +import { reopenWorkOrder } from '../database/reopenWorkOrder.js'; +import { updateLotStatus } from '../database/updateLot.js'; import * as importData from './legacy.importFromCsv.data.js'; import * as importIds from './legacy.importFromCsv.ids.js'; const user = { diff --git a/temp/legacy.importFromCSV.ts b/temp/legacy.importFromCSV.ts index 826fd8d9..e818e2a1 100644 --- a/temp/legacy.importFromCSV.ts +++ b/temp/legacy.importFromCSV.ts @@ -5,28 +5,28 @@ import sqlite from 'better-sqlite3' import papa from 'papaparse' import { lotOccupancyDB as databasePath } from '../data/databasePaths.js' -import { addLot } from '../helpers/lotOccupancyDB/addLot.js' -import { addLotOccupancy } from '../helpers/lotOccupancyDB/addLotOccupancy.js' -import { addLotOccupancyComment } from '../helpers/lotOccupancyDB/addLotOccupancyComment.js' -import { addLotOccupancyFee } from '../helpers/lotOccupancyDB/addLotOccupancyFee.js' -import { addLotOccupancyOccupant } from '../helpers/lotOccupancyDB/addLotOccupancyOccupant.js' -import { addLotOccupancyTransaction } from '../helpers/lotOccupancyDB/addLotOccupancyTransaction.js' -import { addMap } from '../helpers/lotOccupancyDB/addMap.js' -import { addOrUpdateLotOccupancyField } from '../helpers/lotOccupancyDB/addOrUpdateLotOccupancyField.js' -import { addWorkOrder } from '../helpers/lotOccupancyDB/addWorkOrder.js' -import { addWorkOrderLot } from '../helpers/lotOccupancyDB/addWorkOrderLot.js' -import { addWorkOrderLotOccupancy } from '../helpers/lotOccupancyDB/addWorkOrderLotOccupancy.js' -import { addWorkOrderMilestone } from '../helpers/lotOccupancyDB/addWorkOrderMilestone.js' -import { closeWorkOrder } from '../helpers/lotOccupancyDB/closeWorkOrder.js' -import { getLot, getLotByLotName } from '../helpers/lotOccupancyDB/getLot.js' -import { getLotOccupancies } from '../helpers/lotOccupancyDB/getLotOccupancies.js' -import { getMap as getMapFromDatabase } from '../helpers/lotOccupancyDB/getMap.js' +import { addLot } from '../database/addLot.js' +import { addLotOccupancy } from '../database/addLotOccupancy.js' +import { addLotOccupancyComment } from '../database/addLotOccupancyComment.js' +import { addLotOccupancyFee } from '../database/addLotOccupancyFee.js' +import { addLotOccupancyOccupant } from '../database/addLotOccupancyOccupant.js' +import { addLotOccupancyTransaction } from '../database/addLotOccupancyTransaction.js' +import { addMap } from '../database/addMap.js' +import { addOrUpdateLotOccupancyField } from '../database/addOrUpdateLotOccupancyField.js' +import { addWorkOrder } from '../database/addWorkOrder.js' +import { addWorkOrderLot } from '../database/addWorkOrderLot.js' +import { addWorkOrderLotOccupancy } from '../database/addWorkOrderLotOccupancy.js' +import { addWorkOrderMilestone } from '../database/addWorkOrderMilestone.js' +import { closeWorkOrder } from '../database/closeWorkOrder.js' +import { getLot, getLotByLotName } from '../database/getLot.js' +import { getLotOccupancies } from '../database/getLotOccupancies.js' +import { getMap as getMapFromDatabase } from '../database/getMap.js' import { getWorkOrder, getWorkOrderByWorkOrderNumber -} from '../helpers/lotOccupancyDB/getWorkOrder.js' -import { reopenWorkOrder } from '../helpers/lotOccupancyDB/reopenWorkOrder.js' -import { updateLotStatus } from '../helpers/lotOccupancyDB/updateLot.js' +} from '../database/getWorkOrder.js' +import { reopenWorkOrder } from '../database/reopenWorkOrder.js' +import { updateLotStatus } from '../database/updateLot.js' // eslint-disable-next-line import/namespace import type * as recordTypes from '../types/recordTypes.js'