Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSP-8227 : Add search for "historical file number" on the property se… #4033

Merged
merged 6 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions source/backend/api/Areas/Property/Models/PropertyFilterModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public class PropertyFilterModel : PageFilter
/// </summary>
public string PlanNumber { get; set; }

/// <summary>
/// get/set - Search by historical LIS or PS file numbers.
/// </summary>
public string Historical { get; set; }

/// <summary>
/// get/set - The property ownership status.
/// </summary>
Expand All @@ -54,11 +59,11 @@ public PropertyFilterModel(Dictionary<string, Microsoft.Extensions.Primitives.St
// We want case-insensitive query parameter properties.
var filter = new Dictionary<string, Microsoft.Extensions.Primitives.StringValues>(query, StringComparer.OrdinalIgnoreCase);

this.Sort = filter.GetStringArrayValue(nameof(this.Sort));
var tempSort = this.Sort.ToList();
Sort = filter.GetStringArrayValue(nameof(Sort));
var tempSort = Sort.ToList();

// Convert sort to db format
for (int i = 0; i < this.Sort.Length; i++)
for (int i = 0; i < Sort.Length; i++)
{
if (tempSort[i].StartsWith("Location"))
{
Expand All @@ -72,20 +77,21 @@ public PropertyFilterModel(Dictionary<string, Microsoft.Extensions.Primitives.St
{
// The order will affect the display in the frontend. For now in alphabetical order.
// i.e. [Core Inventory, Disposed, Other Interest, Property of Interest]
var direction = this.Sort[i].Split(' ')[1];
tempSort[i] = this.Sort[i].Replace("Ownership", "IsOwned");
var direction = Sort[i].Split(' ')[1];
tempSort[i] = Sort[i].Replace("Ownership", "IsOwned");
tempSort.Add($"IsDisposed {direction}");
tempSort.Add($"IsOtherInterest {direction}");
tempSort.Add($"HasActiveAcquisitionFile {direction}");
tempSort.Add($"HasActiveResearchFile {direction}");
}
}
this.Sort = tempSort.ToArray();
Sort = tempSort.ToArray();

this.PinOrPid = filter.GetStringValue(nameof(this.PinOrPid));
this.Address = filter.GetStringValue(nameof(this.Address));
this.PlanNumber = filter.GetStringValue(nameof(this.PlanNumber));
this.Ownership = filter.GetStringArrayValue(nameof(this.Ownership));
PinOrPid = filter.GetStringValue(nameof(PinOrPid));
Address = filter.GetStringValue(nameof(Address));
PlanNumber = filter.GetStringValue(nameof(PlanNumber));
Historical = filter.GetStringValue(nameof(Historical));
Ownership = filter.GetStringArrayValue(nameof(Ownership));
}
#endregion

Expand All @@ -106,6 +112,7 @@ public static explicit operator PropertyFilter(PropertyFilterModel model)
PinOrPid = model.PinOrPid,
Address = model.Address,
PlanNumber = model.PlanNumber,
Historical = model.Historical,
Ownership = model.Ownership,
};

Expand All @@ -119,8 +126,9 @@ public static explicit operator PropertyFilter(PropertyFilterModel model)
public override bool IsValid()
{
return base.IsValid()
|| !string.IsNullOrWhiteSpace(this.PinOrPid)
|| !string.IsNullOrWhiteSpace(this.Address);
|| !string.IsNullOrWhiteSpace(PinOrPid)
|| !string.IsNullOrWhiteSpace(Historical)
|| !string.IsNullOrWhiteSpace(Address);
}
#endregion
}
Expand Down
174 changes: 88 additions & 86 deletions source/backend/apimodels/Models/Concepts/Property/PropertyViewMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,94 +8,96 @@ public class PropertyViewMap : IRegister
public void Register(TypeAdapterConfig config)
{
config.NewConfig<Entity.PimsPropertyVw, PropertyViewModel>()
.Map(dest => dest.Id, src => src.PropertyId)
.Map(dest => dest.Pid, src => src.Pid)
.Map(dest => dest.PidPadded, src => src.PidPadded)
.Map(dest => dest.Pin, src => src.Pin)
.Map(dest => dest.PropertyTypeCode, src => src.PropertyTypeCode)
.Map(dest => dest.PropertyStatusTypeCode, src => src.PropertyStatusTypeCode)
.Map(dest => dest.PropertyDataSourceTypeCode, src => src.PropertyDataSourceTypeCode)
.Map(dest => dest.PropertyDataSourceEffectiveDate, src => src.PropertyDataSourceEffectiveDate)
.Map(dest => dest.PropertyClassificationTypeCode, src => src.PropertyClassificationTypeCode)
.Map(dest => dest.PropertyTenureTypeCode, src => src.PropertyTenureTypeCode)
.Map(dest => dest.StreetAddress1, src => src.StreetAddress1)
.Map(dest => dest.StreetAddress2, src => src.StreetAddress2)
.Map(dest => dest.StreetAddress3, src => src.StreetAddress3)
.Map(dest => dest.MunicipalityName, src => src.MunicipalityName)
.Map(dest => dest.PostalCode, src => src.PostalCode)
.Map(dest => dest.ProvinceStateCode, src => src.ProvinceStateCode)
.Map(dest => dest.ProvinceName, src => src.ProvinceName)
.Map(dest => dest.CountryCode, src => src.CountryCode)
.Map(dest => dest.CountryName, src => src.CountryName)
.Map(dest => dest.Name, src => src.Name)
.Map(dest => dest.Description, src => src.Description)
.Map(dest => dest.AddressId, src => src.AddressId)
.Map(dest => dest.RegionCode, src => src.RegionCode)
.Map(dest => dest.DistrictCode, src => src.DistrictCode)
.Map(dest => dest.PropertyAreaUnitTypeCode, src => src.PropertyAreaUnitTypeCode)
.Map(dest => dest.LandArea, src => src.LandArea)
.Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription)
.Map(dest => dest.SurveyPlanNumber, src => src.SurveyPlanNumber)
.Map(dest => dest.EncumbranceReason, src => src.EncumbranceReason)
.Map(dest => dest.IsSensitive, src => src.IsSensitive)
.Map(dest => dest.IsOwned, src => src.IsOwned)
.Map(dest => dest.IsRetired, src => src.IsRetired)
.Map(dest => dest.IsVisibleToOtherAgencies, src => src.IsVisibleToOtherAgencies)
.Map(dest => dest.Zoning, src => src.Zoning)
.Map(dest => dest.ZoningPotential, src => src.ZoningPotential)
.Map(dest => dest.IsDisposed, src => src.IsDisposed)
.Map(dest => dest.IsOtherInterest, src => src.IsOtherInterest)
.Map(dest => dest.HasActiveAcquisitionFile, src => src.HasActiveAcquisitionFile)
.Map(dest => dest.HasActiveResearchFile, src => src.HasActiveResearchFile)
.Map(dest => dest.IsPayableLease, src => src.IsPayableLease)
.Map(dest => dest.IsActivePayableLease, src => src.IsActivePayableLease)
.Map(dest => dest.IsReceivableLease, src => src.IsReceivableLease)
.Map(dest => dest.IsActiveReceivableLease, src => src.IsActiveReceivableLease);
.Map(dest => dest.Id, src => src.PropertyId)
.Map(dest => dest.Pid, src => src.Pid)
.Map(dest => dest.PidPadded, src => src.PidPadded)
.Map(dest => dest.Pin, src => src.Pin)
.Map(dest => dest.PropertyTypeCode, src => src.PropertyTypeCode)
.Map(dest => dest.PropertyStatusTypeCode, src => src.PropertyStatusTypeCode)
.Map(dest => dest.PropertyDataSourceTypeCode, src => src.PropertyDataSourceTypeCode)
.Map(dest => dest.PropertyDataSourceEffectiveDate, src => src.PropertyDataSourceEffectiveDate)
.Map(dest => dest.PropertyClassificationTypeCode, src => src.PropertyClassificationTypeCode)
.Map(dest => dest.PropertyTenureTypeCode, src => src.PropertyTenureTypeCode)
.Map(dest => dest.StreetAddress1, src => src.StreetAddress1)
.Map(dest => dest.StreetAddress2, src => src.StreetAddress2)
.Map(dest => dest.StreetAddress3, src => src.StreetAddress3)
.Map(dest => dest.MunicipalityName, src => src.MunicipalityName)
.Map(dest => dest.PostalCode, src => src.PostalCode)
.Map(dest => dest.ProvinceStateCode, src => src.ProvinceStateCode)
.Map(dest => dest.ProvinceName, src => src.ProvinceName)
.Map(dest => dest.CountryCode, src => src.CountryCode)
.Map(dest => dest.CountryName, src => src.CountryName)
.Map(dest => dest.Name, src => src.Name)
.Map(dest => dest.Description, src => src.Description)
.Map(dest => dest.AddressId, src => src.AddressId)
.Map(dest => dest.RegionCode, src => src.RegionCode)
.Map(dest => dest.DistrictCode, src => src.DistrictCode)
.Map(dest => dest.PropertyAreaUnitTypeCode, src => src.PropertyAreaUnitTypeCode)
.Map(dest => dest.LandArea, src => src.LandArea)
.Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription)
.Map(dest => dest.SurveyPlanNumber, src => src.SurveyPlanNumber)
.Map(dest => dest.EncumbranceReason, src => src.EncumbranceReason)
.Map(dest => dest.IsSensitive, src => src.IsSensitive)
.Map(dest => dest.IsOwned, src => src.IsOwned)
.Map(dest => dest.IsRetired, src => src.IsRetired)
.Map(dest => dest.IsVisibleToOtherAgencies, src => src.IsVisibleToOtherAgencies)
.Map(dest => dest.Zoning, src => src.Zoning)
.Map(dest => dest.ZoningPotential, src => src.ZoningPotential)
.Map(dest => dest.IsDisposed, src => src.IsDisposed)
.Map(dest => dest.IsOtherInterest, src => src.IsOtherInterest)
.Map(dest => dest.HasActiveAcquisitionFile, src => src.HasActiveAcquisitionFile)
.Map(dest => dest.HasActiveResearchFile, src => src.HasActiveResearchFile)
.Map(dest => dest.IsPayableLease, src => src.IsPayableLease)
.Map(dest => dest.IsActivePayableLease, src => src.IsActivePayableLease)
.Map(dest => dest.IsReceivableLease, src => src.IsReceivableLease)
.Map(dest => dest.IsActiveReceivableLease, src => src.IsActiveReceivableLease)
.Map(dest => dest.HistoricalFileNumberStr, src => src.HistoricalFileNumberStr);

config.NewConfig<PropertyViewModel, Entity.PimsPropertyVw>()
.Map(dest => dest.PropertyId, src => src.Id)
.Map(dest => dest.Pid, src => src.Pid)
.Map(dest => dest.PidPadded, src => src.PidPadded)
.Map(dest => dest.Pin, src => src.Pin)
.Map(dest => dest.PropertyTypeCode, src => src.PropertyTypeCode)
.Map(dest => dest.PropertyStatusTypeCode, src => src.PropertyStatusTypeCode)
.Map(dest => dest.PropertyDataSourceTypeCode, src => src.PropertyDataSourceTypeCode)
.Map(dest => dest.PropertyDataSourceEffectiveDate, src => src.PropertyDataSourceEffectiveDate)
.Map(dest => dest.PropertyClassificationTypeCode, src => src.PropertyClassificationTypeCode)
.Map(dest => dest.PropertyTenureTypeCode, src => src.PropertyTenureTypeCode)
.Map(dest => dest.StreetAddress1, src => src.StreetAddress1)
.Map(dest => dest.StreetAddress2, src => src.StreetAddress2)
.Map(dest => dest.StreetAddress3, src => src.StreetAddress3)
.Map(dest => dest.MunicipalityName, src => src.MunicipalityName)
.Map(dest => dest.PostalCode, src => src.PostalCode)
.Map(dest => dest.ProvinceStateCode, src => src.ProvinceStateCode)
.Map(dest => dest.ProvinceName, src => src.ProvinceName)
.Map(dest => dest.CountryCode, src => src.CountryCode)
.Map(dest => dest.CountryName, src => src.CountryName)
.Map(dest => dest.Name, src => src.Name)
.Map(dest => dest.Description, src => src.Description)
.Map(dest => dest.AddressId, src => src.AddressId)
.Map(dest => dest.RegionCode, src => src.RegionCode)
.Map(dest => dest.DistrictCode, src => src.DistrictCode)
.Map(dest => dest.PropertyAreaUnitTypeCode, src => src.PropertyAreaUnitTypeCode)
.Map(dest => dest.LandArea, src => src.LandArea)
.Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription)
.Map(dest => dest.SurveyPlanNumber, src => src.SurveyPlanNumber)
.Map(dest => dest.EncumbranceReason, src => src.EncumbranceReason)
.Map(dest => dest.IsSensitive, src => src.IsSensitive)
.Map(dest => dest.IsOwned, src => src.IsOwned)
.Map(dest => dest.IsRetired, src => src.IsRetired)
.Map(dest => dest.IsVisibleToOtherAgencies, src => src.IsVisibleToOtherAgencies)
.Map(dest => dest.Zoning, src => src.Zoning)
.Map(dest => dest.ZoningPotential, src => src.ZoningPotential)
.Map(dest => dest.IsDisposed, src => src.IsDisposed)
.Map(dest => dest.IsOtherInterest, src => src.IsOtherInterest)
.Map(dest => dest.HasActiveAcquisitionFile, src => src.HasActiveAcquisitionFile)
.Map(dest => dest.HasActiveResearchFile, src => src.HasActiveResearchFile)
.Map(dest => dest.IsPayableLease, src => src.IsPayableLease)
.Map(dest => dest.IsActivePayableLease, src => src.IsActivePayableLease)
.Map(dest => dest.IsReceivableLease, src => src.IsReceivableLease)
.Map(dest => dest.IsActiveReceivableLease, src => src.IsActiveReceivableLease);
.Map(dest => dest.PropertyId, src => src.Id)
.Map(dest => dest.Pid, src => src.Pid)
.Map(dest => dest.PidPadded, src => src.PidPadded)
.Map(dest => dest.Pin, src => src.Pin)
.Map(dest => dest.PropertyTypeCode, src => src.PropertyTypeCode)
.Map(dest => dest.PropertyStatusTypeCode, src => src.PropertyStatusTypeCode)
.Map(dest => dest.PropertyDataSourceTypeCode, src => src.PropertyDataSourceTypeCode)
.Map(dest => dest.PropertyDataSourceEffectiveDate, src => src.PropertyDataSourceEffectiveDate)
.Map(dest => dest.PropertyClassificationTypeCode, src => src.PropertyClassificationTypeCode)
.Map(dest => dest.PropertyTenureTypeCode, src => src.PropertyTenureTypeCode)
.Map(dest => dest.StreetAddress1, src => src.StreetAddress1)
.Map(dest => dest.StreetAddress2, src => src.StreetAddress2)
.Map(dest => dest.StreetAddress3, src => src.StreetAddress3)
.Map(dest => dest.MunicipalityName, src => src.MunicipalityName)
.Map(dest => dest.PostalCode, src => src.PostalCode)
.Map(dest => dest.ProvinceStateCode, src => src.ProvinceStateCode)
.Map(dest => dest.ProvinceName, src => src.ProvinceName)
.Map(dest => dest.CountryCode, src => src.CountryCode)
.Map(dest => dest.CountryName, src => src.CountryName)
.Map(dest => dest.Name, src => src.Name)
.Map(dest => dest.Description, src => src.Description)
.Map(dest => dest.AddressId, src => src.AddressId)
.Map(dest => dest.RegionCode, src => src.RegionCode)
.Map(dest => dest.DistrictCode, src => src.DistrictCode)
.Map(dest => dest.PropertyAreaUnitTypeCode, src => src.PropertyAreaUnitTypeCode)
.Map(dest => dest.LandArea, src => src.LandArea)
.Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription)
.Map(dest => dest.SurveyPlanNumber, src => src.SurveyPlanNumber)
.Map(dest => dest.EncumbranceReason, src => src.EncumbranceReason)
.Map(dest => dest.IsSensitive, src => src.IsSensitive)
.Map(dest => dest.IsOwned, src => src.IsOwned)
.Map(dest => dest.IsRetired, src => src.IsRetired)
.Map(dest => dest.IsVisibleToOtherAgencies, src => src.IsVisibleToOtherAgencies)
.Map(dest => dest.Zoning, src => src.Zoning)
.Map(dest => dest.ZoningPotential, src => src.ZoningPotential)
.Map(dest => dest.IsDisposed, src => src.IsDisposed)
.Map(dest => dest.IsOtherInterest, src => src.IsOtherInterest)
.Map(dest => dest.HasActiveAcquisitionFile, src => src.HasActiveAcquisitionFile)
.Map(dest => dest.HasActiveResearchFile, src => src.HasActiveResearchFile)
.Map(dest => dest.IsPayableLease, src => src.IsPayableLease)
.Map(dest => dest.IsActivePayableLease, src => src.IsActivePayableLease)
.Map(dest => dest.IsReceivableLease, src => src.IsReceivableLease)
.Map(dest => dest.IsActiveReceivableLease, src => src.IsActiveReceivableLease)
.Map(dest => dest.HistoricalFileNumberStr, src => src.HistoricalFileNumberStr);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public class PropertyViewModel

public bool? IsActiveReceivableLease { get; set; }

public string HistoricalFileNumberStr { get; set; }

#endregion
}
}
Loading
Loading