linting
parent
984390aaf4
commit
18e05f6c88
|
|
@ -1,6 +1,6 @@
|
|||
import { config as cemeteryConfig } from "./config.cemetery.js";
|
||||
import { config as cemeteryConfig } from './config.cemetery.js';
|
||||
export const config = Object.assign({}, cemeteryConfig);
|
||||
config.settings.lotOccupancy.occupantProvinceDefault = "ON";
|
||||
config.settings.map.mapProvinceDefault = "ON";
|
||||
config.settings.lotOccupancy.occupantProvinceDefault = 'ON';
|
||||
config.settings.map.mapProvinceDefault = 'ON';
|
||||
config.settings.fees.taxPercentageDefault = 13;
|
||||
export default config;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { config as cemeteryConfig } from "./config.cemetery.js";
|
||||
import { config as cemeteryConfig } from './config.cemetery.js'
|
||||
|
||||
export const config = Object.assign({}, cemeteryConfig);
|
||||
export const config = Object.assign({}, cemeteryConfig)
|
||||
|
||||
config.settings.lotOccupancy.occupantProvinceDefault = "ON";
|
||||
config.settings.lotOccupancy.occupantProvinceDefault = 'ON'
|
||||
|
||||
config.settings.map.mapProvinceDefault = "ON";
|
||||
config.settings.map.mapProvinceDefault = 'ON'
|
||||
|
||||
config.settings.fees.taxPercentageDefault = 13;
|
||||
config.settings.fees.taxPercentageDefault = 13
|
||||
|
||||
export default config;
|
||||
export default config
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import sqlite from "better-sqlite3";
|
||||
import type * as recordTypes from "../../types/recordTypes";
|
||||
import sqlite from 'better-sqlite3';
|
||||
import type * as recordTypes from '../../types/recordTypes';
|
||||
export declare function getLotOccupancyComments(lotOccupancyId: number | string, connectedDatabase?: sqlite.Database): recordTypes.LotOccupancyComment[];
|
||||
export default getLotOccupancyComments;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import sqlite from "better-sqlite3";
|
||||
import { lotOccupancyDB as databasePath } from "../../data/databasePaths.js";
|
||||
import { dateIntegerToString, timeIntegerToString } from "@cityssm/expressjs-server-js/dateTimeFns.js";
|
||||
import sqlite from 'better-sqlite3';
|
||||
import { lotOccupancyDB as databasePath } from '../../data/databasePaths.js';
|
||||
import { dateIntegerToString, timeIntegerToString } from '@cityssm/expressjs-server-js/dateTimeFns.js';
|
||||
export function getLotOccupancyComments(lotOccupancyId, connectedDatabase) {
|
||||
const database = connectedDatabase ||
|
||||
const database = connectedDatabase ??
|
||||
sqlite(databasePath, {
|
||||
readonly: true
|
||||
});
|
||||
database.function("userFn_dateIntegerToString", dateIntegerToString);
|
||||
database.function("userFn_timeIntegerToString", timeIntegerToString);
|
||||
database.function('userFn_dateIntegerToString', dateIntegerToString);
|
||||
database.function('userFn_timeIntegerToString', timeIntegerToString);
|
||||
const lotComments = database
|
||||
.prepare(`select lotOccupancyCommentId,
|
||||
lotOccupancyCommentDate, userFn_dateIntegerToString(lotOccupancyCommentDate) as lotOccupancyCommentDateString,
|
||||
|
|
|
|||
|
|
@ -1,26 +1,26 @@
|
|||
import sqlite from "better-sqlite3";
|
||||
import sqlite from 'better-sqlite3'
|
||||
|
||||
import { lotOccupancyDB as databasePath } from "../../data/databasePaths.js";
|
||||
import { lotOccupancyDB as databasePath } from '../../data/databasePaths.js'
|
||||
|
||||
import {
|
||||
dateIntegerToString,
|
||||
timeIntegerToString
|
||||
} from "@cityssm/expressjs-server-js/dateTimeFns.js";
|
||||
} from '@cityssm/expressjs-server-js/dateTimeFns.js'
|
||||
|
||||
import type * as recordTypes from "../../types/recordTypes";
|
||||
import type * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
export function getLotOccupancyComments(
|
||||
lotOccupancyId: number | string,
|
||||
connectedDatabase?: sqlite.Database
|
||||
): recordTypes.LotOccupancyComment[] {
|
||||
const database =
|
||||
connectedDatabase ||
|
||||
connectedDatabase ??
|
||||
sqlite(databasePath, {
|
||||
readonly: true
|
||||
});
|
||||
})
|
||||
|
||||
database.function("userFn_dateIntegerToString", dateIntegerToString);
|
||||
database.function("userFn_timeIntegerToString", timeIntegerToString);
|
||||
database.function('userFn_dateIntegerToString', dateIntegerToString)
|
||||
database.function('userFn_timeIntegerToString', timeIntegerToString)
|
||||
|
||||
const lotComments = database
|
||||
.prepare(
|
||||
|
|
@ -34,13 +34,13 @@ export function getLotOccupancyComments(
|
|||
and lotOccupancyId = ?
|
||||
order by lotOccupancyCommentDate desc, lotOccupancyCommentTime desc, lotOccupancyCommentId desc`
|
||||
)
|
||||
.all(lotOccupancyId);
|
||||
.all(lotOccupancyId)
|
||||
|
||||
if (!connectedDatabase) {
|
||||
database.close();
|
||||
database.close()
|
||||
}
|
||||
|
||||
return lotComments;
|
||||
return lotComments
|
||||
}
|
||||
|
||||
export default getLotOccupancyComments;
|
||||
export default getLotOccupancyComments
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type * as recordTypes from "../../types/recordTypes";
|
||||
import type * as recordTypes from '../../types/recordTypes';
|
||||
interface UpdateFeeCategoryForm {
|
||||
feeCategoryId: number | string;
|
||||
feeCategory: string;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { updateRecord } from "./updateRecord.js";
|
||||
import { updateRecord } from './updateRecord.js';
|
||||
export function updateFeeCategory(feeCategoryForm, requestSession) {
|
||||
const success = updateRecord("FeeCategories", feeCategoryForm.feeCategoryId, feeCategoryForm.feeCategory, requestSession);
|
||||
const success = updateRecord('FeeCategories', feeCategoryForm.feeCategoryId, feeCategoryForm.feeCategory, requestSession);
|
||||
return success;
|
||||
}
|
||||
export default updateFeeCategory;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { updateRecord } from "./updateRecord.js";
|
||||
import { updateRecord } from './updateRecord.js'
|
||||
|
||||
import type * as recordTypes from "../../types/recordTypes";
|
||||
import type * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
interface UpdateFeeCategoryForm {
|
||||
feeCategoryId: number | string;
|
||||
feeCategory: string;
|
||||
feeCategoryId: number | string
|
||||
feeCategory: string
|
||||
}
|
||||
|
||||
export function updateFeeCategory(
|
||||
|
|
@ -12,12 +12,12 @@ export function updateFeeCategory(
|
|||
requestSession: recordTypes.PartialSession
|
||||
): boolean {
|
||||
const success = updateRecord(
|
||||
"FeeCategories",
|
||||
'FeeCategories',
|
||||
feeCategoryForm.feeCategoryId,
|
||||
feeCategoryForm.feeCategory,
|
||||
requestSession
|
||||
);
|
||||
return success;
|
||||
)
|
||||
return success
|
||||
}
|
||||
|
||||
export default updateFeeCategory;
|
||||
export default updateFeeCategory
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import sqlite from "better-sqlite3";
|
||||
declare type RecordTable = "FeeCategories" | "Fees" | "LotOccupantTypes" | "LotStatuses" | "LotTypes" | "LotTypeFields" | "OccupancyTypes" | "OccupancyTypeFields" | "WorkOrderMilestoneTypes" | "WorkOrderTypes";
|
||||
import sqlite from 'better-sqlite3';
|
||||
declare type RecordTable = 'FeeCategories' | 'Fees' | 'LotOccupantTypes' | 'LotStatuses' | 'LotTypes' | 'LotTypeFields' | 'OccupancyTypes' | 'OccupancyTypeFields' | 'WorkOrderMilestoneTypes' | 'WorkOrderTypes';
|
||||
export declare function updateRecordOrderNumber(recordTable: RecordTable, recordId: number | string, orderNumber: number | string, connectedDatabase: sqlite.Database): boolean;
|
||||
export {};
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
const recordIdColumns = new Map();
|
||||
recordIdColumns.set("FeeCategories", "feeCategoryId");
|
||||
recordIdColumns.set("Fees", "feeId");
|
||||
recordIdColumns.set("LotOccupantTypes", "lotOccupantTypeId");
|
||||
recordIdColumns.set("LotStatuses", "lotStatusId");
|
||||
recordIdColumns.set("LotTypes", "lotTypeId");
|
||||
recordIdColumns.set("LotTypeFields", "lotTypeFieldId");
|
||||
recordIdColumns.set("OccupancyTypes", "occupancyTypeId");
|
||||
recordIdColumns.set("OccupancyTypeFields", "occupancyTypeFieldId");
|
||||
recordIdColumns.set("WorkOrderMilestoneTypes", "workOrderMilestoneTypeId");
|
||||
recordIdColumns.set("WorkOrderTypes", "workOrderTypeId");
|
||||
recordIdColumns.set('FeeCategories', 'feeCategoryId');
|
||||
recordIdColumns.set('Fees', 'feeId');
|
||||
recordIdColumns.set('LotOccupantTypes', 'lotOccupantTypeId');
|
||||
recordIdColumns.set('LotStatuses', 'lotStatusId');
|
||||
recordIdColumns.set('LotTypes', 'lotTypeId');
|
||||
recordIdColumns.set('LotTypeFields', 'lotTypeFieldId');
|
||||
recordIdColumns.set('OccupancyTypes', 'occupancyTypeId');
|
||||
recordIdColumns.set('OccupancyTypeFields', 'occupancyTypeFieldId');
|
||||
recordIdColumns.set('WorkOrderMilestoneTypes', 'workOrderMilestoneTypeId');
|
||||
recordIdColumns.set('WorkOrderTypes', 'workOrderTypeId');
|
||||
export function updateRecordOrderNumber(recordTable, recordId, orderNumber, connectedDatabase) {
|
||||
const result = connectedDatabase
|
||||
.prepare(`update ${recordTable}
|
||||
|
|
|
|||
|
|
@ -1,28 +1,28 @@
|
|||
import sqlite from "better-sqlite3";
|
||||
import sqlite from 'better-sqlite3'
|
||||
|
||||
type RecordTable =
|
||||
| "FeeCategories"
|
||||
| "Fees"
|
||||
| "LotOccupantTypes"
|
||||
| "LotStatuses"
|
||||
| "LotTypes"
|
||||
| "LotTypeFields"
|
||||
| "OccupancyTypes"
|
||||
| "OccupancyTypeFields"
|
||||
| "WorkOrderMilestoneTypes"
|
||||
| "WorkOrderTypes";
|
||||
| 'FeeCategories'
|
||||
| 'Fees'
|
||||
| 'LotOccupantTypes'
|
||||
| 'LotStatuses'
|
||||
| 'LotTypes'
|
||||
| 'LotTypeFields'
|
||||
| 'OccupancyTypes'
|
||||
| 'OccupancyTypeFields'
|
||||
| 'WorkOrderMilestoneTypes'
|
||||
| 'WorkOrderTypes'
|
||||
|
||||
const recordIdColumns: Map<RecordTable, string> = new Map();
|
||||
recordIdColumns.set("FeeCategories", "feeCategoryId");
|
||||
recordIdColumns.set("Fees", "feeId");
|
||||
recordIdColumns.set("LotOccupantTypes", "lotOccupantTypeId");
|
||||
recordIdColumns.set("LotStatuses", "lotStatusId");
|
||||
recordIdColumns.set("LotTypes", "lotTypeId");
|
||||
recordIdColumns.set("LotTypeFields", "lotTypeFieldId");
|
||||
recordIdColumns.set("OccupancyTypes", "occupancyTypeId");
|
||||
recordIdColumns.set("OccupancyTypeFields", "occupancyTypeFieldId");
|
||||
recordIdColumns.set("WorkOrderMilestoneTypes", "workOrderMilestoneTypeId");
|
||||
recordIdColumns.set("WorkOrderTypes", "workOrderTypeId");
|
||||
const recordIdColumns: Map<RecordTable, string> = new Map()
|
||||
recordIdColumns.set('FeeCategories', 'feeCategoryId')
|
||||
recordIdColumns.set('Fees', 'feeId')
|
||||
recordIdColumns.set('LotOccupantTypes', 'lotOccupantTypeId')
|
||||
recordIdColumns.set('LotStatuses', 'lotStatusId')
|
||||
recordIdColumns.set('LotTypes', 'lotTypeId')
|
||||
recordIdColumns.set('LotTypeFields', 'lotTypeFieldId')
|
||||
recordIdColumns.set('OccupancyTypes', 'occupancyTypeId')
|
||||
recordIdColumns.set('OccupancyTypeFields', 'occupancyTypeFieldId')
|
||||
recordIdColumns.set('WorkOrderMilestoneTypes', 'workOrderMilestoneTypeId')
|
||||
recordIdColumns.set('WorkOrderTypes', 'workOrderTypeId')
|
||||
|
||||
export function updateRecordOrderNumber(
|
||||
recordTable: RecordTable,
|
||||
|
|
@ -35,9 +35,9 @@ export function updateRecordOrderNumber(
|
|||
`update ${recordTable}
|
||||
set orderNumber = ?
|
||||
where recordDelete_timeMillis is null
|
||||
and ${recordIdColumns.get(recordTable)} = ?`
|
||||
and ${recordIdColumns.get(recordTable)!} = ?`
|
||||
)
|
||||
.run(orderNumber, recordId);
|
||||
.run(orderNumber, recordId)
|
||||
|
||||
return result.changes > 0;
|
||||
return result.changes > 0
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue