Skip to content

Commit

Permalink
Merge branch 'main' into PIMS-2000-MandatoryCheckboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
LawrenceLau2020 authored Sep 9, 2024
2 parents da5f2d1 + 92aa205 commit 02d50b5
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.

* @LawrenceLau2020 @Sharala-Perumal @dbarkowsky @TaylorFries @GrahamS-Quartech @ManishSihag
* @LawrenceLau2020 @Sharala-Perumal @dbarkowsky @TaylorFries @ManishSihag

# Order is important; the last matching pattern takes the most
# precedence. When someone opens a pull request that only
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Example: PIMS-700: A great ticket
## 🎯 Summary

<!-- EDIT JIRA LINK BELOW -->
[PIMS-###: ](https://apps.itsm.gov.bc.ca/jira/browse/PIMS-###)
[PIMS-####](https://citz-imb.atlassian.net/browse/PIMS-####)

<!-- PROVIDE BELOW an explanation of your changes -->

Expand Down
2 changes: 1 addition & 1 deletion express-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@types/jest": "29.5.10",
"@types/morgan": "1.9.9",
"@types/multer": "1.4.11",
"@types/node": "22.3.0",
"@types/node": "22.5.0",
"@types/node-cron": "3.0.11",
"@types/nunjucks": "3.2.6",
"@types/supertest": "6.0.2",
Expand Down
67 changes: 44 additions & 23 deletions express-api/src/services/properties/propertiesServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,29 +390,41 @@ const makeParcelUpsertObject = async (
currRowEvaluations.push(...evaluations);
currRowFiscals.push(...fiscals);
}
if (row.Netbook && !currRowFiscals.some((a) => a.FiscalYear == row.FiscalYear)) {
currRowFiscals.push({
// if there is a netbook and fiscal year we can add or update fiscal
if (row.Netbook && row.FiscalYear) {
const addOrUpdateFiscals: Partial<ParcelFiscal> = {
Value: row.Netbook,
FiscalKeyId: 0,
FiscalYear: row.FiscalYear,
CreatedById: user.Id,
CreatedOn: new Date(),
});
};
if (!currRowFiscals.some((a) => a.FiscalYear == row.FiscalYear)) {
addOrUpdateFiscals.CreatedById = user.Id;
} else {
addOrUpdateFiscals.UpdatedById = user.Id;
}
currRowFiscals.push(addOrUpdateFiscals);
}
if (row.Assessed && !currRowEvaluations.some((a) => a.Year == row.EvaluationYear)) {
currRowEvaluations.push({
// if there is a netbook and fiscal year we can add or update evaluation
if (row.Assessed && row.AssessedYear) {
const addOrUpdateAssessed: Partial<ParcelEvaluation> = {
Value: row.Assessed,
EvaluationKeyId: 0,
Year: row.AssessedYear,
CreatedById: user.Id,
CreatedOn: new Date(),
});
};
if (!currRowEvaluations.some((a) => a.Year == row.AssessedYear)) {
addOrUpdateAssessed.CreatedById = user.Id;
} else {
addOrUpdateAssessed.UpdatedById = user.Id;
}
currRowEvaluations.push(addOrUpdateAssessed);
}

const classificationId: number = getClassificationOrThrow(row, lookups.classifications);
const adminAreaId: number = getAdministrativeAreaOrThrow(row, lookups.adminAreas);
const pin = numberOrNull(row.PIN) ?? existentParcel?.PIN;
const description = row.Description ?? (existentParcel ? existentParcel.Description : '');
const description = row.Description ?? existentParcel?.Description;
const isSensitive = setNewBool(row.IsSensitive, existentParcel?.IsSensitive, false);
const landArea = numberOrNull(row.LandArea) ?? existentParcel?.LandArea;

return {
Id: existentParcel?.Id,
Expand All @@ -433,7 +445,7 @@ const makeParcelUpsertObject = async (
IsSensitive: isSensitive,
PropertyTypeId: 0,
Description: description,
LandArea: numberOrNull(row.LandArea) ?? existentParcel ? existentParcel.LandArea : null,
LandArea: landArea,
Evaluations: currRowEvaluations,
Fiscals: currRowFiscals,
};
Expand Down Expand Up @@ -469,24 +481,33 @@ const makeBuildingUpsertObject = async (
currRowEvaluations.push(...evaluations);
currRowFiscals.push(...fiscals);
}

if (row.Netbook && !currRowFiscals.some((a) => a.FiscalYear == row.FiscalYear)) {
currRowFiscals.push({
// if there is a netbook and fiscal year we can add or update fiscal
if (row.Netbook && row.FiscalYear) {
const addOrUpdateFiscals: Partial<BuildingFiscal> = {
Value: row.Netbook,
FiscalKeyId: 0,
FiscalYear: row.FiscalYear,
CreatedById: user.Id,
CreatedOn: new Date(),
});
};
if (!currRowFiscals.some((a) => a.FiscalYear == row.FiscalYear)) {
addOrUpdateFiscals.CreatedById = user.Id;
} else {
addOrUpdateFiscals.UpdatedById = user.Id;
}
currRowFiscals.push(addOrUpdateFiscals);
}
if (row.Assessed && !currRowEvaluations.some((a) => a.Year == row.EvaluationYear)) {
currRowEvaluations.push({
// if there is a netbook and fiscal year we can add or update evaluation
if (row.Assessed && row.AssessedYear) {
const addOrUpdateAssessed: Partial<BuildingEvaluation> = {
Value: row.Assessed,
EvaluationKeyId: 0,
Year: row.AssessedYear,
CreatedById: user.Id,
CreatedOn: new Date(),
});
};
if (!currRowEvaluations.some((a) => a.Year == row.AssessedYear)) {
addOrUpdateAssessed.CreatedById = user.Id;
} else {
addOrUpdateAssessed.UpdatedById = user.Id;
}
currRowEvaluations.push(addOrUpdateAssessed);
}

const classificationId = getClassificationOrThrow(row, lookups.classifications);
Expand Down
8 changes: 4 additions & 4 deletions react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
"@emotion/styled": "11.13.0",
"@mdi/js": "7.4.47",
"@mdi/react": "1.6.1",
"@mui/icons-material": "5.16.0",
"@mui/icons-material": "6.0.2",
"@mui/lab": "5.0.0-alpha.170",
"@mui/material": "5.16.0",
"@mui/x-data-grid": "7.12.0",
"@mui/x-date-pickers": "7.12.0",
"@mui/material": "6.0.2",
"@mui/x-data-grid": "7.16.0",
"@mui/x-date-pickers": "7.16.0",
"@turf/turf": "7.1.0",
"dayjs": "1.11.10",
"node-xlsx": "0.24.0",
Expand Down
17 changes: 11 additions & 6 deletions react-app/src/components/layout/Footer.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
exports[`Footer.tsx should match the existing snapshot 1`] = `
<footer>
<div
className="MuiToolbar-root MuiToolbar-gutters MuiToolbar-regular css-szcixw-MuiToolbar-root"
className="MuiToolbar-root MuiToolbar-gutters MuiToolbar-regular css-xwp9po-MuiToolbar-root"
>
<p
className="MuiTypography-root MuiTypography-body1 css-3blj21-MuiTypography-root"
className="MuiTypography-root MuiTypography-body1 css-1lsxh3m-MuiTypography-root"
style={{}}
>
© 2024 Government of British Columbia.
</p>
Expand All @@ -17,34 +18,38 @@ exports[`Footer.tsx should match the existing snapshot 1`] = `
className="MuiBox-root css-13t3iqc"
>
<a
className="MuiTypography-root MuiTypography-h5 MuiLink-root MuiLink-underlineAlways css-1qas1pa-MuiTypography-root-MuiLink-root"
className="MuiTypography-root MuiTypography-h5 MuiLink-root MuiLink-underlineAlways css-gjyslq-MuiTypography-root-MuiLink-root"
href="https://www2.gov.bc.ca//gov/content/home/accessible-government"
onBlur={[Function]}
onFocus={[Function]}
style={{}}
>
Accessibility
</a>
<a
className="MuiTypography-root MuiTypography-h5 MuiLink-root MuiLink-underlineAlways css-1qas1pa-MuiTypography-root-MuiLink-root"
className="MuiTypography-root MuiTypography-h5 MuiLink-root MuiLink-underlineAlways css-gjyslq-MuiTypography-root-MuiLink-root"
href="https://www2.gov.bc.ca//gov/content/home/privacy"
onBlur={[Function]}
onFocus={[Function]}
style={{}}
>
Privacy
</a>
<a
className="MuiTypography-root MuiTypography-h5 MuiLink-root MuiLink-underlineAlways css-1qas1pa-MuiTypography-root-MuiLink-root"
className="MuiTypography-root MuiTypography-h5 MuiLink-root MuiLink-underlineAlways css-gjyslq-MuiTypography-root-MuiLink-root"
href="https://www2.gov.bc.ca//gov/content/home/copyright"
onBlur={[Function]}
onFocus={[Function]}
style={{}}
>
Copyright
</a>
<a
className="MuiTypography-root MuiTypography-h5 MuiLink-root MuiLink-underlineAlways css-1qas1pa-MuiTypography-root-MuiLink-root"
className="MuiTypography-root MuiTypography-h5 MuiLink-root MuiLink-underlineAlways css-gjyslq-MuiTypography-root-MuiLink-root"
href="https://www2.gov.bc.ca//gov/content/home/disclaimer"
onBlur={[Function]}
onFocus={[Function]}
style={{}}
>
Disclaimer
</a>
Expand Down

0 comments on commit 02d50b5

Please sign in to comment.