-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
866 additions
and
637 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/Basisregisters.IntegrationDb.Schema/Models/SuspiciousCasesType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace Basisregisters.IntegrationDb.Schema.Models | ||
{ | ||
public enum SuspiciousCasesType | ||
{ | ||
CurrentAddressWithoutLinkedParcelsOrBuildingUnits = 1, | ||
ProposedAddressWithoutLinkedParcelsOrBuildingUnits = 2, | ||
AddressesOutsideOfMunicipalityBoundaries = 3, | ||
CurrentStreetNamesWithoutRoadSegment = 4, | ||
StreetNamesLongerThanTwoYearsProposed = 5, | ||
AddressesLongerThanTwoYearsProposed = 6, | ||
RoadSegmentsLongerThanTwoYearsProposed = 7, | ||
BuildingLongerThanTwoYearsPlanned = 8, | ||
BuildingUnitLongerThanTwoYearsPlanned = 9, | ||
StreetNameWithOnlyOneRoadSegmentToOnlyOneSide = 10, | ||
AddressesAppointedByAdministratorOutsideLinkedBuilding = 11, | ||
AddressesWithBuildingUnitSpecificationOutsideLinkedActiveBuildingUnit = 12, | ||
BuildingUnitsWithoutAddress = 13, | ||
BuildingUnitsLinkedToMultipleAddresses = 14, | ||
AddressesLinkedToMultipleBuildingUnits = 15 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...ers.IntegrationDb.Schema/Models/Views/SuspiciousCases/ActiveBuildingUnitWithoutAddress.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
namespace Basisregisters.IntegrationDb.Schema.Models.Views.SuspiciousCases | ||
{ | ||
using System; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
public class ActiveBuildingUnitWithoutAddress | ||
{ | ||
public int BuildingUnitPersistentLocalId { get; set; } | ||
public int NisCode { get; set; } | ||
public DateTimeOffset Timestamp { get; set; } | ||
|
||
public ActiveBuildingUnitWithoutAddress() | ||
{ } | ||
} | ||
|
||
public sealed class ActiveBuildingUnitWithoutAddressConfiguration : IEntityTypeConfiguration<ActiveBuildingUnitWithoutAddress> | ||
{ | ||
public void Configure(EntityTypeBuilder<ActiveBuildingUnitWithoutAddress> builder) | ||
{ | ||
builder | ||
.ToView(nameof(ActiveBuildingUnitWithoutAddress), IntegrationContext.Schema) | ||
.HasNoKey() | ||
.ToSqlQuery(@$"SELECT | ||
""BuildingUnitPersistentLocalId"", | ||
""NisCode"", | ||
""Timestamp"" | ||
FROM {ViewName}"); | ||
} | ||
|
||
public const string ViewName = @$"""{IntegrationContext.Schema}"".""VIEW_{nameof(ActiveBuildingUnitWithoutAddress)}"""; | ||
public const string Create = $@" | ||
CREATE MATERIALIZED VIEW IF NOT EXISTS {ViewName} AS | ||
SELECT | ||
bu.""PersistentLocalId"" AS ""BuildingUnitPersistentLocalId"", | ||
muni.""NisCode"" AS ""NisCode"", | ||
CURRENT_TIMESTAMP AS ""Timestamp"" | ||
FROM ""Integration"".""BuildingUnits"" AS bu | ||
LEFT OUTER JOIN ""Integration"".""VIEW_BuildingUnitAddressRelations"" AS rel | ||
ON bu.""PersistentLocalId"" = rel.""BuildingUnitPersistentLocalId"" | ||
INNER JOIN ""Integration"".""MunicipalityGeometries"" AS muni | ||
ON ST_Within(bu.""Geometry"", muni.""Geometry"") IS TRUE | ||
WHERE | ||
bu.""IsRemoved"" IS FALSE | ||
AND bu.""Status"" IN ('gepland','gerealiseerd') | ||
AND rel.""AddressPersistentLocalId"" IS NULL | ||
ORDER BY bu.""PersistentLocalId""; | ||
|
||
CREATE INDEX ""IX_BuildingUnitPersistentLocalId"" ON {ViewName} USING btree (""{nameof(ActiveBuildingUnitWithoutAddress.BuildingUnitPersistentLocalId)}""); | ||
CREATE INDEX ""IX_NisCode"" ON {ViewName} USING btree (""{nameof(ActiveBuildingUnitWithoutAddress.NisCode)}""); | ||
"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 0 additions & 42 deletions
42
...registers.IntegrationDb.Schema/Models/Views/SuspiciousCases/AddressesWithMultipleLinks.cs
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
...registers.IntegrationDb.Schema/Models/Views/SuspiciousCases/AddressesWithoutPostalCode.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.