Skip to content

Commit

Permalink
PIMS-1986: Remove LegalLandDescription from Parcels (#2635)
Browse files Browse the repository at this point in the history
  • Loading branch information
LawrenceLau2020 authored Aug 21, 2024
1 parent b4f2d6b commit 032ac71
Show file tree
Hide file tree
Showing 21 changed files with 43 additions and 30 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
3 changes: 0 additions & 3 deletions express-api/src/typeorm/Entities/Parcel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ export class Parcel extends Property {
@Column({ type: 'real', nullable: true })
LandArea: number;

@Column({ type: 'character varying', length: 500, nullable: true })
LandLegalDescription: string;

@Column({ type: 'character varying', length: 50, nullable: true })
Zoning: string;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class RemoveLegalLandDescription1724108452907 implements MigrationInterface {
name = 'RemoveLegalLandDescription1724108452907';

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "parcel" DROP COLUMN "land_legal_description"`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "parcel" ADD "land_legal_description" character varying(500)`,
);
}
}
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
8 changes: 0 additions & 8 deletions react-app/src/components/property/PropertyForms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -349,14 +349,6 @@ export const ParcelInformationForm = (props: IParcelInformationForm) => {
<Grid item xs={12}>
<TextFormField multiline label={'Description'} name={'Description'} fullWidth />
</Grid>
<Grid item xs={12}>
<TextFormField
multiline
label={'Legal description'}
name={'LandLegalDescription'}
fullWidth
/>
</Grid>
</Grid>
</>
);
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 032ac71

Please sign in to comment.