Skip to content

Commit

Permalink
removing references from NotificationTemplates table and other files
Browse files Browse the repository at this point in the history
  • Loading branch information
LawrenceLau2020 committed Aug 20, 2024
1 parent 03307a3 commit 308ed55
Show file tree
Hide file tree
Showing 18 changed files with 28 additions and 19 deletions.
2 changes: 0 additions & 2 deletions express-api/src/controllers/tools/toolsSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const ProjectSchema = z.object({
status: z.string(),
agency: z.string(),
description: z.string(),
landLegalDescription: z.string(),
risk: z.string(),
manager: z.string(),
location: z.string(),
Expand Down Expand Up @@ -76,7 +75,6 @@ const PropertySchema = z.object({
latitude: z.number(),
longitude: z.number(),
landArea: z.number(),
landLegalDescription: z.string(),
buildingFloorCount: z.number(),
buildingConstructionType: z.string(),
buildingPredominateUse: z.string(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
Site Size: {{ property.LandArea }} ha<br>
Zoned: {{ property.Zoning }}<br>
PID: {{ property.PID }} <br>
Legal: {{ property.LandLegalDescription }}<br>
Current Holder of the Property: {{ property.Agency?.Name }} <br>
{% if Project.Appraised != null and Project.Appraised.Value > 0 %}
<span>Appraised Value: ${{ Project.Appraised.Value }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
Site Size: {{ property.LandArea }} ha<br>
Zoned: {{ property.Zoning }}<br>
PID: {{ property.PID }} <br>
Legal: {{ property.LandLegalDescription }}<br>
Current Holder of the Property: {{ property.Agency?.Name }} <br>
{% if Project.Appraised != null and Project.Appraised.Value > 0 %}
<span>Appraised Value: ${{ Project.Appraised.Value }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
Site Size: {{ property.LandArea }} ha<br>
Zoned: {{ property.Zoning }}<br>
PID: {{ property.PID }} <br>
Legal: {{ property.LandLegalDescription }}<br>
Current Holder of the Property: {{ property.Agency?.Name }} <br>
{% if Project.Appraised != null and Project.Appraised.Value > 0 %}
<span>Appraised Value: ${{ Project.Appraised.Value }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
Site Size: {{ property.LandArea }} ha<br>
Zoned: {{ property.Zoning }}<br>
PID: {{ property.PID }} <br>
Legal: {{ property.LandLegalDescription }}<br>
Current Holder of the Property: {{ property.Agency?.Name }} <br>
{% if Project.Appraised != null and Project.Appraised.Value > 0 %}
<span>Appraised Value: ${{ Project.Appraised.Value }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
Site Size: {{ property.LandArea }} ha<br>
Zoned: {{ property.Zoning }}<br>
PID: {{ property.PID }} <br>
Legal: {{ property.LandLegalDescription }}<br>
Current Holder of the Property: {{ property.Agency?.Name }} <br>
{% if Project.Appraised != null and Project.Appraised.Value > 0 %}
<span>Appraised Value: ${{ Project.Appraised.Value }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
Site Size: {{ property.LandArea }} ha<br>
Zoned: {{ property.Zoning }}<br>
PID: {{ property.PID }} <br>
Legal: {{ property.LandLegalDescription }}<br>
Current Holder of the Property: {{ property.Agency?.Name }} <br>
{% if Project.Appraised != null and Project.Appraised.Value > 0 %}
<span>Appraised Value: ${{ Project.Appraised.Value }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
Site Size: {{ property.LandArea }} ha<br>
Zoned: {{ property.Zoning }}<br>
PID: {{ property.PID }} <br>
Legal: {{ property.LandLegalDescription }}<br>
Current Holder of the Property: {{ property.Agency?.Name }} <br>
{% if Project.Appraised != null and Project.Appraised.Value > 0 %}
<span>Appraised Value: ${{ Project.Appraised.Value }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
Site Size: {{ property.LandArea }} ha<br>
Zoned: {{ property.Zoning }}<br>
PID: {{ property.PID }} <br>
Legal: {{ property.LandLegalDescription }}<br>
Current Holder of the Property: {{ property.Agency?.Name }} <br>
{% if Project.Appraised != null and Project.Appraised.Value > 0 %}
<span>Appraised Value: ${{ Project.Appraised.Value }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
Site Size: {{ property.LandArea }} ha<br>
Zoned: {{ property.Zoning }}<br>
PID: {{ property.PID }} <br>
Legal: {{ property.LandLegalDescription }}<br>
Current Holder of the Property: {{ property.Agency?.Name }} <br>
{% if Project.Appraised != null and Project.Appraised.Value > 0 %}
<span>Appraised Value: ${{ Project.Appraised.Value }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
Site Size: {{ property.LandArea }} ha<br>
Zoned: {{ property.Zoning }}<br>
PID: {{ property.PID }} <br>
Legal: {{ property.LandLegalDescription }}<br>
Current Holder of the Property: {{ property.Agency?.Name }} <br>
{% if Project.Appraised != null and Project.Appraised.Value > 0 %}
<span>Appraised Value: ${{ Project.Appraised.Value }}</span>
Expand Down
1 change: 0 additions & 1 deletion express-api/src/services/properties/propertiesServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ const makeParcelUpsertObject = async (
IsVisibleToOtherAgencies: true,
PropertyTypeId: 0,
Description: row.Description,
LandLegalDescription: row.LandLegalDescription,
LandArea: numberOrNull(row.LandArea),
Evaluations: currRowEvaluations,
Fiscals: currRowFiscals,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class RemoveLegalDescriptionLineFromTemplates1724169663927 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
-- Remove 'Legal' line with leading and trailing spaces and line breaks
UPDATE notification_template
SET body = REPLACE(body, '
Legal: {{ property.LandLegalDescription }}
<br> ', '')
WHERE body LIKE '%Legal: {{ property.LandLegalDescription }}%';
-- Remove 'Legal' line with leading spaces and line breaks but without trailing spaces
UPDATE notification_template
SET body = REPLACE(body, '
Legal: {{ property.LandLegalDescription }}
<br> ', '')
WHERE body LIKE '%Legal: {{ property.LandLegalDescription }}%';
-- Remove 'Legal' line with no leading spaces
UPDATE notification_template
SET body = REPLACE(body, 'Legal: {{ property.LandLegalDescription }}<br>', '')
WHERE body LIKE '%Legal: {{ property.LandLegalDescription }}%';
`);
}

public async down(): Promise<void> {}
}
1 change: 0 additions & 1 deletion express-api/tests/integration/parcels/parcels.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const mockParcel: Partial<Parcel> = {
PID: faker.number.int(),
PIN: faker.number.int(),
LandArea: 0,
LandLegalDescription: faker.string.alpha(),
Zoning: '',
ZoningPotential: '',
ParentParcelId: 1,
Expand Down
2 changes: 0 additions & 2 deletions express-api/tests/integration/tools/tools.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ describe('INTEGRATION - Tools', () => {
status: 'Draft',
agency: faker.company.name(),
description: faker.lorem.sentence(),
landLegalDescription: faker.lorem.sentence(),
risk: 'High',
manager: faker.person.firstName(),
location: faker.location.city(),
Expand Down Expand Up @@ -76,7 +75,6 @@ describe('INTEGRATION - Tools', () => {
latitude: faker.location.latitude(),
longitude: faker.location.longitude(),
landArea: faker.number.int(),
landLegalDescription: faker.lorem.sentence(),
buildingFloorCount: faker.number.int(),
buildingConstructionType: faker.lorem.word(),
buildingPredominateUse: faker.lorem.word(),
Expand Down
1 change: 0 additions & 1 deletion express-api/tests/testUtils/factories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ export const produceParcel = (): Parcel => {
CreatedOn: faker.date.anytime(),
UpdatedOn: faker.date.anytime(),
Name: faker.string.alphanumeric(),
LandLegalDescription: faker.string.alphanumeric(),
PID: faker.number.int({ min: 111111111, max: 999999999 }),
PIN: undefined,
LandArea: undefined,
Expand Down
1 change: 0 additions & 1 deletion react-app/src/components/property/AddProperty.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ const AddProperty = () => {
IsSensitive: false,
ClassificationId: null,
Description: '',
LandLegalDescription: '',
Name: '',
BuildingPredominateUseId: null,
BuildingConstructionTypeId: null,
Expand Down
1 change: 0 additions & 1 deletion react-app/src/hooks/api/useParcelsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export interface Parcel extends Property {
Evaluations?: ParcelEvaluation[] | null;
Fiscals?: ParcelFiscal[] | null;
LandArea?: number;
LandLegalDescription?: string;
Zoning?: string;
ZoningPotential?: string;
ParentParcelId?: number;
Expand Down

0 comments on commit 308ed55

Please sign in to comment.