Skip to content

Commit

Permalink
Set property type to UNKNOWN for disabled code values
Browse files Browse the repository at this point in the history
  • Loading branch information
asanchezr committed May 22, 2024
1 parent 8391d47 commit dd5a110
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { GeoJsonProperties } from 'geojson';
import { isEmpty } from 'lodash';

import { ApiGen_CodeTypes_PropertyPPHStatusTypes } from '@/models/api/generated/ApiGen_CodeTypes_PropertyPPHStatusTypes';
import { ApiGen_CodeTypes_PropertyTypes } from '@/models/api/generated/ApiGen_CodeTypes_PropertyTypes';
import { ApiGen_Concepts_Address } from '@/models/api/generated/ApiGen_Concepts_Address';
import { ApiGen_Concepts_CodeType } from '@/models/api/generated/ApiGen_Concepts_CodeType';
import { ApiGen_Concepts_HistoricalFileNumber } from '@/models/api/generated/ApiGen_Concepts_HistoricalFileNumber';
Expand Down Expand Up @@ -228,9 +229,12 @@ export class UpdatePropertyDetailsFormModel {
model.volumetricUnitTypeCode = fromTypeCode(base.volumetricUnit) ?? undefined;
model.volumetricParcelTypeCode = fromTypeCode(base.volumetricType) ?? undefined;

model.propertyTypeCode = fromTypeCode(base.propertyType) ?? undefined;
model.statusTypeCode = fromTypeCode(base.status) ?? undefined;
model.propertyTypeCode =
exists(base.propertyType) && !base.propertyType.isDisabled
? fromTypeCode(base.propertyType)
: ApiGen_CodeTypes_PropertyTypes.UNKNOWN.toString();

model.statusTypeCode = fromTypeCode(base.status) ?? undefined;
model.districtTypeCode = fromTypeCode<number>(base.district) ?? undefined;
model.districtTypeCodeDescription = base.district?.description ?? undefined;

Expand Down

0 comments on commit dd5a110

Please sign in to comment.