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

feat: suspicious cases sort by Description for address/streetname #146

Merged
merged 1 commit into from
Nov 27, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -42,66 +42,78 @@ public async Task<IEnumerable<SuspiciousCase>> GetSuspiciousCase(
{
switch (type)
{
// Address
case SuspiciousCasesType.CurrentAddressWithoutLinkedParcelsOrBuildingUnits:
return await CurrentAddressesWithoutLinkedParcelOrBuilding
.Where(x => x.NisCode == nisCode)
.OrderBy(x => x.AddressPersistentLocalId)
.OrderBy(x => x.Description)
.Skip(offset)
.Take(limit)
.ToListAsync(ct);
case SuspiciousCasesType.ProposedAddressWithoutLinkedParcelOrBuildingUnit:
return await ProposedAddressesWithoutLinkedParcelOrBuilding
.Where(x => x.NisCode == nisCode)
.OrderBy(x => x.AddressPersistentLocalId)
.OrderBy(x => x.Description)
.Skip(offset)
.Take(limit)
.ToListAsync(ct);
case SuspiciousCasesType.ActiveAddressOutsideOfMunicipalityBounds:
return await ActiveAddressesOutsideMunicipalityBounds
.Where(x => x.NisCode == nisCode)
.OrderBy(x => x.AddressPersistentLocalId)
.OrderBy(x => x.Description)
.Skip(offset)
.Take(limit)
.ToListAsync(ct);
case SuspiciousCasesType.CurrentStreetNameWithoutLinkedRoadSegment:
return await CurrentStreetNamesWithoutLinkedRoadSegments
case SuspiciousCasesType.AddressLongerThanTwoYearsProposed:
return await AddressesLongerThanTwoYearsProposed
.Where(x => x.NisCode == nisCode)
.OrderBy(x => x.StreetNamePersistentLocalId)
.OrderBy(x => x.Description)
.Skip(offset)
.Take(limit)
.ToListAsync(ct);
case SuspiciousCasesType.StreetNameLongerThanTwoYearsProposed:
return await StreetNamesLongerThanTwoYearsProposed
case SuspiciousCasesType.CurrentAddressesWithSpecificationDerivedFromBuildingUnitWithoutLinkedBuildingUnit:
return await CurrentAddressesWithSpecificationDerivedFromBuildingUnitWithoutLinkedBuildingUnit
.Where(x => x.NisCode == nisCode)
.OrderBy(x => x.StreetNamePersistentLocalId)
.OrderBy(x => x.Description)
.Skip(offset)
.Take(limit)
.ToListAsync(ct);
case SuspiciousCasesType.AddressLongerThanTwoYearsProposed:
return await AddressesLongerThanTwoYearsProposed
case SuspiciousCasesType.ActiveAddressLinkedToMultipleBuildingUnits:
return await ActiveAddressesLinkedToMultipleBuildingUnits
.Where(x => x.NisCode == nisCode)
.OrderBy(x => x.AddressPersistentLocalId)
.OrderBy(x => x.Description)
.Skip(offset)
.Take(limit)
.ToListAsync(ct);
case SuspiciousCasesType.RoadSegmentLongerThanTwoYearsWithPermit:
return await RoadSegmentsLongerThanTwoYearsWithPermit
case SuspiciousCasesType.CurrentAddressLinkedWithBuildingUnitButNotWithParcel:
return await CurrentAddressesLinkedWithBuildingUnitButNotWithParcel
.Where(x => x.NisCode == nisCode)
.OrderBy(x => x.RoadSegmentPersistentLocalId)
.OrderBy(x => x.Description)
.Skip(offset)
.Take(limit)
.ToListAsync(ct);
case SuspiciousCasesType.BuildingLongerThanTwoYearsPlanned:
return await BuildingsLongerThanTwoYearsPlanned

// StreetName
case SuspiciousCasesType.CurrentStreetNameWithoutLinkedRoadSegment:
return await CurrentStreetNamesWithoutLinkedRoadSegments
.Where(x => x.NisCode == nisCode)
.OrderBy(x => x.BuildingPersistentLocalId)
.OrderBy(x => x.Description)
.Skip(offset)
.Take(limit)
.ToListAsync(ct);
case SuspiciousCasesType.BuildingUnitLongerThanTwoYearsPlanned:
return await BuildingUnitsLongerThanTwoYearsPlanned
case SuspiciousCasesType.StreetNameLongerThanTwoYearsProposed:
return await StreetNamesLongerThanTwoYearsProposed
.Where(x => x.NisCode == nisCode)
.OrderBy(x => x.BuildingUnitPersistentLocalId)
.OrderBy(x => x.Description)
.Skip(offset)
.Take(limit)
.ToListAsync(ct);

// RoadSegment
case SuspiciousCasesType.RoadSegmentLongerThanTwoYearsWithPermit:
return await RoadSegmentsLongerThanTwoYearsWithPermit
.Where(x => x.NisCode == nisCode)
.OrderBy(x => x.RoadSegmentPersistentLocalId)
.Skip(offset)
.Take(limit)
.ToListAsync(ct);
Expand All @@ -112,10 +124,21 @@ public async Task<IEnumerable<SuspiciousCase>> GetSuspiciousCase(
.Skip(offset)
.Take(limit)
.ToListAsync(ct);
case SuspiciousCasesType.CurrentAddressesWithSpecificationDerivedFromBuildingUnitWithoutLinkedBuildingUnit:
return await CurrentAddressesWithSpecificationDerivedFromBuildingUnitWithoutLinkedBuildingUnit

// Building
case SuspiciousCasesType.BuildingLongerThanTwoYearsPlanned:
return await BuildingsLongerThanTwoYearsPlanned
.Where(x => x.NisCode == nisCode)
.OrderBy(x => x.AddressPersistentLocalId)
.OrderBy(x => x.BuildingPersistentLocalId)
.Skip(offset)
.Take(limit)
.ToListAsync(ct);

// BuildingUnit
case SuspiciousCasesType.BuildingUnitLongerThanTwoYearsPlanned:
return await BuildingUnitsLongerThanTwoYearsPlanned
.Where(x => x.NisCode == nisCode)
.OrderBy(x => x.BuildingUnitPersistentLocalId)
.Skip(offset)
.Take(limit)
.ToListAsync(ct);
Expand All @@ -133,20 +156,6 @@ public async Task<IEnumerable<SuspiciousCase>> GetSuspiciousCase(
// .Skip(offset)
// .Take(limit)
// .ToListAsync(ct);
case SuspiciousCasesType.ActiveAddressLinkedToMultipleBuildingUnits:
return await ActiveAddressesLinkedToMultipleBuildingUnits
.Where(x => x.NisCode == nisCode)
.OrderBy(x => x.AddressPersistentLocalId)
.Skip(offset)
.Take(limit)
.ToListAsync(ct);
case SuspiciousCasesType.CurrentAddressLinkedWithBuildingUnitButNotWithParcel:
return await CurrentAddressesLinkedWithBuildingUnitButNotWithParcel
.Where(x => x.NisCode == nisCode)
.OrderBy(x => x.AddressPersistentLocalId)
.Skip(offset)
.Take(limit)
.ToListAsync(ct);
default:
throw new ArgumentOutOfRangeException(nameof(type), type, null);
}
Expand Down
Loading