add cremation occupancy type
parent
345dfc8299
commit
37f10ed88b
|
|
@ -82,6 +82,10 @@ const initializeCemeteryDatabase = () => {
|
||||||
occupancyType: "Interment",
|
occupancyType: "Interment",
|
||||||
orderNumber: 2
|
orderNumber: 2
|
||||||
}, session);
|
}, session);
|
||||||
|
addOccupancyType({
|
||||||
|
occupancyType: "Cremation",
|
||||||
|
orderNumber: 3
|
||||||
|
}, session);
|
||||||
addOccupancyTypeField({
|
addOccupancyTypeField({
|
||||||
occupancyTypeId: intermentOccupancyTypeId,
|
occupancyTypeId: intermentOccupancyTypeId,
|
||||||
occupancyTypeField: "Death Date",
|
occupancyTypeField: "Death Date",
|
||||||
|
|
|
||||||
|
|
@ -153,6 +153,11 @@ const initializeCemeteryDatabase = () => {
|
||||||
orderNumber: 2
|
orderNumber: 2
|
||||||
}, session);
|
}, session);
|
||||||
|
|
||||||
|
addOccupancyType({
|
||||||
|
occupancyType: "Cremation",
|
||||||
|
orderNumber: 3
|
||||||
|
}, session);
|
||||||
|
|
||||||
addOccupancyTypeField({
|
addOccupancyTypeField({
|
||||||
occupancyTypeId: intermentOccupancyTypeId,
|
occupancyTypeId: intermentOccupancyTypeId,
|
||||||
occupancyTypeField: "Death Date",
|
occupancyTypeField: "Death Date",
|
||||||
|
|
|
||||||
|
|
@ -160,6 +160,7 @@ const reservedLotStatus = cacheFunctions.getLotStatusByLotStatus("Reserved");
|
||||||
const takenLotStatus = cacheFunctions.getLotStatusByLotStatus("Taken");
|
const takenLotStatus = cacheFunctions.getLotStatusByLotStatus("Taken");
|
||||||
const preneedOccupancyType = cacheFunctions.getOccupancyTypeByOccupancyType("Preneed");
|
const preneedOccupancyType = cacheFunctions.getOccupancyTypeByOccupancyType("Preneed");
|
||||||
const deceasedOccupancyType = cacheFunctions.getOccupancyTypeByOccupancyType("Interment");
|
const deceasedOccupancyType = cacheFunctions.getOccupancyTypeByOccupancyType("Interment");
|
||||||
|
const cremationOccupancyType = cacheFunctions.getOccupancyTypeByOccupancyType("Cremation");
|
||||||
const preneedOwnerLotOccupantType = cacheFunctions.getLotOccupantTypesByLotOccupantType("Preneed Owner");
|
const preneedOwnerLotOccupantType = cacheFunctions.getLotOccupantTypesByLotOccupantType("Preneed Owner");
|
||||||
const deceasedLotOccupantType = cacheFunctions.getLotOccupantTypesByLotOccupantType("Deceased");
|
const deceasedLotOccupantType = cacheFunctions.getLotOccupantTypesByLotOccupantType("Deceased");
|
||||||
const arrangerLotOccupantType = cacheFunctions.getLotOccupantTypesByLotOccupantType("Arranger");
|
const arrangerLotOccupantType = cacheFunctions.getLotOccupantTypesByLotOccupantType("Arranger");
|
||||||
|
|
@ -193,7 +194,9 @@ function importFromMasterCSV() {
|
||||||
const lotType = getLotType({
|
const lotType = getLotType({
|
||||||
cemetery: masterRow.CM_CEMETERY
|
cemetery: masterRow.CM_CEMETERY
|
||||||
});
|
});
|
||||||
const lotId = addLot({
|
let lotId;
|
||||||
|
if (masterRow.CM_CEMETERY !== "00") {
|
||||||
|
lotId = addLot({
|
||||||
lotName: lotName,
|
lotName: lotName,
|
||||||
lotTypeId: lotType.lotTypeId,
|
lotTypeId: lotType.lotTypeId,
|
||||||
lotStatusId: availableLotStatus.lotStatusId,
|
lotStatusId: availableLotStatus.lotStatusId,
|
||||||
|
|
@ -202,6 +205,7 @@ function importFromMasterCSV() {
|
||||||
lotLatitude: "",
|
lotLatitude: "",
|
||||||
lotLongitude: ""
|
lotLongitude: ""
|
||||||
}, user);
|
}, user);
|
||||||
|
}
|
||||||
if (masterRow.CM_PRENEED_ORDER) {
|
if (masterRow.CM_PRENEED_ORDER) {
|
||||||
let occupancyStartDateString = formatDateString(masterRow.CM_PURCHASE_YR, masterRow.CM_PURCHASE_MON, masterRow.CM_PURCHASE_DAY);
|
let occupancyStartDateString = formatDateString(masterRow.CM_PURCHASE_YR, masterRow.CM_PURCHASE_MON, masterRow.CM_PURCHASE_DAY);
|
||||||
let occupancyEndDateString = "";
|
let occupancyEndDateString = "";
|
||||||
|
|
@ -266,7 +270,7 @@ function importFromMasterCSV() {
|
||||||
occupancyStartDateString = "0001-01-01";
|
occupancyStartDateString = "0001-01-01";
|
||||||
}
|
}
|
||||||
const lotOccupancyId = addLotOccupancy({
|
const lotOccupancyId = addLotOccupancy({
|
||||||
occupancyTypeId: deceasedOccupancyType.occupancyTypeId,
|
occupancyTypeId: lotId ? deceasedOccupancyType.occupancyTypeId : cremationOccupancyType.occupancyTypeId,
|
||||||
lotId,
|
lotId,
|
||||||
occupancyStartDateString,
|
occupancyStartDateString,
|
||||||
occupancyEndDateString,
|
occupancyEndDateString,
|
||||||
|
|
@ -394,13 +398,17 @@ function importFromPrepaidCSV() {
|
||||||
if (!prepaidRow.CMPP_PREPAID_FOR_NAME) {
|
if (!prepaidRow.CMPP_PREPAID_FOR_NAME) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
let cemetery = prepaidRow.CMPP_CEMETERY;
|
||||||
|
if (cemetery && cemetery === ".m") {
|
||||||
|
cemetery = "HC";
|
||||||
|
}
|
||||||
let lot;
|
let lot;
|
||||||
if (prepaidRow.CMPP_CEMETERY) {
|
if (cemetery) {
|
||||||
const map = getMap({
|
const map = getMap({
|
||||||
cemetery: prepaidRow.CMPP_CEMETERY
|
cemetery
|
||||||
});
|
});
|
||||||
const lotName = buildLotName({
|
const lotName = buildLotName({
|
||||||
cemetery: prepaidRow.CMPP_CEMETERY,
|
cemetery,
|
||||||
block: prepaidRow.CMPP_BLOCK,
|
block: prepaidRow.CMPP_BLOCK,
|
||||||
range1: prepaidRow.CMPP_RANGE1,
|
range1: prepaidRow.CMPP_RANGE1,
|
||||||
range2: prepaidRow.CMPP_RANGE2,
|
range2: prepaidRow.CMPP_RANGE2,
|
||||||
|
|
@ -419,7 +427,7 @@ function importFromPrepaidCSV() {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const lotType = getLotType({
|
const lotType = getLotType({
|
||||||
cemetery: prepaidRow.CMPP_CEMETERY
|
cemetery
|
||||||
});
|
});
|
||||||
const lotId = addLot({
|
const lotId = addLot({
|
||||||
lotName: lotName,
|
lotName: lotName,
|
||||||
|
|
|
||||||
|
|
@ -373,6 +373,7 @@ const takenLotStatus = cacheFunctions.getLotStatusByLotStatus("Taken");
|
||||||
|
|
||||||
const preneedOccupancyType = cacheFunctions.getOccupancyTypeByOccupancyType("Preneed");
|
const preneedOccupancyType = cacheFunctions.getOccupancyTypeByOccupancyType("Preneed");
|
||||||
const deceasedOccupancyType = cacheFunctions.getOccupancyTypeByOccupancyType("Interment");
|
const deceasedOccupancyType = cacheFunctions.getOccupancyTypeByOccupancyType("Interment");
|
||||||
|
const cremationOccupancyType = cacheFunctions.getOccupancyTypeByOccupancyType("Cremation");
|
||||||
|
|
||||||
const preneedOwnerLotOccupantType = cacheFunctions.getLotOccupantTypesByLotOccupantType("Preneed Owner");
|
const preneedOwnerLotOccupantType = cacheFunctions.getLotOccupantTypesByLotOccupantType("Preneed Owner");
|
||||||
const deceasedLotOccupantType = cacheFunctions.getLotOccupantTypesByLotOccupantType("Deceased");
|
const deceasedLotOccupantType = cacheFunctions.getLotOccupantTypesByLotOccupantType("Deceased");
|
||||||
|
|
@ -418,7 +419,10 @@ function importFromMasterCSV() {
|
||||||
cemetery: masterRow.CM_CEMETERY
|
cemetery: masterRow.CM_CEMETERY
|
||||||
});
|
});
|
||||||
|
|
||||||
const lotId = addLot({
|
let lotId: number;
|
||||||
|
|
||||||
|
if (masterRow.CM_CEMETERY !== "00") {
|
||||||
|
lotId = addLot({
|
||||||
lotName: lotName,
|
lotName: lotName,
|
||||||
lotTypeId: lotType.lotTypeId,
|
lotTypeId: lotType.lotTypeId,
|
||||||
lotStatusId: availableLotStatus.lotStatusId,
|
lotStatusId: availableLotStatus.lotStatusId,
|
||||||
|
|
@ -427,6 +431,7 @@ function importFromMasterCSV() {
|
||||||
lotLatitude: "",
|
lotLatitude: "",
|
||||||
lotLongitude: ""
|
lotLongitude: ""
|
||||||
}, user);
|
}, user);
|
||||||
|
}
|
||||||
|
|
||||||
if (masterRow.CM_PRENEED_ORDER) {
|
if (masterRow.CM_PRENEED_ORDER) {
|
||||||
|
|
||||||
|
|
@ -523,7 +528,7 @@ function importFromMasterCSV() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const lotOccupancyId = addLotOccupancy({
|
const lotOccupancyId = addLotOccupancy({
|
||||||
occupancyTypeId: deceasedOccupancyType.occupancyTypeId,
|
occupancyTypeId: lotId ? deceasedOccupancyType.occupancyTypeId : cremationOccupancyType.occupancyTypeId,
|
||||||
lotId,
|
lotId,
|
||||||
occupancyStartDateString,
|
occupancyStartDateString,
|
||||||
occupancyEndDateString,
|
occupancyEndDateString,
|
||||||
|
|
@ -686,16 +691,22 @@ function importFromPrepaidCSV() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let cemetery = prepaidRow.CMPP_CEMETERY;
|
||||||
|
|
||||||
|
if (cemetery && cemetery === ".m") {
|
||||||
|
cemetery = "HC"
|
||||||
|
}
|
||||||
|
|
||||||
let lot: recordTypes.Lot;
|
let lot: recordTypes.Lot;
|
||||||
|
|
||||||
if (prepaidRow.CMPP_CEMETERY) {
|
if (cemetery) {
|
||||||
|
|
||||||
const map = getMap({
|
const map = getMap({
|
||||||
cemetery: prepaidRow.CMPP_CEMETERY
|
cemetery
|
||||||
});
|
});
|
||||||
|
|
||||||
const lotName = buildLotName({
|
const lotName = buildLotName({
|
||||||
cemetery: prepaidRow.CMPP_CEMETERY,
|
cemetery,
|
||||||
block: prepaidRow.CMPP_BLOCK,
|
block: prepaidRow.CMPP_BLOCK,
|
||||||
range1: prepaidRow.CMPP_RANGE1,
|
range1: prepaidRow.CMPP_RANGE1,
|
||||||
range2: prepaidRow.CMPP_RANGE2,
|
range2: prepaidRow.CMPP_RANGE2,
|
||||||
|
|
@ -716,7 +727,7 @@ function importFromPrepaidCSV() {
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
const lotType = getLotType({
|
const lotType = getLotType({
|
||||||
cemetery: prepaidRow.CMPP_CEMETERY
|
cemetery
|
||||||
});
|
});
|
||||||
|
|
||||||
const lotId = addLot({
|
const lotId = addLot({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue