linting import

pull/11/head
Dan Gowans 2025-04-23 10:30:44 -04:00
parent 31837d4370
commit 9e6da86d80
5 changed files with 299 additions and 149 deletions

View File

@ -1,5 +1,5 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair // eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable @cspell/spellchecker, @typescript-eslint/no-non-null-assertion, no-console, max-lines, perfectionist/sort-interfaces */ /* eslint-disable @cspell/spellchecker, @typescript-eslint/no-non-null-assertion, no-console, max-lines */
import fs from 'node:fs'; import fs from 'node:fs';
import { dateIntegerToString, dateToString } from '@cityssm/utils-datetime'; import { dateIntegerToString, dateToString } from '@cityssm/utils-datetime';
import sqlite from 'better-sqlite3'; import sqlite from 'better-sqlite3';
@ -598,8 +598,8 @@ async function importFromWorkOrderCSV() {
}, user); }, user);
burialSite = await getBurialSite(burialSiteId); burialSite = await getBurialSite(burialSiteId);
} }
const workOrderContainsLot = workOrder?.workOrderBurialSites?.find((possibleLot) => possibleLot.burialSiteId === burialSite?.burialSiteId); const workOrderContainsBurialSite = workOrder?.workOrderBurialSites?.find((possibleLot) => possibleLot.burialSiteId === burialSite?.burialSiteId);
if (!workOrderContainsLot) { if (!workOrderContainsBurialSite) {
await addWorkOrderBurialSite({ await addWorkOrderBurialSite({
workOrderId: workOrder.workOrderId, workOrderId: workOrder.workOrderId,
burialSiteId: burialSite.burialSiteId burialSiteId: burialSite.burialSiteId

View File

@ -1,5 +1,5 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair // eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable @cspell/spellchecker, @typescript-eslint/no-non-null-assertion, no-console, max-lines, perfectionist/sort-interfaces */ /* eslint-disable @cspell/spellchecker, @typescript-eslint/no-non-null-assertion, no-console, max-lines */
import fs from 'node:fs' import fs from 'node:fs'
@ -46,149 +46,11 @@ import {
} from './data.funeralHomes.js' } from './data.funeralHomes.js'
import * as importIds from './data.ids.js' import * as importIds from './data.ids.js'
import { getIntermentContainerTypeIdByKey } from './data.intermentContainerTypes.js' import { getIntermentContainerTypeIdByKey } from './data.intermentContainerTypes.js'
import type {
interface MasterRecord { MasterRecord,
CM_SYSREC: string PrepaidRecord,
CM_CEMETERY: string WorkOrderRecord
CM_BLOCK: string } from './recordTypes.js'
CM_RANGE1: string
CM_RANGE2: string
CM_LOT1: string
CM_LOT2: string
CM_GRAVE1: string
CM_GRAVE2: string
CM_INTERMENT: string
CM_PRENEED_OWNER: string
CM_PRENEED_OWNER_SEQ: string
CM_DECEASED_NAME: string
CM_DECEASED_NAME_SEQ: string
CM_ADDRESS: string
CM_CITY: string
CM_PROV: string
CM_POST1: string
CM_POST2: string
CM_PRENEED_ORDER: string
CM_PURCHASE_YR: string
CM_PURCHASE_MON: string
CM_PURCHASE_DAY: string
CM_NO_GRAVES: string
CM_DEATH_YR: string
CM_DEATH_MON: string
CM_DEATH_DAY: string
CM_WORK_ORDER: string
CM_INTERMENT_YR: string
CM_INTERMENT_MON: string
CM_INTERMENT_DAY: string
CM_AGE: string
CM_CONTAINER_TYPE: string
CM_COMMITTAL_TYPE: string
CM_CREMATION: string
CM_FUNERAL_HOME: string
CM_FUNERAL_YR: string
CM_FUNERAL_MON: string
CM_FUNERAL_DAY: string
CM_RESIDENT_TYPE: string
CM_REMARK1: string
CM_REMARK2: string
CM_STATUS: string
CM_PERIOD: string
CM_LAST_CHG_DATE: string
CM_DEPTH: string
}
interface PrepaidRecord {
CMPP_SYSREC: string
CMPP_PREPAID_FOR_NAME: string
CMPP_PREPAID_FOR_SEQ: string
CMPP_ADDRESS: string
CMPP_CITY: string
CMPP_PROV: string
CMPP_POSTAL1: string
CMPP_POSTAL2: string
CMPP_ARRANGED_BY_NAME: string
CMPP_ARRANGED_BY_SEQ: string
CMPP_CEMETERY: string
CMPP_BLOCK: string
CMPP_RANGE1: string
CMPP_RANGE2: string
CMPP_LOT1: string
CMPP_LOT2: string
CMPP_GRAVE1: string
CMPP_GRAVE2: string
CMPP_INTERMENT: string
CMPP_ORDER_NO: string
CMPP_PURCH_YR: string
CMPP_PURCH_MON: string
CMPP_PURCH_DAY: string
CMPP_FEE_GRAV_SD: string
CMPP_GST_GRAV_SD: string
CMPP_FEE_GRAV_DD: string
CMPP_GST_GRAV_DD: string
CMPP_FEE_CHAP_SD: string
CMPP_GST_CHAP_SD: string
CMPP_FEE_CHAP_DD: string
CMPP_GST_CHAP_DD: string
CMPP_FEE_ENTOMBMENT: string
CMPP_GST_ENTOMBMENT: string
CMPP_FEE_CREM: string
CMPP_GST_CREM: string
CMPP_FEE_NICHE: string
CMPP_GST_NICHE: string
CMPP_FEE_DISINTERMENT: string
CMPP_GST_DISINTERMENT: string
CMPP_REMARK1: string
CMPP_REMARK2: string
}
interface WorkOrderRecord {
WO_SYSREC: string
WO_DECEASED_NAME: string
WO_DECEASED_SEQ: string
WO_CEMETERY: string
WO_BLOCK: string
WO_RANGE1: string
WO_RANGE2: string
WO_LOT1: string
WO_LOT2: string
WO_GRAVE1: string
WO_GRAVE2: string
WO_INTERMENT: string
WO_ADDRESS: string
WO_CITY: string
WO_PROV: string
WO_POST1: string
WO_POST2: string
WO_DEATH_YR: string
WO_DEATH_MON: string
WO_DEATH_DAY: string
WO_AGE: string
WO_FUNERAL_HOME: string
WO_FUNERAL_YR: string
WO_FUNERAL_MON: string
WO_FUNERAL_DAY: string
WO_FUNERAL_HR: string
WO_FUNERAL_MIN: string
WO_INTERMENT_YR: string
WO_INTERMENT_MON: string
WO_INTERMENT_DAY: string
WO_COST: string
WO_COMMITTAL_TYPE: string
WO_CONTAINER_TYPE: string
WO_CREMATION: string
WO_CONFIRMATION_IN: string
WO_COMPLETION_YR: string
WO_COMPLETION_MON: string
WO_COMPLETION_DAY: string
WO_INITIATION_DATE: string
WO_WORK_ORDER: string
WO_REMARK1: string
WO_REMARK2: string
WO_REMARK3: string
WO_PERIOD: string
WO_RESIDENT_TYPE: string
WO_DEPTH: string
WO_DEATH_PLACE: string
}
const user: User = { const user: User = {
userName: 'import.unix', userName: 'import.unix',
@ -1079,11 +941,11 @@ async function importFromWorkOrderCSV(): Promise<void> {
burialSite = await getBurialSite(burialSiteId) burialSite = await getBurialSite(burialSiteId)
} }
const workOrderContainsLot = workOrder?.workOrderBurialSites?.find( const workOrderContainsBurialSite = workOrder?.workOrderBurialSites?.find(
(possibleLot) => possibleLot.burialSiteId === burialSite?.burialSiteId (possibleLot) => possibleLot.burialSiteId === burialSite?.burialSiteId
) )
if (!workOrderContainsLot) { if (!workOrderContainsBurialSite) {
await addWorkOrderBurialSite( await addWorkOrderBurialSite(
{ {
workOrderId: workOrder.workOrderId!, workOrderId: workOrder.workOrderId!,

View File

@ -0,0 +1,140 @@
export interface MasterRecord {
CM_SYSREC: string;
CM_CEMETERY: string;
CM_BLOCK: string;
CM_RANGE1: string;
CM_RANGE2: string;
CM_LOT1: string;
CM_LOT2: string;
CM_GRAVE1: string;
CM_GRAVE2: string;
CM_INTERMENT: string;
CM_PRENEED_OWNER: string;
CM_PRENEED_OWNER_SEQ: string;
CM_DECEASED_NAME: string;
CM_DECEASED_NAME_SEQ: string;
CM_ADDRESS: string;
CM_CITY: string;
CM_PROV: string;
CM_POST1: string;
CM_POST2: string;
CM_PRENEED_ORDER: string;
CM_PURCHASE_YR: string;
CM_PURCHASE_MON: string;
CM_PURCHASE_DAY: string;
CM_NO_GRAVES: string;
CM_DEATH_YR: string;
CM_DEATH_MON: string;
CM_DEATH_DAY: string;
CM_WORK_ORDER: string;
CM_INTERMENT_YR: string;
CM_INTERMENT_MON: string;
CM_INTERMENT_DAY: string;
CM_AGE: string;
CM_CONTAINER_TYPE: string;
CM_COMMITTAL_TYPE: string;
CM_CREMATION: string;
CM_FUNERAL_HOME: string;
CM_FUNERAL_YR: string;
CM_FUNERAL_MON: string;
CM_FUNERAL_DAY: string;
CM_RESIDENT_TYPE: string;
CM_REMARK1: string;
CM_REMARK2: string;
CM_STATUS: string;
CM_PERIOD: string;
CM_LAST_CHG_DATE: string;
CM_DEPTH: string;
}
export interface PrepaidRecord {
CMPP_SYSREC: string;
CMPP_PREPAID_FOR_NAME: string;
CMPP_PREPAID_FOR_SEQ: string;
CMPP_ADDRESS: string;
CMPP_CITY: string;
CMPP_PROV: string;
CMPP_POSTAL1: string;
CMPP_POSTAL2: string;
CMPP_ARRANGED_BY_NAME: string;
CMPP_ARRANGED_BY_SEQ: string;
CMPP_CEMETERY: string;
CMPP_BLOCK: string;
CMPP_RANGE1: string;
CMPP_RANGE2: string;
CMPP_LOT1: string;
CMPP_LOT2: string;
CMPP_GRAVE1: string;
CMPP_GRAVE2: string;
CMPP_INTERMENT: string;
CMPP_ORDER_NO: string;
CMPP_PURCH_YR: string;
CMPP_PURCH_MON: string;
CMPP_PURCH_DAY: string;
CMPP_FEE_GRAV_SD: string;
CMPP_GST_GRAV_SD: string;
CMPP_FEE_GRAV_DD: string;
CMPP_GST_GRAV_DD: string;
CMPP_FEE_CHAP_SD: string;
CMPP_GST_CHAP_SD: string;
CMPP_FEE_CHAP_DD: string;
CMPP_GST_CHAP_DD: string;
CMPP_FEE_ENTOMBMENT: string;
CMPP_GST_ENTOMBMENT: string;
CMPP_FEE_CREM: string;
CMPP_GST_CREM: string;
CMPP_FEE_NICHE: string;
CMPP_GST_NICHE: string;
CMPP_FEE_DISINTERMENT: string;
CMPP_GST_DISINTERMENT: string;
CMPP_REMARK1: string;
CMPP_REMARK2: string;
}
export interface WorkOrderRecord {
WO_SYSREC: string;
WO_DECEASED_NAME: string;
WO_DECEASED_SEQ: string;
WO_CEMETERY: string;
WO_BLOCK: string;
WO_RANGE1: string;
WO_RANGE2: string;
WO_LOT1: string;
WO_LOT2: string;
WO_GRAVE1: string;
WO_GRAVE2: string;
WO_INTERMENT: string;
WO_ADDRESS: string;
WO_CITY: string;
WO_PROV: string;
WO_POST1: string;
WO_POST2: string;
WO_DEATH_YR: string;
WO_DEATH_MON: string;
WO_DEATH_DAY: string;
WO_AGE: string;
WO_FUNERAL_HOME: string;
WO_FUNERAL_YR: string;
WO_FUNERAL_MON: string;
WO_FUNERAL_DAY: string;
WO_FUNERAL_HR: string;
WO_FUNERAL_MIN: string;
WO_INTERMENT_YR: string;
WO_INTERMENT_MON: string;
WO_INTERMENT_DAY: string;
WO_COST: string;
WO_COMMITTAL_TYPE: string;
WO_CONTAINER_TYPE: string;
WO_CREMATION: string;
WO_CONFIRMATION_IN: string;
WO_COMPLETION_YR: string;
WO_COMPLETION_MON: string;
WO_COMPLETION_DAY: string;
WO_INITIATION_DATE: string;
WO_WORK_ORDER: string;
WO_REMARK1: string;
WO_REMARK2: string;
WO_REMARK3: string;
WO_PERIOD: string;
WO_RESIDENT_TYPE: string;
WO_DEPTH: string;
WO_DEATH_PLACE: string;
}

View File

@ -0,0 +1,3 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable @cspell/spellchecker, perfectionist/sort-interfaces */
export {};

View File

@ -0,0 +1,145 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable @cspell/spellchecker, perfectionist/sort-interfaces */
export interface MasterRecord {
CM_SYSREC: string
CM_CEMETERY: string
CM_BLOCK: string
CM_RANGE1: string
CM_RANGE2: string
CM_LOT1: string
CM_LOT2: string
CM_GRAVE1: string
CM_GRAVE2: string
CM_INTERMENT: string
CM_PRENEED_OWNER: string
CM_PRENEED_OWNER_SEQ: string
CM_DECEASED_NAME: string
CM_DECEASED_NAME_SEQ: string
CM_ADDRESS: string
CM_CITY: string
CM_PROV: string
CM_POST1: string
CM_POST2: string
CM_PRENEED_ORDER: string
CM_PURCHASE_YR: string
CM_PURCHASE_MON: string
CM_PURCHASE_DAY: string
CM_NO_GRAVES: string
CM_DEATH_YR: string
CM_DEATH_MON: string
CM_DEATH_DAY: string
CM_WORK_ORDER: string
CM_INTERMENT_YR: string
CM_INTERMENT_MON: string
CM_INTERMENT_DAY: string
CM_AGE: string
CM_CONTAINER_TYPE: string
CM_COMMITTAL_TYPE: string
CM_CREMATION: string
CM_FUNERAL_HOME: string
CM_FUNERAL_YR: string
CM_FUNERAL_MON: string
CM_FUNERAL_DAY: string
CM_RESIDENT_TYPE: string
CM_REMARK1: string
CM_REMARK2: string
CM_STATUS: string
CM_PERIOD: string
CM_LAST_CHG_DATE: string
CM_DEPTH: string
}
export interface PrepaidRecord {
CMPP_SYSREC: string
CMPP_PREPAID_FOR_NAME: string
CMPP_PREPAID_FOR_SEQ: string
CMPP_ADDRESS: string
CMPP_CITY: string
CMPP_PROV: string
CMPP_POSTAL1: string
CMPP_POSTAL2: string
CMPP_ARRANGED_BY_NAME: string
CMPP_ARRANGED_BY_SEQ: string
CMPP_CEMETERY: string
CMPP_BLOCK: string
CMPP_RANGE1: string
CMPP_RANGE2: string
CMPP_LOT1: string
CMPP_LOT2: string
CMPP_GRAVE1: string
CMPP_GRAVE2: string
CMPP_INTERMENT: string
CMPP_ORDER_NO: string
CMPP_PURCH_YR: string
CMPP_PURCH_MON: string
CMPP_PURCH_DAY: string
CMPP_FEE_GRAV_SD: string
CMPP_GST_GRAV_SD: string
CMPP_FEE_GRAV_DD: string
CMPP_GST_GRAV_DD: string
CMPP_FEE_CHAP_SD: string
CMPP_GST_CHAP_SD: string
CMPP_FEE_CHAP_DD: string
CMPP_GST_CHAP_DD: string
CMPP_FEE_ENTOMBMENT: string
CMPP_GST_ENTOMBMENT: string
CMPP_FEE_CREM: string
CMPP_GST_CREM: string
CMPP_FEE_NICHE: string
CMPP_GST_NICHE: string
CMPP_FEE_DISINTERMENT: string
CMPP_GST_DISINTERMENT: string
CMPP_REMARK1: string
CMPP_REMARK2: string
}
export interface WorkOrderRecord {
WO_SYSREC: string
WO_DECEASED_NAME: string
WO_DECEASED_SEQ: string
WO_CEMETERY: string
WO_BLOCK: string
WO_RANGE1: string
WO_RANGE2: string
WO_LOT1: string
WO_LOT2: string
WO_GRAVE1: string
WO_GRAVE2: string
WO_INTERMENT: string
WO_ADDRESS: string
WO_CITY: string
WO_PROV: string
WO_POST1: string
WO_POST2: string
WO_DEATH_YR: string
WO_DEATH_MON: string
WO_DEATH_DAY: string
WO_AGE: string
WO_FUNERAL_HOME: string
WO_FUNERAL_YR: string
WO_FUNERAL_MON: string
WO_FUNERAL_DAY: string
WO_FUNERAL_HR: string
WO_FUNERAL_MIN: string
WO_INTERMENT_YR: string
WO_INTERMENT_MON: string
WO_INTERMENT_DAY: string
WO_COST: string
WO_COMMITTAL_TYPE: string
WO_CONTAINER_TYPE: string
WO_CREMATION: string
WO_CONFIRMATION_IN: string
WO_COMPLETION_YR: string
WO_COMPLETION_MON: string
WO_COMPLETION_DAY: string
WO_INITIATION_DATE: string
WO_WORK_ORDER: string
WO_REMARK1: string
WO_REMARK2: string
WO_REMARK3: string
WO_PERIOD: string
WO_RESIDENT_TYPE: string
WO_DEPTH: string
WO_DEATH_PLACE: string
}