refactoring
parent
b63d6225e1
commit
bd0b68cbb1
|
|
@ -1,5 +1,5 @@
|
||||||
import type { LotOccupancyOccupant } from '../types/recordTypes.js';
|
import type { LotOccupancyOccupant } from '../types/recordTypes.js';
|
||||||
interface GetPastLotOccupancyOccupantsFilters {
|
export interface GetPastLotOccupancyOccupantsFilters {
|
||||||
searchFilter: string;
|
searchFilter: string;
|
||||||
}
|
}
|
||||||
interface GetPastLotOccupancyOccupantsOptions {
|
interface GetPastLotOccupancyOccupantsOptions {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import type { LotOccupancyOccupant } from '../types/recordTypes.js'
|
||||||
|
|
||||||
import { acquireConnection } from './pool.js'
|
import { acquireConnection } from './pool.js'
|
||||||
|
|
||||||
interface GetPastLotOccupancyOccupantsFilters {
|
export interface GetPastLotOccupancyOccupantsFilters {
|
||||||
searchFilter: string
|
searchFilter: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import type { PoolConnection } from 'better-sqlite-pool';
|
import type { PoolConnection } from 'better-sqlite-pool';
|
||||||
import type { WorkOrder } from '../types/recordTypes.js';
|
import type { WorkOrder } from '../types/recordTypes.js';
|
||||||
interface GetWorkOrdersFilters {
|
export interface GetWorkOrdersFilters {
|
||||||
workOrderTypeId?: number | string;
|
workOrderTypeId?: number | string;
|
||||||
workOrderOpenStatus?: '' | 'open' | 'closed';
|
workOrderOpenStatus?: '' | 'open' | 'closed';
|
||||||
workOrderOpenDateString?: string;
|
workOrderOpenDateString?: string;
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import getWorkOrderComments from './getWorkOrderComments.js'
|
||||||
import getWorkOrderMilestones from './getWorkOrderMilestones.js'
|
import getWorkOrderMilestones from './getWorkOrderMilestones.js'
|
||||||
import { acquireConnection } from './pool.js'
|
import { acquireConnection } from './pool.js'
|
||||||
|
|
||||||
interface GetWorkOrdersFilters {
|
export interface GetWorkOrdersFilters {
|
||||||
workOrderTypeId?: number | string
|
workOrderTypeId?: number | string
|
||||||
workOrderOpenStatus?: '' | 'open' | 'closed'
|
workOrderOpenStatus?: '' | 'open' | 'closed'
|
||||||
workOrderOpenDateString?: string
|
workOrderOpenDateString?: string
|
||||||
|
|
@ -56,7 +56,9 @@ function buildWhereClause(filters: GetWorkOrdersFilters): {
|
||||||
|
|
||||||
if ((filters.workOrderOpenDateString ?? '') !== '') {
|
if ((filters.workOrderOpenDateString ?? '') !== '') {
|
||||||
sqlWhereClause += ' and w.workOrderOpenDate = ?'
|
sqlWhereClause += ' and w.workOrderOpenDate = ?'
|
||||||
sqlParameters.push(dateStringToInteger(filters.workOrderOpenDateString as DateString))
|
sqlParameters.push(
|
||||||
|
dateStringToInteger(filters.workOrderOpenDateString as DateString)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const occupantNameFilters = getOccupantNameWhereClause(
|
const occupantNameFilters = getOccupantNameWhereClause(
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1 @@
|
||||||
export declare function reopenWorkOrder(workOrderId: number | string, user: User): Promise<boolean>;
|
export default function reopenWorkOrder(workOrderId: number | string, user: User): Promise<boolean>;
|
||||||
export default reopenWorkOrder;
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { acquireConnection } from './pool.js';
|
import { acquireConnection } from './pool.js';
|
||||||
export async function reopenWorkOrder(workOrderId, user) {
|
export default async function reopenWorkOrder(workOrderId, user) {
|
||||||
const database = await acquireConnection();
|
const database = await acquireConnection();
|
||||||
const result = database
|
const result = database
|
||||||
.prepare(`update WorkOrders
|
.prepare(`update WorkOrders
|
||||||
|
|
@ -12,4 +12,3 @@ export async function reopenWorkOrder(workOrderId, user) {
|
||||||
database.release();
|
database.release();
|
||||||
return result.changes > 0;
|
return result.changes > 0;
|
||||||
}
|
}
|
||||||
export default reopenWorkOrder;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { acquireConnection } from './pool.js'
|
import { acquireConnection } from './pool.js'
|
||||||
|
|
||||||
export async function reopenWorkOrder(
|
export default async function reopenWorkOrder(
|
||||||
workOrderId: number | string,
|
workOrderId: number | string,
|
||||||
user: User
|
user: User
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
|
|
@ -21,5 +21,3 @@ export async function reopenWorkOrder(
|
||||||
|
|
||||||
return result.changes > 0
|
return result.changes > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
export default reopenWorkOrder
|
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1 @@
|
||||||
export declare function reopenWorkOrderMilestone(workOrderMilestoneId: number | string, user: User): Promise<boolean>;
|
export default function reopenWorkOrderMilestone(workOrderMilestoneId: number | string, user: User): Promise<boolean>;
|
||||||
export default reopenWorkOrderMilestone;
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { acquireConnection } from './pool.js';
|
import { acquireConnection } from './pool.js';
|
||||||
export async function reopenWorkOrderMilestone(workOrderMilestoneId, user) {
|
export default async function reopenWorkOrderMilestone(workOrderMilestoneId, user) {
|
||||||
const database = await acquireConnection();
|
const database = await acquireConnection();
|
||||||
const result = database
|
const result = database
|
||||||
.prepare(`update WorkOrderMilestones
|
.prepare(`update WorkOrderMilestones
|
||||||
|
|
@ -13,4 +13,3 @@ export async function reopenWorkOrderMilestone(workOrderMilestoneId, user) {
|
||||||
database.release();
|
database.release();
|
||||||
return result.changes > 0;
|
return result.changes > 0;
|
||||||
}
|
}
|
||||||
export default reopenWorkOrderMilestone;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { acquireConnection } from './pool.js'
|
import { acquireConnection } from './pool.js'
|
||||||
|
|
||||||
export async function reopenWorkOrderMilestone(
|
export default async function reopenWorkOrderMilestone(
|
||||||
workOrderMilestoneId: number | string,
|
workOrderMilestoneId: number | string,
|
||||||
user: User
|
user: User
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
|
|
@ -22,5 +22,3 @@ export async function reopenWorkOrderMilestone(
|
||||||
|
|
||||||
return result.changes > 0
|
return result.changes > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
export default reopenWorkOrderMilestone
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
interface UpdateFeeForm {
|
export interface UpdateFeeForm {
|
||||||
feeId: string;
|
feeId: string;
|
||||||
feeCategoryId: string;
|
feeCategoryId: string;
|
||||||
feeName: string;
|
feeName: string;
|
||||||
|
|
@ -14,5 +14,4 @@ interface UpdateFeeForm {
|
||||||
quantityUnit?: string;
|
quantityUnit?: string;
|
||||||
isRequired: '' | '1';
|
isRequired: '' | '1';
|
||||||
}
|
}
|
||||||
export declare function updateFee(feeForm: UpdateFeeForm, user: User): Promise<boolean>;
|
export default function updateFee(feeForm: UpdateFeeForm, user: User): Promise<boolean>;
|
||||||
export default updateFee;
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { acquireConnection } from './pool.js';
|
import { acquireConnection } from './pool.js';
|
||||||
export async function updateFee(feeForm, user) {
|
export default async function updateFee(feeForm, user) {
|
||||||
const database = await acquireConnection();
|
const database = await acquireConnection();
|
||||||
const result = database
|
const result = database
|
||||||
.prepare(`update Fees
|
.prepare(`update Fees
|
||||||
|
|
@ -26,4 +26,3 @@ export async function updateFee(feeForm, user) {
|
||||||
database.release();
|
database.release();
|
||||||
return result.changes > 0;
|
return result.changes > 0;
|
||||||
}
|
}
|
||||||
export default updateFee;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { acquireConnection } from './pool.js'
|
import { acquireConnection } from './pool.js'
|
||||||
|
|
||||||
interface UpdateFeeForm {
|
export interface UpdateFeeForm {
|
||||||
feeId: string
|
feeId: string
|
||||||
feeCategoryId: string
|
feeCategoryId: string
|
||||||
feeName: string
|
feeName: string
|
||||||
|
|
@ -17,7 +17,7 @@ interface UpdateFeeForm {
|
||||||
isRequired: '' | '1'
|
isRequired: '' | '1'
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateFee(
|
export default async function updateFee(
|
||||||
feeForm: UpdateFeeForm,
|
feeForm: UpdateFeeForm,
|
||||||
user: User
|
user: User
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
|
|
@ -69,5 +69,3 @@ export async function updateFee(
|
||||||
|
|
||||||
return result.changes > 0
|
return result.changes > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
export default updateFee
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
interface UpdateFeeCategoryForm {
|
export interface UpdateFeeCategoryForm {
|
||||||
feeCategoryId: number | string;
|
feeCategoryId: number | string;
|
||||||
feeCategory: string;
|
feeCategory: string;
|
||||||
}
|
}
|
||||||
export declare function updateFeeCategory(feeCategoryForm: UpdateFeeCategoryForm, user: User): Promise<boolean>;
|
export default function updateFeeCategory(feeCategoryForm: UpdateFeeCategoryForm, user: User): Promise<boolean>;
|
||||||
export default updateFeeCategory;
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import { updateRecord } from './updateRecord.js';
|
import { updateRecord } from './updateRecord.js';
|
||||||
export async function updateFeeCategory(feeCategoryForm, user) {
|
export default async function updateFeeCategory(feeCategoryForm, user) {
|
||||||
return await updateRecord('FeeCategories', feeCategoryForm.feeCategoryId, feeCategoryForm.feeCategory, user);
|
return await updateRecord('FeeCategories', feeCategoryForm.feeCategoryId, feeCategoryForm.feeCategory, user);
|
||||||
}
|
}
|
||||||
export default updateFeeCategory;
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
import { updateRecord } from './updateRecord.js'
|
import { updateRecord } from './updateRecord.js'
|
||||||
|
|
||||||
interface UpdateFeeCategoryForm {
|
export interface UpdateFeeCategoryForm {
|
||||||
feeCategoryId: number | string
|
feeCategoryId: number | string
|
||||||
feeCategory: string
|
feeCategory: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateFeeCategory(
|
export default async function updateFeeCategory(
|
||||||
feeCategoryForm: UpdateFeeCategoryForm,
|
feeCategoryForm: UpdateFeeCategoryForm,
|
||||||
user: User
|
user: User
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
|
|
@ -16,5 +16,3 @@ export async function updateFeeCategory(
|
||||||
user
|
user
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default updateFeeCategory
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
interface UpdateLotForm {
|
export interface UpdateLotForm {
|
||||||
lotId: string | number;
|
lotId: string | number;
|
||||||
lotName: string;
|
lotName: string;
|
||||||
lotTypeId: string | number;
|
lotTypeId: string | number;
|
||||||
|
|
@ -10,6 +10,5 @@ interface UpdateLotForm {
|
||||||
lotTypeFieldIds?: string;
|
lotTypeFieldIds?: string;
|
||||||
[lotFieldValue_lotTypeFieldId: string]: unknown;
|
[lotFieldValue_lotTypeFieldId: string]: unknown;
|
||||||
}
|
}
|
||||||
export declare function updateLot(lotForm: UpdateLotForm, user: User): Promise<boolean>;
|
export default function updateLot(lotForm: UpdateLotForm, user: User): Promise<boolean>;
|
||||||
export declare function updateLotStatus(lotId: number | string, lotStatusId: number | string, user: User): Promise<boolean>;
|
export declare function updateLotStatus(lotId: number | string, lotStatusId: number | string, user: User): Promise<boolean>;
|
||||||
export default updateLot;
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import addOrUpdateLotField from './addOrUpdateLotField.js';
|
import addOrUpdateLotField from './addOrUpdateLotField.js';
|
||||||
import deleteLotField from './deleteLotField.js';
|
import deleteLotField from './deleteLotField.js';
|
||||||
import { acquireConnection } from './pool.js';
|
import { acquireConnection } from './pool.js';
|
||||||
export async function updateLot(lotForm, user) {
|
export default async function updateLot(lotForm, user) {
|
||||||
const database = await acquireConnection();
|
const database = await acquireConnection();
|
||||||
const result = database
|
const result = database
|
||||||
.prepare(`update Lots
|
.prepare(`update Lots
|
||||||
|
|
@ -47,4 +47,3 @@ export async function updateLotStatus(lotId, lotStatusId, user) {
|
||||||
database.release();
|
database.release();
|
||||||
return result.changes > 0;
|
return result.changes > 0;
|
||||||
}
|
}
|
||||||
export default updateLot;
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import addOrUpdateLotField from './addOrUpdateLotField.js'
|
||||||
import deleteLotField from './deleteLotField.js'
|
import deleteLotField from './deleteLotField.js'
|
||||||
import { acquireConnection } from './pool.js'
|
import { acquireConnection } from './pool.js'
|
||||||
|
|
||||||
interface UpdateLotForm {
|
export interface UpdateLotForm {
|
||||||
lotId: string | number
|
lotId: string | number
|
||||||
lotName: string
|
lotName: string
|
||||||
lotTypeId: string | number
|
lotTypeId: string | number
|
||||||
|
|
@ -18,7 +18,7 @@ interface UpdateLotForm {
|
||||||
[lotFieldValue_lotTypeFieldId: string]: unknown
|
[lotFieldValue_lotTypeFieldId: string]: unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateLot(
|
export default async function updateLot(
|
||||||
lotForm: UpdateLotForm,
|
lotForm: UpdateLotForm,
|
||||||
user: User
|
user: User
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
|
|
@ -108,5 +108,3 @@ export async function updateLotStatus(
|
||||||
|
|
||||||
return result.changes > 0
|
return result.changes > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
export default updateLot
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
import { type DateString, type TimeString } from '@cityssm/utils-datetime';
|
import { type DateString, type TimeString } from '@cityssm/utils-datetime';
|
||||||
interface UpdateLotCommentForm {
|
export interface UpdateLotCommentForm {
|
||||||
lotCommentId: string | number;
|
lotCommentId: string | number;
|
||||||
lotCommentDateString: DateString;
|
lotCommentDateString: DateString;
|
||||||
lotCommentTimeString: TimeString;
|
lotCommentTimeString: TimeString;
|
||||||
lotComment: string;
|
lotComment: string;
|
||||||
}
|
}
|
||||||
export declare function updateLotComment(commentForm: UpdateLotCommentForm, user: User): Promise<boolean>;
|
export default function updateLotComment(commentForm: UpdateLotCommentForm, user: User): Promise<boolean>;
|
||||||
export default updateLotComment;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { dateStringToInteger, timeStringToInteger } from '@cityssm/utils-datetime';
|
import { dateStringToInteger, timeStringToInteger } from '@cityssm/utils-datetime';
|
||||||
import { acquireConnection } from './pool.js';
|
import { acquireConnection } from './pool.js';
|
||||||
export async function updateLotComment(commentForm, user) {
|
export default async function updateLotComment(commentForm, user) {
|
||||||
const database = await acquireConnection();
|
const database = await acquireConnection();
|
||||||
const result = database
|
const result = database
|
||||||
.prepare(`update LotComments
|
.prepare(`update LotComments
|
||||||
|
|
@ -15,4 +15,3 @@ export async function updateLotComment(commentForm, user) {
|
||||||
database.release();
|
database.release();
|
||||||
return result.changes > 0;
|
return result.changes > 0;
|
||||||
}
|
}
|
||||||
export default updateLotComment;
|
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,14 @@ import {
|
||||||
|
|
||||||
import { acquireConnection } from './pool.js'
|
import { acquireConnection } from './pool.js'
|
||||||
|
|
||||||
interface UpdateLotCommentForm {
|
export interface UpdateLotCommentForm {
|
||||||
lotCommentId: string | number
|
lotCommentId: string | number
|
||||||
lotCommentDateString: DateString
|
lotCommentDateString: DateString
|
||||||
lotCommentTimeString: TimeString
|
lotCommentTimeString: TimeString
|
||||||
lotComment: string
|
lotComment: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateLotComment(
|
export default async function updateLotComment(
|
||||||
commentForm: UpdateLotCommentForm,
|
commentForm: UpdateLotCommentForm,
|
||||||
user: User
|
user: User
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
|
|
@ -44,5 +44,3 @@ export async function updateLotComment(
|
||||||
|
|
||||||
return result.changes > 0
|
return result.changes > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
export default updateLotComment
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { type DateString } from '@cityssm/utils-datetime';
|
import { type DateString } from '@cityssm/utils-datetime';
|
||||||
interface UpdateLotOccupancyForm {
|
export interface UpdateLotOccupancyForm {
|
||||||
lotOccupancyId: string | number;
|
lotOccupancyId: string | number;
|
||||||
occupancyTypeId: string | number;
|
occupancyTypeId: string | number;
|
||||||
lotId: string | number;
|
lotId: string | number;
|
||||||
|
|
@ -8,5 +8,4 @@ interface UpdateLotOccupancyForm {
|
||||||
occupancyTypeFieldIds?: string;
|
occupancyTypeFieldIds?: string;
|
||||||
[lotOccupancyFieldValue_occupancyTypeFieldId: string]: unknown;
|
[lotOccupancyFieldValue_occupancyTypeFieldId: string]: unknown;
|
||||||
}
|
}
|
||||||
export declare function updateLotOccupancy(lotOccupancyForm: UpdateLotOccupancyForm, user: User): Promise<boolean>;
|
export default function updateLotOccupancy(lotOccupancyForm: UpdateLotOccupancyForm, user: User): Promise<boolean>;
|
||||||
export default updateLotOccupancy;
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import { dateStringToInteger } from '@cityssm/utils-datetime';
|
||||||
import addOrUpdateLotOccupancyField from './addOrUpdateLotOccupancyField.js';
|
import addOrUpdateLotOccupancyField from './addOrUpdateLotOccupancyField.js';
|
||||||
import deleteLotOccupancyField from './deleteLotOccupancyField.js';
|
import deleteLotOccupancyField from './deleteLotOccupancyField.js';
|
||||||
import { acquireConnection } from './pool.js';
|
import { acquireConnection } from './pool.js';
|
||||||
export async function updateLotOccupancy(lotOccupancyForm, user) {
|
export default async function updateLotOccupancy(lotOccupancyForm, user) {
|
||||||
const database = await acquireConnection();
|
const database = await acquireConnection();
|
||||||
const result = database
|
const result = database
|
||||||
.prepare(`update LotOccupancies
|
.prepare(`update LotOccupancies
|
||||||
|
|
@ -33,4 +33,3 @@ export async function updateLotOccupancy(lotOccupancyForm, user) {
|
||||||
database.release();
|
database.release();
|
||||||
return result.changes > 0;
|
return result.changes > 0;
|
||||||
}
|
}
|
||||||
export default updateLotOccupancy;
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import addOrUpdateLotOccupancyField from './addOrUpdateLotOccupancyField.js'
|
||||||
import deleteLotOccupancyField from './deleteLotOccupancyField.js'
|
import deleteLotOccupancyField from './deleteLotOccupancyField.js'
|
||||||
import { acquireConnection } from './pool.js'
|
import { acquireConnection } from './pool.js'
|
||||||
|
|
||||||
interface UpdateLotOccupancyForm {
|
export interface UpdateLotOccupancyForm {
|
||||||
lotOccupancyId: string | number
|
lotOccupancyId: string | number
|
||||||
occupancyTypeId: string | number
|
occupancyTypeId: string | number
|
||||||
lotId: string | number
|
lotId: string | number
|
||||||
|
|
@ -16,7 +16,7 @@ interface UpdateLotOccupancyForm {
|
||||||
[lotOccupancyFieldValue_occupancyTypeFieldId: string]: unknown
|
[lotOccupancyFieldValue_occupancyTypeFieldId: string]: unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateLotOccupancy(
|
export default async function updateLotOccupancy(
|
||||||
lotOccupancyForm: UpdateLotOccupancyForm,
|
lotOccupancyForm: UpdateLotOccupancyForm,
|
||||||
user: User
|
user: User
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
|
|
@ -79,5 +79,3 @@ export async function updateLotOccupancy(
|
||||||
|
|
||||||
return result.changes > 0
|
return result.changes > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
export default updateLotOccupancy
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
interface UpdateLotOccupancyCommentForm {
|
import { type DateString, type TimeString } from '@cityssm/utils-datetime';
|
||||||
|
export interface UpdateLotOccupancyCommentForm {
|
||||||
lotOccupancyCommentId: string | number;
|
lotOccupancyCommentId: string | number;
|
||||||
lotOccupancyCommentDateString: string;
|
lotOccupancyCommentDateString: DateString;
|
||||||
lotOccupancyCommentTimeString: string;
|
lotOccupancyCommentTimeString: TimeString;
|
||||||
lotOccupancyComment: string;
|
lotOccupancyComment: string;
|
||||||
}
|
}
|
||||||
export declare function updateLotOccupancyComment(commentForm: UpdateLotOccupancyCommentForm, user: User): Promise<boolean>;
|
export default function updateLotOccupancyComment(commentForm: UpdateLotOccupancyCommentForm, user: User): Promise<boolean>;
|
||||||
export default updateLotOccupancyComment;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { dateStringToInteger, timeStringToInteger } from '@cityssm/utils-datetime';
|
import { dateStringToInteger, timeStringToInteger } from '@cityssm/utils-datetime';
|
||||||
import { acquireConnection } from './pool.js';
|
import { acquireConnection } from './pool.js';
|
||||||
export async function updateLotOccupancyComment(commentForm, user) {
|
export default async function updateLotOccupancyComment(commentForm, user) {
|
||||||
const database = await acquireConnection();
|
const database = await acquireConnection();
|
||||||
const result = database
|
const result = database
|
||||||
.prepare(`update LotOccupancyComments
|
.prepare(`update LotOccupancyComments
|
||||||
|
|
@ -15,4 +15,3 @@ export async function updateLotOccupancyComment(commentForm, user) {
|
||||||
database.release();
|
database.release();
|
||||||
return result.changes > 0;
|
return result.changes > 0;
|
||||||
}
|
}
|
||||||
export default updateLotOccupancyComment;
|
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,20 @@
|
||||||
import {
|
import {
|
||||||
|
type DateString,
|
||||||
|
type TimeString,
|
||||||
dateStringToInteger,
|
dateStringToInteger,
|
||||||
timeStringToInteger
|
timeStringToInteger
|
||||||
} from '@cityssm/utils-datetime'
|
} from '@cityssm/utils-datetime'
|
||||||
|
|
||||||
import { acquireConnection } from './pool.js'
|
import { acquireConnection } from './pool.js'
|
||||||
|
|
||||||
interface UpdateLotOccupancyCommentForm {
|
export interface UpdateLotOccupancyCommentForm {
|
||||||
lotOccupancyCommentId: string | number
|
lotOccupancyCommentId: string | number
|
||||||
lotOccupancyCommentDateString: string
|
lotOccupancyCommentDateString: DateString
|
||||||
lotOccupancyCommentTimeString: string
|
lotOccupancyCommentTimeString: TimeString
|
||||||
lotOccupancyComment: string
|
lotOccupancyComment: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateLotOccupancyComment(
|
export default async function updateLotOccupancyComment(
|
||||||
commentForm: UpdateLotOccupancyCommentForm,
|
commentForm: UpdateLotOccupancyCommentForm,
|
||||||
user: User
|
user: User
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
|
|
@ -42,5 +44,3 @@ export async function updateLotOccupancyComment(
|
||||||
|
|
||||||
return result.changes > 0
|
return result.changes > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
export default updateLotOccupancyComment
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
interface UpdateLotOccupancyFeeQuantityForm {
|
export interface UpdateLotOccupancyFeeQuantityForm {
|
||||||
lotOccupancyId: string | number;
|
lotOccupancyId: string | number;
|
||||||
feeId: string | number;
|
feeId: string | number;
|
||||||
quantity: string | number;
|
quantity: string | number;
|
||||||
}
|
}
|
||||||
export declare function updateLotOccupancyFeeQuantity(feeQuantityForm: UpdateLotOccupancyFeeQuantityForm, user: User): Promise<boolean>;
|
export default function updateLotOccupancyFeeQuantity(feeQuantityForm: UpdateLotOccupancyFeeQuantityForm, user: User): Promise<boolean>;
|
||||||
export default updateLotOccupancyFeeQuantity;
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { acquireConnection } from './pool.js';
|
import { acquireConnection } from './pool.js';
|
||||||
export async function updateLotOccupancyFeeQuantity(feeQuantityForm, user) {
|
export default async function updateLotOccupancyFeeQuantity(feeQuantityForm, user) {
|
||||||
const database = await acquireConnection();
|
const database = await acquireConnection();
|
||||||
const result = database
|
const result = database
|
||||||
.prepare(`update LotOccupancyFees
|
.prepare(`update LotOccupancyFees
|
||||||
|
|
@ -13,4 +13,3 @@ export async function updateLotOccupancyFeeQuantity(feeQuantityForm, user) {
|
||||||
database.release();
|
database.release();
|
||||||
return result.changes > 0;
|
return result.changes > 0;
|
||||||
}
|
}
|
||||||
export default updateLotOccupancyFeeQuantity;
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
import { acquireConnection } from './pool.js'
|
import { acquireConnection } from './pool.js'
|
||||||
|
|
||||||
interface UpdateLotOccupancyFeeQuantityForm {
|
export interface UpdateLotOccupancyFeeQuantityForm {
|
||||||
lotOccupancyId: string | number
|
lotOccupancyId: string | number
|
||||||
feeId: string | number
|
feeId: string | number
|
||||||
quantity: string | number
|
quantity: string | number
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateLotOccupancyFeeQuantity(
|
export default async function updateLotOccupancyFeeQuantity(
|
||||||
feeQuantityForm: UpdateLotOccupancyFeeQuantityForm,
|
feeQuantityForm: UpdateLotOccupancyFeeQuantityForm,
|
||||||
user: User
|
user: User
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
|
|
@ -34,5 +34,3 @@ export async function updateLotOccupancyFeeQuantity(
|
||||||
|
|
||||||
return result.changes > 0
|
return result.changes > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
export default updateLotOccupancyFeeQuantity
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
interface UpdateLotOccupancyOccupantForm {
|
export interface UpdateLotOccupancyOccupantForm {
|
||||||
lotOccupancyId: string | number;
|
lotOccupancyId: string | number;
|
||||||
lotOccupantIndex: string | number;
|
lotOccupantIndex: string | number;
|
||||||
lotOccupantTypeId: string | number;
|
lotOccupantTypeId: string | number;
|
||||||
|
|
@ -13,5 +13,4 @@ interface UpdateLotOccupancyOccupantForm {
|
||||||
occupantEmailAddress: string;
|
occupantEmailAddress: string;
|
||||||
occupantComment: string;
|
occupantComment: string;
|
||||||
}
|
}
|
||||||
export declare function updateLotOccupancyOccupant(lotOccupancyOccupantForm: UpdateLotOccupancyOccupantForm, user: User): Promise<boolean>;
|
export default function updateLotOccupancyOccupant(lotOccupancyOccupantForm: UpdateLotOccupancyOccupantForm, user: User): Promise<boolean>;
|
||||||
export default updateLotOccupancyOccupant;
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { acquireConnection } from './pool.js';
|
import { acquireConnection } from './pool.js';
|
||||||
export async function updateLotOccupancyOccupant(lotOccupancyOccupantForm, user) {
|
export default async function updateLotOccupancyOccupant(lotOccupancyOccupantForm, user) {
|
||||||
const database = await acquireConnection();
|
const database = await acquireConnection();
|
||||||
const results = database
|
const results = database
|
||||||
.prepare(`update LotOccupancyOccupants
|
.prepare(`update LotOccupancyOccupants
|
||||||
|
|
@ -23,4 +23,3 @@ export async function updateLotOccupancyOccupant(lotOccupancyOccupantForm, user)
|
||||||
database.release();
|
database.release();
|
||||||
return results.changes > 0;
|
return results.changes > 0;
|
||||||
}
|
}
|
||||||
export default updateLotOccupancyOccupant;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { acquireConnection } from './pool.js'
|
import { acquireConnection } from './pool.js'
|
||||||
|
|
||||||
interface UpdateLotOccupancyOccupantForm {
|
export interface UpdateLotOccupancyOccupantForm {
|
||||||
lotOccupancyId: string | number
|
lotOccupancyId: string | number
|
||||||
lotOccupantIndex: string | number
|
lotOccupantIndex: string | number
|
||||||
lotOccupantTypeId: string | number
|
lotOccupantTypeId: string | number
|
||||||
|
|
@ -16,7 +16,7 @@ interface UpdateLotOccupancyOccupantForm {
|
||||||
occupantComment: string
|
occupantComment: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateLotOccupancyOccupant(
|
export default async function updateLotOccupancyOccupant(
|
||||||
lotOccupancyOccupantForm: UpdateLotOccupancyOccupantForm,
|
lotOccupancyOccupantForm: UpdateLotOccupancyOccupantForm,
|
||||||
user: User
|
user: User
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
|
|
@ -64,5 +64,3 @@ export async function updateLotOccupancyOccupant(
|
||||||
|
|
||||||
return results.changes > 0
|
return results.changes > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
export default updateLotOccupancyOccupant
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
interface UpdateLotOccupancyTransactionForm {
|
import { type DateString, type TimeString } from '@cityssm/utils-datetime';
|
||||||
|
export interface UpdateLotOccupancyTransactionForm {
|
||||||
lotOccupancyId: string | number;
|
lotOccupancyId: string | number;
|
||||||
transactionIndex: string | number;
|
transactionIndex: string | number;
|
||||||
transactionDateString: string;
|
transactionDateString: DateString;
|
||||||
transactionTimeString: string;
|
transactionTimeString: TimeString;
|
||||||
transactionAmount: string | number;
|
transactionAmount: string | number;
|
||||||
externalReceiptNumber: string;
|
externalReceiptNumber: string;
|
||||||
transactionNote: string;
|
transactionNote: string;
|
||||||
}
|
}
|
||||||
export declare function updateLotOccupancyTransaction(lotOccupancyTransactionForm: UpdateLotOccupancyTransactionForm, user: User): Promise<boolean>;
|
export default function updateLotOccupancyTransaction(lotOccupancyTransactionForm: UpdateLotOccupancyTransactionForm, user: User): Promise<boolean>;
|
||||||
export default updateLotOccupancyTransaction;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { dateStringToInteger, timeStringToInteger } from '@cityssm/utils-datetime';
|
import { dateStringToInteger, timeStringToInteger } from '@cityssm/utils-datetime';
|
||||||
import { acquireConnection } from './pool.js';
|
import { acquireConnection } from './pool.js';
|
||||||
export async function updateLotOccupancyTransaction(lotOccupancyTransactionForm, user) {
|
export default async function updateLotOccupancyTransaction(lotOccupancyTransactionForm, user) {
|
||||||
const database = await acquireConnection();
|
const database = await acquireConnection();
|
||||||
const result = database
|
const result = database
|
||||||
.prepare(`update LotOccupancyTransactions
|
.prepare(`update LotOccupancyTransactions
|
||||||
|
|
@ -18,4 +18,3 @@ export async function updateLotOccupancyTransaction(lotOccupancyTransactionForm,
|
||||||
database.release();
|
database.release();
|
||||||
return result.changes > 0;
|
return result.changes > 0;
|
||||||
}
|
}
|
||||||
export default updateLotOccupancyTransaction;
|
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,23 @@
|
||||||
import {
|
import {
|
||||||
|
type DateString,
|
||||||
|
type TimeString,
|
||||||
dateStringToInteger,
|
dateStringToInteger,
|
||||||
timeStringToInteger
|
timeStringToInteger
|
||||||
} from '@cityssm/utils-datetime'
|
} from '@cityssm/utils-datetime'
|
||||||
|
|
||||||
import { acquireConnection } from './pool.js'
|
import { acquireConnection } from './pool.js'
|
||||||
|
|
||||||
interface UpdateLotOccupancyTransactionForm {
|
export interface UpdateLotOccupancyTransactionForm {
|
||||||
lotOccupancyId: string | number
|
lotOccupancyId: string | number
|
||||||
transactionIndex: string | number
|
transactionIndex: string | number
|
||||||
transactionDateString: string
|
transactionDateString: DateString
|
||||||
transactionTimeString: string
|
transactionTimeString: TimeString
|
||||||
transactionAmount: string | number
|
transactionAmount: string | number
|
||||||
externalReceiptNumber: string
|
externalReceiptNumber: string
|
||||||
transactionNote: string
|
transactionNote: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateLotOccupancyTransaction(
|
export default async function updateLotOccupancyTransaction(
|
||||||
lotOccupancyTransactionForm: UpdateLotOccupancyTransactionForm,
|
lotOccupancyTransactionForm: UpdateLotOccupancyTransactionForm,
|
||||||
user: User
|
user: User
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
|
|
@ -51,5 +53,3 @@ export async function updateLotOccupancyTransaction(
|
||||||
|
|
||||||
return result.changes > 0
|
return result.changes > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
export default updateLotOccupancyTransaction
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
interface UpdateLotOccupantTypeForm {
|
export interface UpdateLotOccupantTypeForm {
|
||||||
lotOccupantTypeId: number | string;
|
lotOccupantTypeId: number | string;
|
||||||
lotOccupantType: string;
|
lotOccupantType: string;
|
||||||
fontAwesomeIconClass: string;
|
fontAwesomeIconClass: string;
|
||||||
occupantCommentTitle: string;
|
occupantCommentTitle: string;
|
||||||
}
|
}
|
||||||
export declare function updateLotOccupantType(lotOccupantTypeForm: UpdateLotOccupantTypeForm, user: User): Promise<boolean>;
|
export default function updateLotOccupantType(lotOccupantTypeForm: UpdateLotOccupantTypeForm, user: User): Promise<boolean>;
|
||||||
export default updateLotOccupantType;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { clearCacheByTableName } from '../helpers/functions.cache.js';
|
import { clearCacheByTableName } from '../helpers/functions.cache.js';
|
||||||
import { acquireConnection } from './pool.js';
|
import { acquireConnection } from './pool.js';
|
||||||
export async function updateLotOccupantType(lotOccupantTypeForm, user) {
|
export default async function updateLotOccupantType(lotOccupantTypeForm, user) {
|
||||||
const database = await acquireConnection();
|
const database = await acquireConnection();
|
||||||
const result = database
|
const result = database
|
||||||
.prepare(`update LotOccupantTypes
|
.prepare(`update LotOccupantTypes
|
||||||
|
|
@ -16,4 +16,3 @@ export async function updateLotOccupantType(lotOccupantTypeForm, user) {
|
||||||
clearCacheByTableName('LotOccupantTypes');
|
clearCacheByTableName('LotOccupantTypes');
|
||||||
return result.changes > 0;
|
return result.changes > 0;
|
||||||
}
|
}
|
||||||
export default updateLotOccupantType;
|
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,14 @@ import { clearCacheByTableName } from '../helpers/functions.cache.js'
|
||||||
|
|
||||||
import { acquireConnection } from './pool.js'
|
import { acquireConnection } from './pool.js'
|
||||||
|
|
||||||
interface UpdateLotOccupantTypeForm {
|
export interface UpdateLotOccupantTypeForm {
|
||||||
lotOccupantTypeId: number | string
|
lotOccupantTypeId: number | string
|
||||||
lotOccupantType: string
|
lotOccupantType: string
|
||||||
fontAwesomeIconClass: string
|
fontAwesomeIconClass: string
|
||||||
occupantCommentTitle: string
|
occupantCommentTitle: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateLotOccupantType(
|
export default async function updateLotOccupantType(
|
||||||
lotOccupantTypeForm: UpdateLotOccupantTypeForm,
|
lotOccupantTypeForm: UpdateLotOccupantTypeForm,
|
||||||
user: User
|
user: User
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
|
|
@ -41,5 +41,3 @@ export async function updateLotOccupantType(
|
||||||
|
|
||||||
return result.changes > 0
|
return result.changes > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
export default updateLotOccupantType
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
interface UpdateLotTypeFieldForm {
|
export interface UpdateLotTypeFieldForm {
|
||||||
lotTypeFieldId: number | string;
|
lotTypeFieldId: number | string;
|
||||||
lotTypeField: string;
|
lotTypeField: string;
|
||||||
isRequired: '0' | '1';
|
isRequired: '0' | '1';
|
||||||
|
|
@ -7,5 +7,4 @@ interface UpdateLotTypeFieldForm {
|
||||||
pattern?: string;
|
pattern?: string;
|
||||||
lotTypeFieldValues: string;
|
lotTypeFieldValues: string;
|
||||||
}
|
}
|
||||||
export declare function updateLotTypeField(lotTypeFieldForm: UpdateLotTypeFieldForm, user: User): Promise<boolean>;
|
export default function updateLotTypeField(lotTypeFieldForm: UpdateLotTypeFieldForm, user: User): Promise<boolean>;
|
||||||
export default updateLotTypeField;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { clearCacheByTableName } from '../helpers/functions.cache.js';
|
import { clearCacheByTableName } from '../helpers/functions.cache.js';
|
||||||
import { acquireConnection } from './pool.js';
|
import { acquireConnection } from './pool.js';
|
||||||
export async function updateLotTypeField(lotTypeFieldForm, user) {
|
export default async function updateLotTypeField(lotTypeFieldForm, user) {
|
||||||
const database = await acquireConnection();
|
const database = await acquireConnection();
|
||||||
const result = database
|
const result = database
|
||||||
.prepare(`update LotTypeFields
|
.prepare(`update LotTypeFields
|
||||||
|
|
@ -19,4 +19,3 @@ export async function updateLotTypeField(lotTypeFieldForm, user) {
|
||||||
clearCacheByTableName('LotTypeFields');
|
clearCacheByTableName('LotTypeFields');
|
||||||
return result.changes > 0;
|
return result.changes > 0;
|
||||||
}
|
}
|
||||||
export default updateLotTypeField;
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import { clearCacheByTableName } from '../helpers/functions.cache.js'
|
||||||
|
|
||||||
import { acquireConnection } from './pool.js'
|
import { acquireConnection } from './pool.js'
|
||||||
|
|
||||||
interface UpdateLotTypeFieldForm {
|
export interface UpdateLotTypeFieldForm {
|
||||||
lotTypeFieldId: number | string
|
lotTypeFieldId: number | string
|
||||||
lotTypeField: string
|
lotTypeField: string
|
||||||
isRequired: '0' | '1'
|
isRequired: '0' | '1'
|
||||||
|
|
@ -12,7 +12,7 @@ interface UpdateLotTypeFieldForm {
|
||||||
lotTypeFieldValues: string
|
lotTypeFieldValues: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateLotTypeField(
|
export default async function updateLotTypeField(
|
||||||
lotTypeFieldForm: UpdateLotTypeFieldForm,
|
lotTypeFieldForm: UpdateLotTypeFieldForm,
|
||||||
user: User
|
user: User
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
|
|
@ -50,5 +50,3 @@ export async function updateLotTypeField(
|
||||||
|
|
||||||
return result.changes > 0
|
return result.changes > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
export default updateLotTypeField
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
interface UpdateMapForm {
|
export interface UpdateMapForm {
|
||||||
mapId: string;
|
mapId: string;
|
||||||
mapName: string;
|
mapName: string;
|
||||||
mapDescription: string;
|
mapDescription: string;
|
||||||
|
|
@ -12,5 +12,4 @@ interface UpdateMapForm {
|
||||||
mapPostalCode: string;
|
mapPostalCode: string;
|
||||||
mapPhoneNumber: string;
|
mapPhoneNumber: string;
|
||||||
}
|
}
|
||||||
export declare function updateMap(mapForm: UpdateMapForm, user: User): Promise<boolean>;
|
export default function updateMap(mapForm: UpdateMapForm, user: User): Promise<boolean>;
|
||||||
export default updateMap;
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { acquireConnection } from './pool.js';
|
import { acquireConnection } from './pool.js';
|
||||||
export async function updateMap(mapForm, user) {
|
export default async function updateMap(mapForm, user) {
|
||||||
const database = await acquireConnection();
|
const database = await acquireConnection();
|
||||||
const result = database
|
const result = database
|
||||||
.prepare(`update Maps
|
.prepare(`update Maps
|
||||||
|
|
@ -22,4 +22,3 @@ export async function updateMap(mapForm, user) {
|
||||||
database.release();
|
database.release();
|
||||||
return result.changes > 0;
|
return result.changes > 0;
|
||||||
}
|
}
|
||||||
export default updateMap;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { acquireConnection } from './pool.js'
|
import { acquireConnection } from './pool.js'
|
||||||
|
|
||||||
interface UpdateMapForm {
|
export interface UpdateMapForm {
|
||||||
mapId: string
|
mapId: string
|
||||||
mapName: string
|
mapName: string
|
||||||
mapDescription: string
|
mapDescription: string
|
||||||
|
|
@ -15,7 +15,7 @@ interface UpdateMapForm {
|
||||||
mapPhoneNumber: string
|
mapPhoneNumber: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateMap(
|
export default async function updateMap(
|
||||||
mapForm: UpdateMapForm,
|
mapForm: UpdateMapForm,
|
||||||
user: User
|
user: User
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
|
|
@ -61,5 +61,3 @@ export async function updateMap(
|
||||||
|
|
||||||
return result.changes > 0
|
return result.changes > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
export default updateMap
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
interface UpdateOccupancyTypeFieldForm {
|
export interface UpdateOccupancyTypeFieldForm {
|
||||||
occupancyTypeFieldId: number | string;
|
occupancyTypeFieldId: number | string;
|
||||||
occupancyTypeField: string;
|
occupancyTypeField: string;
|
||||||
isRequired: '0' | '1';
|
isRequired: '0' | '1';
|
||||||
|
|
@ -7,5 +7,4 @@ interface UpdateOccupancyTypeFieldForm {
|
||||||
pattern?: string;
|
pattern?: string;
|
||||||
occupancyTypeFieldValues: string;
|
occupancyTypeFieldValues: string;
|
||||||
}
|
}
|
||||||
export declare function updateOccupancyTypeField(occupancyTypeFieldForm: UpdateOccupancyTypeFieldForm, user: User): Promise<boolean>;
|
export default function updateOccupancyTypeField(occupancyTypeFieldForm: UpdateOccupancyTypeFieldForm, user: User): Promise<boolean>;
|
||||||
export default updateOccupancyTypeField;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { clearCacheByTableName } from '../helpers/functions.cache.js';
|
import { clearCacheByTableName } from '../helpers/functions.cache.js';
|
||||||
import { acquireConnection } from './pool.js';
|
import { acquireConnection } from './pool.js';
|
||||||
export async function updateOccupancyTypeField(occupancyTypeFieldForm, user) {
|
export default async function updateOccupancyTypeField(occupancyTypeFieldForm, user) {
|
||||||
const database = await acquireConnection();
|
const database = await acquireConnection();
|
||||||
const result = database
|
const result = database
|
||||||
.prepare(`update OccupancyTypeFields
|
.prepare(`update OccupancyTypeFields
|
||||||
|
|
@ -19,4 +19,3 @@ export async function updateOccupancyTypeField(occupancyTypeFieldForm, user) {
|
||||||
clearCacheByTableName('OccupancyTypeFields');
|
clearCacheByTableName('OccupancyTypeFields');
|
||||||
return result.changes > 0;
|
return result.changes > 0;
|
||||||
}
|
}
|
||||||
export default updateOccupancyTypeField;
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import { clearCacheByTableName } from '../helpers/functions.cache.js'
|
||||||
|
|
||||||
import { acquireConnection } from './pool.js'
|
import { acquireConnection } from './pool.js'
|
||||||
|
|
||||||
interface UpdateOccupancyTypeFieldForm {
|
export interface UpdateOccupancyTypeFieldForm {
|
||||||
occupancyTypeFieldId: number | string
|
occupancyTypeFieldId: number | string
|
||||||
occupancyTypeField: string
|
occupancyTypeField: string
|
||||||
isRequired: '0' | '1'
|
isRequired: '0' | '1'
|
||||||
|
|
@ -12,7 +12,7 @@ interface UpdateOccupancyTypeFieldForm {
|
||||||
occupancyTypeFieldValues: string
|
occupancyTypeFieldValues: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateOccupancyTypeField(
|
export default async function updateOccupancyTypeField(
|
||||||
occupancyTypeFieldForm: UpdateOccupancyTypeFieldForm,
|
occupancyTypeFieldForm: UpdateOccupancyTypeFieldForm,
|
||||||
user: User
|
user: User
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
|
|
@ -50,5 +50,3 @@ export async function updateOccupancyTypeField(
|
||||||
|
|
||||||
return result.changes > 0
|
return result.changes > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
export default updateOccupancyTypeField
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
interface UpdateWorkOrderForm {
|
import { type DateString } from '@cityssm/utils-datetime';
|
||||||
|
export interface UpdateWorkOrderForm {
|
||||||
workOrderId: string;
|
workOrderId: string;
|
||||||
workOrderNumber: string;
|
workOrderNumber: string;
|
||||||
workOrderTypeId: string;
|
workOrderTypeId: string;
|
||||||
workOrderDescription: string;
|
workOrderDescription: string;
|
||||||
workOrderOpenDateString: string;
|
workOrderOpenDateString: DateString;
|
||||||
}
|
}
|
||||||
export declare function updateWorkOrder(workOrderForm: UpdateWorkOrderForm, user: User): Promise<boolean>;
|
export default function updateWorkOrder(workOrderForm: UpdateWorkOrderForm, user: User): Promise<boolean>;
|
||||||
export default updateWorkOrder;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { dateStringToInteger } from '@cityssm/utils-datetime';
|
import { dateStringToInteger } from '@cityssm/utils-datetime';
|
||||||
import { acquireConnection } from './pool.js';
|
import { acquireConnection } from './pool.js';
|
||||||
export async function updateWorkOrder(workOrderForm, user) {
|
export default async function updateWorkOrder(workOrderForm, user) {
|
||||||
const database = await acquireConnection();
|
const database = await acquireConnection();
|
||||||
const result = database
|
const result = database
|
||||||
.prepare(`update WorkOrders
|
.prepare(`update WorkOrders
|
||||||
|
|
@ -16,4 +16,3 @@ export async function updateWorkOrder(workOrderForm, user) {
|
||||||
database.release();
|
database.release();
|
||||||
return result.changes > 0;
|
return result.changes > 0;
|
||||||
}
|
}
|
||||||
export default updateWorkOrder;
|
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
import { dateStringToInteger } from '@cityssm/utils-datetime'
|
import { type DateString, dateStringToInteger } from '@cityssm/utils-datetime'
|
||||||
|
|
||||||
import { acquireConnection } from './pool.js'
|
import { acquireConnection } from './pool.js'
|
||||||
|
|
||||||
interface UpdateWorkOrderForm {
|
export interface UpdateWorkOrderForm {
|
||||||
workOrderId: string
|
workOrderId: string
|
||||||
workOrderNumber: string
|
workOrderNumber: string
|
||||||
workOrderTypeId: string
|
workOrderTypeId: string
|
||||||
workOrderDescription: string
|
workOrderDescription: string
|
||||||
workOrderOpenDateString: string
|
workOrderOpenDateString: DateString
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateWorkOrder(
|
export default async function updateWorkOrder(
|
||||||
workOrderForm: UpdateWorkOrderForm,
|
workOrderForm: UpdateWorkOrderForm,
|
||||||
user: User
|
user: User
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
|
|
@ -42,5 +42,3 @@ export async function updateWorkOrder(
|
||||||
|
|
||||||
return result.changes > 0
|
return result.changes > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
export default updateWorkOrder
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
|
import { type DateString, type TimeString } from '@cityssm/utils-datetime';
|
||||||
export interface UpdateWorkOrderCommentForm {
|
export interface UpdateWorkOrderCommentForm {
|
||||||
workOrderCommentId: string | number;
|
workOrderCommentId: string | number;
|
||||||
workOrderCommentDateString: string;
|
workOrderCommentDateString: DateString;
|
||||||
workOrderCommentTimeString: string;
|
workOrderCommentTimeString: TimeString;
|
||||||
workOrderComment: string;
|
workOrderComment: string;
|
||||||
}
|
}
|
||||||
export declare function updateWorkOrderComment(commentForm: UpdateWorkOrderCommentForm, user: User): Promise<boolean>;
|
export default function updateWorkOrderComment(commentForm: UpdateWorkOrderCommentForm, user: User): Promise<boolean>;
|
||||||
export default updateWorkOrderComment;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { dateStringToInteger, timeStringToInteger } from '@cityssm/utils-datetime';
|
import { dateStringToInteger, timeStringToInteger } from '@cityssm/utils-datetime';
|
||||||
import { acquireConnection } from './pool.js';
|
import { acquireConnection } from './pool.js';
|
||||||
export async function updateWorkOrderComment(commentForm, user) {
|
export default async function updateWorkOrderComment(commentForm, user) {
|
||||||
const database = await acquireConnection();
|
const database = await acquireConnection();
|
||||||
const result = database
|
const result = database
|
||||||
.prepare(`update WorkOrderComments
|
.prepare(`update WorkOrderComments
|
||||||
|
|
@ -15,4 +15,3 @@ export async function updateWorkOrderComment(commentForm, user) {
|
||||||
database.release();
|
database.release();
|
||||||
return result.changes > 0;
|
return result.changes > 0;
|
||||||
}
|
}
|
||||||
export default updateWorkOrderComment;
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
import {
|
import {
|
||||||
|
type DateString,
|
||||||
|
type TimeString,
|
||||||
dateStringToInteger,
|
dateStringToInteger,
|
||||||
timeStringToInteger
|
timeStringToInteger
|
||||||
} from '@cityssm/utils-datetime'
|
} from '@cityssm/utils-datetime'
|
||||||
|
|
@ -7,12 +9,12 @@ import { acquireConnection } from './pool.js'
|
||||||
|
|
||||||
export interface UpdateWorkOrderCommentForm {
|
export interface UpdateWorkOrderCommentForm {
|
||||||
workOrderCommentId: string | number
|
workOrderCommentId: string | number
|
||||||
workOrderCommentDateString: string
|
workOrderCommentDateString: DateString
|
||||||
workOrderCommentTimeString: string
|
workOrderCommentTimeString: TimeString
|
||||||
workOrderComment: string
|
workOrderComment: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateWorkOrderComment(
|
export default async function updateWorkOrderComment(
|
||||||
commentForm: UpdateWorkOrderCommentForm,
|
commentForm: UpdateWorkOrderCommentForm,
|
||||||
user: User
|
user: User
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
|
|
@ -42,5 +44,3 @@ export async function updateWorkOrderComment(
|
||||||
|
|
||||||
return result.changes > 0
|
return result.changes > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
export default updateWorkOrderComment
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import getFeeCategories from '../../database/getFeeCategories.js';
|
import getFeeCategories from '../../database/getFeeCategories.js';
|
||||||
import { updateFee } from '../../database/updateFee.js';
|
import updateFee from '../../database/updateFee.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await updateFee(request.body, request.session.user);
|
const success = await updateFee(request.body, request.session.user);
|
||||||
const feeCategories = await getFeeCategories({}, {
|
const feeCategories = await getFeeCategories({}, {
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import getFeeCategories from '../../database/getFeeCategories.js'
|
import getFeeCategories from '../../database/getFeeCategories.js'
|
||||||
import { updateFee } from '../../database/updateFee.js'
|
import updateFee, { type UpdateFeeForm } from '../../database/updateFee.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success = await updateFee(request.body, request.session.user as User)
|
const success = await updateFee(request.body as UpdateFeeForm, request.session.user as User)
|
||||||
|
|
||||||
const feeCategories = await getFeeCategories(
|
const feeCategories = await getFeeCategories(
|
||||||
{},
|
{},
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import getFeeCategories from '../../database/getFeeCategories.js';
|
import getFeeCategories from '../../database/getFeeCategories.js';
|
||||||
import { updateFeeCategory } from '../../database/updateFeeCategory.js';
|
import updateFeeCategory from '../../database/updateFeeCategory.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await updateFeeCategory(request.body, request.session.user);
|
const success = await updateFeeCategory(request.body, request.session.user);
|
||||||
const feeCategories = await getFeeCategories({}, {
|
const feeCategories = await getFeeCategories({}, {
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,16 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import getFeeCategories from '../../database/getFeeCategories.js'
|
import getFeeCategories from '../../database/getFeeCategories.js'
|
||||||
import { updateFeeCategory } from '../../database/updateFeeCategory.js'
|
import updateFeeCategory, {
|
||||||
|
type UpdateFeeCategoryForm
|
||||||
|
} from '../../database/updateFeeCategory.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success = await updateFeeCategory(
|
const success = await updateFeeCategory(
|
||||||
request.body,
|
request.body as UpdateFeeCategoryForm,
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
|
import updateLotOccupantType from '../../database/updateLotOccupantType.js';
|
||||||
import { getLotOccupantTypes } from '../../helpers/functions.cache.js';
|
import { getLotOccupantTypes } from '../../helpers/functions.cache.js';
|
||||||
import { updateLotOccupantType } from '../../database/updateLotOccupantType.js';
|
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await updateLotOccupantType(request.body, request.session.user);
|
const success = await updateLotOccupantType(request.body, request.session.user);
|
||||||
const lotOccupantTypes = await getLotOccupantTypes();
|
const lotOccupantTypes = await getLotOccupantTypes();
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,16 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
|
import updateLotOccupantType, {
|
||||||
|
type UpdateLotOccupantTypeForm
|
||||||
|
} from '../../database/updateLotOccupantType.js'
|
||||||
import { getLotOccupantTypes } from '../../helpers/functions.cache.js'
|
import { getLotOccupantTypes } from '../../helpers/functions.cache.js'
|
||||||
import { updateLotOccupantType } from '../../database/updateLotOccupantType.js'
|
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success = await updateLotOccupantType(
|
const success = await updateLotOccupantType(
|
||||||
request.body,
|
request.body as UpdateLotOccupantTypeForm,
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -19,4 +21,3 @@ export default async function handler(
|
||||||
lotOccupantTypes
|
lotOccupantTypes
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { getLotStatuses } from '../../helpers/functions.cache.js';
|
|
||||||
import { updateRecord } from '../../database/updateRecord.js';
|
import { updateRecord } from '../../database/updateRecord.js';
|
||||||
|
import { getLotStatuses } from '../../helpers/functions.cache.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await updateRecord('LotStatuses', request.body.lotStatusId, request.body.lotStatus, request.session.user);
|
const success = await updateRecord('LotStatuses', request.body.lotStatusId, request.body.lotStatus, request.session.user);
|
||||||
const lotStatuses = await getLotStatuses();
|
const lotStatuses = await getLotStatuses();
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import { getLotStatuses } from '../../helpers/functions.cache.js'
|
|
||||||
import { updateRecord } from '../../database/updateRecord.js'
|
import { updateRecord } from '../../database/updateRecord.js'
|
||||||
|
import { getLotStatuses } from '../../helpers/functions.cache.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
|
|
@ -9,8 +9,8 @@ export default async function handler(
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success = await updateRecord(
|
const success = await updateRecord(
|
||||||
'LotStatuses',
|
'LotStatuses',
|
||||||
request.body.lotStatusId,
|
request.body.lotStatusId as string,
|
||||||
request.body.lotStatus,
|
request.body.lotStatus as string,
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -21,4 +21,3 @@ export default async function handler(
|
||||||
lotStatuses
|
lotStatuses
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ export default async function handler(
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success = await updateRecord(
|
const success = await updateRecord(
|
||||||
'LotTypes',
|
'LotTypes',
|
||||||
request.body.lotTypeId,
|
request.body.lotTypeId as string,
|
||||||
request.body.lotType,
|
request.body.lotType as string,
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
|
import updateLotTypeField from '../../database/updateLotTypeField.js';
|
||||||
import { getLotTypes } from '../../helpers/functions.cache.js';
|
import { getLotTypes } from '../../helpers/functions.cache.js';
|
||||||
import { updateLotTypeField } from '../../database/updateLotTypeField.js';
|
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await updateLotTypeField(request.body, request.session.user);
|
const success = await updateLotTypeField(request.body, request.session.user);
|
||||||
const lotTypes = await getLotTypes();
|
const lotTypes = await getLotTypes();
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,16 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
|
import updateLotTypeField, {
|
||||||
|
type UpdateLotTypeFieldForm
|
||||||
|
} from '../../database/updateLotTypeField.js'
|
||||||
import { getLotTypes } from '../../helpers/functions.cache.js'
|
import { getLotTypes } from '../../helpers/functions.cache.js'
|
||||||
import { updateLotTypeField } from '../../database/updateLotTypeField.js'
|
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success = await updateLotTypeField(
|
const success = await updateLotTypeField(
|
||||||
request.body,
|
request.body as UpdateLotTypeFieldForm,
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -19,4 +21,3 @@ export default async function handler(
|
||||||
lotTypes
|
lotTypes
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js';
|
|
||||||
import { updateRecord } from '../../database/updateRecord.js';
|
import { updateRecord } from '../../database/updateRecord.js';
|
||||||
|
import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await updateRecord('OccupancyTypes', request.body.occupancyTypeId, request.body.occupancyType, request.session.user);
|
const success = await updateRecord('OccupancyTypes', request.body.occupancyTypeId, request.body.occupancyType, request.session.user);
|
||||||
const occupancyTypes = await getOccupancyTypes();
|
const occupancyTypes = await getOccupancyTypes();
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
|
import { updateRecord } from '../../database/updateRecord.js'
|
||||||
import {
|
import {
|
||||||
getAllOccupancyTypeFields,
|
getAllOccupancyTypeFields,
|
||||||
getOccupancyTypes
|
getOccupancyTypes
|
||||||
} from '../../helpers/functions.cache.js'
|
} from '../../helpers/functions.cache.js'
|
||||||
import { updateRecord } from '../../database/updateRecord.js'
|
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
|
|
@ -12,8 +12,8 @@ export default async function handler(
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success = await updateRecord(
|
const success = await updateRecord(
|
||||||
'OccupancyTypes',
|
'OccupancyTypes',
|
||||||
request.body.occupancyTypeId,
|
request.body.occupancyTypeId as string,
|
||||||
request.body.occupancyType,
|
request.body.occupancyType as string,
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -26,4 +26,3 @@ export default async function handler(
|
||||||
allOccupancyTypeFields
|
allOccupancyTypeFields
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
|
import updateOccupancyTypeField from '../../database/updateOccupancyTypeField.js';
|
||||||
import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js';
|
import { getAllOccupancyTypeFields, getOccupancyTypes } from '../../helpers/functions.cache.js';
|
||||||
import { updateOccupancyTypeField } from '../../database/updateOccupancyTypeField.js';
|
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await updateOccupancyTypeField(request.body, request.session.user);
|
const success = await updateOccupancyTypeField(request.body, request.session.user);
|
||||||
const occupancyTypes = await getOccupancyTypes();
|
const occupancyTypes = await getOccupancyTypes();
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,19 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
|
import updateOccupancyTypeField, {
|
||||||
|
type UpdateOccupancyTypeFieldForm
|
||||||
|
} from '../../database/updateOccupancyTypeField.js'
|
||||||
import {
|
import {
|
||||||
getAllOccupancyTypeFields,
|
getAllOccupancyTypeFields,
|
||||||
getOccupancyTypes
|
getOccupancyTypes
|
||||||
} from '../../helpers/functions.cache.js'
|
} from '../../helpers/functions.cache.js'
|
||||||
import { updateOccupancyTypeField } from '../../database/updateOccupancyTypeField.js'
|
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success = await updateOccupancyTypeField(
|
const success = await updateOccupancyTypeField(
|
||||||
request.body,
|
request.body as UpdateOccupancyTypeFieldForm,
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -24,4 +26,3 @@ export default async function handler(
|
||||||
allOccupancyTypeFields
|
allOccupancyTypeFields
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { getWorkOrderMilestoneTypes } from '../../helpers/functions.cache.js';
|
|
||||||
import { updateRecord } from '../../database/updateRecord.js';
|
import { updateRecord } from '../../database/updateRecord.js';
|
||||||
|
import { getWorkOrderMilestoneTypes } from '../../helpers/functions.cache.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await updateRecord('WorkOrderMilestoneTypes', request.body.workOrderMilestoneTypeId, request.body.workOrderMilestoneType, request.session.user);
|
const success = await updateRecord('WorkOrderMilestoneTypes', request.body.workOrderMilestoneTypeId, request.body.workOrderMilestoneType, request.session.user);
|
||||||
const workOrderMilestoneTypes = await getWorkOrderMilestoneTypes();
|
const workOrderMilestoneTypes = await getWorkOrderMilestoneTypes();
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import { getWorkOrderMilestoneTypes } from '../../helpers/functions.cache.js'
|
|
||||||
import { updateRecord } from '../../database/updateRecord.js'
|
import { updateRecord } from '../../database/updateRecord.js'
|
||||||
|
import { getWorkOrderMilestoneTypes } from '../../helpers/functions.cache.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
|
|
@ -9,8 +9,8 @@ export default async function handler(
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success = await updateRecord(
|
const success = await updateRecord(
|
||||||
'WorkOrderMilestoneTypes',
|
'WorkOrderMilestoneTypes',
|
||||||
request.body.workOrderMilestoneTypeId,
|
request.body.workOrderMilestoneTypeId as string,
|
||||||
request.body.workOrderMilestoneType,
|
request.body.workOrderMilestoneType as string,
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -21,4 +21,3 @@ export default async function handler(
|
||||||
workOrderMilestoneTypes
|
workOrderMilestoneTypes
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { getWorkOrderTypes } from '../../helpers/functions.cache.js';
|
|
||||||
import { updateRecord } from '../../database/updateRecord.js';
|
import { updateRecord } from '../../database/updateRecord.js';
|
||||||
|
import { getWorkOrderTypes } from '../../helpers/functions.cache.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await updateRecord('WorkOrderTypes', request.body.workOrderTypeId, request.body.workOrderType, request.session.user);
|
const success = await updateRecord('WorkOrderTypes', request.body.workOrderTypeId, request.body.workOrderType, request.session.user);
|
||||||
const workOrderTypes = await getWorkOrderTypes();
|
const workOrderTypes = await getWorkOrderTypes();
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import { getWorkOrderTypes } from '../../helpers/functions.cache.js'
|
|
||||||
import { updateRecord } from '../../database/updateRecord.js'
|
import { updateRecord } from '../../database/updateRecord.js'
|
||||||
|
import { getWorkOrderTypes } from '../../helpers/functions.cache.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
|
|
@ -9,8 +9,8 @@ export default async function handler(
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success = await updateRecord(
|
const success = await updateRecord(
|
||||||
'WorkOrderTypes',
|
'WorkOrderTypes',
|
||||||
request.body.workOrderTypeId,
|
request.body.workOrderTypeId as string,
|
||||||
request.body.workOrderType,
|
request.body.workOrderType as string,
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -21,4 +21,3 @@ export default async function handler(
|
||||||
workOrderTypes
|
workOrderTypes
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,19 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import getPastLotOccupancyOccupants from '../../database/getPastLotOccupancyOccupants.js'
|
import getPastLotOccupancyOccupants, {
|
||||||
|
type GetPastLotOccupancyOccupantsFilters
|
||||||
|
} from '../../database/getPastLotOccupancyOccupants.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const occupants = await getPastLotOccupancyOccupants(request.body, {
|
const occupants = await getPastLotOccupancyOccupants(
|
||||||
limit: Number.parseInt(request.body.limit, 10)
|
request.body as GetPastLotOccupancyOccupantsFilters,
|
||||||
})
|
{
|
||||||
|
limit: Number.parseInt(request.body.limit as string, 10)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
occupants
|
occupants
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { updateLotOccupancy } from '../../database/updateLotOccupancy.js';
|
import updateLotOccupancy from '../../database/updateLotOccupancy.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await updateLotOccupancy(request.body, request.session.user);
|
const success = await updateLotOccupancy(request.body, request.session.user);
|
||||||
response.json({
|
response.json({
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,20 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import { updateLotOccupancy } from '../../database/updateLotOccupancy.js'
|
import updateLotOccupancy, {
|
||||||
|
type UpdateLotOccupancyForm
|
||||||
|
} from '../../database/updateLotOccupancy.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success = await updateLotOccupancy(request.body, request.session.user as User)
|
const success = await updateLotOccupancy(
|
||||||
|
request.body as UpdateLotOccupancyForm,
|
||||||
|
request.session.user as User
|
||||||
|
)
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
lotOccupancyId: request.body.lotOccupancyId
|
lotOccupancyId: request.body.lotOccupancyId as string
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import getLotOccupancyComments from '../../database/getLotOccupancyComments.js';
|
import getLotOccupancyComments from '../../database/getLotOccupancyComments.js';
|
||||||
import { updateLotOccupancyComment } from '../../database/updateLotOccupancyComment.js';
|
import updateLotOccupancyComment from '../../database/updateLotOccupancyComment.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await updateLotOccupancyComment(request.body, request.session.user);
|
const success = await updateLotOccupancyComment(request.body, request.session.user);
|
||||||
const lotOccupancyComments = await getLotOccupancyComments(request.body.lotOccupancyId);
|
const lotOccupancyComments = await getLotOccupancyComments(request.body.lotOccupancyId);
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,21 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import getLotOccupancyComments from '../../database/getLotOccupancyComments.js'
|
import getLotOccupancyComments from '../../database/getLotOccupancyComments.js'
|
||||||
import { updateLotOccupancyComment } from '../../database/updateLotOccupancyComment.js'
|
import updateLotOccupancyComment, {
|
||||||
|
type UpdateLotOccupancyCommentForm
|
||||||
|
} from '../../database/updateLotOccupancyComment.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success = await updateLotOccupancyComment(
|
const success = await updateLotOccupancyComment(
|
||||||
request.body,
|
request.body as UpdateLotOccupancyCommentForm,
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
const lotOccupancyComments = await getLotOccupancyComments(
|
const lotOccupancyComments = await getLotOccupancyComments(
|
||||||
request.body.lotOccupancyId
|
request.body.lotOccupancyId as string
|
||||||
)
|
)
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import getLotOccupancyFees from '../../database/getLotOccupancyFees.js';
|
import getLotOccupancyFees from '../../database/getLotOccupancyFees.js';
|
||||||
import { updateLotOccupancyFeeQuantity } from '../../database/updateLotOccupancyFeeQuantity.js';
|
import updateLotOccupancyFeeQuantity from '../../database/updateLotOccupancyFeeQuantity.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await updateLotOccupancyFeeQuantity(request.body, request.session.user);
|
const success = await updateLotOccupancyFeeQuantity(request.body, request.session.user);
|
||||||
const lotOccupancyFees = await getLotOccupancyFees(request.body.lotOccupancyId);
|
const lotOccupancyFees = await getLotOccupancyFees(request.body.lotOccupancyId);
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,21 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import getLotOccupancyFees from '../../database/getLotOccupancyFees.js'
|
import getLotOccupancyFees from '../../database/getLotOccupancyFees.js'
|
||||||
import { updateLotOccupancyFeeQuantity } from '../../database/updateLotOccupancyFeeQuantity.js'
|
import updateLotOccupancyFeeQuantity, {
|
||||||
|
type UpdateLotOccupancyFeeQuantityForm
|
||||||
|
} from '../../database/updateLotOccupancyFeeQuantity.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success = await updateLotOccupancyFeeQuantity(
|
const success = await updateLotOccupancyFeeQuantity(
|
||||||
request.body,
|
request.body as UpdateLotOccupancyFeeQuantityForm,
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
const lotOccupancyFees = await getLotOccupancyFees(
|
const lotOccupancyFees = await getLotOccupancyFees(
|
||||||
request.body.lotOccupancyId
|
request.body.lotOccupancyId as string
|
||||||
)
|
)
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import getLotOccupancyOccupants from '../../database/getLotOccupancyOccupants.js';
|
import getLotOccupancyOccupants from '../../database/getLotOccupancyOccupants.js';
|
||||||
import { updateLotOccupancyOccupant } from '../../database/updateLotOccupancyOccupant.js';
|
import updateLotOccupancyOccupant from '../../database/updateLotOccupancyOccupant.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await updateLotOccupancyOccupant(request.body, request.session.user);
|
const success = await updateLotOccupancyOccupant(request.body, request.session.user);
|
||||||
const lotOccupancyOccupants = await getLotOccupancyOccupants(request.body.lotOccupancyId);
|
const lotOccupancyOccupants = await getLotOccupancyOccupants(request.body.lotOccupancyId);
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,21 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import getLotOccupancyOccupants from '../../database/getLotOccupancyOccupants.js'
|
import getLotOccupancyOccupants from '../../database/getLotOccupancyOccupants.js'
|
||||||
import { updateLotOccupancyOccupant } from '../../database/updateLotOccupancyOccupant.js'
|
import updateLotOccupancyOccupant, {
|
||||||
|
type UpdateLotOccupancyOccupantForm
|
||||||
|
} from '../../database/updateLotOccupancyOccupant.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success = await updateLotOccupancyOccupant(
|
const success = await updateLotOccupancyOccupant(
|
||||||
request.body,
|
request.body as UpdateLotOccupancyOccupantForm,
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
const lotOccupancyOccupants = await getLotOccupancyOccupants(
|
const lotOccupancyOccupants = await getLotOccupancyOccupants(
|
||||||
request.body.lotOccupancyId
|
request.body.lotOccupancyId as string
|
||||||
)
|
)
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import getLotOccupancyTransactions from '../../database/getLotOccupancyTransactions.js';
|
import getLotOccupancyTransactions from '../../database/getLotOccupancyTransactions.js';
|
||||||
import { updateLotOccupancyTransaction } from '../../database/updateLotOccupancyTransaction.js';
|
import updateLotOccupancyTransaction from '../../database/updateLotOccupancyTransaction.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
await updateLotOccupancyTransaction(request.body, request.session.user);
|
await updateLotOccupancyTransaction(request.body, request.session.user);
|
||||||
const lotOccupancyTransactions = await getLotOccupancyTransactions(request.body.lotOccupancyId, { includeIntegrations: true });
|
const lotOccupancyTransactions = await getLotOccupancyTransactions(request.body.lotOccupancyId, { includeIntegrations: true });
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,21 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import getLotOccupancyTransactions from '../../database/getLotOccupancyTransactions.js'
|
import getLotOccupancyTransactions from '../../database/getLotOccupancyTransactions.js'
|
||||||
import { updateLotOccupancyTransaction } from '../../database/updateLotOccupancyTransaction.js'
|
import updateLotOccupancyTransaction, {
|
||||||
|
type UpdateLotOccupancyTransactionForm
|
||||||
|
} from '../../database/updateLotOccupancyTransaction.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
await updateLotOccupancyTransaction(
|
await updateLotOccupancyTransaction(
|
||||||
request.body,
|
request.body as UpdateLotOccupancyTransactionForm,
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
const lotOccupancyTransactions = await getLotOccupancyTransactions(
|
const lotOccupancyTransactions = await getLotOccupancyTransactions(
|
||||||
request.body.lotOccupancyId,
|
request.body.lotOccupancyId as string,
|
||||||
{ includeIntegrations: true }
|
{ includeIntegrations: true }
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
|
import updateLot from '../../database/updateLot.js';
|
||||||
import { clearNextPreviousLotIdCache } from '../../helpers/functions.lots.js';
|
import { clearNextPreviousLotIdCache } from '../../helpers/functions.lots.js';
|
||||||
import { updateLot } from '../../database/updateLot.js';
|
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const lotId = Number.parseInt(request.body.lotId, 10);
|
const lotId = Number.parseInt(request.body.lotId, 10);
|
||||||
const success = await updateLot(request.body, request.session.user);
|
const success = await updateLot(request.body, request.session.user);
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,25 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
|
import updateLot, { type UpdateLotForm } from '../../database/updateLot.js'
|
||||||
import { clearNextPreviousLotIdCache } from '../../helpers/functions.lots.js'
|
import { clearNextPreviousLotIdCache } from '../../helpers/functions.lots.js'
|
||||||
import { updateLot } from '../../database/updateLot.js'
|
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const lotId = Number.parseInt(request.body.lotId, 10)
|
const lotId = Number.parseInt(request.body.lotId as string, 10)
|
||||||
|
|
||||||
const success = await updateLot(request.body, request.session.user as User)
|
const success = await updateLot(
|
||||||
|
request.body as UpdateLotForm,
|
||||||
|
request.session.user as User
|
||||||
|
)
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
lotId: request.body.lotId
|
lotId: request.body.lotId as string
|
||||||
})
|
})
|
||||||
|
|
||||||
response.on('finish', () => {
|
response.on('finish', () => {
|
||||||
clearNextPreviousLotIdCache(lotId)
|
clearNextPreviousLotIdCache(lotId)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import getLotComments from '../../database/getLotComments.js';
|
import getLotComments from '../../database/getLotComments.js';
|
||||||
import { updateLotComment } from '../../database/updateLotComment.js';
|
import updateLotComment from '../../database/updateLotComment.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await updateLotComment(request.body, request.session.user);
|
const success = await updateLotComment(request.body, request.session.user);
|
||||||
const lotComments = await getLotComments(request.body.lotId);
|
const lotComments = await getLotComments(request.body.lotId);
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,16 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import getLotComments from '../../database/getLotComments.js'
|
import getLotComments from '../../database/getLotComments.js'
|
||||||
import { updateLotComment } from '../../database/updateLotComment.js'
|
import updateLotComment, {
|
||||||
|
type UpdateLotCommentForm
|
||||||
|
} from '../../database/updateLotComment.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success = await updateLotComment(
|
const success = await updateLotComment(
|
||||||
request.body,
|
request.body as UpdateLotCommentForm,
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { updateMap } from '../../database/updateMap.js';
|
import updateMap from '../../database/updateMap.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await updateMap(request.body, request.session.user);
|
const success = await updateMap(request.body, request.session.user);
|
||||||
response.json({
|
response.json({
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,18 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import { updateMap } from '../../database/updateMap.js'
|
import updateMap, { type UpdateMapForm } from '../../database/updateMap.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success = await updateMap(request.body, request.session.user as User)
|
const success = await updateMap(
|
||||||
|
request.body as UpdateMapForm,
|
||||||
|
request.session.user as User
|
||||||
|
)
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
mapId: request.body.mapId
|
mapId: request.body.mapId as string
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { reopenWorkOrder } from '../../database/reopenWorkOrder.js';
|
import reopenWorkOrder from '../../database/reopenWorkOrder.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await reopenWorkOrder(request.body.workOrderId, request.session.user);
|
const success = await reopenWorkOrder(request.body.workOrderId, request.session.user);
|
||||||
response.json({
|
response.json({
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,18 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import { reopenWorkOrder } from '../../database/reopenWorkOrder.js'
|
import reopenWorkOrder from '../../database/reopenWorkOrder.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success = await reopenWorkOrder(request.body.workOrderId, request.session.user as User)
|
const success = await reopenWorkOrder(
|
||||||
|
request.body.workOrderId as string,
|
||||||
|
request.session.user as User
|
||||||
|
)
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
workOrderId: request.body.workOrderId
|
workOrderId: request.body.workOrderId as string
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import getWorkOrderMilestones from '../../database/getWorkOrderMilestones.js';
|
import getWorkOrderMilestones from '../../database/getWorkOrderMilestones.js';
|
||||||
import { reopenWorkOrderMilestone } from '../../database/reopenWorkOrderMilestone.js';
|
import reopenWorkOrderMilestone from '../../database/reopenWorkOrderMilestone.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await reopenWorkOrderMilestone(request.body.workOrderMilestoneId, request.session.user);
|
const success = await reopenWorkOrderMilestone(request.body.workOrderMilestoneId, request.session.user);
|
||||||
const workOrderMilestones = await getWorkOrderMilestones({
|
const workOrderMilestones = await getWorkOrderMilestones({
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import getWorkOrderMilestones from '../../database/getWorkOrderMilestones.js'
|
import getWorkOrderMilestones from '../../database/getWorkOrderMilestones.js'
|
||||||
import { reopenWorkOrderMilestone } from '../../database/reopenWorkOrderMilestone.js'
|
import reopenWorkOrderMilestone from '../../database/reopenWorkOrderMilestone.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
|
|
@ -14,7 +14,7 @@ export default async function handler(
|
||||||
|
|
||||||
const workOrderMilestones = await getWorkOrderMilestones(
|
const workOrderMilestones = await getWorkOrderMilestones(
|
||||||
{
|
{
|
||||||
workOrderId: request.body.workOrderId
|
workOrderId: request.body.workOrderId as string
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
orderBy: 'completion'
|
orderBy: 'completion'
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,15 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import { getWorkOrders } from '../../database/getWorkOrders.js'
|
import {
|
||||||
|
type GetWorkOrdersFilters,
|
||||||
|
getWorkOrders
|
||||||
|
} from '../../database/getWorkOrders.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const result = await getWorkOrders(request.body, {
|
const result = await getWorkOrders(request.body as GetWorkOrdersFilters, {
|
||||||
limit: request.body.limit,
|
limit: request.body.limit,
|
||||||
offset: request.body.offset,
|
offset: request.body.offset,
|
||||||
includeLotsAndLotOccupancies: true
|
includeLotsAndLotOccupancies: true
|
||||||
|
|
@ -18,4 +21,3 @@ export default async function handler(
|
||||||
workOrders: result.workOrders
|
workOrders: result.workOrders
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { updateWorkOrder } from '../../database/updateWorkOrder.js';
|
import updateWorkOrder from '../../database/updateWorkOrder.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await updateWorkOrder(request.body, request.session.user);
|
const success = await updateWorkOrder(request.body, request.session.user);
|
||||||
response.json({
|
response.json({
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,20 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import { updateWorkOrder } from '../../database/updateWorkOrder.js'
|
import updateWorkOrder, {
|
||||||
|
type UpdateWorkOrderForm
|
||||||
|
} from '../../database/updateWorkOrder.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
response: Response
|
response: Response
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const success = await updateWorkOrder(
|
const success = await updateWorkOrder(
|
||||||
request.body,
|
request.body as UpdateWorkOrderForm,
|
||||||
request.session.user as User
|
request.session.user as User
|
||||||
)
|
)
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
success,
|
success,
|
||||||
workOrderId: request.body.workOrderId
|
workOrderId: request.body.workOrderId as string
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import getWorkOrderComments from '../../database/getWorkOrderComments.js';
|
import getWorkOrderComments from '../../database/getWorkOrderComments.js';
|
||||||
import { updateWorkOrderComment } from '../../database/updateWorkOrderComment.js';
|
import updateWorkOrderComment from '../../database/updateWorkOrderComment.js';
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const success = await updateWorkOrderComment(request.body, request.session.user);
|
const success = await updateWorkOrderComment(request.body, request.session.user);
|
||||||
const workOrderComments = await getWorkOrderComments(request.body.workOrderId);
|
const workOrderComments = await getWorkOrderComments(request.body.workOrderId);
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
import type { Request, Response } from 'express'
|
import type { Request, Response } from 'express'
|
||||||
|
|
||||||
import getWorkOrderComments from '../../database/getWorkOrderComments.js'
|
import getWorkOrderComments from '../../database/getWorkOrderComments.js'
|
||||||
import {
|
import updateWorkOrderComment, {
|
||||||
type UpdateWorkOrderCommentForm,
|
type UpdateWorkOrderCommentForm
|
||||||
updateWorkOrderComment
|
|
||||||
} from '../../database/updateWorkOrderComment.js'
|
} from '../../database/updateWorkOrderComment.js'
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue