type linting
parent
3eeea38b30
commit
5a9074eb20
|
|
@ -38,7 +38,7 @@ export default async function addLotOccupancy(
|
|||
const rightNowMillis = Date.now()
|
||||
|
||||
const occupancyStartDate = dateTimeFunctions.dateStringToInteger(
|
||||
lotOccupancyForm.occupancyStartDateString
|
||||
lotOccupancyForm.occupancyStartDateString as dateTimeFunctions.DateString
|
||||
)
|
||||
|
||||
if (occupancyStartDate <= 0) {
|
||||
|
|
@ -61,7 +61,7 @@ export default async function addLotOccupancy(
|
|||
lotOccupancyForm.occupancyEndDateString === ''
|
||||
? undefined
|
||||
: dateTimeFunctions.dateStringToInteger(
|
||||
lotOccupancyForm.occupancyEndDateString
|
||||
lotOccupancyForm.occupancyEndDateString as dateTimeFunctions.DateString
|
||||
),
|
||||
user.userName,
|
||||
rightNowMillis,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
import {
|
||||
type DateString,
|
||||
type TimeString,
|
||||
dateStringToInteger,
|
||||
dateToInteger,
|
||||
dateToTimeInteger,
|
||||
|
|
@ -21,14 +23,14 @@ export default async function addLotOccupancyComment(
|
|||
const rightNow = new Date()
|
||||
|
||||
let lotOccupancyCommentDate: number
|
||||
let lotOccupancyCommentTime: number
|
||||
let lotOccupancyCommentTime: number | undefined
|
||||
|
||||
if (commentForm.lotOccupancyCommentDateString) {
|
||||
lotOccupancyCommentDate = dateStringToInteger(
|
||||
commentForm.lotOccupancyCommentDateString
|
||||
commentForm.lotOccupancyCommentDateString as DateString
|
||||
)
|
||||
lotOccupancyCommentTime = timeStringToInteger(
|
||||
commentForm.lotOccupancyCommentTimeString ?? ''
|
||||
(commentForm.lotOccupancyCommentTimeString as TimeString) ?? ''
|
||||
)
|
||||
} else {
|
||||
lotOccupancyCommentDate = dateToInteger(rightNow)
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export async function getFees(feeCategoryId, additionalFilters, connectedDatabas
|
|||
sqlParameters.push(additionalFilters.lotTypeId);
|
||||
}
|
||||
const fees = database
|
||||
.prepare(`select f.feeId,
|
||||
.prepare(`select f.feeId, f.feeCategoryId,
|
||||
f.feeName, f.feeDescription, f.feeAccount,
|
||||
f.occupancyTypeId, o.occupancyType,
|
||||
f.lotTypeId, l.lotType,
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ export async function getFees(
|
|||
|
||||
const fees = database
|
||||
.prepare(
|
||||
`select f.feeId,
|
||||
`select f.feeId, f.feeCategoryId,
|
||||
f.feeName, f.feeDescription, f.feeAccount,
|
||||
f.occupancyTypeId, o.occupancyType,
|
||||
f.lotTypeId, l.lotType,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { acquireConnection } from './pool.js';
|
|||
import { updateRecordOrderNumber } from './updateRecordOrderNumber.js';
|
||||
export async function moveFeeDown(feeId) {
|
||||
const database = await acquireConnection();
|
||||
const currentFee = await getFee(feeId, database);
|
||||
const currentFee = (await getFee(feeId, database));
|
||||
database
|
||||
.prepare(`update Fees
|
||||
set orderNumber = orderNumber - 1
|
||||
|
|
@ -17,7 +17,7 @@ export async function moveFeeDown(feeId) {
|
|||
}
|
||||
export async function moveFeeDownToBottom(feeId) {
|
||||
const database = await acquireConnection();
|
||||
const currentFee = await getFee(feeId, database);
|
||||
const currentFee = (await getFee(feeId, database));
|
||||
const maxOrderNumber = database
|
||||
.prepare(`select max(orderNumber) as maxOrderNumber
|
||||
from Fees
|
||||
|
|
@ -38,7 +38,7 @@ export async function moveFeeDownToBottom(feeId) {
|
|||
}
|
||||
export async function moveFeeUp(feeId) {
|
||||
const database = await acquireConnection();
|
||||
const currentFee = await getFee(feeId, database);
|
||||
const currentFee = (await getFee(feeId, database));
|
||||
if (currentFee.orderNumber <= 0) {
|
||||
database.release();
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { updateRecordOrderNumber } from './updateRecordOrderNumber.js'
|
|||
export async function moveFeeDown(feeId: number | string): Promise<boolean> {
|
||||
const database = await acquireConnection()
|
||||
|
||||
const currentFee = await getFee(feeId, database)
|
||||
const currentFee = (await getFee(feeId, database)) as Fee
|
||||
|
||||
database
|
||||
.prepare(
|
||||
|
|
@ -22,7 +22,7 @@ export async function moveFeeDown(feeId: number | string): Promise<boolean> {
|
|||
const success = updateRecordOrderNumber(
|
||||
'Fees',
|
||||
feeId,
|
||||
currentFee.orderNumber! + 1,
|
||||
currentFee.orderNumber + 1,
|
||||
database
|
||||
)
|
||||
|
||||
|
|
@ -36,7 +36,7 @@ export async function moveFeeDownToBottom(
|
|||
): Promise<boolean> {
|
||||
const database = await acquireConnection()
|
||||
|
||||
const currentFee = await getFee(feeId, database)
|
||||
const currentFee = (await getFee(feeId, database)) as Fee
|
||||
|
||||
const maxOrderNumber = (
|
||||
database
|
||||
|
|
@ -70,9 +70,9 @@ export async function moveFeeDownToBottom(
|
|||
export async function moveFeeUp(feeId: number): Promise<boolean> {
|
||||
const database = await acquireConnection()
|
||||
|
||||
const currentFee = await getFee(feeId, database)
|
||||
const currentFee = (await getFee(feeId, database)) as Fee
|
||||
|
||||
if (currentFee.orderNumber! <= 0) {
|
||||
if (currentFee.orderNumber <= 0) {
|
||||
database.release()
|
||||
return true
|
||||
}
|
||||
|
|
@ -90,7 +90,7 @@ export async function moveFeeUp(feeId: number): Promise<boolean> {
|
|||
const success = updateRecordOrderNumber(
|
||||
'Fees',
|
||||
feeId,
|
||||
currentFee.orderNumber! - 1,
|
||||
currentFee.orderNumber - 1,
|
||||
database
|
||||
)
|
||||
|
||||
|
|
@ -104,7 +104,7 @@ export async function moveFeeUpToTop(feeId: number | string): Promise<boolean> {
|
|||
|
||||
const currentFee = (await getFee(feeId, database)) as Fee
|
||||
|
||||
if (currentFee.orderNumber! > 0) {
|
||||
if (currentFee.orderNumber > 0) {
|
||||
updateRecordOrderNumber('Fees', feeId, -1, database)
|
||||
|
||||
database
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ export interface FeeCategory extends Record {
|
|||
}
|
||||
export interface Fee extends Record {
|
||||
feeId: number;
|
||||
feeCategoryId?: number;
|
||||
feeCategoryId: number;
|
||||
feeCategory?: string;
|
||||
feeName?: string;
|
||||
feeDescription?: string;
|
||||
|
|
@ -130,7 +130,7 @@ export interface Fee extends Record {
|
|||
taxAmount?: number;
|
||||
taxPercentage?: number;
|
||||
isRequired?: boolean;
|
||||
orderNumber?: number;
|
||||
orderNumber: number;
|
||||
lotOccupancyFeeCount?: number;
|
||||
}
|
||||
export interface LotOccupancyFee extends Fee, Record {
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export interface FeeCategory extends Record {
|
|||
export interface Fee extends Record {
|
||||
feeId: number
|
||||
|
||||
feeCategoryId?: number
|
||||
feeCategoryId: number
|
||||
feeCategory?: string
|
||||
|
||||
feeName?: string
|
||||
|
|
@ -173,7 +173,7 @@ export interface Fee extends Record {
|
|||
|
||||
isRequired?: boolean
|
||||
|
||||
orderNumber?: number
|
||||
orderNumber: number
|
||||
|
||||
lotOccupancyFeeCount?: number
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue