From e191fdb8fa3c76c2dddd553b05cdd99be87e5571 Mon Sep 17 00:00:00 2001 From: TaylorFries <78506153+TaylorFries@users.noreply.github.com> Date: Wed, 18 Sep 2024 12:00:49 -0700 Subject: [PATCH] PIMS-2006 Remove PIMS v1 (#2678) Co-authored-by: dbarkowsky --- .editorconfig | 25 - .env-template | 7 - .github/labeler.yaml | 28 +- .github/workflows/DEV-Api-image-deploy.yml | 181 - .github/workflows/DEV-App-image-build.yml | 105 - .github/workflows/DEV-App-image-deploy.yml | 143 - .github/workflows/DEV-api-image-build.yml | 137 - .github/workflows/PROD-Api-image-deploy.yml | 163 - .github/workflows/PROD-App-image-deploy.yml | 138 - .github/workflows/TEST-Api-image-deploy.yml | 163 - .github/workflows/TEST-App-image-deploy.yml | 138 - .github/workflows/api-dotnetcore.yml | 102 - .github/workflows/app-cypress-dev.yml | 37 - .github/workflows/app-jest-coverage.yml | 76 - .github/workflows/app-lint.yaml | 32 - .gitignore | 14 - .vscode/launch.json | 62 - .vscode/settings.json | 62 - .vscode/tasks.json | 84 - Makefile | 152 - adr/ches.md | 59 - adr/database.md | 25 - adr/geocoder.md | 36 - adr/leaflet.md | 29 - adr/map-source-boundaries.md | 23 - adr/model-mapping.md | 31 - adr/monorepo.md | 33 - adr/programming-languages.md | 26 - backend/.dockerignore | 18 - backend/.editorconfig | 27 - backend/.gitignore | 52 - backend/.vscode/launch.json | 41 - backend/.vscode/tasks.json | 95 - backend/Dockerfile | 41 - backend/Dockerfile.migrations | 20 - backend/Dockerfile.ocp | 41 - backend/Pims.sln | 251 - backend/README.md | 78 - .../Controllers/AccessRequestController.cs | 103 - .../AdministrativeAreaController.cs | 183 - .../Admin/Controllers/AgencyController.cs | 177 - .../Admin/Controllers/ClaimController.cs | 145 - .../Areas/Admin/Controllers/RoleController.cs | 166 - .../Areas/Admin/Controllers/UserController.cs | 263 - .../AdministrativeAreaMap.cs | 24 - .../Areas/Admin/Mapping/Agency/AgencyMap.cs | 30 - .../api/Areas/Admin/Mapping/Claim/ClaimMap.cs | 28 - .../Areas/Admin/Mapping/Parcel/AddressMap.cs | 37 - .../Mapping/Parcel/BuildingEvaluationMap.cs | 33 - .../Admin/Mapping/Parcel/BuildingFiscalMap.cs | 33 - .../Areas/Admin/Mapping/Parcel/BuildingMap.cs | 70 - .../Admin/Mapping/Parcel/ParcelBuildingMap.cs | 68 - .../Mapping/Parcel/ParcelEvaluationMap.cs | 31 - .../Admin/Mapping/Parcel/ParcelFiscalMap.cs | 31 - .../Areas/Admin/Mapping/Parcel/ParcelMap.cs | 65 - .../Mapping/Parcel/PartialBuildingMap.cs | 22 - .../Admin/Mapping/Parcel/PartialParcelMap.cs | 24 - .../api/Areas/Admin/Mapping/Role/ClaimMap.cs | 39 - .../api/Areas/Admin/Mapping/Role/RoleMap.cs | 30 - .../Mapping/User/AccessRequestAgencyMap.cs | 25 - .../Admin/Mapping/User/AccessRequestMap.cs | 30 - .../Mapping/User/AccessRequestRoleMap.cs | 25 - .../Mapping/User/AccessRequestUserMap.cs | 34 - .../api/Areas/Admin/Mapping/User/AgencyMap.cs | 29 - .../Areas/Admin/Mapping/User/GoldUserMap.cs | 52 - .../api/Areas/Admin/Mapping/User/RoleMap.cs | 32 - .../api/Areas/Admin/Mapping/User/UserMap.cs | 56 - .../AdministrativeAreaModel.cs | 25 - .../Areas/Admin/Models/Agency/AgencyModel.cs | 35 - .../Areas/Admin/Models/Claim/ClaimModel.cs | 38 - .../Areas/Admin/Models/Parcel/AddressModel.cs | 23 - .../Models/Parcel/BuildingEvaluationModel.cs | 19 - .../Models/Parcel/BuildingFiscalModel.cs | 17 - .../Admin/Models/Parcel/BuildingModel.cs | 63 - .../Models/Parcel/ParcelBuildingModel.cs | 61 - .../Models/Parcel/ParcelEvaluationModel.cs | 19 - .../Admin/Models/Parcel/ParcelFiscalModel.cs | 17 - .../Areas/Admin/Models/Parcel/ParcelModel.cs | 27 - .../Models/Parcel/PartialBuildingModel.cs | 19 - .../Admin/Models/Parcel/PartialParcelModel.cs | 15 - .../Models/Parcel/PartialPropertyModel.cs | 23 - .../Admin/Models/Parcel/PropertyModel.cs | 39 - .../api/Areas/Admin/Models/Role/ClaimModel.cs | 38 - .../api/Areas/Admin/Models/Role/RoleModel.cs | 35 - .../Models/User/AccessRequestAgencyModel.cs | 15 - .../Admin/Models/User/AccessRequestModel.cs | 17 - .../Models/User/AccessRequestRoleModel.cs | 14 - .../Models/User/AccessRequestUserModel.cs | 60 - .../Areas/Admin/Models/User/AgencyModel.cs | 16 - .../Areas/Admin/Models/User/GoldUserModel.cs | 13 - .../api/Areas/Admin/Models/User/RoleModel.cs | 29 - .../api/Areas/Admin/Models/User/UserModel.cs | 90 - .../Keycloak/Controllers/RoleController.cs | 129 - .../Keycloak/Controllers/UserController.cs | 155 - .../Areas/Keycloak/Mapping/Role/RoleMap.cs | 30 - .../Keycloak/Mapping/Role/UpdateRoleMap.cs | 32 - .../Mapping/User/AccessRequestAgencyMap.cs | 24 - .../Keycloak/Mapping/User/AccessRequestMap.cs | 28 - .../Mapping/User/AccessRequestRoleMap.cs | 30 - .../Mapping/User/AccessRequestUserMap.cs | 30 - .../Areas/Keycloak/Mapping/User/AgencyMap.cs | 26 - .../Areas/Keycloak/Mapping/User/RoleMap.cs | 23 - .../Areas/Keycloak/Mapping/User/UserMap.cs | 71 - .../Areas/Keycloak/Models/Role/RoleModel.cs | 29 - .../Keycloak/Models/Role/Update/BaseModel.cs | 16 - .../Keycloak/Models/Role/Update/RoleModel.cs | 28 - .../Models/User/AccessRequestAgencyModel.cs | 12 - .../Models/User/AccessRequestModel.cs | 17 - .../Models/User/AccessRequestRoleModel.cs | 14 - .../Models/User/AccessRequestUserModel.cs | 48 - .../Areas/Keycloak/Models/User/AgencyModel.cs | 16 - .../Areas/Keycloak/Models/User/RoleModel.cs | 24 - .../Keycloak/Models/User/Update/BaseModel.cs | 16 - .../Keycloak/Models/User/Update/RoleModel.cs | 22 - .../Models/User/Update/UserAgencyModel.cs | 22 - .../Models/User/Update/UserRoleModel.cs | 24 - .../Areas/Keycloak/Models/User/UserModel.cs | 96 - .../Controllers/QueueController.cs | 165 - .../Controllers/TemplateController.cs | 160 - .../Mapping/Queue/NotificationQueueMap.cs | 32 - .../Template/NotificationTemplateMap.cs | 50 - .../Template/ProjectStatusNotificationMap.cs | 30 - .../Models/Queue/NotificationQueueModel.cs | 96 - .../Template/NotificationTemplateModel.cs | 91 - .../ProjectStatusNotificationModel.cs | 50 - .../Project/Controllers/DisposeController.cs | 288 -- .../Project/Controllers/ReportController.cs | 201 - .../Project/Controllers/SearchController.cs | 88 - .../Project/Controllers/StatusController.cs | 99 - .../Project/Controllers/WorkflowController.cs | 83 - .../Project/Mapping/Dispose/BuildingMap.cs | 102 - .../Dispose/DisposalProjectMetadataMap.cs | 91 - .../Project/Mapping/Dispose/ParcelMap.cs | 99 - .../Dispose/ProjectAgencyResponseMap.cs | 33 - .../Project/Mapping/Dispose/ProjectMap.cs | 230 - .../Project/Mapping/Dispose/ProjectNoteMap.cs | 28 - .../Mapping/Dispose/ProjectPropertyMap.cs | 32 - .../Dispose/ProjectStatusHistoryMap.cs | 25 - .../Mapping/Dispose/ProjectStatusMap.cs | 19 - .../Project/Mapping/Dispose/ProjectTaskMap.cs | 33 - .../Mapping/Report/ProjectReportMap.cs | 30 - .../Mapping/Report/ProjectSnapshotMap.cs | 79 - .../Project/Mapping/Search/ProjectMap.cs | 45 - .../Mapping/Search/ProjectPropertyMap.cs | 106 - .../Mapping/Status/ProjectStatusMap.cs | 34 - .../Areas/Project/Mapping/Status/TaskMap.cs | 17 - .../Project/Mapping/Status/WorkflowMap.cs | 15 - .../Mapping/Workflow/ProjectStatusMap.cs | 44 - .../Areas/Project/Mapping/Workflow/TaskMap.cs | 17 - .../Project/Models/Dispose/BuildingModel.cs | 49 - .../Project/Models/Dispose/ParcelModel.cs | 34 - .../Models/Dispose/ProjectAgencyResponse.cs | 53 - .../Project/Models/Dispose/ProjectModel.cs | 488 -- .../Models/Dispose/ProjectNoteModel.cs | 30 - .../Models/Dispose/ProjectPropertyModel.cs | 41 - .../Dispose/ProjectStatusHistoryModel.cs | 35 - .../Models/Dispose/ProjectStatusModel.cs | 32 - .../Models/Dispose/ProjectTaskModel.cs | 67 - .../Models/Dispose/SubdivisionParcelModel.cs | 13 - .../Models/Report/ProjectReportModel.cs | 49 - .../Models/Report/ProjectSnapshotModel.cs | 93 - .../Project/Models/Search/ProjectModel.cs | 142 - .../Models/Search/ProjectPropertyModel.cs | 95 - .../Models/Status/ProjectStatusModel.cs | 35 - .../Areas/Project/Models/Status/TaskModel.cs | 20 - .../Project/Models/Status/WorkflowModel.cs | 9 - .../Models/Workflow/ProjectStatusModel.cs | 47 - .../Project/Models/Workflow/TaskModel.cs | 20 - .../Controllers/BuildingController.cs | 154 - .../Property/Controllers/ParcelController.cs | 222 - .../Property/Controllers/SearchController.cs | 188 - .../Mapping/Building/BuildingEvaluationMap.cs | 32 - .../Mapping/Building/BuildingFiscalMap.cs | 34 - .../Property/Mapping/Building/BuildingMap.cs | 121 - .../Property/Mapping/Parcel/AddressMap.cs | 36 - .../Mapping/Parcel/BuildingEvaluationMap.cs | 32 - .../Mapping/Parcel/BuildingFiscalMap.cs | 32 - .../Mapping/Parcel/BuildingParcelMap.cs | 98 - .../Mapping/Parcel/ParcelBuildingMap.cs | 151 - .../Mapping/Parcel/ParcelEvaluationMap.cs | 34 - .../Mapping/Parcel/ParcelFiscalMap.cs | 33 - .../Property/Mapping/Parcel/ParcelMap.cs | 99 - .../Mapping/Parcel/ParcelParcelMap.cs | 79 - .../Property/Mapping/Search/GeoJsonMap.cs | 109 - .../Property/Mapping/Search/PropertyMap.cs | 216 - .../Building/BuildingEvaluationModel.cs | 20 - .../Models/Building/BuildingFiscalModel.cs | 22 - .../Property/Models/Building/BuildingModel.cs | 49 - .../Building/LeasedLandMetadataModel.cs | 25 - .../Property/Models/Parcel/AddressModel.cs | 23 - .../Models/Parcel/BuildingEvaluationModel.cs | 20 - .../Models/Parcel/BuildingFiscalModel.cs | 19 - .../Models/Parcel/BuildingParcelModel.cs | 7 - .../CheckPidAvailabilityResponseModel.cs | 7 - .../Models/Parcel/ParcelBuildingModel.cs | 40 - .../Models/Parcel/ParcelEvaluationModel.cs | 22 - .../Models/Parcel/ParcelFiscalModel.cs | 22 - .../Property/Models/Parcel/ParcelModel.cs | 37 - .../Models/Parcel/ParcelSubdivisionModel.cs | 13 - .../Models/Parcel/PartialPropertyModel.cs | 23 - .../Property/Models/Parcel/PropertyModel.cs | 50 - .../Models/Parcel/SubdivisionParcelModel.cs | 13 - .../Models/Search/GeoJsonFilterModel.cs | 478 -- .../Models/Search/GeoJsonGeometryModel.cs | 23 - .../Property/Models/Search/GeoJsonModel.cs | 25 - .../Models/Search/PropertyFilterModel.cs | 507 -- .../Property/Models/Search/PropertyModel.cs | 281 - .../Reports/Controllers/ProjectController.cs | 157 - .../Reports/Controllers/PropertyController.cs | 153 - .../Reports/Controllers/UserController.cs | 106 - .../Reports/Mapping/Project/ProjectMap.cs | 103 - .../Mapping/Project/ProjectPropertyMap.cs | 71 - .../Mapping/Project/SurplusPropertyListMap.cs | 82 - .../Mapping/Property/AllFieldsPropertyMap.cs | 56 - .../Reports/Mapping/Property/PropertyMap.cs | 53 - .../api/Areas/Reports/Mapping/User/UserMap.cs | 31 - .../Reports/Models/Project/ProjectModel.cs | 306 -- .../Models/Project/ProjectModelExcel.cs | 316 -- .../Models/Project/ProjectPropertyModel.cs | 95 - .../Project/SurplusPropertyListModel.cs | 134 - .../Models/Property/AllFieldsPropertyModel.cs | 277 - .../Reports/Models/Property/PropertyModel.cs | 233 - .../Areas/Reports/Models/User/UserModel.cs | 94 - .../Areas/Tools/Controllers/ChesController.cs | 113 - .../Tools/Controllers/GeocoderController.cs | 88 - .../Tools/Controllers/ImportController.cs | 160 - .../Areas/Tools/Controllers/LtsaController.cs | 50 - .../Tools/Helpers/ImportProjectsHelper.cs | 528 -- .../Tools/Helpers/ImportPropertiesHelper.cs | 648 --- .../Tools/Mapping/Geocoder/AddressMap.cs | 90 - .../Areas/Tools/Mapping/Geocoder/PidsMap.cs | 26 - .../Areas/Tools/Mapping/Import/AddressMap.cs | 36 - .../Mapping/Import/BuildingEvaluationMap.cs | 33 - .../Tools/Mapping/Import/BuildingFiscalMap.cs | 33 - .../Tools/Mapping/Import/ParcelBuildingMap.cs | 65 - .../Mapping/Import/ParcelEvaluationMap.cs | 33 - .../Tools/Mapping/Import/ParcelFiscalMap.cs | 33 - .../Areas/Tools/Mapping/Import/ParcelMap.cs | 61 - .../Import/ProjectAgencyResponseMap.cs | 19 - .../Areas/Tools/Mapping/Import/ProjectMap.cs | 92 - .../Tools/Mapping/Import/ProjectNoteMap.cs | 18 - .../Areas/Tools/Mapping/Import/PropertyMap.cs | 58 - .../Tools/Models/Geocoder/AddressModel.cs | 16 - .../Models/Geocoder/SitePidsResponseModel.cs | 13 - .../Areas/Tools/Models/Import/AddressModel.cs | 21 - .../Models/Import/BuildingEvaluationModel.cs | 19 - .../Models/Import/BuildingFiscalModel.cs | 17 - .../Tools/Models/Import/ImportProjectModel.cs | 227 - .../Models/Import/ImportPropertyModel.cs | 39 - .../Models/Import/ParcelBuildingModel.cs | 54 - .../Models/Import/ParcelEvaluationModel.cs | 19 - .../Tools/Models/Import/ParcelFiscalModel.cs | 17 - .../Areas/Tools/Models/Import/ParcelModel.cs | 27 - .../Import/ProjectAgencyResponseModel.cs | 33 - .../Areas/Tools/Models/Import/ProjectModel.cs | 284 -- .../Tools/Models/Import/ProjectNoteModel.cs | 27 - .../Tools/Models/Import/PropertyModel.cs | 37 - backend/api/Controllers/AuthController.cs | 126 - backend/api/Controllers/ErrorController.cs | 43 - backend/api/Controllers/HealthController.cs | 51 - backend/api/Controllers/LookupController.cs | 147 - backend/api/Controllers/UserController.cs | 213 - .../Authorization/KeyCloakClaimTransformer.cs | 64 - .../Authorization/KeyCloakClaimsFactory.cs | 50 - .../Authorization/RealmAccessRoleHandler.cs | 34 - .../RealmAccessRoleRequirement.cs | 29 - backend/api/Helpers/Constants/ContentTypes.cs | 14 - .../Exceptions/ApiHttpRequestException.cs | 52 - .../Exceptions/AuthenticationException.cs | 27 - .../Helpers/Exceptions/BadRequestException.cs | 27 - .../Helpers/Extensions/DateTimeExtensions.cs | 12 - .../Helpers/Extensions/ExceptionExtensions.cs | 42 - .../HttpResponseMessageExtensions.cs | 63 - .../api/Helpers/Logging/LoggerExtension.cs | 32 - .../Mapping/ApplicationBuilderExtensions.cs | 19 - .../Mapping/ServiceCollectionExtensions.cs | 70 - .../Middleware/ErrorHandlingMiddleware.cs | 226 - .../Middleware/LogRequestMiddleware.cs | 47 - .../Middleware/ResponseTimeMiddleware.cs | 50 - backend/api/Helpers/Reporting/ReportHelper.cs | 51 - .../Routes/Constraints/PidConstraint.cs | 51 - .../Swagger/ConfigureSwaggerOptions.cs | 56 - .../Helpers/Swagger/SwaggerDefaultValues.cs | 52 - .../Helpers/Swagger/SwaggerDocumentFilter.cs | 43 - backend/api/Mapping/BaseMap.cs | 24 - backend/api/Mapping/Building/AddressMap.cs | 34 - .../Mapping/Building/BuildingEvaluationMap.cs | 31 - .../api/Mapping/Building/BuildingFiscalMap.cs | 31 - backend/api/Mapping/Building/BuildingMap.cs | 93 - .../Mapping/Building/PartialBuildingMap.cs | 21 - backend/api/Mapping/CodeMap.cs | 43 - .../api/Mapping/Converters/AgencyConverter.cs | 54 - .../api/Mapping/Converters/ParcelConverter.cs | 19 - backend/api/Mapping/Lookup/CodeMap.cs | 20 - backend/api/Mapping/Lookup/LookupMap.cs | 86 - backend/api/Mapping/Lookup/RoleMap.cs | 23 - backend/api/Mapping/LookupMap.cs | 68 - backend/api/Mapping/PageModelMap.cs | 18 - backend/api/Mapping/Parcel/AddressMap.cs | 35 - .../Mapping/Parcel/BuildingEvaluationMap.cs | 31 - .../api/Mapping/Parcel/BuildingFiscalMap.cs | 31 - .../api/Mapping/Parcel/ParcelBuildingMap.cs | 93 - .../api/Mapping/Parcel/ParcelEvaluationMap.cs | 33 - backend/api/Mapping/Parcel/ParcelFiscalMap.cs | 31 - backend/api/Mapping/Parcel/ParcelMap.cs | 87 - .../api/Mapping/Parcel/PartialParcelMap.cs | 21 - .../Project/DisposalProjectMetadataMap.cs | 36 - backend/api/Mapping/Project/ProjectNoteMap.cs | 14 - .../Mapping/User/AccessRequestAgencyMap.cs | 22 - backend/api/Mapping/User/AccessRequestMap.cs | 32 - .../api/Mapping/User/AccessRequestRoleMap.cs | 24 - .../api/Mapping/User/AccessRequestUserMap.cs | 34 - backend/api/Mapping/User/AgencyMap.cs | 27 - backend/api/Mapping/User/RoleMap.cs | 25 - backend/api/Mapping/User/UserMap.cs | 42 - backend/api/Models/Auth/ClaimModel.cs | 40 - backend/api/Models/Auth/UserModel.cs | 52 - backend/api/Models/BaseModel.cs | 19 - backend/api/Models/Building/AddressModel.cs | 21 - .../Building/BuildingEvaluationModel.cs | 19 - .../Models/Building/BuildingFiscalModel.cs | 17 - backend/api/Models/Building/BuildingModel.cs | 41 - .../Models/Building/PartialBuildingModel.cs | 10 - backend/api/Models/CodeModel.cs | 22 - backend/api/Models/Create/BaseModel.cs | 8 - backend/api/Models/ErrorResponseModel.cs | 73 - backend/api/Models/Health/EnvModel.cs | 56 - backend/api/Models/Lookup/RoleModel.cs | 12 - backend/api/Models/LookupModel.cs | 46 - .../Models/Membership/ApplicationUserModel.cs | 27 - backend/api/Models/PageModel.cs | 82 - backend/api/Models/Parcel/AddressModel.cs | 21 - .../Models/Parcel/BuildingEvaluationModel.cs | 19 - .../api/Models/Parcel/BuildingFiscalModel.cs | 17 - .../api/Models/Parcel/BuildingParcelModel.cs | 11 - .../CheckPidAvailabilityResponseModel.cs | 7 - .../api/Models/Parcel/ParcelBuildingModel.cs | 40 - .../Models/Parcel/ParcelEvaluationModel.cs | 21 - .../api/Models/Parcel/ParcelFiscalModel.cs | 17 - backend/api/Models/Parcel/ParcelModel.cs | 27 - .../api/Models/Parcel/PartialParcelModel.cs | 15 - .../api/Models/Parcel/PartialPropertyModel.cs | 21 - backend/api/Models/Parcel/PropertyModel.cs | 39 - backend/api/Models/Update/BaseModel.cs | 9 - .../Models/User/AccessRequestAgencyModel.cs | 9 - backend/api/Models/User/AccessRequestModel.cs | 19 - .../User/AccessRequestNotificationModel.cs | 52 - .../api/Models/User/AccessRequestRoleModel.cs | 14 - .../api/Models/User/AccessRequestUserModel.cs | 60 - backend/api/Models/User/AgencyModel.cs | 14 - backend/api/Models/User/RoleModel.cs | 14 - backend/api/Models/User/UserModel.cs | 34 - backend/api/Pims.Api.csproj | 64 - .../api/Policies/HasPermissionAttribute.cs | 37 - backend/api/Policies/PermissionFilter.cs | 56 - backend/api/Program.cs | 60 - backend/api/Properties/launchSettings.json | 27 - backend/api/Startup.cs | 358 -- backend/api/appsettings.Development.json | 48 - backend/api/appsettings.Local.json | 49 - backend/api/appsettings.Test.json | 42 - backend/api/appsettings.json | 93 - backend/api/ches.Development.json | 7 - backend/api/ches.Local.json | 7 - backend/api/ches.Test.json | 7 - backend/api/ches.json | 8 - backend/api/geocoder.Development.json | 5 - backend/api/geocoder.Local.json | 5 - backend/api/geocoder.Test.json | 5 - backend/api/geocoder.json | 5 - backend/api/ltsa.local.json | 6 - backend/ches/ChesService.cs | 369 -- backend/ches/Configuration/ChesOptions.cs | 66 - backend/ches/Exceptions/ChesException.cs | 81 - .../Extensions/ServiceCollectionExtensions.cs | 28 - backend/ches/IChesService.cs | 19 - backend/ches/Models/AttachmentModel.cs | 30 - backend/ches/Models/EmailBodyTypes.cs | 15 - backend/ches/Models/EmailContextModel.cs | 43 - backend/ches/Models/EmailEncodings.cs | 19 - backend/ches/Models/EmailMergeModel.cs | 57 - backend/ches/Models/EmailModel.cs | 73 - backend/ches/Models/EmailPriorities.cs | 17 - backend/ches/Models/EmailResponseModel.cs | 26 - backend/ches/Models/ErrorModel.cs | 20 - backend/ches/Models/ErrorResponseModel.cs | 37 - backend/ches/Models/IAttachment.cs | 10 - backend/ches/Models/IEmail.cs | 33 - backend/ches/Models/IEmailContext.cs | 21 - backend/ches/Models/IEmailMerge.cs | 60 - backend/ches/Models/MessageResponseModel.cs | 30 - .../ches/Models/StatusHistoryResponseModel.cs | 30 - backend/ches/Models/StatusModel.cs | 32 - backend/ches/Models/StatusResponseModel.cs | 63 - backend/ches/Pims.Ches.csproj | 24 - backend/core/Comparers/DeepPropertyCompare.cs | 117 - .../core/Comparers/DeepPropertyCompare`.cs | 33 - .../core/Comparers/ShallowPropertyCompare.cs | 59 - .../core/Comparers/ShallowPropertyCompare`.cs | 37 - .../core/Converters/BooleanJsonConverter.cs | 40 - .../core/Converters/EnumValueJsonConverter.cs | 75 - .../core/Converters/GeometryJsonConverter.cs | 100 - .../Converters/Int32ToStringJsonConverter.cs | 26 - .../core/Converters/JsonEnumValueConverter.cs | 62 - .../MicrosecondEpochJsonConverter.cs | 53 - .../core/Exceptions/ConfigurationException.cs | 33 - .../Exceptions/HttpClientRequestException.cs | 80 - .../core/Exceptions/ProxyRequestException.cs | 45 - backend/core/Extensions/ArrayExtensions.cs | 32 - .../core/Extensions/CollectionExtensions.cs | 31 - backend/core/Extensions/DateExtensions.cs | 49 - .../core/Extensions/DictionaryExtensions.cs | 290 -- backend/core/Extensions/EnumExtensions.cs | 49 - .../core/Extensions/EnumerableExtensions.cs | 135 - .../core/Extensions/ExceptionExtensions.cs | 32 - backend/core/Extensions/GeometryExtensions.cs | 80 - backend/core/Extensions/IdentityExtensions.cs | 150 - .../Extensions/JsonSerializerExtensions.cs | 74 - backend/core/Extensions/ObjectExtensions.cs | 68 - .../core/Extensions/QueryableExtensions.cs | 161 - backend/core/Extensions/StringExtensions.cs | 119 - backend/core/Extensions/TypeExtensions.cs | 239 - .../core/Extensions/UriBuilderExtensions.cs | 31 - backend/core/Helpers/CsvHelper.cs | 122 - backend/core/Helpers/ExceptionHelper.cs | 104 - backend/core/Helpers/StringHelper.cs | 46 - backend/core/Helpers/XmlHelper.cs | 25 - .../Http/Configuration/AuthClientOptions.cs | 58 - .../Configuration/OpenIdConnectOptions.cs | 64 - backend/core/Http/HttpRequestClient.cs | 692 --- backend/core/Http/IHttpRequestClient.cs | 65 - .../core/Http/IOpenIdConnectRequestClient.cs | 16 - backend/core/Http/IProxyRequestClient.cs | 16 - backend/core/Http/Models/LtsaOrderModel.cs | 237 - .../core/Http/Models/LtsaTitleSummaryModel.cs | 53 - backend/core/Http/Models/LtsaTokenModel.cs | 26 - .../core/Http/Models/OpenIdConnectModel.cs | 76 - backend/core/Http/Models/TokenModel.cs | 54 - .../core/Http/OpenIdConnectRequestClient.cs | 255 - backend/core/Http/ProxyRequestClient.cs | 116 - backend/core/Json/EnumValueAttribute.cs | 29 - backend/core/Pims.Core.csproj | 20 - backend/core/Properties/launchSettings.json | 27 - .../Extensions/ServiceCollectionExtensions.cs | 22 - backend/dal.keycloak/IPimsKeycloakService.cs | 25 - .../Partials/PimsKeycloakRoleService.cs | 122 - .../Partials/PimsKeycloakUserService.cs | 248 - backend/dal.keycloak/Pims.Dal.Keycloak.csproj | 22 - backend/dal.keycloak/PimsKeycloakService.cs | 44 - .../AccessRequestAgencyConfiguration.cs | 31 - .../AccessRequestConfiguration.cs | 31 - .../AccessRequestRoleConfiguration.cs | 31 - .../dal/Configuration/AddressConfiguration.cs | 41 - .../AdministrativeAreaConfiguration.cs | 35 - .../dal/Configuration/AgencyConfiguration.cs | 41 - .../Configuration/BaseEntityConfiguration`.cs | 30 - .../Configuration/BuildingConfiguration.cs | 44 - .../BuildingConstructionTypeConfiguration.cs | 31 - .../BuildingEvaluationConfiguration.cs | 38 - .../BuildingFiscalConfiguration.cs | 41 - .../BuildingOccupantTypeConfiguration.cs | 31 - .../BuildingPredominateUseConfiguration.cs | 31 - .../dal/Configuration/ClaimConfiguration.cs | 33 - .../Configuration/CodeEntityConfiguration`.cs | 28 - .../Generators/IntIdentityGenerator.cs | 21 - .../LookupEntityConfiguration`.cs | 28 - .../NotificationQueueConfiguration.cs | 53 - .../NotificationTemplateConfiguration.cs | 51 - .../ParcelBuildingConfiguration.cs | 32 - .../dal/Configuration/ParcelConfiguration.cs | 39 - .../ParcelEvaluationConfiguration.cs | 39 - .../ParcelFiscalConfiguration.cs | 41 - .../ParcelParcelsConfiguration.cs | 35 - .../ProjectAgencyResponseConfiguration.cs | 35 - .../dal/Configuration/ProjectConfiguration.cs | 57 - .../Configuration/ProjectNoteConfiguration.cs | 35 - .../ProjectNumberConfiguration.cs | 25 - .../ProjectPropertyConfiguration.cs | 32 - .../ProjectReportConfiguration.cs | 33 - .../Configuration/ProjectRiskConfiguration.cs | 35 - .../ProjectSnapshotConfiguration.cs | 39 - .../ProjectStatusConfiguration.cs | 43 - .../ProjectStatusHistoryConfiguration.cs | 30 - .../ProjectStatusNotificationConfiguration.cs | 30 - .../ProjectStatusTransitionConfiguration.cs | 36 - .../Configuration/ProjectTaskConfiguration.cs | 34 - .../PropertyClassificationConfiguration.cs | 31 - .../Configuration/PropertyConfiguration`.cs | 31 - .../PropertyTypeConfiguration.cs | 31 - .../Configuration/ProvinceConfiguration.cs | 31 - .../Configuration/RoleClaimConfiguration.cs | 32 - .../dal/Configuration/RoleConfiguration.cs | 33 - .../dal/Configuration/TaskConfiguration.cs | 33 - .../Configuration/TierLevelConfiguration.cs | 33 - .../Configuration/UserAgencyConfiguration.cs | 32 - .../dal/Configuration/UserConfiguration.cs | 59 - .../Configuration/UserRoleConfiguration.cs | 32 - .../Views/PropertyConfiguration.cs | 153 - .../Configuration/WorkflowConfiguration.cs | 38 - .../WorkflowProjectStatusConfiguration.cs | 30 - .../dal/Exceptions/ConfigurationException.cs | 33 - .../dal/Exceptions/NotAuthorizedException.cs | 33 - .../Exceptions/RowVersionMissingException.cs | 33 - .../Helpers/Extensions/AddressExtensions.cs | 20 - .../ApplicationBuilderExtensions.cs | 40 - .../Helpers/Extensions/BuildingExtensions.cs | 255 - .../Helpers/Extensions/DbContextExtensions.cs | 58 - .../Helpers/Extensions/EntityExtensions.cs | 92 - .../dal/Helpers/Extensions/EnumExtensions.cs | 26 - .../Helpers/Extensions/IdentityExtensions.cs | 216 - .../dal/Helpers/Extensions/NoteExtensions.cs | 71 - .../Extensions/NotificationQueueExtensions.cs | 63 - .../Helpers/Extensions/ParcelExtensions.cs | 256 - .../Helpers/Extensions/ProjectExtensions.cs | 911 ---- .../Helpers/Extensions/PropertyExtensions.cs | 392 -- .../Extensions/RowVersionExtensions.cs | 85 - .../Extensions/ServiceCollectionExtensions.cs | 111 - .../Helpers/Extensions/ServiceExtensions.cs | 86 - .../Helpers/Extensions/WorkflowExtensions.cs | 76 - backend/dal/Helpers/GeometryHelper.cs | 20 - .../Migrations/ModelBuilderExtensions.cs | 77 - .../dal/Helpers/Migrations/SeedMigration.cs | 176 - backend/dal/IPimsService.cs | 41 - backend/dal/IService.cs | 7 - .../20200722193504_Initial.Designer.cs | 3341 ------------ .../dal/Migrations/20200722193504_Initial.cs | 2806 ---------- .../20200925194028_v01.00.01.Designer.cs | 3364 ------------ .../Migrations/20200925194028_v01.00.01.cs | 308 -- .../20201022154928_v01.01.00.Designer.cs | 3441 ------------- .../Migrations/20201022154928_v01.01.00.cs | 142 - .../20201102211604_v01.02.00.Designer.cs | 3487 ------------- .../Migrations/20201102211604_v01.02.00.cs | 526 -- .../20201119051823_v01.03.00.Designer.cs | 3430 ------------- .../Migrations/20201119051823_v01.03.00.cs | 298 -- .../20201126214802_v01.04.00.Designer.cs | 3412 ------------- .../Migrations/20201126214802_v01.04.00.cs | 94 - .../20201210213149_v01.05.00.Designer.cs | 3412 ------------- .../Migrations/20201210213149_v01.05.00.cs | 22 - .../20210107210217_v01.05.05.Designer.cs | 3412 ------------- .../Migrations/20210107210217_v01.05.05.cs | 22 - .../20210114181825_v01.06.00.Designer.cs | 3435 ------------- .../Migrations/20210114181825_v01.06.00.cs | 291 -- .../20210128205552_v01.07.00.Designer.cs | 3519 ------------- .../Migrations/20210128205552_v01.07.00.cs | 138 - .../20210217204245_v01.08.00.Designer.cs | 3532 ------------- .../Migrations/20210217204245_v01.08.00.cs | 77 - .../20210303154503_v01.08.01.Designer.cs | 3532 ------------- .../Migrations/20210303154503_v01.08.01.cs | 22 - .../20210308210949_v01.09.00.Designer.cs | 3532 ------------- .../Migrations/20210308210949_v01.09.00.cs | 22 - .../20210319220555_v01.09.01.Designer.cs | 3532 ------------- .../Migrations/20210319220555_v01.09.01.cs | 22 - .../20210323132211_v01.09.02.Designer.cs | 3532 ------------- .../Migrations/20210323132211_v01.09.02.cs | 22 - .../20210422222731_v01.10.01.Designer.cs | 3532 ------------- .../Migrations/20210422222731_v01.10.01.cs | 22 - .../20210505204819_v01.10.02.Designer.cs | 3532 ------------- .../Migrations/20210505204819_v01.10.02.cs | 22 - .../20210531140549_v01.10.04.Designer.cs | 3532 ------------- .../Migrations/20210531140549_v01.10.04.cs | 22 - .../20210610153039_v01.10.05.Designer.cs | 3532 ------------- .../Migrations/20210610153039_v01.10.05.cs | 22 - .../20210616142943_v01.10.06.Designer.cs | 3532 ------------- .../Migrations/20210616142943_v01.10.06.cs | 22 - .../20210705144630_v01.11.00.Designer.cs | 3532 ------------- .../Migrations/20210705144630_v01.11.00.cs | 22 - .../20210709230420_v01.11.01.Designer.cs | 3532 ------------- .../Migrations/20210709230420_v01.11.01.cs | 22 - .../20210712190221_v01.11.02.Designer.cs | 3532 ------------- .../Migrations/20210712190221_v01.11.02.cs | 22 - .../20210712220515_v01.11.03.Designer.cs | 3532 ------------- .../Migrations/20210712220515_v01.11.03.cs | 22 - .../20210809174827_v01.12.00.Designer.cs | 3532 ------------- .../Migrations/20210809174827_v01.12.00.cs | 22 - .../20210903194147_v01.12.01.Designer.cs | 3539 ------------- .../Migrations/20210903194147_v01.12.01.cs | 39 - .../20210920230505_v01.12.02.Designer.cs | 3542 ------------- .../Migrations/20210920230505_v01.12.02.cs | 28 - .../20210923231113_v01.13.00.Designer.cs | 3621 ------------- .../Migrations/20210923231113_v01.13.00.cs | 97 - .../20210929203118_v01.13.01.Designer.cs | 3621 ------------- .../Migrations/20210929203118_v01.13.01.cs | 22 - .../20211005225722_v01.14.00.Designer.cs | 3621 ------------- .../Migrations/20211005225722_v01.14.00.cs | 22 - .../20211103230229_v01.14.01.Designer.cs | 4208 --------------- .../Migrations/20211103230229_v01.14.01.cs | 22 - .../20220209183559_v01.15.00.Designer.cs | 4208 --------------- .../Migrations/20220209183559_v01.15.00.cs | 22 - .../20220308190231_v01.16.00.Designer.cs | 4211 --------------- .../Migrations/20220308190231_v01.16.00.cs | 22 - .../20220316211239_v01.17.00.Designer.cs | 4214 --------------- .../Migrations/20220316211239_v01.17.00.cs | 22 - .../20220404232725_v01.18.00.Designer.cs | 4214 --------------- .../Migrations/20220404232725_v01.18.00.cs | 22 - .../20220420193357_v01.18.01.Designer.cs | 4214 --------------- .../Migrations/20220420193357_v01.18.01.cs | 22 - .../20220425181658_v01.18.02.Designer.cs | 4214 --------------- .../Migrations/20220425181658_v01.18.02.cs | 22 - .../20220624191347_v01.18.03.Designer.cs | 4218 --------------- .../Migrations/20220624191347_v01.18.03.cs | 29 - .../20230103232746_v02.01.00.Designer.cs | 4218 --------------- .../Migrations/20230103232746_v02.01.00.cs | 22 - .../20230309230913_v02.03.09.Designer.cs | 4218 --------------- .../Migrations/20230309230913_v02.03.09.cs | 22 - .../20231003220606_v02.06.14.Designer.cs | 4247 ---------------- .../Migrations/20231003220606_v02.06.14.cs | 24 - .../20231129194537_v02.07.00.Designer.cs | 4247 ---------------- .../Migrations/20231129194537_v02.07.00.cs | 24 - .../20231207161338_v02.07.01.Designer.cs | 4247 ---------------- .../Migrations/20231207161338_v02.07.01.cs | 24 - .../Initial/Up/PostUp/01-Agencies.sql | 556 -- .../PostUp/01-BuildingConstructionTypes.sql | 27 - .../Up/PostUp/01-BuildingOccupantTypes.sql | 19 - .../Up/PostUp/01-BuildingPredominantUses.sql | 75 - .../Initial/Up/PostUp/01-Cities.sql | 324 -- .../Initial/Up/PostUp/01-Claims.sql | 96 - .../Up/PostUp/01-NotificationTemplates.sql | 1021 ---- .../Initial/Up/PostUp/01-ProjectNumbers.sql | 3 - .../Initial/Up/PostUp/01-ProjectRisks.sql | 43 - .../Initial/Up/PostUp/01-ProjectStatus.sql | 310 -- .../Up/PostUp/01-PropertyClassifications.sql | 39 - .../Initial/Up/PostUp/01-PropertyTypes.sql | 15 - .../Initial/Up/PostUp/01-Provinces.sql | 12 - .../Migrations/Initial/Up/PostUp/01-Roles.sql | 75 - .../Migrations/Initial/Up/PostUp/01-Tasks.sql | 151 - .../Initial/Up/PostUp/01-TierLevels.sql | 38 - .../Migrations/Initial/Up/PostUp/01-Users.sql | 21 - .../Initial/Up/PostUp/01-ViewProperties.sql | 223 - .../Initial/Up/PostUp/01-Workflow.sql | 56 - .../Up/PostUp/01-WorkflowProjectStatus.sql | 203 - .../PostUp/02-ProjectStatusNotifications.sql | 118 - .../Up/PostUp/02-ProjectStatusTransitions.sql | 414 -- .../Initial/Up/PostUp/02-RoleClaims.sql | 267 - .../Migrations/PimsContextModelSnapshot.cs | 4216 --------------- .../v01.00.01/Down/PostDown/DisableRoles.sql | 1 - .../v01.00.01/Up/PostUp/DisableRoles.sql | 1 - .../Down/PreDown/RemoveRolesAndClaims.sql | 4 - .../v01.01.00/Up/PreUp/AddRolesAndClaims.sql | 47 - .../v01.01.00/Up/PreUp/v01.01.02.sql | 96 - .../v01.02.00/Down/PostDown/01-Buildings.sql | 13 - .../v01.02.00/Down/PostDown/01-Cities.sql | 22 - .../Down/PostDown/01-ViewProperties.sql | 223 - .../v01.02.00/Down/PostDown/02-Addresses.sql | 10 - .../Down/PreDown/01-AdministrativeAreas.sql | 30 - .../v01.02.00/Down/PreDown/01-Buildings.sql | 6 - .../Down/PreDown/01-ParcelBuildings.sql | 13 - .../v01.02.00/Down/PreDown/01-Parcels.sql | 6 - .../v01.02.00/Down/PreDown/02-Addresses.sql | 9 - .../Down/PreDown/03-SpatialIndex.sql | 4 - .../Down/Properties/01-Buildings-Location.sql | 16 - .../Down/Properties/01-Parcels-Location.sql | 16 - .../v01.02.00/Up/PostUp/01-Addresses.sql | 9 - .../Up/PostUp/01-AdministrativeAreas.sql | 25 - .../Up/PostUp/01-ParcelBuildings.sql | 11 - .../v01.02.00/Up/PostUp/01-ViewProperties.sql | 219 - .../Up/PostUp/02-AdministrativeAreas.sql | 666 --- .../v01.02.00/Up/PostUp/02-Buildings.sql | 20 - .../v01.02.00/Up/PostUp/03-SpatialIndex.sql | 4 - .../v01.02.00/Up/PreUp/01-Addresses.sql | 8 - .../v01.02.00/Up/PreUp/01-Buildings.sql | 9 - .../v01.02.00/Up/PreUp/01-Cities.sql | 8 - .../v01.02.00/Up/PreUp/01-Municipalities.sql | 8 - .../Up/Properties/01-Buildings-Location.sql | 11 - .../Up/Properties/01-Parcels-Location.sql | 11 - .../PostDown/01-NotificationTemplates.sql | 10 - .../Down/PostDown/01-ProjectNotes.sql | 54 - .../Down/PostDown/01-ProjectSnapshots.sql | 15 - .../v01.03.00/Down/PostDown/01-Projects.sql | 10 - .../Down/PostDown/01-ViewProperties.sql | 219 - .../Down/PreDown/01-ProjectNotes.sql | 29 - .../Down/PreDown/01-ProjectSnapshots.sql | 14 - .../v01.03.00/Down/PreDown/01-Projects.sql | 52 - .../Up/PostUp/01-NotificationTemplates.sql | 9 - .../v01.03.00/Up/PostUp/01-ProjectNotes.sql | 90 - .../Up/PostUp/01-ProjectSnapshots.sql | 9 - .../v01.03.00/Up/PostUp/01-Projects.sql | 9 - .../v01.03.00/Up/PreUp/01-Agencies.sql | 277 - .../v01.03.00/Up/PreUp/01-ProjectNotes.sql | 12 - .../Up/PreUp/01-ProjectSnapshots.sql | 14 - .../v01.03.00/Up/PreUp/01-Projects.sql | 54 - .../PostDown/01-ProjectStatusTransitions.sql | 82 - .../PostDown/01-WorkflowProjectStatus.sql | 5 - .../Down/PostDown/03-ProjectStatus.sql | 16 - .../v01.04.00/Up/PostUp/01-ProjectStatus.sql | 38 - .../v01.04.00/Up/PostUp/01-Tasks.sql | 6 - .../Up/PostUp/01-WorkflowProjectStatus.sql | 26 - .../Up/PostUp/02-ProjectStatusTransitions.sql | 120 - .../Down/PostDown/01-ProjectRisks.sql | 63 - .../PostDown/01-ProjectStatusTransitions.sql | 19 - .../v01.05.00/Up/PostUp/01-ProjectRisks.sql | 46 - .../Up/PostUp/01-ProjectStatusTransitions.sql | 39 - .../v01.05.00/Up/PostUp/01-Tasks.sql | 6 - .../v01.05.00/Up/PostUp/02-Agencies.sql | 42 - .../PostUp/01-BuildingConstructionTypes.sql | 15 - .../Up/PostUp/01-BuildingPredominantUses.sql | 10 - .../Up/PostUp/02-BuildingPredominateUses.sql | 16 - .../v01.06.00/Down/PostDown/01-Buildings.sql | 9 - .../v01.06.00/Down/PostDown/01-Parcels.sql | 9 - .../Down/PostDown/01-ViewProperties.sql | 219 - .../v01.06.00/Down/PreDown/01-Buildings.sql | 9 - .../Down/PreDown/01-NotificationTemplates.sql | 728 --- .../v01.06.00/Down/PreDown/01-Parcels.sql | 9 - .../v01.06.00/Down/PreDown/01-Projects.sql | 3 - .../Down/PreDown/01-RemoveRolesAndClaims.sql | 5 - .../Up/PostUp/01-AddRoleAndClaims.sql | 59 - .../v01.06.00/Up/PostUp/01-Buildings.sql | 9 - .../v01.06.00/Up/PostUp/01-Parcels.sql | 9 - .../v01.06.00/Up/PostUp/01-ViewProperties.sql | 212 - .../Up/PreUp/01-BuildingPredominateUses.sql | 20 - .../v01.06.00/Up/PreUp/01-Buildings.sql | 9 - .../Up/PreUp/01-NotificationTemplates.sql | 742 --- .../v01.06.00/Up/PreUp/01-Parcels.sql | 9 - .../PostDown/01-ProjectStatusTransitions.sql | 6 - .../PostDown/02-WorkflowProjectStatus.sql | 5 - .../Down/PreDown/01-NotificationTemplates.sql | 5 - .../PreDown/01-RemoveNewClassifications.sql | 10 - .../Down/PreDown/01-ViewProperties.sql | 212 - .../01-Adminstrative_Areas_And_Addresses.sql | 146 - .../v01.07.00/Up/PostUp/01-Agencies.sql | 534 -- .../Up/PostUp/01-NotificationTemplates.sql | 6 - .../PostUp/01-PropertyClassificationTypes.sql | 21 - .../v01.07.00/Up/PostUp/01-PropertyTypes.sql | 14 - .../v01.07.00/Up/PostUp/01-ViewProperties.sql | 213 - .../Up/PostUp/01-WorkflowProjectStatus.sql | 13 - .../Up/PostUp/02-ProjectStatusTransitions.sql | 48 - .../v01.07.00/Up/PreUp/01-Buildings.sql | 423 -- .../v01.07.00/Up/PreUp/01-Parcels.sql | 423 -- .../PostDown/01-NotificationTemplates.sql | 74 - .../PostDown/01-ProjectStatusTransitions.sql | 19 - .../Down/PostDown/01-ViewProperties.sql | 213 - .../Up/Postup/01-NotificationTemplates.sql | 76 - .../v01.08.00/Up/Postup/01-ProjectStatus.sql | 5 - .../Up/Postup/01-ProjectStatusTransitions.sql | 38 - .../v01.08.00/Up/Postup/01-Tasks.sql | 6 - .../v01.08.00/Up/Postup/01-ViewProperties.sql | 213 - .../v01.08.00/Up/PreUp/01-Buildings.sql | 423 -- .../v01.08.00/Up/PreUp/01-Parcels.sql | 423 -- .../v01.08.00/Up/PreUp/02-Buildings.sql | 23 - .../PostDown/01-ProjectStatusTransitions.sql | 25 - .../Up/Postup/01-AdministrativeAreas.sql | 9 - .../v01.08.01/Up/Postup/01-Buildings.sql | 41 - .../Up/Postup/01-NotificationTemplates.sql | 15 - .../v01.08.01/Up/Postup/01-Parcels.sql | 41 - .../Up/Postup/01-ProjectStatusTransitions.sql | 47 - .../PostDown/01-ProjectStatusTransitions.sql | 7 - .../v01.09.00/Down/PostDown/02-RoleClaims.sql | 18 - .../v01.09.00/Up/PostUp/01-Agencies.sql | 255 - .../Up/PostUp/01-BuildingPredominateUses.sql | 41 - .../Up/PostUp/01-NotificationTemplates.sql | 10 - .../Up/PostUp/01-ProjectStatusTransitions.sql | 20 - .../v01.09.00/Up/PostUp/02-RoleClaims.sql | 9 - .../Up/PreUp/01-NotificationTemplates.sql | 70 - .../Up/PostUp/01-NotificationTemplates.sql | 4 - .../Up/PostUp/01-NotificationTemplates.sql | 6 - .../PostUp/01-ProjectStatusNotifications.sql | 81 - .../v01.10.04/Up/PostUp/01-Agencies.sql | 88 - .../v01.10.05/Up/PostUp/01-Properties.sql | 30 - .../Up/PostUp/01-ProjectStatusTransitions.sql | 71 - .../PostDown/01-NotificationTemplates.sql | 5 - .../Up/PostUp/01-NotificationTemplates.sql | 42 - .../PostDown/01-ProjectStatusTransitions.sql | 7 - .../Up/PostUp/01-ProjectStatusTransitions.sql | 20 - .../Up/PostUp/01-NotificationTemplates.sql | 11 - .../Up/PostUp/01-AdministrativeAreas.sql | 32 - .../Up/PostUp/01-NotificationTemplates.sql | 5 - .../v01.12.01/Up/PostUp/01-Users.sql | 5 - .../Up/PreUp/01-AdministrativeAreas.sql | 9 - .../PreDown/RemoveNotificationTemplate.sql | 1 - .../Up/PostUp/01-NotificationTemplates.sql | 37 - .../Down/PreDown/01-NotificationTemplates.sql | 6 - .../Up/PostUp/01-NotificationTemplates.sql | 746 --- .../PostDown/02-WorkflowProjectStatus.sql | 5 - .../Up/PostUp/01-WorkflowProjectStatus.sql | 13 - .../PostDown/01-NotificationTemplates.sql | 6 - .../Up/PostUp/01-NotificationTemplates.sql | 7 - .../Down/PostDown/01-ViewProperties.sql | 213 - .../v01.16.00/Up/PostUp/01-ViewProperties.sql | 219 - .../PostDown/01-NotificationTemplates.sql | 6 - .../Up/PostUp/01-NotificationTemplates.sql | 8 - .../Up/PostUp/01-BuildingEvaluations.sql | 11 - .../Up/PostUp/01-ProjectStatusTransitions.sql | 308 -- .../Up/PostUp/01-ProjectStatusTransition.sql | 514 -- .../v02.01.00/Up/PostUp/01-ProjectStatus.sql | 6 - .../v02.03.09/Up/PostUp/01-Roles.sql | 19 - .../Up/PostUp/01-NotificationTemplates.sql | 7 - .../Up/PostUp/01-AdministrativeAreas.sql | 33 - .../Up/PostUp/01-AdministrativeAreas.sql | 5 - backend/dal/Options/AccessRequestOptions.cs | 25 - backend/dal/Options/EnvironmentOptions.cs | 27 - backend/dal/Options/NotificationOptions.cs | 15 - backend/dal/Options/PimsOptions.cs | 38 - backend/dal/Options/ProjectOptions.cs | 30 - backend/dal/Options/ServiceAccountOptions.cs | 12 - backend/dal/PIMSContext.cs | 235 - backend/dal/PIMSContextFactory.cs | 102 - backend/dal/Pims.Dal.csproj | 70 - backend/dal/PimsService.cs | 118 - backend/dal/Properties/launchSettings.json | 27 - backend/dal/Security/Permissions.cs | 78 - .../Services/Admin/Concrete/AddressService.cs | 63 - .../Concrete/AdministrativeAreaService.cs | 157 - .../Services/Admin/Concrete/AgencyService.cs | 258 - .../Services/Admin/Concrete/BaseService`.cs | 124 - .../BuildingConstructionTypeService.cs | 75 - .../Concrete/BuildingPredominateUseService.cs | 75 - .../Admin/Concrete/BuildingService.cs | 416 -- .../Services/Admin/Concrete/ClaimService.cs | 134 - .../Services/Admin/Concrete/ParcelService.cs | 481 -- .../Admin/Concrete/ProjectRiskService.cs | 86 - .../Services/Admin/Concrete/ProjectService.cs | 274 - .../Admin/Concrete/ProjectStatusService.cs | 86 - .../Concrete/PropertyClassificationService.cs | 75 - .../Admin/Concrete/PropertyTypeService.cs | 76 - .../Admin/Concrete/ProvinceService.cs | 85 - .../Services/Admin/Concrete/RoleService.cs | 159 - .../Admin/Concrete/TierLevelService.cs | 86 - .../Services/Admin/Concrete/UserService.cs | 696 --- .../Admin/Concrete/WorkflowService.cs | 103 - backend/dal/Services/Admin/IAddressService.cs | 10 - .../Admin/IAdministrativeAreaService.cs | 18 - backend/dal/Services/Admin/IAgencyService.cs | 17 - backend/dal/Services/Admin/IBaseService`.cs | 64 - .../Admin/IBuildingConstructionTypeService.cs | 13 - .../Admin/IBuildingPredominateUseService.cs | 13 - .../dal/Services/Admin/IBuildingService.cs | 25 - backend/dal/Services/Admin/IClaimService.cs | 17 - backend/dal/Services/Admin/IParcelService.cs | 20 - .../dal/Services/Admin/IPimsAdminService.cs | 36 - .../dal/Services/Admin/IProjectRiskService.cs | 14 - backend/dal/Services/Admin/IProjectService.cs | 23 - .../Services/Admin/IProjectStatusService.cs | 14 - .../Admin/IPropertyClassificationService.cs | 13 - .../Services/Admin/IPropertyTypeService.cs | 13 - .../dal/Services/Admin/IProvinceService.cs | 13 - backend/dal/Services/Admin/IRoleService.cs | 18 - .../dal/Services/Admin/ITierLevelService.cs | 14 - backend/dal/Services/Admin/IUserService.cs | 33 - .../dal/Services/Admin/IWorkflowService.cs | 15 - .../dal/Services/Admin/PimsAdminService.cs | 147 - backend/dal/Services/BaseService.cs | 89 - backend/dal/Services/BaseService`.cs | 35 - .../dal/Services/Concrete/BuildingService.cs | 444 -- .../dal/Services/Concrete/LookupService.cs | 118 - .../Concrete/NotificationQueueService.cs | 485 -- .../Concrete/NotificationTemplateService.cs | 203 - .../dal/Services/Concrete/ParcelService.cs | 598 --- .../Concrete/ProjectNotificationService.cs | 56 - .../Services/Concrete/ProjectReportService.cs | 345 -- .../dal/Services/Concrete/ProjectService.cs | 1008 ---- .../Services/Concrete/ProjectStatusService.cs | 57 - .../dal/Services/Concrete/PropertyService.cs | 253 - backend/dal/Services/Concrete/TaskService.cs | 79 - backend/dal/Services/Concrete/UserService.cs | 356 -- .../dal/Services/Concrete/WorkflowService.cs | 92 - backend/dal/Services/IBuildingService.cs | 21 - backend/dal/Services/ILookupService.cs | 23 - .../dal/Services/INotificationQueueService.cs | 30 - backend/dal/Services/INotificationService.cs | 17 - .../Services/INotificationTemplateService.cs | 22 - backend/dal/Services/IParcelService.cs | 24 - .../Services/IProjectNotificationService.cs | 14 - backend/dal/Services/IProjectReportService.cs | 21 - backend/dal/Services/IProjectService.cs | 25 - backend/dal/Services/IProjectStatusService.cs | 14 - backend/dal/Services/IPropertyService.cs | 18 - backend/dal/Services/ITaskService.cs | 15 - backend/dal/Services/IUserService.cs | 27 - backend/dal/Services/IWorkflowService.cs | 17 - backend/entities/AccessRequest.cs | 72 - backend/entities/AccessRequestAgency.cs | 69 - backend/entities/AccessRequestRole.cs | 69 - backend/entities/AccessRequestStatus.cs | 9 - backend/entities/Address.cs | 109 - backend/entities/AdministrativeArea.cs | 41 - backend/entities/Agency.cs | 111 - backend/entities/BaseEntity.cs | 66 - backend/entities/Building.cs | 131 - backend/entities/BuildingConstructionType.cs | 27 - backend/entities/BuildingEvaluation.cs | 73 - backend/entities/BuildingFiscal.cs | 78 - backend/entities/BuildingOccupantType.cs | 27 - backend/entities/BuildingPredominateUse.cs | 27 - backend/entities/Claim.cs | 67 - backend/entities/ClassificationTypes.cs | 38 - backend/entities/CodeEntity.cs | 38 - .../AccessRequestAgencyAgencyIdComparer.cs | 21 - .../AccessRequestRoleRoleIdComparer.cs | 21 - .../entities/Comparers/AgencyIdComparer.cs | 21 - backend/entities/Comparers/RoleIdComparer.cs | 21 - .../Comparers/UserAgencyAgencyIdComparer.cs | 21 - .../Comparers/UserRoleRoleIdComparer.cs | 21 - backend/entities/EvalutationKeys.cs | 12 - backend/entities/FiscalKeys.cs | 17 - backend/entities/GoldUser.cs | 39 - .../Helpers/Extensions/BuildingExtensions.cs | 132 - .../Helpers/Extensions/ParcelExtensions.cs | 100 - .../Helpers/Extensions/ProjectExtensions.cs | 124 - backend/entities/LeasedLandTypes.cs | 21 - backend/entities/LookupEntity.cs | 57 - .../entities/Models/AccessRequestFilter.cs | 37 - .../Models/AdministrativeAreaFilter.cs | 92 - backend/entities/Models/AgencyFilter.cs | 112 - backend/entities/Models/AllPropertyFilter.cs | 254 - backend/entities/Models/BuildingFilter.cs | 137 - backend/entities/Models/BuildingModel.cs | 123 - .../Models/DisposalProjectMetadata.cs | 237 - .../Models/DisposalProjectSnapshotMetadata.cs | 13 - backend/entities/Models/EnvironmentModel.cs | 47 - .../Models/LeasedLandMetadataModel.cs | 25 - .../Models/NotificationQueueFilter.cs | 129 - backend/entities/Models/PageFilter.cs | 90 - backend/entities/Models/Paged`.cs | 176 - backend/entities/Models/ParcelFilter.cs | 97 - backend/entities/Models/ParcelModel.cs | 104 - backend/entities/Models/ProjectFilter.cs | 140 - .../Models/ProjectNotificationFilter.cs | 92 - .../Models/ProjectNotificationModel.cs | 61 - backend/entities/Models/ProjectProperty.cs | 75 - backend/entities/Models/PropertyFilter.cs | 260 - backend/entities/Models/PropertyModel.cs | 211 - backend/entities/Models/UserFilter.cs | 158 - backend/entities/NoteTypes.cs | 101 - backend/entities/NotificationAudiences.cs | 33 - backend/entities/NotificationBodyTypes.cs | 11 - backend/entities/NotificationDelays.cs | 14 - backend/entities/NotificationEncodings.cs | 16 - backend/entities/NotificationPriorities.cs | 12 - backend/entities/NotificationQueue.cs | 230 - backend/entities/NotificationResponses.cs | 21 - backend/entities/NotificationStatus.cs | 14 - backend/entities/NotificationTemplate.cs | 134 - backend/entities/Parcel.cs | 108 - backend/entities/ParcelBuildings.cs | 52 - backend/entities/ParcelEvaluation.cs | 79 - backend/entities/ParcelFiscal.cs | 78 - backend/entities/ParcelParcel.cs | 52 - backend/entities/Pims.Dal.Entities.csproj | 20 - backend/entities/Project.cs | 239 - backend/entities/ProjectAgencyResponse.cs | 101 - backend/entities/ProjectNote.cs | 58 - backend/entities/ProjectNumber.cs | 33 - backend/entities/ProjectProperty.cs | 119 - backend/entities/ProjectReport.cs | 75 - backend/entities/ProjectRisk.cs | 46 - backend/entities/ProjectSnapshot.cs | 85 - backend/entities/ProjectStatus.cs | 76 - backend/entities/ProjectStatusHistory.cs | 68 - backend/entities/ProjectStatusNotification.cs | 90 - backend/entities/ProjectStatusTransition.cs | 78 - backend/entities/ProjectTask.cs | 69 - backend/entities/ProjectTypes.cs | 10 - backend/entities/Property.cs | 118 - backend/entities/PropertyClassification.cs | 33 - backend/entities/PropertyType.cs | 27 - backend/entities/PropertyTypes.cs | 12 - backend/entities/Province.cs | 45 - backend/entities/ReportTypes.cs | 10 - backend/entities/Role.cs | 62 - backend/entities/RoleClaim.cs | 69 - backend/entities/Task.cs | 63 - backend/entities/TierLevel.cs | 38 - backend/entities/User.cs | 153 - backend/entities/UserAgency.cs | 69 - backend/entities/UserRole.cs | 69 - backend/entities/Views/Property.cs | 389 -- backend/entities/Workflow.cs | 49 - backend/entities/WorkflowProjectStatus.cs | 75 - backend/entrypoint.sh | 4 - .../geocoder/Configuration/GeocoderOptions.cs | 40 - .../Configuration/IntersectionOptions.cs | 32 - .../geocoder/Configuration/OccupantOptions.cs | 33 - .../geocoder/Configuration/ParcelOptions.cs | 13 - backend/geocoder/Configuration/SiteOptions.cs | 38 - .../Extensions/ParameterExtensions.cs | 85 - .../Extensions/ServiceCollectionExtensions.cs | 26 - backend/geocoder/GeocoderService.cs | 98 - backend/geocoder/IGeocoderService.cs | 14 - backend/geocoder/Models/CrsModel.cs | 12 - backend/geocoder/Models/FaultModel.cs | 11 - .../geocoder/Models/FeatureCollectionModel.cs | 28 - backend/geocoder/Models/FeatureModel.cs | 11 - backend/geocoder/Models/GeometeryModel.cs | 11 - backend/geocoder/Models/GeometryModel.cs | 11 - backend/geocoder/Models/PropertyModel.cs | 49 - .../geocoder/Models/SitePidsResponseModel.cs | 12 - .../Parameters/AddressesParameters.cs | 186 - backend/geocoder/Pims.Geocoder.csproj | 23 - .../Configuration/KeycloakAdminOptions.cs | 42 - .../keycloak/Configuration/KeycloakOptions.cs | 49 - .../KeycloakServiceAccountOptions.cs | 27 - .../HttpResponseMessageExtensions.cs | 75 - .../Extensions/ServiceCollectionExtensions.cs | 20 - backend/keycloak/IKeycloakService.cs | 78 - backend/keycloak/KeycloakService.cs | 48 - backend/keycloak/Models/CountModel.cs | 16 - backend/keycloak/Models/GroupModel.cs | 55 - .../keycloak/Models/RoleCompositieModel.cs | 24 - backend/keycloak/Models/RoleModel.cs | 61 - backend/keycloak/Models/UserInfoModel.cs | 72 - backend/keycloak/Models/UserModel.cs | 79 - .../KeycloakServiceAttackDetection.cs | 26 - .../Partials/KeycloakServiceGroups.cs | 127 - .../keycloak/Partials/KeycloakServiceRoles.cs | 430 -- .../keycloak/Partials/KeycloakServiceUsers.cs | 149 - backend/keycloak/Pims.Keycloak.csproj | 24 - backend/keycloak/README.md | 24 - backend/ltsa/Configuration/LtsaOptions.cs | 40 - .../Extensions/ServiceCollectionExtensions.cs | 28 - backend/ltsa/ILtsaService.cs | 13 - backend/ltsa/LtsaService.cs | 204 - backend/ltsa/Pims.Ltsa.csproj | 24 - .../Configuration/NotificationOptions.cs | 14 - .../Extensions/ServiceCollectionExtensions.cs | 37 - backend/notifications/INotificationService.cs | 17 - backend/notifications/Models/Email.cs | 66 - .../notifications/Models/EmailBodyTypes.cs | 11 - .../notifications/Models/EmailEncodings.cs | 16 - .../notifications/Models/EmailPriorities.cs | 12 - backend/notifications/Models/EmailResponse.cs | 34 - backend/notifications/Models/EmailTemplate.cs | 25 - backend/notifications/Models/IEmail.cs | 55 - .../notifications/Models/IEmailTemplate.cs | 27 - .../notifications/Models/MessageResponse.cs | 45 - .../notifications/Models/StatusResponse.cs | 69 - backend/notifications/NotificationService.cs | 354 -- .../notifications/Pims.Notifications.csproj | 28 - backend/tests/.gitignore | 46 - backend/tests/README.md | 91 - backend/tests/core/ControllerHelper.cs | 148 - backend/tests/core/DatabaseHelper.cs | 276 - .../core/Entities/AccessRequestHelper.cs | 72 - backend/tests/core/Entities/AddressHelper.cs | 70 - .../core/Entities/AdministrativeAreaHelper.cs | 44 - backend/tests/core/Entities/AgencyHelper.cs | 63 - .../Entities/BuildingContructionTypeHelper.cs | 48 - .../core/Entities/BuildingEvaluationHelper.cs | 126 - .../core/Entities/BuildingFiscalHelper.cs | 126 - backend/tests/core/Entities/BuildingHelper.cs | 183 - .../Entities/BuildingOccupantTypeHelper.cs | 46 - .../Entities/BuildingPredominateUseHelper.cs | 62 - .../core/Entities/NotificationQueueHelper.cs | 159 - .../Entities/NotificationTemplateHelper.cs | 85 - .../core/Entities/ParcelEvaluationHelper.cs | 89 - .../tests/core/Entities/ParcelFiscalHelper.cs | 124 - backend/tests/core/Entities/ParcelHelper.cs | 145 - backend/tests/core/Entities/ProjectHelper.cs | 198 - .../core/Entities/ProjectReportHelper.cs | 118 - .../tests/core/Entities/ProjectRiskHelper.cs | 101 - .../core/Entities/ProjectSnapshotHelper.cs | 112 - .../core/Entities/ProjectStatusHelper.cs | 138 - .../Entities/PropertyClassificationHelper.cs | 52 - backend/tests/core/Entities/PropertyHelper.cs | 9 - backend/tests/core/Entities/ProvinceHelper.cs | 35 - backend/tests/core/Entities/RoleHelper.cs | 54 - backend/tests/core/Entities/TaskHelper.cs | 83 - .../tests/core/Entities/TierLevelHelper.cs | 47 - backend/tests/core/Entities/UserHelper.cs | 45 - backend/tests/core/Entities/WorkflowHelper.cs | 154 - .../tests/core/Http/FakeHttpMessageHandler.cs | 40 - backend/tests/core/HttpClientHelper.cs | 31 - backend/tests/core/HttpContextHelper.cs | 138 - backend/tests/core/OptionsHelper.cs | 72 - backend/tests/core/Pims.Core.Test.csproj | 33 - backend/tests/core/PimsAssert.cs | 244 - backend/tests/core/PrincipalHelper.cs | 134 - .../tests/core/ProjectAgencyResponseHelper.cs | 72 - backend/tests/core/ServiceHelper.cs | 187 - backend/tests/core/TestHelper.cs | 186 - backend/tests/core/TestHelperExtensions.cs | 74 - .../Admin/AccessRequestControllerTest.cs | 112 - .../Controllers/Admin/RoleControllerTest.cs | 185 - .../Controllers/Admin/UserControllerTest.cs | 239 - .../api/Controllers/BuildingControllerTest.cs | 222 - .../Keycloak/RoleControllerTest.cs | 142 - .../Keycloak/UserControllerTest.cs | 180 - .../api/Controllers/LookupControllerTest.cs | 191 - .../Notification/QueueControllerTest.cs | 303 -- .../Notification/TemplateControllerTest.cs | 228 - .../api/Controllers/ParcelControllerTest.cs | 264 - .../Project/DisposeControllerTest.cs | 379 -- .../Project/ReportControllerTest.cs | 239 - .../Project/SearchControllerTest.cs | 174 - .../Project/StatusControllerTest.cs | 107 - .../Project/WorkfowControllerTest.cs | 117 - .../Property/SearchControllerTest.cs | 384 -- .../Reports/ProjectControllerTest.cs | 272 - .../Reports/PropertyControllerTest.cs | 518 -- .../Controllers/Reports/UserControllerTest.cs | 329 -- .../Controllers/Tools/ChesControllerTest.cs | 145 - .../Tools/GeocoderControllerTest.cs | 116 - .../Controllers/Tools/ImportControllerTest.cs | 2157 -------- .../Controllers/Tools/LtsaControllerTest.cs | 155 - .../api/Controllers/UserControllerTest.cs | 459 -- .../api/Helpers/ExceptionExtensionsTest.cs | 56 - .../HttpResponseMessageExtensionsTest.cs | 124 - .../api/Mapping/BuildingControllerMapTest.cs | 52 - .../api/Mapping/ParcelControllerMapTest.cs | 47 - backend/tests/unit/api/Pims.Api.Test.csproj | 32 - .../Admin/AccessRequestControllerTest.cs | 68 - .../api/Routes/Admin/ClaimControllerTest.cs | 108 - .../api/Routes/Admin/RoleControllerTest.cs | 120 - .../api/Routes/Admin/UserControllerTest.cs | 121 - .../api/Routes/Keycloak/RoleControllerTest.cs | 99 - .../api/Routes/Keycloak/UserControllerTest.cs | 114 - .../Notification/QueueControllerTest.cs | 125 - .../Notification/TemplateControllerTest.cs | 125 - .../Routes/Project/DisposeControllerTest.cs | 177 - .../Routes/Project/SearchControllerTest.cs | 73 - .../Routes/Project/StatusControllerTest.cs | 85 - .../Routes/Project/WorkflowControllerTest.cs | 72 - .../Routes/Property/BuildingControllerTest.cs | 113 - .../Routes/Property/ParcelControllerTest.cs | 99 - .../Routes/Property/SearchControllerTest.cs | 97 - .../Routes/Reports/PropertyControllerTest.cs | 72 - .../api/Routes/Tools/ChesControllerTest.cs | 100 - .../Routes/Tools/GeocoderControllerTest.cs | 73 - .../api/Routes/Tools/ImportControllerTest.cs | 90 - .../unit/api/Routes/UserControllerTest.cs | 103 - backend/tests/unit/api/coverlet.runsettings | 17 - .../Core/Comparers/DeepPropertyCompareTest.cs | 128 - .../Comparers/DeepPropertyCompareTest`.cs | 128 - .../Comparers/ShallowPropertyCompareTest.cs | 128 - .../Comparers/ShallowPropertyCompareTest`.cs | 128 - .../Converters/BooleanJsonConverterTest.cs | 97 - .../Converters/EnumValueJsonConverterTest.cs | 99 - .../Core/Converters/Int32JsonConverterTest.cs | 100 - .../MicrosecondEpochJsonConverterTest.cs | 105 - .../Core/Extensions/ArrayExtensionsTest.cs | 34 - .../Extensions/CollectionExtensionsTest.cs | 35 - .../dal/Core/Extensions/DateExtensionsTest.cs | 42 - .../Extensions/DictionaryExtensionsTest.cs | 999 ---- .../dal/Core/Extensions/EnumExtensionsTest.cs | 74 - .../Extensions/EnumerableExtensionsTest.cs | 178 - .../unit/dal/Core/Helpers/CsvHelperTest.cs | 131 - .../unit/dal/Core/Helpers/ExceptionHelper.cs | 120 - .../unit/dal/Core/Helpers/StringHelperTest.cs | 66 - .../unit/dal/Core/Helpers/XmlHelperTest.cs | 53 - .../Extensions/BuildingExtensionsTest.cs | 90 - .../Extensions/ProjectExtensionsTest.cs | 89 - .../Extensions/PropertyExtensionsTest.cs | 122 - .../dal/Libraries/Ches/ChesExceptionTest.cs | 144 - .../Ches/ChesServiceCollectionTest.cs | 85 - .../dal/Libraries/Ches/ChesServiceTest.cs | 1190 ----- .../Libraries/Geocoder/GeocoderServiceTest.cs | 15 - .../Keycloak/KeycloakServiceGroupsTest.cs | 593 --- .../Keycloak/KeycloakServiceRolesTest.cs | 1158 ----- .../Libraries/Keycloak/KeycloakServiceTest.cs | 431 -- .../Keycloak/PimsKeycloakUserServiceTest.cs | 220 - .../Ltsa/LtsaServiceCollectionTest.cs | 91 - .../dal/Libraries/Ltsa/LtsaServiceTest.cs | 719 --- .../Notifications/NotificationServiceTest.cs | 320 -- .../unit/dal/Migrations/MigrationTest.cs | 35 - backend/tests/unit/dal/Pims.Dal.Test.csproj | 36 - .../dal/Services/Admin/BuildingServiceTest.cs | 782 --- .../dal/Services/Admin/ParcelServiceTest.cs | 588 --- .../unit/dal/Services/BuildingServiceTest.cs | 836 --- .../Services/NotificationQueueServiceTest.cs | 134 - .../NotificationTemplateServiceTest.cs | 418 -- .../unit/dal/Services/ParcelServiceTest.cs | 1641 ------ .../ProjectNotificationServiceTest.cs | 211 - .../dal/Services/ProjectReportServiceTest.cs | 920 ---- .../unit/dal/Services/ProjectServiceTest.cs | 3389 ------------ .../dal/Services/ProjectStatusServiceTest.cs | 96 - .../unit/dal/Services/PropertyServiceTest.cs | 323 -- .../unit/dal/Services/TaskServiceTest.cs | 96 - .../unit/dal/Services/WorkflowServiceTest.cs | 62 - backend/tests/unit/dal/coverlet.runsettings | 18 - codecov.yml | 31 - database/.gitignore | 6 - database/README.md | 19 - database/mssql/Dockerfile | 15 - database/mssql/README.md | 77 - database/mssql/entrypoint.sh | 13 - database/mssql/scripts/clear-objects.sql | 24 - database/mssql/scripts/init.sql | 12 - database/mssql/setup.sh | 30 - docker-compose.prod.yml | 25 - docker-compose.yml | 87 - frontend/.dockerignore | 11 - frontend/.editorconfig | 21 - frontend/.eslintignore | 2 - frontend/.eslintrc.cjs | 59 - frontend/.gitignore | 32 - frontend/.prettierignore | 6 - frontend/.prettierrc.cjs | 9 - frontend/.vscode/launch.json | 57 - frontend/.vscode/settings.json | 30 - frontend/Dockerfile | 69 - frontend/Dockerfile.ocp | 46 - frontend/README.md | 51 - frontend/cypress.config.ts | 27 - frontend/cypress/e2e/disposalProjects.cy.ts | 627 --- frontend/cypress/e2e/navBar.cy.ts | 248 - frontend/cypress/support/commands.ts | 107 - frontend/cypress/support/e2e.ts | 20 - frontend/cypress/support/index.ts | 8 - frontend/cypress/tsconfig.json | 9 - frontend/index.html | 59 - frontend/nginx.conf | 10 - frontend/package.json | 217 - frontend/prod.nginx.conf | 10 - frontend/public/basemaps.json | 16 - frontend/public/favicon-32x32.ico | Bin 951 -> 0 bytes frontend/public/favicon.ico | Bin 15446 -> 0 bytes frontend/public/logo192.png | Bin 5347 -> 0 bytes frontend/public/logo512.png | Bin 9664 -> 0 bytes frontend/public/manifest.json | 10 - frontend/public/robots.txt | 2 - frontend/public/satellite.jpg | Bin 4118 -> 0 bytes frontend/public/streets.jpg | Bin 2883 -> 0 bytes frontend/src/App.scss | 88 - frontend/src/App.tsx | 76 - frontend/src/OnLoadActions.tsx | 32 - frontend/src/__mocks__/popper.js.js | 15 - frontend/src/__mocks__/react-text-mask.tsx | 28 - frontend/src/__mocks__/svg-mock.tsx | 9 - frontend/src/_variables.module.scss | 32 - frontend/src/_variables.scss | 4 - frontend/src/actions/IAddNewRoleAndAgency.ts | 6 - frontend/src/actions/IFilterData.ts | 5 - frontend/src/actions/ILookupCode.ts | 11 - frontend/src/actions/ISort.ts | 4 - frontend/src/actions/parcelsActions.ts | 294 -- .../assets/images/PIMSlogo/favicon-16x16.ico | Bin 565 -> 0 bytes .../src/assets/images/PIMSlogo/logo_only.png | Bin 2694 -> 0 bytes .../assets/images/PIMSlogo/logo_with_text.png | Bin 5163 -> 0 bytes frontend/src/assets/images/SPP.svg | 3 - frontend/src/assets/images/SeasideBlue.png | Bin 777276 -> 0 bytes frontend/src/assets/images/close-square.svg | 12 - .../src/assets/images/draft-building-icon.svg | 1 - .../src/assets/images/draft-parcel-icon.svg | 1 - frontend/src/assets/images/icon-building.png | Bin 415 -> 0 bytes frontend/src/assets/images/icon-business.svg | 24 - frontend/src/assets/images/icon-land.png | Bin 518 -> 0 bytes frontend/src/assets/images/icon-lot.svg | 7 - frontend/src/assets/images/icon-subdiv.png | Bin 531 -> 0 bytes frontend/src/assets/images/logo-banner.svg | 77 - .../images/pins/building-erp-highlight.png | Bin 2732 -> 0 bytes .../src/assets/images/pins/building-erp.png | Bin 2729 -> 0 bytes .../images/pins/building-reg-highlight.png | Bin 2859 -> 0 bytes .../src/assets/images/pins/building-reg.png | Bin 2748 -> 0 bytes .../images/pins/building-spl-highlight.png | Bin 2729 -> 0 bytes .../src/assets/images/pins/building-spl.png | Bin 2624 -> 0 bytes .../assets/images/pins/land-erp-highlight.png | Bin 3475 -> 0 bytes frontend/src/assets/images/pins/land-erp.png | Bin 3669 -> 0 bytes .../assets/images/pins/land-reg-highlight.png | Bin 3580 -> 0 bytes frontend/src/assets/images/pins/land-reg.png | Bin 3835 -> 0 bytes .../assets/images/pins/land-spl-highlight.png | Bin 3453 -> 0 bytes frontend/src/assets/images/pins/land-spl.png | Bin 3574 -> 0 bytes .../images/pins/marker-blue-highlight.png | Bin 2087 -> 0 bytes .../src/assets/images/pins/marker-blue.png | Bin 2004 -> 0 bytes .../src/assets/images/pins/marker-green.png | Bin 2649 -> 0 bytes .../images/pins/marker-green_highlight.png | Bin 2090 -> 0 bytes .../images/pins/marker-icon-1x-blue.png | Bin 1961 -> 0 bytes .../images/pins/marker-icon-1x-green.png | Bin 1924 -> 0 bytes .../images/pins/marker-icon-2x-blue.png | Bin 4033 -> 0 bytes .../images/pins/marker-icon-2x-green.png | Bin 4203 -> 0 bytes .../assets/images/pins/marker-icon-2x-red.png | Bin 4230 -> 0 bytes .../images/pins/marker-icon-2x-violet.png | Bin 4190 -> 0 bytes .../images/pins/marker-purple-highlight.png | Bin 1972 -> 0 bytes .../src/assets/images/pins/marker-purple.png | Bin 1957 -> 0 bytes .../images/pins/marker-red-highlight.png | Bin 2023 -> 0 bytes .../src/assets/images/pins/marker-red.png | Bin 1981 -> 0 bytes .../src/assets/images/pins/marker-shadow.png | Bin 608 -> 0 bytes .../images/pins/subdiv-erp-highlight.png | Bin 2818 -> 0 bytes .../src/assets/images/pins/subdiv-erp.png | Bin 2848 -> 0 bytes .../images/pins/subdiv-reg-highlight.png | Bin 2861 -> 0 bytes .../src/assets/images/pins/subdiv-reg.png | Bin 2942 -> 0 bytes .../images/pins/subdiv-spl-highlight.png | Bin 2792 -> 0 bytes .../src/assets/images/pins/subdiv-spl.png | Bin 2771 -> 0 bytes frontend/src/assets/images/profile.svg | 1 - .../assets/images/project-diagram-solid.svg | 1 - frontend/src/buttons.scss | 189 - frontend/src/colors.scss | 26 - .../src/components/SearchBar/FilterBar.scss | 23 - .../components/SearchBar/FilterBar.test.tsx | 24 - .../src/components/SearchBar/FilterBar.tsx | 120 - .../SearchBar/FindMorePropertiesForm.scss | 74 - .../SearchBar/FindMorePropertiesForm.test.tsx | 99 - .../SearchBar/FindMorePropertiesForm.tsx | 181 - .../__snapshots__/FilterBar.test.tsx.snap | 114 - .../FindMorePropertiesForm.test.tsx.snap | 481 -- .../src/components/Table/ColumnFilter.scss | 27 - .../components/Table/ColumnFilter.test.tsx | 243 - .../src/components/Table/ColumnFilter.tsx | 100 - frontend/src/components/Table/ColumnSort.tsx | 48 - frontend/src/components/Table/MoneyCell.tsx | 56 - .../Table/PageSizeSelector.test.tsx | 29 - .../src/components/Table/PageSizeSelector.tsx | 49 - .../src/components/Table/PropertyTypeCell.tsx | 25 - frontend/src/components/Table/Table.scss | 122 - frontend/src/components/Table/Table.tsx | 778 --- .../src/components/Table/TablePagination.scss | 5 - .../src/components/Table/TablePagination.tsx | 63 - frontend/src/components/Table/TableSort.ts | 6 - .../src/components/Table/ViewPropertyCell.tsx | 48 - .../PageSizeSelector.test.tsx.snap | 102 - frontend/src/components/Table/constants.ts | 2 - frontend/src/components/Table/index.ts | 6 - frontend/src/components/Table/types.ts | 24 - .../src/components/bcAssessment/BCADialog.tsx | 146 - .../src/components/bootstrap/Jumbotron.tsx | 29 - frontend/src/components/bootstrap/index.ts | 1 - .../src/components/common/AbbreviatedText.tsx | 26 - frontend/src/components/common/ErrorModal.tsx | 39 - frontend/src/components/common/ErrorTabs.tsx | 68 - .../src/components/common/FormikPersist.tsx | 140 - .../src/components/common/GenericModal.tsx | 137 - frontend/src/components/common/Icons.ts | 7 - frontend/src/components/common/Label.scss | 7 - frontend/src/components/common/Label.tsx | 20 - frontend/src/components/common/LinkList.tsx | 60 - frontend/src/components/common/Snackbar.tsx | 42 - frontend/src/components/common/Stepper.scss | 201 - frontend/src/components/common/Stepper.tsx | 62 - .../src/components/common/TooltipIcon.scss | 25 - .../src/components/common/TooltipIcon.tsx | 45 - .../src/components/common/TooltipWrapper.tsx | 52 - .../src/components/common/form/Button.scss | 33 - .../src/components/common/form/Button.tsx | 55 - .../src/components/common/form/Check.scss | 17 - .../src/components/common/form/Check.test.tsx | 52 - frontend/src/components/common/form/Check.tsx | 172 - .../common/form/DisplayCurrency.scss | 4 - .../common/form/DisplayCurrency.tsx | 30 - .../components/common/form/DisplayError.tsx | 26 - .../common/form/FastCurrencyInput.scss | 13 - .../common/form/FastCurrencyInput.test.tsx | 72 - .../common/form/FastCurrencyInput.tsx | 156 - .../common/form/FastDatePicker.test.tsx | 66 - .../components/common/form/FastDatePicker.tsx | 160 - .../common/form/FastFiscalYearInput.tsx | 87 - .../src/components/common/form/FastInput.tsx | 145 - .../src/components/common/form/FastSelect.tsx | 195 - frontend/src/components/common/form/Field.tsx | 47 - frontend/src/components/common/form/Form.scss | 29 - frontend/src/components/common/form/Form.tsx | 32 - .../src/components/common/form/Input.scss | 4 - frontend/src/components/common/form/Input.tsx | 139 - .../components/common/form/InputGroup.scss | 30 - .../src/components/common/form/InputGroup.tsx | 125 - .../common/form/LimitedSelect.test.tsx | 69 - .../common/form/ParentSelect.test.tsx | 90 - .../components/common/form/ParentSelect.tsx | 213 - .../src/components/common/form/PlusButton.tsx | 29 - .../common/form/RadioButtonGroup.tsx | 95 - .../components/common/form/ResetButton.tsx | 26 - .../components/common/form/SearchButton.tsx | 25 - .../src/components/common/form/Select.scss | 14 - .../src/components/common/form/Select.tsx | 154 - .../common/form/StepForm/SteppedForm.md | 32 - .../common/form/StepForm/SteppedForm.scss | 67 - .../common/form/StepForm/SteppedForm.test.tsx | 106 - .../common/form/StepForm/SteppedForm.tsx | 212 - .../common/form/StepForm/StepperField.md | 22 - .../common/form/StepForm/StepperField.tsx | 22 - .../__snapshots__/SteppedForm.test.tsx.snap | 246 - .../common/form/StepForm/context.tsx | 195 - .../components/common/form/StepForm/index.ts | 3 - .../components/common/form/StepForm/types.ts | 59 - .../components/common/form/StringButton.tsx | 31 - .../src/components/common/form/TextArea.tsx | 69 - .../src/components/common/form/Typeahead.tsx | 157 - .../common/form/UserRoleSelector.tsx | 173 - .../FastCurrencyInput.test.tsx.snap | 41 - .../__snapshots__/LimitedSelect.test.tsx.snap | 35 - .../__snapshots__/ParentSelect.test.tsx.snap | 67 - frontend/src/components/common/form/index.ts | 16 - .../src/components/common/tabValidation.ts | 10 - frontend/src/components/flex/Col.tsx | 15 - frontend/src/components/flex/Row.tsx | 17 - frontend/src/components/flex/index.ts | 2 - frontend/src/components/flex/styled/Col.tsx | 14 - frontend/src/components/flex/styled/Row.tsx | 14 - frontend/src/components/flex/styled/index.ts | 2 - .../layout/AppNavBar/AppNavBar.scss | 73 - .../layout/AppNavBar/AppNavBar.test.tsx | 361 -- .../components/layout/AppNavBar/AppNavBar.tsx | 233 - .../__snapshots__/AppNavBar.test.tsx.snap | 173 - .../src/components/layout/Footer/Footer.scss | 20 - .../components/layout/Footer/Footer.test.tsx | 11 - .../src/components/layout/Footer/Footer.tsx | 19 - .../Footer/__snapshots__/Footer.test.tsx.snap | 40 - .../layout/Header/EmptyHeader.test.tsx | 11 - .../components/layout/Header/EmptyHeader.tsx | 45 - .../src/components/layout/Header/Header.scss | 67 - .../components/layout/Header/Header.test.tsx | 87 - .../src/components/layout/Header/Header.tsx | 163 - .../components/layout/Header/UserProfile.tsx | 102 - .../__snapshots__/EmptyHeader.test.tsx.snap | 69 - .../Header/__snapshots__/Header.test.tsx.snap | 69 - frontend/src/components/layout/index.ts | 4 - .../components/leaflet/ControlPanel.test.tsx | 69 - .../src/components/leaflet/ControlPanel.tsx | 75 - .../__snapshots__/ControlPanel.test.tsx.snap | 110 - frontend/src/components/leaflet/index.ts | 3 - frontend/src/components/ltsa/Charges.tsx | 34 - .../src/components/ltsa/LTSADialog.test.tsx | 171 - frontend/src/components/ltsa/LTSADialog.tsx | 47 - .../components/ltsa/OwnershipInformation.tsx | 34 - frontend/src/components/ltsa/TitleDetails.tsx | 98 - .../src/components/maps/BasemapToggle.scss | 57 - .../components/maps/BasemapToggle.test.tsx | 70 - .../src/components/maps/BasemapToggle.tsx | 46 - .../maps/FindMorePropertiesButton.scss | 44 - .../maps/FindMorePropertiesButton.tsx | 71 - .../__snapshots__/BasemapToggle.test.tsx.snap | 26 - .../maps/hooks/useActiveFeatureLayer.test.tsx | 155 - .../maps/hooks/useActiveFeatureLayer.tsx | 144 - .../maps/hooks/useMapRefreshEvent.tsx | 16 - .../maps/hooks/useSupercluster.test.tsx | 83 - .../components/maps/hooks/useSupercluster.ts | 57 - .../maps/leaflet/FilterBackdrop/index.tsx | 31 - .../InfoSlideOut/AssociatedBuildingsList.tsx | 71 - .../InfoSlideOut/AssociatedParcelsList.tsx | 54 - .../InfoSlideOut/AssociatedTab.test.tsx | 79 - .../InfoSlideOut/BuildingAttributes.tsx | 95 - .../leaflet/InfoSlideOut/HeaderActions.scss | 28 - .../InfoSlideOut/HeaderActions.test.tsx | 86 - .../leaflet/InfoSlideOut/HeaderActions.tsx | 113 - .../leaflet/InfoSlideOut/InfoContent.test.tsx | 332 -- .../maps/leaflet/InfoSlideOut/InfoContent.tsx | 225 - .../leaflet/InfoSlideOut/InfoSlideOut.scss | 45 - .../InfoSlideOut/InfoSlideOut.test.tsx | 106 - .../leaflet/InfoSlideOut/InfoSlideOut.tsx | 343 -- .../leaflet/InfoSlideOut/ParcelAttributes.tsx | 87 - .../leaflet/InfoSlideOut/ParcelPIDPIN.tsx | 28 - .../InfoSlideOut/ProjectNumberLink.tsx | 67 - .../leaflet/InfoSlideOut/ThreeColumnItem.tsx | 48 - .../__snapshots__/AssociatedTab.test.tsx.snap | 309 -- .../__snapshots__/HeaderActions.test.tsx.snap | 285 -- .../__snapshots__/InfoContent.test.tsx.snap | 253 - .../maps/leaflet/InventoryLayer.tsx | 366 -- .../LayerPopup/LayerPopUpContent.test.tsx | 81 - .../leaflet/LayerPopup/LayerPopupContent.tsx | 146 - .../LayerPopUpContent.test.tsx.snap | 3 - .../leaflet/LayerPopup/constants/index.tsx | 71 - .../LayerPopup/hooks/useLayerQuery.test.tsx | 180 - .../LayerPopup/hooks/useLayerQuery.tsx | 214 - .../maps/leaflet/LayerPopup/index.ts | 3 - .../leaflet/LayersControl/LayersControl.md | 17 - .../LayersControl/LayersControl.test.tsx | 106 - .../leaflet/LayersControl/LayersControl.tsx | 129 - .../maps/leaflet/LayersControl/LayersTree.tsx | 332 -- .../__snapshots__/LayersControl.test.tsx.snap | 438 -- .../maps/leaflet/LayersControl/data.ts | 236 - .../maps/leaflet/LayersControl/index.ts | 1 - .../maps/leaflet/LayersControl/types.ts | 7 - .../maps/leaflet/LeafletDraw/LeafletDraw.md | 49 - .../maps/leaflet/LeafletDraw/LeafletDraw.scss | 32 - .../maps/leaflet/LeafletDraw/LeafletDraw.tsx | 128 - .../maps/leaflet/LeafletDraw/index.ts | 1 - .../maps/leaflet/Legend/Legend.scss | 27 - .../maps/leaflet/Legend/Legend.test.tsx | 11 - .../components/maps/leaflet/Legend/Legend.tsx | 55 - .../maps/leaflet/Legend/LegendControl.scss | 32 - .../leaflet/Legend/LegendControl.test.tsx | 40 - .../maps/leaflet/Legend/LegendControl.tsx | 40 - .../Legend/__snapshots__/Legend.test.tsx.snap | 107 - .../__snapshots__/LegendControl.test.tsx.snap | 131 - frontend/src/components/maps/leaflet/Map.scss | 48 - frontend/src/components/maps/leaflet/Map.tsx | 515 -- .../maps/leaflet/MapProperties.test.tsx | 378 -- .../maps/leaflet/PointClusterer.scss | 39 - .../maps/leaflet/PointClusterer.tsx | 492 -- .../SelectedPropertyMarker.tsx | 27 - .../src/components/maps/leaflet/Spiderfier.ts | 214 - .../maps/leaflet/ZoomOut/ZoomOutButton.tsx | 44 - .../src/components/maps/leaflet/mapUtils.tsx | 419 -- .../src/components/maps/leaflet/warning.svg | 1 - .../maps/providers/FIlterProvider.tsx | 22 - .../maps/providers/PropertyPopUpProvider.tsx | 52 - frontend/src/components/maps/types.ts | 21 - frontend/src/components/menu/Menu.scss | 58 - frontend/src/components/menu/Menu.tsx | 119 - .../src/components/navigation/dropdown.svg | 1 - frontend/src/components/navigation/logout.svg | 1 - frontend/src/components/tabs/Tab.tsx | 44 - frontend/src/components/tabs/Tabs.tsx | 16 - frontend/src/components/tabs/index.ts | 2 - frontend/src/components/tabs/styled/Tabs.tsx | 46 - frontend/src/components/tabs/styled/index.ts | 1 - frontend/src/constants/API.ts | 163 - frontend/src/constants/accessStatus.ts | 12 - frontend/src/constants/actionTypes.ts | 85 - frontend/src/constants/claims.ts | 29 - frontend/src/constants/classifications.ts | 19 - frontend/src/constants/environment.ts | 4 - frontend/src/constants/evaluationKeys.ts | 5 - frontend/src/constants/fiscalKeys.ts | 4 - frontend/src/constants/index.ts | 9 - frontend/src/constants/noteTypes.ts | 51 - frontend/src/constants/propertySteps.ts | 30 - frontend/src/constants/propertyTypeNames.ts | 9 - frontend/src/constants/propertyTypes.ts | 8 - frontend/src/constants/reducerTypes.ts | 54 - frontend/src/constants/roles.ts | 15 - frontend/src/constants/strings.tsx | 52 - frontend/src/constants/toasts.ts | 153 - frontend/src/constants/trueFalse.ts | 8 - frontend/src/constants/workflows.ts | 13 - frontend/src/contexts/authStateContext.tsx | 44 - frontend/src/customAxios.ts | 87 - .../account/IENotSupportedPage.test.tsx | 41 - .../features/account/IENotSupportedPage.tsx | 20 - frontend/src/features/account/Login.scss | 100 - frontend/src/features/account/Login.test.tsx | 125 - frontend/src/features/account/Login.tsx | 137 - .../features/account/LoginLoading.test.tsx | 11 - .../src/features/account/LoginLoading.tsx | 42 - frontend/src/features/account/Logout.tsx | 21 - .../IENotSupportedPage.test.tsx.snap | 16 - .../account/__snapshots__/Login.test.tsx.snap | 63 - .../__snapshots__/LoginLoading.test.tsx.snap | 74 - frontend/src/features/account/index.ts | 6 - .../access-request/AccessRequestPage.scss | 96 - .../access-request/AccessRequestPage.test.tsx | 175 - .../access-request/AccessRequestPage.tsx | 252 - .../AccessRequestPage.test.tsx.snap | 256 - .../admin/access/ManageAccessRequests.scss | 78 - .../access/ManageAccessRequests.test.tsx | 135 - .../admin/access/ManageAccessRequests.tsx | 105 - .../ManageAccessRequests.test.tsx.snap | 971 ---- .../components/AccessRequestActions.test.tsx | 23 - .../components/AccessRequestActions.tsx | 57 - .../admin/access/components/Details.test.tsx | 33 - .../admin/access/components/Details.tsx | 95 - .../admin/access/components/Filter.scss | 21 - .../admin/access/components/Filter.tsx | 115 - .../access/components/RowActions.test.tsx | 100 - .../admin/access/components/RowActions.tsx | 84 - .../AccessRequestActions.test.tsx.snap | 18 - .../__snapshots__/Details.test.tsx.snap | 3 - .../admin/access/constants/constants.tsx | 75 - .../features/admin/access/interfaces/index.ts | 15 - .../admin/admin-areas/AdminAreasFilterBar.tsx | 64 - .../admin/admin-areas/EditAdminArea.scss | 30 - .../admin/admin-areas/EditAdminArea.test.tsx | 48 - .../admin/admin-areas/EditAdminArea.tsx | 176 - .../admin-areas/ManageAdminAreas.test.tsx | 141 - .../admin/admin-areas/ManageAdminAreas.tsx | 125 - .../__snapshots__/EditAdminArea.test.tsx.snap | 77 - .../ManageAdminAreas.test.tsx.snap | 221 - .../admin-areas/interfaces/addAdminArea.ts | 4 - .../admin-areas/interfaces/adminAreaFilter.ts | 8 - .../interfaces/administrativeArea.ts | 12 - .../admin-areas/interfaces/apiAdminArea.ts | 12 - .../admin/admin-areas/interfaces/index.ts | 4 - .../features/admin/admin-areas/utils/utils.ts | 16 - .../admin/agencies/AgencyFilterBar.tsx | 50 - .../admin/agencies/EditAgencyPage.scss | 31 - .../admin/agencies/EditAgencyPage.test.tsx | 204 - .../admin/agencies/EditAgencyPage.tsx | 326 -- .../admin/agencies/ManageAgencies.scss | 35 - .../admin/agencies/ManageAgencies.test.tsx | 129 - .../admin/agencies/ManageAgencies.tsx | 120 - .../EditAgencyPage.test.tsx.snap | 355 -- .../ManageAgencies.test.tsx.snap | 399 -- .../src/features/admin/constants/columns.tsx | 46 - .../admin/edit-user/EditUserPage.scss | 41 - .../admin/edit-user/EditUserPage.test.tsx | 180 - .../features/admin/edit-user/EditUserPage.tsx | 387 -- .../__snapshots__/EditUserPage.test.tsx.snap | 65 - .../admin/edit-user/useEditUserService.tsx | 82 - .../src/features/admin/users/ManageUsers.scss | 23 - .../features/admin/users/ManageUsers.test.tsx | 182 - .../src/features/admin/users/ManageUsers.tsx | 175 - .../__snapshots__/ManageUsers.test.tsx.snap | 1175 ----- .../users/components/RowActions.test.tsx | 97 - .../admin/users/components/RowActions.tsx | 63 - .../users/components/UsersFilterBar.scss | 17 - .../admin/users/components/UsersFilterBar.tsx | 69 - .../features/admin/users/constants/index.tsx | 94 - .../admin/users/interfaces/IUserRecord.ts | 25 - .../src/features/help/components/HelpBox.scss | 24 - .../src/features/help/components/HelpBox.tsx | 58 - .../features/help/components/HelpModal.scss | 8 - .../features/help/components/HelpModal.tsx | 116 - .../help/components/HelpSubmitBox.scss | 12 - .../help/components/HelpSubmitBox.tsx | 63 - .../text/AssesDisposalProjectText.tsx | 13 - .../text/CreateDisposalNavigationHelpText.tsx | 13 - .../text/DetailNavigationHelpText.tsx | 26 - .../components/text/DetailViewHelpText.tsx | 21 - .../components/text/DisposalStepsHelpText.tsx | 25 - .../text/InventoryFilterHelpText.tsx | 30 - .../components/text/InventoryListHelpText.tsx | 18 - .../text/InventoryNavigationHelpText.tsx | 26 - .../components/text/LandingFilterHelpText.tsx | 37 - .../components/text/LandingMapHelpText.tsx | 22 - .../text/LandingNavigationHelpText.tsx | 26 - .../text/ProjectAssessmentNotesHelpText.tsx | 16 - .../help/components/text/TutorialHelpText.tsx | 55 - .../src/features/help/constants/HelpText.tsx | 115 - .../help/containers/HelpContainer.tsx | 37 - .../containers/HelpModalContentContainer.tsx | 72 - .../src/features/help/forms/BugForm.test.tsx | 25 - frontend/src/features/help/forms/BugForm.tsx | 107 - .../help/forms/FeatureRequestForm.test.tsx | 22 - .../help/forms/FeatureRequestForm.tsx | 82 - .../src/features/help/forms/HelpForms.scss | 14 - .../features/help/forms/QuestionForm.test.tsx | 23 - .../src/features/help/forms/QuestionForm.tsx | 87 - frontend/src/features/help/interfaces.tsx | 36 - .../SidebarContents/AssociatedLandForm.tsx | 707 --- .../SidebarContents/BuildingForm.scss | 3 - .../SidebarContents/BuildingForm.test.tsx | 146 - .../SidebarContents/BuildingForm.tsx | 483 -- .../mapSideBar/SidebarContents/LandForm.scss | 34 - .../SidebarContents/LandForm.test.tsx | 207 - .../mapSideBar/SidebarContents/LandForm.tsx | 484 -- .../SubmitPropertySelector.test.tsx | 28 - .../SubmitPropertySelector.tsx | 144 - .../__snapshots__/BuildingForm.test.tsx.snap | 986 ---- .../__snapshots__/LandForm.test.tsx.snap | 1184 ----- .../SubmitPropertySelector.test.tsx.snap | 177 - .../mapSideBar/SidebarContents/index.ts | 3 - .../subforms/AddParentParcelsForm.test.tsx | 116 - .../subforms/AddParentParcelsForm.tsx | 145 - .../subforms/AssociatedBuildingListForm.scss | 9 - .../subforms/AssociatedBuildingListForm.tsx | 47 - .../subforms/AssociatedLandListForm.tsx | 47 - .../subforms/AssociatedLandReviewPage.scss | 22 - .../AssociatedLandReviewPage.test.tsx | 42 - .../subforms/AssociatedLandReviewPage.tsx | 129 - .../subforms/BuildingReviewPage.test.tsx | 167 - .../subforms/BuildingReviewPage.tsx | 129 - .../subforms/BuildingValuationForm.test.tsx | 31 - .../subforms/BuildingValuationForm.tsx | 37 - .../subforms/ClassificationForm.test.tsx | 169 - .../subforms/ClassificationForm.tsx | 199 - .../subforms/IdentificationForm.scss | 53 - .../subforms/IdentificationForm.tsx | 266 - .../subforms/LandOwnershipForm.scss | 3 - .../subforms/LandOwnershipForm.tsx | 69 - .../subforms/LandReviewPage.scss | 148 - .../subforms/LandReviewPage.tsx | 144 - .../subforms/LandSearchForm.scss | 12 - .../subforms/LandSearchForm.test.tsx | 204 - .../subforms/LandSearchForm.tsx | 228 - .../subforms/LandUsageForm.scss | 32 - .../subforms/LandUsageForm.tsx | 90 - .../subforms/LandValuationForm.tsx | 44 - .../subforms/LeasedLandOther.tsx | 27 - .../subforms/LeasedLandOwned.tsx | 22 - .../subforms/OccupancyForm.test.tsx | 63 - .../subforms/OccupancyForm.tsx | 138 - .../subforms/ParcelIdentificationForm.scss | 104 - .../subforms/ParcelIdentificationForm.tsx | 348 -- .../SidebarContents/subforms/TenancyForm.scss | 42 - .../subforms/ValuationForm.scss | 44 - .../AddParentParcelsForm.test.tsx.snap | 271 - .../AssociatedLandReviewPage.test.tsx.snap | 18 - .../BuildingReviewPage.test.tsx.snap | 276 - .../BuildingValuationForm.test.tsx.snap | 1286 ----- .../ClassificationForm.test.tsx.snap | 16 - .../LandSearchForm.test.tsx.snap | 1184 ----- .../__snapshots__/OccupancyForm.test.tsx.snap | 229 - .../mapSideBar/components/InventoryPolicy.tsx | 25 - .../mapSideBar/components/MapDropPin.scss | 7 - .../mapSideBar/components/MapDropPin.test.tsx | 79 - .../mapSideBar/components/MapDropPin.tsx | 72 - .../components/MapSideBarLayout.scss | 29 - .../components/MapSideBarLayout.tsx | 87 - .../components/tables/ChargeTable.tsx | 107 - .../components/tables/OwnershipTable.tsx | 110 - .../components/tabs/BuildingDetails.scss | 3 - .../components/tabs/BuildingDetails.tsx | 322 -- .../components/tabs/HeaderDivider.tsx | 6 - .../components/tabs/OccupancyValuation.tsx | 225 - .../components/tabs/ParcelDetails.scss | 11 - .../components/tabs/ParcelDetails.tsx | 357 -- .../mapSideBar/components/tabs/TabStyles.ts | 8 - .../components/tabs/TitleOwnership.tsx | 61 - .../components/tabs/UsageValuation.tsx | 207 - .../containers/MapSideBarContainer.test.tsx | 99 - .../containers/MapSideBarContainer.tsx | 677 --- .../MapSideBarContainer.test.tsx.snap | 3 - .../mapSideBar/hooks/useBuildingApi.tsx | 85 - .../mapSideBar/hooks/useQueryParamSideBar.tsx | 210 - .../hooks/useSideBarBuildingLoader.tsx | 84 - .../useSideBarBuildingWithParcelLoader.tsx | 66 - .../hooks/useSideBarParcelLoader.tsx | 95 - frontend/src/features/projects/apiService.ts | 53 - .../components/ReviewApproveActions.test.tsx | 226 - .../components/ReviewApproveActions.tsx | 190 - .../ReviewApproveExemption.test.tsx | 98 - .../assess/forms/ReviewApproveForm.scss | 27 - .../assess/forms/ReviewApproveForm.tsx | 136 - .../src/features/projects/assess/index.ts | 4 - .../assess/steps/ReviewApproveStep.test.tsx | 270 - .../assess/steps/ReviewApproveStep.tsx | 203 - .../ReviewApproveStep.test.tsx.snap | 3 - .../common/ApprovalTransitionPage.tsx | 104 - .../projects/common/ProjectLayout.scss | 160 - .../projects/common/ProjectLayout.tsx | 24 - .../projects/common/ProjectRouter.test.tsx | 166 - .../projects/common/ProjectRouter.tsx | 88 - .../common/components/EditButton.test.tsx | 33 - .../projects/common/components/EditButton.tsx | 28 - .../projects/common/components/FilterBar.scss | 32 - .../projects/common/components/FilterBar.tsx | 135 - .../common/components/FormikTable.tsx | 55 - .../common/components/ManualLink.scss | 20 - .../projects/common/components/ManualLink.tsx | 25 - .../common/components/NotificationCheck.tsx | 32 - .../components/ProjectFinancialTable.tsx | 171 - .../common/components/ProjectNotes.scss | 12 - .../common/components/ProjectNotes.tsx | 120 - .../components/PropertyListViewSelect.tsx | 224 - .../components/PropertyListViewUpdate.tsx | 152 - .../SelectProjectPropertiesPage.tsx | 51 - .../common/components/SresManual.scss | 16 - .../projects/common/components/SresManual.tsx | 33 - .../common/components/StepErrorSummary.tsx | 18 - .../common/components/StepStatusIcon.tsx | 82 - .../__snapshots__/EditButton.test.tsx.snap | 12 - .../projects/common/components/columns.tsx | 366 -- .../AdditionalPropertyInformationForm.tsx | 76 - .../common/forms/AppraisalCheckListForm.tsx | 54 - .../common/forms/ApprovalConfirmationForm.tsx | 36 - .../common/forms/DocumentationForm.tsx | 64 - .../forms/FirstNationsCheckListForm.tsx | 47 - .../projects/common/forms/GreTransferForm.tsx | 75 - .../common/forms/ProjectDraftForm.scss | 27 - .../common/forms/ProjectDraftForm.tsx | 136 - .../forms/SelectProjectPropertiesForm.tsx | 39 - .../projects/common/forms/TasksForm.tsx | 38 - .../projects/common/forms/UpdateInfoForm.scss | 9 - .../common/forms/UpdateInfoForm.test.tsx | 148 - .../projects/common/forms/UpdateInfoForm.tsx | 211 - .../UpdateInfoForm.test.tsx.snap | 732 --- .../common/hooks/useAgencyResponseTable.tsx | 47 - .../projects/common/hooks/useProject.tsx | 46 - .../common/hooks/useStepForm.test.tsx | 94 - .../projects/common/hooks/useStepForm.tsx | 143 - .../src/features/projects/common/index.ts | 36 - .../projects/common/projectConverter.test.tsx | 445 -- .../projects/common/projectConverter.ts | 332 -- .../projects/common/projectsActionCreator.ts | 100 - .../projects/common/slices/projectSlice.ts | 33 - .../common/slices/projectStatusesSlice.ts | 23 - .../common/slices/projectTasksSlice.ts | 24 - .../common/slices/projectWorkflowSlice.ts | 25 - .../slices/projectWorkflowTasksSlice.ts | 24 - .../src/features/projects/common/strings.ts | 54 - .../projects/common/tabs/DocumentationTab.tsx | 52 - .../projects/common/tabs/NotificationList.tsx | 21 - .../projects/common/tabs/NotificationTab.tsx | 70 - .../common/tabs/ProjectInformationTab.tsx | 45 - .../features/projects/common/tabs/columns.tsx | 35 - .../common/tabs/projectTabValidation.ts | 63 - .../common/utils/calcGainBeforeSpl.ts | 15 - .../projects/common/utils/calcNetProceeds.ts | 8 - .../projects/common/utils/getNumber.ts | 9 - .../features/projects/common/utils/index.ts | 3 - .../projects/constants/AgencyResponses.ts | 8 - .../projects/constants/DisposalWorkflows.ts | 4 - .../constants/DisposeWorkflowStatus.ts | 8 - .../constants/ProjectWorkflowComponents.tsx | 43 - .../constants/ReviewWorkflowStatus.ts | 9 - .../projects/constants/SPPApprovalTabs.ts | 8 - .../projects/constants/defaultValues.ts | 80 - .../src/features/projects/constants/index.ts | 6 - .../projects/disposals/DisposalProject.tsx | 143 - .../projects/disposals/ProjectLayout.tsx | 19 - .../projects/disposals/ProjectStatus.tsx | 159 - .../projects/disposals/ProjectTabs.tsx | 86 - .../disposals/close-out/ProjectCloseOut.tsx | 230 - .../projects/disposals/close-out/index.ts | 1 - .../close-out/styled/ProjectCloseOut.tsx | 4 - .../disposals/close-out/styled/index.ts | 1 - .../close-out/utils/calcGainBeforeSpl.ts | 15 - .../close-out/utils/calcNetProceeds.ts | 8 - .../disposals/close-out/utils/getNumber.ts | 9 - .../disposals/close-out/utils/index.ts | 3 - .../disposals/constants/defaultFilter.ts | 13 - .../disposals/constants/defaultProjectForm.ts | 96 - .../projects/disposals/constants/index.ts | 2 - .../documentation/ProjectDocumentation.tsx | 129 - .../projects/disposals/documentation/index.ts | 1 - .../styled/ProjectDocumentation.tsx | 4 - .../disposals/documentation/styled/index.ts | 1 - .../projects/disposals/erp/AgencyInterest.tsx | 95 - .../disposals/erp/ProjectERPApproval.tsx | 102 - .../disposals/erp/ProjectERPComplete.tsx | 109 - .../disposals/erp/ProjectERPDisposed.tsx | 65 - .../disposals/erp/ProjectERPExemption.tsx | 51 - .../projects/disposals/erp/ProjectERPTabs.tsx | 52 - .../erp/constants/AgencyInterestColumns.tsx | 77 - .../projects/disposals/erp/constants/index.ts | 1 - .../features/projects/disposals/erp/index.ts | 6 - .../disposals/erp/styled/ProjectERP.tsx | 4 - .../erp/styled/ProjectERPApproval.tsx | 4 - .../erp/styled/ProjectERPComplete.tsx | 4 - .../erp/styled/ProjectERPDisposed.tsx | 4 - .../erp/styled/ProjectERPExemption.tsx | 4 - .../projects/disposals/erp/styled/index.ts | 5 - .../projects/disposals/erp/utils/addAgency.ts | 33 - .../projects/disposals/erp/utils/index.ts | 1 - .../src/features/projects/disposals/index.ts | 11 - .../information/ProjectAddProperties.tsx | 120 - .../information/ProjectInformation.tsx | 97 - .../information/ProjectInformationTabs.tsx | 29 - .../information/ProjectProperties.tsx | 74 - .../information/ProjectPropertyFilter.tsx | 98 - .../ProjectPropertyInformation.tsx | 152 - .../constants/AddPropertyColumns.test.tsx | 95 - .../constants/AddPropertyColumns.tsx | 137 - .../constants/PropertyColumns.test.tsx | 42 - .../information/constants/PropertyColumns.tsx | 135 - .../disposals/information/constants/index.ts | 2 - .../projects/disposals/information/index.ts | 6 - .../styled/ProjectAddProperties.tsx | 48 - .../information/styled/ProjectInformation.tsx | 44 - .../information/styled/ProjectProperties.tsx | 29 - .../disposals/information/styled/Tooltip.tsx | 9 - .../disposals/information/styled/index.ts | 4 - .../disposals/information/utils/index.ts | 1 - .../information/utils/toProjectProperty.ts | 138 - .../interfaces/IProjectAgencyResponseForm.ts | 11 - .../disposals/interfaces/IProjectForm.ts | 105 - .../disposals/interfaces/IProjectNoteForm.ts | 5 - .../interfaces/IProjectPropertyFilter.ts | 11 - .../interfaces/IProjectPropertyForm.ts | 18 - .../disposals/interfaces/IProjectTaskForm.ts | 12 - .../projects/disposals/interfaces/index.ts | 6 - .../disposals/notes/ErpNotificationNote.tsx | 34 - .../projects/disposals/notes/ProjectNote.tsx | 30 - .../projects/disposals/notes/index.ts | 2 - .../disposals/notes/styled/Comment.tsx | 7 - .../projects/disposals/notes/styled/index.ts | 1 - .../notifications/ProjectNotifications.tsx | 69 - .../notifications/constants/columns.ts | 35 - .../notifications/constants/index.ts | 1 - .../projects/disposals/notifications/index.ts | 1 - .../styled/ProjectNotifications.tsx | 22 - .../disposals/notifications/styled/index.ts | 1 - .../projects/disposals/spl/ProjectNotSPL.tsx | 78 - .../disposals/spl/ProjectSPLApproval.tsx | 89 - .../spl/ProjectSPLContractInPlace.tsx | 66 - .../disposals/spl/ProjectSPLMarketing.tsx | 44 - .../projects/disposals/spl/ProjectSPLTabs.tsx | 66 - .../spl/ProjectSPLTransferWithinGRE.tsx | 44 - .../features/projects/disposals/spl/index.ts | 6 - .../disposals/spl/styled/ProjectNotSPL.tsx | 4 - .../disposals/spl/styled/ProjectSPL.tsx | 4 - .../projects/disposals/spl/styled/index.ts | 2 - .../disposals/styled/ActiveStatus.tsx | 17 - .../disposals/styled/DisposalProject.tsx | 41 - .../disposals/styled/ProjectLayout.tsx | 51 - .../disposals/styled/ProjectStatus.tsx | 36 - .../projects/disposals/styled/ProjectTabs.tsx | 23 - .../projects/disposals/styled/index.ts | 5 - .../transfer-gre/GreTransferStep.tsx | 140 - .../constants/TransferPropertyColumns.tsx | 123 - .../disposals/transfer-gre/constants/index.ts | 1 - .../projects/disposals/transfer-gre/index.ts | 1 - .../transfer-gre/styled/GreTransferStep.tsx | 4 - .../disposals/transfer-gre/styled/index.ts | 1 - .../disposals/utils/convertToPropertyType.ts | 13 - .../utils/convertToPropertyTypeName.ts | 15 - .../utils/getMostRecentEvaluation.ts | 21 - .../disposals/utils/getMostRecentFiscal.ts | 21 - .../projects/disposals/utils/index.ts | 8 - .../projects/disposals/utils/toForm.ts | 147 - .../projects/disposals/utils/toModel.ts | 122 - .../disposals/utils/toPropertyForm.ts | 43 - .../disposals/utils/toPropertyModel.ts | 84 - .../validation/documentationSchema.ts | 27 - .../disposals/validation/erpCompleteSchema.ts | 98 - .../disposals/validation/erpDisposedSchema.ts | 52 - .../validation/erpExemptionSchema.ts | 9 - .../projects/disposals/validation/index.ts | 12 - .../validation/informationProjectSchema.ts | 19 - .../validation/informationPropertiesSchema.ts | 35 - .../disposals/validation/notSplSchema.ts | 35 - .../disposals/validation/splApprovalSchema.ts | 83 - .../validation/splContractInPlaceSchema.ts | 64 - .../validation/splMarketingSchema.ts | 19 - .../validation/splTransferWithinGRESchema.ts | 19 - .../validation/useProjectValidation.ts | 230 - .../ProjectDisposalExemptionSubmitted.tsx | 40 - .../dispose/ProjectDisposalSubmitted.scss | 9 - .../dispose/ProjectDisposalSubmitted.tsx | 40 - .../dispose/ProjectDisposeLayout.test.tsx | 110 - .../projects/dispose/ProjectDisposeLayout.tsx | 175 - .../projects/dispose/ProjectDisposeView.scss | 188 - .../dispose/ProjectDisposeView.test.tsx | 114 - .../projects/dispose/ProjectDisposeView.tsx | 45 - .../ProjectDisposeLayout.test.tsx.snap | 226 - .../ProjectDisposeView.test.tsx.snap | 3 - .../components/ApprovalConfirmation.scss | 4 - .../components/ApprovalConfirmation.test.tsx | 65 - .../dispose/components/ExemptionRequest.scss | 12 - .../components/ExemptionRequest.test.tsx | 96 - .../dispose/components/ExemptionRequest.tsx | 80 - .../components/GeneratedDisposeStepper.tsx | 39 - .../dispose/components/StepActions.test.tsx | 56 - .../dispose/components/StepActions.tsx | 88 - .../ApprovalConfirmation.test.tsx.snap | 43 - .../ExemptionRequest.test.tsx.snap | 36 - .../__snapshots__/StepActions.test.tsx.snap | 36 - .../forms/PropertyListViewSelect.test.tsx | 175 - .../dispose/forms/ReviewProjectForm.scss | 12 - .../dispose/forms/ReviewProjectForm.tsx | 47 - .../PropertyListViewSelect.test.tsx.snap | 602 --- .../dispose/forms/disposalYupSchema.ts | 64 - .../projects/dispose/hooks/stepperContext.tsx | 29 - .../dispose/hooks/useStepper.test.tsx | 157 - .../projects/dispose/hooks/useStepper.ts | 195 - .../projects/dispose/hooks/useTable.ts | 118 - .../src/features/projects/dispose/index.ts | 17 - .../steps/ApprovalConfirmationStep.tsx | 40 - .../dispose/steps/DocumentationStep.test.tsx | 105 - .../dispose/steps/DocumentationStep.tsx | 85 - .../dispose/steps/ProjectDraftStep.test.tsx | 94 - .../dispose/steps/ProjectDraftStep.tsx | 54 - .../dispose/steps/ReviewProjectStep.test.tsx | 116 - .../dispose/steps/ReviewProjectStep.tsx | 54 - .../steps/SelectProjectPropertiesStep.scss | 65 - .../SelectProjectPropertiesStep.test.tsx | 215 - .../steps/SelectProjectPropertiesStep.tsx | 136 - .../projects/dispose/steps/UpdateInfoStep.tsx | 46 - .../DocumentationStep.test.tsx.snap | 181 - .../ProjectDraftStep.test.tsx.snap | 153 - .../ReviewProjectStep.test.tsx.snap | 1129 ---- .../SelectProjectPropertiesStep.test.tsx.snap | 736 --- .../features/projects/dispose/testUtils.ts | 1493 ------ .../projects/interfaces/IApiProject.ts | 42 - .../projects/interfaces/IApiProperty.ts | 34 - .../projects/interfaces/INotification.ts | 11 - .../interfaces/INotificationFilter.ts | 5 - .../projects/interfaces/IParentParcel.ts | 5 - .../features/projects/interfaces/IProject.ts | 92 - .../interfaces/IProjectAgencyResponse.ts | 13 - .../projects/interfaces/IProjectNote.ts | 9 - .../projects/interfaces/IProjectProperty.ts | 11 - .../interfaces/IProjectStatusHistory.ts | 7 - .../projects/interfaces/IProjectTask.ts | 15 - .../interfaces/IProjectWorkflowComponent.ts | 6 - .../features/projects/interfaces/IProperty.ts | 73 - .../projects/interfaces/IPropertyFilter.ts | 20 - .../features/projects/interfaces/IStatus.ts | 17 - .../projects/interfaces/IStepProps.ts | 4 - .../src/features/projects/interfaces/ITask.ts | 7 - .../src/features/projects/interfaces/index.ts | 17 - .../list/ProjectApprovalRequest.test.tsx | 149 - .../list/ProjectApprovalRequestListView.tsx | 36 - .../projects/list/ProjectListView.scss | 69 - .../projects/list/ProjectListView.test.tsx | 192 - .../projects/list/ProjectListView.tsx | 477 -- .../projects/list/SPLProjectListView.test.tsx | 192 - .../projects/list/SPLProjectListView.tsx | 44 - .../ProjectApprovalRequest.test.tsx.snap | 198 - .../ProjectListView.test.tsx.snap | 485 -- .../SPLProjectListView.test.tsx.snap | 485 -- .../src/features/projects/list/columns.tsx | 192 - frontend/src/features/projects/list/index.ts | 4 - .../src/features/projects/list/interfaces.ts | 42 - .../projects/list/properties/Properties.tsx | 23 - .../projects/list/properties/columns.tsx | 131 - .../projects/list/properties/index.ts | 2 - .../projects/summary/ProjectSummary.tsx | 209 - .../summary/constants/PropertyColumns.tsx | 110 - .../projects/summary/constants/index.ts | 1 - .../src/features/projects/summary/index.ts | 1 - .../summary/styled/ProjectSummary.tsx | 39 - .../features/projects/summary/styled/index.ts | 1 - frontend/src/features/projects/utils.ts | 20 - .../common/slices/propertyNameSlice.ts | 22 - .../components/GeocoderAutoComplete.tsx | 170 - .../components/GeocoderAutoCompleteStyled.tsx | 44 - .../components/LastUpdatedBy.test.tsx | 57 - .../properties/components/LastUpdatedBy.tsx | 61 - .../properties/components/forms/strings.ts | 60 - .../forms/subforms/AddressForm.scss | 17 - .../components/forms/subforms/AddressForm.tsx | 147 - .../forms/subforms/DebouncedValidation.tsx | 43 - .../forms/subforms/EvaluationForm.tsx | 208 - .../forms/subforms/InformationForm.scss | 11 - .../forms/subforms/InformationForm.tsx | 114 - .../components/forms/subforms/LandForm.tsx | 62 - .../components/forms/subforms/LatLongForm.tsx | 115 - .../forms/subforms/PaginatedFormErrors.tsx | 51 - .../components/forms/subforms/PidPinForm.scss | 20 - .../forms/subforms/PidPinForm.test.tsx | 57 - .../components/forms/subforms/PidPinForm.tsx | 91 - .../__snapshots__/PidPinForm.test.tsx.snap | 107 - .../components/forms/subforms/columns.tsx | 264 - .../forms/subforms/tableStyles.scss | 11 - .../properties/filter/IPropertyFilter.ts | 55 - .../properties/filter/PropertyFilter.scss | 62 - .../properties/filter/PropertyFilter.test.tsx | 266 - .../properties/filter/PropertyFilter.tsx | 261 - .../filter/PropertyFilterAgencyOptions.tsx | 68 - .../filter/PropertyFilterOptions.test.tsx | 105 - .../filter/PropertyFilterOptions.tsx | 68 - .../PropertyFilter.test.tsx.snap | 360 -- .../PropertyFilterOptions.test.tsx.snap | 161 - .../src/features/properties/filter/index.ts | 2 - .../hooks/useDraftMarkerSynchronizer.tsx | 120 - .../features/properties/hooks/useGeocoder.tsx | 150 - .../properties/hooks/useParcelLayerData.tsx | 209 - .../properties/list/PropertyListView.scss | 98 - .../properties/list/PropertyListView.test.tsx | 368 -- .../properties/list/PropertyListView.tsx | 869 ---- .../PropertyListView.test.tsx.snap | 1254 ----- .../properties/list/buildings/Buildings.tsx | 42 - .../properties/list/buildings/index.ts | 1 - .../src/features/properties/list/columns.tsx | 554 -- .../src/features/properties/list/index.ts | 2 - .../features/properties/list/interfaces.ts | 90 - .../features/properties/list/toApiProperty.ts | 121 - .../src/features/properties/map/MapView.scss | 106 - .../src/features/properties/map/MapView.tsx | 106 - frontend/src/features/properties/service.ts | 65 - .../features/properties/upload/FileInput.scss | 33 - .../properties/upload/FileInput.test.tsx | 38 - .../features/properties/upload/FileInput.tsx | 61 - .../properties/upload/Instructions.scss | 10 - .../properties/upload/Instructions.test.tsx | 14 - .../properties/upload/Instructions.tsx | 87 - .../properties/upload/UploadProgress.scss | 62 - .../properties/upload/UploadProgress.test.tsx | 97 - .../properties/upload/UploadProgress.tsx | 155 - .../properties/upload/UploadProperties.scss | 15 - .../upload/UploadProperties.test.tsx | 118 - .../properties/upload/UploadProperties.tsx | 247 - frontend/src/features/routes/AppRouter.tsx | 644 --- .../features/routes/IsAuthenticatedRoute.tsx | 19 - .../features/routes/LayoutWrapper.test.tsx | 52 - .../src/features/routes/LayoutWrapper.tsx | 52 - frontend/src/features/routes/PrivateRoute.tsx | 27 - frontend/src/features/routes/index.ts | 4 - frontend/src/features/splReports/columns.tsx | 223 - .../components/AddReportControl.tsx | 34 - .../components/ElipsisControls.scss | 28 - .../splReports/components/ElipsisControls.tsx | 58 - .../splReports/components/ReportControls.tsx | 238 - .../splReports/components/ReportForm.tsx | 55 - .../splReports/components/ReportList.tsx | 47 - .../splReports/components/ReportListItem.tsx | 86 - .../components/SplReportLayout.scss | 116 - .../splReports/components/SplReportLayout.tsx | 79 - .../containers/SplReportContainer.tsx | 242 - .../hooks/useProjectSnapshotApi.test.tsx | 84 - .../splReports/hooks/useProjectSnapshotApi.ts | 177 - .../splReports/hooks/useRouterReport.test.tsx | 83 - .../splReports/hooks/useRouterReport.ts | 55 - .../src/features/splReports/interfaces.ts | 36 - frontend/src/globals.d.ts | 3 - .../hooks/api/admin/access-requests/index.ts | 2 - .../interfaces/IAccessRequestAgencyModel.ts | 13 - .../interfaces/IAccessRequestFilter.ts | 11 - .../interfaces/IAccessRequestModel.ts | 12 - .../interfaces/IAccessRequestRoleModel.ts | 3 - .../admin/access-requests/interfaces/index.ts | 4 - .../useApiAdminAccessRequests.ts | 27 - .../api/admin/administrative-areas/index.ts | 2 - .../interfaces/IAdministrativeAreaFilter.ts | 7 - .../interfaces/IAdministrativeAreaModel.ts | 7 - .../administrative-areas/interfaces/index.ts | 2 - .../useApiAdminAdministrativeAreas.ts | 39 - .../src/hooks/api/admin/agencies/index.ts | 2 - .../admin/agencies/interfaces/IAgencyModel.ts | 1 - .../api/admin/agencies/interfaces/index.ts | 1 - .../api/admin/agencies/useApiAdminAgencies.ts | 19 - frontend/src/hooks/api/admin/claims/index.ts | 2 - .../admin/claims/interfaces/IClaimModel.ts | 1 - .../api/admin/claims/interfaces/index.ts | 1 - .../api/admin/claims/useApiAdminClaims.ts | 19 - frontend/src/hooks/api/admin/index.ts | 6 - frontend/src/hooks/api/admin/roles/index.ts | 2 - .../api/admin/roles/interfaces/IRoleModel.ts | 1 - .../hooks/api/admin/roles/interfaces/index.ts | 1 - .../hooks/api/admin/roles/useApiAdminRoles.ts | 19 - frontend/src/hooks/api/admin/users/index.ts | 2 - .../api/admin/users/interfaces/IUserModel.ts | 1 - .../hooks/api/admin/users/interfaces/index.ts | 1 - .../hooks/api/admin/users/useApiAdminUsers.ts | 19 - .../api/constants/AccessRequestStatus.ts | 5 - frontend/src/hooks/api/constants/Claim.ts | 24 - .../src/hooks/api/constants/LookupType.ts | 12 - frontend/src/hooks/api/constants/NoteType.ts | 51 - .../api/constants/NotificationBodyType.ts | 4 - .../api/constants/NotificationEncoding.ts | 6 - .../api/constants/NotificationPriority.ts | 5 - .../api/constants/NotificationResponse.ts | 5 - .../hooks/api/constants/NotificationStatus.ts | 7 - frontend/src/hooks/api/constants/Role.ts | 10 - frontend/src/hooks/api/constants/index.ts | 10 - frontend/src/hooks/api/geocoder/index.ts | 2 - .../geocoder/interfaces/IGeoAddressModel.ts | 10 - .../api/geocoder/interfaces/ISitePidsModel.ts | 4 - .../hooks/api/geocoder/interfaces/index.ts | 2 - .../src/hooks/api/geocoder/useApiGeocoder.ts | 61 - frontend/src/hooks/api/index.ts | 7 - .../hooks/api/interfaces/IBaseLookupModel.ts | 14 - .../src/hooks/api/interfaces/IBaseModel.ts | 7 - .../src/hooks/api/interfaces/IPageFilter.ts | 5 - .../src/hooks/api/interfaces/IPageModel.ts | 6 - frontend/src/hooks/api/interfaces/index.ts | 4 - frontend/src/hooks/api/lookups/index.ts | 2 - .../api/lookups/interfaces/ILookupModel.ts | 4 - .../src/hooks/api/lookups/interfaces/index.ts | 1 - .../src/hooks/api/lookups/useApiLookups.ts | 19 - .../constants/DisposeWorkflowStatus.ts | 8 - .../hooks/api/projects/constants/Workflow.ts | 13 - .../api/projects/constants/WorkflowStatus.ts | 30 - .../src/hooks/api/projects/constants/index.ts | 3 - .../src/hooks/api/projects/disposals/index.ts | 2 - .../interfaces/INotificationQueueModel.ts | 27 - .../interfaces/IProjectAgencyResponseModel.ts | 13 - .../interfaces/IProjectBuildingModel.ts | 23 - .../disposals/interfaces/IProjectModel.ts | 108 - .../disposals/interfaces/IProjectNoteModel.ts | 8 - .../interfaces/IProjectNotificationFilter.ts | 12 - .../interfaces/IProjectParcelModel.ts | 15 - .../interfaces/IProjectPropertyModel.ts | 14 - .../interfaces/IProjectStatusHistoryModel.ts | 9 - .../interfaces/IProjectStatusModel.ts | 9 - .../disposals/interfaces/IProjectTaskModel.ts | 15 - .../projects/disposals/interfaces/index.ts | 11 - .../disposals/useApiProjectDisposal.ts | 56 - frontend/src/hooks/api/projects/index.ts | 1 - .../src/hooks/api/projects/search/index.ts | 2 - .../search/interfaces/IProjectFilter.ts | 15 - .../search/interfaces/IProjectModel.ts | 32 - .../interfaces/IProjectPropertyModel.ts | 22 - .../api/projects/search/interfaces/index.ts | 3 - .../projects/search/useApiProjectSearch.ts | 27 - .../src/hooks/api/projects/status/index.ts | 2 - .../status/interfaces/IProjectStatusModel.ts | 8 - .../projects/status/interfaces/ITaskModel.ts | 5 - .../api/projects/status/interfaces/index.ts | 2 - .../projects/status/useApiProjectStatus.ts | 24 - .../src/hooks/api/projects/workflows/index.ts | 2 - .../interfaces/IProjectStatusModel.ts | 10 - .../workflows/interfaces/ITaskModel.ts | 5 - .../projects/workflows/interfaces/index.ts | 2 - .../workflows/useApiProjectWorkflow.ts | 22 - .../hooks/api/properties/buildings/index.ts | 2 - .../buildings/interfaces/IBuildingModel.ts | 23 - .../interfaces/IBuildingParcelModel.ts | 5 - .../interfaces/ILeasedLandMetadataModel.ts | 5 - .../properties/buildings/interfaces/index.ts | 3 - .../properties/buildings/useApiBuildings.ts | 31 - .../properties/constants/Classification.ts | 19 - .../api/properties/constants/EvaluationKey.ts | 5 - .../properties/constants/EvaluationKeyName.ts | 5 - .../api/properties/constants/FiscalKeyName.ts | 4 - .../api/properties/constants/FiscalKeys.ts | 4 - .../properties/constants/LeasedLandType.ts | 5 - .../api/properties/constants/PropertyType.ts | 7 - .../properties/constants/PropertyTypeName.ts | 9 - .../hooks/api/properties/constants/index.ts | 8 - frontend/src/hooks/api/properties/index.ts | 2 - .../properties/interfaces/IAddressModel.ts | 11 - .../properties/interfaces/IEvaluationModel.ts | 11 - .../api/properties/interfaces/IFiscalModel.ts | 11 - .../properties/interfaces/IParcelFilter.ts | 10 - .../properties/interfaces/IPropertyFilter.ts | 27 - .../properties/interfaces/IPropertyModel.ts | 24 - .../hooks/api/properties/interfaces/index.ts | 6 - .../src/hooks/api/properties/parcels/index.ts | 2 - .../interfaces/IParcelBuildingModel.ts | 19 - .../parcels/interfaces/IParcelModel.ts | 17 - .../interfaces/IParcelSubdivisionModel.ts | 7 - .../parcels/interfaces/IPidAvailableModel.ts | 3 - .../parcels/interfaces/IPinAvailableModel.ts | 3 - .../interfaces/ISubdivisionParcelModel.ts | 5 - .../properties/parcels/interfaces/index.ts | 6 - .../api/properties/parcels/useApiParcels.ts | 44 - .../src/hooks/api/properties/search/index.ts | 2 - .../search/interfaces/IGeoFilter.ts | 44 - .../search/interfaces/ISearchAllFilter.ts | 16 - .../search/interfaces/ISearchFilter.ts | 36 - .../search/interfaces/ISearchPropertyModel.ts | 62 - .../api/properties/search/interfaces/index.ts | 4 - .../api/properties/search/useApiProperties.ts | 35 - frontend/src/hooks/api/useApi.ts | 13 - frontend/src/hooks/api/users/index.ts | 3 - .../users/interfaces/IAccessRequestModel.ts | 16 - .../users/interfaces/IUserActivateModel.ts | 4 - .../api/users/interfaces/IUserInfoModel.ts | 12 - .../hooks/api/users/interfaces/IUserModel.ts | 13 - .../src/hooks/api/users/interfaces/index.ts | 4 - .../hooks/api/users/useApiAccessRequests.ts | 25 - frontend/src/hooks/api/users/useApiUsers.ts | 22 - frontend/src/hooks/use-query.ts | 8 - frontend/src/hooks/useApi.ts | 235 - frontend/src/hooks/useApiAdminAreas.ts | 155 - frontend/src/hooks/useApiDisposal.ts | 29 - frontend/src/hooks/useAsyncError.ts | 23 - frontend/src/hooks/useConfiguration.ts | 69 - frontend/src/hooks/useDeepCompareCallback.ts | 20 - .../src/hooks/useDeepCompareEffect.test.ts | 74 - frontend/src/hooks/useDeepCompareEffect.ts | 19 - frontend/src/hooks/useDeepCompareMemo.ts | 17 - frontend/src/hooks/useDeepCompareMemoize.ts | 13 - frontend/src/hooks/useEnvironment.ts | 34 - frontend/src/hooks/useEventListener.ts | 46 - frontend/src/hooks/useGetAccountType.tsx | 27 - .../src/hooks/useKeycloakWrapper.test.tsx | 156 - frontend/src/hooks/useKeycloakWrapper.tsx | 254 - frontend/src/hooks/useLookupCodes.tsx | 113 - frontend/src/hooks/useMyAgencies.test.tsx | 102 - frontend/src/hooks/useMyAgencies.ts | 45 - frontend/src/hooks/useRouterFilter.test.tsx | 144 - frontend/src/hooks/useRouterFilter.ts | 228 - frontend/src/index.scss | 37 - frontend/src/index.tsx | 81 - frontend/src/interfaces/IKeycloakConfig.ts | 22 - frontend/src/interfaces/IUsersFilter.ts | 9 - frontend/src/interfaces/accessRequests.ts | 28 - frontend/src/interfaces/agency.ts | 56 - frontend/src/interfaces/index.ts | 8 - frontend/src/interfaces/pagedItems.ts | 10 - frontend/src/interfaces/role.ts | 4 - frontend/src/interfaces/user.ts | 20 - frontend/src/interfaces/userDetails.ts | 17 - frontend/src/interfaces/userInfo.ts | 12 - frontend/src/keycloakInstance.ts | 12 - frontend/src/layouts/AuthLayout.scss | 5 - frontend/src/layouts/AuthLayout.tsx | 39 - frontend/src/layouts/EmptyLayout.test.tsx | 11 - frontend/src/layouts/EmptyLayout.tsx | 29 - frontend/src/layouts/PublicLayout.scss | 57 - frontend/src/layouts/PublicLayout.tsx | 58 - .../__snapshots__/EmptyLayout.test.tsx.snap | 120 - frontend/src/layouts/index.ts | 3 - frontend/src/logo.svg | 7 - frontend/src/mocks/dataMocks.js | 8 - frontend/src/mocks/filterDataMock.ts | 553 -- frontend/src/mocks/properties.ts | 93 - frontend/src/pages/401/AccessDenied.test.tsx | 21 - frontend/src/pages/401/AccessDenied.tsx | 29 - .../__snapshots__/AccessDenied.test.tsx.snap | 28 - frontend/src/pages/404/NotFoundPage.test.tsx | 21 - frontend/src/pages/404/NotFoundPage.tsx | 35 - .../__snapshots__/NotFoundPage.test.tsx.snap | 25 - frontend/src/pages/Test.ignore.tsx | 36 - frontend/src/pages/index.ts | 3 - frontend/src/react-app-env.d.ts | 1 - frontend/src/serviceWorker.ignore.ts | 138 - frontend/src/setupTests.ts | 34 - frontend/src/store/hooks/index.ts | 4 - .../store/hooks/lookups/constants/index.ts | 1 - .../hooks/lookups/constants/lookupType.ts | 12 - frontend/src/store/hooks/lookups/index.ts | 2 - .../src/store/hooks/lookups/useLookups.ts | 45 - frontend/src/store/hooks/network/index.ts | 1 - .../src/store/hooks/network/useNetwork.ts | 37 - frontend/src/store/hooks/projects/index.ts | 3 - .../hooks/projects/useProjectDisposal.ts | 67 - .../store/hooks/projects/useProjectStatus.ts | 24 - .../hooks/projects/useProjectWorkflow.ts | 22 - frontend/src/store/hooks/properties/index.ts | 1 - .../store/hooks/properties/useProperties.ts | 28 - frontend/src/store/index.ts | 3 - frontend/src/store/rootReducer.ts | 52 - .../store/slices/accessRequestSlice.spec.ts | 114 - .../src/store/slices/accessRequestSlice.ts | 109 - frontend/src/store/slices/agenciesSlice.ts | 21 - frontend/src/store/slices/agencySlice.spec.ts | 110 - frontend/src/store/slices/agencySlice.ts | 113 - frontend/src/store/slices/filterSlice.spec.ts | 18 - frontend/src/store/slices/filterSlice.ts | 22 - .../store/slices/hooks/agencyActionCreator.ts | 104 - .../slices/hooks/buildingActionCreator.ts | 41 - frontend/src/store/slices/hooks/index.ts | 9 - .../hooks/lookupCodeActionCreator.spec.ts | 64 - .../slices/hooks/lookupCodeActionCreator.ts | 27 - .../slices/hooks/parcelsActionCreator.spec.ts | 270 - .../slices/hooks/parcelsActionCreator.ts | 228 - .../slices/hooks/propertyActionCreator.ts | 23 - .../slices/hooks/useAccessRequest.spec.tsx | 169 - .../store/slices/hooks/useAccessRequest.ts | 248 - .../src/store/slices/hooks/useNetworkStore.ts | 70 - .../src/store/slices/hooks/useProjectStore.ts | 25 - .../slices/hooks/usersActionCreator.spec.ts | 194 - .../store/slices/hooks/usersActionCreator.ts | 161 - frontend/src/store/slices/index.ts | 14 - frontend/src/store/slices/jwtSlice.spec.ts | 18 - frontend/src/store/slices/jwtSlice.ts | 22 - .../store/slices/keycloakReadySlice.spec.ts | 14 - .../src/store/slices/keycloakReadySlice.ts | 18 - .../store/slices/leafletMouseSlice.spec.ts | 39 - .../src/store/slices/leafletMouseSlice.ts | 33 - .../src/store/slices/lookupCodeSlice.spec.ts | 30 - frontend/src/store/slices/lookupCodeSlice.ts | 28 - .../src/store/slices/mapViewSlice.spec.ts | 23 - frontend/src/store/slices/mapViewZoomSlice.ts | 23 - .../src/store/slices/networkSlice.spec.ts | 73 - frontend/src/store/slices/networkSlice.ts | 92 - .../store/slices/parcelLayerDataSlice.spec.ts | 55 - .../src/store/slices/parcelLayerDataSlice.ts | 51 - frontend/src/store/slices/parcelSlice.spec.ts | 79 - frontend/src/store/slices/parcelSlice.ts | 61 - frontend/src/store/slices/projectSlice.ts | 20 - frontend/src/store/slices/userSlice.spec.ts | 124 - frontend/src/store/slices/userSlice.ts | 114 - frontend/src/store/store.ts | 25 - frontend/src/styles.scss | 3 - frontend/src/tabs.scss | 27 - frontend/src/types/react-table.d.ts | 122 - frontend/src/typings/tiles-in-bbox/index.d.ts | 10 - frontend/src/useKeycloakWrapperMock.ts | 164 - frontend/src/utils/CommonFunctions.ts | 36 - .../src/utils/KeycloakEventHandler.test.ts | 68 - frontend/src/utils/KeycloakEventHandler.ts | 38 - frontend/src/utils/YupSchema.ts | 366 -- frontend/src/utils/createNumberMask.test.ts | 297 -- frontend/src/utils/createNumberMask.ts | 162 - frontend/src/utils/csvToPropertyModel.test.ts | 95 - frontend/src/utils/csvToPropertyModel.ts | 215 - frontend/src/utils/download.ts | 53 - frontend/src/utils/formUtils.ts | 9 - frontend/src/utils/formatAddress.ts | 15 - frontend/src/utils/formatCurrency.ts | 28 - frontend/src/utils/formatGuid.ts | 37 - frontend/src/utils/fromQueryString.ts | 14 - frontend/src/utils/index.ts | 7 - frontend/src/utils/mapLookupCode.ts | 21 - frontend/src/utils/numberFormatUtils.ts | 19 - frontend/src/utils/postalCodeFormatter.ts | 12 - frontend/src/utils/storageUtils.ts | 5 - frontend/src/utils/testUtils.tsx | 116 - frontend/src/utils/toQueryString.ts | 12 - frontend/src/utils/utils.test.ts | 73 - frontend/src/utils/utils.ts | 309 -- frontend/tsconfig.json | 24 - frontend/vite.config.ts | 30 - maintenance/.editorconfig | 21 - maintenance/BACKUP.md | 60 - maintenance/Caddyfile | 20 - maintenance/README.md | 204 - maintenance/RESTORE_BACKUPS.md | 15 - maintenance/maintenance.html | 18 - maintenance/maintenance.sh | 113 - nginx/Dockerfile.maintenance | 6 - nginx/config/maintenance.conf | 28 - nginx/html/50x.html | 17 - nginx/html/index.html | 21 - omnisharp.json | 5 - openshift/4.0/README.md | 88 - openshift/4.0/templates/api/README.md | 102 - openshift/4.0/templates/api/build.yaml | 141 - .../4.0/templates/api/deploy-alt-routes.yaml | 188 - .../4.0/templates/api/deploy-routes.yaml | 100 - .../4.0/templates/api/deploy-swagger.yaml | 70 - openshift/4.0/templates/api/deploy.yaml | 452 -- openshift/4.0/templates/app/README.md | 93 - openshift/4.0/templates/app/build.yaml | 218 - .../4.0/templates/app/deploy-alt-routes.yaml | 67 - .../4.0/templates/app/deploy-routes.yaml | 71 - openshift/4.0/templates/app/deploy.yaml | 339 -- openshift/4.0/templates/app/pvc.yaml | 20 - openshift/4.0/templates/backup/README.md | 152 - openshift/4.0/templates/backup/build.yaml | 100 - openshift/4.0/templates/backup/deploy.yaml | 429 -- .../4.0/templates/base-images/dotnet-31.yaml | 61 - .../4.0/templates/base-images/mssql-2019.yaml | 25 - .../base-images/nodejs-10-rhel7.yaml | 25 - .../4.0/templates/base-images/nodejs-16.yaml | 25 - openshift/4.0/templates/database/README.md | 59 - openshift/4.0/templates/database/busybox.yaml | 46 - .../4.0/templates/database/mssql-build.yaml | 139 - .../4.0/templates/database/mssql-deploy.yaml | 321 -- .../4.0/templates/images/docker-repo.yaml | 51 - .../deny-all-traffic.yaml | 14 - .../internet-to-routes.yaml | 19 - .../kubernetes-network-policy/nsp-tools.yaml | 45 - .../kubernetes-network-policy/nsp.yaml | 64 - .../pod-from-pod.yaml | 48 - openshift/4.0/templates/maintenance/README.md | 115 - .../4.0/templates/maintenance/caddy.bc.yaml | 127 - .../4.0/templates/maintenance/caddy.dc.yaml | 177 - .../templates/maintenance/caddy.s2i.bc.yaml | 133 - openshift/4.0/templates/migrations/README.md | 32 - openshift/4.0/templates/migrations/build.yaml | 102 - .../templates/migrations/migration-job.yaml | 97 - .../network-security-policy/README.md | 77 - .../ingress-permissive.yaml | 34 - .../internal-k8s-api.yaml | 25 - .../internet-to-pod.yaml | 32 - .../network-security-policy/nsp-tools.yaml | 56 - .../network-security-policy/nsp.yaml | 63 - .../pod-to-internet.yaml | 32 - .../network-security-policy/pod-to-pod.yaml | 44 - .../pod-to-project.yaml | 45 - .../project-to-project.yaml | 32 - .../service-account-to-k8s-api.yaml | 28 - openshift/4.0/templates/nginx/build.yaml | 126 - openshift/4.0/templates/nginx/deploy.yaml | 177 - openshift/4.0/templates/nginx/route.yaml | 72 - .../rolebindings/citz-imb-github-edit.yaml | 43 - .../rolebindings/citz-imb-idir-admin.yaml | 40 - .../rolebindings/citz-imb-idir-edit.yaml | 40 - .../tekton/conditions/param-has-value.yaml | 15 - .../tekton/conditions/param-is-true.yaml | 15 - .../templates/tekton/pipelines/api-only.yaml | 199 - .../templates/tekton/pipelines/app-only.yaml | 93 - .../tekton/pipelines/backup-database.yaml | 41 - .../templates/tekton/pipelines/complete.yaml | 273 - .../tekton/pipelines/db-migration.yaml | 35 - .../templates/tekton/pipelines/deploy.yaml | 165 - .../tekton/pipelines/redirect-route.yaml | 34 - .../tekton/service-account/role.yaml | 138 - .../service-account/service-account.yaml | 24 - .../templates/tekton/tasks/db-migration.yaml | 62 - .../4.0/templates/tekton/tasks/oc-backup.yaml | 39 - .../4.0/templates/tekton/tasks/oc-build.yaml | 44 - .../tekton/tasks/oc-deploy-with-tag.yaml | 49 - .../tekton/tasks/oc-update-route.yaml | 34 - .../templates/tekton/tasks/owasp-scanner.yaml | 50 - .../tekton/triggers/git-binding.yaml | 49 - .../tekton/triggers/git-eventlistener.yaml | 64 - .../tekton/triggers/git-ingress.yaml | 52 - .../tekton/triggers/git-triggertemplate.yaml | 64 - .../tekton/triggers/git-webhook-secret.yaml | 39 - .../4.0/templates/tekton/triggers/route.yaml | 35 - .../4.0/templates/tekton/triggers/setup.sh | 18 - openshift/BASE_IMAGES.md | 30 - openshift/MULTIPLE_INSTANCES.md | 224 - openshift/OBJECTS.md | 53 - openshift/PIPELINES.md | 42 - openshift/README.md | 119 - openshift/SECRETS.md | 26 - openshift/SSL_CERTIFICATES.md | 155 - openshift/ZAP.md | 5 - openshift/s2i/README.md | 57 - .../s2i/bcgov-s2i-caddy/bcgov-s2i-caddy.yaml | 86 - openshift/s2i/nginx-runtime/Dockerfile | 43 - .../s2i/nginx-runtime/nginx-runtime.yaml | 64 - .../s2i/nginx-runtime/nginx.conf.template | 93 - openshift/s2i/nginx-runtime/s2i/bin/assemble | 3 - .../nginx-runtime/s2i/bin/assemble-runtime | 2 - openshift/s2i/nginx-runtime/s2i/bin/run | 78 - openshift/templates/api-dc-template.yaml | 236 - openshift/templates/api-v2-dc-template.yaml | 181 - openshift/templates/app-dc-template.yaml | 156 - openshift/templates/app-v2-dc-template.yaml | 119 - scripts/README.md | 13 - scripts/build.sh | 4 - scripts/clean.sh | 5 - scripts/db-migration.sh | 30 - scripts/gen-env-files.sh | 67 - scripts/start-dev.sh | 9 - scripts/start.sh | 4 - scripts/test-api.sh | 6 - scripts/test-app.sh | 6 - test/Integration/SubmitDeleteProperty.py | 94 - test/Postman/README.md | 70 - test/Postman/pims-api-collection.json | 4526 ----------------- tools/converters/excel/.editorconfig | 27 - tools/converters/excel/.gitignore | 1 - .../Configuration/ActionArgumentOptions.cs | 21 - .../excel/Configuration/ActionOptions.cs | 26 - .../excel/Configuration/ColumnOptions.cs | 67 - .../excel/Configuration/ConvertWhenOption.cs | 37 - .../excel/Configuration/ConverterOptions.cs | 22 - .../excel/Configuration/GeocoderOptions.cs | 20 - .../excel/Configuration/RowOptions.cs | 15 - .../excel/Configuration/SkipOption.cs | 34 - .../excel/Configuration/SourceOptions.cs | 50 - .../excel/Configuration/ValueSwitchOptions.cs | 24 - tools/converters/excel/Converter.cs | 494 -- .../excel/Converters/GeoLocationConverter.cs | 113 - .../excel/Converters/IGeoLocationConverter.cs | 18 - .../excel/Converters/StringConverters.cs | 150 - .../excel/Extensions/TypeExtensions.cs | 32 - tools/converters/excel/IConverter.cs | 17 - tools/converters/excel/Makefile | 35 - tools/converters/excel/Models/AddressModel.cs | 52 - .../excel/Models/AddressModelMap.cs | 18 - ...ims.Tools.Converters.ExcelConverter.csproj | 61 - .../Pims.Tools.Converters.ExcelConverter.sln | 37 - tools/converters/excel/Program.cs | 99 - tools/converters/excel/README.md | 59 - tools/converters/excel/Startup.cs | 48 - .../excel/appsettings.Development.json | 9 - tools/converters/excel/appsettings.Local.json | 9 - .../excel/appsettings.Production.json | 9 - tools/converters/excel/appsettings.Test.json | 9 - tools/converters/excel/appsettings.json | 1322 ----- tools/core/Configuration/RequestOptions.cs | 28 - tools/core/IRequestClient.cs | 68 - .../Configuration/KeycloakAdminOptions.cs | 16 - .../Keycloak/Configuration/KeycloakOptions.cs | 22 - tools/core/Keycloak/IKeycloakRequestClient.cs | 15 - tools/core/Keycloak/KeycloakRequestClient.cs | 59 - tools/core/Keycloak/Models/ClientModel.cs | 202 - tools/core/Keycloak/Models/GroupModel.cs | 55 - .../Keycloak/Models/ProtocolMapperModel.cs | 44 - tools/core/Keycloak/Models/RealmModel.cs | 97 - tools/core/Keycloak/Models/RoleModel.cs | 55 - tools/core/Keycloak/Models/UserModel.cs | 58 - tools/core/Pims.Tools.Core.csproj | 27 - tools/core/RequestClient.cs | 208 - tools/dbeaver/data-sources.json | 146 - tools/dbeaver/tasks.json | 3427 ------------- tools/projectTaskUpdate/taskUpdate.ts | 74 - tools/rocketchat/incoming.js | 311 -- tools/rocketchat/outgoing.js | 69 - tools/usernameUpdater/.env-template | 9 - tools/usernameUpdater/README.md | 21 - tools/usernameUpdater/package.json | 22 - tools/usernameUpdater/src/UserEntity.ts | 110 - tools/usernameUpdater/src/appDataSource.ts | 27 - tools/usernameUpdater/src/updateUsernames.ts | 187 - tools/usernameUpdater/tsconfig.json | 15 - 2513 files changed, 3 insertions(+), 387444 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .github/workflows/DEV-Api-image-deploy.yml delete mode 100644 .github/workflows/DEV-App-image-build.yml delete mode 100644 .github/workflows/DEV-App-image-deploy.yml delete mode 100644 .github/workflows/DEV-api-image-build.yml delete mode 100644 .github/workflows/PROD-Api-image-deploy.yml delete mode 100644 .github/workflows/PROD-App-image-deploy.yml delete mode 100644 .github/workflows/TEST-Api-image-deploy.yml delete mode 100644 .github/workflows/TEST-App-image-deploy.yml delete mode 100644 .github/workflows/api-dotnetcore.yml delete mode 100644 .github/workflows/app-cypress-dev.yml delete mode 100644 .github/workflows/app-jest-coverage.yml delete mode 100644 .github/workflows/app-lint.yaml delete mode 100644 .vscode/launch.json delete mode 100644 .vscode/settings.json delete mode 100644 .vscode/tasks.json delete mode 100644 Makefile delete mode 100644 adr/ches.md delete mode 100644 adr/database.md delete mode 100644 adr/geocoder.md delete mode 100644 adr/leaflet.md delete mode 100644 adr/map-source-boundaries.md delete mode 100644 adr/model-mapping.md delete mode 100644 adr/monorepo.md delete mode 100644 adr/programming-languages.md delete mode 100644 backend/.dockerignore delete mode 100644 backend/.editorconfig delete mode 100644 backend/.gitignore delete mode 100644 backend/.vscode/launch.json delete mode 100644 backend/.vscode/tasks.json delete mode 100644 backend/Dockerfile delete mode 100644 backend/Dockerfile.migrations delete mode 100644 backend/Dockerfile.ocp delete mode 100644 backend/Pims.sln delete mode 100644 backend/README.md delete mode 100644 backend/api/Areas/Admin/Controllers/AccessRequestController.cs delete mode 100644 backend/api/Areas/Admin/Controllers/AdministrativeAreaController.cs delete mode 100644 backend/api/Areas/Admin/Controllers/AgencyController.cs delete mode 100644 backend/api/Areas/Admin/Controllers/ClaimController.cs delete mode 100644 backend/api/Areas/Admin/Controllers/RoleController.cs delete mode 100644 backend/api/Areas/Admin/Controllers/UserController.cs delete mode 100644 backend/api/Areas/Admin/Mapping/AdministrativeArea/AdministrativeAreaMap.cs delete mode 100644 backend/api/Areas/Admin/Mapping/Agency/AgencyMap.cs delete mode 100644 backend/api/Areas/Admin/Mapping/Claim/ClaimMap.cs delete mode 100644 backend/api/Areas/Admin/Mapping/Parcel/AddressMap.cs delete mode 100644 backend/api/Areas/Admin/Mapping/Parcel/BuildingEvaluationMap.cs delete mode 100644 backend/api/Areas/Admin/Mapping/Parcel/BuildingFiscalMap.cs delete mode 100644 backend/api/Areas/Admin/Mapping/Parcel/BuildingMap.cs delete mode 100644 backend/api/Areas/Admin/Mapping/Parcel/ParcelBuildingMap.cs delete mode 100644 backend/api/Areas/Admin/Mapping/Parcel/ParcelEvaluationMap.cs delete mode 100644 backend/api/Areas/Admin/Mapping/Parcel/ParcelFiscalMap.cs delete mode 100644 backend/api/Areas/Admin/Mapping/Parcel/ParcelMap.cs delete mode 100644 backend/api/Areas/Admin/Mapping/Parcel/PartialBuildingMap.cs delete mode 100644 backend/api/Areas/Admin/Mapping/Parcel/PartialParcelMap.cs delete mode 100644 backend/api/Areas/Admin/Mapping/Role/ClaimMap.cs delete mode 100644 backend/api/Areas/Admin/Mapping/Role/RoleMap.cs delete mode 100644 backend/api/Areas/Admin/Mapping/User/AccessRequestAgencyMap.cs delete mode 100644 backend/api/Areas/Admin/Mapping/User/AccessRequestMap.cs delete mode 100644 backend/api/Areas/Admin/Mapping/User/AccessRequestRoleMap.cs delete mode 100644 backend/api/Areas/Admin/Mapping/User/AccessRequestUserMap.cs delete mode 100644 backend/api/Areas/Admin/Mapping/User/AgencyMap.cs delete mode 100644 backend/api/Areas/Admin/Mapping/User/GoldUserMap.cs delete mode 100644 backend/api/Areas/Admin/Mapping/User/RoleMap.cs delete mode 100644 backend/api/Areas/Admin/Mapping/User/UserMap.cs delete mode 100644 backend/api/Areas/Admin/Models/AdministrativeArea/AdministrativeAreaModel.cs delete mode 100644 backend/api/Areas/Admin/Models/Agency/AgencyModel.cs delete mode 100644 backend/api/Areas/Admin/Models/Claim/ClaimModel.cs delete mode 100644 backend/api/Areas/Admin/Models/Parcel/AddressModel.cs delete mode 100644 backend/api/Areas/Admin/Models/Parcel/BuildingEvaluationModel.cs delete mode 100644 backend/api/Areas/Admin/Models/Parcel/BuildingFiscalModel.cs delete mode 100644 backend/api/Areas/Admin/Models/Parcel/BuildingModel.cs delete mode 100644 backend/api/Areas/Admin/Models/Parcel/ParcelBuildingModel.cs delete mode 100644 backend/api/Areas/Admin/Models/Parcel/ParcelEvaluationModel.cs delete mode 100644 backend/api/Areas/Admin/Models/Parcel/ParcelFiscalModel.cs delete mode 100644 backend/api/Areas/Admin/Models/Parcel/ParcelModel.cs delete mode 100644 backend/api/Areas/Admin/Models/Parcel/PartialBuildingModel.cs delete mode 100644 backend/api/Areas/Admin/Models/Parcel/PartialParcelModel.cs delete mode 100644 backend/api/Areas/Admin/Models/Parcel/PartialPropertyModel.cs delete mode 100644 backend/api/Areas/Admin/Models/Parcel/PropertyModel.cs delete mode 100644 backend/api/Areas/Admin/Models/Role/ClaimModel.cs delete mode 100644 backend/api/Areas/Admin/Models/Role/RoleModel.cs delete mode 100644 backend/api/Areas/Admin/Models/User/AccessRequestAgencyModel.cs delete mode 100644 backend/api/Areas/Admin/Models/User/AccessRequestModel.cs delete mode 100644 backend/api/Areas/Admin/Models/User/AccessRequestRoleModel.cs delete mode 100644 backend/api/Areas/Admin/Models/User/AccessRequestUserModel.cs delete mode 100644 backend/api/Areas/Admin/Models/User/AgencyModel.cs delete mode 100644 backend/api/Areas/Admin/Models/User/GoldUserModel.cs delete mode 100644 backend/api/Areas/Admin/Models/User/RoleModel.cs delete mode 100644 backend/api/Areas/Admin/Models/User/UserModel.cs delete mode 100644 backend/api/Areas/Keycloak/Controllers/RoleController.cs delete mode 100644 backend/api/Areas/Keycloak/Controllers/UserController.cs delete mode 100644 backend/api/Areas/Keycloak/Mapping/Role/RoleMap.cs delete mode 100644 backend/api/Areas/Keycloak/Mapping/Role/UpdateRoleMap.cs delete mode 100644 backend/api/Areas/Keycloak/Mapping/User/AccessRequestAgencyMap.cs delete mode 100644 backend/api/Areas/Keycloak/Mapping/User/AccessRequestMap.cs delete mode 100644 backend/api/Areas/Keycloak/Mapping/User/AccessRequestRoleMap.cs delete mode 100644 backend/api/Areas/Keycloak/Mapping/User/AccessRequestUserMap.cs delete mode 100644 backend/api/Areas/Keycloak/Mapping/User/AgencyMap.cs delete mode 100644 backend/api/Areas/Keycloak/Mapping/User/RoleMap.cs delete mode 100644 backend/api/Areas/Keycloak/Mapping/User/UserMap.cs delete mode 100644 backend/api/Areas/Keycloak/Models/Role/RoleModel.cs delete mode 100644 backend/api/Areas/Keycloak/Models/Role/Update/BaseModel.cs delete mode 100644 backend/api/Areas/Keycloak/Models/Role/Update/RoleModel.cs delete mode 100644 backend/api/Areas/Keycloak/Models/User/AccessRequestAgencyModel.cs delete mode 100644 backend/api/Areas/Keycloak/Models/User/AccessRequestModel.cs delete mode 100644 backend/api/Areas/Keycloak/Models/User/AccessRequestRoleModel.cs delete mode 100644 backend/api/Areas/Keycloak/Models/User/AccessRequestUserModel.cs delete mode 100644 backend/api/Areas/Keycloak/Models/User/AgencyModel.cs delete mode 100644 backend/api/Areas/Keycloak/Models/User/RoleModel.cs delete mode 100644 backend/api/Areas/Keycloak/Models/User/Update/BaseModel.cs delete mode 100644 backend/api/Areas/Keycloak/Models/User/Update/RoleModel.cs delete mode 100644 backend/api/Areas/Keycloak/Models/User/Update/UserAgencyModel.cs delete mode 100644 backend/api/Areas/Keycloak/Models/User/Update/UserRoleModel.cs delete mode 100644 backend/api/Areas/Keycloak/Models/User/UserModel.cs delete mode 100644 backend/api/Areas/Notification/Controllers/QueueController.cs delete mode 100644 backend/api/Areas/Notification/Controllers/TemplateController.cs delete mode 100644 backend/api/Areas/Notification/Mapping/Queue/NotificationQueueMap.cs delete mode 100644 backend/api/Areas/Notification/Mapping/Template/NotificationTemplateMap.cs delete mode 100644 backend/api/Areas/Notification/Mapping/Template/ProjectStatusNotificationMap.cs delete mode 100644 backend/api/Areas/Notification/Models/Queue/NotificationQueueModel.cs delete mode 100644 backend/api/Areas/Notification/Models/Template/NotificationTemplateModel.cs delete mode 100644 backend/api/Areas/Notification/Models/Template/ProjectStatusNotificationModel.cs delete mode 100644 backend/api/Areas/Project/Controllers/DisposeController.cs delete mode 100644 backend/api/Areas/Project/Controllers/ReportController.cs delete mode 100644 backend/api/Areas/Project/Controllers/SearchController.cs delete mode 100644 backend/api/Areas/Project/Controllers/StatusController.cs delete mode 100644 backend/api/Areas/Project/Controllers/WorkflowController.cs delete mode 100644 backend/api/Areas/Project/Mapping/Dispose/BuildingMap.cs delete mode 100644 backend/api/Areas/Project/Mapping/Dispose/DisposalProjectMetadataMap.cs delete mode 100644 backend/api/Areas/Project/Mapping/Dispose/ParcelMap.cs delete mode 100644 backend/api/Areas/Project/Mapping/Dispose/ProjectAgencyResponseMap.cs delete mode 100644 backend/api/Areas/Project/Mapping/Dispose/ProjectMap.cs delete mode 100644 backend/api/Areas/Project/Mapping/Dispose/ProjectNoteMap.cs delete mode 100644 backend/api/Areas/Project/Mapping/Dispose/ProjectPropertyMap.cs delete mode 100644 backend/api/Areas/Project/Mapping/Dispose/ProjectStatusHistoryMap.cs delete mode 100644 backend/api/Areas/Project/Mapping/Dispose/ProjectStatusMap.cs delete mode 100644 backend/api/Areas/Project/Mapping/Dispose/ProjectTaskMap.cs delete mode 100644 backend/api/Areas/Project/Mapping/Report/ProjectReportMap.cs delete mode 100644 backend/api/Areas/Project/Mapping/Report/ProjectSnapshotMap.cs delete mode 100644 backend/api/Areas/Project/Mapping/Search/ProjectMap.cs delete mode 100644 backend/api/Areas/Project/Mapping/Search/ProjectPropertyMap.cs delete mode 100644 backend/api/Areas/Project/Mapping/Status/ProjectStatusMap.cs delete mode 100644 backend/api/Areas/Project/Mapping/Status/TaskMap.cs delete mode 100644 backend/api/Areas/Project/Mapping/Status/WorkflowMap.cs delete mode 100644 backend/api/Areas/Project/Mapping/Workflow/ProjectStatusMap.cs delete mode 100644 backend/api/Areas/Project/Mapping/Workflow/TaskMap.cs delete mode 100644 backend/api/Areas/Project/Models/Dispose/BuildingModel.cs delete mode 100644 backend/api/Areas/Project/Models/Dispose/ParcelModel.cs delete mode 100644 backend/api/Areas/Project/Models/Dispose/ProjectAgencyResponse.cs delete mode 100644 backend/api/Areas/Project/Models/Dispose/ProjectModel.cs delete mode 100644 backend/api/Areas/Project/Models/Dispose/ProjectNoteModel.cs delete mode 100644 backend/api/Areas/Project/Models/Dispose/ProjectPropertyModel.cs delete mode 100644 backend/api/Areas/Project/Models/Dispose/ProjectStatusHistoryModel.cs delete mode 100644 backend/api/Areas/Project/Models/Dispose/ProjectStatusModel.cs delete mode 100644 backend/api/Areas/Project/Models/Dispose/ProjectTaskModel.cs delete mode 100644 backend/api/Areas/Project/Models/Dispose/SubdivisionParcelModel.cs delete mode 100644 backend/api/Areas/Project/Models/Report/ProjectReportModel.cs delete mode 100644 backend/api/Areas/Project/Models/Report/ProjectSnapshotModel.cs delete mode 100644 backend/api/Areas/Project/Models/Search/ProjectModel.cs delete mode 100644 backend/api/Areas/Project/Models/Search/ProjectPropertyModel.cs delete mode 100644 backend/api/Areas/Project/Models/Status/ProjectStatusModel.cs delete mode 100644 backend/api/Areas/Project/Models/Status/TaskModel.cs delete mode 100644 backend/api/Areas/Project/Models/Status/WorkflowModel.cs delete mode 100644 backend/api/Areas/Project/Models/Workflow/ProjectStatusModel.cs delete mode 100644 backend/api/Areas/Project/Models/Workflow/TaskModel.cs delete mode 100644 backend/api/Areas/Property/Controllers/BuildingController.cs delete mode 100644 backend/api/Areas/Property/Controllers/ParcelController.cs delete mode 100644 backend/api/Areas/Property/Controllers/SearchController.cs delete mode 100644 backend/api/Areas/Property/Mapping/Building/BuildingEvaluationMap.cs delete mode 100644 backend/api/Areas/Property/Mapping/Building/BuildingFiscalMap.cs delete mode 100644 backend/api/Areas/Property/Mapping/Building/BuildingMap.cs delete mode 100644 backend/api/Areas/Property/Mapping/Parcel/AddressMap.cs delete mode 100644 backend/api/Areas/Property/Mapping/Parcel/BuildingEvaluationMap.cs delete mode 100644 backend/api/Areas/Property/Mapping/Parcel/BuildingFiscalMap.cs delete mode 100644 backend/api/Areas/Property/Mapping/Parcel/BuildingParcelMap.cs delete mode 100644 backend/api/Areas/Property/Mapping/Parcel/ParcelBuildingMap.cs delete mode 100644 backend/api/Areas/Property/Mapping/Parcel/ParcelEvaluationMap.cs delete mode 100644 backend/api/Areas/Property/Mapping/Parcel/ParcelFiscalMap.cs delete mode 100644 backend/api/Areas/Property/Mapping/Parcel/ParcelMap.cs delete mode 100644 backend/api/Areas/Property/Mapping/Parcel/ParcelParcelMap.cs delete mode 100644 backend/api/Areas/Property/Mapping/Search/GeoJsonMap.cs delete mode 100644 backend/api/Areas/Property/Mapping/Search/PropertyMap.cs delete mode 100644 backend/api/Areas/Property/Models/Building/BuildingEvaluationModel.cs delete mode 100644 backend/api/Areas/Property/Models/Building/BuildingFiscalModel.cs delete mode 100644 backend/api/Areas/Property/Models/Building/BuildingModel.cs delete mode 100644 backend/api/Areas/Property/Models/Building/LeasedLandMetadataModel.cs delete mode 100644 backend/api/Areas/Property/Models/Parcel/AddressModel.cs delete mode 100644 backend/api/Areas/Property/Models/Parcel/BuildingEvaluationModel.cs delete mode 100644 backend/api/Areas/Property/Models/Parcel/BuildingFiscalModel.cs delete mode 100644 backend/api/Areas/Property/Models/Parcel/BuildingParcelModel.cs delete mode 100644 backend/api/Areas/Property/Models/Parcel/CheckPidAvailabilityResponseModel.cs delete mode 100644 backend/api/Areas/Property/Models/Parcel/ParcelBuildingModel.cs delete mode 100644 backend/api/Areas/Property/Models/Parcel/ParcelEvaluationModel.cs delete mode 100644 backend/api/Areas/Property/Models/Parcel/ParcelFiscalModel.cs delete mode 100644 backend/api/Areas/Property/Models/Parcel/ParcelModel.cs delete mode 100644 backend/api/Areas/Property/Models/Parcel/ParcelSubdivisionModel.cs delete mode 100644 backend/api/Areas/Property/Models/Parcel/PartialPropertyModel.cs delete mode 100644 backend/api/Areas/Property/Models/Parcel/PropertyModel.cs delete mode 100644 backend/api/Areas/Property/Models/Parcel/SubdivisionParcelModel.cs delete mode 100644 backend/api/Areas/Property/Models/Search/GeoJsonFilterModel.cs delete mode 100644 backend/api/Areas/Property/Models/Search/GeoJsonGeometryModel.cs delete mode 100644 backend/api/Areas/Property/Models/Search/GeoJsonModel.cs delete mode 100644 backend/api/Areas/Property/Models/Search/PropertyFilterModel.cs delete mode 100644 backend/api/Areas/Property/Models/Search/PropertyModel.cs delete mode 100644 backend/api/Areas/Reports/Controllers/ProjectController.cs delete mode 100644 backend/api/Areas/Reports/Controllers/PropertyController.cs delete mode 100644 backend/api/Areas/Reports/Controllers/UserController.cs delete mode 100644 backend/api/Areas/Reports/Mapping/Project/ProjectMap.cs delete mode 100644 backend/api/Areas/Reports/Mapping/Project/ProjectPropertyMap.cs delete mode 100644 backend/api/Areas/Reports/Mapping/Project/SurplusPropertyListMap.cs delete mode 100644 backend/api/Areas/Reports/Mapping/Property/AllFieldsPropertyMap.cs delete mode 100644 backend/api/Areas/Reports/Mapping/Property/PropertyMap.cs delete mode 100644 backend/api/Areas/Reports/Mapping/User/UserMap.cs delete mode 100644 backend/api/Areas/Reports/Models/Project/ProjectModel.cs delete mode 100644 backend/api/Areas/Reports/Models/Project/ProjectModelExcel.cs delete mode 100644 backend/api/Areas/Reports/Models/Project/ProjectPropertyModel.cs delete mode 100644 backend/api/Areas/Reports/Models/Project/SurplusPropertyListModel.cs delete mode 100644 backend/api/Areas/Reports/Models/Property/AllFieldsPropertyModel.cs delete mode 100644 backend/api/Areas/Reports/Models/Property/PropertyModel.cs delete mode 100644 backend/api/Areas/Reports/Models/User/UserModel.cs delete mode 100644 backend/api/Areas/Tools/Controllers/ChesController.cs delete mode 100644 backend/api/Areas/Tools/Controllers/GeocoderController.cs delete mode 100644 backend/api/Areas/Tools/Controllers/ImportController.cs delete mode 100644 backend/api/Areas/Tools/Controllers/LtsaController.cs delete mode 100644 backend/api/Areas/Tools/Helpers/ImportProjectsHelper.cs delete mode 100644 backend/api/Areas/Tools/Helpers/ImportPropertiesHelper.cs delete mode 100644 backend/api/Areas/Tools/Mapping/Geocoder/AddressMap.cs delete mode 100644 backend/api/Areas/Tools/Mapping/Geocoder/PidsMap.cs delete mode 100644 backend/api/Areas/Tools/Mapping/Import/AddressMap.cs delete mode 100644 backend/api/Areas/Tools/Mapping/Import/BuildingEvaluationMap.cs delete mode 100644 backend/api/Areas/Tools/Mapping/Import/BuildingFiscalMap.cs delete mode 100644 backend/api/Areas/Tools/Mapping/Import/ParcelBuildingMap.cs delete mode 100644 backend/api/Areas/Tools/Mapping/Import/ParcelEvaluationMap.cs delete mode 100644 backend/api/Areas/Tools/Mapping/Import/ParcelFiscalMap.cs delete mode 100644 backend/api/Areas/Tools/Mapping/Import/ParcelMap.cs delete mode 100644 backend/api/Areas/Tools/Mapping/Import/ProjectAgencyResponseMap.cs delete mode 100644 backend/api/Areas/Tools/Mapping/Import/ProjectMap.cs delete mode 100644 backend/api/Areas/Tools/Mapping/Import/ProjectNoteMap.cs delete mode 100644 backend/api/Areas/Tools/Mapping/Import/PropertyMap.cs delete mode 100644 backend/api/Areas/Tools/Models/Geocoder/AddressModel.cs delete mode 100644 backend/api/Areas/Tools/Models/Geocoder/SitePidsResponseModel.cs delete mode 100644 backend/api/Areas/Tools/Models/Import/AddressModel.cs delete mode 100644 backend/api/Areas/Tools/Models/Import/BuildingEvaluationModel.cs delete mode 100644 backend/api/Areas/Tools/Models/Import/BuildingFiscalModel.cs delete mode 100644 backend/api/Areas/Tools/Models/Import/ImportProjectModel.cs delete mode 100644 backend/api/Areas/Tools/Models/Import/ImportPropertyModel.cs delete mode 100644 backend/api/Areas/Tools/Models/Import/ParcelBuildingModel.cs delete mode 100644 backend/api/Areas/Tools/Models/Import/ParcelEvaluationModel.cs delete mode 100644 backend/api/Areas/Tools/Models/Import/ParcelFiscalModel.cs delete mode 100644 backend/api/Areas/Tools/Models/Import/ParcelModel.cs delete mode 100644 backend/api/Areas/Tools/Models/Import/ProjectAgencyResponseModel.cs delete mode 100644 backend/api/Areas/Tools/Models/Import/ProjectModel.cs delete mode 100644 backend/api/Areas/Tools/Models/Import/ProjectNoteModel.cs delete mode 100644 backend/api/Areas/Tools/Models/Import/PropertyModel.cs delete mode 100644 backend/api/Controllers/AuthController.cs delete mode 100644 backend/api/Controllers/ErrorController.cs delete mode 100644 backend/api/Controllers/HealthController.cs delete mode 100644 backend/api/Controllers/LookupController.cs delete mode 100644 backend/api/Controllers/UserController.cs delete mode 100644 backend/api/Helpers/Authorization/KeyCloakClaimTransformer.cs delete mode 100644 backend/api/Helpers/Authorization/KeyCloakClaimsFactory.cs delete mode 100644 backend/api/Helpers/Authorization/RealmAccessRoleHandler.cs delete mode 100644 backend/api/Helpers/Authorization/RealmAccessRoleRequirement.cs delete mode 100644 backend/api/Helpers/Constants/ContentTypes.cs delete mode 100644 backend/api/Helpers/Exceptions/ApiHttpRequestException.cs delete mode 100644 backend/api/Helpers/Exceptions/AuthenticationException.cs delete mode 100644 backend/api/Helpers/Exceptions/BadRequestException.cs delete mode 100644 backend/api/Helpers/Extensions/DateTimeExtensions.cs delete mode 100644 backend/api/Helpers/Extensions/ExceptionExtensions.cs delete mode 100644 backend/api/Helpers/Extensions/HttpResponseMessageExtensions.cs delete mode 100644 backend/api/Helpers/Logging/LoggerExtension.cs delete mode 100644 backend/api/Helpers/Mapping/ApplicationBuilderExtensions.cs delete mode 100644 backend/api/Helpers/Mapping/ServiceCollectionExtensions.cs delete mode 100644 backend/api/Helpers/Middleware/ErrorHandlingMiddleware.cs delete mode 100644 backend/api/Helpers/Middleware/LogRequestMiddleware.cs delete mode 100644 backend/api/Helpers/Middleware/ResponseTimeMiddleware.cs delete mode 100644 backend/api/Helpers/Reporting/ReportHelper.cs delete mode 100644 backend/api/Helpers/Routes/Constraints/PidConstraint.cs delete mode 100644 backend/api/Helpers/Swagger/ConfigureSwaggerOptions.cs delete mode 100644 backend/api/Helpers/Swagger/SwaggerDefaultValues.cs delete mode 100644 backend/api/Helpers/Swagger/SwaggerDocumentFilter.cs delete mode 100644 backend/api/Mapping/BaseMap.cs delete mode 100644 backend/api/Mapping/Building/AddressMap.cs delete mode 100644 backend/api/Mapping/Building/BuildingEvaluationMap.cs delete mode 100644 backend/api/Mapping/Building/BuildingFiscalMap.cs delete mode 100644 backend/api/Mapping/Building/BuildingMap.cs delete mode 100644 backend/api/Mapping/Building/PartialBuildingMap.cs delete mode 100644 backend/api/Mapping/CodeMap.cs delete mode 100644 backend/api/Mapping/Converters/AgencyConverter.cs delete mode 100644 backend/api/Mapping/Converters/ParcelConverter.cs delete mode 100644 backend/api/Mapping/Lookup/CodeMap.cs delete mode 100644 backend/api/Mapping/Lookup/LookupMap.cs delete mode 100644 backend/api/Mapping/Lookup/RoleMap.cs delete mode 100644 backend/api/Mapping/LookupMap.cs delete mode 100644 backend/api/Mapping/PageModelMap.cs delete mode 100644 backend/api/Mapping/Parcel/AddressMap.cs delete mode 100644 backend/api/Mapping/Parcel/BuildingEvaluationMap.cs delete mode 100644 backend/api/Mapping/Parcel/BuildingFiscalMap.cs delete mode 100644 backend/api/Mapping/Parcel/ParcelBuildingMap.cs delete mode 100644 backend/api/Mapping/Parcel/ParcelEvaluationMap.cs delete mode 100644 backend/api/Mapping/Parcel/ParcelFiscalMap.cs delete mode 100644 backend/api/Mapping/Parcel/ParcelMap.cs delete mode 100644 backend/api/Mapping/Parcel/PartialParcelMap.cs delete mode 100644 backend/api/Mapping/Project/DisposalProjectMetadataMap.cs delete mode 100644 backend/api/Mapping/Project/ProjectNoteMap.cs delete mode 100644 backend/api/Mapping/User/AccessRequestAgencyMap.cs delete mode 100644 backend/api/Mapping/User/AccessRequestMap.cs delete mode 100644 backend/api/Mapping/User/AccessRequestRoleMap.cs delete mode 100644 backend/api/Mapping/User/AccessRequestUserMap.cs delete mode 100644 backend/api/Mapping/User/AgencyMap.cs delete mode 100644 backend/api/Mapping/User/RoleMap.cs delete mode 100644 backend/api/Mapping/User/UserMap.cs delete mode 100644 backend/api/Models/Auth/ClaimModel.cs delete mode 100644 backend/api/Models/Auth/UserModel.cs delete mode 100644 backend/api/Models/BaseModel.cs delete mode 100644 backend/api/Models/Building/AddressModel.cs delete mode 100644 backend/api/Models/Building/BuildingEvaluationModel.cs delete mode 100644 backend/api/Models/Building/BuildingFiscalModel.cs delete mode 100644 backend/api/Models/Building/BuildingModel.cs delete mode 100644 backend/api/Models/Building/PartialBuildingModel.cs delete mode 100644 backend/api/Models/CodeModel.cs delete mode 100644 backend/api/Models/Create/BaseModel.cs delete mode 100644 backend/api/Models/ErrorResponseModel.cs delete mode 100644 backend/api/Models/Health/EnvModel.cs delete mode 100644 backend/api/Models/Lookup/RoleModel.cs delete mode 100644 backend/api/Models/LookupModel.cs delete mode 100644 backend/api/Models/Membership/ApplicationUserModel.cs delete mode 100644 backend/api/Models/PageModel.cs delete mode 100644 backend/api/Models/Parcel/AddressModel.cs delete mode 100644 backend/api/Models/Parcel/BuildingEvaluationModel.cs delete mode 100644 backend/api/Models/Parcel/BuildingFiscalModel.cs delete mode 100644 backend/api/Models/Parcel/BuildingParcelModel.cs delete mode 100644 backend/api/Models/Parcel/CheckPidAvailabilityResponseModel.cs delete mode 100644 backend/api/Models/Parcel/ParcelBuildingModel.cs delete mode 100644 backend/api/Models/Parcel/ParcelEvaluationModel.cs delete mode 100644 backend/api/Models/Parcel/ParcelFiscalModel.cs delete mode 100644 backend/api/Models/Parcel/ParcelModel.cs delete mode 100644 backend/api/Models/Parcel/PartialParcelModel.cs delete mode 100644 backend/api/Models/Parcel/PartialPropertyModel.cs delete mode 100644 backend/api/Models/Parcel/PropertyModel.cs delete mode 100644 backend/api/Models/Update/BaseModel.cs delete mode 100644 backend/api/Models/User/AccessRequestAgencyModel.cs delete mode 100644 backend/api/Models/User/AccessRequestModel.cs delete mode 100644 backend/api/Models/User/AccessRequestNotificationModel.cs delete mode 100644 backend/api/Models/User/AccessRequestRoleModel.cs delete mode 100644 backend/api/Models/User/AccessRequestUserModel.cs delete mode 100644 backend/api/Models/User/AgencyModel.cs delete mode 100644 backend/api/Models/User/RoleModel.cs delete mode 100644 backend/api/Models/User/UserModel.cs delete mode 100644 backend/api/Pims.Api.csproj delete mode 100644 backend/api/Policies/HasPermissionAttribute.cs delete mode 100644 backend/api/Policies/PermissionFilter.cs delete mode 100644 backend/api/Program.cs delete mode 100644 backend/api/Properties/launchSettings.json delete mode 100644 backend/api/Startup.cs delete mode 100644 backend/api/appsettings.Development.json delete mode 100644 backend/api/appsettings.Local.json delete mode 100644 backend/api/appsettings.Test.json delete mode 100644 backend/api/appsettings.json delete mode 100644 backend/api/ches.Development.json delete mode 100644 backend/api/ches.Local.json delete mode 100644 backend/api/ches.Test.json delete mode 100644 backend/api/ches.json delete mode 100644 backend/api/geocoder.Development.json delete mode 100644 backend/api/geocoder.Local.json delete mode 100644 backend/api/geocoder.Test.json delete mode 100644 backend/api/geocoder.json delete mode 100644 backend/api/ltsa.local.json delete mode 100644 backend/ches/ChesService.cs delete mode 100644 backend/ches/Configuration/ChesOptions.cs delete mode 100644 backend/ches/Exceptions/ChesException.cs delete mode 100644 backend/ches/Extensions/ServiceCollectionExtensions.cs delete mode 100644 backend/ches/IChesService.cs delete mode 100644 backend/ches/Models/AttachmentModel.cs delete mode 100644 backend/ches/Models/EmailBodyTypes.cs delete mode 100644 backend/ches/Models/EmailContextModel.cs delete mode 100644 backend/ches/Models/EmailEncodings.cs delete mode 100644 backend/ches/Models/EmailMergeModel.cs delete mode 100644 backend/ches/Models/EmailModel.cs delete mode 100644 backend/ches/Models/EmailPriorities.cs delete mode 100644 backend/ches/Models/EmailResponseModel.cs delete mode 100644 backend/ches/Models/ErrorModel.cs delete mode 100644 backend/ches/Models/ErrorResponseModel.cs delete mode 100644 backend/ches/Models/IAttachment.cs delete mode 100644 backend/ches/Models/IEmail.cs delete mode 100644 backend/ches/Models/IEmailContext.cs delete mode 100644 backend/ches/Models/IEmailMerge.cs delete mode 100644 backend/ches/Models/MessageResponseModel.cs delete mode 100644 backend/ches/Models/StatusHistoryResponseModel.cs delete mode 100644 backend/ches/Models/StatusModel.cs delete mode 100644 backend/ches/Models/StatusResponseModel.cs delete mode 100644 backend/ches/Pims.Ches.csproj delete mode 100644 backend/core/Comparers/DeepPropertyCompare.cs delete mode 100644 backend/core/Comparers/DeepPropertyCompare`.cs delete mode 100644 backend/core/Comparers/ShallowPropertyCompare.cs delete mode 100644 backend/core/Comparers/ShallowPropertyCompare`.cs delete mode 100644 backend/core/Converters/BooleanJsonConverter.cs delete mode 100644 backend/core/Converters/EnumValueJsonConverter.cs delete mode 100644 backend/core/Converters/GeometryJsonConverter.cs delete mode 100644 backend/core/Converters/Int32ToStringJsonConverter.cs delete mode 100644 backend/core/Converters/JsonEnumValueConverter.cs delete mode 100644 backend/core/Converters/MicrosecondEpochJsonConverter.cs delete mode 100644 backend/core/Exceptions/ConfigurationException.cs delete mode 100644 backend/core/Exceptions/HttpClientRequestException.cs delete mode 100644 backend/core/Exceptions/ProxyRequestException.cs delete mode 100644 backend/core/Extensions/ArrayExtensions.cs delete mode 100644 backend/core/Extensions/CollectionExtensions.cs delete mode 100644 backend/core/Extensions/DateExtensions.cs delete mode 100644 backend/core/Extensions/DictionaryExtensions.cs delete mode 100644 backend/core/Extensions/EnumExtensions.cs delete mode 100644 backend/core/Extensions/EnumerableExtensions.cs delete mode 100644 backend/core/Extensions/ExceptionExtensions.cs delete mode 100644 backend/core/Extensions/GeometryExtensions.cs delete mode 100644 backend/core/Extensions/IdentityExtensions.cs delete mode 100644 backend/core/Extensions/JsonSerializerExtensions.cs delete mode 100644 backend/core/Extensions/ObjectExtensions.cs delete mode 100644 backend/core/Extensions/QueryableExtensions.cs delete mode 100644 backend/core/Extensions/StringExtensions.cs delete mode 100644 backend/core/Extensions/TypeExtensions.cs delete mode 100644 backend/core/Extensions/UriBuilderExtensions.cs delete mode 100644 backend/core/Helpers/CsvHelper.cs delete mode 100644 backend/core/Helpers/ExceptionHelper.cs delete mode 100644 backend/core/Helpers/StringHelper.cs delete mode 100644 backend/core/Helpers/XmlHelper.cs delete mode 100644 backend/core/Http/Configuration/AuthClientOptions.cs delete mode 100644 backend/core/Http/Configuration/OpenIdConnectOptions.cs delete mode 100644 backend/core/Http/HttpRequestClient.cs delete mode 100644 backend/core/Http/IHttpRequestClient.cs delete mode 100644 backend/core/Http/IOpenIdConnectRequestClient.cs delete mode 100644 backend/core/Http/IProxyRequestClient.cs delete mode 100644 backend/core/Http/Models/LtsaOrderModel.cs delete mode 100644 backend/core/Http/Models/LtsaTitleSummaryModel.cs delete mode 100644 backend/core/Http/Models/LtsaTokenModel.cs delete mode 100644 backend/core/Http/Models/OpenIdConnectModel.cs delete mode 100644 backend/core/Http/Models/TokenModel.cs delete mode 100644 backend/core/Http/OpenIdConnectRequestClient.cs delete mode 100644 backend/core/Http/ProxyRequestClient.cs delete mode 100644 backend/core/Json/EnumValueAttribute.cs delete mode 100644 backend/core/Pims.Core.csproj delete mode 100644 backend/core/Properties/launchSettings.json delete mode 100644 backend/dal.keycloak/Extensions/ServiceCollectionExtensions.cs delete mode 100644 backend/dal.keycloak/IPimsKeycloakService.cs delete mode 100644 backend/dal.keycloak/Partials/PimsKeycloakRoleService.cs delete mode 100644 backend/dal.keycloak/Partials/PimsKeycloakUserService.cs delete mode 100644 backend/dal.keycloak/Pims.Dal.Keycloak.csproj delete mode 100644 backend/dal.keycloak/PimsKeycloakService.cs delete mode 100644 backend/dal/Configuration/AccessRequestAgencyConfiguration.cs delete mode 100644 backend/dal/Configuration/AccessRequestConfiguration.cs delete mode 100644 backend/dal/Configuration/AccessRequestRoleConfiguration.cs delete mode 100644 backend/dal/Configuration/AddressConfiguration.cs delete mode 100644 backend/dal/Configuration/AdministrativeAreaConfiguration.cs delete mode 100644 backend/dal/Configuration/AgencyConfiguration.cs delete mode 100644 backend/dal/Configuration/BaseEntityConfiguration`.cs delete mode 100644 backend/dal/Configuration/BuildingConfiguration.cs delete mode 100644 backend/dal/Configuration/BuildingConstructionTypeConfiguration.cs delete mode 100644 backend/dal/Configuration/BuildingEvaluationConfiguration.cs delete mode 100644 backend/dal/Configuration/BuildingFiscalConfiguration.cs delete mode 100644 backend/dal/Configuration/BuildingOccupantTypeConfiguration.cs delete mode 100644 backend/dal/Configuration/BuildingPredominateUseConfiguration.cs delete mode 100644 backend/dal/Configuration/ClaimConfiguration.cs delete mode 100644 backend/dal/Configuration/CodeEntityConfiguration`.cs delete mode 100644 backend/dal/Configuration/Generators/IntIdentityGenerator.cs delete mode 100644 backend/dal/Configuration/LookupEntityConfiguration`.cs delete mode 100644 backend/dal/Configuration/NotificationQueueConfiguration.cs delete mode 100644 backend/dal/Configuration/NotificationTemplateConfiguration.cs delete mode 100644 backend/dal/Configuration/ParcelBuildingConfiguration.cs delete mode 100644 backend/dal/Configuration/ParcelConfiguration.cs delete mode 100644 backend/dal/Configuration/ParcelEvaluationConfiguration.cs delete mode 100644 backend/dal/Configuration/ParcelFiscalConfiguration.cs delete mode 100644 backend/dal/Configuration/ParcelParcelsConfiguration.cs delete mode 100644 backend/dal/Configuration/ProjectAgencyResponseConfiguration.cs delete mode 100644 backend/dal/Configuration/ProjectConfiguration.cs delete mode 100644 backend/dal/Configuration/ProjectNoteConfiguration.cs delete mode 100644 backend/dal/Configuration/ProjectNumberConfiguration.cs delete mode 100644 backend/dal/Configuration/ProjectPropertyConfiguration.cs delete mode 100644 backend/dal/Configuration/ProjectReportConfiguration.cs delete mode 100644 backend/dal/Configuration/ProjectRiskConfiguration.cs delete mode 100644 backend/dal/Configuration/ProjectSnapshotConfiguration.cs delete mode 100644 backend/dal/Configuration/ProjectStatusConfiguration.cs delete mode 100644 backend/dal/Configuration/ProjectStatusHistoryConfiguration.cs delete mode 100644 backend/dal/Configuration/ProjectStatusNotificationConfiguration.cs delete mode 100644 backend/dal/Configuration/ProjectStatusTransitionConfiguration.cs delete mode 100644 backend/dal/Configuration/ProjectTaskConfiguration.cs delete mode 100644 backend/dal/Configuration/PropertyClassificationConfiguration.cs delete mode 100644 backend/dal/Configuration/PropertyConfiguration`.cs delete mode 100644 backend/dal/Configuration/PropertyTypeConfiguration.cs delete mode 100644 backend/dal/Configuration/ProvinceConfiguration.cs delete mode 100644 backend/dal/Configuration/RoleClaimConfiguration.cs delete mode 100644 backend/dal/Configuration/RoleConfiguration.cs delete mode 100644 backend/dal/Configuration/TaskConfiguration.cs delete mode 100644 backend/dal/Configuration/TierLevelConfiguration.cs delete mode 100644 backend/dal/Configuration/UserAgencyConfiguration.cs delete mode 100644 backend/dal/Configuration/UserConfiguration.cs delete mode 100644 backend/dal/Configuration/UserRoleConfiguration.cs delete mode 100644 backend/dal/Configuration/Views/PropertyConfiguration.cs delete mode 100644 backend/dal/Configuration/WorkflowConfiguration.cs delete mode 100644 backend/dal/Configuration/WorkflowProjectStatusConfiguration.cs delete mode 100644 backend/dal/Exceptions/ConfigurationException.cs delete mode 100644 backend/dal/Exceptions/NotAuthorizedException.cs delete mode 100644 backend/dal/Exceptions/RowVersionMissingException.cs delete mode 100644 backend/dal/Helpers/Extensions/AddressExtensions.cs delete mode 100644 backend/dal/Helpers/Extensions/ApplicationBuilderExtensions.cs delete mode 100644 backend/dal/Helpers/Extensions/BuildingExtensions.cs delete mode 100644 backend/dal/Helpers/Extensions/DbContextExtensions.cs delete mode 100644 backend/dal/Helpers/Extensions/EntityExtensions.cs delete mode 100644 backend/dal/Helpers/Extensions/EnumExtensions.cs delete mode 100644 backend/dal/Helpers/Extensions/IdentityExtensions.cs delete mode 100644 backend/dal/Helpers/Extensions/NoteExtensions.cs delete mode 100644 backend/dal/Helpers/Extensions/NotificationQueueExtensions.cs delete mode 100644 backend/dal/Helpers/Extensions/ParcelExtensions.cs delete mode 100644 backend/dal/Helpers/Extensions/ProjectExtensions.cs delete mode 100644 backend/dal/Helpers/Extensions/PropertyExtensions.cs delete mode 100644 backend/dal/Helpers/Extensions/RowVersionExtensions.cs delete mode 100644 backend/dal/Helpers/Extensions/ServiceCollectionExtensions.cs delete mode 100644 backend/dal/Helpers/Extensions/ServiceExtensions.cs delete mode 100644 backend/dal/Helpers/Extensions/WorkflowExtensions.cs delete mode 100644 backend/dal/Helpers/GeometryHelper.cs delete mode 100644 backend/dal/Helpers/Migrations/ModelBuilderExtensions.cs delete mode 100644 backend/dal/Helpers/Migrations/SeedMigration.cs delete mode 100644 backend/dal/IPimsService.cs delete mode 100644 backend/dal/IService.cs delete mode 100644 backend/dal/Migrations/20200722193504_Initial.Designer.cs delete mode 100644 backend/dal/Migrations/20200722193504_Initial.cs delete mode 100644 backend/dal/Migrations/20200925194028_v01.00.01.Designer.cs delete mode 100644 backend/dal/Migrations/20200925194028_v01.00.01.cs delete mode 100644 backend/dal/Migrations/20201022154928_v01.01.00.Designer.cs delete mode 100644 backend/dal/Migrations/20201022154928_v01.01.00.cs delete mode 100644 backend/dal/Migrations/20201102211604_v01.02.00.Designer.cs delete mode 100644 backend/dal/Migrations/20201102211604_v01.02.00.cs delete mode 100644 backend/dal/Migrations/20201119051823_v01.03.00.Designer.cs delete mode 100644 backend/dal/Migrations/20201119051823_v01.03.00.cs delete mode 100644 backend/dal/Migrations/20201126214802_v01.04.00.Designer.cs delete mode 100644 backend/dal/Migrations/20201126214802_v01.04.00.cs delete mode 100644 backend/dal/Migrations/20201210213149_v01.05.00.Designer.cs delete mode 100644 backend/dal/Migrations/20201210213149_v01.05.00.cs delete mode 100644 backend/dal/Migrations/20210107210217_v01.05.05.Designer.cs delete mode 100644 backend/dal/Migrations/20210107210217_v01.05.05.cs delete mode 100644 backend/dal/Migrations/20210114181825_v01.06.00.Designer.cs delete mode 100644 backend/dal/Migrations/20210114181825_v01.06.00.cs delete mode 100644 backend/dal/Migrations/20210128205552_v01.07.00.Designer.cs delete mode 100644 backend/dal/Migrations/20210128205552_v01.07.00.cs delete mode 100644 backend/dal/Migrations/20210217204245_v01.08.00.Designer.cs delete mode 100644 backend/dal/Migrations/20210217204245_v01.08.00.cs delete mode 100644 backend/dal/Migrations/20210303154503_v01.08.01.Designer.cs delete mode 100644 backend/dal/Migrations/20210303154503_v01.08.01.cs delete mode 100644 backend/dal/Migrations/20210308210949_v01.09.00.Designer.cs delete mode 100644 backend/dal/Migrations/20210308210949_v01.09.00.cs delete mode 100644 backend/dal/Migrations/20210319220555_v01.09.01.Designer.cs delete mode 100644 backend/dal/Migrations/20210319220555_v01.09.01.cs delete mode 100644 backend/dal/Migrations/20210323132211_v01.09.02.Designer.cs delete mode 100644 backend/dal/Migrations/20210323132211_v01.09.02.cs delete mode 100644 backend/dal/Migrations/20210422222731_v01.10.01.Designer.cs delete mode 100644 backend/dal/Migrations/20210422222731_v01.10.01.cs delete mode 100644 backend/dal/Migrations/20210505204819_v01.10.02.Designer.cs delete mode 100644 backend/dal/Migrations/20210505204819_v01.10.02.cs delete mode 100644 backend/dal/Migrations/20210531140549_v01.10.04.Designer.cs delete mode 100644 backend/dal/Migrations/20210531140549_v01.10.04.cs delete mode 100644 backend/dal/Migrations/20210610153039_v01.10.05.Designer.cs delete mode 100644 backend/dal/Migrations/20210610153039_v01.10.05.cs delete mode 100644 backend/dal/Migrations/20210616142943_v01.10.06.Designer.cs delete mode 100644 backend/dal/Migrations/20210616142943_v01.10.06.cs delete mode 100644 backend/dal/Migrations/20210705144630_v01.11.00.Designer.cs delete mode 100644 backend/dal/Migrations/20210705144630_v01.11.00.cs delete mode 100644 backend/dal/Migrations/20210709230420_v01.11.01.Designer.cs delete mode 100644 backend/dal/Migrations/20210709230420_v01.11.01.cs delete mode 100644 backend/dal/Migrations/20210712190221_v01.11.02.Designer.cs delete mode 100644 backend/dal/Migrations/20210712190221_v01.11.02.cs delete mode 100644 backend/dal/Migrations/20210712220515_v01.11.03.Designer.cs delete mode 100644 backend/dal/Migrations/20210712220515_v01.11.03.cs delete mode 100644 backend/dal/Migrations/20210809174827_v01.12.00.Designer.cs delete mode 100644 backend/dal/Migrations/20210809174827_v01.12.00.cs delete mode 100644 backend/dal/Migrations/20210903194147_v01.12.01.Designer.cs delete mode 100644 backend/dal/Migrations/20210903194147_v01.12.01.cs delete mode 100644 backend/dal/Migrations/20210920230505_v01.12.02.Designer.cs delete mode 100644 backend/dal/Migrations/20210920230505_v01.12.02.cs delete mode 100644 backend/dal/Migrations/20210923231113_v01.13.00.Designer.cs delete mode 100644 backend/dal/Migrations/20210923231113_v01.13.00.cs delete mode 100644 backend/dal/Migrations/20210929203118_v01.13.01.Designer.cs delete mode 100644 backend/dal/Migrations/20210929203118_v01.13.01.cs delete mode 100644 backend/dal/Migrations/20211005225722_v01.14.00.Designer.cs delete mode 100644 backend/dal/Migrations/20211005225722_v01.14.00.cs delete mode 100644 backend/dal/Migrations/20211103230229_v01.14.01.Designer.cs delete mode 100644 backend/dal/Migrations/20211103230229_v01.14.01.cs delete mode 100644 backend/dal/Migrations/20220209183559_v01.15.00.Designer.cs delete mode 100644 backend/dal/Migrations/20220209183559_v01.15.00.cs delete mode 100644 backend/dal/Migrations/20220308190231_v01.16.00.Designer.cs delete mode 100644 backend/dal/Migrations/20220308190231_v01.16.00.cs delete mode 100644 backend/dal/Migrations/20220316211239_v01.17.00.Designer.cs delete mode 100644 backend/dal/Migrations/20220316211239_v01.17.00.cs delete mode 100644 backend/dal/Migrations/20220404232725_v01.18.00.Designer.cs delete mode 100644 backend/dal/Migrations/20220404232725_v01.18.00.cs delete mode 100644 backend/dal/Migrations/20220420193357_v01.18.01.Designer.cs delete mode 100644 backend/dal/Migrations/20220420193357_v01.18.01.cs delete mode 100644 backend/dal/Migrations/20220425181658_v01.18.02.Designer.cs delete mode 100644 backend/dal/Migrations/20220425181658_v01.18.02.cs delete mode 100644 backend/dal/Migrations/20220624191347_v01.18.03.Designer.cs delete mode 100644 backend/dal/Migrations/20220624191347_v01.18.03.cs delete mode 100644 backend/dal/Migrations/20230103232746_v02.01.00.Designer.cs delete mode 100644 backend/dal/Migrations/20230103232746_v02.01.00.cs delete mode 100644 backend/dal/Migrations/20230309230913_v02.03.09.Designer.cs delete mode 100644 backend/dal/Migrations/20230309230913_v02.03.09.cs delete mode 100644 backend/dal/Migrations/20231003220606_v02.06.14.Designer.cs delete mode 100644 backend/dal/Migrations/20231003220606_v02.06.14.cs delete mode 100644 backend/dal/Migrations/20231129194537_v02.07.00.Designer.cs delete mode 100644 backend/dal/Migrations/20231129194537_v02.07.00.cs delete mode 100644 backend/dal/Migrations/20231207161338_v02.07.01.Designer.cs delete mode 100644 backend/dal/Migrations/20231207161338_v02.07.01.cs delete mode 100644 backend/dal/Migrations/Initial/Up/PostUp/01-Agencies.sql delete mode 100644 backend/dal/Migrations/Initial/Up/PostUp/01-BuildingConstructionTypes.sql delete mode 100644 backend/dal/Migrations/Initial/Up/PostUp/01-BuildingOccupantTypes.sql delete mode 100644 backend/dal/Migrations/Initial/Up/PostUp/01-BuildingPredominantUses.sql delete mode 100644 backend/dal/Migrations/Initial/Up/PostUp/01-Cities.sql delete mode 100644 backend/dal/Migrations/Initial/Up/PostUp/01-Claims.sql delete mode 100644 backend/dal/Migrations/Initial/Up/PostUp/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/Initial/Up/PostUp/01-ProjectNumbers.sql delete mode 100644 backend/dal/Migrations/Initial/Up/PostUp/01-ProjectRisks.sql delete mode 100644 backend/dal/Migrations/Initial/Up/PostUp/01-ProjectStatus.sql delete mode 100644 backend/dal/Migrations/Initial/Up/PostUp/01-PropertyClassifications.sql delete mode 100644 backend/dal/Migrations/Initial/Up/PostUp/01-PropertyTypes.sql delete mode 100644 backend/dal/Migrations/Initial/Up/PostUp/01-Provinces.sql delete mode 100644 backend/dal/Migrations/Initial/Up/PostUp/01-Roles.sql delete mode 100644 backend/dal/Migrations/Initial/Up/PostUp/01-Tasks.sql delete mode 100644 backend/dal/Migrations/Initial/Up/PostUp/01-TierLevels.sql delete mode 100644 backend/dal/Migrations/Initial/Up/PostUp/01-Users.sql delete mode 100644 backend/dal/Migrations/Initial/Up/PostUp/01-ViewProperties.sql delete mode 100644 backend/dal/Migrations/Initial/Up/PostUp/01-Workflow.sql delete mode 100644 backend/dal/Migrations/Initial/Up/PostUp/01-WorkflowProjectStatus.sql delete mode 100644 backend/dal/Migrations/Initial/Up/PostUp/02-ProjectStatusNotifications.sql delete mode 100644 backend/dal/Migrations/Initial/Up/PostUp/02-ProjectStatusTransitions.sql delete mode 100644 backend/dal/Migrations/Initial/Up/PostUp/02-RoleClaims.sql delete mode 100644 backend/dal/Migrations/PimsContextModelSnapshot.cs delete mode 100644 backend/dal/Migrations/v01.00.01/Down/PostDown/DisableRoles.sql delete mode 100644 backend/dal/Migrations/v01.00.01/Up/PostUp/DisableRoles.sql delete mode 100644 backend/dal/Migrations/v01.01.00/Down/PreDown/RemoveRolesAndClaims.sql delete mode 100644 backend/dal/Migrations/v01.01.00/Up/PreUp/AddRolesAndClaims.sql delete mode 100644 backend/dal/Migrations/v01.01.00/Up/PreUp/v01.01.02.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Down/PostDown/01-Buildings.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Down/PostDown/01-Cities.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Down/PostDown/01-ViewProperties.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Down/PostDown/02-Addresses.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Down/PreDown/01-AdministrativeAreas.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Down/PreDown/01-Buildings.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Down/PreDown/01-ParcelBuildings.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Down/PreDown/01-Parcels.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Down/PreDown/02-Addresses.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Down/PreDown/03-SpatialIndex.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Down/Properties/01-Buildings-Location.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Down/Properties/01-Parcels-Location.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Up/PostUp/01-Addresses.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Up/PostUp/01-AdministrativeAreas.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Up/PostUp/01-ParcelBuildings.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Up/PostUp/01-ViewProperties.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Up/PostUp/02-AdministrativeAreas.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Up/PostUp/02-Buildings.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Up/PostUp/03-SpatialIndex.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Up/PreUp/01-Addresses.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Up/PreUp/01-Buildings.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Up/PreUp/01-Cities.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Up/PreUp/01-Municipalities.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Up/Properties/01-Buildings-Location.sql delete mode 100644 backend/dal/Migrations/v01.02.00/Up/Properties/01-Parcels-Location.sql delete mode 100644 backend/dal/Migrations/v01.03.00/Down/PostDown/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.03.00/Down/PostDown/01-ProjectNotes.sql delete mode 100644 backend/dal/Migrations/v01.03.00/Down/PostDown/01-ProjectSnapshots.sql delete mode 100644 backend/dal/Migrations/v01.03.00/Down/PostDown/01-Projects.sql delete mode 100644 backend/dal/Migrations/v01.03.00/Down/PostDown/01-ViewProperties.sql delete mode 100644 backend/dal/Migrations/v01.03.00/Down/PreDown/01-ProjectNotes.sql delete mode 100644 backend/dal/Migrations/v01.03.00/Down/PreDown/01-ProjectSnapshots.sql delete mode 100644 backend/dal/Migrations/v01.03.00/Down/PreDown/01-Projects.sql delete mode 100644 backend/dal/Migrations/v01.03.00/Up/PostUp/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.03.00/Up/PostUp/01-ProjectNotes.sql delete mode 100644 backend/dal/Migrations/v01.03.00/Up/PostUp/01-ProjectSnapshots.sql delete mode 100644 backend/dal/Migrations/v01.03.00/Up/PostUp/01-Projects.sql delete mode 100644 backend/dal/Migrations/v01.03.00/Up/PreUp/01-Agencies.sql delete mode 100644 backend/dal/Migrations/v01.03.00/Up/PreUp/01-ProjectNotes.sql delete mode 100644 backend/dal/Migrations/v01.03.00/Up/PreUp/01-ProjectSnapshots.sql delete mode 100644 backend/dal/Migrations/v01.03.00/Up/PreUp/01-Projects.sql delete mode 100644 backend/dal/Migrations/v01.04.00/Down/PostDown/01-ProjectStatusTransitions.sql delete mode 100644 backend/dal/Migrations/v01.04.00/Down/PostDown/01-WorkflowProjectStatus.sql delete mode 100644 backend/dal/Migrations/v01.04.00/Down/PostDown/03-ProjectStatus.sql delete mode 100644 backend/dal/Migrations/v01.04.00/Up/PostUp/01-ProjectStatus.sql delete mode 100644 backend/dal/Migrations/v01.04.00/Up/PostUp/01-Tasks.sql delete mode 100644 backend/dal/Migrations/v01.04.00/Up/PostUp/01-WorkflowProjectStatus.sql delete mode 100644 backend/dal/Migrations/v01.04.00/Up/PostUp/02-ProjectStatusTransitions.sql delete mode 100644 backend/dal/Migrations/v01.05.00/Down/PostDown/01-ProjectRisks.sql delete mode 100644 backend/dal/Migrations/v01.05.00/Down/PostDown/01-ProjectStatusTransitions.sql delete mode 100644 backend/dal/Migrations/v01.05.00/Up/PostUp/01-ProjectRisks.sql delete mode 100644 backend/dal/Migrations/v01.05.00/Up/PostUp/01-ProjectStatusTransitions.sql delete mode 100644 backend/dal/Migrations/v01.05.00/Up/PostUp/01-Tasks.sql delete mode 100644 backend/dal/Migrations/v01.05.00/Up/PostUp/02-Agencies.sql delete mode 100644 backend/dal/Migrations/v01.05.05/Up/PostUp/01-BuildingConstructionTypes.sql delete mode 100644 backend/dal/Migrations/v01.05.05/Up/PostUp/01-BuildingPredominantUses.sql delete mode 100644 backend/dal/Migrations/v01.05.05/Up/PostUp/02-BuildingPredominateUses.sql delete mode 100644 backend/dal/Migrations/v01.06.00/Down/PostDown/01-Buildings.sql delete mode 100644 backend/dal/Migrations/v01.06.00/Down/PostDown/01-Parcels.sql delete mode 100644 backend/dal/Migrations/v01.06.00/Down/PostDown/01-ViewProperties.sql delete mode 100644 backend/dal/Migrations/v01.06.00/Down/PreDown/01-Buildings.sql delete mode 100644 backend/dal/Migrations/v01.06.00/Down/PreDown/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.06.00/Down/PreDown/01-Parcels.sql delete mode 100644 backend/dal/Migrations/v01.06.00/Down/PreDown/01-Projects.sql delete mode 100644 backend/dal/Migrations/v01.06.00/Down/PreDown/01-RemoveRolesAndClaims.sql delete mode 100644 backend/dal/Migrations/v01.06.00/Up/PostUp/01-AddRoleAndClaims.sql delete mode 100644 backend/dal/Migrations/v01.06.00/Up/PostUp/01-Buildings.sql delete mode 100644 backend/dal/Migrations/v01.06.00/Up/PostUp/01-Parcels.sql delete mode 100644 backend/dal/Migrations/v01.06.00/Up/PostUp/01-ViewProperties.sql delete mode 100644 backend/dal/Migrations/v01.06.00/Up/PreUp/01-BuildingPredominateUses.sql delete mode 100644 backend/dal/Migrations/v01.06.00/Up/PreUp/01-Buildings.sql delete mode 100644 backend/dal/Migrations/v01.06.00/Up/PreUp/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.06.00/Up/PreUp/01-Parcels.sql delete mode 100644 backend/dal/Migrations/v01.07.00/Down/PostDown/01-ProjectStatusTransitions.sql delete mode 100644 backend/dal/Migrations/v01.07.00/Down/PostDown/02-WorkflowProjectStatus.sql delete mode 100644 backend/dal/Migrations/v01.07.00/Down/PreDown/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.07.00/Down/PreDown/01-RemoveNewClassifications.sql delete mode 100644 backend/dal/Migrations/v01.07.00/Down/PreDown/01-ViewProperties.sql delete mode 100644 backend/dal/Migrations/v01.07.00/Up/PostUp/01-Adminstrative_Areas_And_Addresses.sql delete mode 100644 backend/dal/Migrations/v01.07.00/Up/PostUp/01-Agencies.sql delete mode 100644 backend/dal/Migrations/v01.07.00/Up/PostUp/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.07.00/Up/PostUp/01-PropertyClassificationTypes.sql delete mode 100644 backend/dal/Migrations/v01.07.00/Up/PostUp/01-PropertyTypes.sql delete mode 100644 backend/dal/Migrations/v01.07.00/Up/PostUp/01-ViewProperties.sql delete mode 100644 backend/dal/Migrations/v01.07.00/Up/PostUp/01-WorkflowProjectStatus.sql delete mode 100644 backend/dal/Migrations/v01.07.00/Up/PostUp/02-ProjectStatusTransitions.sql delete mode 100644 backend/dal/Migrations/v01.07.00/Up/PreUp/01-Buildings.sql delete mode 100644 backend/dal/Migrations/v01.07.00/Up/PreUp/01-Parcels.sql delete mode 100644 backend/dal/Migrations/v01.08.00/Down/PostDown/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.08.00/Down/PostDown/01-ProjectStatusTransitions.sql delete mode 100644 backend/dal/Migrations/v01.08.00/Down/PostDown/01-ViewProperties.sql delete mode 100644 backend/dal/Migrations/v01.08.00/Up/Postup/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.08.00/Up/Postup/01-ProjectStatus.sql delete mode 100644 backend/dal/Migrations/v01.08.00/Up/Postup/01-ProjectStatusTransitions.sql delete mode 100644 backend/dal/Migrations/v01.08.00/Up/Postup/01-Tasks.sql delete mode 100644 backend/dal/Migrations/v01.08.00/Up/Postup/01-ViewProperties.sql delete mode 100644 backend/dal/Migrations/v01.08.00/Up/PreUp/01-Buildings.sql delete mode 100644 backend/dal/Migrations/v01.08.00/Up/PreUp/01-Parcels.sql delete mode 100644 backend/dal/Migrations/v01.08.00/Up/PreUp/02-Buildings.sql delete mode 100644 backend/dal/Migrations/v01.08.01/Down/PostDown/01-ProjectStatusTransitions.sql delete mode 100644 backend/dal/Migrations/v01.08.01/Up/Postup/01-AdministrativeAreas.sql delete mode 100644 backend/dal/Migrations/v01.08.01/Up/Postup/01-Buildings.sql delete mode 100644 backend/dal/Migrations/v01.08.01/Up/Postup/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.08.01/Up/Postup/01-Parcels.sql delete mode 100644 backend/dal/Migrations/v01.08.01/Up/Postup/01-ProjectStatusTransitions.sql delete mode 100644 backend/dal/Migrations/v01.09.00/Down/PostDown/01-ProjectStatusTransitions.sql delete mode 100644 backend/dal/Migrations/v01.09.00/Down/PostDown/02-RoleClaims.sql delete mode 100644 backend/dal/Migrations/v01.09.00/Up/PostUp/01-Agencies.sql delete mode 100644 backend/dal/Migrations/v01.09.00/Up/PostUp/01-BuildingPredominateUses.sql delete mode 100644 backend/dal/Migrations/v01.09.00/Up/PostUp/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.09.00/Up/PostUp/01-ProjectStatusTransitions.sql delete mode 100644 backend/dal/Migrations/v01.09.00/Up/PostUp/02-RoleClaims.sql delete mode 100644 backend/dal/Migrations/v01.09.01/Up/PreUp/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.09.02/Up/PostUp/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.10.01/Up/PostUp/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.10.02/Up/PostUp/01-ProjectStatusNotifications.sql delete mode 100644 backend/dal/Migrations/v01.10.04/Up/PostUp/01-Agencies.sql delete mode 100644 backend/dal/Migrations/v01.10.05/Up/PostUp/01-Properties.sql delete mode 100644 backend/dal/Migrations/v01.10.06/Up/PostUp/01-ProjectStatusTransitions.sql delete mode 100644 backend/dal/Migrations/v01.11.00/Down/PostDown/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.11.00/Up/PostUp/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.11.01/Down/PostDown/01-ProjectStatusTransitions.sql delete mode 100644 backend/dal/Migrations/v01.11.01/Up/PostUp/01-ProjectStatusTransitions.sql delete mode 100644 backend/dal/Migrations/v01.11.02/Up/PostUp/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.11.03/Up/PostUp/01-AdministrativeAreas.sql delete mode 100644 backend/dal/Migrations/v01.12.00/Up/PostUp/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.12.01/Up/PostUp/01-Users.sql delete mode 100644 backend/dal/Migrations/v01.12.02/Up/PreUp/01-AdministrativeAreas.sql delete mode 100644 backend/dal/Migrations/v01.13.01/Down/PreDown/RemoveNotificationTemplate.sql delete mode 100644 backend/dal/Migrations/v01.13.01/Up/PostUp/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.14.00/Down/PreDown/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.14.00/Up/PostUp/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.14.01/Down/PostDown/02-WorkflowProjectStatus.sql delete mode 100644 backend/dal/Migrations/v01.14.01/Up/PostUp/01-WorkflowProjectStatus.sql delete mode 100644 backend/dal/Migrations/v01.15.00/Down/PostDown/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.15.00/Up/PostUp/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.16.00/Down/PostDown/01-ViewProperties.sql delete mode 100644 backend/dal/Migrations/v01.16.00/Up/PostUp/01-ViewProperties.sql delete mode 100644 backend/dal/Migrations/v01.17.00/Down/PostDown/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.17.00/Up/PostUp/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v01.18.00/Up/PostUp/01-BuildingEvaluations.sql delete mode 100644 backend/dal/Migrations/v01.18.01/Up/PostUp/01-ProjectStatusTransitions.sql delete mode 100644 backend/dal/Migrations/v01.18.02/Up/PostUp/01-ProjectStatusTransition.sql delete mode 100644 backend/dal/Migrations/v02.01.00/Up/PostUp/01-ProjectStatus.sql delete mode 100644 backend/dal/Migrations/v02.03.09/Up/PostUp/01-Roles.sql delete mode 100644 backend/dal/Migrations/v02.06.14/Up/PostUp/01-NotificationTemplates.sql delete mode 100644 backend/dal/Migrations/v02.07.00/Up/PostUp/01-AdministrativeAreas.sql delete mode 100644 backend/dal/Migrations/v02.07.01/Up/PostUp/01-AdministrativeAreas.sql delete mode 100644 backend/dal/Options/AccessRequestOptions.cs delete mode 100644 backend/dal/Options/EnvironmentOptions.cs delete mode 100644 backend/dal/Options/NotificationOptions.cs delete mode 100644 backend/dal/Options/PimsOptions.cs delete mode 100644 backend/dal/Options/ProjectOptions.cs delete mode 100644 backend/dal/Options/ServiceAccountOptions.cs delete mode 100644 backend/dal/PIMSContext.cs delete mode 100644 backend/dal/PIMSContextFactory.cs delete mode 100644 backend/dal/Pims.Dal.csproj delete mode 100644 backend/dal/PimsService.cs delete mode 100644 backend/dal/Properties/launchSettings.json delete mode 100644 backend/dal/Security/Permissions.cs delete mode 100644 backend/dal/Services/Admin/Concrete/AddressService.cs delete mode 100644 backend/dal/Services/Admin/Concrete/AdministrativeAreaService.cs delete mode 100644 backend/dal/Services/Admin/Concrete/AgencyService.cs delete mode 100644 backend/dal/Services/Admin/Concrete/BaseService`.cs delete mode 100644 backend/dal/Services/Admin/Concrete/BuildingConstructionTypeService.cs delete mode 100644 backend/dal/Services/Admin/Concrete/BuildingPredominateUseService.cs delete mode 100644 backend/dal/Services/Admin/Concrete/BuildingService.cs delete mode 100644 backend/dal/Services/Admin/Concrete/ClaimService.cs delete mode 100644 backend/dal/Services/Admin/Concrete/ParcelService.cs delete mode 100644 backend/dal/Services/Admin/Concrete/ProjectRiskService.cs delete mode 100644 backend/dal/Services/Admin/Concrete/ProjectService.cs delete mode 100644 backend/dal/Services/Admin/Concrete/ProjectStatusService.cs delete mode 100644 backend/dal/Services/Admin/Concrete/PropertyClassificationService.cs delete mode 100644 backend/dal/Services/Admin/Concrete/PropertyTypeService.cs delete mode 100644 backend/dal/Services/Admin/Concrete/ProvinceService.cs delete mode 100644 backend/dal/Services/Admin/Concrete/RoleService.cs delete mode 100644 backend/dal/Services/Admin/Concrete/TierLevelService.cs delete mode 100644 backend/dal/Services/Admin/Concrete/UserService.cs delete mode 100644 backend/dal/Services/Admin/Concrete/WorkflowService.cs delete mode 100644 backend/dal/Services/Admin/IAddressService.cs delete mode 100644 backend/dal/Services/Admin/IAdministrativeAreaService.cs delete mode 100644 backend/dal/Services/Admin/IAgencyService.cs delete mode 100644 backend/dal/Services/Admin/IBaseService`.cs delete mode 100644 backend/dal/Services/Admin/IBuildingConstructionTypeService.cs delete mode 100644 backend/dal/Services/Admin/IBuildingPredominateUseService.cs delete mode 100644 backend/dal/Services/Admin/IBuildingService.cs delete mode 100644 backend/dal/Services/Admin/IClaimService.cs delete mode 100644 backend/dal/Services/Admin/IParcelService.cs delete mode 100644 backend/dal/Services/Admin/IPimsAdminService.cs delete mode 100644 backend/dal/Services/Admin/IProjectRiskService.cs delete mode 100644 backend/dal/Services/Admin/IProjectService.cs delete mode 100644 backend/dal/Services/Admin/IProjectStatusService.cs delete mode 100644 backend/dal/Services/Admin/IPropertyClassificationService.cs delete mode 100644 backend/dal/Services/Admin/IPropertyTypeService.cs delete mode 100644 backend/dal/Services/Admin/IProvinceService.cs delete mode 100644 backend/dal/Services/Admin/IRoleService.cs delete mode 100644 backend/dal/Services/Admin/ITierLevelService.cs delete mode 100644 backend/dal/Services/Admin/IUserService.cs delete mode 100644 backend/dal/Services/Admin/IWorkflowService.cs delete mode 100644 backend/dal/Services/Admin/PimsAdminService.cs delete mode 100644 backend/dal/Services/BaseService.cs delete mode 100644 backend/dal/Services/BaseService`.cs delete mode 100644 backend/dal/Services/Concrete/BuildingService.cs delete mode 100644 backend/dal/Services/Concrete/LookupService.cs delete mode 100644 backend/dal/Services/Concrete/NotificationQueueService.cs delete mode 100644 backend/dal/Services/Concrete/NotificationTemplateService.cs delete mode 100644 backend/dal/Services/Concrete/ParcelService.cs delete mode 100644 backend/dal/Services/Concrete/ProjectNotificationService.cs delete mode 100644 backend/dal/Services/Concrete/ProjectReportService.cs delete mode 100644 backend/dal/Services/Concrete/ProjectService.cs delete mode 100644 backend/dal/Services/Concrete/ProjectStatusService.cs delete mode 100644 backend/dal/Services/Concrete/PropertyService.cs delete mode 100644 backend/dal/Services/Concrete/TaskService.cs delete mode 100644 backend/dal/Services/Concrete/UserService.cs delete mode 100644 backend/dal/Services/Concrete/WorkflowService.cs delete mode 100644 backend/dal/Services/IBuildingService.cs delete mode 100644 backend/dal/Services/ILookupService.cs delete mode 100644 backend/dal/Services/INotificationQueueService.cs delete mode 100644 backend/dal/Services/INotificationService.cs delete mode 100644 backend/dal/Services/INotificationTemplateService.cs delete mode 100644 backend/dal/Services/IParcelService.cs delete mode 100644 backend/dal/Services/IProjectNotificationService.cs delete mode 100644 backend/dal/Services/IProjectReportService.cs delete mode 100644 backend/dal/Services/IProjectService.cs delete mode 100644 backend/dal/Services/IProjectStatusService.cs delete mode 100644 backend/dal/Services/IPropertyService.cs delete mode 100644 backend/dal/Services/ITaskService.cs delete mode 100644 backend/dal/Services/IUserService.cs delete mode 100644 backend/dal/Services/IWorkflowService.cs delete mode 100644 backend/entities/AccessRequest.cs delete mode 100644 backend/entities/AccessRequestAgency.cs delete mode 100644 backend/entities/AccessRequestRole.cs delete mode 100644 backend/entities/AccessRequestStatus.cs delete mode 100644 backend/entities/Address.cs delete mode 100644 backend/entities/AdministrativeArea.cs delete mode 100644 backend/entities/Agency.cs delete mode 100644 backend/entities/BaseEntity.cs delete mode 100644 backend/entities/Building.cs delete mode 100644 backend/entities/BuildingConstructionType.cs delete mode 100644 backend/entities/BuildingEvaluation.cs delete mode 100644 backend/entities/BuildingFiscal.cs delete mode 100644 backend/entities/BuildingOccupantType.cs delete mode 100644 backend/entities/BuildingPredominateUse.cs delete mode 100644 backend/entities/Claim.cs delete mode 100644 backend/entities/ClassificationTypes.cs delete mode 100644 backend/entities/CodeEntity.cs delete mode 100644 backend/entities/Comparers/AccessRequestAgencyAgencyIdComparer.cs delete mode 100644 backend/entities/Comparers/AccessRequestRoleRoleIdComparer.cs delete mode 100644 backend/entities/Comparers/AgencyIdComparer.cs delete mode 100644 backend/entities/Comparers/RoleIdComparer.cs delete mode 100644 backend/entities/Comparers/UserAgencyAgencyIdComparer.cs delete mode 100644 backend/entities/Comparers/UserRoleRoleIdComparer.cs delete mode 100644 backend/entities/EvalutationKeys.cs delete mode 100644 backend/entities/FiscalKeys.cs delete mode 100644 backend/entities/GoldUser.cs delete mode 100644 backend/entities/Helpers/Extensions/BuildingExtensions.cs delete mode 100644 backend/entities/Helpers/Extensions/ParcelExtensions.cs delete mode 100644 backend/entities/Helpers/Extensions/ProjectExtensions.cs delete mode 100644 backend/entities/LeasedLandTypes.cs delete mode 100644 backend/entities/LookupEntity.cs delete mode 100644 backend/entities/Models/AccessRequestFilter.cs delete mode 100644 backend/entities/Models/AdministrativeAreaFilter.cs delete mode 100644 backend/entities/Models/AgencyFilter.cs delete mode 100644 backend/entities/Models/AllPropertyFilter.cs delete mode 100644 backend/entities/Models/BuildingFilter.cs delete mode 100644 backend/entities/Models/BuildingModel.cs delete mode 100644 backend/entities/Models/DisposalProjectMetadata.cs delete mode 100644 backend/entities/Models/DisposalProjectSnapshotMetadata.cs delete mode 100644 backend/entities/Models/EnvironmentModel.cs delete mode 100644 backend/entities/Models/LeasedLandMetadataModel.cs delete mode 100644 backend/entities/Models/NotificationQueueFilter.cs delete mode 100644 backend/entities/Models/PageFilter.cs delete mode 100644 backend/entities/Models/Paged`.cs delete mode 100644 backend/entities/Models/ParcelFilter.cs delete mode 100644 backend/entities/Models/ParcelModel.cs delete mode 100644 backend/entities/Models/ProjectFilter.cs delete mode 100644 backend/entities/Models/ProjectNotificationFilter.cs delete mode 100644 backend/entities/Models/ProjectNotificationModel.cs delete mode 100644 backend/entities/Models/ProjectProperty.cs delete mode 100644 backend/entities/Models/PropertyFilter.cs delete mode 100644 backend/entities/Models/PropertyModel.cs delete mode 100644 backend/entities/Models/UserFilter.cs delete mode 100644 backend/entities/NoteTypes.cs delete mode 100644 backend/entities/NotificationAudiences.cs delete mode 100644 backend/entities/NotificationBodyTypes.cs delete mode 100644 backend/entities/NotificationDelays.cs delete mode 100644 backend/entities/NotificationEncodings.cs delete mode 100644 backend/entities/NotificationPriorities.cs delete mode 100644 backend/entities/NotificationQueue.cs delete mode 100644 backend/entities/NotificationResponses.cs delete mode 100644 backend/entities/NotificationStatus.cs delete mode 100644 backend/entities/NotificationTemplate.cs delete mode 100644 backend/entities/Parcel.cs delete mode 100644 backend/entities/ParcelBuildings.cs delete mode 100644 backend/entities/ParcelEvaluation.cs delete mode 100644 backend/entities/ParcelFiscal.cs delete mode 100644 backend/entities/ParcelParcel.cs delete mode 100644 backend/entities/Pims.Dal.Entities.csproj delete mode 100644 backend/entities/Project.cs delete mode 100644 backend/entities/ProjectAgencyResponse.cs delete mode 100644 backend/entities/ProjectNote.cs delete mode 100644 backend/entities/ProjectNumber.cs delete mode 100644 backend/entities/ProjectProperty.cs delete mode 100644 backend/entities/ProjectReport.cs delete mode 100644 backend/entities/ProjectRisk.cs delete mode 100644 backend/entities/ProjectSnapshot.cs delete mode 100644 backend/entities/ProjectStatus.cs delete mode 100644 backend/entities/ProjectStatusHistory.cs delete mode 100644 backend/entities/ProjectStatusNotification.cs delete mode 100644 backend/entities/ProjectStatusTransition.cs delete mode 100644 backend/entities/ProjectTask.cs delete mode 100644 backend/entities/ProjectTypes.cs delete mode 100644 backend/entities/Property.cs delete mode 100644 backend/entities/PropertyClassification.cs delete mode 100644 backend/entities/PropertyType.cs delete mode 100644 backend/entities/PropertyTypes.cs delete mode 100644 backend/entities/Province.cs delete mode 100644 backend/entities/ReportTypes.cs delete mode 100644 backend/entities/Role.cs delete mode 100644 backend/entities/RoleClaim.cs delete mode 100644 backend/entities/Task.cs delete mode 100644 backend/entities/TierLevel.cs delete mode 100644 backend/entities/User.cs delete mode 100644 backend/entities/UserAgency.cs delete mode 100644 backend/entities/UserRole.cs delete mode 100644 backend/entities/Views/Property.cs delete mode 100644 backend/entities/Workflow.cs delete mode 100644 backend/entities/WorkflowProjectStatus.cs delete mode 100644 backend/entrypoint.sh delete mode 100644 backend/geocoder/Configuration/GeocoderOptions.cs delete mode 100644 backend/geocoder/Configuration/IntersectionOptions.cs delete mode 100644 backend/geocoder/Configuration/OccupantOptions.cs delete mode 100644 backend/geocoder/Configuration/ParcelOptions.cs delete mode 100644 backend/geocoder/Configuration/SiteOptions.cs delete mode 100644 backend/geocoder/Extensions/ParameterExtensions.cs delete mode 100644 backend/geocoder/Extensions/ServiceCollectionExtensions.cs delete mode 100644 backend/geocoder/GeocoderService.cs delete mode 100644 backend/geocoder/IGeocoderService.cs delete mode 100644 backend/geocoder/Models/CrsModel.cs delete mode 100644 backend/geocoder/Models/FaultModel.cs delete mode 100644 backend/geocoder/Models/FeatureCollectionModel.cs delete mode 100644 backend/geocoder/Models/FeatureModel.cs delete mode 100644 backend/geocoder/Models/GeometeryModel.cs delete mode 100644 backend/geocoder/Models/GeometryModel.cs delete mode 100644 backend/geocoder/Models/PropertyModel.cs delete mode 100644 backend/geocoder/Models/SitePidsResponseModel.cs delete mode 100644 backend/geocoder/Parameters/AddressesParameters.cs delete mode 100644 backend/geocoder/Pims.Geocoder.csproj delete mode 100644 backend/keycloak/Configuration/KeycloakAdminOptions.cs delete mode 100644 backend/keycloak/Configuration/KeycloakOptions.cs delete mode 100644 backend/keycloak/Configuration/KeycloakServiceAccountOptions.cs delete mode 100644 backend/keycloak/Extensions/HttpResponseMessageExtensions.cs delete mode 100644 backend/keycloak/Extensions/ServiceCollectionExtensions.cs delete mode 100644 backend/keycloak/IKeycloakService.cs delete mode 100644 backend/keycloak/KeycloakService.cs delete mode 100644 backend/keycloak/Models/CountModel.cs delete mode 100644 backend/keycloak/Models/GroupModel.cs delete mode 100644 backend/keycloak/Models/RoleCompositieModel.cs delete mode 100644 backend/keycloak/Models/RoleModel.cs delete mode 100644 backend/keycloak/Models/UserInfoModel.cs delete mode 100644 backend/keycloak/Models/UserModel.cs delete mode 100644 backend/keycloak/Partials/KeycloakServiceAttackDetection.cs delete mode 100644 backend/keycloak/Partials/KeycloakServiceGroups.cs delete mode 100644 backend/keycloak/Partials/KeycloakServiceRoles.cs delete mode 100644 backend/keycloak/Partials/KeycloakServiceUsers.cs delete mode 100644 backend/keycloak/Pims.Keycloak.csproj delete mode 100644 backend/keycloak/README.md delete mode 100644 backend/ltsa/Configuration/LtsaOptions.cs delete mode 100644 backend/ltsa/Extensions/ServiceCollectionExtensions.cs delete mode 100644 backend/ltsa/ILtsaService.cs delete mode 100644 backend/ltsa/LtsaService.cs delete mode 100644 backend/ltsa/Pims.Ltsa.csproj delete mode 100644 backend/notifications/Configuration/NotificationOptions.cs delete mode 100644 backend/notifications/Extensions/ServiceCollectionExtensions.cs delete mode 100644 backend/notifications/INotificationService.cs delete mode 100644 backend/notifications/Models/Email.cs delete mode 100644 backend/notifications/Models/EmailBodyTypes.cs delete mode 100644 backend/notifications/Models/EmailEncodings.cs delete mode 100644 backend/notifications/Models/EmailPriorities.cs delete mode 100644 backend/notifications/Models/EmailResponse.cs delete mode 100644 backend/notifications/Models/EmailTemplate.cs delete mode 100644 backend/notifications/Models/IEmail.cs delete mode 100644 backend/notifications/Models/IEmailTemplate.cs delete mode 100644 backend/notifications/Models/MessageResponse.cs delete mode 100644 backend/notifications/Models/StatusResponse.cs delete mode 100644 backend/notifications/NotificationService.cs delete mode 100644 backend/notifications/Pims.Notifications.csproj delete mode 100644 backend/tests/.gitignore delete mode 100644 backend/tests/README.md delete mode 100644 backend/tests/core/ControllerHelper.cs delete mode 100644 backend/tests/core/DatabaseHelper.cs delete mode 100644 backend/tests/core/Entities/AccessRequestHelper.cs delete mode 100644 backend/tests/core/Entities/AddressHelper.cs delete mode 100644 backend/tests/core/Entities/AdministrativeAreaHelper.cs delete mode 100644 backend/tests/core/Entities/AgencyHelper.cs delete mode 100644 backend/tests/core/Entities/BuildingContructionTypeHelper.cs delete mode 100644 backend/tests/core/Entities/BuildingEvaluationHelper.cs delete mode 100644 backend/tests/core/Entities/BuildingFiscalHelper.cs delete mode 100644 backend/tests/core/Entities/BuildingHelper.cs delete mode 100644 backend/tests/core/Entities/BuildingOccupantTypeHelper.cs delete mode 100644 backend/tests/core/Entities/BuildingPredominateUseHelper.cs delete mode 100644 backend/tests/core/Entities/NotificationQueueHelper.cs delete mode 100644 backend/tests/core/Entities/NotificationTemplateHelper.cs delete mode 100644 backend/tests/core/Entities/ParcelEvaluationHelper.cs delete mode 100644 backend/tests/core/Entities/ParcelFiscalHelper.cs delete mode 100644 backend/tests/core/Entities/ParcelHelper.cs delete mode 100644 backend/tests/core/Entities/ProjectHelper.cs delete mode 100644 backend/tests/core/Entities/ProjectReportHelper.cs delete mode 100644 backend/tests/core/Entities/ProjectRiskHelper.cs delete mode 100644 backend/tests/core/Entities/ProjectSnapshotHelper.cs delete mode 100644 backend/tests/core/Entities/ProjectStatusHelper.cs delete mode 100644 backend/tests/core/Entities/PropertyClassificationHelper.cs delete mode 100644 backend/tests/core/Entities/PropertyHelper.cs delete mode 100644 backend/tests/core/Entities/ProvinceHelper.cs delete mode 100644 backend/tests/core/Entities/RoleHelper.cs delete mode 100644 backend/tests/core/Entities/TaskHelper.cs delete mode 100644 backend/tests/core/Entities/TierLevelHelper.cs delete mode 100644 backend/tests/core/Entities/UserHelper.cs delete mode 100644 backend/tests/core/Entities/WorkflowHelper.cs delete mode 100644 backend/tests/core/Http/FakeHttpMessageHandler.cs delete mode 100644 backend/tests/core/HttpClientHelper.cs delete mode 100644 backend/tests/core/HttpContextHelper.cs delete mode 100644 backend/tests/core/OptionsHelper.cs delete mode 100644 backend/tests/core/Pims.Core.Test.csproj delete mode 100644 backend/tests/core/PimsAssert.cs delete mode 100644 backend/tests/core/PrincipalHelper.cs delete mode 100644 backend/tests/core/ProjectAgencyResponseHelper.cs delete mode 100644 backend/tests/core/ServiceHelper.cs delete mode 100644 backend/tests/core/TestHelper.cs delete mode 100644 backend/tests/core/TestHelperExtensions.cs delete mode 100644 backend/tests/unit/api/Controllers/Admin/AccessRequestControllerTest.cs delete mode 100644 backend/tests/unit/api/Controllers/Admin/RoleControllerTest.cs delete mode 100644 backend/tests/unit/api/Controllers/Admin/UserControllerTest.cs delete mode 100644 backend/tests/unit/api/Controllers/BuildingControllerTest.cs delete mode 100644 backend/tests/unit/api/Controllers/Keycloak/RoleControllerTest.cs delete mode 100644 backend/tests/unit/api/Controllers/Keycloak/UserControllerTest.cs delete mode 100644 backend/tests/unit/api/Controllers/LookupControllerTest.cs delete mode 100644 backend/tests/unit/api/Controllers/Notification/QueueControllerTest.cs delete mode 100644 backend/tests/unit/api/Controllers/Notification/TemplateControllerTest.cs delete mode 100644 backend/tests/unit/api/Controllers/ParcelControllerTest.cs delete mode 100644 backend/tests/unit/api/Controllers/Project/DisposeControllerTest.cs delete mode 100644 backend/tests/unit/api/Controllers/Project/ReportControllerTest.cs delete mode 100644 backend/tests/unit/api/Controllers/Project/SearchControllerTest.cs delete mode 100644 backend/tests/unit/api/Controllers/Project/StatusControllerTest.cs delete mode 100644 backend/tests/unit/api/Controllers/Project/WorkfowControllerTest.cs delete mode 100644 backend/tests/unit/api/Controllers/Property/SearchControllerTest.cs delete mode 100644 backend/tests/unit/api/Controllers/Reports/ProjectControllerTest.cs delete mode 100644 backend/tests/unit/api/Controllers/Reports/PropertyControllerTest.cs delete mode 100644 backend/tests/unit/api/Controllers/Reports/UserControllerTest.cs delete mode 100644 backend/tests/unit/api/Controllers/Tools/ChesControllerTest.cs delete mode 100644 backend/tests/unit/api/Controllers/Tools/GeocoderControllerTest.cs delete mode 100644 backend/tests/unit/api/Controllers/Tools/ImportControllerTest.cs delete mode 100644 backend/tests/unit/api/Controllers/Tools/LtsaControllerTest.cs delete mode 100644 backend/tests/unit/api/Controllers/UserControllerTest.cs delete mode 100644 backend/tests/unit/api/Helpers/ExceptionExtensionsTest.cs delete mode 100644 backend/tests/unit/api/Helpers/HttpResponseMessageExtensionsTest.cs delete mode 100644 backend/tests/unit/api/Mapping/BuildingControllerMapTest.cs delete mode 100644 backend/tests/unit/api/Mapping/ParcelControllerMapTest.cs delete mode 100644 backend/tests/unit/api/Pims.Api.Test.csproj delete mode 100644 backend/tests/unit/api/Routes/Admin/AccessRequestControllerTest.cs delete mode 100644 backend/tests/unit/api/Routes/Admin/ClaimControllerTest.cs delete mode 100644 backend/tests/unit/api/Routes/Admin/RoleControllerTest.cs delete mode 100644 backend/tests/unit/api/Routes/Admin/UserControllerTest.cs delete mode 100644 backend/tests/unit/api/Routes/Keycloak/RoleControllerTest.cs delete mode 100644 backend/tests/unit/api/Routes/Keycloak/UserControllerTest.cs delete mode 100644 backend/tests/unit/api/Routes/Notification/QueueControllerTest.cs delete mode 100644 backend/tests/unit/api/Routes/Notification/TemplateControllerTest.cs delete mode 100644 backend/tests/unit/api/Routes/Project/DisposeControllerTest.cs delete mode 100644 backend/tests/unit/api/Routes/Project/SearchControllerTest.cs delete mode 100644 backend/tests/unit/api/Routes/Project/StatusControllerTest.cs delete mode 100644 backend/tests/unit/api/Routes/Project/WorkflowControllerTest.cs delete mode 100644 backend/tests/unit/api/Routes/Property/BuildingControllerTest.cs delete mode 100644 backend/tests/unit/api/Routes/Property/ParcelControllerTest.cs delete mode 100644 backend/tests/unit/api/Routes/Property/SearchControllerTest.cs delete mode 100644 backend/tests/unit/api/Routes/Reports/PropertyControllerTest.cs delete mode 100644 backend/tests/unit/api/Routes/Tools/ChesControllerTest.cs delete mode 100644 backend/tests/unit/api/Routes/Tools/GeocoderControllerTest.cs delete mode 100644 backend/tests/unit/api/Routes/Tools/ImportControllerTest.cs delete mode 100644 backend/tests/unit/api/Routes/UserControllerTest.cs delete mode 100644 backend/tests/unit/api/coverlet.runsettings delete mode 100644 backend/tests/unit/dal/Core/Comparers/DeepPropertyCompareTest.cs delete mode 100644 backend/tests/unit/dal/Core/Comparers/DeepPropertyCompareTest`.cs delete mode 100644 backend/tests/unit/dal/Core/Comparers/ShallowPropertyCompareTest.cs delete mode 100644 backend/tests/unit/dal/Core/Comparers/ShallowPropertyCompareTest`.cs delete mode 100644 backend/tests/unit/dal/Core/Converters/BooleanJsonConverterTest.cs delete mode 100644 backend/tests/unit/dal/Core/Converters/EnumValueJsonConverterTest.cs delete mode 100644 backend/tests/unit/dal/Core/Converters/Int32JsonConverterTest.cs delete mode 100644 backend/tests/unit/dal/Core/Converters/MicrosecondEpochJsonConverterTest.cs delete mode 100644 backend/tests/unit/dal/Core/Extensions/ArrayExtensionsTest.cs delete mode 100644 backend/tests/unit/dal/Core/Extensions/CollectionExtensionsTest.cs delete mode 100644 backend/tests/unit/dal/Core/Extensions/DateExtensionsTest.cs delete mode 100644 backend/tests/unit/dal/Core/Extensions/DictionaryExtensionsTest.cs delete mode 100644 backend/tests/unit/dal/Core/Extensions/EnumExtensionsTest.cs delete mode 100644 backend/tests/unit/dal/Core/Extensions/EnumerableExtensionsTest.cs delete mode 100644 backend/tests/unit/dal/Core/Helpers/CsvHelperTest.cs delete mode 100644 backend/tests/unit/dal/Core/Helpers/ExceptionHelper.cs delete mode 100644 backend/tests/unit/dal/Core/Helpers/StringHelperTest.cs delete mode 100644 backend/tests/unit/dal/Core/Helpers/XmlHelperTest.cs delete mode 100644 backend/tests/unit/dal/Helpers/Extensions/BuildingExtensionsTest.cs delete mode 100644 backend/tests/unit/dal/Helpers/Extensions/ProjectExtensionsTest.cs delete mode 100644 backend/tests/unit/dal/Helpers/Extensions/PropertyExtensionsTest.cs delete mode 100644 backend/tests/unit/dal/Libraries/Ches/ChesExceptionTest.cs delete mode 100644 backend/tests/unit/dal/Libraries/Ches/ChesServiceCollectionTest.cs delete mode 100644 backend/tests/unit/dal/Libraries/Ches/ChesServiceTest.cs delete mode 100644 backend/tests/unit/dal/Libraries/Geocoder/GeocoderServiceTest.cs delete mode 100644 backend/tests/unit/dal/Libraries/Keycloak/KeycloakServiceGroupsTest.cs delete mode 100644 backend/tests/unit/dal/Libraries/Keycloak/KeycloakServiceRolesTest.cs delete mode 100644 backend/tests/unit/dal/Libraries/Keycloak/KeycloakServiceTest.cs delete mode 100644 backend/tests/unit/dal/Libraries/Keycloak/PimsKeycloakUserServiceTest.cs delete mode 100644 backend/tests/unit/dal/Libraries/Ltsa/LtsaServiceCollectionTest.cs delete mode 100644 backend/tests/unit/dal/Libraries/Ltsa/LtsaServiceTest.cs delete mode 100644 backend/tests/unit/dal/Libraries/Notifications/NotificationServiceTest.cs delete mode 100644 backend/tests/unit/dal/Migrations/MigrationTest.cs delete mode 100644 backend/tests/unit/dal/Pims.Dal.Test.csproj delete mode 100644 backend/tests/unit/dal/Services/Admin/BuildingServiceTest.cs delete mode 100644 backend/tests/unit/dal/Services/Admin/ParcelServiceTest.cs delete mode 100644 backend/tests/unit/dal/Services/BuildingServiceTest.cs delete mode 100644 backend/tests/unit/dal/Services/NotificationQueueServiceTest.cs delete mode 100644 backend/tests/unit/dal/Services/NotificationTemplateServiceTest.cs delete mode 100644 backend/tests/unit/dal/Services/ParcelServiceTest.cs delete mode 100644 backend/tests/unit/dal/Services/ProjectNotificationServiceTest.cs delete mode 100644 backend/tests/unit/dal/Services/ProjectReportServiceTest.cs delete mode 100644 backend/tests/unit/dal/Services/ProjectServiceTest.cs delete mode 100644 backend/tests/unit/dal/Services/ProjectStatusServiceTest.cs delete mode 100644 backend/tests/unit/dal/Services/PropertyServiceTest.cs delete mode 100644 backend/tests/unit/dal/Services/TaskServiceTest.cs delete mode 100644 backend/tests/unit/dal/Services/WorkflowServiceTest.cs delete mode 100644 backend/tests/unit/dal/coverlet.runsettings delete mode 100644 codecov.yml delete mode 100644 database/.gitignore delete mode 100644 database/README.md delete mode 100644 database/mssql/Dockerfile delete mode 100644 database/mssql/README.md delete mode 100755 database/mssql/entrypoint.sh delete mode 100644 database/mssql/scripts/clear-objects.sql delete mode 100644 database/mssql/scripts/init.sql delete mode 100755 database/mssql/setup.sh delete mode 100644 docker-compose.prod.yml delete mode 100644 frontend/.dockerignore delete mode 100644 frontend/.editorconfig delete mode 100644 frontend/.eslintignore delete mode 100644 frontend/.eslintrc.cjs delete mode 100644 frontend/.gitignore delete mode 100644 frontend/.prettierignore delete mode 100644 frontend/.prettierrc.cjs delete mode 100644 frontend/.vscode/launch.json delete mode 100644 frontend/.vscode/settings.json delete mode 100644 frontend/Dockerfile delete mode 100644 frontend/Dockerfile.ocp delete mode 100644 frontend/README.md delete mode 100644 frontend/cypress.config.ts delete mode 100644 frontend/cypress/e2e/disposalProjects.cy.ts delete mode 100644 frontend/cypress/e2e/navBar.cy.ts delete mode 100644 frontend/cypress/support/commands.ts delete mode 100644 frontend/cypress/support/e2e.ts delete mode 100644 frontend/cypress/support/index.ts delete mode 100644 frontend/cypress/tsconfig.json delete mode 100644 frontend/index.html delete mode 100644 frontend/nginx.conf delete mode 100644 frontend/package.json delete mode 100644 frontend/prod.nginx.conf delete mode 100644 frontend/public/basemaps.json delete mode 100644 frontend/public/favicon-32x32.ico delete mode 100644 frontend/public/favicon.ico delete mode 100644 frontend/public/logo192.png delete mode 100644 frontend/public/logo512.png delete mode 100644 frontend/public/manifest.json delete mode 100644 frontend/public/robots.txt delete mode 100644 frontend/public/satellite.jpg delete mode 100644 frontend/public/streets.jpg delete mode 100644 frontend/src/App.scss delete mode 100644 frontend/src/App.tsx delete mode 100644 frontend/src/OnLoadActions.tsx delete mode 100644 frontend/src/__mocks__/popper.js.js delete mode 100644 frontend/src/__mocks__/react-text-mask.tsx delete mode 100644 frontend/src/__mocks__/svg-mock.tsx delete mode 100644 frontend/src/_variables.module.scss delete mode 100644 frontend/src/_variables.scss delete mode 100644 frontend/src/actions/IAddNewRoleAndAgency.ts delete mode 100644 frontend/src/actions/IFilterData.ts delete mode 100644 frontend/src/actions/ILookupCode.ts delete mode 100644 frontend/src/actions/ISort.ts delete mode 100644 frontend/src/actions/parcelsActions.ts delete mode 100644 frontend/src/assets/images/PIMSlogo/favicon-16x16.ico delete mode 100644 frontend/src/assets/images/PIMSlogo/logo_only.png delete mode 100644 frontend/src/assets/images/PIMSlogo/logo_with_text.png delete mode 100644 frontend/src/assets/images/SPP.svg delete mode 100644 frontend/src/assets/images/SeasideBlue.png delete mode 100644 frontend/src/assets/images/close-square.svg delete mode 100644 frontend/src/assets/images/draft-building-icon.svg delete mode 100644 frontend/src/assets/images/draft-parcel-icon.svg delete mode 100644 frontend/src/assets/images/icon-building.png delete mode 100644 frontend/src/assets/images/icon-business.svg delete mode 100644 frontend/src/assets/images/icon-land.png delete mode 100644 frontend/src/assets/images/icon-lot.svg delete mode 100644 frontend/src/assets/images/icon-subdiv.png delete mode 100644 frontend/src/assets/images/logo-banner.svg delete mode 100644 frontend/src/assets/images/pins/building-erp-highlight.png delete mode 100644 frontend/src/assets/images/pins/building-erp.png delete mode 100644 frontend/src/assets/images/pins/building-reg-highlight.png delete mode 100644 frontend/src/assets/images/pins/building-reg.png delete mode 100644 frontend/src/assets/images/pins/building-spl-highlight.png delete mode 100644 frontend/src/assets/images/pins/building-spl.png delete mode 100644 frontend/src/assets/images/pins/land-erp-highlight.png delete mode 100644 frontend/src/assets/images/pins/land-erp.png delete mode 100644 frontend/src/assets/images/pins/land-reg-highlight.png delete mode 100644 frontend/src/assets/images/pins/land-reg.png delete mode 100644 frontend/src/assets/images/pins/land-spl-highlight.png delete mode 100644 frontend/src/assets/images/pins/land-spl.png delete mode 100644 frontend/src/assets/images/pins/marker-blue-highlight.png delete mode 100644 frontend/src/assets/images/pins/marker-blue.png delete mode 100644 frontend/src/assets/images/pins/marker-green.png delete mode 100644 frontend/src/assets/images/pins/marker-green_highlight.png delete mode 100644 frontend/src/assets/images/pins/marker-icon-1x-blue.png delete mode 100644 frontend/src/assets/images/pins/marker-icon-1x-green.png delete mode 100644 frontend/src/assets/images/pins/marker-icon-2x-blue.png delete mode 100644 frontend/src/assets/images/pins/marker-icon-2x-green.png delete mode 100644 frontend/src/assets/images/pins/marker-icon-2x-red.png delete mode 100644 frontend/src/assets/images/pins/marker-icon-2x-violet.png delete mode 100644 frontend/src/assets/images/pins/marker-purple-highlight.png delete mode 100644 frontend/src/assets/images/pins/marker-purple.png delete mode 100644 frontend/src/assets/images/pins/marker-red-highlight.png delete mode 100644 frontend/src/assets/images/pins/marker-red.png delete mode 100644 frontend/src/assets/images/pins/marker-shadow.png delete mode 100644 frontend/src/assets/images/pins/subdiv-erp-highlight.png delete mode 100644 frontend/src/assets/images/pins/subdiv-erp.png delete mode 100644 frontend/src/assets/images/pins/subdiv-reg-highlight.png delete mode 100644 frontend/src/assets/images/pins/subdiv-reg.png delete mode 100644 frontend/src/assets/images/pins/subdiv-spl-highlight.png delete mode 100644 frontend/src/assets/images/pins/subdiv-spl.png delete mode 100644 frontend/src/assets/images/profile.svg delete mode 100644 frontend/src/assets/images/project-diagram-solid.svg delete mode 100644 frontend/src/buttons.scss delete mode 100644 frontend/src/colors.scss delete mode 100644 frontend/src/components/SearchBar/FilterBar.scss delete mode 100644 frontend/src/components/SearchBar/FilterBar.test.tsx delete mode 100644 frontend/src/components/SearchBar/FilterBar.tsx delete mode 100644 frontend/src/components/SearchBar/FindMorePropertiesForm.scss delete mode 100644 frontend/src/components/SearchBar/FindMorePropertiesForm.test.tsx delete mode 100644 frontend/src/components/SearchBar/FindMorePropertiesForm.tsx delete mode 100644 frontend/src/components/SearchBar/__snapshots__/FilterBar.test.tsx.snap delete mode 100644 frontend/src/components/SearchBar/__snapshots__/FindMorePropertiesForm.test.tsx.snap delete mode 100644 frontend/src/components/Table/ColumnFilter.scss delete mode 100644 frontend/src/components/Table/ColumnFilter.test.tsx delete mode 100644 frontend/src/components/Table/ColumnFilter.tsx delete mode 100644 frontend/src/components/Table/ColumnSort.tsx delete mode 100644 frontend/src/components/Table/MoneyCell.tsx delete mode 100644 frontend/src/components/Table/PageSizeSelector.test.tsx delete mode 100644 frontend/src/components/Table/PageSizeSelector.tsx delete mode 100644 frontend/src/components/Table/PropertyTypeCell.tsx delete mode 100644 frontend/src/components/Table/Table.scss delete mode 100644 frontend/src/components/Table/Table.tsx delete mode 100644 frontend/src/components/Table/TablePagination.scss delete mode 100644 frontend/src/components/Table/TablePagination.tsx delete mode 100644 frontend/src/components/Table/TableSort.ts delete mode 100644 frontend/src/components/Table/ViewPropertyCell.tsx delete mode 100644 frontend/src/components/Table/__snapshots__/PageSizeSelector.test.tsx.snap delete mode 100644 frontend/src/components/Table/constants.ts delete mode 100644 frontend/src/components/Table/index.ts delete mode 100644 frontend/src/components/Table/types.ts delete mode 100644 frontend/src/components/bcAssessment/BCADialog.tsx delete mode 100644 frontend/src/components/bootstrap/Jumbotron.tsx delete mode 100644 frontend/src/components/bootstrap/index.ts delete mode 100644 frontend/src/components/common/AbbreviatedText.tsx delete mode 100644 frontend/src/components/common/ErrorModal.tsx delete mode 100644 frontend/src/components/common/ErrorTabs.tsx delete mode 100644 frontend/src/components/common/FormikPersist.tsx delete mode 100644 frontend/src/components/common/GenericModal.tsx delete mode 100644 frontend/src/components/common/Icons.ts delete mode 100644 frontend/src/components/common/Label.scss delete mode 100644 frontend/src/components/common/Label.tsx delete mode 100644 frontend/src/components/common/LinkList.tsx delete mode 100644 frontend/src/components/common/Snackbar.tsx delete mode 100644 frontend/src/components/common/Stepper.scss delete mode 100644 frontend/src/components/common/Stepper.tsx delete mode 100644 frontend/src/components/common/TooltipIcon.scss delete mode 100644 frontend/src/components/common/TooltipIcon.tsx delete mode 100644 frontend/src/components/common/TooltipWrapper.tsx delete mode 100644 frontend/src/components/common/form/Button.scss delete mode 100644 frontend/src/components/common/form/Button.tsx delete mode 100644 frontend/src/components/common/form/Check.scss delete mode 100644 frontend/src/components/common/form/Check.test.tsx delete mode 100644 frontend/src/components/common/form/Check.tsx delete mode 100644 frontend/src/components/common/form/DisplayCurrency.scss delete mode 100644 frontend/src/components/common/form/DisplayCurrency.tsx delete mode 100644 frontend/src/components/common/form/DisplayError.tsx delete mode 100644 frontend/src/components/common/form/FastCurrencyInput.scss delete mode 100644 frontend/src/components/common/form/FastCurrencyInput.test.tsx delete mode 100644 frontend/src/components/common/form/FastCurrencyInput.tsx delete mode 100644 frontend/src/components/common/form/FastDatePicker.test.tsx delete mode 100644 frontend/src/components/common/form/FastDatePicker.tsx delete mode 100644 frontend/src/components/common/form/FastFiscalYearInput.tsx delete mode 100644 frontend/src/components/common/form/FastInput.tsx delete mode 100644 frontend/src/components/common/form/FastSelect.tsx delete mode 100644 frontend/src/components/common/form/Field.tsx delete mode 100644 frontend/src/components/common/form/Form.scss delete mode 100644 frontend/src/components/common/form/Form.tsx delete mode 100644 frontend/src/components/common/form/Input.scss delete mode 100644 frontend/src/components/common/form/Input.tsx delete mode 100644 frontend/src/components/common/form/InputGroup.scss delete mode 100644 frontend/src/components/common/form/InputGroup.tsx delete mode 100644 frontend/src/components/common/form/LimitedSelect.test.tsx delete mode 100644 frontend/src/components/common/form/ParentSelect.test.tsx delete mode 100644 frontend/src/components/common/form/ParentSelect.tsx delete mode 100644 frontend/src/components/common/form/PlusButton.tsx delete mode 100644 frontend/src/components/common/form/RadioButtonGroup.tsx delete mode 100644 frontend/src/components/common/form/ResetButton.tsx delete mode 100644 frontend/src/components/common/form/SearchButton.tsx delete mode 100644 frontend/src/components/common/form/Select.scss delete mode 100644 frontend/src/components/common/form/Select.tsx delete mode 100644 frontend/src/components/common/form/StepForm/SteppedForm.md delete mode 100644 frontend/src/components/common/form/StepForm/SteppedForm.scss delete mode 100644 frontend/src/components/common/form/StepForm/SteppedForm.test.tsx delete mode 100644 frontend/src/components/common/form/StepForm/SteppedForm.tsx delete mode 100644 frontend/src/components/common/form/StepForm/StepperField.md delete mode 100644 frontend/src/components/common/form/StepForm/StepperField.tsx delete mode 100644 frontend/src/components/common/form/StepForm/__snapshots__/SteppedForm.test.tsx.snap delete mode 100644 frontend/src/components/common/form/StepForm/context.tsx delete mode 100644 frontend/src/components/common/form/StepForm/index.ts delete mode 100644 frontend/src/components/common/form/StepForm/types.ts delete mode 100644 frontend/src/components/common/form/StringButton.tsx delete mode 100644 frontend/src/components/common/form/TextArea.tsx delete mode 100644 frontend/src/components/common/form/Typeahead.tsx delete mode 100644 frontend/src/components/common/form/UserRoleSelector.tsx delete mode 100644 frontend/src/components/common/form/__snapshots__/FastCurrencyInput.test.tsx.snap delete mode 100644 frontend/src/components/common/form/__snapshots__/LimitedSelect.test.tsx.snap delete mode 100644 frontend/src/components/common/form/__snapshots__/ParentSelect.test.tsx.snap delete mode 100644 frontend/src/components/common/form/index.ts delete mode 100644 frontend/src/components/common/tabValidation.ts delete mode 100644 frontend/src/components/flex/Col.tsx delete mode 100644 frontend/src/components/flex/Row.tsx delete mode 100644 frontend/src/components/flex/index.ts delete mode 100644 frontend/src/components/flex/styled/Col.tsx delete mode 100644 frontend/src/components/flex/styled/Row.tsx delete mode 100644 frontend/src/components/flex/styled/index.ts delete mode 100644 frontend/src/components/layout/AppNavBar/AppNavBar.scss delete mode 100644 frontend/src/components/layout/AppNavBar/AppNavBar.test.tsx delete mode 100644 frontend/src/components/layout/AppNavBar/AppNavBar.tsx delete mode 100644 frontend/src/components/layout/AppNavBar/__snapshots__/AppNavBar.test.tsx.snap delete mode 100644 frontend/src/components/layout/Footer/Footer.scss delete mode 100644 frontend/src/components/layout/Footer/Footer.test.tsx delete mode 100644 frontend/src/components/layout/Footer/Footer.tsx delete mode 100644 frontend/src/components/layout/Footer/__snapshots__/Footer.test.tsx.snap delete mode 100644 frontend/src/components/layout/Header/EmptyHeader.test.tsx delete mode 100644 frontend/src/components/layout/Header/EmptyHeader.tsx delete mode 100644 frontend/src/components/layout/Header/Header.scss delete mode 100644 frontend/src/components/layout/Header/Header.test.tsx delete mode 100644 frontend/src/components/layout/Header/Header.tsx delete mode 100644 frontend/src/components/layout/Header/UserProfile.tsx delete mode 100644 frontend/src/components/layout/Header/__snapshots__/EmptyHeader.test.tsx.snap delete mode 100644 frontend/src/components/layout/Header/__snapshots__/Header.test.tsx.snap delete mode 100644 frontend/src/components/layout/index.ts delete mode 100644 frontend/src/components/leaflet/ControlPanel.test.tsx delete mode 100644 frontend/src/components/leaflet/ControlPanel.tsx delete mode 100644 frontend/src/components/leaflet/__snapshots__/ControlPanel.test.tsx.snap delete mode 100644 frontend/src/components/leaflet/index.ts delete mode 100644 frontend/src/components/ltsa/Charges.tsx delete mode 100644 frontend/src/components/ltsa/LTSADialog.test.tsx delete mode 100644 frontend/src/components/ltsa/LTSADialog.tsx delete mode 100644 frontend/src/components/ltsa/OwnershipInformation.tsx delete mode 100644 frontend/src/components/ltsa/TitleDetails.tsx delete mode 100644 frontend/src/components/maps/BasemapToggle.scss delete mode 100644 frontend/src/components/maps/BasemapToggle.test.tsx delete mode 100644 frontend/src/components/maps/BasemapToggle.tsx delete mode 100644 frontend/src/components/maps/FindMorePropertiesButton.scss delete mode 100644 frontend/src/components/maps/FindMorePropertiesButton.tsx delete mode 100644 frontend/src/components/maps/__snapshots__/BasemapToggle.test.tsx.snap delete mode 100644 frontend/src/components/maps/hooks/useActiveFeatureLayer.test.tsx delete mode 100644 frontend/src/components/maps/hooks/useActiveFeatureLayer.tsx delete mode 100644 frontend/src/components/maps/hooks/useMapRefreshEvent.tsx delete mode 100644 frontend/src/components/maps/hooks/useSupercluster.test.tsx delete mode 100644 frontend/src/components/maps/hooks/useSupercluster.ts delete mode 100644 frontend/src/components/maps/leaflet/FilterBackdrop/index.tsx delete mode 100644 frontend/src/components/maps/leaflet/InfoSlideOut/AssociatedBuildingsList.tsx delete mode 100644 frontend/src/components/maps/leaflet/InfoSlideOut/AssociatedParcelsList.tsx delete mode 100644 frontend/src/components/maps/leaflet/InfoSlideOut/AssociatedTab.test.tsx delete mode 100644 frontend/src/components/maps/leaflet/InfoSlideOut/BuildingAttributes.tsx delete mode 100644 frontend/src/components/maps/leaflet/InfoSlideOut/HeaderActions.scss delete mode 100644 frontend/src/components/maps/leaflet/InfoSlideOut/HeaderActions.test.tsx delete mode 100644 frontend/src/components/maps/leaflet/InfoSlideOut/HeaderActions.tsx delete mode 100644 frontend/src/components/maps/leaflet/InfoSlideOut/InfoContent.test.tsx delete mode 100644 frontend/src/components/maps/leaflet/InfoSlideOut/InfoContent.tsx delete mode 100644 frontend/src/components/maps/leaflet/InfoSlideOut/InfoSlideOut.scss delete mode 100644 frontend/src/components/maps/leaflet/InfoSlideOut/InfoSlideOut.test.tsx delete mode 100644 frontend/src/components/maps/leaflet/InfoSlideOut/InfoSlideOut.tsx delete mode 100644 frontend/src/components/maps/leaflet/InfoSlideOut/ParcelAttributes.tsx delete mode 100644 frontend/src/components/maps/leaflet/InfoSlideOut/ParcelPIDPIN.tsx delete mode 100644 frontend/src/components/maps/leaflet/InfoSlideOut/ProjectNumberLink.tsx delete mode 100644 frontend/src/components/maps/leaflet/InfoSlideOut/ThreeColumnItem.tsx delete mode 100644 frontend/src/components/maps/leaflet/InfoSlideOut/__snapshots__/AssociatedTab.test.tsx.snap delete mode 100644 frontend/src/components/maps/leaflet/InfoSlideOut/__snapshots__/HeaderActions.test.tsx.snap delete mode 100644 frontend/src/components/maps/leaflet/InfoSlideOut/__snapshots__/InfoContent.test.tsx.snap delete mode 100644 frontend/src/components/maps/leaflet/InventoryLayer.tsx delete mode 100644 frontend/src/components/maps/leaflet/LayerPopup/LayerPopUpContent.test.tsx delete mode 100644 frontend/src/components/maps/leaflet/LayerPopup/LayerPopupContent.tsx delete mode 100644 frontend/src/components/maps/leaflet/LayerPopup/__snapshots__/LayerPopUpContent.test.tsx.snap delete mode 100644 frontend/src/components/maps/leaflet/LayerPopup/constants/index.tsx delete mode 100644 frontend/src/components/maps/leaflet/LayerPopup/hooks/useLayerQuery.test.tsx delete mode 100644 frontend/src/components/maps/leaflet/LayerPopup/hooks/useLayerQuery.tsx delete mode 100644 frontend/src/components/maps/leaflet/LayerPopup/index.ts delete mode 100644 frontend/src/components/maps/leaflet/LayersControl/LayersControl.md delete mode 100644 frontend/src/components/maps/leaflet/LayersControl/LayersControl.test.tsx delete mode 100644 frontend/src/components/maps/leaflet/LayersControl/LayersControl.tsx delete mode 100644 frontend/src/components/maps/leaflet/LayersControl/LayersTree.tsx delete mode 100644 frontend/src/components/maps/leaflet/LayersControl/__snapshots__/LayersControl.test.tsx.snap delete mode 100644 frontend/src/components/maps/leaflet/LayersControl/data.ts delete mode 100644 frontend/src/components/maps/leaflet/LayersControl/index.ts delete mode 100644 frontend/src/components/maps/leaflet/LayersControl/types.ts delete mode 100644 frontend/src/components/maps/leaflet/LeafletDraw/LeafletDraw.md delete mode 100644 frontend/src/components/maps/leaflet/LeafletDraw/LeafletDraw.scss delete mode 100644 frontend/src/components/maps/leaflet/LeafletDraw/LeafletDraw.tsx delete mode 100644 frontend/src/components/maps/leaflet/LeafletDraw/index.ts delete mode 100644 frontend/src/components/maps/leaflet/Legend/Legend.scss delete mode 100644 frontend/src/components/maps/leaflet/Legend/Legend.test.tsx delete mode 100644 frontend/src/components/maps/leaflet/Legend/Legend.tsx delete mode 100644 frontend/src/components/maps/leaflet/Legend/LegendControl.scss delete mode 100644 frontend/src/components/maps/leaflet/Legend/LegendControl.test.tsx delete mode 100644 frontend/src/components/maps/leaflet/Legend/LegendControl.tsx delete mode 100644 frontend/src/components/maps/leaflet/Legend/__snapshots__/Legend.test.tsx.snap delete mode 100644 frontend/src/components/maps/leaflet/Legend/__snapshots__/LegendControl.test.tsx.snap delete mode 100644 frontend/src/components/maps/leaflet/Map.scss delete mode 100644 frontend/src/components/maps/leaflet/Map.tsx delete mode 100644 frontend/src/components/maps/leaflet/MapProperties.test.tsx delete mode 100644 frontend/src/components/maps/leaflet/PointClusterer.scss delete mode 100644 frontend/src/components/maps/leaflet/PointClusterer.tsx delete mode 100644 frontend/src/components/maps/leaflet/SelectedPropertyMarker/SelectedPropertyMarker.tsx delete mode 100644 frontend/src/components/maps/leaflet/Spiderfier.ts delete mode 100644 frontend/src/components/maps/leaflet/ZoomOut/ZoomOutButton.tsx delete mode 100644 frontend/src/components/maps/leaflet/mapUtils.tsx delete mode 100644 frontend/src/components/maps/leaflet/warning.svg delete mode 100644 frontend/src/components/maps/providers/FIlterProvider.tsx delete mode 100644 frontend/src/components/maps/providers/PropertyPopUpProvider.tsx delete mode 100644 frontend/src/components/maps/types.ts delete mode 100644 frontend/src/components/menu/Menu.scss delete mode 100644 frontend/src/components/menu/Menu.tsx delete mode 100644 frontend/src/components/navigation/dropdown.svg delete mode 100644 frontend/src/components/navigation/logout.svg delete mode 100644 frontend/src/components/tabs/Tab.tsx delete mode 100644 frontend/src/components/tabs/Tabs.tsx delete mode 100644 frontend/src/components/tabs/index.ts delete mode 100644 frontend/src/components/tabs/styled/Tabs.tsx delete mode 100644 frontend/src/components/tabs/styled/index.ts delete mode 100644 frontend/src/constants/API.ts delete mode 100644 frontend/src/constants/accessStatus.ts delete mode 100644 frontend/src/constants/actionTypes.ts delete mode 100644 frontend/src/constants/claims.ts delete mode 100644 frontend/src/constants/classifications.ts delete mode 100644 frontend/src/constants/environment.ts delete mode 100644 frontend/src/constants/evaluationKeys.ts delete mode 100644 frontend/src/constants/fiscalKeys.ts delete mode 100644 frontend/src/constants/index.ts delete mode 100644 frontend/src/constants/noteTypes.ts delete mode 100644 frontend/src/constants/propertySteps.ts delete mode 100644 frontend/src/constants/propertyTypeNames.ts delete mode 100644 frontend/src/constants/propertyTypes.ts delete mode 100644 frontend/src/constants/reducerTypes.ts delete mode 100644 frontend/src/constants/roles.ts delete mode 100644 frontend/src/constants/strings.tsx delete mode 100644 frontend/src/constants/toasts.ts delete mode 100644 frontend/src/constants/trueFalse.ts delete mode 100644 frontend/src/constants/workflows.ts delete mode 100644 frontend/src/contexts/authStateContext.tsx delete mode 100644 frontend/src/customAxios.ts delete mode 100644 frontend/src/features/account/IENotSupportedPage.test.tsx delete mode 100644 frontend/src/features/account/IENotSupportedPage.tsx delete mode 100644 frontend/src/features/account/Login.scss delete mode 100644 frontend/src/features/account/Login.test.tsx delete mode 100644 frontend/src/features/account/Login.tsx delete mode 100644 frontend/src/features/account/LoginLoading.test.tsx delete mode 100644 frontend/src/features/account/LoginLoading.tsx delete mode 100644 frontend/src/features/account/Logout.tsx delete mode 100644 frontend/src/features/account/__snapshots__/IENotSupportedPage.test.tsx.snap delete mode 100644 frontend/src/features/account/__snapshots__/Login.test.tsx.snap delete mode 100644 frontend/src/features/account/__snapshots__/LoginLoading.test.tsx.snap delete mode 100644 frontend/src/features/account/index.ts delete mode 100644 frontend/src/features/admin/access-request/AccessRequestPage.scss delete mode 100644 frontend/src/features/admin/access-request/AccessRequestPage.test.tsx delete mode 100644 frontend/src/features/admin/access-request/AccessRequestPage.tsx delete mode 100644 frontend/src/features/admin/access-request/__snapshots__/AccessRequestPage.test.tsx.snap delete mode 100644 frontend/src/features/admin/access/ManageAccessRequests.scss delete mode 100644 frontend/src/features/admin/access/ManageAccessRequests.test.tsx delete mode 100644 frontend/src/features/admin/access/ManageAccessRequests.tsx delete mode 100644 frontend/src/features/admin/access/__snapshots__/ManageAccessRequests.test.tsx.snap delete mode 100644 frontend/src/features/admin/access/components/AccessRequestActions.test.tsx delete mode 100644 frontend/src/features/admin/access/components/AccessRequestActions.tsx delete mode 100644 frontend/src/features/admin/access/components/Details.test.tsx delete mode 100644 frontend/src/features/admin/access/components/Details.tsx delete mode 100644 frontend/src/features/admin/access/components/Filter.scss delete mode 100644 frontend/src/features/admin/access/components/Filter.tsx delete mode 100644 frontend/src/features/admin/access/components/RowActions.test.tsx delete mode 100644 frontend/src/features/admin/access/components/RowActions.tsx delete mode 100644 frontend/src/features/admin/access/components/__snapshots__/AccessRequestActions.test.tsx.snap delete mode 100644 frontend/src/features/admin/access/components/__snapshots__/Details.test.tsx.snap delete mode 100644 frontend/src/features/admin/access/constants/constants.tsx delete mode 100644 frontend/src/features/admin/access/interfaces/index.ts delete mode 100644 frontend/src/features/admin/admin-areas/AdminAreasFilterBar.tsx delete mode 100644 frontend/src/features/admin/admin-areas/EditAdminArea.scss delete mode 100644 frontend/src/features/admin/admin-areas/EditAdminArea.test.tsx delete mode 100644 frontend/src/features/admin/admin-areas/EditAdminArea.tsx delete mode 100644 frontend/src/features/admin/admin-areas/ManageAdminAreas.test.tsx delete mode 100644 frontend/src/features/admin/admin-areas/ManageAdminAreas.tsx delete mode 100644 frontend/src/features/admin/admin-areas/__snapshots__/EditAdminArea.test.tsx.snap delete mode 100644 frontend/src/features/admin/admin-areas/__snapshots__/ManageAdminAreas.test.tsx.snap delete mode 100644 frontend/src/features/admin/admin-areas/interfaces/addAdminArea.ts delete mode 100644 frontend/src/features/admin/admin-areas/interfaces/adminAreaFilter.ts delete mode 100644 frontend/src/features/admin/admin-areas/interfaces/administrativeArea.ts delete mode 100644 frontend/src/features/admin/admin-areas/interfaces/apiAdminArea.ts delete mode 100644 frontend/src/features/admin/admin-areas/interfaces/index.ts delete mode 100644 frontend/src/features/admin/admin-areas/utils/utils.ts delete mode 100644 frontend/src/features/admin/agencies/AgencyFilterBar.tsx delete mode 100644 frontend/src/features/admin/agencies/EditAgencyPage.scss delete mode 100644 frontend/src/features/admin/agencies/EditAgencyPage.test.tsx delete mode 100644 frontend/src/features/admin/agencies/EditAgencyPage.tsx delete mode 100644 frontend/src/features/admin/agencies/ManageAgencies.scss delete mode 100644 frontend/src/features/admin/agencies/ManageAgencies.test.tsx delete mode 100644 frontend/src/features/admin/agencies/ManageAgencies.tsx delete mode 100644 frontend/src/features/admin/agencies/__snapshots__/EditAgencyPage.test.tsx.snap delete mode 100644 frontend/src/features/admin/agencies/__snapshots__/ManageAgencies.test.tsx.snap delete mode 100644 frontend/src/features/admin/constants/columns.tsx delete mode 100644 frontend/src/features/admin/edit-user/EditUserPage.scss delete mode 100644 frontend/src/features/admin/edit-user/EditUserPage.test.tsx delete mode 100644 frontend/src/features/admin/edit-user/EditUserPage.tsx delete mode 100644 frontend/src/features/admin/edit-user/__snapshots__/EditUserPage.test.tsx.snap delete mode 100644 frontend/src/features/admin/edit-user/useEditUserService.tsx delete mode 100644 frontend/src/features/admin/users/ManageUsers.scss delete mode 100644 frontend/src/features/admin/users/ManageUsers.test.tsx delete mode 100644 frontend/src/features/admin/users/ManageUsers.tsx delete mode 100644 frontend/src/features/admin/users/__snapshots__/ManageUsers.test.tsx.snap delete mode 100644 frontend/src/features/admin/users/components/RowActions.test.tsx delete mode 100644 frontend/src/features/admin/users/components/RowActions.tsx delete mode 100644 frontend/src/features/admin/users/components/UsersFilterBar.scss delete mode 100644 frontend/src/features/admin/users/components/UsersFilterBar.tsx delete mode 100644 frontend/src/features/admin/users/constants/index.tsx delete mode 100644 frontend/src/features/admin/users/interfaces/IUserRecord.ts delete mode 100644 frontend/src/features/help/components/HelpBox.scss delete mode 100644 frontend/src/features/help/components/HelpBox.tsx delete mode 100644 frontend/src/features/help/components/HelpModal.scss delete mode 100644 frontend/src/features/help/components/HelpModal.tsx delete mode 100644 frontend/src/features/help/components/HelpSubmitBox.scss delete mode 100644 frontend/src/features/help/components/HelpSubmitBox.tsx delete mode 100644 frontend/src/features/help/components/text/AssesDisposalProjectText.tsx delete mode 100644 frontend/src/features/help/components/text/CreateDisposalNavigationHelpText.tsx delete mode 100644 frontend/src/features/help/components/text/DetailNavigationHelpText.tsx delete mode 100644 frontend/src/features/help/components/text/DetailViewHelpText.tsx delete mode 100644 frontend/src/features/help/components/text/DisposalStepsHelpText.tsx delete mode 100644 frontend/src/features/help/components/text/InventoryFilterHelpText.tsx delete mode 100644 frontend/src/features/help/components/text/InventoryListHelpText.tsx delete mode 100644 frontend/src/features/help/components/text/InventoryNavigationHelpText.tsx delete mode 100644 frontend/src/features/help/components/text/LandingFilterHelpText.tsx delete mode 100644 frontend/src/features/help/components/text/LandingMapHelpText.tsx delete mode 100644 frontend/src/features/help/components/text/LandingNavigationHelpText.tsx delete mode 100644 frontend/src/features/help/components/text/ProjectAssessmentNotesHelpText.tsx delete mode 100644 frontend/src/features/help/components/text/TutorialHelpText.tsx delete mode 100644 frontend/src/features/help/constants/HelpText.tsx delete mode 100644 frontend/src/features/help/containers/HelpContainer.tsx delete mode 100644 frontend/src/features/help/containers/HelpModalContentContainer.tsx delete mode 100644 frontend/src/features/help/forms/BugForm.test.tsx delete mode 100644 frontend/src/features/help/forms/BugForm.tsx delete mode 100644 frontend/src/features/help/forms/FeatureRequestForm.test.tsx delete mode 100644 frontend/src/features/help/forms/FeatureRequestForm.tsx delete mode 100644 frontend/src/features/help/forms/HelpForms.scss delete mode 100644 frontend/src/features/help/forms/QuestionForm.test.tsx delete mode 100644 frontend/src/features/help/forms/QuestionForm.tsx delete mode 100644 frontend/src/features/help/interfaces.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/AssociatedLandForm.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/BuildingForm.scss delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/BuildingForm.test.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/BuildingForm.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/LandForm.scss delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/LandForm.test.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/LandForm.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/SubmitPropertySelector.test.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/SubmitPropertySelector.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/__snapshots__/BuildingForm.test.tsx.snap delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/__snapshots__/LandForm.test.tsx.snap delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/__snapshots__/SubmitPropertySelector.test.tsx.snap delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/index.ts delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/AddParentParcelsForm.test.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/AddParentParcelsForm.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/AssociatedBuildingListForm.scss delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/AssociatedBuildingListForm.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/AssociatedLandListForm.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/AssociatedLandReviewPage.scss delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/AssociatedLandReviewPage.test.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/AssociatedLandReviewPage.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/BuildingReviewPage.test.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/BuildingReviewPage.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/BuildingValuationForm.test.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/BuildingValuationForm.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/ClassificationForm.test.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/ClassificationForm.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/IdentificationForm.scss delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/IdentificationForm.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/LandOwnershipForm.scss delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/LandOwnershipForm.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/LandReviewPage.scss delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/LandReviewPage.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/LandSearchForm.scss delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/LandSearchForm.test.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/LandSearchForm.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/LandUsageForm.scss delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/LandUsageForm.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/LandValuationForm.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/LeasedLandOther.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/LeasedLandOwned.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/OccupancyForm.test.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/OccupancyForm.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/ParcelIdentificationForm.scss delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/ParcelIdentificationForm.tsx delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/TenancyForm.scss delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/ValuationForm.scss delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/__snapshots__/AddParentParcelsForm.test.tsx.snap delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/__snapshots__/AssociatedLandReviewPage.test.tsx.snap delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/__snapshots__/BuildingReviewPage.test.tsx.snap delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/__snapshots__/BuildingValuationForm.test.tsx.snap delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/__snapshots__/ClassificationForm.test.tsx.snap delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/__snapshots__/LandSearchForm.test.tsx.snap delete mode 100644 frontend/src/features/mapSideBar/SidebarContents/subforms/__snapshots__/OccupancyForm.test.tsx.snap delete mode 100644 frontend/src/features/mapSideBar/components/InventoryPolicy.tsx delete mode 100644 frontend/src/features/mapSideBar/components/MapDropPin.scss delete mode 100644 frontend/src/features/mapSideBar/components/MapDropPin.test.tsx delete mode 100644 frontend/src/features/mapSideBar/components/MapDropPin.tsx delete mode 100644 frontend/src/features/mapSideBar/components/MapSideBarLayout.scss delete mode 100644 frontend/src/features/mapSideBar/components/MapSideBarLayout.tsx delete mode 100644 frontend/src/features/mapSideBar/components/tables/ChargeTable.tsx delete mode 100644 frontend/src/features/mapSideBar/components/tables/OwnershipTable.tsx delete mode 100644 frontend/src/features/mapSideBar/components/tabs/BuildingDetails.scss delete mode 100644 frontend/src/features/mapSideBar/components/tabs/BuildingDetails.tsx delete mode 100644 frontend/src/features/mapSideBar/components/tabs/HeaderDivider.tsx delete mode 100644 frontend/src/features/mapSideBar/components/tabs/OccupancyValuation.tsx delete mode 100644 frontend/src/features/mapSideBar/components/tabs/ParcelDetails.scss delete mode 100644 frontend/src/features/mapSideBar/components/tabs/ParcelDetails.tsx delete mode 100644 frontend/src/features/mapSideBar/components/tabs/TabStyles.ts delete mode 100644 frontend/src/features/mapSideBar/components/tabs/TitleOwnership.tsx delete mode 100644 frontend/src/features/mapSideBar/components/tabs/UsageValuation.tsx delete mode 100644 frontend/src/features/mapSideBar/containers/MapSideBarContainer.test.tsx delete mode 100644 frontend/src/features/mapSideBar/containers/MapSideBarContainer.tsx delete mode 100644 frontend/src/features/mapSideBar/containers/__snapshots__/MapSideBarContainer.test.tsx.snap delete mode 100644 frontend/src/features/mapSideBar/hooks/useBuildingApi.tsx delete mode 100644 frontend/src/features/mapSideBar/hooks/useQueryParamSideBar.tsx delete mode 100644 frontend/src/features/mapSideBar/hooks/useSideBarBuildingLoader.tsx delete mode 100644 frontend/src/features/mapSideBar/hooks/useSideBarBuildingWithParcelLoader.tsx delete mode 100644 frontend/src/features/mapSideBar/hooks/useSideBarParcelLoader.tsx delete mode 100644 frontend/src/features/projects/apiService.ts delete mode 100644 frontend/src/features/projects/assess/components/ReviewApproveActions.test.tsx delete mode 100644 frontend/src/features/projects/assess/components/ReviewApproveActions.tsx delete mode 100644 frontend/src/features/projects/assess/components/ReviewApproveExemption.test.tsx delete mode 100644 frontend/src/features/projects/assess/forms/ReviewApproveForm.scss delete mode 100644 frontend/src/features/projects/assess/forms/ReviewApproveForm.tsx delete mode 100644 frontend/src/features/projects/assess/index.ts delete mode 100644 frontend/src/features/projects/assess/steps/ReviewApproveStep.test.tsx delete mode 100644 frontend/src/features/projects/assess/steps/ReviewApproveStep.tsx delete mode 100644 frontend/src/features/projects/assess/steps/__snapshots__/ReviewApproveStep.test.tsx.snap delete mode 100644 frontend/src/features/projects/common/ApprovalTransitionPage.tsx delete mode 100644 frontend/src/features/projects/common/ProjectLayout.scss delete mode 100644 frontend/src/features/projects/common/ProjectLayout.tsx delete mode 100644 frontend/src/features/projects/common/ProjectRouter.test.tsx delete mode 100644 frontend/src/features/projects/common/ProjectRouter.tsx delete mode 100644 frontend/src/features/projects/common/components/EditButton.test.tsx delete mode 100644 frontend/src/features/projects/common/components/EditButton.tsx delete mode 100644 frontend/src/features/projects/common/components/FilterBar.scss delete mode 100644 frontend/src/features/projects/common/components/FilterBar.tsx delete mode 100644 frontend/src/features/projects/common/components/FormikTable.tsx delete mode 100644 frontend/src/features/projects/common/components/ManualLink.scss delete mode 100644 frontend/src/features/projects/common/components/ManualLink.tsx delete mode 100644 frontend/src/features/projects/common/components/NotificationCheck.tsx delete mode 100644 frontend/src/features/projects/common/components/ProjectFinancialTable.tsx delete mode 100644 frontend/src/features/projects/common/components/ProjectNotes.scss delete mode 100644 frontend/src/features/projects/common/components/ProjectNotes.tsx delete mode 100644 frontend/src/features/projects/common/components/PropertyListViewSelect.tsx delete mode 100644 frontend/src/features/projects/common/components/PropertyListViewUpdate.tsx delete mode 100644 frontend/src/features/projects/common/components/SelectProjectPropertiesPage.tsx delete mode 100644 frontend/src/features/projects/common/components/SresManual.scss delete mode 100644 frontend/src/features/projects/common/components/SresManual.tsx delete mode 100644 frontend/src/features/projects/common/components/StepErrorSummary.tsx delete mode 100644 frontend/src/features/projects/common/components/StepStatusIcon.tsx delete mode 100644 frontend/src/features/projects/common/components/__snapshots__/EditButton.test.tsx.snap delete mode 100644 frontend/src/features/projects/common/components/columns.tsx delete mode 100644 frontend/src/features/projects/common/forms/AdditionalPropertyInformationForm.tsx delete mode 100644 frontend/src/features/projects/common/forms/AppraisalCheckListForm.tsx delete mode 100644 frontend/src/features/projects/common/forms/ApprovalConfirmationForm.tsx delete mode 100644 frontend/src/features/projects/common/forms/DocumentationForm.tsx delete mode 100644 frontend/src/features/projects/common/forms/FirstNationsCheckListForm.tsx delete mode 100644 frontend/src/features/projects/common/forms/GreTransferForm.tsx delete mode 100644 frontend/src/features/projects/common/forms/ProjectDraftForm.scss delete mode 100644 frontend/src/features/projects/common/forms/ProjectDraftForm.tsx delete mode 100644 frontend/src/features/projects/common/forms/SelectProjectPropertiesForm.tsx delete mode 100644 frontend/src/features/projects/common/forms/TasksForm.tsx delete mode 100644 frontend/src/features/projects/common/forms/UpdateInfoForm.scss delete mode 100644 frontend/src/features/projects/common/forms/UpdateInfoForm.test.tsx delete mode 100644 frontend/src/features/projects/common/forms/UpdateInfoForm.tsx delete mode 100644 frontend/src/features/projects/common/forms/__snapshots__/UpdateInfoForm.test.tsx.snap delete mode 100644 frontend/src/features/projects/common/hooks/useAgencyResponseTable.tsx delete mode 100644 frontend/src/features/projects/common/hooks/useProject.tsx delete mode 100644 frontend/src/features/projects/common/hooks/useStepForm.test.tsx delete mode 100644 frontend/src/features/projects/common/hooks/useStepForm.tsx delete mode 100644 frontend/src/features/projects/common/index.ts delete mode 100644 frontend/src/features/projects/common/projectConverter.test.tsx delete mode 100644 frontend/src/features/projects/common/projectConverter.ts delete mode 100644 frontend/src/features/projects/common/projectsActionCreator.ts delete mode 100644 frontend/src/features/projects/common/slices/projectSlice.ts delete mode 100644 frontend/src/features/projects/common/slices/projectStatusesSlice.ts delete mode 100644 frontend/src/features/projects/common/slices/projectTasksSlice.ts delete mode 100644 frontend/src/features/projects/common/slices/projectWorkflowSlice.ts delete mode 100644 frontend/src/features/projects/common/slices/projectWorkflowTasksSlice.ts delete mode 100644 frontend/src/features/projects/common/strings.ts delete mode 100644 frontend/src/features/projects/common/tabs/DocumentationTab.tsx delete mode 100644 frontend/src/features/projects/common/tabs/NotificationList.tsx delete mode 100644 frontend/src/features/projects/common/tabs/NotificationTab.tsx delete mode 100644 frontend/src/features/projects/common/tabs/ProjectInformationTab.tsx delete mode 100644 frontend/src/features/projects/common/tabs/columns.tsx delete mode 100644 frontend/src/features/projects/common/tabs/projectTabValidation.ts delete mode 100644 frontend/src/features/projects/common/utils/calcGainBeforeSpl.ts delete mode 100644 frontend/src/features/projects/common/utils/calcNetProceeds.ts delete mode 100644 frontend/src/features/projects/common/utils/getNumber.ts delete mode 100644 frontend/src/features/projects/common/utils/index.ts delete mode 100644 frontend/src/features/projects/constants/AgencyResponses.ts delete mode 100644 frontend/src/features/projects/constants/DisposalWorkflows.ts delete mode 100644 frontend/src/features/projects/constants/DisposeWorkflowStatus.ts delete mode 100644 frontend/src/features/projects/constants/ProjectWorkflowComponents.tsx delete mode 100644 frontend/src/features/projects/constants/ReviewWorkflowStatus.ts delete mode 100644 frontend/src/features/projects/constants/SPPApprovalTabs.ts delete mode 100644 frontend/src/features/projects/constants/defaultValues.ts delete mode 100644 frontend/src/features/projects/constants/index.ts delete mode 100644 frontend/src/features/projects/disposals/DisposalProject.tsx delete mode 100644 frontend/src/features/projects/disposals/ProjectLayout.tsx delete mode 100644 frontend/src/features/projects/disposals/ProjectStatus.tsx delete mode 100644 frontend/src/features/projects/disposals/ProjectTabs.tsx delete mode 100644 frontend/src/features/projects/disposals/close-out/ProjectCloseOut.tsx delete mode 100644 frontend/src/features/projects/disposals/close-out/index.ts delete mode 100644 frontend/src/features/projects/disposals/close-out/styled/ProjectCloseOut.tsx delete mode 100644 frontend/src/features/projects/disposals/close-out/styled/index.ts delete mode 100644 frontend/src/features/projects/disposals/close-out/utils/calcGainBeforeSpl.ts delete mode 100644 frontend/src/features/projects/disposals/close-out/utils/calcNetProceeds.ts delete mode 100644 frontend/src/features/projects/disposals/close-out/utils/getNumber.ts delete mode 100644 frontend/src/features/projects/disposals/close-out/utils/index.ts delete mode 100644 frontend/src/features/projects/disposals/constants/defaultFilter.ts delete mode 100644 frontend/src/features/projects/disposals/constants/defaultProjectForm.ts delete mode 100644 frontend/src/features/projects/disposals/constants/index.ts delete mode 100644 frontend/src/features/projects/disposals/documentation/ProjectDocumentation.tsx delete mode 100644 frontend/src/features/projects/disposals/documentation/index.ts delete mode 100644 frontend/src/features/projects/disposals/documentation/styled/ProjectDocumentation.tsx delete mode 100644 frontend/src/features/projects/disposals/documentation/styled/index.ts delete mode 100644 frontend/src/features/projects/disposals/erp/AgencyInterest.tsx delete mode 100644 frontend/src/features/projects/disposals/erp/ProjectERPApproval.tsx delete mode 100644 frontend/src/features/projects/disposals/erp/ProjectERPComplete.tsx delete mode 100644 frontend/src/features/projects/disposals/erp/ProjectERPDisposed.tsx delete mode 100644 frontend/src/features/projects/disposals/erp/ProjectERPExemption.tsx delete mode 100644 frontend/src/features/projects/disposals/erp/ProjectERPTabs.tsx delete mode 100644 frontend/src/features/projects/disposals/erp/constants/AgencyInterestColumns.tsx delete mode 100644 frontend/src/features/projects/disposals/erp/constants/index.ts delete mode 100644 frontend/src/features/projects/disposals/erp/index.ts delete mode 100644 frontend/src/features/projects/disposals/erp/styled/ProjectERP.tsx delete mode 100644 frontend/src/features/projects/disposals/erp/styled/ProjectERPApproval.tsx delete mode 100644 frontend/src/features/projects/disposals/erp/styled/ProjectERPComplete.tsx delete mode 100644 frontend/src/features/projects/disposals/erp/styled/ProjectERPDisposed.tsx delete mode 100644 frontend/src/features/projects/disposals/erp/styled/ProjectERPExemption.tsx delete mode 100644 frontend/src/features/projects/disposals/erp/styled/index.ts delete mode 100644 frontend/src/features/projects/disposals/erp/utils/addAgency.ts delete mode 100644 frontend/src/features/projects/disposals/erp/utils/index.ts delete mode 100644 frontend/src/features/projects/disposals/index.ts delete mode 100644 frontend/src/features/projects/disposals/information/ProjectAddProperties.tsx delete mode 100644 frontend/src/features/projects/disposals/information/ProjectInformation.tsx delete mode 100644 frontend/src/features/projects/disposals/information/ProjectInformationTabs.tsx delete mode 100644 frontend/src/features/projects/disposals/information/ProjectProperties.tsx delete mode 100644 frontend/src/features/projects/disposals/information/ProjectPropertyFilter.tsx delete mode 100644 frontend/src/features/projects/disposals/information/ProjectPropertyInformation.tsx delete mode 100644 frontend/src/features/projects/disposals/information/constants/AddPropertyColumns.test.tsx delete mode 100644 frontend/src/features/projects/disposals/information/constants/AddPropertyColumns.tsx delete mode 100644 frontend/src/features/projects/disposals/information/constants/PropertyColumns.test.tsx delete mode 100644 frontend/src/features/projects/disposals/information/constants/PropertyColumns.tsx delete mode 100644 frontend/src/features/projects/disposals/information/constants/index.ts delete mode 100644 frontend/src/features/projects/disposals/information/index.ts delete mode 100644 frontend/src/features/projects/disposals/information/styled/ProjectAddProperties.tsx delete mode 100644 frontend/src/features/projects/disposals/information/styled/ProjectInformation.tsx delete mode 100644 frontend/src/features/projects/disposals/information/styled/ProjectProperties.tsx delete mode 100644 frontend/src/features/projects/disposals/information/styled/Tooltip.tsx delete mode 100644 frontend/src/features/projects/disposals/information/styled/index.ts delete mode 100644 frontend/src/features/projects/disposals/information/utils/index.ts delete mode 100644 frontend/src/features/projects/disposals/information/utils/toProjectProperty.ts delete mode 100644 frontend/src/features/projects/disposals/interfaces/IProjectAgencyResponseForm.ts delete mode 100644 frontend/src/features/projects/disposals/interfaces/IProjectForm.ts delete mode 100644 frontend/src/features/projects/disposals/interfaces/IProjectNoteForm.ts delete mode 100644 frontend/src/features/projects/disposals/interfaces/IProjectPropertyFilter.ts delete mode 100644 frontend/src/features/projects/disposals/interfaces/IProjectPropertyForm.ts delete mode 100644 frontend/src/features/projects/disposals/interfaces/IProjectTaskForm.ts delete mode 100644 frontend/src/features/projects/disposals/interfaces/index.ts delete mode 100644 frontend/src/features/projects/disposals/notes/ErpNotificationNote.tsx delete mode 100644 frontend/src/features/projects/disposals/notes/ProjectNote.tsx delete mode 100644 frontend/src/features/projects/disposals/notes/index.ts delete mode 100644 frontend/src/features/projects/disposals/notes/styled/Comment.tsx delete mode 100644 frontend/src/features/projects/disposals/notes/styled/index.ts delete mode 100644 frontend/src/features/projects/disposals/notifications/ProjectNotifications.tsx delete mode 100644 frontend/src/features/projects/disposals/notifications/constants/columns.ts delete mode 100644 frontend/src/features/projects/disposals/notifications/constants/index.ts delete mode 100644 frontend/src/features/projects/disposals/notifications/index.ts delete mode 100644 frontend/src/features/projects/disposals/notifications/styled/ProjectNotifications.tsx delete mode 100644 frontend/src/features/projects/disposals/notifications/styled/index.ts delete mode 100644 frontend/src/features/projects/disposals/spl/ProjectNotSPL.tsx delete mode 100644 frontend/src/features/projects/disposals/spl/ProjectSPLApproval.tsx delete mode 100644 frontend/src/features/projects/disposals/spl/ProjectSPLContractInPlace.tsx delete mode 100644 frontend/src/features/projects/disposals/spl/ProjectSPLMarketing.tsx delete mode 100644 frontend/src/features/projects/disposals/spl/ProjectSPLTabs.tsx delete mode 100644 frontend/src/features/projects/disposals/spl/ProjectSPLTransferWithinGRE.tsx delete mode 100644 frontend/src/features/projects/disposals/spl/index.ts delete mode 100644 frontend/src/features/projects/disposals/spl/styled/ProjectNotSPL.tsx delete mode 100644 frontend/src/features/projects/disposals/spl/styled/ProjectSPL.tsx delete mode 100644 frontend/src/features/projects/disposals/spl/styled/index.ts delete mode 100644 frontend/src/features/projects/disposals/styled/ActiveStatus.tsx delete mode 100644 frontend/src/features/projects/disposals/styled/DisposalProject.tsx delete mode 100644 frontend/src/features/projects/disposals/styled/ProjectLayout.tsx delete mode 100644 frontend/src/features/projects/disposals/styled/ProjectStatus.tsx delete mode 100644 frontend/src/features/projects/disposals/styled/ProjectTabs.tsx delete mode 100644 frontend/src/features/projects/disposals/styled/index.ts delete mode 100644 frontend/src/features/projects/disposals/transfer-gre/GreTransferStep.tsx delete mode 100644 frontend/src/features/projects/disposals/transfer-gre/constants/TransferPropertyColumns.tsx delete mode 100644 frontend/src/features/projects/disposals/transfer-gre/constants/index.ts delete mode 100644 frontend/src/features/projects/disposals/transfer-gre/index.ts delete mode 100644 frontend/src/features/projects/disposals/transfer-gre/styled/GreTransferStep.tsx delete mode 100644 frontend/src/features/projects/disposals/transfer-gre/styled/index.ts delete mode 100644 frontend/src/features/projects/disposals/utils/convertToPropertyType.ts delete mode 100644 frontend/src/features/projects/disposals/utils/convertToPropertyTypeName.ts delete mode 100644 frontend/src/features/projects/disposals/utils/getMostRecentEvaluation.ts delete mode 100644 frontend/src/features/projects/disposals/utils/getMostRecentFiscal.ts delete mode 100644 frontend/src/features/projects/disposals/utils/index.ts delete mode 100644 frontend/src/features/projects/disposals/utils/toForm.ts delete mode 100644 frontend/src/features/projects/disposals/utils/toModel.ts delete mode 100644 frontend/src/features/projects/disposals/utils/toPropertyForm.ts delete mode 100644 frontend/src/features/projects/disposals/utils/toPropertyModel.ts delete mode 100644 frontend/src/features/projects/disposals/validation/documentationSchema.ts delete mode 100644 frontend/src/features/projects/disposals/validation/erpCompleteSchema.ts delete mode 100644 frontend/src/features/projects/disposals/validation/erpDisposedSchema.ts delete mode 100644 frontend/src/features/projects/disposals/validation/erpExemptionSchema.ts delete mode 100644 frontend/src/features/projects/disposals/validation/index.ts delete mode 100644 frontend/src/features/projects/disposals/validation/informationProjectSchema.ts delete mode 100644 frontend/src/features/projects/disposals/validation/informationPropertiesSchema.ts delete mode 100644 frontend/src/features/projects/disposals/validation/notSplSchema.ts delete mode 100644 frontend/src/features/projects/disposals/validation/splApprovalSchema.ts delete mode 100644 frontend/src/features/projects/disposals/validation/splContractInPlaceSchema.ts delete mode 100644 frontend/src/features/projects/disposals/validation/splMarketingSchema.ts delete mode 100644 frontend/src/features/projects/disposals/validation/splTransferWithinGRESchema.ts delete mode 100644 frontend/src/features/projects/disposals/validation/useProjectValidation.ts delete mode 100644 frontend/src/features/projects/dispose/ProjectDisposalExemptionSubmitted.tsx delete mode 100644 frontend/src/features/projects/dispose/ProjectDisposalSubmitted.scss delete mode 100644 frontend/src/features/projects/dispose/ProjectDisposalSubmitted.tsx delete mode 100644 frontend/src/features/projects/dispose/ProjectDisposeLayout.test.tsx delete mode 100644 frontend/src/features/projects/dispose/ProjectDisposeLayout.tsx delete mode 100644 frontend/src/features/projects/dispose/ProjectDisposeView.scss delete mode 100644 frontend/src/features/projects/dispose/ProjectDisposeView.test.tsx delete mode 100644 frontend/src/features/projects/dispose/ProjectDisposeView.tsx delete mode 100644 frontend/src/features/projects/dispose/__snapshots__/ProjectDisposeLayout.test.tsx.snap delete mode 100644 frontend/src/features/projects/dispose/__snapshots__/ProjectDisposeView.test.tsx.snap delete mode 100644 frontend/src/features/projects/dispose/components/ApprovalConfirmation.scss delete mode 100644 frontend/src/features/projects/dispose/components/ApprovalConfirmation.test.tsx delete mode 100644 frontend/src/features/projects/dispose/components/ExemptionRequest.scss delete mode 100644 frontend/src/features/projects/dispose/components/ExemptionRequest.test.tsx delete mode 100644 frontend/src/features/projects/dispose/components/ExemptionRequest.tsx delete mode 100644 frontend/src/features/projects/dispose/components/GeneratedDisposeStepper.tsx delete mode 100644 frontend/src/features/projects/dispose/components/StepActions.test.tsx delete mode 100644 frontend/src/features/projects/dispose/components/StepActions.tsx delete mode 100644 frontend/src/features/projects/dispose/components/__snapshots__/ApprovalConfirmation.test.tsx.snap delete mode 100644 frontend/src/features/projects/dispose/components/__snapshots__/ExemptionRequest.test.tsx.snap delete mode 100644 frontend/src/features/projects/dispose/components/__snapshots__/StepActions.test.tsx.snap delete mode 100644 frontend/src/features/projects/dispose/forms/PropertyListViewSelect.test.tsx delete mode 100644 frontend/src/features/projects/dispose/forms/ReviewProjectForm.scss delete mode 100644 frontend/src/features/projects/dispose/forms/ReviewProjectForm.tsx delete mode 100644 frontend/src/features/projects/dispose/forms/__snapshots__/PropertyListViewSelect.test.tsx.snap delete mode 100644 frontend/src/features/projects/dispose/forms/disposalYupSchema.ts delete mode 100644 frontend/src/features/projects/dispose/hooks/stepperContext.tsx delete mode 100644 frontend/src/features/projects/dispose/hooks/useStepper.test.tsx delete mode 100644 frontend/src/features/projects/dispose/hooks/useStepper.ts delete mode 100644 frontend/src/features/projects/dispose/hooks/useTable.ts delete mode 100644 frontend/src/features/projects/dispose/index.ts delete mode 100644 frontend/src/features/projects/dispose/steps/ApprovalConfirmationStep.tsx delete mode 100644 frontend/src/features/projects/dispose/steps/DocumentationStep.test.tsx delete mode 100644 frontend/src/features/projects/dispose/steps/DocumentationStep.tsx delete mode 100644 frontend/src/features/projects/dispose/steps/ProjectDraftStep.test.tsx delete mode 100644 frontend/src/features/projects/dispose/steps/ProjectDraftStep.tsx delete mode 100644 frontend/src/features/projects/dispose/steps/ReviewProjectStep.test.tsx delete mode 100644 frontend/src/features/projects/dispose/steps/ReviewProjectStep.tsx delete mode 100644 frontend/src/features/projects/dispose/steps/SelectProjectPropertiesStep.scss delete mode 100644 frontend/src/features/projects/dispose/steps/SelectProjectPropertiesStep.test.tsx delete mode 100644 frontend/src/features/projects/dispose/steps/SelectProjectPropertiesStep.tsx delete mode 100644 frontend/src/features/projects/dispose/steps/UpdateInfoStep.tsx delete mode 100644 frontend/src/features/projects/dispose/steps/__snapshots__/DocumentationStep.test.tsx.snap delete mode 100644 frontend/src/features/projects/dispose/steps/__snapshots__/ProjectDraftStep.test.tsx.snap delete mode 100644 frontend/src/features/projects/dispose/steps/__snapshots__/ReviewProjectStep.test.tsx.snap delete mode 100644 frontend/src/features/projects/dispose/steps/__snapshots__/SelectProjectPropertiesStep.test.tsx.snap delete mode 100644 frontend/src/features/projects/dispose/testUtils.ts delete mode 100644 frontend/src/features/projects/interfaces/IApiProject.ts delete mode 100644 frontend/src/features/projects/interfaces/IApiProperty.ts delete mode 100644 frontend/src/features/projects/interfaces/INotification.ts delete mode 100644 frontend/src/features/projects/interfaces/INotificationFilter.ts delete mode 100644 frontend/src/features/projects/interfaces/IParentParcel.ts delete mode 100644 frontend/src/features/projects/interfaces/IProject.ts delete mode 100644 frontend/src/features/projects/interfaces/IProjectAgencyResponse.ts delete mode 100644 frontend/src/features/projects/interfaces/IProjectNote.ts delete mode 100644 frontend/src/features/projects/interfaces/IProjectProperty.ts delete mode 100644 frontend/src/features/projects/interfaces/IProjectStatusHistory.ts delete mode 100644 frontend/src/features/projects/interfaces/IProjectTask.ts delete mode 100644 frontend/src/features/projects/interfaces/IProjectWorkflowComponent.ts delete mode 100644 frontend/src/features/projects/interfaces/IProperty.ts delete mode 100644 frontend/src/features/projects/interfaces/IPropertyFilter.ts delete mode 100644 frontend/src/features/projects/interfaces/IStatus.ts delete mode 100644 frontend/src/features/projects/interfaces/IStepProps.ts delete mode 100644 frontend/src/features/projects/interfaces/ITask.ts delete mode 100644 frontend/src/features/projects/interfaces/index.ts delete mode 100644 frontend/src/features/projects/list/ProjectApprovalRequest.test.tsx delete mode 100644 frontend/src/features/projects/list/ProjectApprovalRequestListView.tsx delete mode 100644 frontend/src/features/projects/list/ProjectListView.scss delete mode 100644 frontend/src/features/projects/list/ProjectListView.test.tsx delete mode 100644 frontend/src/features/projects/list/ProjectListView.tsx delete mode 100644 frontend/src/features/projects/list/SPLProjectListView.test.tsx delete mode 100644 frontend/src/features/projects/list/SPLProjectListView.tsx delete mode 100644 frontend/src/features/projects/list/__snapshots__/ProjectApprovalRequest.test.tsx.snap delete mode 100644 frontend/src/features/projects/list/__snapshots__/ProjectListView.test.tsx.snap delete mode 100644 frontend/src/features/projects/list/__snapshots__/SPLProjectListView.test.tsx.snap delete mode 100644 frontend/src/features/projects/list/columns.tsx delete mode 100644 frontend/src/features/projects/list/index.ts delete mode 100644 frontend/src/features/projects/list/interfaces.ts delete mode 100644 frontend/src/features/projects/list/properties/Properties.tsx delete mode 100644 frontend/src/features/projects/list/properties/columns.tsx delete mode 100644 frontend/src/features/projects/list/properties/index.ts delete mode 100644 frontend/src/features/projects/summary/ProjectSummary.tsx delete mode 100644 frontend/src/features/projects/summary/constants/PropertyColumns.tsx delete mode 100644 frontend/src/features/projects/summary/constants/index.ts delete mode 100644 frontend/src/features/projects/summary/index.ts delete mode 100644 frontend/src/features/projects/summary/styled/ProjectSummary.tsx delete mode 100644 frontend/src/features/projects/summary/styled/index.ts delete mode 100644 frontend/src/features/projects/utils.ts delete mode 100644 frontend/src/features/properties/common/slices/propertyNameSlice.ts delete mode 100644 frontend/src/features/properties/components/GeocoderAutoComplete.tsx delete mode 100644 frontend/src/features/properties/components/GeocoderAutoCompleteStyled.tsx delete mode 100644 frontend/src/features/properties/components/LastUpdatedBy.test.tsx delete mode 100644 frontend/src/features/properties/components/LastUpdatedBy.tsx delete mode 100644 frontend/src/features/properties/components/forms/strings.ts delete mode 100644 frontend/src/features/properties/components/forms/subforms/AddressForm.scss delete mode 100644 frontend/src/features/properties/components/forms/subforms/AddressForm.tsx delete mode 100644 frontend/src/features/properties/components/forms/subforms/DebouncedValidation.tsx delete mode 100644 frontend/src/features/properties/components/forms/subforms/EvaluationForm.tsx delete mode 100644 frontend/src/features/properties/components/forms/subforms/InformationForm.scss delete mode 100644 frontend/src/features/properties/components/forms/subforms/InformationForm.tsx delete mode 100644 frontend/src/features/properties/components/forms/subforms/LandForm.tsx delete mode 100644 frontend/src/features/properties/components/forms/subforms/LatLongForm.tsx delete mode 100644 frontend/src/features/properties/components/forms/subforms/PaginatedFormErrors.tsx delete mode 100644 frontend/src/features/properties/components/forms/subforms/PidPinForm.scss delete mode 100644 frontend/src/features/properties/components/forms/subforms/PidPinForm.test.tsx delete mode 100644 frontend/src/features/properties/components/forms/subforms/PidPinForm.tsx delete mode 100644 frontend/src/features/properties/components/forms/subforms/__snapshots__/PidPinForm.test.tsx.snap delete mode 100644 frontend/src/features/properties/components/forms/subforms/columns.tsx delete mode 100644 frontend/src/features/properties/components/forms/subforms/tableStyles.scss delete mode 100644 frontend/src/features/properties/filter/IPropertyFilter.ts delete mode 100644 frontend/src/features/properties/filter/PropertyFilter.scss delete mode 100644 frontend/src/features/properties/filter/PropertyFilter.test.tsx delete mode 100644 frontend/src/features/properties/filter/PropertyFilter.tsx delete mode 100644 frontend/src/features/properties/filter/PropertyFilterAgencyOptions.tsx delete mode 100644 frontend/src/features/properties/filter/PropertyFilterOptions.test.tsx delete mode 100644 frontend/src/features/properties/filter/PropertyFilterOptions.tsx delete mode 100644 frontend/src/features/properties/filter/__snapshots__/PropertyFilter.test.tsx.snap delete mode 100644 frontend/src/features/properties/filter/__snapshots__/PropertyFilterOptions.test.tsx.snap delete mode 100644 frontend/src/features/properties/filter/index.ts delete mode 100644 frontend/src/features/properties/hooks/useDraftMarkerSynchronizer.tsx delete mode 100644 frontend/src/features/properties/hooks/useGeocoder.tsx delete mode 100644 frontend/src/features/properties/hooks/useParcelLayerData.tsx delete mode 100644 frontend/src/features/properties/list/PropertyListView.scss delete mode 100644 frontend/src/features/properties/list/PropertyListView.test.tsx delete mode 100644 frontend/src/features/properties/list/PropertyListView.tsx delete mode 100644 frontend/src/features/properties/list/__snapshots__/PropertyListView.test.tsx.snap delete mode 100644 frontend/src/features/properties/list/buildings/Buildings.tsx delete mode 100644 frontend/src/features/properties/list/buildings/index.ts delete mode 100644 frontend/src/features/properties/list/columns.tsx delete mode 100644 frontend/src/features/properties/list/index.ts delete mode 100644 frontend/src/features/properties/list/interfaces.ts delete mode 100644 frontend/src/features/properties/list/toApiProperty.ts delete mode 100644 frontend/src/features/properties/map/MapView.scss delete mode 100644 frontend/src/features/properties/map/MapView.tsx delete mode 100644 frontend/src/features/properties/service.ts delete mode 100644 frontend/src/features/properties/upload/FileInput.scss delete mode 100644 frontend/src/features/properties/upload/FileInput.test.tsx delete mode 100644 frontend/src/features/properties/upload/FileInput.tsx delete mode 100644 frontend/src/features/properties/upload/Instructions.scss delete mode 100644 frontend/src/features/properties/upload/Instructions.test.tsx delete mode 100644 frontend/src/features/properties/upload/Instructions.tsx delete mode 100644 frontend/src/features/properties/upload/UploadProgress.scss delete mode 100644 frontend/src/features/properties/upload/UploadProgress.test.tsx delete mode 100644 frontend/src/features/properties/upload/UploadProgress.tsx delete mode 100644 frontend/src/features/properties/upload/UploadProperties.scss delete mode 100644 frontend/src/features/properties/upload/UploadProperties.test.tsx delete mode 100644 frontend/src/features/properties/upload/UploadProperties.tsx delete mode 100644 frontend/src/features/routes/AppRouter.tsx delete mode 100644 frontend/src/features/routes/IsAuthenticatedRoute.tsx delete mode 100644 frontend/src/features/routes/LayoutWrapper.test.tsx delete mode 100644 frontend/src/features/routes/LayoutWrapper.tsx delete mode 100644 frontend/src/features/routes/PrivateRoute.tsx delete mode 100644 frontend/src/features/routes/index.ts delete mode 100644 frontend/src/features/splReports/columns.tsx delete mode 100644 frontend/src/features/splReports/components/AddReportControl.tsx delete mode 100644 frontend/src/features/splReports/components/ElipsisControls.scss delete mode 100644 frontend/src/features/splReports/components/ElipsisControls.tsx delete mode 100644 frontend/src/features/splReports/components/ReportControls.tsx delete mode 100644 frontend/src/features/splReports/components/ReportForm.tsx delete mode 100644 frontend/src/features/splReports/components/ReportList.tsx delete mode 100644 frontend/src/features/splReports/components/ReportListItem.tsx delete mode 100644 frontend/src/features/splReports/components/SplReportLayout.scss delete mode 100644 frontend/src/features/splReports/components/SplReportLayout.tsx delete mode 100644 frontend/src/features/splReports/containers/SplReportContainer.tsx delete mode 100644 frontend/src/features/splReports/hooks/useProjectSnapshotApi.test.tsx delete mode 100644 frontend/src/features/splReports/hooks/useProjectSnapshotApi.ts delete mode 100644 frontend/src/features/splReports/hooks/useRouterReport.test.tsx delete mode 100644 frontend/src/features/splReports/hooks/useRouterReport.ts delete mode 100644 frontend/src/features/splReports/interfaces.ts delete mode 100644 frontend/src/globals.d.ts delete mode 100644 frontend/src/hooks/api/admin/access-requests/index.ts delete mode 100644 frontend/src/hooks/api/admin/access-requests/interfaces/IAccessRequestAgencyModel.ts delete mode 100644 frontend/src/hooks/api/admin/access-requests/interfaces/IAccessRequestFilter.ts delete mode 100644 frontend/src/hooks/api/admin/access-requests/interfaces/IAccessRequestModel.ts delete mode 100644 frontend/src/hooks/api/admin/access-requests/interfaces/IAccessRequestRoleModel.ts delete mode 100644 frontend/src/hooks/api/admin/access-requests/interfaces/index.ts delete mode 100644 frontend/src/hooks/api/admin/access-requests/useApiAdminAccessRequests.ts delete mode 100644 frontend/src/hooks/api/admin/administrative-areas/index.ts delete mode 100644 frontend/src/hooks/api/admin/administrative-areas/interfaces/IAdministrativeAreaFilter.ts delete mode 100644 frontend/src/hooks/api/admin/administrative-areas/interfaces/IAdministrativeAreaModel.ts delete mode 100644 frontend/src/hooks/api/admin/administrative-areas/interfaces/index.ts delete mode 100644 frontend/src/hooks/api/admin/administrative-areas/useApiAdminAdministrativeAreas.ts delete mode 100644 frontend/src/hooks/api/admin/agencies/index.ts delete mode 100644 frontend/src/hooks/api/admin/agencies/interfaces/IAgencyModel.ts delete mode 100644 frontend/src/hooks/api/admin/agencies/interfaces/index.ts delete mode 100644 frontend/src/hooks/api/admin/agencies/useApiAdminAgencies.ts delete mode 100644 frontend/src/hooks/api/admin/claims/index.ts delete mode 100644 frontend/src/hooks/api/admin/claims/interfaces/IClaimModel.ts delete mode 100644 frontend/src/hooks/api/admin/claims/interfaces/index.ts delete mode 100644 frontend/src/hooks/api/admin/claims/useApiAdminClaims.ts delete mode 100644 frontend/src/hooks/api/admin/index.ts delete mode 100644 frontend/src/hooks/api/admin/roles/index.ts delete mode 100644 frontend/src/hooks/api/admin/roles/interfaces/IRoleModel.ts delete mode 100644 frontend/src/hooks/api/admin/roles/interfaces/index.ts delete mode 100644 frontend/src/hooks/api/admin/roles/useApiAdminRoles.ts delete mode 100644 frontend/src/hooks/api/admin/users/index.ts delete mode 100644 frontend/src/hooks/api/admin/users/interfaces/IUserModel.ts delete mode 100644 frontend/src/hooks/api/admin/users/interfaces/index.ts delete mode 100644 frontend/src/hooks/api/admin/users/useApiAdminUsers.ts delete mode 100644 frontend/src/hooks/api/constants/AccessRequestStatus.ts delete mode 100644 frontend/src/hooks/api/constants/Claim.ts delete mode 100644 frontend/src/hooks/api/constants/LookupType.ts delete mode 100644 frontend/src/hooks/api/constants/NoteType.ts delete mode 100644 frontend/src/hooks/api/constants/NotificationBodyType.ts delete mode 100644 frontend/src/hooks/api/constants/NotificationEncoding.ts delete mode 100644 frontend/src/hooks/api/constants/NotificationPriority.ts delete mode 100644 frontend/src/hooks/api/constants/NotificationResponse.ts delete mode 100644 frontend/src/hooks/api/constants/NotificationStatus.ts delete mode 100644 frontend/src/hooks/api/constants/Role.ts delete mode 100644 frontend/src/hooks/api/constants/index.ts delete mode 100644 frontend/src/hooks/api/geocoder/index.ts delete mode 100644 frontend/src/hooks/api/geocoder/interfaces/IGeoAddressModel.ts delete mode 100644 frontend/src/hooks/api/geocoder/interfaces/ISitePidsModel.ts delete mode 100644 frontend/src/hooks/api/geocoder/interfaces/index.ts delete mode 100644 frontend/src/hooks/api/geocoder/useApiGeocoder.ts delete mode 100644 frontend/src/hooks/api/index.ts delete mode 100644 frontend/src/hooks/api/interfaces/IBaseLookupModel.ts delete mode 100644 frontend/src/hooks/api/interfaces/IBaseModel.ts delete mode 100644 frontend/src/hooks/api/interfaces/IPageFilter.ts delete mode 100644 frontend/src/hooks/api/interfaces/IPageModel.ts delete mode 100644 frontend/src/hooks/api/interfaces/index.ts delete mode 100644 frontend/src/hooks/api/lookups/index.ts delete mode 100644 frontend/src/hooks/api/lookups/interfaces/ILookupModel.ts delete mode 100644 frontend/src/hooks/api/lookups/interfaces/index.ts delete mode 100644 frontend/src/hooks/api/lookups/useApiLookups.ts delete mode 100644 frontend/src/hooks/api/projects/constants/DisposeWorkflowStatus.ts delete mode 100644 frontend/src/hooks/api/projects/constants/Workflow.ts delete mode 100644 frontend/src/hooks/api/projects/constants/WorkflowStatus.ts delete mode 100644 frontend/src/hooks/api/projects/constants/index.ts delete mode 100644 frontend/src/hooks/api/projects/disposals/index.ts delete mode 100644 frontend/src/hooks/api/projects/disposals/interfaces/INotificationQueueModel.ts delete mode 100644 frontend/src/hooks/api/projects/disposals/interfaces/IProjectAgencyResponseModel.ts delete mode 100644 frontend/src/hooks/api/projects/disposals/interfaces/IProjectBuildingModel.ts delete mode 100644 frontend/src/hooks/api/projects/disposals/interfaces/IProjectModel.ts delete mode 100644 frontend/src/hooks/api/projects/disposals/interfaces/IProjectNoteModel.ts delete mode 100644 frontend/src/hooks/api/projects/disposals/interfaces/IProjectNotificationFilter.ts delete mode 100644 frontend/src/hooks/api/projects/disposals/interfaces/IProjectParcelModel.ts delete mode 100644 frontend/src/hooks/api/projects/disposals/interfaces/IProjectPropertyModel.ts delete mode 100644 frontend/src/hooks/api/projects/disposals/interfaces/IProjectStatusHistoryModel.ts delete mode 100644 frontend/src/hooks/api/projects/disposals/interfaces/IProjectStatusModel.ts delete mode 100644 frontend/src/hooks/api/projects/disposals/interfaces/IProjectTaskModel.ts delete mode 100644 frontend/src/hooks/api/projects/disposals/interfaces/index.ts delete mode 100644 frontend/src/hooks/api/projects/disposals/useApiProjectDisposal.ts delete mode 100644 frontend/src/hooks/api/projects/index.ts delete mode 100644 frontend/src/hooks/api/projects/search/index.ts delete mode 100644 frontend/src/hooks/api/projects/search/interfaces/IProjectFilter.ts delete mode 100644 frontend/src/hooks/api/projects/search/interfaces/IProjectModel.ts delete mode 100644 frontend/src/hooks/api/projects/search/interfaces/IProjectPropertyModel.ts delete mode 100644 frontend/src/hooks/api/projects/search/interfaces/index.ts delete mode 100644 frontend/src/hooks/api/projects/search/useApiProjectSearch.ts delete mode 100644 frontend/src/hooks/api/projects/status/index.ts delete mode 100644 frontend/src/hooks/api/projects/status/interfaces/IProjectStatusModel.ts delete mode 100644 frontend/src/hooks/api/projects/status/interfaces/ITaskModel.ts delete mode 100644 frontend/src/hooks/api/projects/status/interfaces/index.ts delete mode 100644 frontend/src/hooks/api/projects/status/useApiProjectStatus.ts delete mode 100644 frontend/src/hooks/api/projects/workflows/index.ts delete mode 100644 frontend/src/hooks/api/projects/workflows/interfaces/IProjectStatusModel.ts delete mode 100644 frontend/src/hooks/api/projects/workflows/interfaces/ITaskModel.ts delete mode 100644 frontend/src/hooks/api/projects/workflows/interfaces/index.ts delete mode 100644 frontend/src/hooks/api/projects/workflows/useApiProjectWorkflow.ts delete mode 100644 frontend/src/hooks/api/properties/buildings/index.ts delete mode 100644 frontend/src/hooks/api/properties/buildings/interfaces/IBuildingModel.ts delete mode 100644 frontend/src/hooks/api/properties/buildings/interfaces/IBuildingParcelModel.ts delete mode 100644 frontend/src/hooks/api/properties/buildings/interfaces/ILeasedLandMetadataModel.ts delete mode 100644 frontend/src/hooks/api/properties/buildings/interfaces/index.ts delete mode 100644 frontend/src/hooks/api/properties/buildings/useApiBuildings.ts delete mode 100644 frontend/src/hooks/api/properties/constants/Classification.ts delete mode 100644 frontend/src/hooks/api/properties/constants/EvaluationKey.ts delete mode 100644 frontend/src/hooks/api/properties/constants/EvaluationKeyName.ts delete mode 100644 frontend/src/hooks/api/properties/constants/FiscalKeyName.ts delete mode 100644 frontend/src/hooks/api/properties/constants/FiscalKeys.ts delete mode 100644 frontend/src/hooks/api/properties/constants/LeasedLandType.ts delete mode 100644 frontend/src/hooks/api/properties/constants/PropertyType.ts delete mode 100644 frontend/src/hooks/api/properties/constants/PropertyTypeName.ts delete mode 100644 frontend/src/hooks/api/properties/constants/index.ts delete mode 100644 frontend/src/hooks/api/properties/index.ts delete mode 100644 frontend/src/hooks/api/properties/interfaces/IAddressModel.ts delete mode 100644 frontend/src/hooks/api/properties/interfaces/IEvaluationModel.ts delete mode 100644 frontend/src/hooks/api/properties/interfaces/IFiscalModel.ts delete mode 100644 frontend/src/hooks/api/properties/interfaces/IParcelFilter.ts delete mode 100644 frontend/src/hooks/api/properties/interfaces/IPropertyFilter.ts delete mode 100644 frontend/src/hooks/api/properties/interfaces/IPropertyModel.ts delete mode 100644 frontend/src/hooks/api/properties/interfaces/index.ts delete mode 100644 frontend/src/hooks/api/properties/parcels/index.ts delete mode 100644 frontend/src/hooks/api/properties/parcels/interfaces/IParcelBuildingModel.ts delete mode 100644 frontend/src/hooks/api/properties/parcels/interfaces/IParcelModel.ts delete mode 100644 frontend/src/hooks/api/properties/parcels/interfaces/IParcelSubdivisionModel.ts delete mode 100644 frontend/src/hooks/api/properties/parcels/interfaces/IPidAvailableModel.ts delete mode 100644 frontend/src/hooks/api/properties/parcels/interfaces/IPinAvailableModel.ts delete mode 100644 frontend/src/hooks/api/properties/parcels/interfaces/ISubdivisionParcelModel.ts delete mode 100644 frontend/src/hooks/api/properties/parcels/interfaces/index.ts delete mode 100644 frontend/src/hooks/api/properties/parcels/useApiParcels.ts delete mode 100644 frontend/src/hooks/api/properties/search/index.ts delete mode 100644 frontend/src/hooks/api/properties/search/interfaces/IGeoFilter.ts delete mode 100644 frontend/src/hooks/api/properties/search/interfaces/ISearchAllFilter.ts delete mode 100644 frontend/src/hooks/api/properties/search/interfaces/ISearchFilter.ts delete mode 100644 frontend/src/hooks/api/properties/search/interfaces/ISearchPropertyModel.ts delete mode 100644 frontend/src/hooks/api/properties/search/interfaces/index.ts delete mode 100644 frontend/src/hooks/api/properties/search/useApiProperties.ts delete mode 100644 frontend/src/hooks/api/useApi.ts delete mode 100644 frontend/src/hooks/api/users/index.ts delete mode 100644 frontend/src/hooks/api/users/interfaces/IAccessRequestModel.ts delete mode 100644 frontend/src/hooks/api/users/interfaces/IUserActivateModel.ts delete mode 100644 frontend/src/hooks/api/users/interfaces/IUserInfoModel.ts delete mode 100644 frontend/src/hooks/api/users/interfaces/IUserModel.ts delete mode 100644 frontend/src/hooks/api/users/interfaces/index.ts delete mode 100644 frontend/src/hooks/api/users/useApiAccessRequests.ts delete mode 100644 frontend/src/hooks/api/users/useApiUsers.ts delete mode 100644 frontend/src/hooks/use-query.ts delete mode 100644 frontend/src/hooks/useApi.ts delete mode 100644 frontend/src/hooks/useApiAdminAreas.ts delete mode 100644 frontend/src/hooks/useApiDisposal.ts delete mode 100644 frontend/src/hooks/useAsyncError.ts delete mode 100644 frontend/src/hooks/useConfiguration.ts delete mode 100644 frontend/src/hooks/useDeepCompareCallback.ts delete mode 100644 frontend/src/hooks/useDeepCompareEffect.test.ts delete mode 100644 frontend/src/hooks/useDeepCompareEffect.ts delete mode 100644 frontend/src/hooks/useDeepCompareMemo.ts delete mode 100644 frontend/src/hooks/useDeepCompareMemoize.ts delete mode 100644 frontend/src/hooks/useEnvironment.ts delete mode 100644 frontend/src/hooks/useEventListener.ts delete mode 100644 frontend/src/hooks/useGetAccountType.tsx delete mode 100644 frontend/src/hooks/useKeycloakWrapper.test.tsx delete mode 100644 frontend/src/hooks/useKeycloakWrapper.tsx delete mode 100644 frontend/src/hooks/useLookupCodes.tsx delete mode 100644 frontend/src/hooks/useMyAgencies.test.tsx delete mode 100644 frontend/src/hooks/useMyAgencies.ts delete mode 100644 frontend/src/hooks/useRouterFilter.test.tsx delete mode 100644 frontend/src/hooks/useRouterFilter.ts delete mode 100644 frontend/src/index.scss delete mode 100644 frontend/src/index.tsx delete mode 100644 frontend/src/interfaces/IKeycloakConfig.ts delete mode 100644 frontend/src/interfaces/IUsersFilter.ts delete mode 100644 frontend/src/interfaces/accessRequests.ts delete mode 100644 frontend/src/interfaces/agency.ts delete mode 100644 frontend/src/interfaces/index.ts delete mode 100644 frontend/src/interfaces/pagedItems.ts delete mode 100644 frontend/src/interfaces/role.ts delete mode 100644 frontend/src/interfaces/user.ts delete mode 100644 frontend/src/interfaces/userDetails.ts delete mode 100644 frontend/src/interfaces/userInfo.ts delete mode 100644 frontend/src/keycloakInstance.ts delete mode 100644 frontend/src/layouts/AuthLayout.scss delete mode 100644 frontend/src/layouts/AuthLayout.tsx delete mode 100644 frontend/src/layouts/EmptyLayout.test.tsx delete mode 100644 frontend/src/layouts/EmptyLayout.tsx delete mode 100644 frontend/src/layouts/PublicLayout.scss delete mode 100644 frontend/src/layouts/PublicLayout.tsx delete mode 100644 frontend/src/layouts/__snapshots__/EmptyLayout.test.tsx.snap delete mode 100644 frontend/src/layouts/index.ts delete mode 100644 frontend/src/logo.svg delete mode 100644 frontend/src/mocks/dataMocks.js delete mode 100644 frontend/src/mocks/filterDataMock.ts delete mode 100644 frontend/src/mocks/properties.ts delete mode 100644 frontend/src/pages/401/AccessDenied.test.tsx delete mode 100644 frontend/src/pages/401/AccessDenied.tsx delete mode 100644 frontend/src/pages/401/__snapshots__/AccessDenied.test.tsx.snap delete mode 100644 frontend/src/pages/404/NotFoundPage.test.tsx delete mode 100644 frontend/src/pages/404/NotFoundPage.tsx delete mode 100644 frontend/src/pages/404/__snapshots__/NotFoundPage.test.tsx.snap delete mode 100644 frontend/src/pages/Test.ignore.tsx delete mode 100644 frontend/src/pages/index.ts delete mode 100644 frontend/src/react-app-env.d.ts delete mode 100644 frontend/src/serviceWorker.ignore.ts delete mode 100644 frontend/src/setupTests.ts delete mode 100644 frontend/src/store/hooks/index.ts delete mode 100644 frontend/src/store/hooks/lookups/constants/index.ts delete mode 100644 frontend/src/store/hooks/lookups/constants/lookupType.ts delete mode 100644 frontend/src/store/hooks/lookups/index.ts delete mode 100644 frontend/src/store/hooks/lookups/useLookups.ts delete mode 100644 frontend/src/store/hooks/network/index.ts delete mode 100644 frontend/src/store/hooks/network/useNetwork.ts delete mode 100644 frontend/src/store/hooks/projects/index.ts delete mode 100644 frontend/src/store/hooks/projects/useProjectDisposal.ts delete mode 100644 frontend/src/store/hooks/projects/useProjectStatus.ts delete mode 100644 frontend/src/store/hooks/projects/useProjectWorkflow.ts delete mode 100644 frontend/src/store/hooks/properties/index.ts delete mode 100644 frontend/src/store/hooks/properties/useProperties.ts delete mode 100644 frontend/src/store/index.ts delete mode 100644 frontend/src/store/rootReducer.ts delete mode 100644 frontend/src/store/slices/accessRequestSlice.spec.ts delete mode 100644 frontend/src/store/slices/accessRequestSlice.ts delete mode 100644 frontend/src/store/slices/agenciesSlice.ts delete mode 100644 frontend/src/store/slices/agencySlice.spec.ts delete mode 100644 frontend/src/store/slices/agencySlice.ts delete mode 100644 frontend/src/store/slices/filterSlice.spec.ts delete mode 100644 frontend/src/store/slices/filterSlice.ts delete mode 100644 frontend/src/store/slices/hooks/agencyActionCreator.ts delete mode 100644 frontend/src/store/slices/hooks/buildingActionCreator.ts delete mode 100644 frontend/src/store/slices/hooks/index.ts delete mode 100644 frontend/src/store/slices/hooks/lookupCodeActionCreator.spec.ts delete mode 100644 frontend/src/store/slices/hooks/lookupCodeActionCreator.ts delete mode 100644 frontend/src/store/slices/hooks/parcelsActionCreator.spec.ts delete mode 100644 frontend/src/store/slices/hooks/parcelsActionCreator.ts delete mode 100644 frontend/src/store/slices/hooks/propertyActionCreator.ts delete mode 100644 frontend/src/store/slices/hooks/useAccessRequest.spec.tsx delete mode 100644 frontend/src/store/slices/hooks/useAccessRequest.ts delete mode 100644 frontend/src/store/slices/hooks/useNetworkStore.ts delete mode 100644 frontend/src/store/slices/hooks/useProjectStore.ts delete mode 100644 frontend/src/store/slices/hooks/usersActionCreator.spec.ts delete mode 100644 frontend/src/store/slices/hooks/usersActionCreator.ts delete mode 100644 frontend/src/store/slices/index.ts delete mode 100644 frontend/src/store/slices/jwtSlice.spec.ts delete mode 100644 frontend/src/store/slices/jwtSlice.ts delete mode 100644 frontend/src/store/slices/keycloakReadySlice.spec.ts delete mode 100644 frontend/src/store/slices/keycloakReadySlice.ts delete mode 100644 frontend/src/store/slices/leafletMouseSlice.spec.ts delete mode 100644 frontend/src/store/slices/leafletMouseSlice.ts delete mode 100644 frontend/src/store/slices/lookupCodeSlice.spec.ts delete mode 100644 frontend/src/store/slices/lookupCodeSlice.ts delete mode 100644 frontend/src/store/slices/mapViewSlice.spec.ts delete mode 100644 frontend/src/store/slices/mapViewZoomSlice.ts delete mode 100644 frontend/src/store/slices/networkSlice.spec.ts delete mode 100644 frontend/src/store/slices/networkSlice.ts delete mode 100644 frontend/src/store/slices/parcelLayerDataSlice.spec.ts delete mode 100644 frontend/src/store/slices/parcelLayerDataSlice.ts delete mode 100644 frontend/src/store/slices/parcelSlice.spec.ts delete mode 100644 frontend/src/store/slices/parcelSlice.ts delete mode 100644 frontend/src/store/slices/projectSlice.ts delete mode 100644 frontend/src/store/slices/userSlice.spec.ts delete mode 100644 frontend/src/store/slices/userSlice.ts delete mode 100644 frontend/src/store/store.ts delete mode 100644 frontend/src/styles.scss delete mode 100644 frontend/src/tabs.scss delete mode 100644 frontend/src/types/react-table.d.ts delete mode 100644 frontend/src/typings/tiles-in-bbox/index.d.ts delete mode 100644 frontend/src/useKeycloakWrapperMock.ts delete mode 100644 frontend/src/utils/CommonFunctions.ts delete mode 100644 frontend/src/utils/KeycloakEventHandler.test.ts delete mode 100644 frontend/src/utils/KeycloakEventHandler.ts delete mode 100644 frontend/src/utils/YupSchema.ts delete mode 100644 frontend/src/utils/createNumberMask.test.ts delete mode 100644 frontend/src/utils/createNumberMask.ts delete mode 100644 frontend/src/utils/csvToPropertyModel.test.ts delete mode 100644 frontend/src/utils/csvToPropertyModel.ts delete mode 100644 frontend/src/utils/download.ts delete mode 100644 frontend/src/utils/formUtils.ts delete mode 100644 frontend/src/utils/formatAddress.ts delete mode 100644 frontend/src/utils/formatCurrency.ts delete mode 100644 frontend/src/utils/formatGuid.ts delete mode 100644 frontend/src/utils/fromQueryString.ts delete mode 100644 frontend/src/utils/index.ts delete mode 100644 frontend/src/utils/mapLookupCode.ts delete mode 100644 frontend/src/utils/numberFormatUtils.ts delete mode 100644 frontend/src/utils/postalCodeFormatter.ts delete mode 100644 frontend/src/utils/storageUtils.ts delete mode 100644 frontend/src/utils/testUtils.tsx delete mode 100644 frontend/src/utils/toQueryString.ts delete mode 100644 frontend/src/utils/utils.test.ts delete mode 100644 frontend/src/utils/utils.ts delete mode 100644 frontend/tsconfig.json delete mode 100644 frontend/vite.config.ts delete mode 100644 maintenance/.editorconfig delete mode 100644 maintenance/BACKUP.md delete mode 100644 maintenance/Caddyfile delete mode 100644 maintenance/README.md delete mode 100644 maintenance/RESTORE_BACKUPS.md delete mode 100644 maintenance/maintenance.html delete mode 100755 maintenance/maintenance.sh delete mode 100644 nginx/Dockerfile.maintenance delete mode 100644 nginx/config/maintenance.conf delete mode 100644 nginx/html/50x.html delete mode 100644 nginx/html/index.html delete mode 100644 omnisharp.json delete mode 100644 openshift/4.0/README.md delete mode 100644 openshift/4.0/templates/api/README.md delete mode 100644 openshift/4.0/templates/api/build.yaml delete mode 100644 openshift/4.0/templates/api/deploy-alt-routes.yaml delete mode 100644 openshift/4.0/templates/api/deploy-routes.yaml delete mode 100644 openshift/4.0/templates/api/deploy-swagger.yaml delete mode 100644 openshift/4.0/templates/api/deploy.yaml delete mode 100644 openshift/4.0/templates/app/README.md delete mode 100644 openshift/4.0/templates/app/build.yaml delete mode 100644 openshift/4.0/templates/app/deploy-alt-routes.yaml delete mode 100644 openshift/4.0/templates/app/deploy-routes.yaml delete mode 100644 openshift/4.0/templates/app/deploy.yaml delete mode 100644 openshift/4.0/templates/app/pvc.yaml delete mode 100644 openshift/4.0/templates/backup/README.md delete mode 100644 openshift/4.0/templates/backup/build.yaml delete mode 100644 openshift/4.0/templates/backup/deploy.yaml delete mode 100644 openshift/4.0/templates/base-images/dotnet-31.yaml delete mode 100644 openshift/4.0/templates/base-images/mssql-2019.yaml delete mode 100644 openshift/4.0/templates/base-images/nodejs-10-rhel7.yaml delete mode 100644 openshift/4.0/templates/base-images/nodejs-16.yaml delete mode 100644 openshift/4.0/templates/database/README.md delete mode 100644 openshift/4.0/templates/database/busybox.yaml delete mode 100644 openshift/4.0/templates/database/mssql-build.yaml delete mode 100644 openshift/4.0/templates/database/mssql-deploy.yaml delete mode 100644 openshift/4.0/templates/images/docker-repo.yaml delete mode 100644 openshift/4.0/templates/kubernetes-network-policy/deny-all-traffic.yaml delete mode 100644 openshift/4.0/templates/kubernetes-network-policy/internet-to-routes.yaml delete mode 100644 openshift/4.0/templates/kubernetes-network-policy/nsp-tools.yaml delete mode 100644 openshift/4.0/templates/kubernetes-network-policy/nsp.yaml delete mode 100644 openshift/4.0/templates/kubernetes-network-policy/pod-from-pod.yaml delete mode 100644 openshift/4.0/templates/maintenance/README.md delete mode 100644 openshift/4.0/templates/maintenance/caddy.bc.yaml delete mode 100644 openshift/4.0/templates/maintenance/caddy.dc.yaml delete mode 100644 openshift/4.0/templates/maintenance/caddy.s2i.bc.yaml delete mode 100644 openshift/4.0/templates/migrations/README.md delete mode 100644 openshift/4.0/templates/migrations/build.yaml delete mode 100644 openshift/4.0/templates/migrations/migration-job.yaml delete mode 100644 openshift/4.0/templates/network-security-policy/README.md delete mode 100644 openshift/4.0/templates/network-security-policy/ingress-permissive.yaml delete mode 100644 openshift/4.0/templates/network-security-policy/internal-k8s-api.yaml delete mode 100644 openshift/4.0/templates/network-security-policy/internet-to-pod.yaml delete mode 100644 openshift/4.0/templates/network-security-policy/nsp-tools.yaml delete mode 100644 openshift/4.0/templates/network-security-policy/nsp.yaml delete mode 100644 openshift/4.0/templates/network-security-policy/pod-to-internet.yaml delete mode 100644 openshift/4.0/templates/network-security-policy/pod-to-pod.yaml delete mode 100644 openshift/4.0/templates/network-security-policy/pod-to-project.yaml delete mode 100644 openshift/4.0/templates/network-security-policy/project-to-project.yaml delete mode 100644 openshift/4.0/templates/network-security-policy/service-account-to-k8s-api.yaml delete mode 100644 openshift/4.0/templates/nginx/build.yaml delete mode 100644 openshift/4.0/templates/nginx/deploy.yaml delete mode 100644 openshift/4.0/templates/nginx/route.yaml delete mode 100644 openshift/4.0/templates/rolebindings/citz-imb-github-edit.yaml delete mode 100644 openshift/4.0/templates/rolebindings/citz-imb-idir-admin.yaml delete mode 100644 openshift/4.0/templates/rolebindings/citz-imb-idir-edit.yaml delete mode 100644 openshift/4.0/templates/tekton/conditions/param-has-value.yaml delete mode 100644 openshift/4.0/templates/tekton/conditions/param-is-true.yaml delete mode 100644 openshift/4.0/templates/tekton/pipelines/api-only.yaml delete mode 100644 openshift/4.0/templates/tekton/pipelines/app-only.yaml delete mode 100644 openshift/4.0/templates/tekton/pipelines/backup-database.yaml delete mode 100644 openshift/4.0/templates/tekton/pipelines/complete.yaml delete mode 100644 openshift/4.0/templates/tekton/pipelines/db-migration.yaml delete mode 100644 openshift/4.0/templates/tekton/pipelines/deploy.yaml delete mode 100644 openshift/4.0/templates/tekton/pipelines/redirect-route.yaml delete mode 100644 openshift/4.0/templates/tekton/service-account/role.yaml delete mode 100644 openshift/4.0/templates/tekton/service-account/service-account.yaml delete mode 100644 openshift/4.0/templates/tekton/tasks/db-migration.yaml delete mode 100644 openshift/4.0/templates/tekton/tasks/oc-backup.yaml delete mode 100644 openshift/4.0/templates/tekton/tasks/oc-build.yaml delete mode 100644 openshift/4.0/templates/tekton/tasks/oc-deploy-with-tag.yaml delete mode 100644 openshift/4.0/templates/tekton/tasks/oc-update-route.yaml delete mode 100644 openshift/4.0/templates/tekton/tasks/owasp-scanner.yaml delete mode 100644 openshift/4.0/templates/tekton/triggers/git-binding.yaml delete mode 100644 openshift/4.0/templates/tekton/triggers/git-eventlistener.yaml delete mode 100644 openshift/4.0/templates/tekton/triggers/git-ingress.yaml delete mode 100644 openshift/4.0/templates/tekton/triggers/git-triggertemplate.yaml delete mode 100644 openshift/4.0/templates/tekton/triggers/git-webhook-secret.yaml delete mode 100644 openshift/4.0/templates/tekton/triggers/route.yaml delete mode 100644 openshift/4.0/templates/tekton/triggers/setup.sh delete mode 100644 openshift/BASE_IMAGES.md delete mode 100644 openshift/MULTIPLE_INSTANCES.md delete mode 100644 openshift/OBJECTS.md delete mode 100644 openshift/PIPELINES.md delete mode 100644 openshift/README.md delete mode 100644 openshift/SECRETS.md delete mode 100644 openshift/SSL_CERTIFICATES.md delete mode 100644 openshift/ZAP.md delete mode 100644 openshift/s2i/README.md delete mode 100644 openshift/s2i/bcgov-s2i-caddy/bcgov-s2i-caddy.yaml delete mode 100644 openshift/s2i/nginx-runtime/Dockerfile delete mode 100644 openshift/s2i/nginx-runtime/nginx-runtime.yaml delete mode 100644 openshift/s2i/nginx-runtime/nginx.conf.template delete mode 100644 openshift/s2i/nginx-runtime/s2i/bin/assemble delete mode 100644 openshift/s2i/nginx-runtime/s2i/bin/assemble-runtime delete mode 100644 openshift/s2i/nginx-runtime/s2i/bin/run delete mode 100644 openshift/templates/api-dc-template.yaml delete mode 100644 openshift/templates/api-v2-dc-template.yaml delete mode 100644 openshift/templates/app-dc-template.yaml delete mode 100644 openshift/templates/app-v2-dc-template.yaml delete mode 100644 scripts/README.md delete mode 100755 scripts/build.sh delete mode 100755 scripts/clean.sh delete mode 100755 scripts/db-migration.sh delete mode 100644 scripts/gen-env-files.sh delete mode 100755 scripts/start-dev.sh delete mode 100755 scripts/start.sh delete mode 100755 scripts/test-api.sh delete mode 100755 scripts/test-app.sh delete mode 100644 test/Integration/SubmitDeleteProperty.py delete mode 100644 test/Postman/README.md delete mode 100644 test/Postman/pims-api-collection.json delete mode 100644 tools/converters/excel/.editorconfig delete mode 100644 tools/converters/excel/.gitignore delete mode 100644 tools/converters/excel/Configuration/ActionArgumentOptions.cs delete mode 100644 tools/converters/excel/Configuration/ActionOptions.cs delete mode 100644 tools/converters/excel/Configuration/ColumnOptions.cs delete mode 100644 tools/converters/excel/Configuration/ConvertWhenOption.cs delete mode 100644 tools/converters/excel/Configuration/ConverterOptions.cs delete mode 100644 tools/converters/excel/Configuration/GeocoderOptions.cs delete mode 100644 tools/converters/excel/Configuration/RowOptions.cs delete mode 100644 tools/converters/excel/Configuration/SkipOption.cs delete mode 100644 tools/converters/excel/Configuration/SourceOptions.cs delete mode 100644 tools/converters/excel/Configuration/ValueSwitchOptions.cs delete mode 100644 tools/converters/excel/Converter.cs delete mode 100644 tools/converters/excel/Converters/GeoLocationConverter.cs delete mode 100644 tools/converters/excel/Converters/IGeoLocationConverter.cs delete mode 100644 tools/converters/excel/Converters/StringConverters.cs delete mode 100644 tools/converters/excel/Extensions/TypeExtensions.cs delete mode 100644 tools/converters/excel/IConverter.cs delete mode 100644 tools/converters/excel/Makefile delete mode 100644 tools/converters/excel/Models/AddressModel.cs delete mode 100644 tools/converters/excel/Models/AddressModelMap.cs delete mode 100644 tools/converters/excel/Pims.Tools.Converters.ExcelConverter.csproj delete mode 100644 tools/converters/excel/Pims.Tools.Converters.ExcelConverter.sln delete mode 100644 tools/converters/excel/Program.cs delete mode 100644 tools/converters/excel/README.md delete mode 100644 tools/converters/excel/Startup.cs delete mode 100644 tools/converters/excel/appsettings.Development.json delete mode 100644 tools/converters/excel/appsettings.Local.json delete mode 100644 tools/converters/excel/appsettings.Production.json delete mode 100644 tools/converters/excel/appsettings.Test.json delete mode 100644 tools/converters/excel/appsettings.json delete mode 100644 tools/core/Configuration/RequestOptions.cs delete mode 100644 tools/core/IRequestClient.cs delete mode 100644 tools/core/Keycloak/Configuration/KeycloakAdminOptions.cs delete mode 100644 tools/core/Keycloak/Configuration/KeycloakOptions.cs delete mode 100644 tools/core/Keycloak/IKeycloakRequestClient.cs delete mode 100644 tools/core/Keycloak/KeycloakRequestClient.cs delete mode 100644 tools/core/Keycloak/Models/ClientModel.cs delete mode 100644 tools/core/Keycloak/Models/GroupModel.cs delete mode 100644 tools/core/Keycloak/Models/ProtocolMapperModel.cs delete mode 100644 tools/core/Keycloak/Models/RealmModel.cs delete mode 100644 tools/core/Keycloak/Models/RoleModel.cs delete mode 100644 tools/core/Keycloak/Models/UserModel.cs delete mode 100644 tools/core/Pims.Tools.Core.csproj delete mode 100644 tools/core/RequestClient.cs delete mode 100644 tools/dbeaver/data-sources.json delete mode 100644 tools/dbeaver/tasks.json delete mode 100644 tools/projectTaskUpdate/taskUpdate.ts delete mode 100644 tools/rocketchat/incoming.js delete mode 100644 tools/rocketchat/outgoing.js delete mode 100644 tools/usernameUpdater/.env-template delete mode 100644 tools/usernameUpdater/README.md delete mode 100644 tools/usernameUpdater/package.json delete mode 100644 tools/usernameUpdater/src/UserEntity.ts delete mode 100644 tools/usernameUpdater/src/appDataSource.ts delete mode 100644 tools/usernameUpdater/src/updateUsernames.ts delete mode 100644 tools/usernameUpdater/tsconfig.json diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 0a71e657d6..0000000000 --- a/.editorconfig +++ /dev/null @@ -1,25 +0,0 @@ -# EditorConfig is awesome: https://EditorConfig.org - -root = true - -[*] -end_of_line = lf -trim_trailing_whitespace = true -insert_final_newline = true - -[*.ts] -indent_style = space - -[*.cs] -indent_size = 4 - -[{*.json,*.md,*.yml,*.groovy,Jenkinsfile*}] -indent_style = space -indent_size = 2 - -[*.env] -insert_final_newline = false - -[{Makefile,**.mk}] -# Use tabs for indentation (Makefiles require tabs) -indent_style = tab diff --git a/.env-template b/.env-template index cb3f236c92..75dcba021a 100644 --- a/.env-template +++ b/.env-template @@ -1,10 +1,3 @@ -# Old PIMS -DATABASE_PORT= -API_HTTPS_PORT= -API_PROXY_PORT= -API_SERVICE_NAME= -APP_HTTP_PORT= - # Old and New PIMS API_HTTP_PORT= diff --git a/.github/labeler.yaml b/.github/labeler.yaml index a5385e8357..753cb275a8 100644 --- a/.github/labeler.yaml +++ b/.github/labeler.yaml @@ -21,22 +21,11 @@ Dependencies: Documentation: - '**/*.md' -################# -# DotNet backend -DotNet: - - backend/**/* - -Migrations: - - backend/dal/Migrations/**/* ################# # React frontend React: - - frontend/**/* - -Styles: - - frontend/**/*.css - - frontend/**/*.scss + - react-app/**/* ################ # Express API @@ -49,16 +38,5 @@ TypeORM: ################# # Testing Tests: - - frontend/**/*.test.* - - frontend/**/*.spec.* - - backend/**/*.Test.* - -Cypress: - - any: ['frontend/cypress/**/*', 'frontend/cypress.*'] - all: ['!frontend/cypress/e2e/**/*', '!frontend/cypress/component/**/*'] - -'Cypress E2E': - - frontend/cypress/e2e/**/* - -'Cypress Component': - - frontend/component/**/* + - express-api/tests/**/* + - react-app/tests/**/* diff --git a/.github/workflows/DEV-Api-image-deploy.yml b/.github/workflows/DEV-Api-image-deploy.yml deleted file mode 100644 index 09b391aa2e..0000000000 --- a/.github/workflows/DEV-Api-image-deploy.yml +++ /dev/null @@ -1,181 +0,0 @@ -# GitHub Actions workflow for deploying API image on PR merge to main branch -name: DEV API-Image Deploy on PR merge - -on: - pull_request: - types: - - closed - branches: [main] - paths: - - 'backend/**' # Triggers on changes to files in the backend/ directory. - - workflow_dispatch: - inputs: - image_tag: - description: 'Image Tag to deploy' - required: true - - migration_tag: - description: 'DataBase Migration Tag, if needed' - required: false - -env: - IMAGE_TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.image_tag || github.event.pull_request.number }} - MIGRATION_IMAGE : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.migration_tag || github.event.pull_request.number }} - -jobs: - # Job to deploy API image to OpenShift - Deploy-To-OpenShift: - if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged }} - name: Deploy to OpenShift - runs-on: ubuntu-latest - outputs: - migration: ${{ steps.migration.outputs.migration_needed }} - steps: - # Checkout the repository - - name: Checkout Repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - # Check for migration files - - name: Check for migration files - if: ${{ github.event_name != 'workflow_dispatch'}} - id: migration - run: | - if git diff --name-only origin/main HEAD~1 | grep -q "backend/dal/Migrations"; then - echo "migration_needed=true" >> $GITHUB_OUTPUT - else - echo "migration_needed=false" >> $GITHUB_OUTPUT - fi - - - name: Login to OpenShift - uses: redhat-actions/oc-login@v1 - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }} - openshift_token: ${{ secrets.OPENSHIFT_SA_DEV_TOKEN }} - namespace: ${{ secrets.OPENSHIFT_DEV_NAMESPACE }} - - # run migration if needed - - name: Migration Run - if: github.event.inputs.migration_tag || steps.migration.outputs.migration_needed == 'true' - env: - NAMESPACE: "${{ secrets.OPENSHIFT_DEV_NAMESPACE }}" - TOOLS_NAMESPACE: "${{ secrets.OPENSHIFT_TOOLS_NAMESPACE }}" - IMAGE_REPOSITORY : ${{ secrets.PUBLIC_IMAGE_REPOSITORY }} - IMAGE_TAG: ${{ env.MIGRATION_IMAGE }} - MIGRATION_IMAGE: "pims-migrations" - DB_NAME: "pims-database" - run: | - ./.github/helpers/migrations.sh - - # Process and Apply API DeploymentConfig - - name: Process and Apply API DeploymentConfig - env: - NAMESPACE: '${{ secrets.OPENSHIFT_DEV_NAMESPACE }}' - DC_TEMPLATE: 'api-dc-template.yaml' - IMAGE_TAG: ${{ env.IMAGE_TAG }} - ENVIRONMENT: 'dev' - ASPNETCORE_ENVIRONMENT: 'Development' - EMAIL_AUTHORIZED: 'false' - APPLICATION_NAME: 'pims-api' - LICENSE_PLATE: '${{ secrets.LICENSE_PLATE }}' - run: | - ./.github/helpers/deploy.sh - - # Job to check the health of the deployed API - Health-Check: - name: Check Deployment Health - runs-on: ubuntu-latest - needs: [Deploy-To-OpenShift] - steps: - # Login to OpenShift - - name: Login to OpenShift - uses: redhat-actions/oc-login@v1 - env: - OPENSHIFT_USER: github-actions - OPENSHIFT_PROJECT: ${{ secrets.OPENSHIFT_DEV_NAMESPACE }} - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }} - openshift_token: ${{ secrets.OPENSHIFT_SA_DEV_TOKEN }} - namespace: ${{ secrets.OPENSHIFT_DEV_NAMESPACE }} - - # Check Deployment Status - - name: Check Deployment Status - run: | - oc rollout status -n ${{ secrets.OPENSHIFT_DEV_NAMESPACE }} dc/pims-api --watch - - # Job to clean up previous objects in OpenShift - Clean-Up: - name: Clean Up - runs-on: ubuntu-latest - needs: [Health-Check] - steps: - # Login to OpenShift - - name: Login to OpenShift - uses: redhat-actions/oc-login@v1 - env: - OPENSHIFT_USER: github-actions - OPENSHIFT_PROJECT: ${{ secrets.OPENSHIFT_DEV_NAMESPACE }} - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }} - openshift_token: ${{ secrets.OPENSHIFT_SA_DEV_TOKEN }} - namespace: ${{ secrets.OPENSHIFT_DEV_NAMESPACE }} - - # Remove previous objects - - name: Remove previous objects - run: | - oc delete pod -n ${{ secrets.OPENSHIFT_DEV_NAMESPACE }} --field-selector status.phase=Succeeded - - # Remove previous replication controllers - - name: Remove previous replication controllers - run: | - oc delete rc -n ${{ secrets.OPENSHIFT_DEV_NAMESPACE }} --field-selector status.replicas=0 - - # Job to update the wiki with deployed image tag information - Update_Wiki_Tags: - needs: [Health-Check, Deploy-To-OpenShift] - name: Update table in wiki - runs-on: ubuntu-latest - env: - GH_TOKEN: ${{ github.token }} - - steps: - # Checkout the repository - - name: Checkout - uses: actions/checkout@v3 - - # Clone wiki repository - - name: Clone wiki repository - run: | - echo "Cloning wiki repo https://github.com/$GITHUB_REPOSITORY.wiki.git" - git clone "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" ./wiki - - # Setup Python - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - # Run update wiki python script - - name: Run update wiki python script - run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md API "Deployed Image Tag in DEV" "${{ env.IMAGE_TAG }}" - - # Run update wiki python script for Migration If needed - - name: Update wiki for Migration If needed - if: github.event.inputs.migration_tag || needs.Deploy-To-OpenShift.outputs.migration == 'true' - run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md MIGRATION "Deployed Image Tag in DEV" "${{ env.MIGRATION_IMAGE }}" - - # Commit and push changes to wiki - - name: Commit and push changes to wiki - run: | - cd ./wiki - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - git add . - if git diff-index --quiet HEAD; then - echo "Nothing changed" - exit 0 - fi - echo "Pushing changes to wiki" - git commit -m "Value populated at Deploy API" && git push "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" diff --git a/.github/workflows/DEV-App-image-build.yml b/.github/workflows/DEV-App-image-build.yml deleted file mode 100644 index 8502554f9a..0000000000 --- a/.github/workflows/DEV-App-image-build.yml +++ /dev/null @@ -1,105 +0,0 @@ -# GitHub Actions workflow for building and tagging the APP image on PR -name: DEV APP-:Image Build on PR - -on: - pull_request: - types: [opened, synchronize, ready_for_review] # Triggered by opened or changed pull requests. - branches: [main] - paths: - - 'frontend/**' # Triggers on changes to files in the frontend/ directory. - -jobs: - # Job to build, tag, and push the APP image - PIMS-APP-Build-Tag-Push: - environment: dev - runs-on: ubuntu-latest - steps: - # Checkout the repository - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - # Login to the Openshift Cluster - - name: Login to Openshift - uses: redhat-actions/oc-login@v1 - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }} - openshift_token: ${{ secrets.OPENSHIFT_SA_TOOLS_TOKEN }} - namespace: ${{ secrets.OPENSHIFT_TOOLS_NAMESPACE }} - - # Login to BC Gov Docker Image Repository - - name: Login to Openshift Docker - run : | - docker login ${{ secrets.PUBLIC_IMAGE_REPOSITORY }} -u ${{ secrets.OPENSHIFT_SA_NAME }} -p ${{ secrets.OPENSHIFT_SA_TOOLS_TOKEN }} - - # Build the APP image - - name: Build APP Image - run: | - docker-compose -f docker-compose.prod.yml build frontend - - # Tag the APP image - - name: Tag APP Image - run: | - docker tag pims_frontend ${{ secrets.PUBLIC_IMAGE_REPOSITORY }}/${{ secrets.OPENSHIFT_TOOLS_NAMESPACE }}/pims-app:${{github.event.pull_request.number}} - - # Push the APP image - - name: Push APP Image - run: | - docker push ${{ secrets.PUBLIC_IMAGE_REPOSITORY }}/${{ secrets.OPENSHIFT_TOOLS_NAMESPACE }}/pims-app:${{github.event.pull_request.number}} - - # Job to update the wiki with the latest build image tag information - Update_Wiki_Tags: - needs: [PIMS-APP-Build-Tag-Push] - name: Update table in wiki - runs-on: ubuntu-latest - env: - GH_TOKEN: ${{ github.token }} - - steps: - # Checkout the repository - - name: Checkout - uses: actions/checkout@v3 - - # Clone wiki repository - - name: Clone wiki repository - run: | - echo "Cloning wiki repo https://github.com/$GITHUB_REPOSITORY.wiki.git" - git clone "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" ./wiki - - # Setup Python - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - # Run update wiki python script - - name: Run update wiki python script - run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md APP "Latest Build Image Tag" "${{github.event.pull_request.number}}" - - # Commit and push changes to wiki - - name: Commit and push changes to wiki - run: | - cd ./wiki - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - git add . - if git diff-index --quiet HEAD; then - echo "Nothing changed" - exit 0 - fi - echo "Pushing changes to wiki" - git commit -m "Value populated at image build App" && git push "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" - - # Add Comment To the PR - - name: Add Comment To the PR - if: github.event.action == 'opened' - uses: actions/github-script@v6 - with: - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: "🚀 **Deployment Information**\n\nThe APP Image has been built with the tag: **`${{github.event.pull_request.number}}`**. Please make sure to utilize this specific tag when promoting these changes to the TEST and PROD environments during the APP deployment. For more updates please monitor [Image Tags](https://github.com/bcgov/PIMS/wiki/Image-tags) Page on Wiki." - }) diff --git a/.github/workflows/DEV-App-image-deploy.yml b/.github/workflows/DEV-App-image-deploy.yml deleted file mode 100644 index 423d5de483..0000000000 --- a/.github/workflows/DEV-App-image-deploy.yml +++ /dev/null @@ -1,143 +0,0 @@ -# GitHub Actions workflow for deploying APP image on PR merge to main branch -name: DEV APP-Image Deploy on PR merge - -on: - pull_request: - types: - - closed - branches: [main] - paths: - - 'frontend/**' # Triggers on changes to files in the frontend/ directory. - workflow_dispatch: - inputs: - image_tag: - description: 'Image Tag to deploy' - required: true - -env: - IMAGE_TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.image_tag || github.event.pull_request.number }} - - -jobs: - # Job to deploy APP image to OpenShift - Deploy-To-OpenShift: - if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged }} - name: Deploy to OpenShift - runs-on: ubuntu-latest - - steps: - # Checkout the repository - - name: Checkout Repository - uses: actions/checkout@v3 - - # Login to OpenShift - - name: Login to OpenShift - uses: redhat-actions/oc-login@v1 - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }} - openshift_token: ${{ secrets.OPENSHIFT_SA_DEV_TOKEN }} - namespace: ${{ secrets.OPENSHIFT_DEV_NAMESPACE }} - - # Process and Apply APP DeploymentConfig - - name: Process and Apply APP DeploymentConfig - env: - NAMESPACE: "${{ secrets.OPENSHIFT_DEV_NAMESPACE }}" - DC_TEMPLATE: "app-dc-template.yaml" - IMAGE_TAG: ${{ env.IMAGE_TAG }} - ENVIRONMENT: "dev" - APPLICATION_NAME: "pims-app" - LICENSE_PLATE: "${{ secrets.LICENSE_PLATE }}" - run: | - ./.github/helpers/deploy.sh - - # Job to check the health of the deployed APP - Health-Check: - name: Check Deployment Health - runs-on: ubuntu-latest - needs: [ Deploy-To-OpenShift ] - steps: - # Login to OpenShift - - name: Login to OpenShift - uses: redhat-actions/oc-login@v1 - env: - OPENSHIFT_USER: github-actions - OPENSHIFT_PROJECT: ${{ secrets.OPENSHIFT_DEV_NAMESPACE }} - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }} - openshift_token: ${{ secrets.OPENSHIFT_SA_DEV_TOKEN }} - namespace: ${{ secrets.OPENSHIFT_DEV_NAMESPACE }} - - # Check Deployment Status - - name: Check Deployment Status - run: | - oc rollout status -n ${{ secrets.OPENSHIFT_DEV_NAMESPACE }} dc/pims-app --watch - - # Job to clean up previous objects in OpenShift - Clean-Up: - name: Clean Up - runs-on: ubuntu-latest - needs: [ Health-Check ] - steps: - # Login to OpenShift - - name: Login to OpenShift - uses: redhat-actions/oc-login@v1 - env: - OPENSHIFT_USER: github-actions - OPENSHIFT_PROJECT: ${{ secrets.OPENSHIFT_DEV_NAMESPACE }} - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }} - openshift_token: ${{ secrets.OPENSHIFT_SA_DEV_TOKEN }} - namespace: ${{ secrets.OPENSHIFT_DEV_NAMESPACE }} - - # Remove previous objects - - name: Remove previous objects - run: | - oc delete pod -n ${{ secrets.OPENSHIFT_DEV_NAMESPACE }} --field-selector status.phase=Succeeded - - # Remove previous replication controllers - - name: Remove previous replication controllers - run: | - oc delete rc -n ${{ secrets.OPENSHIFT_DEV_NAMESPACE }} --field-selector status.replicas=0 - - # Job to update the wiki with deployed image tag information - Update_Wiki_Tags: - needs: [ Health-Check ] - name: Update table in wiki - runs-on: ubuntu-latest - env: - GH_TOKEN: ${{ github.token }} - - steps: - # Checkout the repository - - name: Checkout - uses: actions/checkout@v3 - - # Clone wiki repository - - name: Clone wiki repository - run: | - echo "Cloning wiki repo https://github.com/$GITHUB_REPOSITORY.wiki.git" - git clone "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" ./wiki - - # Setup Python - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - # Run update wiki python script - - name: Run update wiki python script - run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md APP "Deployed Image Tag in DEV" "${{ env.IMAGE_TAG }}" - - # Commit and push changes to wiki - - name: Commit and push changes to wiki - run: | - cd ./wiki - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - git add . - if git diff-index --quiet HEAD; then - echo "Nothing changed" - exit 0 - fi - echo "Pushing changes to wiki" - git commit -m "Value populated at Deploy App" && git push "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" diff --git a/.github/workflows/DEV-api-image-build.yml b/.github/workflows/DEV-api-image-build.yml deleted file mode 100644 index bbe9a0246f..0000000000 --- a/.github/workflows/DEV-api-image-build.yml +++ /dev/null @@ -1,137 +0,0 @@ -# GitHub Actions workflow for building and tagging the API image on PR -name: DEV API-:Image Build on PR - -on: - pull_request: - types: [opened, synchronize, ready_for_review] # Triggered by opened or changed pull requests. - branches: [main] - paths: - - 'backend/**' # Triggers on changes to files in the frontend/ directory. - -jobs: - PIMS-API-Build-Tag-Push: - environment: dev - runs-on: ubuntu-latest - outputs: - migration: ${{ steps.migration.outputs.migration_needed }} - steps: - # check out the repo - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - # login to the Openshift Cluster - - name: Login to Openshift - uses: redhat-actions/oc-login@v1 - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }} - openshift_token: ${{ secrets.OPENSHIFT_SA_TOOLS_TOKEN }} - namespace: ${{ secrets.OPENSHIFT_TOOLS_NAMESPACE }} - - # Login to BC Gov Docker Image Repository - - name: Login to Openshift Docker - run: | - docker login ${{ secrets.PUBLIC_IMAGE_REPOSITORY }} -u ${{ secrets.OPENSHIFT_SA_NAME }} -p ${{ secrets.OPENSHIFT_SA_TOOLS_TOKEN }} - - # Build the API Image - - name: Build API Image - run: | - docker-compose -f docker-compose.prod.yml build backend - - # Tag the API Image with the PR number - - name: Tag API Image - run: | - docker tag pims_backend ${{ secrets.PUBLIC_IMAGE_REPOSITORY }}/${{ secrets.OPENSHIFT_TOOLS_NAMESPACE }}/pims-api:${{github.event.pull_request.number}} - - # Check for migration files - - name: Check for migration files - id: migration - run: | - if git diff --name-only HEAD~1 | grep -q "backend/dal/Migrations"; then - echo "migration_needed=true" >> $GITHUB_OUTPUT - else - echo "migration_needed=false" >> $GITHUB_OUTPUT - fi - - # if migration files have changed, build the migration image - - name: Build Migration Image - if: steps.migration.outputs.migration_needed == 'true' - run: | - docker-compose -f docker-compose.prod.yml build migration - - - name: Tag Migration Image - if: steps.migration.outputs.migration_needed == 'true' - run: | - docker tag pims_migration ${{ secrets.PUBLIC_IMAGE_REPOSITORY }}/${{ secrets.OPENSHIFT_TOOLS_NAMESPACE }}/pims-migrations:${{github.event.pull_request.number}} - - # push the migration image - - name: Push Migration Image - if: steps.migration.outputs.migration_needed == 'true' - run: | - docker push ${{ secrets.PUBLIC_IMAGE_REPOSITORY }}/${{ secrets.OPENSHIFT_TOOLS_NAMESPACE }}/pims-migrations:${{github.event.pull_request.number}} - - # Push the API Image - - name: Push API Image - run: | - docker push ${{ secrets.PUBLIC_IMAGE_REPOSITORY }}/${{ secrets.OPENSHIFT_TOOLS_NAMESPACE }}/pims-api:${{github.event.pull_request.number}} - - Update_Wiki_Tags: - needs: [PIMS-API-Build-Tag-Push] - name: Update table in wiki - runs-on: ubuntu-latest - env: - GH_TOKEN: ${{ github.token }} - - steps: - # Checkout the repository - - name: Checkout - uses: actions/checkout@v3 - - # Clone the wiki repository - - name: Clone wiki repository - run: | - echo "Cloning wiki repo https://github.com/$GITHUB_REPOSITORY.wiki.git" - git clone "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" ./wiki - - # Setup Python - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - # Run the update wiki Python script - - name: Run update wiki Python script - run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md API "Latest Build Image Tag" "${{github.event.pull_request.number}}" - - - name: Update wiki for Migration - if: needs.PIMS-API-Build-Tag-Push.outputs.migration == 'true' - run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md MIGRATION "Latest Build Image Tag" "${{github.event.pull_request.number}}" - - # Commit and push changes to the wiki - - name: Commit and push changes to wiki - run: | - cd ./wiki - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - git add . - if git diff-index --quiet HEAD; then - echo "Nothing changed" - exit 0 - fi - echo "Pushing changes to wiki" - git commit -m "Value populated at image build API" && git push "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" - - # Add comment to the PR - - name: Add Comment To the PR - if: github.event.action == 'opened' - uses: actions/github-script@v6 - with: - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: "🚀 **Deployment Information**\n\nThe API Image has been built with the tag: **`${{github.event.pull_request.number}}`**. Please make sure to utilize this specific tag when promoting these changes to the TEST and PROD environments during the API deployment. For more updates please monitor [Image Tags](https://github.com/bcgov/PIMS/wiki/Image-tags) Page on Wiki." - }) - diff --git a/.github/workflows/PROD-Api-image-deploy.yml b/.github/workflows/PROD-Api-image-deploy.yml deleted file mode 100644 index 99a3b5622f..0000000000 --- a/.github/workflows/PROD-Api-image-deploy.yml +++ /dev/null @@ -1,163 +0,0 @@ -# GitHub Actions workflow for deploying API image to PROD env -name: PROD API-Image Deploy - -on: - workflow_dispatch: - inputs: - image_tag: - description: 'Image Tag to deploy' - required: true - - migration_tag: - description: 'DataBase Migration Tag, if needed' - required: false - -env: - IMAGE_TAG: ${{ github.event.inputs.image_tag }} - MIGRATION_IMAGE : ${{ github.event.inputs.migration_tag }} - ENVIRONMENT: 'prod' - OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_SA_PROD_TOKEN }} - - -jobs: - # Job to deploy API image to OpenShift - Deploy-To-OpenShift: - name: Deploy to OpenShift - runs-on: ubuntu-latest - steps: - # Checkout the repository - - name: Checkout Repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Login to OpenShift - uses: redhat-actions/oc-login@v1 - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }} - openshift_token: ${{env.OPENSHIFT_TOKEN}} - namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - - # run migration if needed - - name: Migration Run - if: github.event.inputs.migration_tag - env: - NAMESPACE: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - TOOLS_NAMESPACE: "${{ secrets.OPENSHIFT_TOOLS_NAMESPACE }}" - IMAGE_REPOSITORY : ${{ secrets.PUBLIC_IMAGE_REPOSITORY }} - IMAGE_TAG: ${{ env.MIGRATION_IMAGE }} - MIGRATION_IMAGE: "pims-migrations" - DB_NAME: "pims-database" - run: | - ./.github/helpers/migrations.sh - - # Process and Apply API DeploymentConfig - - name: Process and Apply API DeploymentConfig - env: - NAMESPACE: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - DC_TEMPLATE: 'api-dc-template.yaml' - IMAGE_TAG: ${{ env.IMAGE_TAG }} - ENVIRONMENT: ${{ env.ENVIRONMENT }} - ASPNETCORE_ENVIRONMENT: 'Production' - EMAIL_AUTHORIZED: 'true' - APPLICATION_NAME: 'pims-api' - LICENSE_PLATE: '${{ secrets.LICENSE_PLATE }}' - run: | - ./.github/helpers/deploy.sh - - # Job to check the health of the deployed API - Health-Check: - name: Check Deployment Health - runs-on: ubuntu-latest - needs: [Deploy-To-OpenShift] - steps: - # Login to OpenShift - - name: Login to OpenShift - uses: redhat-actions/oc-login@v1 - env: - OPENSHIFT_USER: github-actions - OPENSHIFT_PROJECT: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }} - openshift_token: ${{env.OPENSHIFT_TOKEN}} - namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - - # Check Deployment Status - - name: Check Deployment Status - run: | - oc rollout status -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} dc/pims-api --watch - - # Job to clean up previous objects in OpenShift - Clean-Up: - name: Clean Up - runs-on: ubuntu-latest - needs: [Health-Check] - steps: - # Login to OpenShift - - name: Login to OpenShift - uses: redhat-actions/oc-login@v1 - env: - OPENSHIFT_USER: github-actions - OPENSHIFT_PROJECT: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }} - openshift_token: ${{env.OPENSHIFT_TOKEN}} - namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - - # Remove previous objects - - name: Remove previous objects - run: | - oc delete pod -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} --field-selector status.phase=Succeeded - - # Remove previous replication controllers - - name: Remove previous replication controllers - run: | - oc delete rc -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} --field-selector status.replicas=0 - - # Job to update the wiki with deployed image tag information - Update_Wiki_Tags: - needs: [Health-Check, Deploy-To-OpenShift] - name: Update table in wiki - runs-on: ubuntu-latest - env: - GH_TOKEN: ${{ github.token }} - - steps: - # Checkout the repository - - name: Checkout - uses: actions/checkout@v3 - - # Clone wiki repository - - name: Clone wiki repository - run: | - echo "Cloning wiki repo https://github.com/$GITHUB_REPOSITORY.wiki.git" - git clone "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" ./wiki - - # Setup Python - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - # Run update wiki python script - - name: Run update wiki python script - run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md API "Deployed Image Tag in PROD" "${{ env.IMAGE_TAG }}" - - # Run update wiki python script for Migration If needed - - name: Update wiki for Migration If needed - if: github.event.inputs.migration_tag - run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md MIGRATION "Deployed Image Tag in PROD" "${{ env.MIGRATION_IMAGE }}" - - # Commit and push changes to wiki - - name: Commit and push changes to wiki - run: | - cd ./wiki - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - git add . - if git diff-index --quiet HEAD; then - echo "Nothing changed" - exit 0 - fi - echo "Pushing changes to wiki" - git commit -m "Value populated at Deploy API" && git push "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" diff --git a/.github/workflows/PROD-App-image-deploy.yml b/.github/workflows/PROD-App-image-deploy.yml deleted file mode 100644 index 941f857273..0000000000 --- a/.github/workflows/PROD-App-image-deploy.yml +++ /dev/null @@ -1,138 +0,0 @@ -# GitHub Actions workflow for deploying APP image to PROD env -name: PROD APP-Image Deploy - -on: - workflow_dispatch: - inputs: - image_tag: - description: 'Image Tag to deploy' - required: true - -env: - IMAGE_TAG: ${{ github.event.inputs.image_tag }} - ENVIRONMENT: 'prod' - OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_SA_PROD_TOKEN }} - - -jobs: - # Job to deploy APP image to OpenShift - Deploy-To-OpenShift: - name: Deploy to OpenShift - runs-on: ubuntu-latest - - steps: - # Checkout the repository - - name: Checkout Repository - uses: actions/checkout@v3 - - # Login to OpenShift - - name: Login to OpenShift - uses: redhat-actions/oc-login@v1 - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }} - openshift_token: ${{ env.OPENSHIFT_TOKEN }} - namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - - # Process and Apply APP DeploymentConfig - - name: Process and Apply APP DeploymentConfig - env: - NAMESPACE: "${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}" - DC_TEMPLATE: "app-dc-template.yaml" - IMAGE_TAG: ${{ env.IMAGE_TAG }} - ENVIRONMENT: ${{ env.ENVIRONMENT }} - APPLICATION_NAME: "pims-app" - LICENSE_PLATE: "${{ secrets.LICENSE_PLATE }}" - run: | - ./.github/helpers/deploy.sh - - # Job to check the health of the deployed APP - Health-Check: - name: Check Deployment Health - runs-on: ubuntu-latest - needs: [ Deploy-To-OpenShift ] - steps: - # Login to OpenShift - - name: Login to OpenShift - uses: redhat-actions/oc-login@v1 - env: - OPENSHIFT_USER: github-actions - OPENSHIFT_PROJECT: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }} - openshift_token: ${{ env.OPENSHIFT_TOKEN }} - namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - - # Check Deployment Status - - name: Check Deployment Status - run: | - oc rollout status -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} dc/pims-app --watch - - # Job to clean up previous objects in OpenShift - Clean-Up: - name: Clean Up - runs-on: ubuntu-latest - needs: [ Health-Check ] - steps: - # Login to OpenShift - - name: Login to OpenShift - uses: redhat-actions/oc-login@v1 - env: - OPENSHIFT_USER: github-actions - OPENSHIFT_PROJECT: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }} - openshift_token: ${{ env.OPENSHIFT_TOKEN }} - namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - - # Remove previous objects - - name: Remove previous objects - run: | - oc delete pod -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} --field-selector status.phase=Succeeded - - # Remove previous replication controllers - - name: Remove previous replication controllers - run: | - oc delete rc -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} --field-selector status.replicas=0 - - # Job to update the wiki with deployed image tag information - Update_Wiki_Tags: - needs: [ Health-Check ] - name: Update table in wiki - runs-on: ubuntu-latest - env: - GH_TOKEN: ${{ github.token }} - - steps: - # Checkout the repository - - name: Checkout - uses: actions/checkout@v3 - - # Clone wiki repository - - name: Clone wiki repository - run: | - echo "Cloning wiki repo https://github.com/$GITHUB_REPOSITORY.wiki.git" - git clone "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" ./wiki - - # Setup Python - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - # Run update wiki python script - - name: Run update wiki python script - run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md APP "Deployed Image Tag in PROD" "${{ env.IMAGE_TAG }}" - - # Commit and push changes to wiki - - name: Commit and push changes to wiki - run: | - cd ./wiki - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - git add . - if git diff-index --quiet HEAD; then - echo "Nothing changed" - exit 0 - fi - echo "Pushing changes to wiki" - git commit -m "Value populated at Deploy App" && git push "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" diff --git a/.github/workflows/TEST-Api-image-deploy.yml b/.github/workflows/TEST-Api-image-deploy.yml deleted file mode 100644 index d2185567db..0000000000 --- a/.github/workflows/TEST-Api-image-deploy.yml +++ /dev/null @@ -1,163 +0,0 @@ -# GitHub Actions workflow for deploying API image to TEST env -name: TEST API-Image Deploy - -on: - workflow_dispatch: - inputs: - image_tag: - description: 'Image Tag to deploy' - required: true - - migration_tag: - description: 'DataBase Migration Tag, if needed' - required: false - -env: - IMAGE_TAG: ${{ github.event.inputs.image_tag }} - MIGRATION_IMAGE : ${{ github.event.inputs.migration_tag }} - ENVIRONMENT: 'test' - OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_SA_TEST_TOKEN }} - - -jobs: - # Job to deploy API image to OpenShift - Deploy-To-OpenShift: - name: Deploy to OpenShift - runs-on: ubuntu-latest - steps: - # Checkout the repository - - name: Checkout Repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Login to OpenShift - uses: redhat-actions/oc-login@v1 - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }} - openshift_token: ${{env.OPENSHIFT_TOKEN}} - namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - - # run migration if needed - - name: Migration Run - if: github.event.inputs.migration_tag - env: - NAMESPACE: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - TOOLS_NAMESPACE: "${{ secrets.OPENSHIFT_TOOLS_NAMESPACE }}" - IMAGE_REPOSITORY : ${{ secrets.PUBLIC_IMAGE_REPOSITORY }} - IMAGE_TAG: ${{ env.MIGRATION_IMAGE }} - MIGRATION_IMAGE: "pims-migrations" - DB_NAME: "pims-database" - run: | - ./.github/helpers/migrations.sh - - # Process and Apply API DeploymentConfig - - name: Process and Apply API DeploymentConfig - env: - NAMESPACE: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - DC_TEMPLATE: 'api-dc-template.yaml' - IMAGE_TAG: ${{ env.IMAGE_TAG }} - ENVIRONMENT: ${{ env.ENVIRONMENT }} - ASPNETCORE_ENVIRONMENT: 'Test' - EMAIL_AUTHORIZED: 'false' - APPLICATION_NAME: 'pims-api' - LICENSE_PLATE: '${{ secrets.LICENSE_PLATE }}' - run: | - ./.github/helpers/deploy.sh - - # Job to check the health of the deployed API - Health-Check: - name: Check Deployment Health - runs-on: ubuntu-latest - needs: [Deploy-To-OpenShift] - steps: - # Login to OpenShift - - name: Login to OpenShift - uses: redhat-actions/oc-login@v1 - env: - OPENSHIFT_USER: github-actions - OPENSHIFT_PROJECT: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }} - openshift_token: ${{env.OPENSHIFT_TOKEN}} - namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - - # Check Deployment Status - - name: Check Deployment Status - run: | - oc rollout status -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} dc/pims-api --watch - - # Job to clean up previous objects in OpenShift - Clean-Up: - name: Clean Up - runs-on: ubuntu-latest - needs: [Health-Check] - steps: - # Login to OpenShift - - name: Login to OpenShift - uses: redhat-actions/oc-login@v1 - env: - OPENSHIFT_USER: github-actions - OPENSHIFT_PROJECT: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }} - openshift_token: ${{env.OPENSHIFT_TOKEN}} - namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - - # Remove previous objects - - name: Remove previous objects - run: | - oc delete pod -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} --field-selector status.phase=Succeeded - - # Remove previous replication controllers - - name: Remove previous replication controllers - run: | - oc delete rc -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} --field-selector status.replicas=0 - - # Job to update the wiki with deployed image tag information - Update_Wiki_Tags: - needs: [Health-Check, Deploy-To-OpenShift] - name: Update table in wiki - runs-on: ubuntu-latest - env: - GH_TOKEN: ${{ github.token }} - - steps: - # Checkout the repository - - name: Checkout - uses: actions/checkout@v3 - - # Clone wiki repository - - name: Clone wiki repository - run: | - echo "Cloning wiki repo https://github.com/$GITHUB_REPOSITORY.wiki.git" - git clone "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" ./wiki - - # Setup Python - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - # Run update wiki python script - - name: Run update wiki python script - run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md API "Deployed Image Tag in TEST" "${{ env.IMAGE_TAG }}" - - # Run update wiki python script for Migration If needed - - name: Update wiki for Migration If needed - if: github.event.inputs.migration_tag - run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md MIGRATION "Deployed Image Tag in TEST" "${{ env.MIGRATION_IMAGE }}" - - # Commit and push changes to wiki - - name: Commit and push changes to wiki - run: | - cd ./wiki - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - git add . - if git diff-index --quiet HEAD; then - echo "Nothing changed" - exit 0 - fi - echo "Pushing changes to wiki" - git commit -m "Value populated at Deploy API" && git push "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" diff --git a/.github/workflows/TEST-App-image-deploy.yml b/.github/workflows/TEST-App-image-deploy.yml deleted file mode 100644 index cbf629cf63..0000000000 --- a/.github/workflows/TEST-App-image-deploy.yml +++ /dev/null @@ -1,138 +0,0 @@ -# GitHub Actions workflow for deploying APP image to TEST env -name: TEST APP-Image Deploy - -on: - workflow_dispatch: - inputs: - image_tag: - description: 'Image Tag to deploy' - required: true - -env: - IMAGE_TAG: ${{ github.event.inputs.image_tag }} - ENVIRONMENT: 'test' - OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_SA_TEST_TOKEN }} - - -jobs: - # Job to deploy APP image to OpenShift - Deploy-To-OpenShift: - name: Deploy to OpenShift - runs-on: ubuntu-latest - - steps: - # Checkout the repository - - name: Checkout Repository - uses: actions/checkout@v3 - - # Login to OpenShift - - name: Login to OpenShift - uses: redhat-actions/oc-login@v1 - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }} - openshift_token: ${{ env.OPENSHIFT_TOKEN }} - namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - - # Process and Apply APP DeploymentConfig - - name: Process and Apply APP DeploymentConfig - env: - NAMESPACE: "${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}" - DC_TEMPLATE: "app-dc-template.yaml" - IMAGE_TAG: ${{ env.IMAGE_TAG }} - ENVIRONMENT: ${{ env.ENVIRONMENT }} - APPLICATION_NAME: "pims-app" - LICENSE_PLATE: "${{ secrets.LICENSE_PLATE }}" - run: | - ./.github/helpers/deploy.sh - - # Job to check the health of the deployed APP - Health-Check: - name: Check Deployment Health - runs-on: ubuntu-latest - needs: [ Deploy-To-OpenShift ] - steps: - # Login to OpenShift - - name: Login to OpenShift - uses: redhat-actions/oc-login@v1 - env: - OPENSHIFT_USER: github-actions - OPENSHIFT_PROJECT: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }} - openshift_token: ${{ env.OPENSHIFT_TOKEN }} - namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - - # Check Deployment Status - - name: Check Deployment Status - run: | - oc rollout status -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} dc/pims-app --watch - - # Job to clean up previous objects in OpenShift - Clean-Up: - name: Clean Up - runs-on: ubuntu-latest - needs: [ Health-Check ] - steps: - # Login to OpenShift - - name: Login to OpenShift - uses: redhat-actions/oc-login@v1 - env: - OPENSHIFT_USER: github-actions - OPENSHIFT_PROJECT: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }} - openshift_token: ${{ env.OPENSHIFT_TOKEN }} - namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} - - # Remove previous objects - - name: Remove previous objects - run: | - oc delete pod -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} --field-selector status.phase=Succeeded - - # Remove previous replication controllers - - name: Remove previous replication controllers - run: | - oc delete rc -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} --field-selector status.replicas=0 - - # Job to update the wiki with deployed image tag information - Update_Wiki_Tags: - needs: [ Health-Check ] - name: Update table in wiki - runs-on: ubuntu-latest - env: - GH_TOKEN: ${{ github.token }} - - steps: - # Checkout the repository - - name: Checkout - uses: actions/checkout@v3 - - # Clone wiki repository - - name: Clone wiki repository - run: | - echo "Cloning wiki repo https://github.com/$GITHUB_REPOSITORY.wiki.git" - git clone "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" ./wiki - - # Setup Python - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - # Run update wiki python script - - name: Run update wiki python script - run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md APP "Deployed Image Tag in TEST" "${{ env.IMAGE_TAG }}" - - # Commit and push changes to wiki - - name: Commit and push changes to wiki - run: | - cd ./wiki - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - git add . - if git diff-index --quiet HEAD; then - echo "Nothing changed" - exit 0 - fi - echo "Pushing changes to wiki" - git commit -m "Value populated at Deploy App" && git push "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" diff --git a/.github/workflows/api-dotnetcore.yml b/.github/workflows/api-dotnetcore.yml deleted file mode 100644 index c8af521998..0000000000 --- a/.github/workflows/api-dotnetcore.yml +++ /dev/null @@ -1,102 +0,0 @@ -name: API (.NET 7.0) - -on: - push: - branches: [main] - paths: - - 'backend/**' # Triggers on changes to files in the backend/ directory. - - '!backend/Dockerfile*' # Will not trigger on changes to the following. - - '!backend/README.md' - pull_request: - types: [opened, synchronize] # Triggered by opened or changed pull requests. - branches: [dev] - paths: - - 'backend/**' # Triggers on changes to files in the backend/ directory. - - '!backend/Dockerfile*' # Will not trigger on changes to the following. - - '!backend/README.md' - -jobs: - build: - runs-on: ubuntu-latest - env: - working-directory: ./backend - codeCov-token: ${{ secrets.CodeCov }} - - steps: - - uses: actions/checkout@v3 - - - name: Setup .NET 7.0 - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 7.0.x - - - name: Install dependencies - run: dotnet restore - working-directory: ${{env.working-directory}} - - - name: Install coverlet for code coverage - run: dotnet tool install -g coverlet.console --version 1.7.2 - working-directory: ${{env.working-directory}} - - - name: Build - run: dotnet build --configuration Release --no-restore - working-directory: ${{env.working-directory}} - - - name: Test - run: dotnet test --no-restore --verbosity normal - working-directory: ${{env.working-directory}} - - # For future reference, if we have N test projects the flow of events would be: - # - # **Pre-conditions:** - # - All projects export their individual coverage percents in JSON and OpenCover format - # - There's no way to merge OpenCover xmls together (that I could find) - # - Common folder "../TestResults" is git ignored so nothing gets in source control - # - # **Steps:** - # - # - Test-project 1 - # - generate coverage files (without merging) - # - copy results to common folder "../TestResults" - # - Test-project 2 - # - generate coverage files merging with previous `coverage.json` - # - the previous `coverage.opencoverage.xml` is ignored - # - copy results to common folder "../TestResults" - # ... - # - Test-project N - # - generate coverage files merging with previous `coverage.json` - # - the previous `coverage.opencoverage.xml` is ignored - # - copy results to common folder "../TestResults" - # - # The final `coverage.opencover.xml` is the one we want - - name: Generate code coverage - working-directory: ${{env.working-directory}}/tests/unit - run: | - mkdir -p TestResults - rm -rf api/TestResults - rm -rf dal/TestResults - cd api - dotnet test --collect:"XPlat Code Coverage" --settings coverlet.runsettings --no-restore - mv TestResults/*/* ../TestResults/ - cd .. - cd dal - dotnet test --collect:"XPlat Code Coverage" --settings coverlet.runsettings --no-restore - mv TestResults/*/* ../TestResults/ - cd .. - head TestResults/coverage.opencover.xml - - - name: Codecov - uses: codecov/codecov-action@v1.5.0 - with: - # User defined upload name. Visible in Codecov UI - name: PIMS - # Repository upload token - get it from codecov.io. Required only for private repositories - token: ${{env.codeCov-token}} - # Path to coverage file to upload - file: ${{env.working-directory}}/tests/unit/TestResults/coverage.opencover.xml - # Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome) - flags: unittests - # Environment variables to tag the upload with (e.g. PYTHON | OS,PYTHON) - env_vars: C# - # Specify whether or not CI build should fail if Codecov runs into an error during upload - fail_ci_if_error: true diff --git a/.github/workflows/app-cypress-dev.yml b/.github/workflows/app-cypress-dev.yml deleted file mode 100644 index af812cfb4b..0000000000 --- a/.github/workflows/app-cypress-dev.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: App Cypress Tests - Dev - -on: - schedule: - - cron: '0 21 * * 1-5' # Every weekday at 9:00pm UTC - roughly 1:00pm Pacific Time. - workflow_dispatch: - -jobs: - e2e-tests-dev: - runs-on: ubuntu-22.04 - # Cypress Docker Image - # - with Chrome, Firefox, and Edge v113 pre-installed. - # - Node v18.16.0 - container: cypress/browsers:node-18.16.0-chrome-113.0.5672.92-1-ff-113.0-edge-113.0.1774.35-1 - - steps: - # Checkout PIMS Github Repository. - - name: Checkout Repository - uses: actions/checkout@v3 - - # Install NPM Dependencies. - - name: Install Dependencies - run: | - cd ./frontend - npm i - - # Run Cypress E2E Tests. - - name: Cypress Run E2E Tests - uses: cypress-io/github-action@v5 - env: - CYPRESS_KEYCLOAK_USER: ${{ secrets.TEST_IDIR_USERNAME }} - CYPRESS_KEYCLOAK_PASSWORD: ${{ secrets.TEST_IDIR_PASSWORD }} - with: - browser: chrome - working-directory: frontend - command: npm run cypress:e2e-dev - config-file: cypress.config.ts diff --git a/.github/workflows/app-jest-coverage.yml b/.github/workflows/app-jest-coverage.yml deleted file mode 100644 index 50179b759b..0000000000 --- a/.github/workflows/app-jest-coverage.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: APP (React 18) - Jest Test Coverage - -on: - pull_request: - types: [opened, synchronize] # Triggered by opened or changed pull requests. - branches: [main] - paths: - - 'frontend/**' # Triggers on changes to files in the frontend/ directory. - - '!frontend/cypress/**' # Will not trigger on changes to the following. - - '!frontend/cypress.config.*' - - '!frontend/.*' - - '!frontend/Dockerfile*' - - '!frontend/nginx.conf' - - '!frontend/vite.config.*' - - '!frontend/tsconfig.json' - - '!frontend/README.md' - -jobs: - codeclimate-jest-coverage: - runs-on: ubuntu-latest - env: - GIT_BRANCH: ${{ github.event.pull_request.head.ref }} - GIT_COMMIT_SHA: ${{ github.event.pull_request.head.sha }} - CC_TEST_REPORTER_ID: 37fdb6f058122c17fc2419b78b02b1d5582694f7cd84a2b735de8eec235e9c5b - - steps: - # Confirm GitHub ENVs. - - name: Echo ENVs - run: | - echo $GIT_BRANCH - echo $GIT_COMMIT_SHA - - # Checkout code from Repo. - - name: Checkout Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - # Import Code Climate test reporter. - - name: Import Code Climate - run: | - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - - # Allow test reporter to be executed. - - name: Execute Permissions for Code Climate Binary - run: | - chmod +x ./cc-test-reporter - - # Notifies Code Climate of impending report. - - name: Test Reporter Before Build - run: | - ./cc-test-reporter before-build - - # Install dependencies. - - name: Install Dependencies - working-directory: ./frontend - run: | - npm i - - # Generate coverage report. - - name: Run Coverage Report - working-directory: ./frontend - run: | - npm run coverage - - # Use lcov to format coverage for Code Climate - # -t is for coverage type - - name: Format Test Coverage - run: | - ./cc-test-reporter format-coverage ${{ github.workspace }}/frontend/coverage/lcov.info -t lcov --output ${{ github.workspace }}/frontend/coverage/coverage.json - - # Upload coverage to Code Climate. - # -i is for input, -d for detached - - name: Upload Coverage - run: | - ./cc-test-reporter upload-coverage -d -i ${{ github.workspace }}/frontend/coverage/coverage.json diff --git a/.github/workflows/app-lint.yaml b/.github/workflows/app-lint.yaml deleted file mode 100644 index 5e2bda46d5..0000000000 --- a/.github/workflows/app-lint.yaml +++ /dev/null @@ -1,32 +0,0 @@ -name: APP Linting Check - -on: - pull_request: - types: [opened, synchronize] - branches: [main] - paths: - - "frontend/**" - - ".github/workflows/app-lint.yaml" - workflow_dispatch: - -jobs: - lint-app: - name: Lint Frontend App - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - # Could optimize this by only installing necessary dependencies - - name: Install Dependencies - working-directory: ./frontend - run: npm i --only=dev - - - name: Run ESLint - working-directory: ./frontend - run: npm run lint - - - name: Run Prettier - working-directory: ./frontend - run: npm run check diff --git a/.gitignore b/.gitignore index 683af4d4dc..ff7b27515a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,7 @@ -**/sh.exe.stackdump -bash.exe.stackdump *.env .vs -*.orig -*.param -.scannerwork/ -auth/keycloak/config/hsperfdata_jboss/ -auth/keycloak/config/*.log .DS_Store -/backups **/node_modules -database/mssql/data docker-compose.override.yml -docker-compose.override.yml @@ -22,14 +13,9 @@ node_modules/ # testing coverage/ -test-report.xml -cypress/videos -cypress/screenshots -testUser.json # production build/ -public/videos # misc .DS_Store diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 3566bf838b..0000000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - // Use IntelliSense to find out which attributes exist for C# debugging - // Use hover for the description of the existing attributes - // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md - "version": "0.2.0", - "configurations": [ - { - "name": "Tool-Keycloak-Sync", - "type": "coreclr", - "request": "launch", - "console": "internalConsole", - "preLaunchTask": "build", - "program": "${workspaceRoot}/tools/keycloak/sync/bin/Debug/net6.0/Pims.Tools.Keycloak.Sync.dll", - "cwd": "${workspaceRoot}/tools/keycloak/sync", - "stopAtEntry": false, - "requireExactSource": false - }, - { - "name": "Tool-Converter", - "type": "coreclr", - "request": "launch", - "console": "internalConsole", - "preLaunchTask": "build", - "program": "${workspaceRoot}/tools/converters/excel/bin/Debug/net7.0/Pims.Tools.Converters.ExcelConverter.dll", - "cwd": "${workspaceRoot}/tools/converters/excel", - "stopAtEntry": false - }, - { - "name": "Tool-Import", - "type": "coreclr", - "request": "launch", - "console": "internalConsole", - "preLaunchTask": "build", - "program": "${workspaceRoot}/tools/import/bin/Debug/net7.0/Pims.Tools.Import.dll", - "cwd": "${workspaceRoot}/tools/import", - "stopAtEntry": false - }, - { - "name": ".NET Core Launch (api)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - "program": "${workspaceFolder}/backend/api/bin/Debug/net7.0/Pims.Api.dll", - "args": [], - "cwd": "${workspaceFolder}/backend/api", - "stopAtEntry": false, - "env": { - "ASPNETCORE_ENVIRONMENT": "Local", - "ASPNETCORE_URLS": "http://*:5000;https://*:433" - }, - "sourceFileMap": { - "/Views": "${workspaceFolder}/backend/Views" - } - }, - { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach", - "processId": "${command:pickProcess}" - } - ] -} diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 05e5f95cfc..0000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "dotnet-test-explorer.testProjectPath": "./backend", - "csharpfixformat.style.braces.onSameLine": false, - "sqltools.connections": [ - { - "database": "keycloak", - "driver": "PostgreSQL", - "name": "Keycloak", - "askForPassword": true, - "port": 5432, - "server": "localhost", - "username": "keycloak" - }, - { - "database": "geospatial", - "driver": "PostgreSQL", - "name": "Geo-spatial", - "password": "password", - "port": 5433, - "server": "localhost", - "username": "postgres" - }, - { - "database": "master", - "driver": "MSSQL", - "name": "MSSQL-RedHat-master", - "password": "6I6KXYc6SDscXq7j", - "port": 1433, - "server": "localhost", - "username": "sa" - }, - { - "database": "geospatial", - "driver": "MSSQL", - "isActive": true, - "isConnected": true, - "name": "MSSQL-RedHat-geospatial", - "password": "6I6KXYc6SDscXq7j", - "port": 1433, - "server": "localhost", - "username": "sa" - }, - { - "mssqlOptions": { - "appName": "SQLTools", - "useUTC": true, - "encrypt": true - }, - "previewLimit": 50, - "server": "localhost", - "port": 5433, - "askForPassword": true, - "driver": "MSSQL", - "name": "pims", - "database": "pims", - "username": "admin" - } - ], - "[javascript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - } -} diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index 04112de5c7..0000000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "version": "2.0.0", - "tasks": [{ - "label": "build", - "command": "dotnet", - "type": "process", - "args": [ - "build", - "${workspaceFolder}/backend/api/Pims.Api.csproj", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" - ], - "problemMatcher": "$msCompile" - }, - { - "label": "publish", - "command": "dotnet", - "type": "process", - "args": [ - "publish", - "${workspaceFolder}/backend/api/Pims.Api.csproj", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" - ], - "problemMatcher": "$msCompile" - }, - { - "label": "watch", - "command": "dotnet", - "type": "process", - "args": [ - "watch", - "run", - "${workspaceFolder}/backend/api/Pims.Api.csproj", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" - ], - "problemMatcher": "$msCompile" - }, - { - "label": "test", - "command": "dotnet", - "type": "shell", - "group": "test", - "args": [ - "test", - "${workspaceFolder}/backend/test/Pims.Api.Test.csproj" - ], - "presentation": { - "reveal": "silent" - }, - "problemMatcher": "$msCompile" - }, - { - "type": "docker-build", - "label": "docker-build", - "platform": "node", - "dockerBuild": { - "dockerfile": "${workspaceFolder}/Dockerfile", - "context": "${workspaceFolder}" - } - }, - { - "type": "docker-run", - "label": "docker-run: release", - "dependsOn": ["docker-build"], - "platform": "node" - }, - { - "type": "docker-run", - "label": "docker-run: debug", - "dependsOn": ["docker-build"], - "dockerRun": { - "env": { - "DEBUG": "*", - "NODE_ENV": "development" - } - }, - "node": { - "enableDebugging": true - } - } - ] -} diff --git a/Makefile b/Makefile deleted file mode 100644 index c35407b65d..0000000000 --- a/Makefile +++ /dev/null @@ -1,152 +0,0 @@ -#!/usr/bin/make - -SHELL := /usr/bin/env bash -.DEFAULT_GOAL := help - -ifneq ($(OS),Windows_NT) -POSIXSHELL := 1 -else -POSIXSHELL := -endif - -# to see all colors, run -# bash -c 'for c in {0..255}; do tput setaf $c; tput setaf $c | cat -v; echo =$c; done' -# the first 15 entries are the 8-bit colors - -# define standard colors -BLACK := $(shell tput -Txterm setaf 0) -RED := $(shell tput -Txterm setaf 1) -GREEN := $(shell tput -Txterm setaf 2) -YELLOW := $(shell tput -Txterm setaf 3) -LIGHTPURPLE := $(shell tput -Txterm setaf 4) -PURPLE := $(shell tput -Txterm setaf 5) -BLUE := $(shell tput -Txterm setaf 6) -WHITE := $(shell tput -Txterm setaf 7) - -RESET := $(shell tput -Txterm sgr0) - -# default "prompt" -P = ${GREEN}[+]${RESET} - -help: - @grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' - -.PHONY: help - -############################################################################## -# Docker Development -############################################################################## - -restart: ## Restart local docker environment (n=service name) - $(info Restart local docker environment) - @make stop n=$(n) - @make up n=$(n) - -refresh: ## Recreates local docker environment (n=service name) - $(info Recreates local docker environment) - @make stop n=$(n) - @make build n=$(n) - @make up n=$(n) - -up: ## Runs the local containers (n=service name), stop dev container first - @echo "$(P) Running client and server..." - @docker compose rm -sf frontend-dev - @docker compose --env-file .env --profile prod up -d $(n) - -up-dev: ## Runs the local containers (n=service name), stop prod container first - @echo "$(P) Running client and server..." - @docker compose rm -sf frontend - @make npm-refresh - @docker compose --env-file .env --profile dev up -d $(n) - -down: ## Stops the local containers and removes them - @echo "$(P) Stopping client and server..." - @docker compose down - -stop: ## Stops the local containers (n=service name) - @echo "$(P) Stopping client and server..." - @docker compose stop $(n) - -build: ## Builds the local containers (n=service name) - @echo "$(P) Building images..." - @docker compose --profile prod build --no-cache $(n) - -rebuild: ## Build the local contains (n=service name) and then start them after building - @make build n=$(n) - @make up n=$(n) - -clean: ## Removes all local containers, images, volumes, etc - @echo "$(P) Removing all containers, images, volumes for solution." - @docker compose rm -f -v -s - @docker volume rm -f pims-app-node-cache - @docker volume rm -f database-data - -setup: ## Setup local container environment, initialize keycloak and database - @make build; make up; make pause-30; make db-update; - -pause-30: - @echo "$(P) Pausing 30 seconds..." - @-sleep 30 - -client-test: ## Runs the client tests in a container - @echo "$(P) Running client unit tests..." - @docker compose --env-file .env run frontend npm test - -server-test: ## Runs the server tests in a container - @echo "$(P) Running server unit tests..." - @docker compose --env-file .env run backend dotnet test - -server-run: ## Starts local server containers - @echo "$(P) Starting server containers..." - @docker compose --env-file .env up -d backend - -npm-clean: ## Removes local containers, images, volumes, for frontend-dev container. - @echo "$(P) Removing frontend containers and volumes." - @docker compose stop frontend-dev - @docker compose rm -f -v -s frontend-dev - @docker volume rm -f pims-app-node-cache - -npm-refresh: ## Cleans and rebuilds the frontend-dev container. This is useful when npm packages are changed. - @make npm-clean; - @docker compose up frontend-dev --build -d - -db-migrations: ## Display a list of migrations. - @echo "$(P) Display a list of migrations." - @cd backend/dal; dotnet ef migrations list - -db-add: ## Add a new database migration for the specified name (n=name of migration). - @echo "$(P) Create a new database migration for the specified name." - @cd backend/dal; dotnet ef migrations add $(n); code -r ./Migrations/*_$(n).cs - @./scripts/db-migration.sh $(n); - -db-update: ## Update the database with the latest migration. - @echo "$(P) Updating database with latest migration..." - @docker compose --env-file .env up -d database; cd backend/dal; dotnet ef database update - -db-rollback: ## Rollback to the specified database migration (n=name of migration). - @echo "$(P) Rollback to the specified database migration." - @cd backend/dal; dotnet ef database update $(n); - -db-remove: ## Remove the last database migration. - @echo "$(P) Remove the last migration." - @cd backend/dal; dotnet ef migrations remove --force; - -db-clean: ## Re-creates an empty docker database - ready for seeding. - @echo "$(P) Refreshing the database..." - @cd backend/dal; dotnet ef database drop --force; dotnet ef database update - -db-refresh: | server-run pause-30 db-clean ## Refresh the database and seed it with data. - -db-drop: ## Drop the database. - @echo "$(P) Drop the database." - @cd backend/dal; dotnet ef database drop; - -db-script: ## Export an SQL script from the migration (from=0 to=Initial). - @echo "$(P) Exporting script to 'db-migration.sql'" - @cd backend/dal; dotnet ef migrations script ${from} ${to} --output ../../db-migration.sql - -convert: ## Convert Excel files to JSON - @echo "$(P) Convert Excel files to JSON..." - @cd tools/converters/excel; dotnet build; dotnet run; - -.PHONY: local setup restart refresh up down stop build rebuild clean client-test server-test pause-30 server-run db-migrations db-add db-update db-rollback db-remove db-clean db-drop db-refresh npm-clean npm-refresh convert diff --git a/adr/ches.md b/adr/ches.md deleted file mode 100644 index 0e1daf9862..0000000000 --- a/adr/ches.md +++ /dev/null @@ -1,59 +0,0 @@ -# Notifications - Email Service - -## Status - -> Accepted - -> June 16, 2020 - -## Context - -PIMS requires a way to send email notifications to agencies throughout the workflow of disposing properties. - -Use Cases; - -- Whitelist of agencies who will receive emails -- Inform all agencies of a new properties in the Enhanced Referral Program (ERP) -- A way for agencies to show interest, or to opt out of further notifications -- Inform all agencies of status change or progress of properties in ERP -- Inform owning agency of status change of disposal project -- Notify owning agency of requirement or information - -The **Common Hosted Email Service (CHES)** is a free service offered and supported by the **Exchange Lab**. - -Additional Information here; - -- [Common Services Showcase](https://bcgov.github.io/common-service-showcase/) -- [Common Hosted Email Service](https://bcgov.github.io/common-service-showcase/#CHES) -- [GetOk](https://getok.pathfinder.gov.bc.ca/getok/about) -- [GetOk - PIMS](https://getok.pathfinder.gov.bc.ca/getok/apps/PIMS) -- [ReDoc](https://ches-master-9f0fbe-prod.pathfinder.gov.bc.ca/api/v1/docs) -- [GitHub](https://github.com/bcgov/common-hosted-email-service) - -## Decision - -The decision is to integrate with the **CHES** or to continue looking for another solution to provide notification emails. - -The key features **CHES** has are; - -- Send emails with attachments and special business tagging -- Schedule for delayed delivery, with ability to cancel -- Create bulk email merge with your own templates. -- Send plain text or HTML emails -- Track the status of your request - -In addition to integrating with **CHES** it will require developing the following features within PIMS; - -- Maintain a list of `txId` and `msgId` so that messages can be tracked and cancelled if required. -- Notifications are `async` which will require design/workflow that handles failures. -- Manage a collection of templates that will be used for messages. - -## Consequences - -The primary benefit of integrating with **CHES** is that we don't have to support or build an email notification solution. -Additionally **CHES** is supported and used by other projects with the Lab, which means internal support and knowledge sharing. - -Some of the consequences would/might be; - -- No SLA -- No UI application to support diff --git a/adr/database.md b/adr/database.md deleted file mode 100644 index 208ea6586f..0000000000 --- a/adr/database.md +++ /dev/null @@ -1,25 +0,0 @@ -# Database Choice - MS-SQL - -## Status - -> Accepted - -> January 1, 2020 - -## Context - -PIMS requires a database to store all property information. -The data is relational, requiring constraints and must run within a Linux docker container on OpenShift. -Additionally it must be supported by Entity Framework Core 3.1. - -## Decision - -Originally the database generated for the SWU was with PostgreSQL, after further consideration it made more sense to tightly couple both MS-SQL with .NET Core. -This will give us better performance and tighter integration with Entity Framework Core. -It was decided to create a Linux docker container to host the MS-SQL 2019 database. - -## Consequences - -There are benefits from doing it as there is tighter integration with Entity Framework Core. -One such example is simpler optimistic concurrency handling. -It makes it move difficult with additional effort to setup OpenShift, as there are not existing lab projects we can use. diff --git a/adr/geocoder.md b/adr/geocoder.md deleted file mode 100644 index 429f5db046..0000000000 --- a/adr/geocoder.md +++ /dev/null @@ -1,36 +0,0 @@ -# Data BC Geocoder - -## Status - -> Accepted - -> June 18, 2020 - -## Context - -Presently when submitting new properties or editing existing properties within inventory the only way to set the latitude and longitude values is manually. -Ideally the inventory would use GIS location values that are pulled from Data BC (better source of truth). - -Providing a way through the property address to pull valid GIS coordinates from Data BC Geocoder would improve the data and the user experience. - -Additionally Geocoder can be used to verify addresses that are manually entered. - -- [Geocoder](https://www2.gov.bc.ca/gov/content/data/geographic-data-services/location-services/geocoder) -- [Data BC](https://catalogue.data.gov.bc.ca/dataset/bc-address-geocoder-web-service) -- [API Swagger](https://catalogue.data.gov.bc.ca/dataset/bc-address-geocoder-web-service/resource/40d6411e-ab98-4df9-a24e-67f81c45f6fa/view/1d3c42fc-53dc-4aab-ae3b-f4d056cb00e0) -- [Developer API Keys](https://github.com/bcgov/gwa/wiki/Developer-Guide#developer-api-keys) -- API Host = `https://geocoder.api.gov.bc.ca` - -## Decision - -Integrate with Data BC Geocoder API. -When a user types an address a list of viable matches will be displayed. -If the user selects one of the matches it will be used to set the address and GIS coordinates,. - -## Consequences - -Submitting new properties and editing existing properties will be easier and less error prone. - -GIS coordinates will be more tightly integrated with a single source of truth, and therefore more consistent and authentic. - -Address values can be verified. diff --git a/adr/leaflet.md b/adr/leaflet.md deleted file mode 100644 index c13076e933..0000000000 --- a/adr/leaflet.md +++ /dev/null @@ -1,29 +0,0 @@ -# Leaflet - -## Status - -> Accepted - -> January 1, 2020 - -## Context - -The project requires a GIS component to display a map, properties on the map and property boundaries. - -The following options were reviewed; - -- [ArcGIS](https://www.arcgis.com/index.html) -- [Leaflet](https://leafletjs.com/) -- [Data BC](https://data.gov.bc.ca/) -- [LTSA](https://ltsa.ca/) - -## Decision - -The PIMS project will use Leaflet for the basic GIS solution. - -## Consequences - -Leaflet only offers a few features and performance isn't spectacular. -Using Leaflet is the simplest and most efficient option. -It is free to use. -Only requires making requests to their API. diff --git a/adr/map-source-boundaries.md b/adr/map-source-boundaries.md deleted file mode 100644 index 823641b069..0000000000 --- a/adr/map-source-boundaries.md +++ /dev/null @@ -1,23 +0,0 @@ -# GIS Parcel Boundary Map Source - -## Status - -> Accepted - -> May 1, 2020 - -## Context - -To improve usability of the map it is required that we include the parcel boundaries as a default layer. -Data BC currently provides mapping layers (which includes parcel boundaries). - -- [openmaps.gov.bc.ca](https://www2.gov.bc.ca/gov/content/data/geographic-data-services/web-based-mapping/map-services) - -## Decision - -Add the **Data BC** openmaps parcel boundaries layer to the default map. - -## Consequences - -Adding additional layers to the map will increase the amount of data that needs to be requested and displayed. -This will make the user experience slower, but will improve the view of property information (boundaries). diff --git a/adr/model-mapping.md b/adr/model-mapping.md deleted file mode 100644 index 367ec5f128..0000000000 --- a/adr/model-mapping.md +++ /dev/null @@ -1,31 +0,0 @@ -# Model Mapping Change - AutoMapper to Mapster - -## Status - -> Accepted - -> April 15, 2020 - -## Context - -The current model mapping library [AutoMapper](https://automapper.org/) ([GitHub](https://github.com/AutoMapper/AutoMapper)) requires a lot of effort to configure. -It is near impossible to debug. -It is not intuitive to develop with. -The benefits and features it offers are far outweighed by the time invested in implementation and maintenance. - -A new library is required to speed up development and improve the debugging experience. - -## Decision - -[Mapster](https://github.com/MapsterMapper/Mapster/wiki) ([source](https://github.com/MapsterMapper/Mapster)) provides a more intuitive solution, along with performance benefits. - -## Consequences - -The industry adoption of AutoMapper is much higher than Mapster. -AutoMapper has more features available (although irrelevant at this point in time). - -Mapster is far more intuitive when developing. -It is far better in performance. -It can be debugged, and provides better error handling. -The structure is similar enough to AutoMapper that the learning curve is minimal. -However global configuration appears to be more challenging when used with Dependency Injection. diff --git a/adr/monorepo.md b/adr/monorepo.md deleted file mode 100644 index 5a0021aa8a..0000000000 --- a/adr/monorepo.md +++ /dev/null @@ -1,33 +0,0 @@ -# Monorepo vs Multirepo - -## Status - -> Accepted - -> January 1, 2020 - -## Context - -Our project involves developing a number of tools and layers to support PIMS. -This includes at present the following; - -- Frontend GUI Web Application -- Backend RESTful API -- Frontend GIS components -- Backend database -- Keycloak integration -- OpenShift integration -- Docker integration -- ETL tools - -## Decision - -The Exchange Lab's practice is to use the monorepo solution. - -## Consequences - -SonarQube doesn't natively support monorepos with different programming languages. - -DevOps is more complicated with a monorepo. - -A benefit of the monorepo is that it is easier to maintain and perform rapid iterations. diff --git a/adr/programming-languages.md b/adr/programming-languages.md deleted file mode 100644 index 8fed5b2cda..0000000000 --- a/adr/programming-languages.md +++ /dev/null @@ -1,26 +0,0 @@ -# Programming Languages - -## Status - -> Accepted - -> January 1, 2020 - -## Context - -We need to choose programming languages for our software. We have two major needs: a front-end programming language suitable for web applications, and a back-end programming language suitable for server applications. - -The languages selected should be part of the skillset and expierence of the team members. -They should have broad industry support. -They should be supported by GIS related plugins, libraries and tools. - -## Decision - -We are choosing TypeScript and React for the front-end. - -We are choosing .NET Core 3.1 for the back-end API. - -## Consequences - -Not all team members have TypeScript and React experience. -This however is also a benefit in the sense they will now have an opportunity. diff --git a/backend/.dockerignore b/backend/.dockerignore deleted file mode 100644 index 7ed9d732a6..0000000000 --- a/backend/.dockerignore +++ /dev/null @@ -1,18 +0,0 @@ -.vs/ -.env - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -build/ -bld/ -**/[Bb]in/ -**/[Oo]bj/ -**/[Oo]ut/ -msbuild.log -msbuild.err -msbuild.wrn diff --git a/backend/.editorconfig b/backend/.editorconfig deleted file mode 100644 index 1cbc50d983..0000000000 --- a/backend/.editorconfig +++ /dev/null @@ -1,27 +0,0 @@ -# Editor configuration, see https://editorconfig.org -root = true - -[*] -end_of_line = lf -charset = utf-8 -indent_style = space -insert_final_newline = true -trim_trailing_whitespace = true - -[*.ts] -indent_size = 2 - -[*.cs] -indent_size = 4 - -[*.md] -max_line_length = off -trim_trailing_whitespace = false - -[*.env] -insert_final_newline = false - -[{Makefile,**.mk}] -# Use tabs for indentation (Makefiles require tabs) -indent_style = tab - diff --git a/backend/.gitignore b/backend/.gitignore deleted file mode 100644 index 1da9b51693..0000000000 --- a/backend/.gitignore +++ /dev/null @@ -1,52 +0,0 @@ -# Environment variables -.env -connectionstrings.*json -.vscode/settings.json - -*.swp -*.*~ -project.lock.json -.DS_Store -*.pyc -nupkg/ - -# IDE - VSCode -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -TestResults/ - -# Rider -.idea - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# Build results -**/[Dd]ebug/ -**/[Dd]ebugPublic/ -**/[Rr]elease/ -**/[Rr]eleases/ -**/x64/ -**/x86/ -**/build/ -**/bld/ -**/[Bb]in/ -**/[Oo]bj/ -**/[Oo]ut/ -**/msbuild.log -**/msbuild.err -**/msbuild.wrn - -# Visual Studio 2015 -.vs/ - -# NET Core Healthchecks UI -healthchecksdb -healthchecksdb-shm -healthchecksdb-wal diff --git a/backend/.vscode/launch.json b/backend/.vscode/launch.json deleted file mode 100644 index d069e97ed3..0000000000 --- a/backend/.vscode/launch.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - // Use IntelliSense to find out which attributes exist for C# debugging - // Use hover for the description of the existing attributes - // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md - "version": "0.2.0", - "configurations": [ - { - "name": ".NET Core Launch (web)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - "program": "${workspaceFolder}/api/bin/Debug/net7.0/Pims.Api.dll", - "args": [], - "cwd": "${workspaceFolder}/api", - "stopAtEntry": false, - "requireExactSource": false, - "env": { - "ASPNETCORE_ENVIRONMENT": "Local", - "ASPNETCORE_URLS": "http://*:5000;https://*:433" - }, - "sourceFileMap": { - "/Views": "${workspaceFolder}/Views" - } - }, - { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach", - "processId": "${command:pickProcess}" - }, - { - "name": "Docker .NET Core Launch", - "type": "docker", - "request": "launch", - "preLaunchTask": "docker-run: debug", - "netCore": { - "appProject": "${workspaceFolder}/api/Pims.Api.csproj" - } - } - ] -} diff --git a/backend/.vscode/tasks.json b/backend/.vscode/tasks.json deleted file mode 100644 index a6e596733b..0000000000 --- a/backend/.vscode/tasks.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "process", - "args": [ - "build", - "${workspaceFolder}/api/Pims.Api.csproj", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" - ], - "problemMatcher": "$msCompile" - }, - { - "label": "publish", - "command": "dotnet", - "type": "process", - "args": [ - "publish", - "${workspaceFolder}/api/Pims.Api.csproj", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" - ], - "problemMatcher": "$msCompile" - }, - { - "label": "watch", - "command": "dotnet", - "type": "process", - "args": [ - "watch", - "run", - "${workspaceFolder}/api/Pims.Api.csproj", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" - ], - "problemMatcher": "$msCompile" - }, - { - "type": "docker-build", - "label": "docker-build: debug", - "dependsOn": ["build"], - "dockerBuild": { - "tag": "backend:dev", - "target": "base", - "dockerfile": "${workspaceFolder}/Dockerfile", - "context": "${workspaceFolder}", - "pull": true - }, - "netCore": { - "appProject": "${workspaceFolder}/api/Pims.Api.csproj" - } - }, - { - "type": "docker-build", - "label": "docker-build: release", - "dependsOn": ["build"], - "dockerBuild": { - "tag": "backend:latest", - "dockerfile": "${workspaceFolder}/Dockerfile", - "context": "${workspaceFolder}", - "pull": true - }, - "netCore": { - "appProject": "${workspaceFolder}/api/Pims.Api.csproj" - } - }, - { - "type": "docker-run", - "label": "docker-run: debug", - "dependsOn": ["docker-build: debug"], - "dockerRun": { - "envFiles": ["${workspaceFolder}\\api\\.env"], - "network": "pims-net", - "ports": [{ "hostPort": 5000, "containerPort": 80 }] - }, - "netCore": { - "appProject": "${workspaceFolder}/api/Pims.Api.csproj", - "configureSsl": false, - "enableDebugging": true - } - }, - { - "type": "docker-run", - "label": "docker-run: release", - "dependsOn": ["docker-build: release"], - "dockerRun": {}, - "netCore": { - "appProject": "${workspaceFolder}/api/Pims.Api.csproj" - } - } - ] -} diff --git a/backend/Dockerfile b/backend/Dockerfile deleted file mode 100644 index 93501774a2..0000000000 --- a/backend/Dockerfile +++ /dev/null @@ -1,41 +0,0 @@ -ARG BUILD_CONFIGURATION=Release -FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base -WORKDIR /app -EXPOSE 443 8080 - -# Copy csproj and restore as distinct layers -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build -WORKDIR /src -COPY *.sln . -COPY api/*.csproj api/ -COPY entities/*.csproj entities/ -COPY tests/core/*.csproj tests/core/ -COPY tests/unit/api/*.csproj tests/unit/api/ -COPY tests/unit/dal/*.csproj tests/unit/dal/ -COPY dal/*.csproj dal/ -COPY dal.keycloak/*.csproj dal.keycloak/ -COPY keycloak/*.csproj keycloak/ -COPY geocoder/*.csproj geocoder/ -COPY ches/*.csproj ches/ -COPY notifications/*.csproj notifications/ -COPY core/*.csproj core/ -COPY ltsa/*.csproj ltsa/ - -RUN dotnet restore -ENV PATH="$PATH:/root/.dotnet/tools" -RUN dotnet tool install --global dotnet-ef --version 7.0.5 -# Copy everything else and build -COPY . . -WORKDIR /src/api -RUN dotnet build "Pims.Api.csproj" -c "$BUILD_CONFIGURATION" -o /app/build - -FROM build AS publish -RUN dotnet publish "Pims.Api.csproj" -c "$BUILD_CONFIGURATION" -o /app/publish - -# Runtime image -FROM base AS final -WORKDIR /app -COPY --from=publish /app/publish . -COPY entrypoint.sh . -RUN chmod +x /app/entrypoint.sh -ENTRYPOINT ["/app/entrypoint.sh"] diff --git a/backend/Dockerfile.migrations b/backend/Dockerfile.migrations deleted file mode 100644 index 584a8dad1a..0000000000 --- a/backend/Dockerfile.migrations +++ /dev/null @@ -1,20 +0,0 @@ - -FROM mcr.microsoft.com/dotnet/sdk:7.0 - -ENV DOTNET_CLI_HOME=/tmp -ENV XDG_DATA_HOME=/tmp -ENV PATH="$PATH:/tmp/.dotnet/tools" - -# Switch to root for package installs -USER 0 -RUN dotnet tool install --global dotnet-ef --version 7.0.5 - -WORKDIR /src -COPY . . -RUN fix_permissions() { while [ $# -gt 0 ] ; do chgrp -R 0 "$1" && chmod -R g=u "$1"; shift; done } && \ - fix_permissions "/src" "/tmp" - -# Run container by default as user with id 1001 (default) -USER 1001 - -ENTRYPOINT cd /src/dal && dotnet ef database update -v diff --git a/backend/Dockerfile.ocp b/backend/Dockerfile.ocp deleted file mode 100644 index be4bfc8ff4..0000000000 --- a/backend/Dockerfile.ocp +++ /dev/null @@ -1,41 +0,0 @@ -ARG BUILD_CONFIGURATION=Release -FROM image-registry.apps.silver.devops.gov.bc.ca/354028-tools/dotnet-aspnet-runtime:7.0 AS base -WORKDIR /app -EXPOSE 443 8080 - -# Copy csproj and restore as distinct layers -FROM image-registry.apps.silver.devops.gov.bc.ca/354028-tools/dotnet-sdk:7.0 AS build -WORKDIR /src -COPY *.sln . -COPY api/*.csproj api/ -COPY entities/*.csproj entities/ -COPY tests/core/*.csproj tests/core/ -COPY tests/unit/api/*.csproj tests/unit/api/ -COPY tests/unit/dal/*.csproj tests/unit/dal/ -COPY dal/*.csproj dal/ -COPY dal.keycloak/*.csproj dal.keycloak/ -COPY keycloak/*.csproj keycloak/ -COPY geocoder/*.csproj geocoder/ -COPY ches/*.csproj ches/ -COPY notifications/*.csproj notifications/ -COPY core/*.csproj core/ -COPY ltsa/*.csproj ltsa/ - -RUN dotnet restore -ENV PATH="$PATH:/root/.dotnet/tools" -RUN dotnet tool install --global dotnet-ef --version 7.0.5 -# Copy everything else and build -COPY . . -WORKDIR /src/api -RUN dotnet build "Pims.Api.csproj" -c "$BUILD_CONFIGURATION" -o /app/build - -FROM build AS publish -RUN dotnet publish "Pims.Api.csproj" -c "$BUILD_CONFIGURATION" -o /app/publish - -# Runtime image -FROM base AS final -WORKDIR /app -COPY --from=publish /app/publish . -COPY entrypoint.sh . -RUN chmod +x /app/entrypoint.sh -ENTRYPOINT ["/app/entrypoint.sh"] diff --git a/backend/Pims.sln b/backend/Pims.sln deleted file mode 100644 index 4e2c908abc..0000000000 --- a/backend/Pims.sln +++ /dev/null @@ -1,251 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.5.33530.505 -MinimumVisualStudioVersion = 15.0.26124.0 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Api", "api\Pims.Api.csproj", "{16BC0468-78F6-4C91-87DA-7403C919E646}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Dal", "dal\Pims.Dal.csproj", "{6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Dal.Entities", "entities\Pims.Dal.Entities.csproj", "{1C724CD5-CD24-46CD-835A-A83F673F97B5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Keycloak", "keycloak\Pims.Keycloak.csproj", "{970903E9-BC53-436F-BA77-C62349546425}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Core", "core\Pims.Core.csproj", "{AC8F04FF-3164-41FB-9EDF-E468B8B77837}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Dal.Keycloak", "dal.keycloak\Pims.Dal.Keycloak.csproj", "{5697DD19-62CC-4377-ABA8-1E192376F4F6}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "root", "root", "{8D3E4CB2-41D6-4AA6-B9E4-CFCAB0E2F5BC}" - ProjectSection(SolutionItems) = preProject - .dockerignore = .dockerignore - .editorconfig = .editorconfig - .gitignore = .gitignore - Dockerfile = Dockerfile - Dockerfile.bak = Dockerfile.bak - entrypoint.sh = entrypoint.sh - README.md = README.md - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libraries", "libraries", "{5237F8A4-67F5-4751-B8B2-B93A06791480}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{A0343C94-486E-4A06-9A64-0584D20A4728}" - ProjectSection(SolutionItems) = preProject - docs\API.md = docs\API.md - docs\DAL.md = docs\DAL.md - docs\DATABASE.md = docs\DATABASE.md - docs\GITHUB-ACTIONS.md = docs\GITHUB-ACTIONS.md - docs\SETUP.md = docs\SETUP.md - docs\TOOLS.md = docs\TOOLS.md - docs\VERSIONING.md = docs\VERSIONING.md - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{F256F2A5-0DBF-4137-A7D6-21F08111BD4A}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unit", "unit", "{3D70B211-74A8-484C-9B86-B0A2835C71E7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Api.Test", "tests\unit\api\Pims.Api.Test.csproj", "{1F4E301C-F03B-4A31-A6F2-6A77384A74DA}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Dal.Test", "tests\unit\dal\Pims.Dal.Test.csproj", "{412BF533-2759-4FBE-B4C6-B89DB44FB6B5}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "core", "core", "{04780892-FC30-4B6B-A10C-5795C657E574}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Core.Test", "tests\core\Pims.Core.Test.csproj", "{5A83C636-741A-4795-8588-70F033E79B5A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Geocoder", "geocoder\Pims.Geocoder.csproj", "{BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Ches", "ches\Pims.Ches.csproj", "{08A82D74-0854-498F-9C74-E0A7242FE430}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Notifications", "notifications\Pims.Notifications.csproj", "{3942CAF2-93CE-45BC-A734-3247D266ECE6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pims.Ltsa", "ltsa\Pims.Ltsa.csproj", "{4DB543FF-19CF-4FA8-B772-2AE7E6721F86}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {16BC0468-78F6-4C91-87DA-7403C919E646}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {16BC0468-78F6-4C91-87DA-7403C919E646}.Debug|Any CPU.Build.0 = Debug|Any CPU - {16BC0468-78F6-4C91-87DA-7403C919E646}.Debug|x64.ActiveCfg = Debug|Any CPU - {16BC0468-78F6-4C91-87DA-7403C919E646}.Debug|x64.Build.0 = Debug|Any CPU - {16BC0468-78F6-4C91-87DA-7403C919E646}.Debug|x86.ActiveCfg = Debug|Any CPU - {16BC0468-78F6-4C91-87DA-7403C919E646}.Debug|x86.Build.0 = Debug|Any CPU - {16BC0468-78F6-4C91-87DA-7403C919E646}.Release|Any CPU.ActiveCfg = Release|Any CPU - {16BC0468-78F6-4C91-87DA-7403C919E646}.Release|Any CPU.Build.0 = Release|Any CPU - {16BC0468-78F6-4C91-87DA-7403C919E646}.Release|x64.ActiveCfg = Release|Any CPU - {16BC0468-78F6-4C91-87DA-7403C919E646}.Release|x64.Build.0 = Release|Any CPU - {16BC0468-78F6-4C91-87DA-7403C919E646}.Release|x86.ActiveCfg = Release|Any CPU - {16BC0468-78F6-4C91-87DA-7403C919E646}.Release|x86.Build.0 = Release|Any CPU - {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Debug|x64.ActiveCfg = Debug|Any CPU - {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Debug|x64.Build.0 = Debug|Any CPU - {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Debug|x86.ActiveCfg = Debug|Any CPU - {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Debug|x86.Build.0 = Debug|Any CPU - {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Release|Any CPU.Build.0 = Release|Any CPU - {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Release|x64.ActiveCfg = Release|Any CPU - {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Release|x64.Build.0 = Release|Any CPU - {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Release|x86.ActiveCfg = Release|Any CPU - {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Release|x86.Build.0 = Release|Any CPU - {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Debug|x64.ActiveCfg = Debug|Any CPU - {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Debug|x64.Build.0 = Debug|Any CPU - {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Debug|x86.ActiveCfg = Debug|Any CPU - {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Debug|x86.Build.0 = Debug|Any CPU - {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Release|Any CPU.Build.0 = Release|Any CPU - {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Release|x64.ActiveCfg = Release|Any CPU - {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Release|x64.Build.0 = Release|Any CPU - {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Release|x86.ActiveCfg = Release|Any CPU - {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Release|x86.Build.0 = Release|Any CPU - {970903E9-BC53-436F-BA77-C62349546425}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {970903E9-BC53-436F-BA77-C62349546425}.Debug|Any CPU.Build.0 = Debug|Any CPU - {970903E9-BC53-436F-BA77-C62349546425}.Debug|x64.ActiveCfg = Debug|Any CPU - {970903E9-BC53-436F-BA77-C62349546425}.Debug|x64.Build.0 = Debug|Any CPU - {970903E9-BC53-436F-BA77-C62349546425}.Debug|x86.ActiveCfg = Debug|Any CPU - {970903E9-BC53-436F-BA77-C62349546425}.Debug|x86.Build.0 = Debug|Any CPU - {970903E9-BC53-436F-BA77-C62349546425}.Release|Any CPU.ActiveCfg = Release|Any CPU - {970903E9-BC53-436F-BA77-C62349546425}.Release|Any CPU.Build.0 = Release|Any CPU - {970903E9-BC53-436F-BA77-C62349546425}.Release|x64.ActiveCfg = Release|Any CPU - {970903E9-BC53-436F-BA77-C62349546425}.Release|x64.Build.0 = Release|Any CPU - {970903E9-BC53-436F-BA77-C62349546425}.Release|x86.ActiveCfg = Release|Any CPU - {970903E9-BC53-436F-BA77-C62349546425}.Release|x86.Build.0 = Release|Any CPU - {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Debug|x64.ActiveCfg = Debug|Any CPU - {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Debug|x64.Build.0 = Debug|Any CPU - {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Debug|x86.ActiveCfg = Debug|Any CPU - {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Debug|x86.Build.0 = Debug|Any CPU - {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Release|Any CPU.Build.0 = Release|Any CPU - {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Release|x64.ActiveCfg = Release|Any CPU - {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Release|x64.Build.0 = Release|Any CPU - {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Release|x86.ActiveCfg = Release|Any CPU - {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Release|x86.Build.0 = Release|Any CPU - {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Debug|x64.ActiveCfg = Debug|Any CPU - {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Debug|x64.Build.0 = Debug|Any CPU - {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Debug|x86.ActiveCfg = Debug|Any CPU - {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Debug|x86.Build.0 = Debug|Any CPU - {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Release|Any CPU.Build.0 = Release|Any CPU - {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Release|x64.ActiveCfg = Release|Any CPU - {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Release|x64.Build.0 = Release|Any CPU - {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Release|x86.ActiveCfg = Release|Any CPU - {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Release|x86.Build.0 = Release|Any CPU - {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Debug|x64.ActiveCfg = Debug|Any CPU - {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Debug|x64.Build.0 = Debug|Any CPU - {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Debug|x86.ActiveCfg = Debug|Any CPU - {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Debug|x86.Build.0 = Debug|Any CPU - {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Release|Any CPU.Build.0 = Release|Any CPU - {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Release|x64.ActiveCfg = Release|Any CPU - {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Release|x64.Build.0 = Release|Any CPU - {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Release|x86.ActiveCfg = Release|Any CPU - {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Release|x86.Build.0 = Release|Any CPU - {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Debug|x64.ActiveCfg = Debug|Any CPU - {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Debug|x64.Build.0 = Debug|Any CPU - {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Debug|x86.ActiveCfg = Debug|Any CPU - {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Debug|x86.Build.0 = Debug|Any CPU - {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Release|Any CPU.Build.0 = Release|Any CPU - {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Release|x64.ActiveCfg = Release|Any CPU - {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Release|x64.Build.0 = Release|Any CPU - {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Release|x86.ActiveCfg = Release|Any CPU - {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Release|x86.Build.0 = Release|Any CPU - {5A83C636-741A-4795-8588-70F033E79B5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5A83C636-741A-4795-8588-70F033E79B5A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5A83C636-741A-4795-8588-70F033E79B5A}.Debug|x64.ActiveCfg = Debug|Any CPU - {5A83C636-741A-4795-8588-70F033E79B5A}.Debug|x64.Build.0 = Debug|Any CPU - {5A83C636-741A-4795-8588-70F033E79B5A}.Debug|x86.ActiveCfg = Debug|Any CPU - {5A83C636-741A-4795-8588-70F033E79B5A}.Debug|x86.Build.0 = Debug|Any CPU - {5A83C636-741A-4795-8588-70F033E79B5A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5A83C636-741A-4795-8588-70F033E79B5A}.Release|Any CPU.Build.0 = Release|Any CPU - {5A83C636-741A-4795-8588-70F033E79B5A}.Release|x64.ActiveCfg = Release|Any CPU - {5A83C636-741A-4795-8588-70F033E79B5A}.Release|x64.Build.0 = Release|Any CPU - {5A83C636-741A-4795-8588-70F033E79B5A}.Release|x86.ActiveCfg = Release|Any CPU - {5A83C636-741A-4795-8588-70F033E79B5A}.Release|x86.Build.0 = Release|Any CPU - {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Debug|x64.ActiveCfg = Debug|Any CPU - {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Debug|x64.Build.0 = Debug|Any CPU - {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Debug|x86.ActiveCfg = Debug|Any CPU - {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Debug|x86.Build.0 = Debug|Any CPU - {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Release|Any CPU.Build.0 = Release|Any CPU - {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Release|x64.ActiveCfg = Release|Any CPU - {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Release|x64.Build.0 = Release|Any CPU - {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Release|x86.ActiveCfg = Release|Any CPU - {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Release|x86.Build.0 = Release|Any CPU - {08A82D74-0854-498F-9C74-E0A7242FE430}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {08A82D74-0854-498F-9C74-E0A7242FE430}.Debug|Any CPU.Build.0 = Debug|Any CPU - {08A82D74-0854-498F-9C74-E0A7242FE430}.Debug|x64.ActiveCfg = Debug|Any CPU - {08A82D74-0854-498F-9C74-E0A7242FE430}.Debug|x64.Build.0 = Debug|Any CPU - {08A82D74-0854-498F-9C74-E0A7242FE430}.Debug|x86.ActiveCfg = Debug|Any CPU - {08A82D74-0854-498F-9C74-E0A7242FE430}.Debug|x86.Build.0 = Debug|Any CPU - {08A82D74-0854-498F-9C74-E0A7242FE430}.Release|Any CPU.ActiveCfg = Release|Any CPU - {08A82D74-0854-498F-9C74-E0A7242FE430}.Release|Any CPU.Build.0 = Release|Any CPU - {08A82D74-0854-498F-9C74-E0A7242FE430}.Release|x64.ActiveCfg = Release|Any CPU - {08A82D74-0854-498F-9C74-E0A7242FE430}.Release|x64.Build.0 = Release|Any CPU - {08A82D74-0854-498F-9C74-E0A7242FE430}.Release|x86.ActiveCfg = Release|Any CPU - {08A82D74-0854-498F-9C74-E0A7242FE430}.Release|x86.Build.0 = Release|Any CPU - {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Debug|x64.ActiveCfg = Debug|Any CPU - {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Debug|x64.Build.0 = Debug|Any CPU - {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Debug|x86.ActiveCfg = Debug|Any CPU - {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Debug|x86.Build.0 = Debug|Any CPU - {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Release|Any CPU.Build.0 = Release|Any CPU - {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Release|x64.ActiveCfg = Release|Any CPU - {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Release|x64.Build.0 = Release|Any CPU - {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Release|x86.ActiveCfg = Release|Any CPU - {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Release|x86.Build.0 = Release|Any CPU - {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Debug|x64.ActiveCfg = Debug|Any CPU - {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Debug|x64.Build.0 = Debug|Any CPU - {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Debug|x86.ActiveCfg = Debug|Any CPU - {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Debug|x86.Build.0 = Debug|Any CPU - {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Release|Any CPU.Build.0 = Release|Any CPU - {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Release|x64.ActiveCfg = Release|Any CPU - {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Release|x64.Build.0 = Release|Any CPU - {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Release|x86.ActiveCfg = Release|Any CPU - {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3} = {5237F8A4-67F5-4751-B8B2-B93A06791480} - {1C724CD5-CD24-46CD-835A-A83F673F97B5} = {5237F8A4-67F5-4751-B8B2-B93A06791480} - {970903E9-BC53-436F-BA77-C62349546425} = {5237F8A4-67F5-4751-B8B2-B93A06791480} - {AC8F04FF-3164-41FB-9EDF-E468B8B77837} = {5237F8A4-67F5-4751-B8B2-B93A06791480} - {5697DD19-62CC-4377-ABA8-1E192376F4F6} = {5237F8A4-67F5-4751-B8B2-B93A06791480} - {3D70B211-74A8-484C-9B86-B0A2835C71E7} = {F256F2A5-0DBF-4137-A7D6-21F08111BD4A} - {1F4E301C-F03B-4A31-A6F2-6A77384A74DA} = {3D70B211-74A8-484C-9B86-B0A2835C71E7} - {412BF533-2759-4FBE-B4C6-B89DB44FB6B5} = {3D70B211-74A8-484C-9B86-B0A2835C71E7} - {04780892-FC30-4B6B-A10C-5795C657E574} = {F256F2A5-0DBF-4137-A7D6-21F08111BD4A} - {5A83C636-741A-4795-8588-70F033E79B5A} = {04780892-FC30-4B6B-A10C-5795C657E574} - {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC} = {5237F8A4-67F5-4751-B8B2-B93A06791480} - {08A82D74-0854-498F-9C74-E0A7242FE430} = {5237F8A4-67F5-4751-B8B2-B93A06791480} - {3942CAF2-93CE-45BC-A734-3247D266ECE6} = {5237F8A4-67F5-4751-B8B2-B93A06791480} - {4DB543FF-19CF-4FA8-B772-2AE7E6721F86} = {5237F8A4-67F5-4751-B8B2-B93A06791480} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {3433C5DD-DC49-4A96-A1AE-90C1A1EBA87C} - EndGlobalSection -EndGlobal diff --git a/backend/README.md b/backend/README.md deleted file mode 100644 index 2c12b9146b..0000000000 --- a/backend/README.md +++ /dev/null @@ -1,78 +0,0 @@ -# PIMS RESTful API - .NET CORE - -The PIMS API provides an RESTful interface to interact with the configured data-source. - -The API is configured to run in a Docker container and has the following dependencies with other containers; database. - -For more information refer to documentation [here](https://github.com/bcgov/PIMS/wiki/api/API.md). - -To run the API locally you will need to create the appropriate environment variable `.env` files. You can do this through using the prebuilt scripts [here](../../scripts/README.md). - -## API Environment Variables - -The current environment is initialized through the environment variable `ASPNETCORE_ENVIRONMENT`. - -When running the solution it applies the configuration setting in the following order; - -> NOTE: When the environment is Development it will look for your _User Secrets_ file. - -1. appsettings.json -2. appsettings.`[environment]`.json -3. User Secrets `(if environment=Development)` -4. Environment Variables - -To run the solution with docker-compose create a `.env` file within the `/api` directory and populate with the following; - -```conf -ConnectionStrings__PIMS={connection string} # For local debugging in VSCode - -ASPNETCORE_ENVIRONMENT=Development -ASPNETCORE_URLS=http://*:8080 #http://*:8081 for debugging -DB_PASSWORD={password} - -Keycloak__Secret={secret} -Keycloak__ServiceAccount__Secret={secret} -Keycloak__FrontendClientId={client id} - -Ches__Username={secret} -Ches__Password={password} -Ches__OverrideTo={email} - -Ltsa__IntegratorUsername={username} -Ltsa__IntegratorPassword={password} -Ltsa__UserName={username} -Ltsa__UserPassword={password} -``` - -| Key | Required | Value | Description | -| ----------------------------------- | :------: | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -| ASPNETCORE_ENVIRONMENT | x | [Development\|Staging\|Production] | The environment name to run under. This will result in apply different configuration settings. | -| ASPNETCORE_URLS | x | {http://*:8080} | The host addresses with ports and protocols that the server will listen to. | -| DB_PASSWORD | x | {password} | The password to the database. If using MSSQL it will require a complex password. Needs to be the same value found in the `/database/mssql/.env` file. | -| ConnectionStrings\_\_PIMS | | {connection string} | To override the `appsettings.[environment].json` configuration files you can set the connection string value here. | - - -## Running Locally - -To run the API locally with vscode, comment out the following lines, and add the `ConnectionStrings__PIMS` value in your `.env` file; - -```conf -# ASPNETCORE_ENVIRONMENT=Development -# ASPNETCORE_URLS=http://*:8080 -ConnectionStrings__PIMS=Server=localhost,5433;Database=pims;User ID=admin;Encrypt=False -``` - -This is so that the `/.vscode/launch.json` configured environment variables are used instead. Specifically it will run with the following; - -```json -{ - "configurations": [{ - ... - "env": { - "ASPNETCORE_ENVIRONMENT": "Local", - "ASPNETCORE_URLS": "http://*:5000" - } - ... - }] -} -``` diff --git a/backend/api/Areas/Admin/Controllers/AccessRequestController.cs b/backend/api/Areas/Admin/Controllers/AccessRequestController.cs deleted file mode 100644 index 2bd6e94f0c..0000000000 --- a/backend/api/Areas/Admin/Controllers/AccessRequestController.cs +++ /dev/null @@ -1,103 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Pims.Api.Policies; -using Pims.Dal.Security; -using Pims.Dal.Services.Admin; -using Swashbuckle.AspNetCore.Annotations; -using EModel = Pims.Dal.Entities.Models; -using Entity = Pims.Dal.Entities; -using IUserService = Pims.Dal.Services.IUserService; -using Model = Pims.Api.Areas.Admin.Models.User; -using PModel = Pims.Api.Models; - -namespace Pims.Api.Areas.Admin.Controllers -{ - /// - /// AccessRequestController class, provides endpoints for managing access requests. - /// - [HasPermission(Permissions.AdminUsers)] - [ApiController] - [Area("admin")] - [ApiVersion("1.0")] - [Route("v{version:apiVersion}/[area]/access/requests")] - [Route("[area]/access/requests")] - public class AccessRequestController : Controller - { - #region Properties - private readonly IPimsAdminService _pimsAdminService; - private readonly IMapper _mapper; - private readonly IUserService _userService; - #endregion - - #region Constructors - /// - /// Creates a new instance of an AccessRequestController object, initializes with specified parameters. - /// - /// - /// - /// - public AccessRequestController(IPimsAdminService pimsAdminService, - IMapper mapper, IUserService userService) - { - _pimsAdminService = pimsAdminService; - _userService = userService; - _mapper = mapper; - } - #endregion - - #region Endpoints - - /// - /// Get a list of access requests - /// - /// - /// - /// - /// - /// - /// - /// - /// - [HttpGet] - [Produces("application/json")] - [ProducesResponseType(typeof(PModel.PageModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-access-requests" })] - public IActionResult GetPage(int page = 1, int quantity = 10, string sort = null, - string searchText = null, string role = null, string agency = null, - Entity.AccessRequestStatus status = Entity.AccessRequestStatus.OnHold) - { - if (page < 1) page = 1; - if (quantity < 1) quantity = 1; - if (quantity > 20) quantity = 20; - - var filter = new EModel.AccessRequestFilter(page, quantity, new[] { sort }, searchText, role, agency, status); - - var result = _pimsAdminService.User.GetAccessRequests(filter); - var models = _mapper.Map(result.Items); - var paged = new PModel.PageModel(models, page, quantity, result.Total); - return new JsonResult(paged); - } - - /// - /// Delete an access requests - /// - /// - /// - [HttpDelete("{id}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.AccessRequestModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-access-requests" })] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "To support standardized routes ({id})")] - public IActionResult Delete(int id, [FromBody] Model.AccessRequestModel accessRequestModel) - { - var entity = _mapper.Map(accessRequestModel); - _userService.DeleteAccessRequest(entity); - return new JsonResult(accessRequestModel); - } - #endregion - - } -} - diff --git a/backend/api/Areas/Admin/Controllers/AdministrativeAreaController.cs b/backend/api/Areas/Admin/Controllers/AdministrativeAreaController.cs deleted file mode 100644 index c7326afd46..0000000000 --- a/backend/api/Areas/Admin/Controllers/AdministrativeAreaController.cs +++ /dev/null @@ -1,183 +0,0 @@ -using Pims.Api.Helpers.Extensions; -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Pims.Api.Policies; -using Pims.Dal.Security; -using Pims.Dal.Services.Admin; -using Swashbuckle.AspNetCore.Annotations; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.AdministrativeArea; -using EModel = Pims.Dal.Entities.Models; -using Pims.Dal.Keycloak; - -namespace Pims.Api.Areas.Admin.Controllers -{ - /// - /// AdministrativeArea class, provides endpoints for managing administrative areas. - /// - [HasPermission(Permissions.SystemAdmin)] - [ApiController] - [Area("admin")] - [ApiVersion("1.0")] - [Route("v{version:apiVersion}/[area]/administrative/areas")] - [Route("[area]/administrative/areas")] - public class AdministrativeAreaController : ControllerBase - { - #region Variables - - private readonly IPimsAdminService _pimsAdminService; - private readonly IMapper _mapper; - - #endregion - - #region Constructors - - /// - /// Creates a new instance of a AdministrativeAreaController class. - /// - /// - /// - /// - public AdministrativeAreaController(IPimsAdminService pimsAdminService, IPimsKeycloakService keycloakService, - IMapper mapper) - { - _pimsAdminService = pimsAdminService; - _mapper = mapper; - } - - #endregion - - #region Endpoints - - /// - /// GET - Returns a paged list of administrative areas from the datasource. - /// - /// Array of administrative areas. - [HttpGet] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.AdministrativeAreaModel[]), 200)] - [SwaggerOperation(Tags = new[] { "admin-administrative-area" })] - public IActionResult GetAdministrativeAreas() - { - var adminAreas = _pimsAdminService.AdministrativeArea.GetAll(); - return new JsonResult(_mapper.Map(adminAreas)); - } - - /// - /// GET - Returns a paged array of administrative areas from the datasource. - /// - /// - /// Paged object with an array of administrative areas. - [HttpPost("filter")] - [Produces("application/json")] - [ProducesResponseType(typeof(Api.Models.PageModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-administrative-area" })] - public IActionResult GetAdministrativeAreas(EModel.AdministrativeAreaFilter filter) - { - var page = _pimsAdminService.AdministrativeArea.Get(filter); - var result = _mapper.Map>(page); - return new JsonResult(result); - } - - /// - /// GET - Returns a administrative area for the specified 'id' from the datasource. - /// - /// The unique 'id' for the admin area to return. - /// The administrative area requested. - [HttpGet("{id}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.AdministrativeAreaModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-administrative-area" })] - public IActionResult GetAdministrativeArea(int id) - { - var adminArea = _pimsAdminService.AdministrativeArea.Get(id); - return new JsonResult(_mapper.Map(adminArea)); - } - - /// - /// PUT - Update an administrative area in the datasource. - /// - /// The administrative area model. - /// The administrative area updated. - [HttpPut("{id}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.AdministrativeAreaModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-administrative-area" })] - public IActionResult UpdateAdministrativeAreaAsync([FromBody] Model.AdministrativeAreaModel model) - { - var entity = _mapper.Map(model); - try - { - _pimsAdminService.AdministrativeArea.Update(entity); - - var adminArea = _mapper.Map(entity); - return new JsonResult(adminArea); - } - catch (DbUpdateException ex) - { - var duplicateError = ex.CheckErrorMessageForDuplicate("Error while updating Administrative Area."); - if (duplicateError != null) - { - return BadRequest(duplicateError); - } - throw; - } - } - - /// - /// POST - Add a new administrative area to the datasource. - /// - /// The administrative area model. - /// The administrative area added. - [HttpPost] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.AdministrativeAreaModel), 201)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-administrative-area" })] - public IActionResult AddAdministrativeArea([FromBody] Model.AdministrativeAreaModel model) - { - var entity = _mapper.Map(model); - try - { - _pimsAdminService.AdministrativeArea.Add(entity); - - var administrativeArea = _mapper.Map(entity); - - return CreatedAtAction(nameof(GetAdministrativeArea), new { id = administrativeArea.Id }, - administrativeArea); - } - catch (DbUpdateException ex) - { - var duplicateError = ex.CheckErrorMessageForDuplicate("Error while adding Administrative Area."); - if (duplicateError != null) - { - return BadRequest(duplicateError); - } - throw; - } - } - - /// - /// DELETE - Delete the administrative area from the datasource. - /// - /// The administrative area model. - /// The administrative area that was deleted. - [HttpDelete("{id}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.AdministrativeAreaModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-administrative-area" })] - public IActionResult DeleteAdministrativeAreaAsync([FromBody] Model.AdministrativeAreaModel model) - { - var entity = _mapper.Map(model); - _pimsAdminService.AdministrativeArea.Remove(entity); - - return new JsonResult(model); - } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Controllers/AgencyController.cs b/backend/api/Areas/Admin/Controllers/AgencyController.cs deleted file mode 100644 index b99b683fdb..0000000000 --- a/backend/api/Areas/Admin/Controllers/AgencyController.cs +++ /dev/null @@ -1,177 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Pims.Api.Policies; -using Pims.Dal.Security; -using Pims.Dal.Services.Admin; -using Swashbuckle.AspNetCore.Annotations; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.Agency; -using EModel = Pims.Dal.Entities.Models; -using Pims.Dal.Keycloak; -using Pims.Core.Extensions; -using System.Threading.Tasks; -using System.Collections.Generic; - -namespace Pims.Api.Areas.Admin.Controllers -{ - /// - /// AgencyController class, provides endpoints for managing agencys. - /// - [HasPermission(Permissions.AgencyAdmin)] - [ApiController] - [Area("admin")] - [ApiVersion("1.0")] - [Route("v{version:apiVersion}/[area]/agencies")] - [Route("[area]/agencies")] - public class AgencyController : ControllerBase - { - #region Variables - private readonly IPimsAdminService _pimsAdminService; - private readonly IPimsKeycloakService _pimsKeycloakService; - private readonly IMapper _mapper; - #endregion - - #region Constructors - /// - /// Creates a new instance of a AgencyController class. - /// - /// - /// - /// - public AgencyController(IPimsAdminService pimsAdminService, IPimsKeycloakService keycloakService, IMapper mapper) - { - _pimsAdminService = pimsAdminService; - _pimsKeycloakService = keycloakService; - _mapper = mapper; - } - #endregion - - #region Endpoints - /// - /// GET - Returns a paged array of agencys from the datasource. - /// - /// Paged object with an array of agencys. - [HttpGet] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-agency" })] - public IActionResult GetAgencies() - { - var agencies = _pimsAdminService.Agency.GetAll(); - return new JsonResult(_mapper.Map(agencies)); - } - - /// - /// GET - Returns a agency for the specified 'id' from the datasource. - /// - /// The unique 'id' for the agency to return. - /// The agency requested. - [HttpGet("{id}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.AgencyModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-agency" })] - public IActionResult GetAgency(int id) - { - var agency = _pimsAdminService.Agency.Get(id); - return new JsonResult(_mapper.Map(agency)); - } - - /// - /// GET - Returns a paged array of agencies from the datasource. - /// - /// - /// Paged object with an array of agencies. - [HttpPost("filter")] - [Produces("application/json")] - [ProducesResponseType(typeof(Api.Models.PageModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-agency" })] - public IActionResult GetAgencies(EModel.AgencyFilter filter) - { - var page = _pimsAdminService.Agency.Get(filter); - var result = _mapper.Map>(page); - return new JsonResult(result); - } - - /// - /// POST - Add a new agency to the datasource. - /// - /// The agency model. - /// The agency added. - [HttpPost] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.AgencyModel), 201)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-agency" })] - public async Task AddAgencyAsync([FromBody] Model.AgencyModel model) - { - var entity = _mapper.Map(model); - _pimsAdminService.Agency.Add(entity); - - // TODO: This isn't ideal as the db update may be successful but this request may not. - await entity.Users.ForEachAsync(async u => - { - var user = _pimsAdminService.User.Get(u.UserId); - await _pimsKeycloakService.UpdateUserAsync(user); - }); - - var agency = _mapper.Map(entity); - - return CreatedAtAction(nameof(GetAgency), new { id = agency.Id }, agency); - } - - /// - /// PUT - Update the agency in the datasource. - /// - /// The agency model. - /// The agency updated. - [HttpPut("{id}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.AgencyModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-agency" })] - public async Task UpdateAgencyAsync([FromBody] Model.AgencyModel model) - { - var entity = _mapper.Map(model); - _pimsAdminService.Agency.Update(entity); - - // TODO: This isn't ideal as the db update may be successful but this request may not. - await entity.Users.ForEachAsync(async u => - { - var user = _pimsAdminService.User.Get(u.UserId); - await _pimsKeycloakService.UpdateUserAsync(user); - }); - - var agency = _mapper.Map(entity); - return new JsonResult(agency); - } - - /// - /// DELETE - Delete the agency from the datasource. - /// - /// The agency model. - /// The agency who was deleted. - [HttpDelete("{id}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.AgencyModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-agency" })] - public async Task DeleteAgencyAsync([FromBody] Model.AgencyModel model) - { - var entity = _mapper.Map(model); - _pimsAdminService.Agency.Remove(entity); - - // TODO: This isn't ideal as the db update may be successful but this request may not. - await entity.Users.ForEachAsync(async u => - { - var user = _pimsAdminService.User.Get(u.UserId); - await _pimsKeycloakService.UpdateUserAsync(user); - }); - - return new JsonResult(model); - } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Controllers/ClaimController.cs b/backend/api/Areas/Admin/Controllers/ClaimController.cs deleted file mode 100644 index 6d3e8d6293..0000000000 --- a/backend/api/Areas/Admin/Controllers/ClaimController.cs +++ /dev/null @@ -1,145 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Pims.Api.Policies; -using Pims.Dal.Entities; -using Pims.Dal.Security; -using Pims.Dal.Services.Admin; -using Swashbuckle.AspNetCore.Annotations; -using System; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.Claim; - -namespace Pims.Api.Areas.Admin.Controllers -{ - /// - /// ClaimController class, provides endpoints for managing claims. - /// - [HasPermission(Permissions.SystemAdmin)] - [ApiController] - [Area("admin")] - [ApiVersion("1.0")] - [Route("v{version:apiVersion}/[area]/claims")] - [Route("[area]/claims")] - public class ClaimController : ControllerBase - { - #region Variables - private readonly IPimsAdminService _pimsAdminService; - private readonly IMapper _mapper; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ClaimController class, initializes it with the specified arguments. - /// - /// - /// - public ClaimController(IPimsAdminService pimsAdminService, IMapper mapper) - { - _pimsAdminService = pimsAdminService; - _mapper = mapper; - } - #endregion - - #region Endpoints - /// - /// GET - Returns a paged array of claims from the datasource. - /// - /// - /// - /// - /// Paged object with an array of claims. - [HttpGet] - [Produces("application/json")] - [ProducesResponseType(typeof(Api.Models.PageModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-claim" })] - public IActionResult GetClaims(int page = 1, int quantity = 10, string name = null) - { - if (page < 1) page = 1; - if (quantity < 1) quantity = 1; - if (quantity > 50) quantity = 50; - - var paged = _pimsAdminService.Claim.Get(page, quantity, name); - var result = _mapper.Map>(paged); - return new JsonResult(result); - } - - /// - /// GET - Returns a claim for the specified 'id' from the datasource. - /// - /// The unique 'id' for the claim to return. - /// The claim requested. - [HttpGet("{id}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.ClaimModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-claim" })] - public IActionResult GetClaim(Guid id) - { - var entity = _pimsAdminService.Claim.Get(id); - var claim = _mapper.Map(entity); - return new JsonResult(claim); - } - - /// - /// POST - Add a new claim to the datasource. - /// - /// The claim model. - /// The claim added. - [HttpPost] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.ClaimModel), 201)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-claim" })] - public IActionResult AddClaim([FromBody] Model.ClaimModel model) - { - var entity = _mapper.Map(model); // TODO: Return bad request. - _pimsAdminService.Claim.Add(entity); - var claim = _mapper.Map(entity); - - return CreatedAtAction(nameof(GetClaim), new { id = claim.Id }, claim); - } - - /// - /// PUT - Update the claim in the datasource. - /// - /// - /// The claim model. - /// The claim updated. - [HttpPut("{id}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.ClaimModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-claim" })] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Parameter 'id' is required for route.")] - public IActionResult UpdateClaim(Guid id, [FromBody] Model.ClaimModel model) - { - var entity = _mapper.Map(model); - _pimsAdminService.Claim.Update(entity); - - var claim = _mapper.Map(entity); - return new JsonResult(claim); - } - - /// - /// DELETE - Delete the claim from the datasource. - /// - /// - /// The claim model. - /// The claim who was deleted. - [HttpDelete("{id}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.ClaimModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-claim" })] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Parameter 'id' is required for route.")] - public IActionResult DeleteClaim(Guid id, [FromBody] Model.ClaimModel model) - { - var entity = _mapper.Map(model); - _pimsAdminService.Claim.Remove(entity); - - return new JsonResult(model); - } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Controllers/RoleController.cs b/backend/api/Areas/Admin/Controllers/RoleController.cs deleted file mode 100644 index 2385e1eeef..0000000000 --- a/backend/api/Areas/Admin/Controllers/RoleController.cs +++ /dev/null @@ -1,166 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -using Pims.Api.Policies; -using Pims.Dal.Entities; -using Pims.Dal.Security; -using Pims.Dal.Services.Admin; -using Swashbuckle.AspNetCore.Annotations; -using System; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.Role; - -namespace Pims.Api.Areas.Admin.Controllers -{ - /// - /// RoleController class, provides endpoints for managing roles. - /// - [HasPermission(Permissions.AdminRoles)] - [ApiController] - [Area("admin")] - [ApiVersion("1.0")] - [Route("v{version:apiVersion}/[area]/roles")] - [Route("[area]/roles")] - public class RoleController : ControllerBase - { - #region Variables - private readonly ILogger _logger; - private readonly IPimsAdminService _pimsAdminService; - private readonly IMapper _mapper; - #endregion - - #region Constructors - /// - /// Creates a new instance of a RoleController class, initializes it with the specified arguments. - /// - /// - /// - /// - public RoleController(ILogger logger, IPimsAdminService pimsAdminService, IMapper mapper) - { - _logger = logger; - _pimsAdminService = pimsAdminService; - _mapper = mapper; - } - #endregion - - #region Endpoints - /// - /// GET - Returns a paged array of roles from the datasource. - /// - /// - /// - /// - /// Paged object with an array of roles. - [HttpGet] - [Produces("application/json")] - [ProducesResponseType(typeof(Api.Models.PageModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-role" })] - public IActionResult GetRoles(int page = 1, int quantity = 10, string name = null) - { - if (page < 1) page = 1; - if (quantity < 1) quantity = 1; - if (quantity > 50) quantity = 50; - - var paged = _pimsAdminService.Role.Get(page, quantity, name); - var result = _mapper.Map>(paged); - return new JsonResult(result); - } - - /// - /// GET - Returns a role for the specified 'id' from the datasource. - /// - /// The unique 'id' for the role to return. - /// The role requested. - [HttpGet("{id}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.RoleModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-role" })] - public IActionResult GetRole(Guid id) - { - var entity = _pimsAdminService.Role.Get(id); - var role = _mapper.Map(entity); - return new JsonResult(role); - } - - /// - /// GET - Returns a role for the specified 'name' from the datasource. - /// - /// The unique 'name' for the role to return. - /// The role requested. - [HttpGet("name/{name}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.RoleModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-role" })] - public IActionResult GetRoleByName(string name) - { - var entity = _pimsAdminService.Role.GetByName(name); - var role = _mapper.Map(entity); - return new JsonResult(role); - } - - /// - /// POST - Add a new role to the datasource. - /// - /// The role model. - /// The role added. - [HttpPost] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.RoleModel), 201)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-role" })] - public IActionResult AddRole([FromBody] Model.RoleModel model) - { - var entity = _mapper.Map(model); // TODO: Return bad request. - _pimsAdminService.Role.Add(entity); - var role = _mapper.Map(entity); - - return CreatedAtAction(nameof(GetRole), new { id = role.Id }, role); - } - - /// - /// PUT - Update the role in the datasource. - /// - /// - /// The role model. - /// The role updated. - [HttpPut("{id}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.RoleModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-role" })] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Parameter 'id' is required for route.")] - public IActionResult UpdateRole(Guid id, [FromBody] Model.RoleModel model) - { - var entity = _mapper.Map(model); - _pimsAdminService.Role.Update(entity); - - var role = _mapper.Map(entity); - return new JsonResult(role); - } - - /// - /// DELETE - Delete the role from the datasource. - /// - /// - /// The role model. - /// The role who was deleted. - [HttpDelete("{id}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.RoleModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-role" })] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Parameter 'id' is required for route.")] - public IActionResult DeleteRole(Guid id, [FromBody] Model.RoleModel model) - { - var entity = _mapper.Map(model); - _pimsAdminService.Role.Remove(entity); - - return new JsonResult(model); - } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Controllers/UserController.cs b/backend/api/Areas/Admin/Controllers/UserController.cs deleted file mode 100644 index 292e02c1ea..0000000000 --- a/backend/api/Areas/Admin/Controllers/UserController.cs +++ /dev/null @@ -1,263 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Http.Extensions; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -using Pims.Api.Policies; -using Pims.Dal.Security; -using Pims.Dal.Services.Admin; -using Swashbuckle.AspNetCore.Annotations; -using System; -using EModel = Pims.Dal.Entities.Models; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.User; -using GoldModel = Pims.Api.Areas.Admin.Models.GoldUser; -using System.Linq; - -namespace Pims.Api.Areas.Admin.Controllers -{ - /// - /// UserController class, provides endpoints for managing users. - /// - [HasPermission(Permissions.AdminUsers)] - [ApiController] - [Area("admin")] - [ApiVersion("1.0")] - [Route("v{version:apiVersion}/[area]/users")] - [Route("[area]/users")] - public class UserController : ControllerBase - { - #region Variables - private readonly ILogger _logger; - private readonly IPimsAdminService _pimsAdminService; - private readonly IMapper _mapper; - private readonly object res; - #endregion - - #region Constructors - /// - /// Creates a new instance of a UserController class. - /// - /// - /// - /// - public UserController(ILogger logger, IPimsAdminService pimsAdminService, IMapper mapper) - { - _logger = logger; - _pimsAdminService = pimsAdminService; - _mapper = mapper; - } - #endregion - - #region Endpoints - /// - /// GET - Returns a paged array of users from the datasource. - /// - /// Paged object with an array of users. - [HttpGet] - [Produces("application/json")] - [ProducesResponseType(typeof(Api.Models.PageModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-user" })] - public IActionResult GetUsers() - { - var uri = new Uri(this.Request.GetDisplayUrl()); - var query = Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query); - return GetUsers(new EModel.UserFilter(query)); - } - - /// - /// POST - Returns a paged array of users from the datasource. - /// - /// - /// Paged object with an array of users. - [HttpPost("filter")] - [Produces("application/json")] - [ProducesResponseType(typeof(Api.Models.PageModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-user" })] - public IActionResult GetUsers(EModel.UserFilter filter) - { - var page = _pimsAdminService.User.Get(filter); - var result = _mapper.Map>(page); - return new JsonResult(result); - } - - /// - /// POST /api/admin/users/my/agency - Returns a paged array of users from the datasource that belong to the same agency (or sub-agency) as the current user. - /// - /// - /// Paged object with an array of users. - [HttpPost("my/agency")] - [Produces("application/json")] - [ProducesResponseType(typeof(Api.Models.PageModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-user" })] - public IActionResult GetMyUsers(EModel.UserFilter filter) - { - return GetUsers(filter); - } - - /// - /// GET /api/admin/users/${id} - Returns a user for the specified 'id' from the datasource. - /// - /// The unique 'id' for the user to return. - /// The user requested. - [HttpGet("{id}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.UserModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-user" })] - public IActionResult GetUser(Guid id) - { - var entity = _pimsAdminService.User.Get(id); - var user = _mapper.Map(entity); - return new JsonResult(user); - } - - /// - /// POST - Add a new user to the datasource. - /// - /// The user model. - /// The user added. - [HttpPost] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.UserModel), 201)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-user" })] - public IActionResult AddUser([FromBody] Model.UserModel model) - { - var entity = _mapper.Map(model); - _pimsAdminService.User.Add(entity); - - var user = _mapper.Map(entity); - - return CreatedAtAction(nameof(GetUser), new { id = user.Id }, user); - } - - /// - /// PUT /api/admin/user/{id} - Update the user in the datasource. - /// - /// - /// The user model. - /// The user updated. - [HttpPut("{id}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.UserModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-user" })] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Parameter 'id' is required for route.")] - public IActionResult UpdateUser(Guid id, [FromBody] Model.UserModel model) - { - var entity = _mapper.Map(model); - _pimsAdminService.User.Update(entity); - var user = _mapper.Map(entity); - return new JsonResult(user); - } - public class AddRolesToUserRequest - { - public string[] Roles { get; set; } - } - public class RemoveRolesToUserRequest - { - public string[] Roles { get; set; } - } - - /// - /// POST - Get all roles from the Keycloak Gold API. - /// - /// JSON Array of the user roles. - [HttpGet("getroles")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.UserModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-user" })] - public IActionResult GetRoles() - { - var res = _pimsAdminService.User.GetRolesAsync().Result; - return new JsonResult(res); - - } - - /// - /// DELETE - Remove a role from the user by calling the Keycloak Gold API. - /// - /// The user's username - /// - /// JSON Array of the users roles, updated with the one just added. - [HttpDelete("roles/{username}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.UserModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-user" })] - public IActionResult DeleteRoleFromUser(string username, [FromBody] RemoveRolesToUserRequest request) - { - var user = _pimsAdminService.User.Get(username); - var preferred_username = _pimsAdminService.User.GetUsersPreferredUsername(user.KeycloakUserId ?? Guid.Empty, user.Username.Split("@").Last()).Result; - foreach (var role in request.Roles) - { - var res = _pimsAdminService.User.DeleteRoleFromUser(preferred_username, role).Result; - } - return new JsonResult(res); - } - - - /// - /// POST - Add a role to the user by calling the Keycloak Gold API. - /// - /// The user's username - /// - /// JSON Array of the users roles, updated with the one just added. - [HttpPost("roles/{username}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.UserModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-user" })] - public IActionResult AddRoleToUser(string username, [FromBody] AddRolesToUserRequest request) - { - var user = _pimsAdminService.User.Get(username); - var preferred_username = _pimsAdminService.User.GetUsersPreferredUsername(user.KeycloakUserId ?? Guid.Empty, user.Username.Split("@").Last()).Result; - foreach (var role in request.Roles) - { - var res = _pimsAdminService.User.AddRoleToUser(preferred_username, role).Result; - } - return new JsonResult(res); - } - - /// - /// POST - Get roles for a specific user from the Keycloak Gold API. - /// - /// JSON Array of the user's roles. - [HttpGet("roles/{username}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.UserModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-user" })] - public IActionResult UserRoles(string username) - { - var res = _pimsAdminService.User.GetGoldUsersRolesAsync(username).Result; - return new JsonResult(res); - - } - - /// - /// DELETE - Delete the user from the datasource. - /// - /// - /// The user model. - /// The user who was deleted. - [HttpDelete("{id}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.UserModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "admin-user" })] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Parameter 'id' is required for route.")] - public IActionResult DeleteUser(Guid id, [FromBody] Model.UserModel model) - { - var entity = _mapper.Map(model); - _pimsAdminService.User.Remove(entity); - - return new JsonResult(model); - } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Mapping/AdministrativeArea/AdministrativeAreaMap.cs b/backend/api/Areas/Admin/Mapping/AdministrativeArea/AdministrativeAreaMap.cs deleted file mode 100644 index d42eac2550..0000000000 --- a/backend/api/Areas/Admin/Mapping/AdministrativeArea/AdministrativeAreaMap.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.AdministrativeArea; - -namespace Pims.Api.Areas.Admin.Mapping.AdministrativeArea -{ - public class AdministrativeAreaMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.GroupName, src => src.GroupName) - .Map(dest => dest.BoundaryType, src => src.BoundaryType) - .Map(dest => dest.Abbreviation, src => src.Abbreviation) - .Inherits, Api.Models.LookupModel>(); - - config.NewConfig() - .Map(dest => dest.GroupName, src => src.GroupName) - .Map(dest => dest.BoundaryType, src => src.BoundaryType) - .Map(dest => dest.Abbreviation, src => src.Abbreviation) - .Inherits, Entity.LookupEntity>(); - } - } -} diff --git a/backend/api/Areas/Admin/Mapping/Agency/AgencyMap.cs b/backend/api/Areas/Admin/Mapping/Agency/AgencyMap.cs deleted file mode 100644 index 5119f552b6..0000000000 --- a/backend/api/Areas/Admin/Mapping/Agency/AgencyMap.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.Agency; - -namespace Pims.Api.Areas.Admin.Mapping.Agency -{ - public class AgencyMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.Email, src => src.Email) - .Map(dest => dest.CcEmail, src => src.CCEmail) - .Map(dest => dest.SendEmail, src => src.SendEmail) - .Map(dest => dest.ParentId, src => src.ParentId) - .Map(dest => dest.AddressTo, src => src.AddressTo) - .Inherits, Api.Models.CodeModel>(); - - config.NewConfig() - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.Email, src => src.Email) - .Map(dest => dest.CCEmail, src => src.CcEmail) - .Map(dest => dest.SendEmail, src => src.SendEmail) - .Map(dest => dest.ParentId, src => src.ParentId) - .Map(dest => dest.AddressTo, src => src.AddressTo) - .Inherits, Entity.CodeEntity>(); - } - } -} diff --git a/backend/api/Areas/Admin/Mapping/Claim/ClaimMap.cs b/backend/api/Areas/Admin/Mapping/Claim/ClaimMap.cs deleted file mode 100644 index e212c5c4d2..0000000000 --- a/backend/api/Areas/Admin/Mapping/Claim/ClaimMap.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.Claim; - -namespace Pims.Api.Areas.Admin.Mapping.Claim -{ - public class ClaimMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.KeycloakRoleId, src => src.KeycloakRoleId) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.KeycloakRoleId, src => src.KeycloakRoleId) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Admin/Mapping/Parcel/AddressMap.cs b/backend/api/Areas/Admin/Mapping/Parcel/AddressMap.cs deleted file mode 100644 index 539c1a61a6..0000000000 --- a/backend/api/Areas/Admin/Mapping/Parcel/AddressMap.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Mapster; -using Pims.Core.Extensions; -using System; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.Parcel; - -namespace Pims.Api.Areas.Admin.Mapping.Parcel -{ - public class AddressMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .IgnoreNonMapped(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Line1, src => src.Address1) - .Map(dest => dest.Line2, src => src.Address2) - .Map(dest => dest.AdministrativeArea, src => src.AdministrativeArea) - .Map(dest => dest.ProvinceId, src => src.ProvinceId) - .Map(dest => dest.Province, src => src.Province == null ? null : src.Province.Name) - .Map(dest => dest.Postal, src => src.Postal.FormatAsPostal()) - .Inherits(); - - - config.NewConfig() - .IgnoreNonMapped(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Address1, src => src.Line1) - .Map(dest => dest.Address2, src => src.Line2) - .Map(dest => dest.AdministrativeArea, src => src.AdministrativeArea) - .Map(dest => dest.ProvinceId, src => src.ProvinceId) - .Map(dest => dest.Province, src => String.IsNullOrWhiteSpace(src.Province) ? null : new Entity.Province(src.ProvinceId, src.Province)) - .Map(dest => dest.Postal, src => src.Postal.Replace(" ", "")) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Admin/Mapping/Parcel/BuildingEvaluationMap.cs b/backend/api/Areas/Admin/Mapping/Parcel/BuildingEvaluationMap.cs deleted file mode 100644 index d8c9f002a7..0000000000 --- a/backend/api/Areas/Admin/Mapping/Parcel/BuildingEvaluationMap.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.Parcel; - -namespace Pims.Api.Areas.Admin.Mapping.Parcel -{ - public class BuildingEvaluationMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .IgnoreNonMapped(true) - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.Date, src => src.Date) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - - - config.NewConfig() - .IgnoreNonMapped(true) - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.Date, src => src.Date) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Admin/Mapping/Parcel/BuildingFiscalMap.cs b/backend/api/Areas/Admin/Mapping/Parcel/BuildingFiscalMap.cs deleted file mode 100644 index d9d8d71de2..0000000000 --- a/backend/api/Areas/Admin/Mapping/Parcel/BuildingFiscalMap.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.Parcel; - -namespace Pims.Api.Areas.Admin.Mapping.Parcel -{ - public class BuildingFiscalMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .IgnoreNonMapped(true) - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.FiscalYear, src => src.FiscalYear) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - - - config.NewConfig() - .IgnoreNonMapped(true) - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.FiscalYear, src => src.FiscalYear) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Admin/Mapping/Parcel/BuildingMap.cs b/backend/api/Areas/Admin/Mapping/Parcel/BuildingMap.cs deleted file mode 100644 index 74e3d509c7..0000000000 --- a/backend/api/Areas/Admin/Mapping/Parcel/BuildingMap.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Mapster; -using Pims.Api.Mapping.Converters; -using Pims.Dal.Helpers.Extensions; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.Parcel; - -namespace Pims.Api.Areas.Admin.Mapping.Parcel -{ - public class BuildingMap : IRegister - { - - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .IgnoreNonMapped(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Agency, src => AgencyConverter.ConvertAgency(src.Agency)) - .Map(dest => dest.SubAgency, src => AgencyConverter.ConvertSubAgency(src.Agency)) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.ParcelId, src => src.GetParcelId()) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.BuildingConstructionTypeId, src => src.BuildingConstructionTypeId) - .Map(dest => dest.BuildingConstructionType, src => src.GetConstructionType()) - .Map(dest => dest.BuildingOccupantTypeId, src => src.BuildingOccupantTypeId) - .Map(dest => dest.BuildingOccupantType, src => src.GetOccupantType()) - .Map(dest => dest.BuildingPredominateUseId, src => src.BuildingPredominateUseId) - .Map(dest => dest.BuildingPredominateUse, src => src.GetPredominateUse()) - .Map(dest => dest.BuildingTenancy, src => src.BuildingTenancy) - .Map(dest => dest.BuildingFloorCount, src => src.BuildingFloorCount) - .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry) - .Map(dest => dest.OccupantName, src => src.OccupantName) - .Map(dest => dest.RentableArea, src => src.RentableArea) - .Map(dest => dest.TotalArea, src => src.TotalArea) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Inherits(); - - config.NewConfig() - .IgnoreNonMapped(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.Location, src => src) - .Map(dest => dest.AddressId, src => src.Address == null ? 0 : src.Address.Id) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.BuildingConstructionTypeId, src => src.BuildingConstructionTypeId) - .Map(dest => dest.BuildingOccupantTypeId, src => src.BuildingOccupantTypeId) - .Map(dest => dest.BuildingPredominateUseId, src => src.BuildingPredominateUseId) - .Map(dest => dest.BuildingTenancy, src => src.BuildingTenancy) - .Map(dest => dest.BuildingFloorCount, src => src.BuildingFloorCount) - .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry) - .Map(dest => dest.OccupantName, src => src.OccupantName) - .Map(dest => dest.RentableArea, src => src.RentableArea) - .Map(dest => dest.TotalArea, src => src.TotalArea) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Inherits(); - - config.NewConfig() - .ConstructUsing(src => Dal.Helpers.GeometryHelper.CreatePoint(src.Longitude, src.Latitude)); - } - } -} diff --git a/backend/api/Areas/Admin/Mapping/Parcel/ParcelBuildingMap.cs b/backend/api/Areas/Admin/Mapping/Parcel/ParcelBuildingMap.cs deleted file mode 100644 index d628d95818..0000000000 --- a/backend/api/Areas/Admin/Mapping/Parcel/ParcelBuildingMap.cs +++ /dev/null @@ -1,68 +0,0 @@ -using Mapster; -using Pims.Api.Mapping.Converters; -using Pims.Dal.Helpers.Extensions; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.Parcel; - -namespace Pims.Api.Areas.Admin.Mapping.Parcel -{ - public class ParcelBuildingMap : IRegister - { - - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .IgnoreNonMapped(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Agency, src => AgencyConverter.ConvertAgency(src.Agency)) - .Map(dest => dest.SubAgency, src => AgencyConverter.ConvertSubAgency(src.Agency)) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.ParcelId, src => src.GetParcelId()) - .Map(dest => dest.BuildingConstructionTypeId, src => src.BuildingConstructionTypeId) - .Map(dest => dest.BuildingConstructionType, src => src.GetConstructionType()) - .Map(dest => dest.BuildingOccupantTypeId, src => src.BuildingOccupantTypeId) - .Map(dest => dest.BuildingOccupantType, src => src.GetOccupantType()) - .Map(dest => dest.BuildingPredominateUseId, src => src.BuildingPredominateUseId) - .Map(dest => dest.BuildingPredominateUse, src => src.GetPredominateUse()) - .Map(dest => dest.BuildingTenancy, src => src.BuildingTenancy) - .Map(dest => dest.BuildingFloorCount, src => src.BuildingFloorCount) - .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry) - .Map(dest => dest.OccupantName, src => src.OccupantName) - .Map(dest => dest.RentableArea, src => src.RentableArea) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Inherits(); - - config.NewConfig() - .IgnoreNonMapped(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Location, src => src) - .Map(dest => dest.AddressId, src => src.Address == null ? 0 : src.Address.Id) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.BuildingConstructionTypeId, src => src.BuildingConstructionTypeId) - .Map(dest => dest.BuildingOccupantTypeId, src => src.BuildingOccupantTypeId) - .Map(dest => dest.BuildingPredominateUseId, src => src.BuildingPredominateUseId) - .Map(dest => dest.BuildingTenancy, src => src.BuildingTenancy) - .Map(dest => dest.BuildingFloorCount, src => src.BuildingFloorCount) - .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry) - .Map(dest => dest.OccupantName, src => src.OccupantName) - .Map(dest => dest.RentableArea, src => src.RentableArea) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Inherits(); - - config.NewConfig() - .ConstructUsing(src => Dal.Helpers.GeometryHelper.CreatePoint(src.Longitude, src.Latitude)); - } - } -} diff --git a/backend/api/Areas/Admin/Mapping/Parcel/ParcelEvaluationMap.cs b/backend/api/Areas/Admin/Mapping/Parcel/ParcelEvaluationMap.cs deleted file mode 100644 index 439570584d..0000000000 --- a/backend/api/Areas/Admin/Mapping/Parcel/ParcelEvaluationMap.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.Parcel; - -namespace Pims.Api.Areas.Admin.Mapping.Parcel -{ - public class ParcelEvaluationMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .IgnoreNonMapped(true) - .Map(dest => dest.ParcelId, src => src.ParcelId) - .Map(dest => dest.Date, src => src.Date) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - - - config.NewConfig() - .IgnoreNonMapped(true) - .Map(dest => dest.ParcelId, src => src.ParcelId) - .Map(dest => dest.Date, src => src.Date) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Admin/Mapping/Parcel/ParcelFiscalMap.cs b/backend/api/Areas/Admin/Mapping/Parcel/ParcelFiscalMap.cs deleted file mode 100644 index 98c335911f..0000000000 --- a/backend/api/Areas/Admin/Mapping/Parcel/ParcelFiscalMap.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.Parcel; - -namespace Pims.Api.Areas.Admin.Mapping.Parcel -{ - public class ParcelFiscalMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .IgnoreNonMapped(true) - .Map(dest => dest.ParcelId, src => src.ParcelId) - .Map(dest => dest.FiscalYear, src => src.FiscalYear) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - - - config.NewConfig() - .IgnoreNonMapped(true) - .Map(dest => dest.ParcelId, src => src.ParcelId) - .Map(dest => dest.FiscalYear, src => src.FiscalYear) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Admin/Mapping/Parcel/ParcelMap.cs b/backend/api/Areas/Admin/Mapping/Parcel/ParcelMap.cs deleted file mode 100644 index cf32c89d64..0000000000 --- a/backend/api/Areas/Admin/Mapping/Parcel/ParcelMap.cs +++ /dev/null @@ -1,65 +0,0 @@ -using Mapster; -using Pims.Api.Mapping.Converters; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.Parcel; - -namespace Pims.Api.Areas.Admin.Mapping.Parcel -{ - public class ParcelMap : IRegister - { - - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .IgnoreNonMapped(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.PID, src => src.ParcelIdentity) - .Map(dest => dest.PIN, src => src.PIN) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Classification, src => src.Classification.Name) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Agency, src => AgencyConverter.ConvertAgency(src.Agency)) - .Map(dest => dest.SubAgency, src => AgencyConverter.ConvertSubAgency(src.Agency)) - .Map(dest => dest.Longitude, src => src.Location.X) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.LandArea, src => src.LandArea) - .Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription) - .Map(dest => dest.Zoning, src => src.Zoning) - .Map(dest => dest.ZoningPotential, src => src.ZoningPotential) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.Buildings, src => src.Buildings) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Inherits(); - - - config.NewConfig() - .IgnoreNonMapped(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.PID, src => ParcelConverter.ConvertPID(src.PID)) - .Map(dest => dest.PIN, src => src.PIN) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Location, src => src) - .Map(dest => dest.AddressId, src => src.Address == null ? 0 : src.Address.Id) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.LandArea, src => src.LandArea) - .Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription) - .Map(dest => dest.Zoning, src => src.Zoning) - .Map(dest => dest.ZoningPotential, src => src.ZoningPotential) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.Buildings, src => src.Buildings) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Inherits(); - - config.NewConfig() - .ConstructUsing(src => Dal.Helpers.GeometryHelper.CreatePoint(src.Longitude, src.Latitude)); - } - } -} diff --git a/backend/api/Areas/Admin/Mapping/Parcel/PartialBuildingMap.cs b/backend/api/Areas/Admin/Mapping/Parcel/PartialBuildingMap.cs deleted file mode 100644 index abe36bc341..0000000000 --- a/backend/api/Areas/Admin/Mapping/Parcel/PartialBuildingMap.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.Parcel; - -namespace Pims.Api.Areas.Admin.Mapping.Parcel -{ - public class PartialBuildingMap : IRegister - { - - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .IgnoreNonMapped(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Admin/Mapping/Parcel/PartialParcelMap.cs b/backend/api/Areas/Admin/Mapping/Parcel/PartialParcelMap.cs deleted file mode 100644 index c77c68013d..0000000000 --- a/backend/api/Areas/Admin/Mapping/Parcel/PartialParcelMap.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.Parcel; - -namespace Pims.Api.Areas.Admin.Mapping.Parcel -{ - public class PartialParcelMap : IRegister - { - - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .IgnoreNonMapped(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.PID, src => src.ParcelIdentity) - .Map(dest => dest.PIN, src => src.PIN) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Admin/Mapping/Role/ClaimMap.cs b/backend/api/Areas/Admin/Mapping/Role/ClaimMap.cs deleted file mode 100644 index 54da4847df..0000000000 --- a/backend/api/Areas/Admin/Mapping/Role/ClaimMap.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.Role; - -namespace Pims.Api.Areas.Admin.Mapping.Role -{ - public class ClaimMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.KeycloakRoleId, src => src.KeycloakRoleId) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.KeycloakRoleId, src => src.KeycloakRoleId) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Inherits(); - - - config.NewConfig() - .Map(dest => dest.Id, src => src.Claim.Id) - .Map(dest => dest.Name, src => src.Claim.Name) - .Map(dest => dest.Description, src => src.Claim.Description) - .Map(dest => dest.KeycloakRoleId, src => src.Claim.KeycloakRoleId) - .Map(dest => dest.IsDisabled, src => src.Claim.IsDisabled); - - config.NewConfig() - .Map(dest => dest.RoleId, src => src.Id); - } - } -} diff --git a/backend/api/Areas/Admin/Mapping/Role/RoleMap.cs b/backend/api/Areas/Admin/Mapping/Role/RoleMap.cs deleted file mode 100644 index 65222113e1..0000000000 --- a/backend/api/Areas/Admin/Mapping/Role/RoleMap.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Mapster; -using System; -using System.Linq; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.Role; - -namespace Pims.Api.Areas.Admin.Mapping.Role -{ - public class RoleMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.IsPublic, src => src.IsPublic) - .Map(dest => dest.KeycloakGroupId, src => src.KeycloakGroupId) - .Map(dest => dest.Claims, src => src.Claims.Select(c => c.Claim)) - .Inherits, Api.Models.LookupModel>(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.IsPublic, src => src.IsPublic) - .Map(dest => dest.KeycloakGroupId, src => src.KeycloakGroupId) - .Map(dest => dest.Claims, src => src.Claims) - .Inherits, Entity.LookupEntity>(); - } - } -} diff --git a/backend/api/Areas/Admin/Mapping/User/AccessRequestAgencyMap.cs b/backend/api/Areas/Admin/Mapping/User/AccessRequestAgencyMap.cs deleted file mode 100644 index 0b7cb62a2a..0000000000 --- a/backend/api/Areas/Admin/Mapping/User/AccessRequestAgencyMap.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.User; - -namespace Pims.Api.Areas.Admin.Mapping.User -{ - public class AccessRequestAgencyMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.AgencyId) - .Map(dest => dest.Code, src => src.Agency.Code) - .Map(dest => dest.Description, src => src.Agency.Description) - .Map(dest => dest.Name, src => src.Agency.Name) - .Map(dest => dest.IsDisabled, src => src.Agency.IsDisabled) - .Map(dest => dest.SortOrder, src => src.Agency.SortOrder) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.AgencyId, src => src.Id) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Admin/Mapping/User/AccessRequestMap.cs b/backend/api/Areas/Admin/Mapping/User/AccessRequestMap.cs deleted file mode 100644 index a67c20ece4..0000000000 --- a/backend/api/Areas/Admin/Mapping/User/AccessRequestMap.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.User; - -namespace Pims.Api.Areas.Admin.Mapping.User -{ - public class AccessRequestMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Status, src => src.Status) - .Map(dest => dest.Agencies, src => src.Agencies) - .Map(dest => dest.Roles, src => src.Roles) - .Map(dest => dest.User, src => src.User) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Status, src => src.Status) - .Map(dest => dest.Agencies, src => src.Agencies) - .Map(dest => dest.Roles, src => src.Roles) - .Map(dest => dest.User, src => src.User) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Admin/Mapping/User/AccessRequestRoleMap.cs b/backend/api/Areas/Admin/Mapping/User/AccessRequestRoleMap.cs deleted file mode 100644 index 4a60f69cbd..0000000000 --- a/backend/api/Areas/Admin/Mapping/User/AccessRequestRoleMap.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.User; - -namespace Pims.Api.Areas.Admin.Mapping.User -{ - public class AccessRequestRoleMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.RoleId) - .Map(dest => dest.Description, src => src.Role.Description) - .Map(dest => dest.Name, src => src.Role.Name) - .Map(dest => dest.IsDisabled, src => src.Role.IsDisabled) - .Map(dest => dest.SortOrder, src => src.Role.SortOrder) - .Inherits(); - - config.NewConfig() - .IgnoreNonMapped(true) - .Map(dest => dest.RoleId, src => src.Id) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Admin/Mapping/User/AccessRequestUserMap.cs b/backend/api/Areas/Admin/Mapping/User/AccessRequestUserMap.cs deleted file mode 100644 index 4f4521f18d..0000000000 --- a/backend/api/Areas/Admin/Mapping/User/AccessRequestUserMap.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.User; - -namespace Pims.Api.Areas.Admin.Mapping.User -{ - public class AccessRequestUserMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.DisplayName, src => src.DisplayName) - .Map(dest => dest.FirstName, src => src.FirstName) - .Map(dest => dest.MiddleName, src => src.MiddleName) - .Map(dest => dest.LastName, src => src.LastName) - .Map(dest => dest.Email, src => src.Email) - .Map(dest => dest.Username, src => src.Username) - .Map(dest => dest.Position, src => src.Position) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.DisplayName, src => src.DisplayName) - .Map(dest => dest.FirstName, src => src.FirstName) - .Map(dest => dest.MiddleName, src => src.MiddleName) - .Map(dest => dest.LastName, src => src.LastName) - .Map(dest => dest.Email, src => src.Email) - .Map(dest => dest.Username, src => src.Username) - .Map(dest => dest.Position, src => src.Position) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Admin/Mapping/User/AgencyMap.cs b/backend/api/Areas/Admin/Mapping/User/AgencyMap.cs deleted file mode 100644 index fcd5f92f04..0000000000 --- a/backend/api/Areas/Admin/Mapping/User/AgencyMap.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.User; - -namespace Pims.Api.Areas.Admin.Mapping.User -{ - public class AgencyMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.ParentId, src => src.ParentId) - .Inherits, Api.Models.CodeModel>(); - - config.NewConfig() - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.ParentId, src => src.ParentId) - .Inherits, Entity.CodeEntity>(); - - - config.NewConfig() - .Map(dest => dest.Id, src => src.AgencyId); - - config.NewConfig() - .Map(dest => dest.AgencyId, src => src.Id); - } - } -} diff --git a/backend/api/Areas/Admin/Mapping/User/GoldUserMap.cs b/backend/api/Areas/Admin/Mapping/User/GoldUserMap.cs deleted file mode 100644 index 949022d222..0000000000 --- a/backend/api/Areas/Admin/Mapping/User/GoldUserMap.cs +++ /dev/null @@ -1,52 +0,0 @@ -using Mapster; -using Pims.Core.Extensions; -using System.Linq; - -namespace Pims.Api.Areas.Admin.Mapping.GoldUser -{ - public class GoldUserMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.KeycloakUserId, src => src.KeycloakUserId) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.Username, src => src.Username) - .Map(dest => dest.Position, src => src.Position) - .Map(dest => dest.DisplayName, src => src.DisplayName) - .Map(dest => dest.FirstName, src => src.FirstName) - .Map(dest => dest.MiddleName, src => src.MiddleName) - .Map(dest => dest.LastName, src => src.LastName) - .Map(dest => dest.Email, src => src.Email) - .Map(dest => dest.Note, src => src.Note) - .Map(dest => dest.Agencies, src => src.Agencies.Select(a => a.Agency)) - .Map(dest => dest.Roles, src => src.Roles) - .Map(dest => dest.GoldUserRoles, src => src.GoldUserRoles) - .Map(dest => dest.LastLogin, src => src.LastLogin); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.KeycloakUserId, src => src.KeycloakUserId) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.Username, src => src.Username) - .Map(dest => dest.Position, src => src.Position) - .Map(dest => dest.DisplayName, src => src.DisplayName) - .Map(dest => dest.FirstName, src => src.FirstName) - .Map(dest => dest.MiddleName, src => src.MiddleName) - .Map(dest => dest.LastName, src => src.LastName) - .Map(dest => dest.Email, src => src.Email) - .Map(dest => dest.Note, src => src.Note) - .Map(dest => dest.Agencies, src => src.Agencies) - .Map(dest => dest.Roles, src => src.Roles) - .Map(dest => dest.GoldUserRoles, src => src.GoldUserRoles) - .AfterMappingInline((m, e) => UpdateUser(m, e)); - } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Required for signature")] - private void UpdateUser(Pims.Api.Areas.Admin.Models.GoldUser.GoldUser model, Pims.Dal.Entities.GoldUser entity) - { - entity.Agencies.Where(a => a != null).ForEach(a => a.UserId = entity.Id); - } - } -} diff --git a/backend/api/Areas/Admin/Mapping/User/RoleMap.cs b/backend/api/Areas/Admin/Mapping/User/RoleMap.cs deleted file mode 100644 index 50a49b8ee7..0000000000 --- a/backend/api/Areas/Admin/Mapping/User/RoleMap.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Mapster; -using System; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.User; - -namespace Pims.Api.Areas.Admin.Mapping.User -{ - public class RoleMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.IsPublic, src => src.IsPublic) - .Map(dest => dest.KeycloakGroupId, src => src.KeycloakGroupId) - .Inherits, Api.Models.LookupModel>(); - - config.NewConfig() - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.IsPublic, src => src.IsPublic) - .Map(dest => dest.KeycloakGroupId, src => src.KeycloakGroupId) - .Inherits, Entity.LookupEntity>(); - - - config.NewConfig() - .Map(dest => dest.Id, src => src.RoleId); - - config.NewConfig() - .Map(dest => dest.RoleId, src => src.Id); - } - } -} diff --git a/backend/api/Areas/Admin/Mapping/User/UserMap.cs b/backend/api/Areas/Admin/Mapping/User/UserMap.cs deleted file mode 100644 index 3fed9e5807..0000000000 --- a/backend/api/Areas/Admin/Mapping/User/UserMap.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Mapster; -using Pims.Core.Extensions; -using System.Linq; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.User; - -namespace Pims.Api.Areas.Admin.Mapping.User -{ - public class UserMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.KeycloakUserId, src => src.KeycloakUserId) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.Username, src => src.Username) - .Map(dest => dest.Position, src => src.Position) - .Map(dest => dest.DisplayName, src => src.DisplayName) - .Map(dest => dest.FirstName, src => src.FirstName) - .Map(dest => dest.MiddleName, src => src.MiddleName) - .Map(dest => dest.LastName, src => src.LastName) - .Map(dest => dest.Email, src => src.Email) - .Map(dest => dest.Note, src => src.Note) - .Map(dest => dest.Agencies, src => src.Agencies.Select(a => a.Agency)) - .Map(dest => dest.Roles, src => src.Roles.Select(a => a.Role)) - .Map(dest => dest.LastLogin, src => src.LastLogin) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.KeycloakUserId, src => src.KeycloakUserId) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.Username, src => src.Username) - .Map(dest => dest.Position, src => src.Position) - .Map(dest => dest.DisplayName, src => src.DisplayName) - .Map(dest => dest.FirstName, src => src.FirstName) - .Map(dest => dest.MiddleName, src => src.MiddleName) - .Map(dest => dest.LastName, src => src.LastName) - .Map(dest => dest.Email, src => src.Email) - .Map(dest => dest.Note, src => src.Note) - .Map(dest => dest.Agencies, src => src.Agencies) - .Map(dest => dest.Roles, src => src.Roles) - .Map(dest => dest.LastLogin, src => src.LastLogin) - .AfterMappingInline((m, e) => UpdateUser(m, e)) - .Inherits(); - } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Required for signature")] - private void UpdateUser(Model.UserModel model, Entity.User entity) - { - entity.Agencies.Where(a => a != null).ForEach(a => a.UserId = entity.Id); - entity.Roles.Where(r => r != null).ForEach(r => r.UserId = entity.Id); - } - } -} diff --git a/backend/api/Areas/Admin/Models/AdministrativeArea/AdministrativeAreaModel.cs b/backend/api/Areas/Admin/Models/AdministrativeArea/AdministrativeAreaModel.cs deleted file mode 100644 index b952f5a565..0000000000 --- a/backend/api/Areas/Admin/Models/AdministrativeArea/AdministrativeAreaModel.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace Pims.Api.Areas.Admin.Models.AdministrativeArea -{ - /// - /// AdministrativeAreaModel, provides a model that represents administrative areas. - /// - public class AdministrativeAreaModel : Api.Models.LookupModel - { - #region Properties - /// - /// get/set - An abbreviated name. - /// - public string Abbreviation { get; set; } - - /// - /// get/set - A description of the boundary type for this area (o.e. Legal). - /// - public string BoundaryType { get; set; } - - /// - /// get/set - The parent group name for this area. - /// - public string GroupName { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Models/Agency/AgencyModel.cs b/backend/api/Areas/Admin/Models/Agency/AgencyModel.cs deleted file mode 100644 index 1119b84c76..0000000000 --- a/backend/api/Areas/Admin/Models/Agency/AgencyModel.cs +++ /dev/null @@ -1,35 +0,0 @@ -namespace Pims.Api.Areas.Admin.Models.Agency -{ - /// - /// AgencyModel class, provides a model that represents the agency. - /// - public class AgencyModel : Api.Models.CodeModel - { - #region Properties - /// - /// get/set - The agency description. - /// - public string Description { get; set; } - - /// - /// get/set - The agency email. - /// - public string Email { get; set; } - - /// - /// get/set - The CC agency email. - /// - public string CcEmail { get; set; } - - /// - /// get/set - Whether to send email to the agency. - /// - public bool SendEmail { get; set; } - - /// - /// get/set - Who the email will be addressed to. - /// - public string AddressTo { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Models/Claim/ClaimModel.cs b/backend/api/Areas/Admin/Models/Claim/ClaimModel.cs deleted file mode 100644 index 547ace1c5d..0000000000 --- a/backend/api/Areas/Admin/Models/Claim/ClaimModel.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; - -namespace Pims.Api.Areas.Admin.Models.Claim -{ - public class ClaimModel : Api.Models.BaseModel - { - #region Properties - /// - /// get/set - The primary key IDENTITY. - /// - /// - public Guid Id { get; set; } - - /// - /// get/set - The claims display name. - /// - /// - public string Name { get; set; } - - /// - /// get/set - The GUID that identifies this Role in Keycloak. - /// - public Guid? KeycloakRoleId { get; set; } - - /// - /// get/set - The claims first name. - /// - /// - public string Description { get; set; } - - /// - /// get/set - Whether the user is disabled. - /// - /// - public bool IsDisabled { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Models/Parcel/AddressModel.cs b/backend/api/Areas/Admin/Models/Parcel/AddressModel.cs deleted file mode 100644 index db5fed68f6..0000000000 --- a/backend/api/Areas/Admin/Models/Parcel/AddressModel.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Model = Pims.Api.Models; - -namespace Pims.Api.Areas.Admin.Models.Parcel -{ - public class AddressModel : Model.BaseModel - { - #region Properties - public int Id { get; set; } - - public string Line1 { get; set; } - - public string Line2 { get; set; } - - public string AdministrativeArea { get; set; } - - public string ProvinceId { get; set; } - - public string Province { get; set; } - - public string Postal { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Models/Parcel/BuildingEvaluationModel.cs b/backend/api/Areas/Admin/Models/Parcel/BuildingEvaluationModel.cs deleted file mode 100644 index 018a06b781..0000000000 --- a/backend/api/Areas/Admin/Models/Parcel/BuildingEvaluationModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace Pims.Api.Areas.Admin.Models.Parcel -{ - public class BuildingEvaluationModel : Api.Models.BaseModel - { - #region Properties - public int BuildingId { get; set; } - - public DateTime Date { get; set; } - - public string Key { get; set; } - - public decimal Value { get; set; } - - public string Note { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Models/Parcel/BuildingFiscalModel.cs b/backend/api/Areas/Admin/Models/Parcel/BuildingFiscalModel.cs deleted file mode 100644 index fc1da2dd67..0000000000 --- a/backend/api/Areas/Admin/Models/Parcel/BuildingFiscalModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Pims.Api.Areas.Admin.Models.Parcel -{ - public class BuildingFiscalModel : Api.Models.BaseModel - { - #region Properties - public int BuildingId { get; set; } - - public int FiscalYear { get; set; } - - public string Key { get; set; } - - public decimal Value { get; set; } - - public string Note { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Models/Parcel/BuildingModel.cs b/backend/api/Areas/Admin/Models/Parcel/BuildingModel.cs deleted file mode 100644 index 141a732d77..0000000000 --- a/backend/api/Areas/Admin/Models/Parcel/BuildingModel.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using System.Collections.Generic; -using Model = Pims.Api.Models; - -namespace Pims.Api.Areas.Admin.Models.Parcel -{ - public class BuildingModel : Model.BaseModel - { - #region Properties - public int Id { get; set; } - - public int ParcelId { get; set; } - - public int AgencyId { get; set; } - - public string SubAgency { get; set; } - - public string Agency { get; set; } - - public string Name { get; set; } - - public string Description { get; set; } - - public AddressModel Address { get; set; } - - public double Latitude { get; set; } - - public double Longitude { get; set; } - - public int BuildingConstructionTypeId { get; set; } - - public string BuildingConstructionType { get; set; } - - public int BuildingFloorCount { get; set; } - - public int BuildingPredominateUseId { get; set; } - - public string BuildingPredominateUse { get; set; } - - public int BuildingOccupantTypeId { get; set; } - - public string BuildingOccupantType { get; set; } - - public DateTime? LeaseExpiry { get; set; } - - public string OccupantName { get; set; } - - public bool TransferLeaseOnSale { get; set; } - - public string BuildingTenancy { get; set; } - - public float RentableArea { get; set; } - - public float TotalArea { get; set; } - - public bool IsSensitive { get; set; } - - public IEnumerable Evaluations { get; set; } = new List(); - - public IEnumerable Fiscals { get; set; } = new List(); - #endregion - } -} diff --git a/backend/api/Areas/Admin/Models/Parcel/ParcelBuildingModel.cs b/backend/api/Areas/Admin/Models/Parcel/ParcelBuildingModel.cs deleted file mode 100644 index d71f57a931..0000000000 --- a/backend/api/Areas/Admin/Models/Parcel/ParcelBuildingModel.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Collections.Generic; -using Model = Pims.Api.Models; - -namespace Pims.Api.Areas.Admin.Models.Parcel -{ - public class ParcelBuildingModel : Model.BaseModel - { - #region Properties - public int Id { get; set; } - - public int ParcelId { get; set; } - - public int AgencyId { get; set; } - - public string Agency { get; set; } - - public string SubAgency { get; set; } - - public string Name { get; set; } - - public string Description { get; set; } - - public AddressModel Address { get; set; } - - public double Latitude { get; set; } - - public double Longitude { get; set; } - - public int BuildingConstructionTypeId { get; set; } - - public string BuildingConstructionType { get; set; } - - public int BuildingFloorCount { get; set; } - - public int BuildingPredominateUseId { get; set; } - - public string BuildingPredominateUse { get; set; } - - public int BuildingOccupantTypeId { get; set; } - - public string BuildingOccupantType { get; set; } - - public DateTime? LeaseExpiry { get; set; } - - public string OccupantName { get; set; } - - public bool TransferLeaseOnSale { get; set; } - - public string BuildingTenancy { get; set; } - - public float RentableArea { get; set; } - - public bool IsSensitive { get; set; } - - public IEnumerable Evaluations { get; set; } = new List(); - - public IEnumerable Fiscals { get; set; } = new List(); - #endregion - } -} diff --git a/backend/api/Areas/Admin/Models/Parcel/ParcelEvaluationModel.cs b/backend/api/Areas/Admin/Models/Parcel/ParcelEvaluationModel.cs deleted file mode 100644 index c765448c3b..0000000000 --- a/backend/api/Areas/Admin/Models/Parcel/ParcelEvaluationModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace Pims.Api.Areas.Admin.Models.Parcel -{ - public class ParcelEvaluationModel : Api.Models.BaseModel - { - #region Properties - public int ParcelId { get; set; } - - public DateTime Date { get; set; } - - public string Key { get; set; } - - public decimal Value { get; set; } - - public string Note { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Models/Parcel/ParcelFiscalModel.cs b/backend/api/Areas/Admin/Models/Parcel/ParcelFiscalModel.cs deleted file mode 100644 index 417f2f7998..0000000000 --- a/backend/api/Areas/Admin/Models/Parcel/ParcelFiscalModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Pims.Api.Areas.Admin.Models.Parcel -{ - public class ParcelFiscalModel : Api.Models.BaseModel - { - #region Properties - public int ParcelId { get; set; } - - public int FiscalYear { get; set; } - - public string Key { get; set; } - - public decimal Value { get; set; } - - public string Note { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Models/Parcel/ParcelModel.cs b/backend/api/Areas/Admin/Models/Parcel/ParcelModel.cs deleted file mode 100644 index 27a20f5e79..0000000000 --- a/backend/api/Areas/Admin/Models/Parcel/ParcelModel.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Collections.Generic; - -namespace Pims.Api.Areas.Admin.Models.Parcel -{ - public class ParcelModel : PropertyModel - { - #region Properties - public string PID { get; set; } - - public int? PIN { get; set; } - - public float LandArea { get; set; } - - public string LandLegalDescription { get; set; } - - public string Zoning { get; set; } - - public string ZoningPotential { get; set; } - - public IEnumerable Evaluations { get; set; } = new List(); - - public IEnumerable Fiscals { get; set; } = new List(); - - public IEnumerable Buildings { get; set; } = new List(); - #endregion - } -} diff --git a/backend/api/Areas/Admin/Models/Parcel/PartialBuildingModel.cs b/backend/api/Areas/Admin/Models/Parcel/PartialBuildingModel.cs deleted file mode 100644 index 4e96b64913..0000000000 --- a/backend/api/Areas/Admin/Models/Parcel/PartialBuildingModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Model = Pims.Api.Models; - -namespace Pims.Api.Areas.Admin.Models.Parcel -{ - public class PartialBuildingModel : Model.BaseModel - { - #region Properties - public int Id { get; set; } - - public string Name { get; set; } - - public string Description { get; set; } - - public double Latitude { get; set; } - - public double Longitude { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Models/Parcel/PartialParcelModel.cs b/backend/api/Areas/Admin/Models/Parcel/PartialParcelModel.cs deleted file mode 100644 index 9069ba2b0f..0000000000 --- a/backend/api/Areas/Admin/Models/Parcel/PartialParcelModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Pims.Api.Areas.Admin.Models.Parcel -{ - public class PartialParcelModel : PartialPropertyModel - { - #region Properties - public string PID { get; set; } - - public int PIN { get; set; } - - public string Zoning { get; set; } - - public string ZoningPotential { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Models/Parcel/PartialPropertyModel.cs b/backend/api/Areas/Admin/Models/Parcel/PartialPropertyModel.cs deleted file mode 100644 index dd60a10488..0000000000 --- a/backend/api/Areas/Admin/Models/Parcel/PartialPropertyModel.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Model = Pims.Api.Models; - -namespace Pims.Api.Areas.Admin.Models.Parcel -{ - public class PartialPropertyModel : Model.BaseModel - { - #region Properties - public int Id { get; set; } - - public int StatusId { get; set; } - - public int ClassificationId { get; set; } - - public double Latitude { get; set; } - - public double Longitude { get; set; } - - public string Name { get; set; } - - public string Description { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Models/Parcel/PropertyModel.cs b/backend/api/Areas/Admin/Models/Parcel/PropertyModel.cs deleted file mode 100644 index fda79c49b6..0000000000 --- a/backend/api/Areas/Admin/Models/Parcel/PropertyModel.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Model = Pims.Api.Models; - -namespace Pims.Api.Areas.Admin.Models.Parcel -{ - public class PropertyModel : Model.BaseModel - { - #region Properties - public int Id { get; set; } - - public string ProjectNumber { get; set; } - - public int StatusId { get; set; } - - public string Status { get; set; } - - public string Name { get; set; } - - public string Description { get; set; } - - public int ClassificationId { get; set; } - - public string Classification { get; set; } - - public int AgencyId { get; set; } - - public string SubAgency { get; set; } - - public string Agency { get; set; } - - public AddressModel Address { get; set; } - - public double Latitude { get; set; } - - public double Longitude { get; set; } - - public bool IsSensitive { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Models/Role/ClaimModel.cs b/backend/api/Areas/Admin/Models/Role/ClaimModel.cs deleted file mode 100644 index 483386b12d..0000000000 --- a/backend/api/Areas/Admin/Models/Role/ClaimModel.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; - -namespace Pims.Api.Areas.Admin.Models.Role -{ - public class ClaimModel : Api.Models.BaseModel - { - #region Properties - /// - /// get/set - The primary key IDENTITY. - /// - /// - public Guid Id { get; set; } - - /// - /// get/set - The claims display name. - /// - /// - public string Name { get; set; } - - /// - /// get/set - The GUID that identifies this Role in Keycloak. - /// - public Guid? KeycloakRoleId { get; set; } - - /// - /// get/set - The claims first name. - /// - /// - public string Description { get; set; } - - /// - /// get/set - Whether the user is disabled. - /// - /// - public bool IsDisabled { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Models/Role/RoleModel.cs b/backend/api/Areas/Admin/Models/Role/RoleModel.cs deleted file mode 100644 index a9d817a87a..0000000000 --- a/backend/api/Areas/Admin/Models/Role/RoleModel.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Api.Areas.Admin.Models.Role -{ - /// - /// RoleModel class, provides a model that represents a role. - /// - public class RoleModel : Api.Models.LookupModel - { - #region Properties - /// - /// get/set - The role description. - /// - /// - public string Description { get; set; } - - /// - /// get/set - Whether the role is public. - /// One which users can request to join. - /// - public bool IsPublic { get; set; } - - /// - /// get/set - The keycloak group id. - /// - public Guid? KeycloakGroupId { get; set; } - - /// - /// get/set - An array of claims associated to this role. - /// - public IEnumerable Claims { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Models/User/AccessRequestAgencyModel.cs b/backend/api/Areas/Admin/Models/User/AccessRequestAgencyModel.cs deleted file mode 100644 index 36430dc489..0000000000 --- a/backend/api/Areas/Admin/Models/User/AccessRequestAgencyModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Pims.Api.Areas.Admin.Models.User -{ - /// - /// AccessRequestAgencyModel class, provides a model that represents the agency. - /// - public class AccessRequestAgencyModel : Api.Models.CodeModel - { - #region Properties - /// - /// get/set - The agency description. - /// - public string Description { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Models/User/AccessRequestModel.cs b/backend/api/Areas/Admin/Models/User/AccessRequestModel.cs deleted file mode 100644 index 295e879968..0000000000 --- a/backend/api/Areas/Admin/Models/User/AccessRequestModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Pims.Dal.Entities; -using System.Collections.Generic; - -namespace Pims.Api.Areas.Admin.Models.User -{ - public class AccessRequestModel : Api.Models.BaseModel - { - #region Properties - public int Id { get; set; } - public AccessRequestStatus Status { get; set; } - public string Note { get; set; } - public AccessRequestUserModel User { get; set; } - public IEnumerable Agencies { get; set; } - public IEnumerable Roles { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Models/User/AccessRequestRoleModel.cs b/backend/api/Areas/Admin/Models/User/AccessRequestRoleModel.cs deleted file mode 100644 index 8ada4f3af8..0000000000 --- a/backend/api/Areas/Admin/Models/User/AccessRequestRoleModel.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace Pims.Api.Areas.Admin.Models.User -{ - /// - /// AccessRequestRoleModel class, provides a model that represents a role attached to an access request. - /// - public class AccessRequestRoleModel : Api.Models.LookupModel - { - #region Properties - public string Description { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Models/User/AccessRequestUserModel.cs b/backend/api/Areas/Admin/Models/User/AccessRequestUserModel.cs deleted file mode 100644 index 108423156c..0000000000 --- a/backend/api/Areas/Admin/Models/User/AccessRequestUserModel.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; - -namespace Pims.Api.Areas.Admin.Models.User -{ - /// - /// AccessRequestUserModel class, provides a model that represents a user attached to an access request. - /// - public class AccessRequestUserModel : Pims.Api.Models.BaseModel - { - #region Properties - /// - /// get/set - The user's unique identifier. - /// - /// - public Guid Id { get; set; } - - /// - /// get/set - The user's display name. - /// - /// - public string DisplayName { get; set; } - - /// - /// get/set - The user's given name. - /// - /// - public string FirstName { get; set; } - - /// - /// get/set - The user's middlename. - /// - /// - public string MiddleName { get; set; } - - /// - /// get/set - The user's surname. - /// - /// - public string LastName { get; set; } - - /// - /// get/set - The user's email. - /// - /// - public string Email { get; set; } - - /// - /// get/set - The username. - /// - /// - public string Username { get; set; } - - /// - /// get/set - The position. - /// - /// - public string Position { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Models/User/AgencyModel.cs b/backend/api/Areas/Admin/Models/User/AgencyModel.cs deleted file mode 100644 index 252c288cf8..0000000000 --- a/backend/api/Areas/Admin/Models/User/AgencyModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace Pims.Api.Areas.Admin.Models.User -{ - /// - /// AgencyModel class, provides a model that represents the agency. - /// - public class AgencyModel : Api.Models.CodeModel - { - #region Properties - /// - /// get/set - The agency description. - /// - /// - public string Description { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Models/User/GoldUserModel.cs b/backend/api/Areas/Admin/Models/User/GoldUserModel.cs deleted file mode 100644 index 1695be456e..0000000000 --- a/backend/api/Areas/Admin/Models/User/GoldUserModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Collections.Generic; -using Pims.Api.Areas.Admin.Models.User; - -namespace Pims.Api.Areas.Admin.Models.GoldUser -{ - /// - /// Extension of the UserModel class, this class adds a new array which represents keycloak gold roles - /// - public class GoldUser : UserModel - { - public IEnumerable GoldUserRoles { get; set; } - } -} \ No newline at end of file diff --git a/backend/api/Areas/Admin/Models/User/RoleModel.cs b/backend/api/Areas/Admin/Models/User/RoleModel.cs deleted file mode 100644 index 0164ee9c2b..0000000000 --- a/backend/api/Areas/Admin/Models/User/RoleModel.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; - -namespace Pims.Api.Areas.Admin.Models.User -{ - /// - /// RoleModel class, provides a model that represents a role. - /// - public class RoleModel : Api.Models.LookupModel - { - #region Properties - /// - /// get/set - The role description. - /// - /// - public string Description { get; set; } - - /// - /// get/set - The keycloak group id. - /// - public Guid? KeycloakGroupId { get; set; } - - /// - /// get/set - Whether the role is public. - /// One which users can request to join. - /// - public bool IsPublic { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Admin/Models/User/UserModel.cs b/backend/api/Areas/Admin/Models/User/UserModel.cs deleted file mode 100644 index 46efb53d44..0000000000 --- a/backend/api/Areas/Admin/Models/User/UserModel.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Api.Areas.Admin.Models.User -{ - /// - /// UserModel class, provides a model that represents a user. - /// - public class UserModel : Pims.Api.Models.BaseModel - { - #region Properties - /// - /// get/set - The user's unique identifier. - /// - public Guid Id { get; set; } - - /// - /// get/set - Unique identifier to link user with Keycloak user. - /// - public Guid? KeycloakUserId { get; set; } - - /// - /// get/set - The user's unique identity. - /// - public string Username { get; set; } - - /// - /// get/set - The user's position title. - /// - public string Position { get; set; } - - /// - /// get/set - The user's display name. - /// - public string DisplayName { get; set; } - - /// - /// get/set - The user's given name. - /// - public string FirstName { get; set; } - - /// - /// get/set - The user's middlename. - /// - public string MiddleName { get; set; } - - /// - /// get/set - The user's surname. - /// - public string LastName { get; set; } - - /// - /// get/set - The user's email. - /// - public string Email { get; set; } - - /// - /// get/set - Whether the user is disabled. - /// - /// - public bool IsDisabled { get; set; } - - /// - /// get/set - Whether the email has been verified. - /// - /// - public bool EmailVerified { get; set; } - - /// - /// get/set - A note about the user. - /// - public string Note { get; set; } - - /// - /// get/set - User's last login timestamp - /// - public DateTime? LastLogin { get; set; } - - /// - /// get/set - An array of agencies the user belongs to. - /// - public IEnumerable Agencies { get; set; } = new List(); - - /// - /// get/set - An array of roles the user is a member of. - /// - public IEnumerable Roles { get; set; } = new List(); - #endregion - } -} diff --git a/backend/api/Areas/Keycloak/Controllers/RoleController.cs b/backend/api/Areas/Keycloak/Controllers/RoleController.cs deleted file mode 100644 index bc10e6ba74..0000000000 --- a/backend/api/Areas/Keycloak/Controllers/RoleController.cs +++ /dev/null @@ -1,129 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Pims.Api.Policies; -using Pims.Dal.Keycloak; -using Pims.Dal.Security; -using Swashbuckle.AspNetCore.Annotations; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Keycloak.Models.Role; - -namespace Pims.Api.Areas.Keycloak.Controllers -{ - /// - /// RoleController class, provides endpoints for managing the integration between keycloak groups and PIMS roles. - /// - [HasPermission(Permissions.AdminRoles)] - [ApiController] - [Area("keycloak")] - [ApiVersion("1.0")] - [Route("v{version:apiVersion}/[area]/roles")] - [Route("[area]/roles")] - public class RoleController : ControllerBase - { - #region Variables - private readonly IPimsKeycloakService _keycloakService; - private readonly IMapper _mapper; - #endregion - - #region Constructors - /// - /// Creates a new instance of a RoleController class, initializes with specified arguments. - /// - /// - /// - public RoleController(IPimsKeycloakService keycloakService, IMapper mapper) - { - _mapper = mapper; - _keycloakService = keycloakService; - } - #endregion - - #region Endpoints - /// - /// Sync keycloak groups into PIMS roles. - /// - /// - [HttpPost("sync")] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "keycloak-role" })] - [HasPermission(Permissions.AdminRoles)] - public async Task SyncRolesAsync() - { - var roles = await _keycloakService.SyncRolesAsync(); - var result = _mapper.Map(roles); - - return new JsonResult(result); - } - - /// - /// Fetch a list of groups from Keycloak and their associated role within PIMS. - /// - /// - /// - /// - /// - [HttpGet] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "keycloak-role" })] - [HasPermission(Permissions.AdminRoles)] - public async Task GetRolesAsync(int page = 1, int quantity = 10, string search = null) - { - var roles = await _keycloakService.GetRolesAsync(page, quantity, search); - var result = _mapper.Map(roles); - - return new JsonResult(result); - } - - /// - /// Fetch role for the specified 'id'. - /// If the group doesn't exist in keycloak it will return a 400 BadRequest. - /// If the role doesn't exist in PIMS it will return a 400 BadRequest. - /// - /// The role does not exist for the specified 'id'. - /// - [HttpGet("{id}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.RoleModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "keycloak-role" })] - [HasPermission(Permissions.AdminRoles)] - public async Task GetRoleAsync(Guid id) - { - var role = await _keycloakService.GetRoleAsync(id); - var result = _mapper.Map(role); - - return new JsonResult(result); - } - - /// - /// Update the keycloak group and PIMS role for the specified 'id'. - /// If the group doesn't exist in keycloak it will return a 400 BadRequest. - /// If the role doesn't exist in PIMS it will create it. - /// - /// The role does not exist for the specified 'id'. - /// - [HttpPut("{id}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.RoleModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "keycloak-role" })] - [HasPermission(Permissions.AdminRoles)] - public async Task UpdateRoleAsync(Guid id, [FromBody] Model.Update.RoleModel model) - { - var role = _mapper.Map(model); - role.Id = id; - await _keycloakService.UpdateRoleAsync(role); - var result = _mapper.Map(role); - - return new JsonResult(result); - } - #endregion - } -} diff --git a/backend/api/Areas/Keycloak/Controllers/UserController.cs b/backend/api/Areas/Keycloak/Controllers/UserController.cs deleted file mode 100644 index cc16aea0dc..0000000000 --- a/backend/api/Areas/Keycloak/Controllers/UserController.cs +++ /dev/null @@ -1,155 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Pims.Api.Policies; -using Pims.Dal.Keycloak; -using Pims.Dal.Security; -using Swashbuckle.AspNetCore.Annotations; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using AdminModels = Pims.Api.Areas.Admin.Models.User; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Keycloak.Models.User; - -namespace Pims.Api.Areas.Keycloak.Controllers -{ - /// - /// UserController class, provides endpoints for managing users within keycloak. - /// - [HasPermission(Permissions.AdminUsers)] - [ApiController] - [Area("keycloak")] - [ApiVersion("1.0")] - [Route("v{version:apiVersion}/[area]/users")] - [Route("[area]/users")] - public class UserController : ControllerBase - { - #region Variables - private readonly IMapper _mapper; - private readonly IPimsKeycloakService _keycloakService; - #endregion - - #region Constructors - /// - /// Creates a new instance of a UserController class. - /// - /// - /// - public UserController(IMapper mapper, IPimsKeycloakService keycloakService) - { - _keycloakService = keycloakService; - _mapper = mapper; - } - #endregion - - #region Endpoints - /// - /// Sync the user for the specified 'id' from keycloak with PIMS. - /// If the user does not exist in keycloak it will return a 400-BadRequest. - /// If the user does not exist in PIMS it will add it. - /// Also links the user to the appropriate groups it is a member of within keycloak.!-- - /// If the group does not exist in PIMS it will add it. - /// - /// - /// The user does not exist in keycloak. - /// - [HttpPost("sync/{id}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.UserModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "keycloak-user" })] - [HasPermission(Permissions.AdminUsers)] - public async Task SyncUserAsync(Guid keycloakUserId) - { - var user = await _keycloakService.SyncUserAsync(keycloakUserId); - var result = _mapper.Map(user); - - return new JsonResult(result); - } - - - /// - /// Fetch an array of users from keycloak. - /// This endpoint supports paging. - /// - /// - /// - /// - /// - [HttpGet] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "keycloak-user" })] - [HasPermission(Permissions.AdminUsers)] - public async Task GetUsersAsync(int page = 1, int quantity = 10, string search = null) - { - var users = await _keycloakService.GetUsersAsync(page, quantity, search); - var result = _mapper.Map(users); - - return new JsonResult(result); - } - - /// - /// Fetch the user for the specified 'id'. - /// If the user does not exist in keycloak or PIMS return a 400-BadRequest. - /// - /// The user does not exist in keycloak. - /// - [HttpGet("{id}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.UserModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "keycloak-user" })] - [HasPermission(Permissions.AdminUsers)] - public async Task GetUserAsync(Guid id) - { - var user = await _keycloakService.GetUserAsync(id); - var result = _mapper.Map(user); - - return new JsonResult(result); - } - - /// - /// Update the user for the specified 'id'. - /// If the user does not exist in Keycloak or PIMS return a 400-BadRequest. - /// - /// The user does not exist in Keycloak or PIMS. - /// - [HttpPut("{id}")] - [Produces("application/json")] - [ProducesResponseType(typeof(AdminModels.UserModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "keycloak-user" })] - [HasPermission(Permissions.AdminUsers)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Parameter 'id' is required for route.")] - public async Task UpdateUserAsync(Guid id, [FromBody] AdminModels.UserModel model) - { - var user = _mapper.Map(model); - var entity = await _keycloakService.UpdateUserAsync(user); - var result = _mapper.Map(entity); - return new JsonResult(result); - } - - #region Access Request - /// - /// Update an access request, generally to grant/deny it. - /// - /// - [HttpPut("access/request")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.AccessRequestModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "keycloak-user" })] - [HasPermission(Permissions.AdminUsers)] - public async Task UpdateAccessRequestAsync(Model.AccessRequestModel updateModel) - { - var entity = _mapper.Map(updateModel); - var updatedEntity = await _keycloakService.UpdateAccessRequestAsync(entity); - var user = _mapper.Map(updatedEntity); - return new JsonResult(user); - } - #endregion - #endregion - } -} diff --git a/backend/api/Areas/Keycloak/Mapping/Role/RoleMap.cs b/backend/api/Areas/Keycloak/Mapping/Role/RoleMap.cs deleted file mode 100644 index 1f05d9318d..0000000000 --- a/backend/api/Areas/Keycloak/Mapping/Role/RoleMap.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Mapster; -using System; -using Entity = Pims.Dal.Entities; -using KModel = Pims.Keycloak.Models; -using Model = Pims.Api.Areas.Keycloak.Models.Role; - -namespace Pims.Api.Areas.Admin.Keycloak.Role -{ - public class RoleMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.KeycloakGroupId, src => src.KeycloakGroupId) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.IsPublic, src => src.IsPublic) - .Inherits, Api.Models.LookupModel>(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.IsPublic, src => src.IsPublic) - .Inherits, Entity.LookupEntity>(); - - config.NewConfig() - .Map(dest => dest.KeycloakGroupId, src => src.Id) - .Map(dest => dest.Name, src => src.Name); - } - } -} diff --git a/backend/api/Areas/Keycloak/Mapping/Role/UpdateRoleMap.cs b/backend/api/Areas/Keycloak/Mapping/Role/UpdateRoleMap.cs deleted file mode 100644 index b6519585b4..0000000000 --- a/backend/api/Areas/Keycloak/Mapping/Role/UpdateRoleMap.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Mapster; -using System; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Keycloak.Models.Role; - -namespace Pims.Api.Areas.Admin.Keycloak.Role -{ - public class UpdateRoleMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.IsPublic, src => src.IsPublic) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.IsPublic, src => src.IsPublic) - .Inherits(); - - - config.NewConfig() - .Map(dest => dest.RowVersion, src => src.RowVersion == null ? null : Convert.ToBase64String(src.RowVersion)); - - config.NewConfig() - .Map(dest => dest.RowVersion, src => src.RowVersion == null ? null : Convert.FromBase64String(src.RowVersion)); - } - } -} diff --git a/backend/api/Areas/Keycloak/Mapping/User/AccessRequestAgencyMap.cs b/backend/api/Areas/Keycloak/Mapping/User/AccessRequestAgencyMap.cs deleted file mode 100644 index 5bc6dd5930..0000000000 --- a/backend/api/Areas/Keycloak/Mapping/User/AccessRequestAgencyMap.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Keycloak.Models.User; - -namespace Pims.Api.Areas.Keycloak.Mapping.User -{ - public class AccessRequestAgencyMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.AgencyId) - .Map(dest => dest.Description, src => src.Agency == null ? null : src.Agency.Description) - .Map(dest => dest.Name, src => src.Agency == null ? null : src.Agency.Name) - .Map(dest => dest.IsDisabled, src => src.Agency == null ? false : src.Agency.IsDisabled) - .Map(dest => dest.SortOrder, src => src.Agency == null ? 0 : src.Agency.SortOrder) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.AgencyId, src => src.Id) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Keycloak/Mapping/User/AccessRequestMap.cs b/backend/api/Areas/Keycloak/Mapping/User/AccessRequestMap.cs deleted file mode 100644 index 7f905edb5a..0000000000 --- a/backend/api/Areas/Keycloak/Mapping/User/AccessRequestMap.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Keycloak.Models.User; - -namespace Pims.Api.Areas.Keycloak.Mapping.User -{ - public class AccessRequestMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Status, src => src.Status) - .Map(dest => dest.Agencies, src => src.Agencies) - .Map(dest => dest.Roles, src => src.Roles) - .Map(dest => dest.User, src => src.User) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Status, src => src.Status) - .Map(dest => dest.Agencies, src => src.Agencies) - .Map(dest => dest.Roles, src => src.Roles) - .Map(dest => dest.User, src => src.User) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Keycloak/Mapping/User/AccessRequestRoleMap.cs b/backend/api/Areas/Keycloak/Mapping/User/AccessRequestRoleMap.cs deleted file mode 100644 index e4626a1a7a..0000000000 --- a/backend/api/Areas/Keycloak/Mapping/User/AccessRequestRoleMap.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Keycloak.Models.User; - -namespace Pims.Api.Areas.Keycloak.Mapping.User -{ - public class AccessRequestRoleMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.RoleId) - .Map(dest => dest.Description, src => src.Role == null ? null : src.Role.Description) - .Map(dest => dest.Name, src => src.Role == null ? null : src.Role.Name) - .Map(dest => dest.IsDisabled, src => src.Role == null ? false : src.Role.IsDisabled) - .Map(dest => dest.SortOrder, src => src.Role == null ? 0 : src.Role.SortOrder) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.RoleId, src => src.Id) - .Map(dest => dest.Role, src => new Entity.Role(src.Id, src.Name) - { - Description = src.Description, - IsDisabled = src.IsDisabled, - SortOrder = src.SortOrder - }) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Keycloak/Mapping/User/AccessRequestUserMap.cs b/backend/api/Areas/Keycloak/Mapping/User/AccessRequestUserMap.cs deleted file mode 100644 index 95bb14eab1..0000000000 --- a/backend/api/Areas/Keycloak/Mapping/User/AccessRequestUserMap.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Keycloak.Models.User; - -namespace Pims.Api.Areas.Keycloak.Mapping.User -{ - public class AccessRequestUserMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.DisplayName, src => src.DisplayName) - .Map(dest => dest.FirstName, src => src.FirstName) - .Map(dest => dest.MiddleName, src => src.MiddleName) - .Map(dest => dest.LastName, src => src.LastName) - .Map(dest => dest.Email, src => src.Email) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.DisplayName, src => src.DisplayName) - .Map(dest => dest.FirstName, src => src.FirstName) - .Map(dest => dest.MiddleName, src => src.MiddleName) - .Map(dest => dest.LastName, src => src.LastName) - .Map(dest => dest.Email, src => src.Email) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Keycloak/Mapping/User/AgencyMap.cs b/backend/api/Areas/Keycloak/Mapping/User/AgencyMap.cs deleted file mode 100644 index 657f26567e..0000000000 --- a/backend/api/Areas/Keycloak/Mapping/User/AgencyMap.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Keycloak.Models.User; - -namespace Pims.Api.Areas.Keycloak.Mapping.User -{ - public class AgencyMap : IRegister - { - - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .IgnoreNonMapped(true) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.ParentId, src => src.ParentId) - .Inherits, Api.Models.CodeModel>(); - - - config.NewConfig() - .IgnoreNonMapped(true) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.ParentId, src => src.ParentId) - .Inherits, Entity.CodeEntity>(); - } - } -} diff --git a/backend/api/Areas/Keycloak/Mapping/User/RoleMap.cs b/backend/api/Areas/Keycloak/Mapping/User/RoleMap.cs deleted file mode 100644 index d721b6ac02..0000000000 --- a/backend/api/Areas/Keycloak/Mapping/User/RoleMap.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Mapster; -using System; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Keycloak.Models.User; - -namespace Pims.Api.Areas.Keycloak.Mapping.User -{ - public class RoleMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.IsPublic, src => src.IsPublic) - .Inherits, Api.Models.LookupModel>(); - - config.NewConfig() - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.IsPublic, src => src.IsPublic) - .Inherits, Entity.LookupEntity>(); - } - } -} diff --git a/backend/api/Areas/Keycloak/Mapping/User/UserMap.cs b/backend/api/Areas/Keycloak/Mapping/User/UserMap.cs deleted file mode 100644 index dc1f9b9deb..0000000000 --- a/backend/api/Areas/Keycloak/Mapping/User/UserMap.cs +++ /dev/null @@ -1,71 +0,0 @@ -using Mapster; -using System; -using System.Linq; -using Entity = Pims.Dal.Entities; -using KModel = Pims.Keycloak.Models; -using Model = Pims.Api.Areas.Keycloak.Models.User; - -namespace Pims.Api.Areas.Keycloak.Mapping.User -{ - public class UserMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.KeycloakUserId, src => src.KeycloakUserId) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.Username, src => src.Username) - .Map(dest => dest.Position, src => src.Position) - .Map(dest => dest.DisplayName, src => src.DisplayName) - .Map(dest => dest.FirstName, src => src.FirstName) - .Map(dest => dest.MiddleName, src => src.MiddleName) - .Map(dest => dest.LastName, src => src.LastName) - .Map(dest => dest.Email, src => src.Email) - .Map(dest => dest.Note, src => src.Note) - .Map(dest => dest.Agencies, src => src.Agencies) - .Map(dest => dest.Roles, src => src.Roles.Select(r => r.Role)) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.KeycloakUserId, src => src.KeycloakUserId) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.Username, src => src.Username) - .Map(dest => dest.Position, src => src.Position) - .Map(dest => dest.DisplayName, src => src.DisplayName) - .Map(dest => dest.FirstName, src => src.FirstName) - .Map(dest => dest.MiddleName, src => src.MiddleName) - .Map(dest => dest.LastName, src => src.LastName) - .Map(dest => dest.Email, src => src.Email) - .Map(dest => dest.Note, src => src.Note) - .Map(dest => dest.Agencies, src => src.Agencies) - .Map(dest => dest.Roles, src => src.Roles) - .Inherits(); - - - config.NewConfig() - .Map(dest => dest.Id, src => src.KeycloakUserId) - .Map(dest => dest.Username, src => src.Username) - .Map(dest => dest.FirstName, src => src.FirstName) - .Map(dest => dest.LastName, src => src.LastName) - .Map(dest => dest.Email, src => src.Email) - .Map(dest => dest.Enabled, src => !src.IsDisabled) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.KeycloakUserId, src => src.KeycloakUserId) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.Username, src => src.Username) - .Map(dest => dest.Position, src => src.Position) - .Map(dest => dest.DisplayName, src => src.DisplayName) - .Map(dest => dest.FirstName, src => src.FirstName) - .Map(dest => dest.MiddleName, src => src.MiddleName) - .Map(dest => dest.LastName, src => src.LastName) - .Map(dest => dest.Email, src => src.Email) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Keycloak/Models/Role/RoleModel.cs b/backend/api/Areas/Keycloak/Models/Role/RoleModel.cs deleted file mode 100644 index baf1bb490f..0000000000 --- a/backend/api/Areas/Keycloak/Models/Role/RoleModel.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; - -namespace Pims.Api.Areas.Keycloak.Models.Role -{ - /// - /// RoleModel class, provides a model that represents a role. - /// - public class RoleModel : Api.Models.LookupModel - { - #region Properties - /// - /// get/set - The GUID that identifies this Group in Keycloak. - /// - public Guid? KeycloakGroupId { get; set; } - - /// - /// get/set - The role description. - /// - /// - public string Description { get; set; } - - /// - /// get/set - Whether the role is public. - /// One which users can request to join. - /// - public bool IsPublic { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Keycloak/Models/Role/Update/BaseModel.cs b/backend/api/Areas/Keycloak/Models/Role/Update/BaseModel.cs deleted file mode 100644 index 0cec8bc805..0000000000 --- a/backend/api/Areas/Keycloak/Models/Role/Update/BaseModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace Pims.Api.Areas.Keycloak.Models.Role.Update -{ - /// - /// BaseModel class, provides a model that represents the base properties of an update model. - /// - public abstract class BaseModel - { - #region Properties - /// - /// get/set - The rowversion of the item. - /// - /// - public string RowVersion { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Keycloak/Models/Role/Update/RoleModel.cs b/backend/api/Areas/Keycloak/Models/Role/Update/RoleModel.cs deleted file mode 100644 index d271efcd06..0000000000 --- a/backend/api/Areas/Keycloak/Models/Role/Update/RoleModel.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace Pims.Api.Areas.Keycloak.Models.Role.Update -{ - /// - /// RoleModel class, provides a model that represents a role. - /// - public class RoleModel : BaseModel - { - #region Properties - /// - /// get/set - A unique name to identify the role. - /// - /// - public string Name { get; set; } - - /// - /// get/set - The role description. - /// - /// - public string Description { get; set; } - - /// - /// get/set - Whether the role is public. - /// One which users can request to join. - /// - public bool IsPublic { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Keycloak/Models/User/AccessRequestAgencyModel.cs b/backend/api/Areas/Keycloak/Models/User/AccessRequestAgencyModel.cs deleted file mode 100644 index 9015bce47a..0000000000 --- a/backend/api/Areas/Keycloak/Models/User/AccessRequestAgencyModel.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Pims.Api.Areas.Keycloak.Models.User -{ - /// - /// AccessRequestAgencyModel class, provides a model that represents a role attached to an access request. - /// - public class AccessRequestAgencyModel : Api.Models.CodeModel - { - #region Properties - public string Description { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Keycloak/Models/User/AccessRequestModel.cs b/backend/api/Areas/Keycloak/Models/User/AccessRequestModel.cs deleted file mode 100644 index f0cf2f8325..0000000000 --- a/backend/api/Areas/Keycloak/Models/User/AccessRequestModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Pims.Dal.Entities; -using System.Collections.Generic; - -namespace Pims.Api.Areas.Keycloak.Models.User -{ - public class AccessRequestModel : Api.Models.BaseModel - { - #region Properties - public int Id { get; set; } - public AccessRequestStatus? Status { get; set; } - public string Note { get; set; } - public AccessRequestUserModel User { get; set; } - public IEnumerable Agencies { get; set; } - public IEnumerable Roles { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Keycloak/Models/User/AccessRequestRoleModel.cs b/backend/api/Areas/Keycloak/Models/User/AccessRequestRoleModel.cs deleted file mode 100644 index de1bc724d1..0000000000 --- a/backend/api/Areas/Keycloak/Models/User/AccessRequestRoleModel.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace Pims.Api.Areas.Keycloak.Models.User -{ - /// - /// AccessRequestRoleModel class, provides a model that represents a role attached to an access request. - /// - public class AccessRequestRoleModel : Pims.Api.Models.LookupModel - { - #region Properties - public string Description { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Keycloak/Models/User/AccessRequestUserModel.cs b/backend/api/Areas/Keycloak/Models/User/AccessRequestUserModel.cs deleted file mode 100644 index f78513e30c..0000000000 --- a/backend/api/Areas/Keycloak/Models/User/AccessRequestUserModel.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; - -namespace Pims.Api.Areas.Keycloak.Models.User -{ - /// - /// AccessRequestUserModel class, provides a model that represents a user attached to an access request. - /// - public class AccessRequestUserModel : Pims.Api.Models.BaseModel - { - #region Properties - /// - /// get/set - The user's unique identifier. - /// - /// - public Guid Id { get; set; } - - /// - /// get/set - The user's display name. - /// - /// - public string DisplayName { get; set; } - - /// - /// get/set - The user's given name. - /// - /// - public string FirstName { get; set; } - - /// - /// get/set - The user's middlename. - /// - /// - public string MiddleName { get; set; } - - /// - /// get/set - The user's surname. - /// - /// - public string LastName { get; set; } - - /// - /// get/set - The user's email. - /// - /// - public string Email { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Keycloak/Models/User/AgencyModel.cs b/backend/api/Areas/Keycloak/Models/User/AgencyModel.cs deleted file mode 100644 index 8d5d0d0afd..0000000000 --- a/backend/api/Areas/Keycloak/Models/User/AgencyModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace Pims.Api.Areas.Keycloak.Models.User -{ - /// - /// AgencyModel class, provides a model to represent the agency. - /// - public class AgencyModel : Api.Models.CodeModel - { - #region Properties - /// - /// get/set - The agency description. - /// - /// - public string Description { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Keycloak/Models/User/RoleModel.cs b/backend/api/Areas/Keycloak/Models/User/RoleModel.cs deleted file mode 100644 index 288aa183e2..0000000000 --- a/backend/api/Areas/Keycloak/Models/User/RoleModel.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace Pims.Api.Areas.Keycloak.Models.User -{ - /// - /// RoleModel class, provides a model that represents a role. - /// - public class RoleModel : Api.Models.LookupModel - { - #region Properties - /// - /// get/set - The role description. - /// - /// - public string Description { get; set; } - - /// - /// get/set - Whether the role is public. - /// One which users can request to join. - /// - public bool IsPublic { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Keycloak/Models/User/Update/BaseModel.cs b/backend/api/Areas/Keycloak/Models/User/Update/BaseModel.cs deleted file mode 100644 index e6cb310091..0000000000 --- a/backend/api/Areas/Keycloak/Models/User/Update/BaseModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace Pims.Api.Areas.Keycloak.Models.User.Update -{ - /// - /// BaseModel class, provides a model that represents the base properties of an update model. - /// - public abstract class BaseModel - { - #region Properties - /// - /// get/set - The rowversion of the item. - /// - /// - public string RowVersion { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Keycloak/Models/User/Update/RoleModel.cs b/backend/api/Areas/Keycloak/Models/User/Update/RoleModel.cs deleted file mode 100644 index 0ca074471c..0000000000 --- a/backend/api/Areas/Keycloak/Models/User/Update/RoleModel.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace Pims.Api.Areas.Keycloak.Models.User.Update -{ - /// - /// RoleModel class, provides a model that represents a role. - /// - public class RoleModel : BaseModel - { - #region Properties - /// - /// get/set - A unique name to identify the role. - /// - /// - public string Name { get; set; } - - /// - /// get/set - The role description. - /// - /// - public string Description { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Keycloak/Models/User/Update/UserAgencyModel.cs b/backend/api/Areas/Keycloak/Models/User/Update/UserAgencyModel.cs deleted file mode 100644 index 619e76b183..0000000000 --- a/backend/api/Areas/Keycloak/Models/User/Update/UserAgencyModel.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace Pims.Api.Areas.Keycloak.Models.User.Update -{ - /// - /// UserAgencyModel class, provides a model to represent a user agency. - /// - public class UserAgencyModel - { - #region Properties - /// - /// get/set - The unique identify for the agency. - /// - /// - public int Id { get; set; } - - /// - /// get/set - The unique name to identify the agency. - /// - /// - public string Name { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Keycloak/Models/User/Update/UserRoleModel.cs b/backend/api/Areas/Keycloak/Models/User/Update/UserRoleModel.cs deleted file mode 100644 index 10d914e1da..0000000000 --- a/backend/api/Areas/Keycloak/Models/User/Update/UserRoleModel.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace Pims.Api.Areas.Keycloak.Models.User.Update -{ - /// - /// UserRoleModel class, provides a model that represents a user role model. - /// - public class UserRoleModel - { - #region Properties - /// - /// get/set - The unique identify for the user role. - /// - /// - public Guid Id { get; set; } - - /// - /// get/set - A unique name that identifies the user role. - /// - /// - public string Name { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Keycloak/Models/User/UserModel.cs b/backend/api/Areas/Keycloak/Models/User/UserModel.cs deleted file mode 100644 index cd93037064..0000000000 --- a/backend/api/Areas/Keycloak/Models/User/UserModel.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Api.Areas.Keycloak.Models.User -{ - /// - /// UserModel class, provides a model to represent a user. - /// - public class UserModel : Pims.Api.Models.BaseModel - { - #region Properties - /// - /// get/set - An unique identifier for the user. - /// - /// - public Guid Id { get; set; } - - /// - /// get/set - Unique identifier to link user with Keycloak user. - /// - public Guid? KeycloakUserId { get; set; } - - /// - /// get/set - A unique username to identify the user. - /// - /// - public string Username { get; set; } - - /// - /// get/set - The user's display name. - /// - /// - public string DisplayName { get; set; } - - /// - /// get/set - The user's position title. - /// - /// - public string Position { get; set; } - - /// - /// get/set - The user's given name. - /// - /// - public string FirstName { get; set; } - - /// - /// get/set - The user's middle name. - /// - /// - public string MiddleName { get; set; } - - /// - /// get/set - The user's last name. - /// - /// - public string LastName { get; set; } - - /// - /// get/set - The user's email. - /// - /// - public string Email { get; set; } - - /// - /// get/set - Whether the user is disabled. - /// - /// - public bool IsDisabled { get; set; } - - /// - /// get/set - Whether the email has been verified. - /// - /// - public bool EmailVerified { get; set; } - - /// - /// get/set - A note about the user. - /// - /// - public string Note { get; set; } - - /// - /// get/set - An array of agencies the user belongs to. - /// - /// - public IEnumerable Agencies { get; set; } = new List(); - - /// - /// get/set - An array of roles the user is a member of. - /// - /// - public IEnumerable Roles { get; set; } = new List(); - #endregion - } -} diff --git a/backend/api/Areas/Notification/Controllers/QueueController.cs b/backend/api/Areas/Notification/Controllers/QueueController.cs deleted file mode 100644 index 4d7b9eaf94..0000000000 --- a/backend/api/Areas/Notification/Controllers/QueueController.cs +++ /dev/null @@ -1,165 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http.Extensions; -using Microsoft.AspNetCore.Mvc; -using Pims.Api.Areas.Notification.Models.Queue; -using Pims.Api.Helpers.Exceptions; -using Pims.Api.Helpers.Extensions; -using Pims.Api.Models; -using Pims.Api.Policies; -using Pims.Dal; -using Pims.Dal.Entities.Models; -using Pims.Dal.Security; -using Pims.Notifications; -using Swashbuckle.AspNetCore.Annotations; -using System; -using System.Threading.Tasks; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Areas.Notification.Controllers -{ - /// - /// QueueController class, provides endpoints for interacting with the notification queue. - /// - [Authorize] - [ApiController] - [ApiVersion("1.0")] - [Area("notifications")] - [Route("v{version:apiVersion}/[area]/queue")] - [Route("[area]/queue")] - public class QueueController : ControllerBase - { - #region Variables - private readonly IPimsService _pimsService; - private readonly INotificationService _notifyService; - private readonly IMapper _mapper; - #endregion - - #region Constructors - /// - /// Creates a new instance of a QueueController class, initializes it with the specified arguments. - /// - /// - /// - /// - public QueueController(IPimsService pimsService, INotificationService notifyService, IMapper mapper) - { - _pimsService = pimsService; - _notifyService = notifyService; - _mapper = mapper; - } - #endregion - - #region Endpoints - /// - /// Get all the notifications that satisfy the filter parameters. - /// - /// - [HttpGet()] - [HasPermission(Permissions.SystemAdmin)] - [Produces("application/json")] - [ProducesResponseType(typeof(PageModel), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "notification" })] - public IActionResult GetNotificationsPage() - { - var uri = new Uri(this.Request.GetDisplayUrl()); - var query = Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query); - return GetNotificationsPage(new NotificationQueueFilter(query)); - } - - /// - /// Get all the notifications that satisfy the filter parameters. - /// - /// - /// - [HttpPost("filter")] - [HasPermission(Permissions.SystemAdmin)] - [Produces("application/json")] - [ProducesResponseType(typeof(PageModel), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "notification" })] - public IActionResult GetNotificationsPage([FromBody] NotificationQueueFilter filter) - { - filter.ThrowBadRequestIfNull($"The request must include a filter."); - if (!filter.IsValid()) throw new BadRequestException("Projects filter must contain valid values."); - - var page = _pimsService.NotificationQueue.GetPage(filter); - return new JsonResult(_mapper.Map>(page)); - } - - /// - /// Get the notification in the queue for the specified 'id'. - /// - /// - /// - [HttpGet("{id}")] - [HasPermission(Permissions.SystemAdmin)] - [Produces("application/json")] - [ProducesResponseType(typeof(NotificationQueueModel), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "notification" })] - public IActionResult GetNotificationQueue(int id) - { - var notification = _pimsService.NotificationQueue.Get(id); - return new JsonResult(_mapper.Map(notification)); - } - - /// - /// Update the status of the notification in the queue for the specified 'id'. - /// - /// - /// - [HttpPut("{id}")] - [HasPermission(Permissions.SystemAdmin)] - [Produces("application/json")] - [ProducesResponseType(typeof(NotificationQueueModel), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "notification" })] - public async Task UpdateNotificationStatusAsync(int id) - { - var notification = _pimsService.NotificationQueue.Get(id); - if (!notification.ChesMessageId.HasValue) throw new InvalidOperationException("Notification does not exist in CHES."); - var response = await _notifyService.GetStatusAsync(notification.ChesMessageId.Value); - notification.Status = (Entity.NotificationStatus)Enum.Parse(typeof(Entity.NotificationStatus), response.Status, true); - _pimsService.NotificationQueue.Update(notification); - return new JsonResult(_mapper.Map(notification)); - } - - /// - /// Update the status of the notification in the queue for the specified 'id'. - /// - /// - /// - [HttpPut("{id}/resend")] - [HasPermission(Permissions.SystemAdmin)] - [Produces("application/json")] - [ProducesResponseType(typeof(NotificationQueueModel), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "notification" })] - public async Task ResendNotificationAsync(int id) - { - var notification = _pimsService.NotificationQueue.Get(id); - await _pimsService.NotificationQueue.SendNotificationsAsync(new[] { notification }); - return new JsonResult(_mapper.Map(notification)); - } - - /// - /// Update the status of the notification in the queue for the specified 'id'. - /// - /// - /// - [HttpPut("{id}/cancel")] - [HasPermission(Permissions.SystemAdmin)] - [Produces("application/json")] - [ProducesResponseType(typeof(NotificationQueueModel), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "notification" })] - public async Task CancelNotificationAsync(int id) - { - var notification = await _pimsService.NotificationQueue.CancelNotificationAsync(id); - return new JsonResult(_mapper.Map(notification)); - } - #endregion - } -} diff --git a/backend/api/Areas/Notification/Controllers/TemplateController.cs b/backend/api/Areas/Notification/Controllers/TemplateController.cs deleted file mode 100644 index 9360b63303..0000000000 --- a/backend/api/Areas/Notification/Controllers/TemplateController.cs +++ /dev/null @@ -1,160 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Options; -using Pims.Api.Areas.Notification.Models.Template; -using Pims.Api.Models; -using Pims.Api.Policies; -using Pims.Dal; -using Pims.Dal.Security; -using Swashbuckle.AspNetCore.Annotations; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Areas.Notification.Controllers -{ - /// - /// TemplateController class, provides endpoints for interacting with notification templates. - /// - [Authorize] - [ApiController] - [ApiVersion("1.0")] - [Area("notifications")] - [Route("v{version:apiVersion}/[area]/templates")] - [Route("[area]/templates")] - public class TemplateController : ControllerBase - { - #region Variables - private readonly PimsOptions _options; - private readonly IPimsService _pimsService; - private readonly IMapper _mapper; - #endregion - - #region Constructors - /// - /// Creates a new instance of a TemplateController class, initializes it with the specified arguments. - /// - /// - /// - /// - public TemplateController(IOptions options, IPimsService pimsService, IMapper mapper) - { - _options = options.Value; - _pimsService = pimsService; - _mapper = mapper; - } - #endregion - - #region Endpoints - /// - /// Get all the notification templates. - /// - /// - [HttpGet] - [HasPermission(Permissions.SystemAdmin)] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [SwaggerOperation(Tags = new[] { "notification" })] - public IActionResult GetNotificationTemplates() - { - var templates = _pimsService.NotificationTemplate.Get(); - return new JsonResult(_mapper.Map(templates)); - } - - /// - /// Get the notification template for the specified 'id'. - /// - /// - /// - [HttpGet("{id}")] - [HasPermission(Permissions.SystemAdmin)] - [Produces("application/json")] - [ProducesResponseType(typeof(NotificationTemplateModel), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "notification" })] - public IActionResult GetNotificationTemplate(int id) - { - var template = _pimsService.NotificationTemplate.Get(id); - return new JsonResult(_mapper.Map(template)); - } - - /// - /// Add the specificied notification 'template' to the datasource. - /// - /// - /// - [HttpPost] - [HasPermission(Permissions.SystemAdmin)] - [Produces("application/json")] - [ProducesResponseType(typeof(NotificationTemplateModel), 201)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "notification" })] - public IActionResult AddNotificationTemplate([FromBody] NotificationTemplateModel model) - { - var template = _pimsService.NotificationTemplate.Add(_mapper.Map(model)); - return CreatedAtAction(nameof(GetNotificationTemplate), new { id = template.Id }, _mapper.Map(template)); - } - - /// - /// Update the specificied notification 'template' in the datasource. - /// - /// - /// - [HttpPut("{id}")] - [HasPermission(Permissions.SystemAdmin)] - [Produces("application/json")] - [ProducesResponseType(typeof(NotificationTemplateModel), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "notification" })] - public IActionResult UpdateNotificationTemplate([FromBody] NotificationTemplateModel model) - { - var template = _pimsService.NotificationTemplate.Update(_mapper.Map(model)); - return new JsonResult(_mapper.Map(template)); - } - - /// - /// Delete the specificied notification 'template' from the datasource. - /// - /// - /// - [HttpDelete("{id}")] - [HasPermission(Permissions.SystemAdmin)] - [Produces("application/json")] - [ProducesResponseType(typeof(NotificationTemplateModel), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "notification" })] - public IActionResult DeleteNotificationTemplate([FromBody] NotificationTemplateModel model) - { - _pimsService.NotificationTemplate.Remove(_mapper.Map(model)); - return new JsonResult(model); - } - - /// - /// Send an email for the specified notification template 'templateId' to the specified list of email addresses in 'to'. - /// - /// - /// - /// - /// - /// - /// - [HttpPost("{templateId}/projects/{projectId}")] - [HasPermission(Permissions.SystemAdmin)] - [Produces("application/json")] - [ProducesResponseType(typeof(Models.Queue.NotificationQueueModel), 201)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "notification" })] - public async Task SendProjectNotificationAsync(int templateId, string to, string cc, string bcc, int projectId) - { - var project = _pimsService.Project.Get(projectId); - var env = new Entity.Models.EnvironmentModel(_options.Environment.Uri, _options.Environment.Name, _options.Environment.Title); - var model = new Entity.Models.ProjectNotificationModel(Guid.NewGuid(), env, project, project.Agency); - var notification = await _pimsService.NotificationTemplate.SendNotificationAsync(templateId, to, cc, bcc, model); - - return CreatedAtAction(nameof(QueueController.GetNotificationQueue), new { controller = "queue", id = notification.Id }, _mapper.Map(notification)); - } - #endregion - } -} diff --git a/backend/api/Areas/Notification/Mapping/Queue/NotificationQueueMap.cs b/backend/api/Areas/Notification/Mapping/Queue/NotificationQueueMap.cs deleted file mode 100644 index 787d047105..0000000000 --- a/backend/api/Areas/Notification/Mapping/Queue/NotificationQueueMap.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Notification.Models.Queue; - -namespace Pims.Api.Areas.Project.Mapping.Queue -{ - public class NotificationQueueMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Status, src => src.Status) - .Map(dest => dest.Priority, src => src.Priority) - .Map(dest => dest.Encoding, src => src.Encoding) - .Map(dest => dest.To, src => src.To) - .Map(dest => dest.Cc, src => src.Cc) - .Map(dest => dest.Bcc, src => src.Bcc) - .Map(dest => dest.Subject, src => src.Subject) - .Map(dest => dest.Body, src => src.Body) - .Map(dest => dest.BodyType, src => src.BodyType) - .Map(dest => dest.Tag, src => src.Tag) - .Map(dest => dest.SendOn, src => src.SendOn) - .Map(dest => dest.ProjectId, src => src.ProjectId) - .Map(dest => dest.ToAgencyId, src => src.ToAgencyId) - .Map(dest => dest.ChesTransactionId, src => src.ChesTransactionId) - .Map(dest => dest.ChesMessageId, src => src.ChesMessageId) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Notification/Mapping/Template/NotificationTemplateMap.cs b/backend/api/Areas/Notification/Mapping/Template/NotificationTemplateMap.cs deleted file mode 100644 index 61d801cda8..0000000000 --- a/backend/api/Areas/Notification/Mapping/Template/NotificationTemplateMap.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Notification.Models.Template; - -namespace Pims.Api.Areas.Project.Mapping.Template -{ - public class NotificationTemplateMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.Status, src => src.Status) - .Map(dest => dest.Audience, src => src.Audience) - .Map(dest => dest.To, src => src.To) - .Map(dest => dest.Cc, src => src.Cc) - .Map(dest => dest.Bcc, src => src.Bcc) - .Map(dest => dest.Priority, src => src.Priority) - .Map(dest => dest.Encoding, src => src.Encoding) - .Map(dest => dest.Subject, src => src.Subject) - .Map(dest => dest.Body, src => src.Body) - .Map(dest => dest.BodyType, src => src.BodyType) - .Map(dest => dest.Tag, src => src.Tag) - .Map(dest => dest.Status, src => src.Status) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.Status, src => src.Status) - .Map(dest => dest.Audience, src => src.Audience) - .Map(dest => dest.To, src => src.To) - .Map(dest => dest.Cc, src => src.Cc) - .Map(dest => dest.Bcc, src => src.Bcc) - .Map(dest => dest.Priority, src => src.Priority) - .Map(dest => dest.Encoding, src => src.Encoding) - .Map(dest => dest.Subject, src => src.Subject) - .Map(dest => dest.Body, src => src.Body) - .Map(dest => dest.BodyType, src => src.BodyType) - .Map(dest => dest.Tag, src => src.Tag) - .Map(dest => dest.Status, src => src.Status) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Notification/Mapping/Template/ProjectStatusNotificationMap.cs b/backend/api/Areas/Notification/Mapping/Template/ProjectStatusNotificationMap.cs deleted file mode 100644 index 55eeaa459e..0000000000 --- a/backend/api/Areas/Notification/Mapping/Template/ProjectStatusNotificationMap.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Notification.Models.Template; - -namespace Pims.Api.Areas.Project.Mapping.Template -{ - public class ProjectStatusNotificationMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.FromStatusId, src => src.FromStatusId) - .Map(dest => dest.FromStatus, src => src.FromStatus != null ? src.FromStatus.Name : null) - .Map(dest => dest.ToStatusId, src => src.ToStatusId) - .Map(dest => dest.ToStatus, src => src.ToStatus != null ? src.ToStatus.Name : null) - .Map(dest => dest.Priority, src => src.Priority) - .Map(dest => dest.Delay, src => src.Delay) - .Map(dest => dest.DelayDays, src => src.DelayDays); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.FromStatusId, src => src.FromStatusId) - .Map(dest => dest.ToStatusId, src => src.ToStatusId) - .Map(dest => dest.Priority, src => src.Priority) - .Map(dest => dest.Delay, src => src.Delay) - .Map(dest => dest.DelayDays, src => src.DelayDays); - } - } -} diff --git a/backend/api/Areas/Notification/Models/Queue/NotificationQueueModel.cs b/backend/api/Areas/Notification/Models/Queue/NotificationQueueModel.cs deleted file mode 100644 index bb03241a07..0000000000 --- a/backend/api/Areas/Notification/Models/Queue/NotificationQueueModel.cs +++ /dev/null @@ -1,96 +0,0 @@ -using Pims.Api.Models; -using Pims.Dal.Entities; -using System; - -namespace Pims.Api.Areas.Notification.Models.Queue -{ - public class NotificationQueueModel : BaseModel - { - #region Properties - /// - /// get/set - Primary key unique identity for notification template. - /// - public int Id { get; set; } - - /// - /// get/set - A unique key to identify this notification when recipients respond. - /// - public Guid Key { get; set; } - - /// - /// get/set - The status of the notification [accepted, pending, cancelled, failed, completed]. - /// - public NotificationStatus Status { get; set; } - - /// - /// get/set - The priority of the notification [low, normal, high]. - /// - public NotificationPriorities Priority { get; set; } - - /// - /// get/set - The notification encoding [base64, binary, hex, utf-8]. - /// - public NotificationEncodings Encoding { get; set; } - - /// - /// get/set - The body type of the notification [html, text]. - /// - public NotificationBodyTypes BodyType { get; set; } - - /// - /// get/set - The date the notification should be sent on. - /// - public DateTime SendOn { get; set; } - - /// - /// get/set - Semi-colon separated list of email addresses that the notification will be sent to. - /// - public string To { get; set; } - - /// - /// get/set - Semi-colon separated list of email addresses that the notification will be blind-copied to. - /// - public string Bcc { get; set; } - - /// - /// get/set - Semi-colon separated list of email addresses that the notification will be carbon-copied to. - /// - public string Cc { get; set; } - - /// - /// get/set - The notification subject line. - /// - public string Subject { get; set; } - - /// - /// get/set - The notification body message. - /// - public string Body { get; set; } - - /// - /// get/set - A tag to group related notifications. - /// - public string Tag { get; set; } - - /// - /// get/set - Foreign key to the project this notification is related to. - /// - public int? ProjectId { get; set; } - - /// - /// get/set - Foreign key to the agency this notification was sent to. - /// - public int? ToAgencyId { get; set; } - - /// - /// get/set - CHES message Id. - /// - public Guid? ChesMessageId { get; set; } - - /// - /// get/set - CHES transaction Id. - /// - public Guid? ChesTransactionId { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Notification/Models/Template/NotificationTemplateModel.cs b/backend/api/Areas/Notification/Models/Template/NotificationTemplateModel.cs deleted file mode 100644 index bb05804033..0000000000 --- a/backend/api/Areas/Notification/Models/Template/NotificationTemplateModel.cs +++ /dev/null @@ -1,91 +0,0 @@ -using Pims.Api.Models; -using Pims.Core.Converters; -using Pims.Dal.Entities; -using System.Collections.Generic; -using System.Text.Json.Serialization; - -namespace Pims.Api.Areas.Notification.Models.Template -{ - public class NotificationTemplateModel : BaseModel - { - #region Properties - /// - /// get/set - Primary key unique identity for notification template. - /// - public int Id { get; set; } - - /// - /// get/set - A unique name to identify the template. - /// - public string Name { get; set; } - - /// - /// get/set - A description of the template. - /// - public string Description { get; set; } - - /// - /// get/set - A semi-colon separated list of email addresses this notification will be sent to. - /// - public string To { get; set; } - - /// - /// get/set - A semi-colon separated list of email addresses this notification will be carbon-copied to. - /// - public string Cc { get; set; } - - /// - /// get/set - A semi-colon separated list of email addresses this notification will be blind carbon-copied to. - /// - public string Bcc { get; set; } - - /// - /// get/set - The audience for this notification template. - /// - public NotificationAudiences Audience { get; set; } - - /// - /// get/set - The notification encoding [base64, binary, hex, utf-8]. - /// - [JsonConverter(typeof(EnumValueJsonConverter))] - public NotificationEncodings Encoding { get; set; } - - /// - /// get/set - The notification body type [html, text]. - /// - [JsonConverter(typeof(EnumValueJsonConverter))] - public NotificationBodyTypes BodyType { get; set; } - - /// - /// get/set - The notification priority [low, normal, high] - /// - [JsonConverter(typeof(EnumValueJsonConverter))] - public NotificationPriorities Priority { get; set; } - - /// - /// get/set - The subject line of the notification (supports variables). - /// - public string Subject { get; set; } - - /// - /// get/set - The body of the notification (supports variables). - /// - public string Body { get; set; } - - /// - /// get/set - Whether this template is disabled. - /// - public bool IsDisabled { get; set; } - - /// - /// get/set - A way to group notifications within CHES. - /// - public string Tag { get; set; } - - /// - /// get - A collection of project status that reference this template. - /// - public IEnumerable Status { get; set; } = new List(); - #endregion - } -} diff --git a/backend/api/Areas/Notification/Models/Template/ProjectStatusNotificationModel.cs b/backend/api/Areas/Notification/Models/Template/ProjectStatusNotificationModel.cs deleted file mode 100644 index 9dc4c58ba0..0000000000 --- a/backend/api/Areas/Notification/Models/Template/ProjectStatusNotificationModel.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Pims.Dal.Entities; - -namespace Pims.Api.Areas.Notification.Models.Template -{ - public class ProjectStatusNotificationModel - { - #region Properties - - /// - /// get/set - Primary key unique identity for project status notification. - /// - public int Id { get; set; } - - /// - /// get/set - Foreign key to the original project status before the status change. - /// - public int? FromStatusId { get; set; } - - /// - /// get/set - The from status name. - /// - public string FromStatus { get; set; } - - /// - /// get/set - Foreign key to the desired project status after the status change. - /// - public int? ToStatusId { get; set; } - - /// - /// get/set - The to status name. - /// - public string ToStatus { get; set; } - - /// - /// get/set - The notification priority [low, normal, high] - /// - public NotificationPriorities Priority { get; set; } - - /// - /// get/set - Controls when the notification will be sent. - /// - public NotificationDelays Delay { get; set; } - - /// - /// get/set - The number of days to delay the notification. - /// - public int DelayDays { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Project/Controllers/DisposeController.cs b/backend/api/Areas/Project/Controllers/DisposeController.cs deleted file mode 100644 index 450161de86..0000000000 --- a/backend/api/Areas/Project/Controllers/DisposeController.cs +++ /dev/null @@ -1,288 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http.Extensions; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Options; -using Pims.Api.Areas.Project.Models.Dispose; -using Pims.Api.Models; -using Pims.Api.Policies; -using Pims.Core.Extensions; -using Pims.Dal; -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using Pims.Dal.Security; -using Pims.Notifications; -using Swashbuckle.AspNetCore.Annotations; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Entity = Pims.Dal.Entities; -using NModel = Pims.Api.Areas.Notification.Models.Queue; - -namespace Pims.Api.Areas.Project.Controllers -{ - /// - /// DisposeController class, provides endpoints for managing disposal projects. - /// - [Authorize] - [ApiController] - [ApiVersion("1.0")] - [Area("projects")] - [Route("v{version:apiVersion}/[area]/disposal")] - [Route("[area]/disposal")] - public class DisposeController : ControllerBase - { - #region Variables - private readonly IPimsService _pimsService; - private readonly INotificationService _notifyService; - private readonly IMapper _mapper; - private readonly PimsOptions _options; - #endregion - - #region Constructors - /// - /// Creates a new instance of a DisposeController class, initializes it with the specified arguments. - /// - /// - /// - /// - /// - public DisposeController(IOptionsMonitor options, IPimsService pimsService, INotificationService notifyService, IMapper mapper) - { - _options = options.CurrentValue; - _pimsService = pimsService; - _notifyService = notifyService; - _mapper = mapper; - } - #endregion - - #region Endpoints - /// - /// Get the project for the specified 'id'. - /// - /// - /// - [HttpGet("{id:int}")] - [HasPermission(Permissions.ProjectView)] - [Produces("application/json")] - [ProducesResponseType(typeof(ProjectModel), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "project" })] - public IActionResult GetProject(int id) - { - var project = _mapper.Map(_pimsService.Project.Get(id)); - return new JsonResult(project); - } - - /// - /// Get the project for the specified 'projectNumber'. - /// - /// - /// - [HttpGet("{projectNumber}")] - [HasPermission(Permissions.ProjectView)] - [Produces("application/json")] - [ProducesResponseType(typeof(ProjectModel), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "project" })] - public IActionResult GetProject(string projectNumber) - { - var project = _mapper.Map(_pimsService.Project.Get(projectNumber)); - return new JsonResult(project); - } - - /// - /// Add the project to the datasource. - /// - /// - /// - [HttpPost] - [HasPermission(Permissions.ProjectAdd)] - [Produces("application/json")] - [ProducesResponseType(typeof(ProjectModel), 201)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "project" })] - public async Task AddProjectAsync(ProjectModel model) - { - var project = await _pimsService.Project.AddAsync(_mapper.Map(model)); - return CreatedAtAction(nameof(GetProject), new { projectNumber = project.ProjectNumber }, _mapper.Map(project)); // TODO: If notifications have failures a different response should be returned. - } - - /// - /// Update the project for the specified 'projectNumber'. - /// - /// - /// - /// - [HttpPut("{projectNumber}")] - [HasPermission(Permissions.ProjectEdit)] - [Produces("application/json")] - [ProducesResponseType(typeof(ProjectModel), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "project" })] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "To support standardized routes (/{projectNumber})")] - public async Task UpdateProjectAsync(string projectNumber, ProjectModel model) - { - var project = await _pimsService.Project.UpdateAsync(_mapper.Map(model)); - return new JsonResult(_mapper.Map(project)); // TODO: If notifications have failures a different response should be returned. - } - - /// - /// Delete the project for the specified 'projectNumber'. - /// - /// - /// - /// - [HttpDelete("{projectNumber}")] - [HasPermission(Permissions.ProjectDelete)] - [Produces("application/json")] - [ProducesResponseType(typeof(ProjectModel), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "project" })] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "To support standardized routes (/{projectNumber})")] - public async Task DeleteProjectAsync(string projectNumber, ProjectModel model) - { - var project = await _pimsService.Project.RemoveAsync(_mapper.Map(model)); - return new JsonResult(_mapper.Map(project)); - } - - #region SetStatus - /// - /// Update the specified 'project' by submitting it to the specified 'workflowCode' and request to change the status to the specified 'statusCode' - /// - /// - /// - [HttpPut("workflows")] - [HasPermission(Permissions.ProjectEdit)] - [Produces("application/json")] - [ProducesResponseType(typeof(ProjectModel), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "project" })] - public async Task SetStatusAsync(ProjectModel model) - { - if (String.IsNullOrWhiteSpace(model.WorkflowCode)) throw new ArgumentException("Argument is required and cannot be null, empty or whitespace.", nameof(model.WorkflowCode)); - if (String.IsNullOrWhiteSpace(model.StatusCode)) throw new ArgumentException("Argument is required and cannot be null, empty or whitespace.", nameof(model.StatusCode)); - - var project = _mapper.Map(model); - var workflow = _pimsService.Workflow.Get(model.WorkflowCode); - var sendNotifications = model.SendNotifications; - var status = workflow.Status.FirstOrDefault(s => s.Status.Code == model.StatusCode) ?? throw new KeyNotFoundException(); - project.WorkflowId = workflow.Id; - project.StatusId = status.StatusId; - project = await _pimsService.Project.SetStatusAsync(project, workflow, sendNotifications); - - return new JsonResult(_mapper.Map(project)); - } - - /// - /// Update the specified 'project' by submitting it to the specified 'workflowCode' and request to change the status to the specified 'statusCode' - /// - /// - /// - /// - /// - [HttpPut("workflows/{workflowCode}/{statusCode}")] - [HasPermission(Permissions.ProjectEdit)] - [Produces("application/json")] - [ProducesResponseType(typeof(ProjectModel), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "project" })] - public async Task SetStatusAsync(string workflowCode, string statusCode, ProjectModel model) - { - if (String.IsNullOrWhiteSpace(workflowCode)) throw new ArgumentException("Argument is required and cannot be null, empty or whitespace.", nameof(workflowCode)); - if (String.IsNullOrWhiteSpace(statusCode)) throw new ArgumentException("Argument is required and cannot be null, empty or whitespace.", nameof(statusCode)); - - model.WorkflowCode = workflowCode; - model.StatusCode = statusCode; - return await SetStatusAsync(model); - } - - /// - /// Update the specified 'project' by submitting it to the specified 'workflowCode' and request to change the status to the specified 'statusId' - /// - /// - /// - /// - /// - [HttpPut("workflows/{workflowCode}/{statusId:int}")] - [HasPermission(Permissions.ProjectEdit)] - [Produces("application/json")] - [ProducesResponseType(typeof(ProjectModel), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "project" })] - public async Task SetStatusAsync(string workflowCode, int statusId, ProjectModel model) - { - if (String.IsNullOrWhiteSpace(workflowCode)) throw new ArgumentException("Argument is required and cannot be null, empty or whitespace.", nameof(workflowCode)); - - var status = _pimsService.ProjectStatus.Get(statusId); - model.WorkflowCode = workflowCode; - model.StatusCode = status.Code; - return await SetStatusAsync(model); - } - #endregion - - #region Notifications - /// - /// Get the notifications for the specified project filter based on query parameters. - /// This will also update the status of all notifications that have not failed or been completed. - /// - /// - [HttpGet("{id}/notifications")] - [HasPermission(Permissions.ProjectView)] - [Produces("application/json")] - [ProducesResponseType(typeof(PageModel), 200)] - [SwaggerOperation(Tags = new[] { "project", "notification" })] - public async Task GetProjectNotificationsAsync(int id) - { - var uri = new Uri(this.Request.GetDisplayUrl()); - var query = Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query); - return await GetProjectNotificationsAsync(new ProjectNotificationFilter(query) { ProjectId = id }); - } - - /// - /// Get the notifications for the specified project based on the specified 'filter'. - /// This will also update the status of all notifications that have not failed or been completed. - /// - /// - /// - [HttpPost("notifications")] - [HasPermission(Permissions.ProjectView)] - [Produces("application/json")] - [ProducesResponseType(typeof(PageModel), 200)] - [SwaggerOperation(Tags = new[] { "project", "notification" })] - public async Task GetProjectNotificationsAsync(ProjectNotificationFilter filter) - { - var page = _pimsService.Project.GetNotificationsInQueue(filter); - foreach (var notification in page.Items.Where(n => n.ChesMessageId.HasValue && n.Status.In(NotificationStatus.Accepted, NotificationStatus.Pending))) - { - var response = await _notifyService.GetStatusAsync(notification.ChesMessageId.Value); - notification.Status = (Entity.NotificationStatus)Enum.Parse(typeof(Entity.NotificationStatus), response.Status, true); - } - _pimsService.NotificationQueue.Update(page); - - return new JsonResult(_mapper.Map>(page)); - } - - /// - /// Make a request to cancel any notifications in the queue that haven't been sent yet. - /// Note - The queue may not immediately cancel the notification, and the response may indicate it is still Pending. - /// - /// - /// - [HttpPut("{id}/notifications/cancel")] - [HasPermission(Permissions.ProjectEdit)] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "project", "notification" })] - public async Task CancelProjectNotificationsAsync(int id) - { - var notifications = await _pimsService.Project.CancelNotificationsAsync(id); - _pimsService.NotificationQueue.Update(notifications); - return new JsonResult(_mapper.Map>(notifications)); - } - #endregion - #endregion - } -} diff --git a/backend/api/Areas/Project/Controllers/ReportController.cs b/backend/api/Areas/Project/Controllers/ReportController.cs deleted file mode 100644 index f5e227c8e0..0000000000 --- a/backend/api/Areas/Project/Controllers/ReportController.cs +++ /dev/null @@ -1,201 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using MapsterMapper; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Options; -using Pims.Api.Areas.Project.Models.Report; -using Pims.Api.Models; -using Pims.Api.Policies; -using Pims.Dal; -using Pims.Dal.Security; -using Swashbuckle.AspNetCore.Annotations; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Areas.Project.Controllers -{ - /// - /// ReportController class, provides endpoints for managing project reports. - /// - [Authorize] - [ApiController] - [ApiVersion("1.0")] - [Area("projects")] - [Route("v{version:apiVersion}/[area]/reports")] - [Route("[area]/reports")] - public class ReportController : ControllerBase - { - #region Variables - private readonly IPimsService _pimsService; - private readonly IMapper _mapper; - private readonly PimsOptions _options; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ReportController class, initializes it with the specified arguments. - /// - /// - /// - /// - public ReportController(IOptionsMonitor options, IPimsService pimsService, IMapper mapper) - { - _options = options.CurrentValue; - _pimsService = pimsService; - _mapper = mapper; - } - #endregion - - #region Endpoints - /// - /// Get the project report for the specified 'id'. - /// - /// - /// - [HttpGet("{id:int}")] - [HasPermission(Permissions.ReportsSpl)] - [Produces("application/json")] - [ProducesResponseType(typeof(ProjectReportModel), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "project" })] - public IActionResult GetProjectReport(int id) - { - var report = _pimsService.ProjectReport.Get(id); - return new JsonResult(_mapper.Map(report)); - } - - /// - /// Get all of the project reports. - /// - /// - [HttpGet()] - [HasPermission(Permissions.ReportsSpl)] - [Produces("application/json")] - [ProducesResponseType(typeof(ProjectReportModel[]), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "project" })] - public IActionResult GetProjectReports() - { - var report = _pimsService.ProjectReport.GetAll(); - return new JsonResult(_mapper.Map(report)); - } - - /// - /// Get all of the project snapshots for the specified report id. - /// If snapshots to not exist for the for the 'To' date in the passed report they will be generated. - /// By passing a 'From' date different than the report saved in the DB, the variances will be calculated against the passed 'From' date. - /// - /// - [HttpPost("snapshots/{reportId:int}")] - [HasPermission(Permissions.ReportsSpl)] - [Produces("application/json")] - [ProducesResponseType(typeof(ProjectSnapshotModel[]), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "project" })] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Parameter to satisfy URL pattern.")] - public IActionResult GetProjectReportSnapshots(int reportId, ProjectReportModel model) - { - var snapshots = _pimsService.ProjectReport.GetSnapshots(_mapper.Map(model)); - return new JsonResult(_mapper.Map(snapshots)); - } - - /// - /// Get all of the project snapshots for the specified report id. - /// - /// - [HttpGet("snapshots/{reportId:int}")] - [HasPermission(Permissions.ReportsSpl)] - [Produces("application/json")] - [ProducesResponseType(typeof(ProjectSnapshotModel[]), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "project" })] - public IActionResult GetProjectReportSnapshots(int reportId) - { - var snapshots = _pimsService.ProjectReport.GetSnapshots(reportId); - return new JsonResult(_mapper.Map(snapshots)); - } - - /// - /// Add the project report to the datasource. - /// - /// - /// - [HttpPost] - [HasPermission(Permissions.ReportsSpl)] - [Produces("application/json")] - [ProducesResponseType(typeof(ProjectReportModel), 201)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "project" })] - public IActionResult AddProjectReport(ProjectReportModel model) - { - Entity.ProjectReport report; - - if (model.Snapshots?.Any() == true) - { - report = _pimsService.ProjectReport.Add(_mapper.Map(model), _mapper.Map>(model.Snapshots)); - } - else - { - report = _pimsService.ProjectReport.Add(_mapper.Map(model)); - } - return CreatedAtAction(nameof(GetProjectReport), new { id = report.Id }, _mapper.Map(report)); - } - - /// - /// Update the project report metadata in the datasource. - /// - /// - /// /// - /// - [HttpPut("{id}")] - [HasPermission(Permissions.ReportsSpl)] - [Produces("application/json")] - [ProducesResponseType(typeof(ProjectReportModel), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "project" })] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Parameter to satisfy URL pattern.")] - public IActionResult UpdateProjectReport(int id, ProjectReportModel model) - { - var report = _pimsService.ProjectReport.Update(_mapper.Map(model)); - return new JsonResult(_mapper.Map(report)); - } - - /// - /// Get a refreshed list of project snapshots based on the current data in the database. - /// - /// - /// - [HttpGet("refresh/{id}")] - [HasPermission(Permissions.ReportsSpl)] - [Produces("application/json")] - [ProducesResponseType(typeof(ProjectSnapshotModel[]), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "project" })] - public IActionResult GenerateProjectSnapshots(int id) - { - var snapshots = _pimsService.ProjectReport.Refresh(id); - return new JsonResult(_mapper.Map(snapshots)); - } - - /// - /// Delete the project report for the specified 'id'. - /// - /// - /// - /// - [HttpDelete("{id}")] - [HasPermission(Permissions.ReportsSpl)] - [Produces("application/json")] - [ProducesResponseType(typeof(ProjectReportModel), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "project" })] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "To support standardized routes (/{id})")] - public IActionResult DeleteProjectReport(int id, ProjectReportModel model) - { - _pimsService.ProjectReport.Remove(_mapper.Map(model)); - return new JsonResult(model); - } - - #endregion - } -} diff --git a/backend/api/Areas/Project/Controllers/SearchController.cs b/backend/api/Areas/Project/Controllers/SearchController.cs deleted file mode 100644 index 320ab1fcd9..0000000000 --- a/backend/api/Areas/Project/Controllers/SearchController.cs +++ /dev/null @@ -1,88 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http.Extensions; -using Microsoft.AspNetCore.Mvc; -using Pims.Api.Areas.Project.Models.Search; -using Pims.Api.Helpers.Exceptions; -using Pims.Api.Helpers.Extensions; -using Pims.Api.Models; -using Pims.Api.Policies; -using Pims.Dal; -using Pims.Dal.Entities.Models; -using Pims.Dal.Security; -using Swashbuckle.AspNetCore.Annotations; -using System; - -namespace Pims.Api.Areas.Project.Controllers -{ - /// - /// SearchController class, provides endpoints for searching projects. - /// - [Authorize] - [ApiController] - [ApiVersion("1.0")] - [Area("projects")] - [Route("v{version:apiVersion}/[area]/search")] - [Route("[area]/search")] - public class SearchController : ControllerBase - { - #region Variables - private readonly IPimsService _pimsService; - private readonly IMapper _mapper; - #endregion - - #region Constructors - /// - /// Creates a new instance of a SearchController class, initializes it with the specified arguments. - /// - /// - /// - public SearchController(IPimsService pimsService, IMapper mapper) - { - _pimsService = pimsService; - _mapper = mapper; - } - #endregion - - #region Endpoints - /// - /// Get all the projects that satisfy the filter parameters. - /// - /// - [HttpGet("page")] - [HasPermission(Permissions.ProjectView)] - [Produces("application/json")] - [ProducesResponseType(typeof(PageModel), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "project" })] - public IActionResult GetProjectsPage() - { - var uri = new Uri(this.Request.GetDisplayUrl()); - var query = Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query); - return GetProjectsPage(new ProjectFilter(query)); - } - - /// - /// Get all the projects that satisfy the filter parameters. - /// - /// - /// - [HttpPost("page")] - [HasPermission(Permissions.ProjectView)] - [Produces("application/json")] - [ProducesResponseType(typeof(PageModel), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "project" })] - public IActionResult GetProjectsPage([FromBody] ProjectFilter filter) - { - filter.ThrowBadRequestIfNull($"The request must include a filter."); - if (!filter.IsValid()) throw new BadRequestException("Projects filter must contain valid values."); - - var page = _pimsService.Project.GetPage(filter); - - var result = _mapper.Map>(page); - return new JsonResult(result); - } - #endregion - } -} diff --git a/backend/api/Areas/Project/Controllers/StatusController.cs b/backend/api/Areas/Project/Controllers/StatusController.cs deleted file mode 100644 index 5e56afcdec..0000000000 --- a/backend/api/Areas/Project/Controllers/StatusController.cs +++ /dev/null @@ -1,99 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Pims.Api.Areas.Project.Models.Status; -using Pims.Api.Models; -using Pims.Api.Policies; -using Pims.Dal; -using Pims.Dal.Security; -using Swashbuckle.AspNetCore.Annotations; -using System.Collections.Generic; -using System.Linq; - -namespace Pims.Api.Areas.Project.Controllers -{ - /// - /// StatusController class, provides endpoints for searching projects. - /// - [Authorize] - [ApiController] - [ApiVersion("1.0")] - [Area("projects")] - [Route("v{version:apiVersion}/[area]/status")] - [Route("[area]/status")] - public class StatusController : ControllerBase - { - #region Variables - private readonly IPimsService _pimsService; - private readonly IMapper _mapper; - #endregion - - #region Constructors - /// - /// Creates a new instance of a StatusController class, initializes it with the specified arguments. - /// - /// - /// - public StatusController(IPimsService pimsService, IMapper mapper) - { - _pimsService = pimsService; - _mapper = mapper; - } - #endregion - - #region Endpoints - #region Status - /// - /// Get an array of all project status. - /// - /// - [HttpGet] - [HasPermission(Permissions.ProjectView)] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [SwaggerOperation(Tags = new[] { "project" })] - public IActionResult GetStatus() - { - var status = _pimsService.ProjectStatus.Get(); - return new JsonResult(_mapper.Map(status)); - } - #endregion - - #region Tasks - /// - /// Get an array of tasks for the current disposal project status. - /// - /// - /// - [HttpGet("{statusCode}/tasks")] - [HasPermission(Permissions.ProjectView)] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "project" })] - public IActionResult GetTasksForStatus(string statusCode) - { - var tasks = _pimsService.Task.GetForStatus(statusCode).Select(s => _mapper.Map(s)).ToArray(); - return new JsonResult(tasks); - } - - /// - /// Get an array of tasks for the current disposal project status. - /// - /// - /// - [HttpGet("{statusId:int}/tasks")] - [HasPermission(Permissions.ProjectView)] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "project" })] - public IActionResult GetTasksForStatus(int statusId) - { - var tasks = _pimsService.Task.GetForStatus(statusId).Select(s => _mapper.Map(s)).ToArray(); - return new JsonResult(tasks); - } - #endregion - #endregion - } -} diff --git a/backend/api/Areas/Project/Controllers/WorkflowController.cs b/backend/api/Areas/Project/Controllers/WorkflowController.cs deleted file mode 100644 index ada311991e..0000000000 --- a/backend/api/Areas/Project/Controllers/WorkflowController.cs +++ /dev/null @@ -1,83 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Pims.Api.Areas.Project.Models.Workflow; -using Pims.Api.Models; -using Pims.Api.Policies; -using Pims.Dal; -using Pims.Dal.Security; -using Swashbuckle.AspNetCore.Annotations; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Pims.Api.Areas.Project.Controllers -{ - /// - /// WorkflowController class, provides endpoints for managing disposal projects. - /// - [Authorize] - [ApiController] - [ApiVersion("1.0")] - [Area("projects")] - [Route("v{version:apiVersion}/[area]/workflows")] - [Route("[area]/workflows")] - public class WorkflowController : ControllerBase - { - #region Variables - private readonly IPimsService _pimsService; - private readonly IMapper _mapper; - #endregion - - #region Constructors - /// - /// Creates a new instance of a WorkflowController class, initializes it with the specified arguments. - /// - /// - /// - public WorkflowController(IPimsService pimsService, IMapper mapper) - { - _pimsService = pimsService; - _mapper = mapper; - } - #endregion - - #region Endpoints - /// - /// Get an array of project status steps for the submit disposal project workflow. - /// - /// - /// - [HttpGet("{workflowCode}/status")] - [HasPermission(Permissions.ProjectView)] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "project" })] - public IActionResult GetWorkflowStatus(string workflowCode) - { - if (String.IsNullOrWhiteSpace(workflowCode)) throw new ArgumentException("Argument is required and cannot be null, empty or whitespace.", nameof(workflowCode)); - - var status = _pimsService.Workflow.Get(workflowCode).Status.Select(s => _mapper.Map(s)).ToArray(); - return new JsonResult(status); - } - - /// - /// Get an array of tasks for the current disposal project status. - /// - /// - /// - [HttpGet("{workflowCode}/tasks")] - [HasPermission(Permissions.ProjectView)] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [ProducesResponseType(typeof(ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "project" })] - public IActionResult GetWorkflowTasks(string workflowCode) - { - var tasks = _pimsService.Task.GetForWorkflow(workflowCode).Select(s => _mapper.Map(s)).ToArray(); - return new JsonResult(tasks); - } - #endregion - } -} diff --git a/backend/api/Areas/Project/Mapping/Dispose/BuildingMap.cs b/backend/api/Areas/Project/Mapping/Dispose/BuildingMap.cs deleted file mode 100644 index 79c0048e5c..0000000000 --- a/backend/api/Areas/Project/Mapping/Dispose/BuildingMap.cs +++ /dev/null @@ -1,102 +0,0 @@ -using Mapster; -using Microsoft.Extensions.Options; -using Pims.Api.Models; -using Pims.Dal.Helpers.Extensions; -using System.Collections.Generic; -using System.Linq; -using System.Text.Json; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Project.Models.Dispose; - -namespace Pims.Api.Areas.Project.Mapping.Dispose -{ - public class BuildingMap : IRegister - { - #region Variables - private readonly JsonSerializerOptions _serializerOptions; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ProjectMap, initializes with specified arguments. - /// - /// - public BuildingMap(IOptions serializerOptions) - { - _serializerOptions = serializerOptions.Value; - } - #endregion - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.ParcelId, src => src.GetParcelId()) - .Map(dest => dest.ProjectNumbers, src => JsonSerializer.Deserialize>(src.ProjectNumbers ?? "[]", _serializerOptions)) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Classification, src => src.Classification.Name) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Agency, src => src.Agency == null ? null : src.Agency.ParentId.HasValue ? src.Agency.Parent.Code : src.Agency.Code) - .Map(dest => dest.SubAgency, src => src.Agency == null ? null : src.Agency.ParentId.HasValue ? src.Agency.Name : null) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.BuildingConstructionTypeId, src => src.BuildingConstructionTypeId) - .Map(dest => dest.BuildingConstructionType, src => src.GetConstructionType()) - .Map(dest => dest.BuildingOccupantTypeId, src => src.BuildingOccupantTypeId) - .Map(dest => dest.BuildingOccupantType, src => src.GetOccupantType()) - .Map(dest => dest.BuildingPredominateUseId, src => src.BuildingPredominateUseId) - .Map(dest => dest.BuildingPredominateUse, src => src.GetPredominateUse()) - .Map(dest => dest.BuildingTenancy, src => src.BuildingTenancy) - .Map(dest => dest.BuildingFloorCount, src => src.BuildingFloorCount) - .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry) - .Map(dest => dest.OccupantName, src => src.OccupantName) - .Map(dest => dest.RentableArea, src => src.RentableArea) - .Map(dest => dest.LandArea, src => src.Parcels.FirstOrDefault() != null ? src.Parcels.FirstOrDefault().Parcel.LandArea : 0) - .Map(dest => dest.Zoning, src => src.Parcels.FirstOrDefault() != null ? src.Parcels.FirstOrDefault().Parcel.Zoning : "") - .Map(dest => dest.ZoningPotential, src => src.Parcels.FirstOrDefault() != null ? src.Parcels.FirstOrDefault().Parcel.ZoningPotential : "") - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Parcels, src => new[] { new Entity.ParcelBuilding() { ParcelId = src.ParcelId, BuildingId = src.Id } }) - .Map(dest => dest.ProjectNumbers, src => JsonSerializer.Serialize>(src.ProjectNumbers ?? Enumerable.Empty(), _serializerOptions)) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.Location, src => src) - .Map(dest => dest.AddressId, src => src.Address == null ? 0 : src.Address.Id) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.BuildingConstructionTypeId, src => src.BuildingConstructionTypeId) - .Map(dest => dest.BuildingOccupantTypeId, src => src.BuildingOccupantTypeId) - .Map(dest => dest.BuildingPredominateUseId, src => src.BuildingPredominateUseId) - .Map(dest => dest.BuildingTenancy, src => src.BuildingTenancy) - .Map(dest => dest.BuildingFloorCount, src => src.BuildingFloorCount) - .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry) - .Map(dest => dest.OccupantName, src => src.OccupantName) - .Map(dest => dest.RentableArea, src => src.RentableArea) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .AfterMapping((src, dest) => - { - var parcel = dest.Parcels.FirstOrDefault()?.Parcel; - if (parcel != null) - { - parcel.LandArea = src.LandArea; - parcel.Zoning = src.Zoning; - parcel.ZoningPotential = src.ZoningPotential; - } - }) - .Inherits(); - - config.NewConfig() - .ConstructUsing(src => Dal.Helpers.GeometryHelper.CreatePoint(src.Longitude, src.Latitude)); - } - } -} diff --git a/backend/api/Areas/Project/Mapping/Dispose/DisposalProjectMetadataMap.cs b/backend/api/Areas/Project/Mapping/Dispose/DisposalProjectMetadataMap.cs deleted file mode 100644 index af337de356..0000000000 --- a/backend/api/Areas/Project/Mapping/Dispose/DisposalProjectMetadataMap.cs +++ /dev/null @@ -1,91 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Project.Models.Dispose; - -namespace Pims.Api.Areas.Project.Mapping.Dispose -{ - public class DisposalProjectMetadataMap : IRegister - { - #region Methods - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.InitialNotificationSentOn, src => src.InitialNotificationSentOn) - .Map(dest => dest.ThirtyDayNotificationSentOn, src => src.ThirtyDayNotificationSentOn) - .Map(dest => dest.SixtyDayNotificationSentOn, src => src.SixtyDayNotificationSentOn) - .Map(dest => dest.NinetyDayNotificationSentOn, src => src.NinetyDayNotificationSentOn) - .Map(dest => dest.OnHoldNotificationSentOn, src => src.OnHoldNotificationSentOn) - .Map(dest => dest.ClearanceNotificationSentOn, src => src.ClearanceNotificationSentOn) - .Map(dest => dest.TransferredWithinGreOn, src => src.TransferredWithinGreOn) - .Map(dest => dest.RequestForSplReceivedOn, src => src.RequestForSplReceivedOn) - .Map(dest => dest.ApprovedForSplOn, src => src.ApprovedForSplOn) - .Map(dest => dest.MarketedOn, src => src.MarketedOn) - .Map(dest => dest.OfferAcceptedOn, src => src.OfferAcceptedOn) - .Map(dest => dest.DisposedOn, src => src.DisposedOn) - .Map(dest => dest.AssessedOn, src => src.AssessedOn) - .Map(dest => dest.AdjustedOn, src => src.AdjustedOn) - .Map(dest => dest.PreliminaryFormSignedOn, src => src.PreliminaryFormSignedOn) - .Map(dest => dest.FinalFormSignedOn, src => src.FinalFormSignedOn) - .Map(dest => dest.PriorYearAdjustmentOn, src => src.PriorYearAdjustmentOn) - .Map(dest => dest.ExemptionRequested, src => src.ExemptionRequested) - .Map(dest => dest.SalesCost, src => src.SalesCost) - .Map(dest => dest.NetProceeds, src => src.NetProceeds) - .Map(dest => dest.ProgramCost, src => src.ProgramCost) - .Map(dest => dest.GainLoss, src => src.GainLoss) - .Map(dest => dest.SppCapitalization, src => src.SppCapitalization) - .Map(dest => dest.GainBeforeSpl, src => src.GainBeforeSpl) - .Map(dest => dest.OcgFinancialStatement, src => src.OcgFinancialStatement) - .Map(dest => dest.OfferAmount, src => src.OfferAmount) - .Map(dest => dest.SaleWithLeaseInPlace, src => src.SaleWithLeaseInPlace) - .Map(dest => dest.PriorYearAdjustment, src => src.PriorYearAdjustment) - .Map(dest => dest.PriorYearAdjustmentAmount, src => src.PriorYearAdjustmentAmount) - .Map(dest => dest.InterestComponent, src => src.InterestComponent) - .Map(dest => dest.Realtor, src => src.Realtor) - .Map(dest => dest.RealtorRate, src => src.RealtorRate) - .Map(dest => dest.RealtorCommission, src => src.RealtorCommission) - .Map(dest => dest.PlannedFutureUse, src => src.PlannedFutureUse) - .Map(dest => dest.PreliminaryFormSignedBy, src => src.PreliminaryFormSignedBy) - .Map(dest => dest.FinalFormSignedBy, src => src.FinalFormSignedBy); - - config.NewConfig() - .Map(dest => dest.Purchaser, src => src.Purchaser) - .Map(dest => dest.InitialNotificationSentOn, src => src.InitialNotificationSentOn) - .Map(dest => dest.ThirtyDayNotificationSentOn, src => src.ThirtyDayNotificationSentOn) - .Map(dest => dest.SixtyDayNotificationSentOn, src => src.SixtyDayNotificationSentOn) - .Map(dest => dest.NinetyDayNotificationSentOn, src => src.NinetyDayNotificationSentOn) - .Map(dest => dest.OnHoldNotificationSentOn, src => src.OnHoldNotificationSentOn) - .Map(dest => dest.ClearanceNotificationSentOn, src => src.ClearanceNotificationSentOn) - .Map(dest => dest.TransferredWithinGreOn, src => src.TransferredWithinGreOn) - .Map(dest => dest.RequestForSplReceivedOn, src => src.RequestForSplReceivedOn) - .Map(dest => dest.ApprovedForSplOn, src => src.ApprovedForSplOn) - .Map(dest => dest.MarketedOn, src => src.MarketedOn) - .Map(dest => dest.OfferAcceptedOn, src => src.OfferAcceptedOn) - .Map(dest => dest.AssessedOn, src => src.AssessedOn) - .Map(dest => dest.AdjustedOn, src => src.AdjustedOn) - .Map(dest => dest.PreliminaryFormSignedOn, src => src.PreliminaryFormSignedOn) - .Map(dest => dest.FinalFormSignedOn, src => src.FinalFormSignedOn) - .Map(dest => dest.PriorYearAdjustmentOn, src => src.PriorYearAdjustmentOn) - .Map(dest => dest.ExemptionRequested, src => src.ExemptionRequested) - .Map(dest => dest.DisposedOn, src => src.DisposedOn) - .Map(dest => dest.SalesCost, src => src.SalesCost) - .Map(dest => dest.NetProceeds, src => src.NetProceeds) - .Map(dest => dest.ProgramCost, src => src.ProgramCost) - .Map(dest => dest.GainLoss, src => src.GainLoss) - .Map(dest => dest.SppCapitalization, src => src.SppCapitalization) - .Map(dest => dest.GainBeforeSpl, src => src.GainBeforeSpl) - .Map(dest => dest.OcgFinancialStatement, src => src.OcgFinancialStatement) - .Map(dest => dest.OfferAmount, src => src.OfferAmount) - .Map(dest => dest.SaleWithLeaseInPlace, src => src.SaleWithLeaseInPlace) - .Map(dest => dest.PriorYearAdjustment, src => src.PriorYearAdjustment) - .Map(dest => dest.PriorYearAdjustmentAmount, src => src.PriorYearAdjustmentAmount) - .Map(dest => dest.InterestComponent, src => src.InterestComponent) - .Map(dest => dest.Realtor, src => src.Realtor) - .Map(dest => dest.RealtorRate, src => src.RealtorRate) - .Map(dest => dest.RealtorCommission, src => src.RealtorCommission) - .Map(dest => dest.PlannedFutureUse, src => src.PlannedFutureUse) - .Map(dest => dest.PreliminaryFormSignedBy, src => src.PreliminaryFormSignedBy) - .Map(dest => dest.FinalFormSignedBy, src => src.FinalFormSignedBy); - } - #endregion - } -} diff --git a/backend/api/Areas/Project/Mapping/Dispose/ParcelMap.cs b/backend/api/Areas/Project/Mapping/Dispose/ParcelMap.cs deleted file mode 100644 index 41e0250bc5..0000000000 --- a/backend/api/Areas/Project/Mapping/Dispose/ParcelMap.cs +++ /dev/null @@ -1,99 +0,0 @@ -using Mapster; -using Microsoft.Extensions.Options; -using Pims.Api.Mapping.Converters; -using Pims.Api.Models; -using System.Collections.Generic; -using System.Text.Json; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Project.Models.Dispose; - -namespace Pims.Api.Areas.Project.Mapping.Dispose -{ - public class ParcelMap : IRegister - { - #region Variables - private readonly JsonSerializerOptions _serializerOptions; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ProjectMap, initializes with specified arguments. - /// - /// - public ParcelMap(IOptions serializerOptions) - { - _serializerOptions = serializerOptions.Value; - } - #endregion - - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.PID, src => src.ParcelIdentity) - .Map(dest => dest.PIN, src => src.PIN) - .Map(dest => dest.PropertyTypeId, src => src.PropertyTypeId) - .Map(dest => dest.ProjectNumbers, src => JsonSerializer.Deserialize>(src.ProjectNumbers ?? "[]", _serializerOptions)) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Classification, src => src.Classification.Name) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Agency, src => src.Agency == null ? null : src.Agency.ParentId.HasValue ? src.Agency.Parent.Code : src.Agency.Code) - .Map(dest => dest.SubAgency, src => src.Agency == null ? null : src.Agency.ParentId.HasValue ? src.Agency.Name : null) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.LandArea, src => src.LandArea) - .Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription) - .Map(dest => dest.Zoning, src => src.Zoning) - .Map(dest => dest.ZoningPotential, src => src.ZoningPotential) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.Buildings, src => src.Buildings) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Map(dest => dest.Parcels, src => src.Parcels) - .Inherits(); - - - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.PID, src => ParcelConverter.ConvertPID(src.PID)) - .Map(dest => dest.PIN, src => src.PIN) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Location, src => src) - .Map(dest => dest.AddressId, src => src.Address == null ? 0 : src.Address.Id) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.LandArea, src => src.LandArea) - .Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription) - .Map(dest => dest.Zoning, src => src.Zoning) - .Map(dest => dest.ZoningPotential, src => src.ZoningPotential) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.Buildings, src => src.Buildings) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Map(dest => dest.Parcels, src => src.Parcels) - .Inherits(); - - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.Id, src => src.Parcel.Id) - .Map(dest => dest.PID, src => src.Parcel.PID) - .Map(dest => dest.PIN, src => src.Parcel.PIN) - .Inherits(); - - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.ParcelId, src => src.Id) - .Inherits(); - - config.NewConfig() - .ConstructUsing(src => Dal.Helpers.GeometryHelper.CreatePoint(src.Longitude, src.Latitude)); - } - } -} diff --git a/backend/api/Areas/Project/Mapping/Dispose/ProjectAgencyResponseMap.cs b/backend/api/Areas/Project/Mapping/Dispose/ProjectAgencyResponseMap.cs deleted file mode 100644 index 15cdcd9e27..0000000000 --- a/backend/api/Areas/Project/Mapping/Dispose/ProjectAgencyResponseMap.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Project.Models.Dispose; - -namespace Pims.Api.Areas.Project.Mapping.Dispose -{ - public class ProjectAgencyResponseMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.ProjectId, src => src.ProjectId) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.AgencyCode, src => src.Agency.Name) - .Map(dest => dest.NotificationId, src => src.NotificationId) - .Map(dest => dest.Response, src => src.Response) - .Map(dest => dest.Note, src => src.Note) - .Map(dest => dest.ReceivedOn, src => src.ReceivedOn) - .Map(dest => dest.OfferAmount, src => src.OfferAmount) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.ProjectId, src => src.ProjectId) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.NotificationId, src => src.NotificationId) - .Map(dest => dest.Response, src => src.Response) - .Map(dest => dest.Note, src => src.Note) - .Map(dest => dest.ReceivedOn, src => src.ReceivedOn) - .Map(dest => dest.OfferAmount, src => src.OfferAmount) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Project/Mapping/Dispose/ProjectMap.cs b/backend/api/Areas/Project/Mapping/Dispose/ProjectMap.cs deleted file mode 100644 index 9c6825a70c..0000000000 --- a/backend/api/Areas/Project/Mapping/Dispose/ProjectMap.cs +++ /dev/null @@ -1,230 +0,0 @@ -using Mapster; -using Microsoft.Extensions.Options; -using Pims.Api.Mapping.Converters; -using Pims.Dal.Helpers.Extensions; -using System.Text.Json; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Project.Models.Dispose; - -namespace Pims.Api.Areas.Project.Mapping.Dispose -{ - /// - /// ProjectMap class, provides a way to map data from entity to model. - /// - public class ProjectMap : IRegister - { - #region Variables - private readonly JsonSerializerOptions _serializerOptions; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ProjectMap, initializes with specified arguments. - /// - /// - public ProjectMap(IOptions serializerOptions) - { - _serializerOptions = serializerOptions.Value; - } - #endregion - - #region Methods - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.ProjectNumber, src => src.ProjectNumber) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.ReportedFiscalYear, src => src.ReportedFiscalYear) - .Map(dest => dest.ActualFiscalYear, src => src.ActualFiscalYear) - .Map(dest => dest.WorkflowId, src => src.WorkflowId) - .Map(dest => dest.WorkflowCode, src => src.Workflow.Code) - .Map(dest => dest.StatusId, src => src.StatusId) - .Map(dest => dest.StatusCode, src => src.Status.Code) - .Map(dest => dest.Status, src => src.Status) - .Map(dest => dest.RiskId, src => src.RiskId) - .Map(dest => dest.Risk, src => src.Risk.Name) - .Map(dest => dest.TierLevelId, src => src.TierLevelId) - .Map(dest => dest.TierLevel, src => src.TierLevel == null ? null : src.TierLevel.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Manager, src => src.Manager) - .Map(dest => dest.Agency, src => AgencyConverter.ConvertAgencyFullName(src.Agency)) - .Map(dest => dest.AgencyCode, src => AgencyConverter.ConvertAgency(src.Agency)) - .Map(dest => dest.SubAgency, src => AgencyConverter.ConvertSubAgencyFullName(src.Agency)) - .Map(dest => dest.SubAgencyCode, src => AgencyConverter.ConvertSubAgency(src.Agency)) - .Map(dest => dest.Properties, src => src.Properties) - .Map(dest => dest.SubmittedOn, src => src.SubmittedOn) - .Map(dest => dest.ApprovedOn, src => src.ApprovedOn) - .Map(dest => dest.DeniedOn, src => src.DeniedOn) - .Map(dest => dest.CancelledOn, src => src.CancelledOn) - .Map(dest => dest.NetBook, src => src.NetBook) - .Map(dest => dest.Market, src => src.Market) - .Map(dest => dest.Assessed, src => src.Assessed) - .Map(dest => dest.Appraised, src => src.Appraised) - .Map(dest => dest.Tasks, src => src.Tasks) - .Map(dest => dest.ProjectAgencyResponses, src => src.Responses) - .Map(dest => dest.StatusHistory, src => src.StatusHistory) - .Map(dest => dest.Note, src => src.GetNoteText(Entity.NoteTypes.General)) - .Map(dest => dest.PublicNote, src => src.GetNoteText(Entity.NoteTypes.Public)) - .Map(dest => dest.PrivateNote, src => src.GetNoteText(Entity.NoteTypes.Private)) - .Map(dest => dest.OffersNote, src => src.GetNoteText(Entity.NoteTypes.Offer)) - .Map(dest => dest.AppraisedNote, src => src.GetNoteText(Entity.NoteTypes.Appraisal)) - .Map(dest => dest.ExemptionRationale, src => src.GetNoteText(Entity.NoteTypes.Exemption)) - .Map(dest => dest.ReportingNote, src => src.GetNoteText(Entity.NoteTypes.Reporting)) - .Map(dest => dest.RemovalFromSplRationale, src => src.GetNoteText(Entity.NoteTypes.SplRemoval)) - .Map(dest => dest.InterestFromEnhancedReferralNote, src => src.GetNoteText(Entity.NoteTypes.AgencyInterest)) - .Map(dest => dest.DocumentationNote, src => src.GetNoteText(Entity.NoteTypes.Documentation)) - .Map(dest => dest.AdjustmentNote, src => src.GetNoteText(Entity.NoteTypes.Adjustment)) - .Map(dest => dest.LoanTermsNote, src => src.GetNoteText(Entity.NoteTypes.LoanTerms)) - .Map(dest => dest.CloseOutNote, src => src.GetNoteText(Entity.NoteTypes.CloseOut)) - .Map(dest => dest.RemediationNote, src => src.GetNoteText(Entity.NoteTypes.Remediation)) - .Map(dest => dest.ProgramCostNote, src => src.GetNoteText(Entity.NoteTypes.SplCost)) - .Map(dest => dest.GainNote, src => src.GetNoteText(Entity.NoteTypes.SplGain)) - .Map(dest => dest.SalesHistoryNote, src => src.GetNoteText(Entity.NoteTypes.SalesHistory)) - .Map(dest => dest.Comments, src => src.GetNoteText(Entity.NoteTypes.Comments)) - .Map(dest => dest.Notes, src => src.Notes) - .AfterMapping((src, dest) => - { - var metadata = JsonSerializer.Deserialize(src.Metadata ?? "{}", _serializerOptions); - - dest.Purchaser = metadata.Purchaser; - dest.InitialNotificationSentOn = metadata.InitialNotificationSentOn; - dest.ThirtyDayNotificationSentOn = metadata.ThirtyDayNotificationSentOn; - dest.SixtyDayNotificationSentOn = metadata.SixtyDayNotificationSentOn; - dest.NinetyDayNotificationSentOn = metadata.NinetyDayNotificationSentOn; - dest.OnHoldNotificationSentOn = metadata.OnHoldNotificationSentOn; - dest.ClearanceNotificationSentOn = metadata.ClearanceNotificationSentOn; - dest.TransferredWithinGreOn = metadata.TransferredWithinGreOn; - dest.InterestedReceivedOn = metadata.InterestedReceivedOn; - dest.RequestForSplReceivedOn = metadata.RequestForSplReceivedOn; - dest.ApprovedForSplOn = metadata.ApprovedForSplOn; - dest.MarketedOn = metadata.MarketedOn; - dest.OfferAcceptedOn = metadata.OfferAcceptedOn; - dest.AssessedOn = metadata.AssessedOn; - dest.AdjustedOn = metadata.AdjustedOn; - dest.PriorYearAdjustmentOn = metadata.PriorYearAdjustmentOn; - dest.ExemptionRequested = metadata.ExemptionRequested; - dest.ExemptionApprovedOn = metadata.ExemptionApprovedOn; - dest.DisposedOn = metadata.DisposedOn; - dest.SalesCost = metadata.SalesCost; - dest.NetProceeds = metadata.NetProceeds; - dest.ProgramCost = metadata.ProgramCost; - dest.GainLoss = metadata.GainLoss; - dest.SppCapitalization = metadata.SppCapitalization; - dest.GainBeforeSpl = metadata.GainBeforeSpl; - dest.OcgFinancialStatement = metadata.OcgFinancialStatement; - dest.OfferAmount = metadata.OfferAmount; - dest.SaleWithLeaseInPlace = metadata.SaleWithLeaseInPlace; - dest.PriorYearAdjustment = metadata.PriorYearAdjustment; - dest.PriorYearAdjustmentAmount = metadata.PriorYearAdjustmentAmount; - dest.InterestComponent = metadata.InterestComponent; - dest.Realtor = metadata.Realtor; - dest.RealtorRate = metadata.RealtorRate; - dest.RealtorCommission = metadata.RealtorCommission; - dest.PlannedFutureUse = metadata.PlannedFutureUse; - dest.PreliminaryFormSignedOn = metadata.PreliminaryFormSignedOn; - dest.PreliminaryFormSignedBy = metadata.PreliminaryFormSignedBy; - dest.FinalFormSignedOn = metadata.FinalFormSignedOn; - dest.FinalFormSignedBy = metadata.FinalFormSignedBy; - dest.RemovalFromSplRequestOn = metadata.RemovalFromSplRequestOn; - dest.RemovalFromSplApprovedOn = metadata.RemovalFromSplApprovedOn; - }) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.ProjectNumber, src => src.ProjectNumber) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.ReportedFiscalYear, src => src.ReportedFiscalYear) - .Map(dest => dest.ActualFiscalYear, src => src.ActualFiscalYear) - .Map(dest => dest.WorkflowId, src => src.WorkflowId) - .Map(dest => dest.StatusId, src => src.StatusId) - .Map(dest => dest.RiskId, src => src.RiskId) - .Map(dest => dest.TierLevelId, src => src.TierLevelId) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Manager, src => src.Manager) - .Map(dest => dest.Properties, src => src.Properties) - .Map(dest => dest.SubmittedOn, src => src.SubmittedOn) - .Map(dest => dest.ApprovedOn, src => src.ApprovedOn) - .Map(dest => dest.DeniedOn, src => src.DeniedOn) - .Map(dest => dest.CancelledOn, src => src.CancelledOn) - .Map(dest => dest.NetBook, src => src.NetBook) - .Map(dest => dest.Market, src => src.Market) - .Map(dest => dest.Assessed, src => src.Assessed) - .Map(dest => dest.Appraised, src => src.Appraised) - .Map(dest => dest.Tasks, src => src.Tasks) - .Map(dest => dest.Responses, src => src.ProjectAgencyResponses) - .Map(dest => dest.Notes, src => src.Notes) - .AfterMapping((src, dest) => - { - var metadata = new Entity.Models.DisposalProjectMetadata() - { - Purchaser = src.Purchaser, - InitialNotificationSentOn = src.InitialNotificationSentOn, - ThirtyDayNotificationSentOn = src.ThirtyDayNotificationSentOn, - SixtyDayNotificationSentOn = src.SixtyDayNotificationSentOn, - NinetyDayNotificationSentOn = src.NinetyDayNotificationSentOn, - OnHoldNotificationSentOn = src.OnHoldNotificationSentOn, - ClearanceNotificationSentOn = src.ClearanceNotificationSentOn, - InterestedReceivedOn = src.InterestedReceivedOn, - TransferredWithinGreOn = src.TransferredWithinGreOn, - RequestForSplReceivedOn = src.RequestForSplReceivedOn, - ApprovedForSplOn = src.ApprovedForSplOn, - MarketedOn = src.MarketedOn, - OfferAcceptedOn = src.OfferAcceptedOn, - AssessedOn = src.AssessedOn, - AdjustedOn = src.AdjustedOn, - PriorYearAdjustmentOn = src.PriorYearAdjustmentOn, - ExemptionRequested = src.ExemptionRequested, - ExemptionApprovedOn = src.ExemptionApprovedOn, - DisposedOn = src.DisposedOn, - SalesCost = src.SalesCost, - NetProceeds = src.Market - src.SalesCost - src.ProgramCost - src.NetBook, - ProgramCost = src.ProgramCost, - GainLoss = src.GainLoss, - SppCapitalization = src.SppCapitalization, - GainBeforeSpl = src.GainBeforeSpl, - OcgFinancialStatement = src.OcgFinancialStatement, - OfferAmount = src.OfferAmount, - SaleWithLeaseInPlace = src.SaleWithLeaseInPlace, - PriorYearAdjustment = src.PriorYearAdjustment, - PriorYearAdjustmentAmount = src.PriorYearAdjustmentAmount, - InterestComponent = src.InterestComponent, - Realtor = src.Realtor, - RealtorRate = src.RealtorRate, - RealtorCommission = src.RealtorCommission, - PlannedFutureUse = src.PlannedFutureUse, - PreliminaryFormSignedOn = src.PreliminaryFormSignedOn, - PreliminaryFormSignedBy = src.PreliminaryFormSignedBy, - FinalFormSignedOn = src.FinalFormSignedOn, - FinalFormSignedBy = src.FinalFormSignedBy, - RemovalFromSplRequestOn = src.RemovalFromSplRequestOn, - RemovalFromSplApprovedOn = src.RemovalFromSplApprovedOn - }; - dest.Metadata = JsonSerializer.Serialize(metadata, _serializerOptions); - dest.AddOrUpdateNote(Entity.NoteTypes.General, src.Note ?? ""); - dest.AddOrUpdateNote(Entity.NoteTypes.Public, src.PublicNote ?? ""); - dest.AddOrUpdateNote(Entity.NoteTypes.Private, src.PrivateNote ?? ""); - dest.AddOrUpdateNote(Entity.NoteTypes.Appraisal, src.AppraisedNote ?? ""); - dest.AddOrUpdateNote(Entity.NoteTypes.Offer, src.OffersNote ?? ""); - dest.AddOrUpdateNote(Entity.NoteTypes.Exemption, src.ExemptionRationale ?? ""); - dest.AddOrUpdateNote(Entity.NoteTypes.Reporting, src.ReportingNote ?? ""); - dest.AddOrUpdateNote(Entity.NoteTypes.SplRemoval, src.RemovalFromSplRationale ?? ""); - dest.AddOrUpdateNote(Entity.NoteTypes.AgencyInterest, src.InterestFromEnhancedReferralNote ?? ""); - dest.AddOrUpdateNote(Entity.NoteTypes.Documentation, src.DocumentationNote ?? ""); - dest.AddOrUpdateNote(Entity.NoteTypes.Adjustment, src.AdjustmentNote ?? ""); - dest.AddOrUpdateNote(Entity.NoteTypes.LoanTerms, src.LoanTermsNote ?? ""); - dest.AddOrUpdateNote(Entity.NoteTypes.CloseOut, src.CloseOutNote ?? ""); - dest.AddOrUpdateNote(Entity.NoteTypes.Remediation, src.RemediationNote ?? ""); - dest.AddOrUpdateNote(Entity.NoteTypes.SplCost, src.ProgramCostNote ?? ""); - dest.AddOrUpdateNote(Entity.NoteTypes.SplGain, src.GainNote ?? ""); - dest.AddOrUpdateNote(Entity.NoteTypes.SalesHistory, src.SalesHistoryNote ?? ""); - dest.AddOrUpdateNote(Entity.NoteTypes.Comments, src.Comments ?? ""); - }) - .Inherits(); - } - #endregion - } -} diff --git a/backend/api/Areas/Project/Mapping/Dispose/ProjectNoteMap.cs b/backend/api/Areas/Project/Mapping/Dispose/ProjectNoteMap.cs deleted file mode 100644 index 702ddde135..0000000000 --- a/backend/api/Areas/Project/Mapping/Dispose/ProjectNoteMap.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Project.Models.Dispose; - -namespace Pims.Api.Areas.Project.Mapping.Dispose -{ - public class ProjectNoteMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByValue) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.ProjectId, src => src.ProjectId) - .Map(dest => dest.NoteType, src => src.NoteType) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByValue) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.ProjectId, src => src.ProjectId) - .Map(dest => dest.NoteType, src => src.NoteType) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Project/Mapping/Dispose/ProjectPropertyMap.cs b/backend/api/Areas/Project/Mapping/Dispose/ProjectPropertyMap.cs deleted file mode 100644 index 0085404108..0000000000 --- a/backend/api/Areas/Project/Mapping/Dispose/ProjectPropertyMap.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Project.Models.Dispose; - -namespace Pims.Api.Areas.Project.Mapping.Dispose -{ - public class ProjectPropertyMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.ProjectId, src => src.ProjectId) - .Map(dest => dest.PropertyType, src => src.PropertyType) - .Map(dest => dest.ParcelId, src => src.ParcelId) - .Map(dest => dest.Parcel, src => src.Parcel) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.Building, src => src.Building) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.ProjectId, src => src.ProjectId) - .Map(dest => dest.PropertyType, src => src.PropertyType) - .Map(dest => dest.ParcelId, src => src.ParcelId) - .Map(dest => dest.Parcel, src => src.Parcel) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.Building, src => src.Building) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Project/Mapping/Dispose/ProjectStatusHistoryMap.cs b/backend/api/Areas/Project/Mapping/Dispose/ProjectStatusHistoryMap.cs deleted file mode 100644 index 6bba20667e..0000000000 --- a/backend/api/Areas/Project/Mapping/Dispose/ProjectStatusHistoryMap.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Project.Models.Dispose; - -namespace Pims.Api.Areas.Project.Mapping.Dispose -{ - /// - /// ProjectStatusHistoryMap class, provides a way to map data from entity to model. - /// - public class ProjectStatusHistoryMap : IRegister - { - #region Methods - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.WorkflowId, src => src.WorkflowId) - .Map(dest => dest.Workflow, src => src.Workflow.Code) - .Map(dest => dest.StatusId, src => src.StatusId) - .Map(dest => dest.Status, src => src.Status.Code) - .Inherits(); - } - #endregion - } -} diff --git a/backend/api/Areas/Project/Mapping/Dispose/ProjectStatusMap.cs b/backend/api/Areas/Project/Mapping/Dispose/ProjectStatusMap.cs deleted file mode 100644 index fde11b751e..0000000000 --- a/backend/api/Areas/Project/Mapping/Dispose/ProjectStatusMap.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Project.Models.Dispose; - -namespace Pims.Api.Areas.Project.Mapping.Dispose -{ - public class ProjectStatusMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.Route, src => src.Route) - .Map(dest => dest.Tasks, src => src.Tasks) - .Map(dest => dest.IsTerminal, src => src.IsTerminal) - .Inherits, Api.Models.CodeModel>(); - } - } -} diff --git a/backend/api/Areas/Project/Mapping/Dispose/ProjectTaskMap.cs b/backend/api/Areas/Project/Mapping/Dispose/ProjectTaskMap.cs deleted file mode 100644 index 32b10551c6..0000000000 --- a/backend/api/Areas/Project/Mapping/Dispose/ProjectTaskMap.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Project.Models.Dispose; - -namespace Pims.Api.Areas.Project.Mapping.Dispose -{ - public class ProjectTaskMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.ProjectId, src => src.ProjectId) - .Map(dest => dest.TaskId, src => src.TaskId) - .Map(dest => dest.StatusId, src => src.Task == null ? 0 : src.Task.StatusId) - .Map(dest => dest.StatusCode, src => src.Task == null ? "" : src.Task.Status.Code) - .Map(dest => dest.Name, src => src.Task == null ? null : src.Task.Name) - .Map(dest => dest.Description, src => src.Task == null ? null : src.Task.Description) - .Map(dest => dest.IsOptional, src => src.Task == null ? true : src.Task.IsOptional) - .Map(dest => dest.IsDisabled, src => src.Task == null ? true : src.Task.IsDisabled) - .Map(dest => dest.SortOrder, src => src.Task == null ? 0 : src.Task.SortOrder) - .Map(dest => dest.IsCompleted, src => src.IsCompleted) - .Map(dest => dest.CompletedOn, src => src.CompletedOn) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.ProjectId, src => src.ProjectId) - .Map(dest => dest.TaskId, src => src.TaskId) - .Map(dest => dest.IsCompleted, src => src.IsCompleted) - .Map(dest => dest.CompletedOn, src => src.CompletedOn) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Project/Mapping/Report/ProjectReportMap.cs b/backend/api/Areas/Project/Mapping/Report/ProjectReportMap.cs deleted file mode 100644 index 090012bd49..0000000000 --- a/backend/api/Areas/Project/Mapping/Report/ProjectReportMap.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Project.Models.Report; - -namespace Pims.Api.Areas.Project.Mapping.Report -{ - public class ProjectReportMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.From, src => src.From) - .Map(dest => dest.To, src => src.To) - .Map(dest => dest.IsFinal, src => src.IsFinal) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.ReportType, src => src.ReportType) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.From, src => src.From) - .Map(dest => dest.To, src => src.To) - .Map(dest => dest.IsFinal, src => src.IsFinal) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.ReportType, src => src.ReportType) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Project/Mapping/Report/ProjectSnapshotMap.cs b/backend/api/Areas/Project/Mapping/Report/ProjectSnapshotMap.cs deleted file mode 100644 index ca785bca10..0000000000 --- a/backend/api/Areas/Project/Mapping/Report/ProjectSnapshotMap.cs +++ /dev/null @@ -1,79 +0,0 @@ -using Mapster; -using Microsoft.Extensions.Options; -using System.Text.Json; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Project.Models.Report; - -namespace Pims.Api.Areas.Project.Mapping.Report -{ - public class ProjectSnapshotMap : IRegister - { - #region Variables - private readonly JsonSerializerOptions _serializerOptions; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ProjectSnapshotMap, initializes with specified arguments. - /// - /// - public ProjectSnapshotMap(IOptions serializerOptions) - { - _serializerOptions = serializerOptions.Value; - } - #endregion - - #region Methods - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.ProjectId, src => src.ProjectId) - .Map(dest => dest.Project, src => src.Project) - .Map(dest => dest.SnapshotOn, src => src.SnapshotOn) - .Map(dest => dest.NetBook, src => src.NetBook) - .Map(dest => dest.Market, src => src.Market) - .Map(dest => dest.Assessed, src => src.Assessed) - .Map(dest => dest.Appraised, src => src.Appraised) - .AfterMapping((src, dest) => - { - var metadata = JsonSerializer.Deserialize(src.Metadata ?? "{}", _serializerOptions); - dest.SalesCost = metadata.SalesCost; - dest.NetProceeds = metadata.NetProceeds; - dest.BaselineIntegrity = metadata.BaselineIntegrity; - dest.ProgramCost = metadata.ProgramCost; - dest.GainLoss = metadata.GainLoss; - dest.OcgFinancialStatement = metadata.OcgFinancialStatement; - dest.SaleWithLeaseInPlace = metadata.SaleWithLeaseInPlace; - dest.InterestComponent = metadata.InterestComponent; - }) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.ProjectId, src => src.ProjectId) - .Map(dest => dest.NetBook, src => src.NetBook) - .Map(dest => dest.Market, src => src.Market) - .Map(dest => dest.Assessed, src => src.Assessed) - .Map(dest => dest.Appraised, src => src.Appraised) - .AfterMapping((src, dest) => - { - var metadata = new Entity.Models.DisposalProjectSnapshotMetadata() - { - SalesCost = src.SalesCost, - NetProceeds = src.NetProceeds, - BaselineIntegrity = src.BaselineIntegrity, - ProgramCost = src.ProgramCost, - GainLoss = src.GainLoss, - OcgFinancialStatement = src.OcgFinancialStatement, - SaleWithLeaseInPlace = src.SaleWithLeaseInPlace, - InterestComponent = src.InterestComponent - }; - - dest.Metadata = JsonSerializer.Serialize(metadata, _serializerOptions); - }) - .Inherits(); - } - #endregion - } -} diff --git a/backend/api/Areas/Project/Mapping/Search/ProjectMap.cs b/backend/api/Areas/Project/Mapping/Search/ProjectMap.cs deleted file mode 100644 index 81ffc5abf2..0000000000 --- a/backend/api/Areas/Project/Mapping/Search/ProjectMap.cs +++ /dev/null @@ -1,45 +0,0 @@ -using Mapster; -using Pims.Api.Mapping.Converters; -using Pims.Dal.Helpers.Extensions; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Project.Models.Search; - -namespace Pims.Api.Areas.Project.Mapping.Search -{ - public class ProjectMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.ProjectNumber, src => src.ProjectNumber) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.ReportedFiscalYear, src => src.ReportedFiscalYear) - .Map(dest => dest.ActualFiscalYear, src => src.ActualFiscalYear) - .Map(dest => dest.WorkflowCode, src => src.Workflow == null ? null : src.Workflow.Code) - .Map(dest => dest.StatusId, src => src.StatusId) - .Map(dest => dest.StatusCode, src => src.Status == null ? null : src.Status.Code) - .Map(dest => dest.Status, src => src.Status == null ? null : src.Status.Name) - .Map(dest => dest.StatusRoute, src => src.Status == null ? null : src.Status.Route) - .Map(dest => dest.TierLevelId, src => src.TierLevelId) - .Map(dest => dest.TierLevel, src => src.TierLevel == null ? null : src.TierLevel.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.Note, src => src.GetNoteText(Entity.NoteTypes.General)) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Agency, src => AgencyConverter.ConvertAgency(src.Agency)) - .Map(dest => dest.SubAgency, src => AgencyConverter.ConvertSubAgency(src.Agency)) - .Map(dest => dest.NetBook, src => src.NetBook) - .Map(dest => dest.Market, src => src.Market) - .Map(dest => dest.Assessed, src => src.Assessed) - .Map(dest => dest.Appraised, src => src.Appraised) - .Map(dest => dest.Properties, src => src.Properties) - .Map(dest => dest.UpdatedOn, src => src.UpdatedOn) - .Map(dest => dest.UpdatedBy, - src => src.UpdatedBy != null ? src.UpdatedBy.DisplayName : null) - .Map(dest => dest.CreatedOn, src => src.CreatedOn) - .Map(dest => dest.CreatedBy, - src => src.CreatedBy != null ? src.CreatedBy.DisplayName : null) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Project/Mapping/Search/ProjectPropertyMap.cs b/backend/api/Areas/Project/Mapping/Search/ProjectPropertyMap.cs deleted file mode 100644 index 3b3d72f196..0000000000 --- a/backend/api/Areas/Project/Mapping/Search/ProjectPropertyMap.cs +++ /dev/null @@ -1,106 +0,0 @@ -using Mapster; -using Pims.Api.Areas.Project.Models.Search; -using Pims.Api.Models; -using Pims.Dal.Entities; -using Pims.Dal.Helpers.Extensions; -using System.Collections.Generic; -using System.Linq; - -namespace Pims.Api.Areas.Project.Mapping.Search -{ - public class ProjectPropertyMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.PropertyTypeId, - src => src.Building != null ? PropertyTypes.Building : PropertyTypes.Land) - .Map(dest => dest.Id, src => src.BuildingId ?? src.ParcelId) - .Map(dest => dest.Classification, - src => src.Building != null ? src.Building.Classification.Name : src.Parcel.Classification.Name) - .Map(dest => dest.Name, src => src.Building != null ? src.Building.Name : src.Parcel.Name) - .Map(dest => dest.Address, - src => src.Building != null - ? src.Building.Address.FormatAddress() - : src.Parcel.Address.FormatAddress()) - .Map(dest => dest.AdministrativeArea, - src => src.Building != null ? src.Building.Address.AdministrativeArea : src.Parcel.Address.AdministrativeArea) - .Map(dest => dest.Assessed, - src => src.Building != null - ? GetBuildingAssessedValue(src.Building.Evaluations) - : GetParcelAssessedValue(src.Parcel.Evaluations)) - .Map(dest => dest.NetBook, - src => src.Building != null - ? GetBuildingNetBookValue(src.Building.Fiscals) - : GetParcelNetBookValue(src.Parcel.Fiscals)) - .Map(dest => dest.Market, - src => src.Building != null - ? GetBuildingMarketValue(src.Building.Fiscals) - : GetParcelMarketValue(src.Parcel.Fiscals)) - .Map(dest => dest.Zoning, src => src.Building != null ? src.Building.GetZoning().First() : src.Parcel.Zoning) - .Map(dest => dest.ZoningPotential, src => src.Building != null ? src.Building.GetZoningPotential().First() : src.Parcel.ZoningPotential) - - .Map(dest => dest.AgencyCode, - src => src.Building != null ? GetAgencyCode(src.Building.Agency) : GetAgencyCode(src.Parcel.Agency)) - .Map(dest => dest.SubAgency, - src => src.Building != null ? GetAgencyName(src.Building.Agency) : GetAgencyName(src.Parcel.Agency)) - - .Map(dest => dest.LandArea, src => src.Building != null ? GetLandArea(src.Building.Parcels.FirstOrDefault().Parcel) : GetLandArea(src.Parcel)) - .Map(dest => dest.ParcelId, src => src.Building != null ? src.Building.Parcels.FirstOrDefault().Parcel.GetId() : src.Parcel.GetId()) - .Inherits(); - - } - - private float? GetLandArea(Parcel parcel) - { - return parcel?.LandArea; - } - - private string GetAgencyCode(Agency agency) - { - return agency.Parent?.Code ?? agency.Code; - } - - private string GetAgencyName(Agency agency) - { - return agency != null ? agency.Name : ""; - } - - private decimal GetBuildingAssessedValue(ICollection evaluations) - { - var evaluation = evaluations.OrderByDescending(f => f.Date).FirstOrDefault(f => f.Key == EvaluationKeys.Assessed); - return evaluation?.Value ?? 0; - } - - private decimal GetParcelAssessedValue(ICollection evaluations) - { - var parcelEvaluation = evaluations.OrderByDescending(f => f.Date).FirstOrDefault(f => f.Key == EvaluationKeys.Assessed); - return parcelEvaluation?.Value ?? 0; - } - - private decimal GetBuildingNetBookValue(ICollection fiscals) - { - var buildingFiscal = fiscals.OrderByDescending(f => f.FiscalYear).FirstOrDefault(f => f.Key == FiscalKeys.NetBook); - return buildingFiscal?.Value ?? 0; - } - - private decimal GetBuildingMarketValue(ICollection fiscals) - { - var buildingFiscal = fiscals.OrderByDescending(f => f.FiscalYear).FirstOrDefault(f => f.Key == FiscalKeys.Market); - return buildingFiscal?.Value ?? 0; - } - - private decimal GetParcelNetBookValue(ICollection fiscals) - { - var parcelFiscal = fiscals.OrderByDescending(f => f.FiscalYear).FirstOrDefault(f => f.Key == FiscalKeys.NetBook); - return parcelFiscal?.Value ?? 0; - } - - private decimal GetParcelMarketValue(ICollection fiscals) - { - var parcelFiscal = fiscals.OrderByDescending(f => f.FiscalYear).FirstOrDefault(f => f.Key == FiscalKeys.Market); - return parcelFiscal?.Value ?? 0; - } - - } -} diff --git a/backend/api/Areas/Project/Mapping/Status/ProjectStatusMap.cs b/backend/api/Areas/Project/Mapping/Status/ProjectStatusMap.cs deleted file mode 100644 index 331fff4e70..0000000000 --- a/backend/api/Areas/Project/Mapping/Status/ProjectStatusMap.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Project.Models.Status; - -namespace Pims.Api.Areas.Project.Mapping.Status -{ - public class ProjectStatusMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.IsMilestone, src => src.IsMilestone) - .Map(dest => dest.IsTerminal, src => src.IsTerminal) - .Map(dest => dest.Route, src => src.Route) - .Inherits, Api.Models.CodeModel>(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Status.Id) - .Map(dest => dest.Description, src => src.Status.Description) - .Map(dest => dest.IsMilestone, src => src.Status.IsMilestone) - .Map(dest => dest.IsTerminal, src => src.Status.IsTerminal) - .Map(dest => dest.Route, src => src.Status.Route) - .Map(dest => dest.IsOptional, src => src.IsOptional) - .Map(dest => dest.Name, src => src.Status.Name) - .Map(dest => dest.Code, src => src.Status.Code) - .Map(dest => dest.IsDisabled, src => src.Status.IsDisabled) - .Map(dest => dest.CreatedOn, src => src.Status.CreatedOn) - .Map(dest => dest.UpdatedOn, src => src.Status.UpdatedOn) - .Map(dest => dest.RowVersion, src => src.Status.RowVersion) - .Map(dest => dest.SortOrder, src => src.SortOrder); - } - } -} diff --git a/backend/api/Areas/Project/Mapping/Status/TaskMap.cs b/backend/api/Areas/Project/Mapping/Status/TaskMap.cs deleted file mode 100644 index 98c2403db6..0000000000 --- a/backend/api/Areas/Project/Mapping/Status/TaskMap.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Project.Models.Status; - -namespace Pims.Api.Areas.Project.Mapping.Status -{ - public class TaskMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.IsOptional, src => src.IsOptional) - .Inherits, Api.Models.LookupModel>(); - } - } -} diff --git a/backend/api/Areas/Project/Mapping/Status/WorkflowMap.cs b/backend/api/Areas/Project/Mapping/Status/WorkflowMap.cs deleted file mode 100644 index 1dd9ce1e3f..0000000000 --- a/backend/api/Areas/Project/Mapping/Status/WorkflowMap.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Project.Models.Status; - -namespace Pims.Api.Areas.Project.Mapping.Status -{ - public class WorkflowMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Inherits, Api.Models.CodeModel>(); - } - } -} diff --git a/backend/api/Areas/Project/Mapping/Workflow/ProjectStatusMap.cs b/backend/api/Areas/Project/Mapping/Workflow/ProjectStatusMap.cs deleted file mode 100644 index 20ce1b5234..0000000000 --- a/backend/api/Areas/Project/Mapping/Workflow/ProjectStatusMap.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Project.Models.Workflow; - -namespace Pims.Api.Areas.Project.Mapping.Workflow -{ - public class ProjectStatusMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.IsMilestone, src => src.IsMilestone) - .Map(dest => dest.Route, src => src.Route) - .Inherits, Api.Models.CodeModel>(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.StatusId) - .Map(dest => dest.Code, src => src.Status.Code) - .Map(dest => dest.Name, src => src.Status.Name) - .Map(dest => dest.GroupName, src => src.Status.GroupName) - .Map(dest => dest.Description, src => src.Status.Description) - .Map(dest => dest.IsMilestone, src => src.Status.IsMilestone) - .Map(dest => dest.IsOptional, src => src.IsOptional) - .Map(dest => dest.WorkflowCode, src => src.Workflow.Code) - .Map(dest => dest.SortOrder, src => src.SortOrder) - .Map(dest => dest.Route, src => src.Status.Route) - .Map(dest => dest.ToStatus, src => src.ToStatus); - - - config.NewConfig() - .Map(dest => dest.Id, src => src.ToStatusId) - .Map(dest => dest.Code, src => src.ToWorkflowStatus.Status.Code) - .Map(dest => dest.WorkflowCode, src => src.ToWorkflowStatus.Workflow.Code) - .Map(dest => dest.Name, src => src.ToWorkflowStatus.Status.Name) - .Map(dest => dest.GroupName, src => src.ToWorkflowStatus.Status.GroupName) - .Map(dest => dest.Description, src => src.ToWorkflowStatus.Status.Description) - .Map(dest => dest.IsMilestone, src => src.ToWorkflowStatus.Status.IsMilestone) - .Map(dest => dest.IsOptional, src => src.ToWorkflowStatus.IsOptional) - .Map(dest => dest.SortOrder, src => src.ToWorkflowStatus.SortOrder) - .Map(dest => dest.Route, src => src.ToWorkflowStatus.Status.Route); - } - } -} diff --git a/backend/api/Areas/Project/Mapping/Workflow/TaskMap.cs b/backend/api/Areas/Project/Mapping/Workflow/TaskMap.cs deleted file mode 100644 index 638db894b0..0000000000 --- a/backend/api/Areas/Project/Mapping/Workflow/TaskMap.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Project.Models.Workflow; - -namespace Pims.Api.Areas.Project.Mapping.Workflow -{ - public class TaskMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.IsOptional, src => src.IsOptional) - .Inherits, Api.Models.LookupModel>(); - } - } -} diff --git a/backend/api/Areas/Project/Models/Dispose/BuildingModel.cs b/backend/api/Areas/Project/Models/Dispose/BuildingModel.cs deleted file mode 100644 index 49571debbb..0000000000 --- a/backend/api/Areas/Project/Models/Dispose/BuildingModel.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Pims.Api.Models.Parcel; -using System; -using System.Collections.Generic; - -namespace Pims.Api.Areas.Project.Models.Dispose -{ - public class BuildingModel : PropertyModel - { - #region Properties - public int ParcelId { get; set; } - - public int BuildingConstructionTypeId { get; set; } - - public string BuildingConstructionType { get; set; } - - public int BuildingFloorCount { get; set; } - - public int BuildingPredominateUseId { get; set; } - - public string BuildingPredominateUse { get; set; } - - public int BuildingOccupantTypeId { get; set; } - - public string BuildingOccupantType { get; set; } - - public DateTime? LeaseExpiry { get; set; } - - public string OccupantName { get; set; } - - public bool TransferLeaseOnSale { get; set; } - - public string BuildingTenancy { get; set; } - - public float RentableArea { get; set; } - - public float LandArea { get; set; } - - public string Zoning { get; set; } - - public string ZoningPotential { get; set; } - - public override string SubAgency { get; set; } - - public IEnumerable Evaluations { get; set; } = new List(); - - public IEnumerable Fiscals { get; set; } = new List(); - #endregion - } -} diff --git a/backend/api/Areas/Project/Models/Dispose/ParcelModel.cs b/backend/api/Areas/Project/Models/Dispose/ParcelModel.cs deleted file mode 100644 index 24cd7ccc36..0000000000 --- a/backend/api/Areas/Project/Models/Dispose/ParcelModel.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Pims.Api.Models.Parcel; -using System.Collections.Generic; - -namespace Pims.Api.Areas.Project.Models.Dispose -{ - public class ParcelModel : PropertyModel - { - #region Properties - public string PID { get; set; } - - public int? PIN { get; set; } - - public int? PropertyTypeId { get; set; } - - public float LandArea { get; set; } - - public string LandLegalDescription { get; set; } - - public string Zoning { get; set; } - - public string ZoningPotential { get; set; } - - public override string SubAgency { get; set; } - - public IEnumerable Evaluations { get; set; } = new List(); - - public IEnumerable Fiscals { get; set; } = new List(); - - public IEnumerable Buildings { get; set; } = new List(); - - public IEnumerable Parcels { get; set; } = new List(); - #endregion - } -} diff --git a/backend/api/Areas/Project/Models/Dispose/ProjectAgencyResponse.cs b/backend/api/Areas/Project/Models/Dispose/ProjectAgencyResponse.cs deleted file mode 100644 index 1fb6659dbc..0000000000 --- a/backend/api/Areas/Project/Models/Dispose/ProjectAgencyResponse.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using Pims.Dal.Entities; - -namespace Pims.Api.Areas.Project.Models.Dispose -{ - /// - /// ProjectTaskModel class, provides a model to represent a project task. - /// - public class ProjectAgencyResponse : Api.Models.BaseModel - { - #region Properties - /// - /// get/set - The foreign key to the project. - /// - public int ProjectId { get; set; } - - /// - /// get/set - The foreign key to the task. - /// - public int AgencyId { get; set; } - - /// - /// get/set - The corresponding agency code. - /// - public string AgencyCode { get; set; } - - /// - /// get/set - The foreign key of the associated notification, or null. - /// - public int? NotificationId { get; set; } - - /// - /// get/set - The response from this agency. - /// - public NotificationResponses Response { get; set; } - - /// - /// get/set - The date SRES received a business case from this agency. - /// - public DateTime? ReceivedOn { get; set; } - - /// - /// get/set - An agency specific note viewable/editable by SRES only. - /// - public string Note { get; set; } - - /// - /// get/set - amount offered by an agency for the project. - /// - public decimal OfferAmount { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Project/Models/Dispose/ProjectModel.cs b/backend/api/Areas/Project/Models/Dispose/ProjectModel.cs deleted file mode 100644 index e868773b49..0000000000 --- a/backend/api/Areas/Project/Models/Dispose/ProjectModel.cs +++ /dev/null @@ -1,488 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Api.Areas.Project.Models.Dispose -{ - /// - /// ProjectModel class, provides a model to represent the project. - /// - public class ProjectModel : Api.Models.BaseModel - { - #region Properties - /// - /// get/set - The primary key to identify the project. - /// - public int Id { get; set; } - - /// - /// get/set - A unique project number to identify the project. - /// - public string ProjectNumber { get; set; } - - /// - /// get/set - The name to identify the project. - /// - public string Name { get; set; } - - /// - /// get/set - The reported fiscal year this project. - /// - public int ReportedFiscalYear { get; set; } - - /// - /// get/set - The actual or forecasted fiscal year. - /// - public int ActualFiscalYear { get; set; } - - /// - /// get/set - The project manager name(s). - /// - public string Manager { get; set; } - - /// - /// get/set - Flag to determine whether to send notifications - /// - public bool SendNotifications { get; set; } = true; - - /// - /// get/set - The foreign key to the workflow. - /// - public int WorkflowId { get; set; } - - /// - /// get/set - The code of the workflow. - /// - public string WorkflowCode { get; set; } - - /// - /// get/set - The foreign key to the project status. - /// - public int StatusId { get; set; } - - /// - /// get/set - The code of the project status. - /// - public string StatusCode { get; set; } - - /// - /// get/set - The status of the project. - /// - public ProjectStatusModel Status { get; set; } - - /// - /// get/set - The foreign key to the project risk. - /// - public int RiskId { get; set; } - - /// - /// get/set - The project risk name. - /// - public string Risk { get; set; } - - /// - /// get/set - The foreign key to the tier level. - /// - public int TierLevelId { get; set; } - - /// - /// get/set - The tier level of the project. - /// - public string TierLevel { get; set; } - - /// - /// get/set - The project description. - /// - public string Description { get; set; } - - /// - /// get/set - The project note. - /// - public string Note { get; set; } - - /// - /// get/set - A shared note between SRES and agency. - /// - public string PublicNote { get; set; } - - /// - /// get/set - A private note for SRES only. - /// - public string PrivateNote { get; set; } - - /// - /// get/set - Notes for appraisal value. - /// - public string AppraisedNote { get; set; } - - /// - /// get/set - Note summerizing offers received. - /// - public string OffersNote { get; set; } - - /// - /// get/set - Note for reporting. - /// - public string ReportingNote { get; set; } - - /// - /// get/set - Text field describing project purchaser. - /// - public string Purchaser { get; set; } - - /// - /// get/set - Whether or not the contract for the project is conditional - /// - public bool? IsContractConditional { get; set; } - - /// - /// get/set - The foreign key to the owning agency. - /// - public int AgencyId { get; set; } - - /// - /// get/set - The owning agency name. - /// - public string Agency { get; set; } - - /// - /// get/set - The owning agency code. - /// - public string AgencyCode { get; set; } - - /// - /// get/set - The owning subagency name. - /// - public string SubAgency { get; set; } - - /// - /// get/set - The owning subagency code. - /// - public string SubAgencyCode { get; set; } - - /// - /// get/set - When the project was submitted. - /// - public DateTime? SubmittedOn { get; set; } - - /// - /// get/set - When the project was approved. - /// - public DateTime? ApprovedOn { get; set; } - - /// - /// get/set - When the project was denied. - /// - public DateTime? DeniedOn { get; set; } - - /// - /// get/set - When the project was cancelled. - /// - public DateTime? CancelledOn { get; set; } - - /// - /// get/set - When the initial enhanced referral notification was sent. - /// - public DateTime? InitialNotificationSentOn { get; set; } - - /// - /// get/set - When the 30 day enhanced referral notification was sent. - /// - public DateTime? ThirtyDayNotificationSentOn { get; set; } - - /// - /// get/set - When the 60 day enhanced referral notification was sent. - /// - public DateTime? SixtyDayNotificationSentOn { get; set; } - - /// - /// get/set - When the 90 day enhanced referral notification was sent. - /// - public DateTime? NinetyDayNotificationSentOn { get; set; } - - /// - /// get/set - When the on hold enhanced referral notification was sent. - /// - public DateTime? OnHoldNotificationSentOn { get; set; } - - /// - /// get/set - When the project was transferred within the GRE. - /// - public DateTime? TransferredWithinGreOn { get; set; } - - /// - /// get/set - When the clearance enhanced referral notification was sent. - /// - public DateTime? ClearanceNotificationSentOn { get; set; } - - /// - /// get/set - When interest within ERP was received on. - /// - public DateTime? InterestedReceivedOn { get; set; } - - /// - /// get/set - A note to capture interest in the project during ERP. - /// - public string InterestFromEnhancedReferralNote { get; set; } - - /// - /// get/set - When a request to be added to SPL was received. - /// - public DateTime? RequestForSplReceivedOn { get; set; } - - /// - /// get/set - When the project was approved to be added to SPL. - /// - public DateTime? ApprovedForSplOn { get; set; } - - /// - /// get/set - When the project was externally marketed. - /// - public DateTime? MarketedOn { get; set; } - - /// - /// get/set - When the project was disposed. - /// - public DateTime? DisposedOn { get; set; } - - /// - /// get/set - When the project was disposed. - /// - public DateTime? OfferAcceptedOn { get; set; } - - /// - /// get/set - When the project was assessed. - /// - public DateTime? AssessedOn { get; set; } - - /// - /// get/set - When the project had its sale adjusted. - /// - public DateTime? AdjustedOn { get; set; } - - /// - /// get/set - When the preliminary form was signed on. - /// - public DateTime? PreliminaryFormSignedOn { get; set; } - - /// - /// get/set - When the final form was signed on. - /// - public DateTime? FinalFormSignedOn { get; set; } - - /// - /// get/set - When the prior year adjustment sale date occurred on. - /// - public DateTime? PriorYearAdjustmentOn { get; set; } - - /// - /// get/set - Whether an exemption was requested for the ERP. - /// - public bool ExemptionRequested { get; set; } - - /// - /// get/set - The rational for the exemption from ERP. - /// - public string ExemptionRationale { get; set; } - - /// - /// get/set - The date the ADM approved the exemption. - /// - public DateTime? ExemptionApprovedOn { get; set; } - - /// - /// get/set - The netbook value which is the sum of the properties. - /// - public decimal? NetBook { get; set; } - - /// - /// get/set - The market value. - /// - public decimal? Market { get; set; } - - /// - /// get/set - The appraised value. - /// - public decimal? Appraised { get; set; } - - /// - /// get/set - The assessed value. - /// - public decimal? Assessed { get; set; } - - /// - /// get/set - The sales cost. - /// - public decimal? SalesCost { get; set; } - - /// - /// get/set - The net proceeds - /// - public decimal? NetProceeds { get; set; } - - /// - /// get/set - The SPL program cost. - /// - public decimal? ProgramCost { get; set; } - - /// - /// get/set - A note about the SPL program cost. - /// - public string ProgramCostNote { get; set; } - - /// - /// get/set - The gain or loss from selling the properties. - /// - public decimal? GainLoss { get; set; } - - /// - /// get/set - A note about the gain or loss from selling the properties. - /// - public string GainNote { get; set; } - - /// - /// get/set - The SPP Capitalization value. - /// - public decimal? SppCapitalization { get; set; } - - /// - /// get/set - The gain before SPL. - /// - public decimal? GainBeforeSpl { get; set; } - - /// - /// get/set - OCG final statement. - /// - public decimal? OcgFinancialStatement { get; set; } - - /// - /// get/set - Record the interest component. - /// - public decimal? InterestComponent { get; set; } - - /// - /// get/set - A note about the loan terms. - /// - public string LoanTermsNote { get; set; } - - /// - /// get/set - Amount offered during SPL - /// - public decimal? OfferAmount { get; set; } - - /// - /// get/set - Whether the sale includes a lease in place (SLIP). - /// - public bool SaleWithLeaseInPlace { get; set; } - - /// - /// get/set - Whether an adjustment to prior year sale is required. - /// - public bool PriorYearAdjustment { get; set; } - - /// - /// get/set - Whether an adjustment to prior year sale is required. - /// - public decimal? PriorYearAdjustmentAmount { get; set; } - - /// - /// get/set - A note about the adjustment. - /// - public string AdjustmentNote { get; set; } - - /// - /// get/set - A note about remediation. - /// - public string RemediationNote { get; set; } - - /// - /// get/set - Note to capture final close out comments. - /// - public string CloseOutNote { get; set; } - - /// - /// get/set - Panned future user description. - /// - public string PlannedFutureUse { get; set; } - - /// - /// get/set - the real estate agent - /// - public string Realtor { get; set; } - - /// - /// get/set - the real estate agent's rate for this project - /// - public string RealtorRate { get; set; } - - /// - /// get/set - the real estate agent's commission for this project - /// - public decimal? RealtorCommission { get; set; } - - /// - /// get/set - who signed the preliminary form. - /// - public string PreliminaryFormSignedBy { get; set; } - - /// - /// get/set - who signed the final form. - /// - public string FinalFormSignedBy { get; set; } - - /// - /// get/set - When the request to be removed from SPL was. - /// - public DateTime? RemovalFromSplRequestOn { get; set; } - - /// - /// get/set - When the request to be removed from SPL was approved on. - /// - public DateTime? RemovalFromSplApprovedOn { get; set; } - - /// - /// get/set - A note with the reason to remove the project from SPL. - /// - public string RemovalFromSplRationale { get; set; } - - /// - /// get/set - A note related to the received documentation. - /// - public string DocumentationNote { get; set; } - - /// - /// get/set - Sales history of the properties. - /// - public string SalesHistoryNote { get; set; } - - /// - /// get/set - Project general comments. - /// - public string Comments { get; set; } - - /// - /// get/set - An array of project notes. - /// - public IEnumerable Notes { get; set; } = new List(); - - /// - /// get/set - An array of properties associated with this project. - /// - public IEnumerable Properties { get; set; } = new List(); - - /// - /// get/set - An array of tasks associated with this project. - /// - public IEnumerable Tasks { get; set; } = new List(); - - /// - /// get/set - An array of agency responses associated with this project. - /// - public IEnumerable ProjectAgencyResponses { get; set; } = new List(); - - /// - /// get/set - An array of project status history associated with this project. - /// - public IEnumerable StatusHistory { get; set; } = new List(); - #endregion - } -} diff --git a/backend/api/Areas/Project/Models/Dispose/ProjectNoteModel.cs b/backend/api/Areas/Project/Models/Dispose/ProjectNoteModel.cs deleted file mode 100644 index 96b6089a0c..0000000000 --- a/backend/api/Areas/Project/Models/Dispose/ProjectNoteModel.cs +++ /dev/null @@ -1,30 +0,0 @@ -namespace Pims.Api.Areas.Project.Models.Dispose -{ - /// - /// ProjectNoteModel class, provides a model to represent a project note. - /// - public class ProjectNoteModel : Pims.Api.Models.BaseModel - { - #region Properties - /// - /// get/set - The primary key for the project note. - /// - public int Id { get; set; } - - /// - /// get/set - The linked project. - /// - public int ProjectId { get; set; } - - /// - /// get/set - The type of note. - /// - public int NoteType { get; set; } - - /// - /// get/set - The note. - /// - public string Note { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Project/Models/Dispose/ProjectPropertyModel.cs b/backend/api/Areas/Project/Models/Dispose/ProjectPropertyModel.cs deleted file mode 100644 index ecdffd068e..0000000000 --- a/backend/api/Areas/Project/Models/Dispose/ProjectPropertyModel.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Pims.Dal.Entities; - -namespace Pims.Api.Areas.Project.Models.Dispose -{ - /// - /// ProjectPropertyModel class, provides a model to represent a project property. - /// - public class ProjectPropertyModel : Api.Models.BaseModel - { - #region Properties - /// - /// get/set - The primary key to the relational table. - /// - public int Id { get; set; } - - /// - /// get/set - The foreign key to identify the project. - /// - public string ProjectId { get; set; } - - /// - /// get/set - The type of proeprty [Land, Building]. - /// - public PropertyTypes PropertyType { get; set; } - - /// - /// get/set - The foreign key to the parcel. - /// - public int? ParcelId { get; set; } - - public ParcelModel Parcel { get; set; } - - /// - /// get/set - The foreign key to the building. - /// - public int? BuildingId { get; set; } - - public BuildingModel Building { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Project/Models/Dispose/ProjectStatusHistoryModel.cs b/backend/api/Areas/Project/Models/Dispose/ProjectStatusHistoryModel.cs deleted file mode 100644 index 10179442bc..0000000000 --- a/backend/api/Areas/Project/Models/Dispose/ProjectStatusHistoryModel.cs +++ /dev/null @@ -1,35 +0,0 @@ -namespace Pims.Api.Areas.Project.Models.Dispose -{ - /// - /// ProjectStatusHistoryModel class, provides a model to represent the project status history. - /// - public class ProjectStatusHistoryModel : Api.Models.BaseModel - { - #region Properties - /// - /// get/set - The primary key to identify the project. - /// - public int Id { get; set; } - - /// - /// get/set - Foreign key to the project workflow. - /// - public int WorkflowId { get; set; } - - /// - /// get/set - The workflow code. - /// - public string Workflow { get; set; } - - /// - /// get/set - Foreign key to the project status. - /// - public int StatusId { get; set; } - - /// - /// get/set - The status code. - /// - public string Status { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Project/Models/Dispose/ProjectStatusModel.cs b/backend/api/Areas/Project/Models/Dispose/ProjectStatusModel.cs deleted file mode 100644 index 3af27349dd..0000000000 --- a/backend/api/Areas/Project/Models/Dispose/ProjectStatusModel.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Collections.Generic; - -namespace Pims.Api.Areas.Project.Models.Dispose -{ - /// - /// ProjectStatusModel class, provides a model to represent the project status. - /// - public class ProjectStatusModel : Api.Models.CodeModel - { - #region Properties - /// - /// get/set - A description of the status. - /// - public string Description { get; set; } - - /// - /// get/set - The route to go to for this status. - /// - public string Route { get; set; } - - /// - /// get/set - Whether this status corresponds to a terminal project. - /// - public bool IsTerminal { get; set; } - - /// - /// get/set - The tasks associated with this status. - /// - public IEnumerable Tasks { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Project/Models/Dispose/ProjectTaskModel.cs b/backend/api/Areas/Project/Models/Dispose/ProjectTaskModel.cs deleted file mode 100644 index 5995a5e0f5..0000000000 --- a/backend/api/Areas/Project/Models/Dispose/ProjectTaskModel.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System; - -namespace Pims.Api.Areas.Project.Models.Dispose -{ - /// - /// ProjectTaskModel class, provides a model to represent a project task. - /// - public class ProjectTaskModel : Api.Models.BaseModel - { - #region Properties - /// - /// get/set - The foreign key to the project. - /// - public string ProjectId { get; set; } - - /// - /// get/set - The foreign key to the task. - /// - public int TaskId { get; set; } - - /// - /// get/set - Whether the task is complete. - /// - public bool IsCompleted { get; set; } - - /// - /// get/set - When the task was completed. - /// - public DateTime? CompletedOn { get; set; } - - /// - /// get/set - The name of the task. - /// - public string Name { get; set; } - - /// - /// get/set - The task description. - /// - public string Description { get; set; } - - /// - /// get/set - Whether the task is optional. - /// - public bool IsOptional { get; set; } - - /// - /// get/set - Whether the task is disabled. - /// - public bool IsDisabled { get; set; } - - /// - /// get/set - The sort order - /// - public int SortOrder { get; set; } - - /// - /// get/set - The task status Id. - /// - public int? StatusId { get; set; } - - /// - /// get/set - The task status code. - /// - public string StatusCode { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Project/Models/Dispose/SubdivisionParcelModel.cs b/backend/api/Areas/Project/Models/Dispose/SubdivisionParcelModel.cs deleted file mode 100644 index ee321fe694..0000000000 --- a/backend/api/Areas/Project/Models/Dispose/SubdivisionParcelModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Model = Pims.Api.Models; - -namespace Pims.Api.Areas.Project.Models.Dispose -{ - public class SubdivisionParcelModel : Model.BaseModel - { - public int Id { get; set; } - - public string PID { get; set; } - - public int? PIN { get; set; } - } -} diff --git a/backend/api/Areas/Project/Models/Report/ProjectReportModel.cs b/backend/api/Areas/Project/Models/Report/ProjectReportModel.cs deleted file mode 100644 index 84c31ac38b..0000000000 --- a/backend/api/Areas/Project/Models/Report/ProjectReportModel.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Pims.Dal.Entities; -using System; -using System.Collections.Generic; - -namespace Pims.Api.Areas.Project.Models.Report -{ - /// - /// ProjectReportModel class, provides a model to represent the project reports. - /// - public class ProjectReportModel : Api.Models.BaseModel - { - #region Properties - /// - /// get/set - The primary key provides a unique identity for the project report. - /// - public int Id { get; set; } - - /// - /// get/set - Whether this report is final and should not be deleted. - /// - public bool IsFinal { get; set; } - - /// - /// get/set - An optional, descriptive name given to the report. - /// - public string Name { get; set; } - - /// - /// get/set - The oldest date of comparison snapshots used in the report. - /// - public DateTime? From { get; set; } - - /// - /// get/set - The most recent date of comparison snapshots used in the report. - /// - public DateTime? To { get; set; } - - /// - /// get/set - The type of this report. - /// - public ReportTypes ReportType { get; set; } - - /// - /// get/set - An array of snapshots for the project. - /// - public IEnumerable Snapshots { get; set; } = new List(); - #endregion - } -} diff --git a/backend/api/Areas/Project/Models/Report/ProjectSnapshotModel.cs b/backend/api/Areas/Project/Models/Report/ProjectSnapshotModel.cs deleted file mode 100644 index 53773782f1..0000000000 --- a/backend/api/Areas/Project/Models/Report/ProjectSnapshotModel.cs +++ /dev/null @@ -1,93 +0,0 @@ -using Pims.Api.Areas.Project.Models.Dispose; -using System; - -namespace Pims.Api.Areas.Project.Models.Report -{ - /// - /// ProjectSnapshotModel class, provides a model to represent the project. - /// - public class ProjectSnapshotModel : Api.Models.BaseModel - { - #region Properties - /// - /// get/set - The primary key to identify the project. - /// - public int Id { get; set; } - - /// - /// get/set - The project id corresponding to this snapshot. - /// - public int ProjectId { get; set; } - - /// - /// get/set - The project corresponding to this snapshot. - /// - public ProjectModel Project { get; set; } - - /// - /// get/set - The date when this snapshot's data was taken from the project. - /// - public DateTime? SnapshotOn { get; set; } - - /// - /// get/set - The netbook value. - /// - public decimal NetBook { get; set; } - - /// - /// get/set - The market value. - /// - public decimal Market { get; set; } - - /// - /// get/set - The assessed value. - /// - public decimal Assessed { get; set; } - - /// - /// get/set - The appraised value. - /// - public decimal Appraised { get; set; } - - /// - /// get/set - The sales cost. - /// - public decimal? SalesCost { get; set; } - - /// - /// get/set - The net proceeds - /// - public decimal? NetProceeds { get; set; } - - /// - /// get/set - The net proceed baseline integrity - /// - public decimal? BaselineIntegrity { get; set; } - - /// - /// get/set - The program cost. - /// - public decimal? ProgramCost { get; set; } - - /// - /// get/set - The gain or loss from selling the properties. - /// - public decimal? GainLoss { get; set; } - - /// - /// get/set - OCG final statement. - /// - public decimal? OcgFinancialStatement { get; set; } - - /// - /// get/set - Record the interest component. - /// - public decimal? InterestComponent { get; set; } - - /// - /// get/set - Whether the sale includes a lease in place (SLIP). - /// - public bool SaleWithLeaseInPlace { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Project/Models/Search/ProjectModel.cs b/backend/api/Areas/Project/Models/Search/ProjectModel.cs deleted file mode 100644 index ac9cda53ea..0000000000 --- a/backend/api/Areas/Project/Models/Search/ProjectModel.cs +++ /dev/null @@ -1,142 +0,0 @@ -using System.Collections.Generic; - -namespace Pims.Api.Areas.Project.Models.Search -{ - /// - /// ProjectModel class, provides a model to represent the project. - /// - public class ProjectModel : Api.Models.BaseModel - { - #region Properties - /// - /// get/set - The primary key to identify the project. - /// - public int Id { get; set; } - - /// - /// get/set - A unique project number to identify the project. - /// - public string ProjectNumber { get; set; } - - /// - /// get/set - The name to identify the project. - /// - public string Name { get; set; } - - /// - /// get/set - The reported fiscal year this project. - /// - public int ReportedFiscalYear { get; set; } - - /// - /// get/set - The actual or forecasted fiscal year. - /// - public int ActualFiscalYear { get; set; } - - /// - /// get/set - The code of the workflow. - /// - public string WorkflowCode { get; set; } - - /// - /// get/set - The foreign key to the project status. - /// - public int StatusId { get; set; } - - /// - /// get/set - The code name of the status code. - /// - public string StatusCode { get; set; } - - /// - /// get/set - The status of the project. - /// - public string Status { get; set; } - - /// - /// get/set - The project status page route. - /// - public string StatusRoute { get; set; } - - /// - /// get/set - The foreign key to the tier level. - /// - public int TierLevelId { get; set; } - - /// - /// get/set - The tier level of the project. - /// - public string TierLevel { get; set; } - - /// - /// get/set - The project description. - /// - public string Description { get; set; } - - /// - /// get/set - The project note. - /// - public string Note { get; set; } - - /// - /// get/set - The foreign key to the owning agency. - /// - public int AgencyId { get; set; } - - /// - /// get/set - The owning agency name. - /// - public string Agency { get; set; } - - /// - /// get/set - The owning agency code. - /// - public string AgencyCode { get; set; } - - /// - /// get/set - The owning subagency name. - /// - public string SubAgency { get; set; } - - /// - /// get/set - The owning subagency code. - /// - public string SubAgencyCode { get; set; } - - /// - /// get/set - The netbook value which is the sum of the properties. - /// - public decimal NetBook { get; set; } - - /// - /// get/set - The market value which is the sum of the properties. - /// - public decimal Market { get; set; } - - /// - /// get/set - The assessed value which is the sum of the properties. - /// - public decimal Assessed { get; set; } - - /// - /// get/set - The appraised value which is the sum of the properties. - /// - public decimal Appraised { get; set; } - - /// - /// get/set - Project properties - /// - public IEnumerable Properties { get; set; } = new List(); - - /// - /// get/set - User Id - /// - public string UpdatedBy { get; set; } - - /// - /// get/set - User Id - /// - public string CreatedBy { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Project/Models/Search/ProjectPropertyModel.cs b/backend/api/Areas/Project/Models/Search/ProjectPropertyModel.cs deleted file mode 100644 index 42b2bb68c3..0000000000 --- a/backend/api/Areas/Project/Models/Search/ProjectPropertyModel.cs +++ /dev/null @@ -1,95 +0,0 @@ -using Pims.Api.Models; - -namespace Pims.Api.Areas.Project.Models.Search -{ - public class ProjectPropertyModel : BaseModel - { - #region Properties - /// - /// get/set - The primary key to identify the property. - /// - public int Id { get; set; } - - /// - /// get/set - The foreign key to the property type [Land, Building]. - /// - public int PropertyTypeId { get; set; } - - /// - /// get/set - property name. - /// - public string Name { get; set; } - - /// - /// get/set - The classification of the property. - /// - public string Classification { get; set; } - - /// - /// get/set - The foreign key to the owning agency. - /// - public int AgencyId { get; set; } - - /// - /// get/set - The owning agency name. - /// - public string Agency { get; set; } - - /// - /// get/set - The owning sub agency name. - /// - public string SubAgency { get; set; } - - /// - /// get/set - The owning agency code. - /// - public string AgencyCode { get; set; } - - /// - /// get/set - The address of the property. - /// - public string Address { get; set; } - - /// - /// get/set - The name of the administrative area (city, municipality, district, etc.). - /// - public string AdministrativeArea { get; set; } - - /// - /// get/set - The property netbook value. - /// - public decimal NetBook { get; set; } - - /// - /// get/set - The property assessed value. - /// - public decimal Assessed { get; set; } - - /// - /// get/set - The property market value. - /// - public decimal Market { get; set; } - - /// - /// get/set - The land area of the parcel. - /// - public float LandArea { get; set; } - - - /// - /// get/set - The id of the parcel. - /// - public int? ParcelId { get; set; } - - /// - /// get/set - The property zoning - /// - public string Zoning { get; set; } - - /// - /// get/set - The property zoning potential - /// - public string ZoningPotential { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Project/Models/Status/ProjectStatusModel.cs b/backend/api/Areas/Project/Models/Status/ProjectStatusModel.cs deleted file mode 100644 index c2f3c775eb..0000000000 --- a/backend/api/Areas/Project/Models/Status/ProjectStatusModel.cs +++ /dev/null @@ -1,35 +0,0 @@ -namespace Pims.Api.Areas.Project.Models.Status -{ - /// - /// ProjectStatusModel class, provides a model to represent the project status. - /// - public class ProjectStatusModel : Api.Models.CodeModel - { - #region Properties - /// - /// get/set - A description of the status. - /// - public string Description { get; set; } - - /// - /// get/set - The route to go to for this status. - /// - public string Route { get; set; } - - /// - /// get/set - whether or not this status is a milestone, requiring special transition logic. - /// - public bool IsMilestone { get; set; } - - /// - /// get/set - Whether this status is terminal state. - /// - public bool IsTerminal { get; set; } - - /// - /// get/set - Whether this status is optional. - /// - public bool? IsOptional { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Project/Models/Status/TaskModel.cs b/backend/api/Areas/Project/Models/Status/TaskModel.cs deleted file mode 100644 index 7a151497af..0000000000 --- a/backend/api/Areas/Project/Models/Status/TaskModel.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace Pims.Api.Areas.Project.Models.Status -{ - /// - /// TaskModel class, provides a model to represent a task. - /// - public class TaskModel : Api.Models.LookupModel - { - #region Properties - /// - /// get/set - The task description. - /// - public string Description { get; set; } - - /// - /// get/set - Whether the task is optional. - /// - public bool IsOptional { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Project/Models/Status/WorkflowModel.cs b/backend/api/Areas/Project/Models/Status/WorkflowModel.cs deleted file mode 100644 index 0fd0ebda9f..0000000000 --- a/backend/api/Areas/Project/Models/Status/WorkflowModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Pims.Api.Areas.Project.Models.Status -{ - /// - /// WorkflowModel class, provides a model to represent the project workflows. - /// - public class WorkflowModel : Api.Models.CodeModel - { - } -} diff --git a/backend/api/Areas/Project/Models/Workflow/ProjectStatusModel.cs b/backend/api/Areas/Project/Models/Workflow/ProjectStatusModel.cs deleted file mode 100644 index 2996c7f808..0000000000 --- a/backend/api/Areas/Project/Models/Workflow/ProjectStatusModel.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.Collections.Generic; - -namespace Pims.Api.Areas.Project.Models.Workflow -{ - /// - /// ProjectStatusModel class, provides a model to represent the project status. - /// - public class ProjectStatusModel : Api.Models.CodeModel - { - #region Properties - /// - /// get/set - A name to describe related status. - /// - public string GroupName { get; set; } - - /// - /// get/set - A description of the status. - /// - public string Description { get; set; } - - /// - /// get/set - The route to go to for this status. - /// - public string Route { get; set; } - - /// - /// get/set - whether or not this status is a milestone, requiring special transition logic. - /// - public bool IsMilestone { get; set; } - - /// - /// get/set - Whether this status is optional for the specified workflow. - /// - public bool? IsOptional { get; set; } - - /// - /// get/set - The workflow this status belongs to. - /// - public string WorkflowCode { get; set; } - - /// - /// get/set - An array of status this status can transition to. - /// - public IEnumerable ToStatus { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Project/Models/Workflow/TaskModel.cs b/backend/api/Areas/Project/Models/Workflow/TaskModel.cs deleted file mode 100644 index 18956935e8..0000000000 --- a/backend/api/Areas/Project/Models/Workflow/TaskModel.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace Pims.Api.Areas.Project.Models.Workflow -{ - /// - /// TaskModel class, provides a model to represent a task. - /// - public class TaskModel : Api.Models.LookupModel - { - #region Properties - /// - /// get/set - The task description. - /// - public string Description { get; set; } - - /// - /// get/set - Whether the task is optional. - /// - public bool IsOptional { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Property/Controllers/BuildingController.cs b/backend/api/Areas/Property/Controllers/BuildingController.cs deleted file mode 100644 index 9bb8ebcc5e..0000000000 --- a/backend/api/Areas/Property/Controllers/BuildingController.cs +++ /dev/null @@ -1,154 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Pims.Api.Policies; -using Pims.Dal; -using Pims.Dal.Security; -using Swashbuckle.AspNetCore.Annotations; -using Model = Pims.Api.Areas.Property.Models.Building; -using ApiModels = Pims.Api.Models; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Areas.Property.Controllers -{ - /// - /// BuildingController class, provides endpoints for managing my buildings. - /// - [Authorize] - [ApiController] - [ApiVersion("1.0")] - [Area("properties")] - [Route("v{version:apiVersion}/[area]/buildings")] - [Route("[area]/buildings")] - public class BuildingController : ControllerBase - { - #region Variables - private readonly IPimsService _pimsService; - private readonly IMapper _mapper; - #endregion - - #region Constructors - /// - /// Creates a new instance of a BuildingController class. - /// - /// - /// - public BuildingController(IPimsService pimsService, IMapper mapper) - { - _pimsService = pimsService; - _mapper = mapper; - } - #endregion - - #region Endpoints - /// - /// Get the building from the datasource if the user is allowed. - /// - /// - /// - [HttpGet("{id}")] - [HasPermission(Permissions.PropertyView)] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.BuildingModel), 200)] - [SwaggerOperation(Tags = new[] { "building" })] - public IActionResult GetBuilding(int id) - { - var entity = _pimsService.Building.Get(id); - var building = _mapper.Map(entity); - - return new JsonResult(building); - } - - /// - /// Add a new building to the datasource for the current user. - /// - /// - /// - [HttpPost] - [HasPermission(Permissions.PropertyAdd)] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.BuildingModel), 201)] - [ProducesResponseType(typeof(ApiModels.ErrorResponseModel), 400)] - [ProducesResponseType(typeof(ApiModels.ErrorResponseModel), 403)] - [SwaggerOperation(Tags = new[] { "building" })] - public IActionResult AddBuilding([FromBody] Model.BuildingModel model) - { - var entity = _mapper.Map(model); - - var addedEntity = _pimsService.Building.Add(entity); - var building = _mapper.Map(addedEntity); - - return CreatedAtAction(nameof(GetBuilding), new { id = building.Id }, building); - } - - /// - /// Update the specified building in the datasource if the user is allowed. - /// - /// - /// - /// - [HttpPut("{id}")] - [HasPermission(Permissions.PropertyEdit)] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.BuildingModel), 200)] - [ProducesResponseType(typeof(ApiModels.ErrorResponseModel), 400)] - [ProducesResponseType(typeof(ApiModels.ErrorResponseModel), 403)] - [SwaggerOperation(Tags = new[] { "building" })] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "To support standardized routes (/update/{id})")] - public IActionResult UpdateBuilding(int id, [FromBody] Model.BuildingModel model) - { - var entity = _mapper.Map(model); - - var updatedEntity = _pimsService.Building.Update(entity); - var building = _mapper.Map(updatedEntity); - - return new JsonResult(building); - } - - /// - /// Update the specified building financial values in the datasource if the user is allowed. - /// - /// - /// - /// - [HttpPut("{id}/financials")] - [HasPermission(Permissions.PropertyEdit)] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.BuildingModel), 200)] - [ProducesResponseType(typeof(ApiModels.ErrorResponseModel), 400)] - [ProducesResponseType(typeof(ApiModels.ErrorResponseModel), 403)] - [SwaggerOperation(Tags = new[] { "building" })] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "To support standardized routes (/update/{id})")] - public IActionResult UpdateBuildingFinancials(int id, [FromBody] Model.BuildingModel model) - { - var entity = _mapper.Map(model); - - var updatedEntity = _pimsService.Building.UpdateFinancials(entity); - var building = _mapper.Map(updatedEntity); - - return new JsonResult(building); - } - - /// - /// Delete the specified building from the datasource if the user is allowed. - /// - /// - /// - /// - [HttpDelete("{id}")] - [HasPermission(Permissions.PropertyDelete)] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.BuildingModel), 200)] - [SwaggerOperation(Tags = new[] { "building" })] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "To support standardized routes (/delete/{id})")] - public IActionResult DeleteBuilding(int id, [FromBody] Model.BuildingModel model) - { - var entity = _mapper.Map(model); - - _pimsService.Building.Remove(entity); - - return new JsonResult(model); - } - #endregion - } -} diff --git a/backend/api/Areas/Property/Controllers/ParcelController.cs b/backend/api/Areas/Property/Controllers/ParcelController.cs deleted file mode 100644 index bb912dcd48..0000000000 --- a/backend/api/Areas/Property/Controllers/ParcelController.cs +++ /dev/null @@ -1,222 +0,0 @@ -using System; -using System.Collections.Generic; -using MapsterMapper; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -using Pims.Api.Policies; -using Pims.Dal; -using Pims.Dal.Security; -using Swashbuckle.AspNetCore.Annotations; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Property.Models.Parcel; -using Microsoft.AspNetCore.Http.Extensions; -using Pims.Api.Helpers.Extensions; -using Pims.Api.Helpers.Exceptions; -using EModel = Pims.Dal.Entities.Models; -using System.Linq; - -namespace Pims.Api.Areas.Property.Controllers -{ - /// - /// ParcelController class, provides endpoints for managing my parcels. - /// - [Authorize] - [ApiController] - [ApiVersion("1.0")] - [Area("properties")] - [Route("v{version:apiVersion}/[area]/parcels")] - [Route("[area]/parcels")] - public class ParcelController : ControllerBase - { - #region Variables - private readonly ILogger _logger; - private readonly IPimsService _pimsService; - private readonly IMapper _mapper; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ParcelController class. - /// - /// - /// - /// - public ParcelController(ILogger logger, IPimsService pimsService, IMapper mapper) - { - _logger = logger; - _pimsService = pimsService; - _mapper = mapper; - } - #endregion - - #region Endpoints - - /// - /// Get the parcel from the datasource if the user is allowed. - /// - /// - /// - [HttpGet("{id}")] - [HasPermission(Permissions.PropertyView)] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.ParcelModel), 200)] - [SwaggerOperation(Tags = new[] { "parcel" })] - public IActionResult GetParcel(int id) - { - var entity = _pimsService.Parcel.Get(id); - var parcel = _mapper.Map(entity); - - return new JsonResult(parcel); - } - - /// - /// Get all the properties that satisfy the filter parameters. - /// - /// - [HttpGet] - [HasPermission(Permissions.PropertyView)] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [SwaggerOperation(Tags = new[] { "parcel" })] - public IActionResult GetParcels() - { - var uri = new Uri(this.Request.GetDisplayUrl()); - var query = Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query); - return GetParcels(new EModel.ParcelFilter(query)); - } - - /// - /// Get all the properties that satisfy the filter parameters. - /// - /// - /// - [HttpPost("filter")] - [HasPermission(Permissions.PropertyView)] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [SwaggerOperation(Tags = new[] { "parcel" })] - public IActionResult GetParcels([FromBody] EModel.ParcelFilter filter) - { - filter.ThrowBadRequestIfNull($"The request must include a filter."); - if (!filter.IsValid()) throw new BadRequestException("Parcel filter must contain valid values."); - - var parcels = _pimsService.Parcel.Get((EModel.ParcelFilter)filter).ToArray(); - return new JsonResult(_mapper.Map(parcels).ToArray()); - } - - /// - /// Check if PID is available - /// - /// - [HttpGet("check/pid-available")] - [HasPermission(Permissions.PropertyView)] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.CheckPidAvailabilityResponseModel), 200)] - [SwaggerOperation(Tags = new[] { "parcel" })] - public IActionResult IsPidAvailable(int parcelId, int pid) - { - var result = new Model.CheckPidAvailabilityResponseModel - { Available = _pimsService.Parcel.IsPidAvailable(parcelId, pid) }; - return new JsonResult(result); - } - - /// - /// Check if PIN is available - /// - /// - [HttpGet("check/pin-available")] - [HasPermission(Permissions.PropertyView)] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.CheckPidAvailabilityResponseModel), 200)] - [SwaggerOperation(Tags = new[] { "parcel" })] - public IActionResult IsPinAvailable(int parcelId, int pin) - { - var result = new Model.CheckPidAvailabilityResponseModel - { Available = _pimsService.Parcel.IsPinAvailable(parcelId, pin) }; - return new JsonResult(result); - } - - /// - /// Add a new parcel to the datasource for the current user. - /// - /// - /// - [HttpPost] - [HasPermission(Permissions.PropertyAdd)] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.ParcelModel), 200)] - [SwaggerOperation(Tags = new[] { "parcel" })] - public IActionResult AddParcel([FromBody] Model.ParcelModel model) - { - var entity = _mapper.Map(model); - - _pimsService.Parcel.Add(entity); - var parcel = _mapper.Map(entity); - - return CreatedAtAction(nameof(GetParcel), new { id = parcel.Id }, parcel); - } - - /// - /// Update the specified parcel in the datasource if the user is allowed. - /// - /// - /// - /// - [HttpPut("{id}")] - [HasPermission(Permissions.PropertyEdit)] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.ParcelModel), 200)] - [SwaggerOperation(Tags = new[] { "parcel" })] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "To support standardized routes (/update/{id})")] - public IActionResult UpdateParcel(int id, [FromBody] Model.ParcelModel model) - { - var entity = _mapper.Map(model); - - var parcel = _pimsService.Parcel.Update(entity); - return new JsonResult(_mapper.Map(parcel)); - } - - /// - /// Update the specified parcel financials values in the datasource if the user is allowed. - /// - /// - /// - /// - [HttpPut("{id}/financials")] - [HasPermission(Permissions.PropertyEdit)] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.ParcelModel), 200)] - [SwaggerOperation(Tags = new[] { "parcel" })] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "To support standardized routes (/update/{id})")] - public IActionResult UpdateParcelFinancials(int id, [FromBody] Model.ParcelModel model) - { - var entity = _mapper.Map(model); - - var parcel = _pimsService.Parcel.Update(entity); - return new JsonResult(_mapper.Map(parcel)); - } - - /// - /// Delete the specified parcel from the datasource if the user is allowed. - /// - /// - /// - /// - [HttpDelete("{id}")] - [HasPermission(Permissions.PropertyDelete, Permissions.PropertyEdit)] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.ParcelModel), 200)] - [SwaggerOperation(Tags = new[] { "parcel" })] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "To support standardized routes (/delete/{id})")] - public IActionResult DeleteParcel(int id, [FromBody] Model.ParcelModel model) - { - var entity = _mapper.Map(model); - - _pimsService.Parcel.Remove(entity); - - return new JsonResult(model); - } - #endregion - } -} diff --git a/backend/api/Areas/Property/Controllers/SearchController.cs b/backend/api/Areas/Property/Controllers/SearchController.cs deleted file mode 100644 index 6eeadf3926..0000000000 --- a/backend/api/Areas/Property/Controllers/SearchController.cs +++ /dev/null @@ -1,188 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http.Extensions; -using Microsoft.AspNetCore.Mvc; -using Pims.Api.Areas.Property.Models.Search; -using Pims.Api.Helpers.Exceptions; -using Pims.Api.Helpers.Extensions; -using Pims.Api.Policies; -using Pims.Core.Extensions; -using Pims.Dal; -using Pims.Dal.Entities.Models; -using Pims.Dal.Security; -using Swashbuckle.AspNetCore.Annotations; -using System; -using System.Collections.Generic; -using System.Linq; -using BModel = Pims.Api.Models; - -namespace Pims.Api.Areas.Property.Controllers -{ - /// - /// SearchController class, provides endpoints for searching properties. - /// - [Authorize] - [ApiController] - [ApiVersion("1.0")] - [Area("properties")] - [Route("v{version:apiVersion}/[area]/search")] - [Route("[area]/search")] - public class SearchController : ControllerBase - { - #region Variables - private readonly IPimsService _pimsService; - private readonly IMapper _mapper; - #endregion - - #region Constructors - /// - /// Creates a new instance of a SearchController class, initializes it with the specified arguments. - /// - /// - /// - /// - public SearchController(IPimsService pimsService, IMapper mapper) - { - _pimsService = pimsService; - _mapper = mapper; - } - #endregion - - #region Endpoints - #region Landing Page Endpoints - /// - /// Get all the properties that satisfy the filter parameters. - /// - /// - [HttpGet] - [HasPermission(Permissions.PropertyView)] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [SwaggerOperation(Tags = new[] { "property" })] - public IActionResult GetProperties() - { - var uri = new Uri(this.Request.GetDisplayUrl()); - var query = Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query); - return GetProperties(new PropertyFilterModel(query)); - } - - /// - /// Get all the properties that satisfy the filter parameters. - /// - /// - /// - [HttpPost("filter")] - [HasPermission(Permissions.PropertyView)] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [SwaggerOperation(Tags = new[] { "property" })] - public IActionResult GetProperties([FromBody] PropertyFilterModel filter) - { - filter.ThrowBadRequestIfNull($"The request must include a filter."); - if (!filter.IsValid()) throw new BadRequestException("Property filter must contain valid values."); - - var properties = _pimsService.Property.Get((AllPropertyFilter)filter).ToArray(); - return new JsonResult(_mapper.Map(properties).ToArray()); - } - #endregion - - /// - /// Get all the property names that satisfy the filter paramaters. - /// - /// - /// - [HttpGet("names")] - [HasPermission(Permissions.PropertyView)] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [SwaggerOperation(Tags = new[] { "property" })] - public IActionResult GetPropertyNames([FromQuery] PropertyFilterModel filter) - { - filter.ThrowBadRequestIfNull($"The request must include a filter."); - if (!filter.IsValid()) throw new BadRequestException("Property filter must contain valid values."); - - var propertyNames = _pimsService.Property.GetNames((AllPropertyFilter)filter); - return new JsonResult(propertyNames); - } - - #region GeoJSON - /// - /// Get all the properties that satisfy the filter parameters. - /// - /// - [HttpGet("wfs")] - [HasPermission(Permissions.PropertyView)] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable>), 200)] - [SwaggerOperation(Tags = new[] { "property" })] - public IActionResult GetGeoJson() - { - var uri = new Uri(this.Request.GetDisplayUrl()); - var query = Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query); - return GetGeoJson(new GeoJsonFilterModel(query)); - } - - /// - /// Get all the properties that satisfy the filter parameters. - /// - /// - /// - [HttpPost("wfs/filter")] - [HasPermission(Permissions.PropertyView)] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable>), 200)] - [SwaggerOperation(Tags = new[] { "property" })] - public IActionResult GetGeoJson([FromBody] GeoJsonFilterModel filter) - { - filter.ThrowBadRequestIfNull($"The request must include a filter."); - if (!filter.IsValid()) throw new BadRequestException("Property filter must contain valid values."); - - var pfilter = filter.CopyValues(new AllPropertyFilter(filter.Boundary)); - pfilter.PropertyType = filter.PropertyType; - - var properties = _pimsService.Property.Search(pfilter).ToArray(); - var results = _mapper.Map[]>(properties).ToArray(); - return new JsonResult(results); - } - #endregion - - #region Property Paging Endpoints - /// - /// Get all the properties that satisfy the filter parameters. - /// - /// - [HttpGet("page")] - [HasPermission(Permissions.PropertyView)] - [Produces("application/json")] - [ProducesResponseType(typeof(BModel.PageModel), 200)] - [SwaggerOperation(Tags = new[] { "property" })] - public IActionResult GetPropertiesPage() - { - var uri = new Uri(this.Request.GetDisplayUrl()); - var query = Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query); - return GetPropertiesPage(new PropertyFilterModel(query)); - } - - /// - /// Get all the properties that satisfy the filter parameters. - /// - /// - /// - [HttpPost("page/filter")] - [HasPermission(Permissions.PropertyView)] - [Produces("application/json")] - [ProducesResponseType(typeof(BModel.PageModel), 200)] - [SwaggerOperation(Tags = new[] { "property" })] - public IActionResult GetPropertiesPage([FromBody] PropertyFilterModel filter) - { - filter.ThrowBadRequestIfNull($"The request must include a filter."); - if (!filter.IsValid()) throw new BadRequestException("Property filter must contain valid values."); - - var page = _pimsService.Property.GetPage((AllPropertyFilter)filter); - var result = _mapper.Map>(page); - return new JsonResult(result); - } - #endregion - #endregion - } -} diff --git a/backend/api/Areas/Property/Mapping/Building/BuildingEvaluationMap.cs b/backend/api/Areas/Property/Mapping/Building/BuildingEvaluationMap.cs deleted file mode 100644 index b3c7fcec22..0000000000 --- a/backend/api/Areas/Property/Mapping/Building/BuildingEvaluationMap.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Property.Models.Building; -using BModel = Pims.Api.Models; - -namespace Pims.Api.Areas.Property.Mapping.Building -{ - public class BuildingEvaluationMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.Date, src => src.Date) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - - - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.Date, src => src.Date) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Property/Mapping/Building/BuildingFiscalMap.cs b/backend/api/Areas/Property/Mapping/Building/BuildingFiscalMap.cs deleted file mode 100644 index 262e7e0fc6..0000000000 --- a/backend/api/Areas/Property/Mapping/Building/BuildingFiscalMap.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Property.Models.Building; -using BModel = Pims.Api.Models; - -namespace Pims.Api.Areas.Property.Mapping.Building -{ - public class BuildingFiscalMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.FiscalYear, src => src.FiscalYear) - .Map(dest => dest.EffectiveDate, src => src.EffectiveDate) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - - - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.FiscalYear, src => src.FiscalYear) - .Map(dest => dest.EffectiveDate, src => src.EffectiveDate) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Property/Mapping/Building/BuildingMap.cs b/backend/api/Areas/Property/Mapping/Building/BuildingMap.cs deleted file mode 100644 index 072a292681..0000000000 --- a/backend/api/Areas/Property/Mapping/Building/BuildingMap.cs +++ /dev/null @@ -1,121 +0,0 @@ -using Mapster; -using Pims.Api.Mapping.Converters; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Property.Models.Building; -using BModel = Pims.Api.Models; -using Pims.Dal.Helpers.Extensions; -using System.Text.Json; -using Microsoft.Extensions.Options; -using System.Collections.Generic; -using System.Linq; - -namespace Pims.Api.Areas.Property.Mapping.Building -{ - public class BuildingMap : IRegister - { - #region Variables - private readonly JsonSerializerOptions _serializerOptions; - #endregion - - #region Constructors - /// - /// Creates a new instance of a BuildingMap, initializes with specified arguments. - /// - /// - public BuildingMap(IOptions serializerOptions) - { - _serializerOptions = serializerOptions.Value; - } - #endregion - - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.ParcelId, src => src.GetParcelId()) - .Map(dest => dest.ProjectWorkflow, src => src.GetLatestWorkflowCode()) - .Map(dest => dest.ProjectStatus, src => src.GetLatestProjectStatus()) - .Map(dest => dest.ProjectNumbers, src => JsonSerializer.Deserialize>(src.ProjectNumbers ?? "[]", _serializerOptions)) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Classification, src => src.Classification.Name) - .Map(dest => dest.EncumbranceReason, src => src.EncumbranceReason) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Agency, src => AgencyConverter.ConvertAgency(src.Agency)) - .Map(dest => dest.SubAgency, src => AgencyConverter.ConvertSubAgency(src.Agency)) - .Map(dest => dest.AgencyFullName, src => AgencyConverter.ConvertAgencyFullName(src.Agency)) - .Map(dest => dest.SubAgencyFullName, src => AgencyConverter.ConvertSubAgencyFullName(src.Agency)) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.BuildingConstructionTypeId, src => src.BuildingConstructionTypeId) - .Map(dest => dest.BuildingConstructionType, src => src.GetConstructionType()) - .Map(dest => dest.BuildingOccupantTypeId, src => src.BuildingOccupantTypeId) - .Map(dest => dest.BuildingOccupantType, src => src.GetOccupantType()) - .Map(dest => dest.BuildingPredominateUseId, src => src.BuildingPredominateUseId) - .Map(dest => dest.BuildingPredominateUse, src => src.GetPredominateUse()) - .Map(dest => dest.BuildingTenancy, src => src.BuildingTenancy) - .Map(dest => dest.BuildingTenancyUpdatedOn, src => src.BuildingTenancyUpdatedOn) - .Map(dest => dest.BuildingFloorCount, src => src.BuildingFloorCount) - .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry) - .Map(dest => dest.OccupantName, src => src.OccupantName) - .Map(dest => dest.RentableArea, src => src.RentableArea) - .Map(dest => dest.TotalArea, src => src.TotalArea) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.IsVisibleToOtherAgencies, src => src.IsVisibleToOtherAgencies) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Map(dest => dest.Parcels, src => src.Parcels) - .AfterMapping((src, dest) => - { - if (src.LeasedLandMetadata == null) - { - dest.LeasedLandMetadata = new List(); - return; - } - var metadata = JsonSerializer.Deserialize>(src.LeasedLandMetadata, _serializerOptions); - - dest.LeasedLandMetadata = metadata.Where(m => m != null).Select(l => new Model.LeasedLandMetadataModel { OwnershipNote = l.OwnershipNote, ParcelId = l.ParcelId, Type = (int)l.Type }); - }) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Parcels, src => src.Parcels) - .Map(dest => dest.ProjectNumbers, src => JsonSerializer.Serialize>(src.ProjectNumbers ?? Enumerable.Empty(), _serializerOptions)) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.EncumbranceReason, src => src.EncumbranceReason) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.Location, src => src) - .Map(dest => dest.AddressId, src => src.Address == null ? 0 : src.Address.Id) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.BuildingConstructionTypeId, src => src.BuildingConstructionTypeId) - .Map(dest => dest.BuildingOccupantTypeId, src => src.BuildingOccupantTypeId) - .Map(dest => dest.BuildingPredominateUseId, src => src.BuildingPredominateUseId) - .Map(dest => dest.BuildingTenancy, src => src.BuildingTenancy) - .Map(dest => dest.BuildingTenancyUpdatedOn, src => src.BuildingTenancyUpdatedOn) - .Map(dest => dest.BuildingFloorCount, src => src.BuildingFloorCount) - .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry) - .Map(dest => dest.OccupantName, src => src.OccupantName) - .Map(dest => dest.RentableArea, src => src.RentableArea) - .Map(dest => dest.TotalArea, src => src.TotalArea) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.IsVisibleToOtherAgencies, src => src.IsVisibleToOtherAgencies) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .AfterMapping((src, dest) => - { - var metadata = JsonSerializer.Serialize>(src.LeasedLandMetadata, _serializerOptions); - - dest.LeasedLandMetadata = metadata; - }) - .Inherits(); - - config.NewConfig() - .ConstructUsing(src => Dal.Helpers.GeometryHelper.CreatePoint(src.Longitude, src.Latitude)); - } - } -} diff --git a/backend/api/Areas/Property/Mapping/Parcel/AddressMap.cs b/backend/api/Areas/Property/Mapping/Parcel/AddressMap.cs deleted file mode 100644 index 85783753f5..0000000000 --- a/backend/api/Areas/Property/Mapping/Parcel/AddressMap.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Mapster; -using Pims.Core.Extensions; -using System; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Property.Models.Parcel; -using BModel = Pims.Api.Models; - -namespace Pims.Api.Areas.Property.Mapping.Parcel -{ - public class AddressMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Line1, src => src.Address1) - .Map(dest => dest.Line2, src => src.Address2) - .Map(dest => dest.AdministrativeArea, src => src.AdministrativeArea) - .Map(dest => dest.ProvinceId, src => src.ProvinceId) - .Map(dest => dest.Province, src => src.Province == null ? null : src.Province.Name) - .Map(dest => dest.Postal, src => src.Postal.FormatAsPostal()) - .Inherits(); - - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Address1, src => src.Line1) - .Map(dest => dest.Address2, src => src.Line2) - .Map(dest => dest.AdministrativeArea, src => src.AdministrativeArea) - .Map(dest => dest.ProvinceId, src => src.ProvinceId) - .Map(dest => dest.Province, src => String.IsNullOrWhiteSpace(src.Province) ? null : new Entity.Province(src.ProvinceId, src.Province)) - .Map(dest => dest.Postal, src => src.Postal.Replace(" ", "")) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Property/Mapping/Parcel/BuildingEvaluationMap.cs b/backend/api/Areas/Property/Mapping/Parcel/BuildingEvaluationMap.cs deleted file mode 100644 index 6d4a5ae840..0000000000 --- a/backend/api/Areas/Property/Mapping/Parcel/BuildingEvaluationMap.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Property.Models.Parcel; -using BModel = Pims.Api.Models; - -namespace Pims.Api.Areas.Property.Mapping.Parcel -{ - public class BuildingEvaluationMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.Date, src => src.Date) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - - - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.Date, src => src.Date) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Property/Mapping/Parcel/BuildingFiscalMap.cs b/backend/api/Areas/Property/Mapping/Parcel/BuildingFiscalMap.cs deleted file mode 100644 index 8a4aa89b57..0000000000 --- a/backend/api/Areas/Property/Mapping/Parcel/BuildingFiscalMap.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Property.Models.Parcel; -using BModel = Pims.Api.Models; - -namespace Pims.Api.Areas.Property.Mapping.Parcel -{ - public class BuildingFiscalMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.FiscalYear, src => src.FiscalYear) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - - - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.FiscalYear, src => src.FiscalYear) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Property/Mapping/Parcel/BuildingParcelMap.cs b/backend/api/Areas/Property/Mapping/Parcel/BuildingParcelMap.cs deleted file mode 100644 index c8168cc400..0000000000 --- a/backend/api/Areas/Property/Mapping/Parcel/BuildingParcelMap.cs +++ /dev/null @@ -1,98 +0,0 @@ -using Mapster; -using Microsoft.Extensions.Options; -using Pims.Api.Mapping.Converters; -using System.Text.Json; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Property.Models.Parcel; -using BModel = Pims.Api.Models; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Pims.Api.Areas.Property.Mapping.Parcel -{ - public class BuildingParcelMap : IRegister - { - #region Variables - private readonly JsonSerializerOptions _serializerOptions; - #endregion - - #region Constructors - /// - /// Creates a new instance of a BuildingParcelMap, initializes with specified arguments. - /// - /// - public BuildingParcelMap(IOptions serializerOptions) - { - _serializerOptions = serializerOptions.Value; - } - #endregion - - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.Id, src => src.Parcel.Id) - .Map(dest => dest.PID, src => src.Parcel.ParcelIdentity) - .Map(dest => dest.PIN, src => src.Parcel.PIN) - .Map(dest => dest.ProjectNumbers, src => JsonSerializer.Deserialize>(src.Parcel.ProjectNumbers ?? "[]", _serializerOptions)) - .Map(dest => dest.Name, src => src.Parcel.Name) - .Map(dest => dest.Description, src => src.Parcel.Description) - .Map(dest => dest.ClassificationId, src => src.Parcel.ClassificationId) - .Map(dest => dest.Classification, src => src.Parcel.Classification.Name) - .Map(dest => dest.AgencyId, src => src.Parcel.AgencyId) - .Map(dest => dest.Agency, src => AgencyConverter.ConvertAgency(src.Parcel.Agency)) - .Map(dest => dest.SubAgency, src => AgencyConverter.ConvertSubAgency(src.Parcel.Agency)) - .Map(dest => dest.Latitude, src => src.Parcel.Location.Y) - .Map(dest => dest.Longitude, src => src.Parcel.Location.X) - .Map(dest => dest.Address, src => src.Parcel.Address) - .Map(dest => dest.LandArea, src => src.Parcel.LandArea) - .Map(dest => dest.LandLegalDescription, src => src.Parcel.LandLegalDescription) - .Map(dest => dest.Zoning, src => src.Parcel.Zoning) - .Map(dest => dest.ZoningPotential, src => src.Parcel.ZoningPotential) - .Map(dest => dest.IsSensitive, src => src.Parcel.IsSensitive) - .Map(dest => dest.IsVisibleToOtherAgencies, src => src.Parcel.IsVisibleToOtherAgencies) - .Map(dest => dest.Buildings, src => src.Parcel.Buildings) - .Map(dest => dest.Evaluations, src => src.Parcel.Evaluations) - .Map(dest => dest.Fiscals, src => src.Parcel.Fiscals) - .Map(dest => dest.RowVersion, src => src.Parcel.RowVersion == null ? null : Convert.ToBase64String(src.Parcel.RowVersion)) - .Inherits(); - - - - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.PID, src => ParcelConverter.ConvertPID(src.PID)) - .Map(dest => dest.PIN, src => src.PIN) - .Map(dest => dest.ProjectNumbers, src => JsonSerializer.Serialize>(src.ProjectNumbers ?? Enumerable.Empty(), _serializerOptions)) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Location, src => src) - .Map(dest => dest.AddressId, src => src.Address == null ? 0 : src.Address.Id) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.LandArea, src => src.LandArea) - .Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription) - .Map(dest => dest.Zoning, src => src.Zoning) - .Map(dest => dest.ZoningPotential, src => src.ZoningPotential) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.IsVisibleToOtherAgencies, src => src.IsVisibleToOtherAgencies) - .Map(dest => dest.Buildings, src => src.Buildings) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Inherits(); - - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.ParcelId, src => src.Id) - .Map(dest => dest.Parcel, src => src) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Inherits(); - - config.NewConfig() - .ConstructUsing(src => Dal.Helpers.GeometryHelper.CreatePoint(src.Longitude, src.Latitude)); - } - } -} diff --git a/backend/api/Areas/Property/Mapping/Parcel/ParcelBuildingMap.cs b/backend/api/Areas/Property/Mapping/Parcel/ParcelBuildingMap.cs deleted file mode 100644 index 980829f46d..0000000000 --- a/backend/api/Areas/Property/Mapping/Parcel/ParcelBuildingMap.cs +++ /dev/null @@ -1,151 +0,0 @@ -using Mapster; -using Pims.Api.Mapping.Converters; -using System.Collections.Generic; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Property.Models.Parcel; -using BModel = Pims.Api.Models; -using Pims.Dal.Helpers.Extensions; -using System.Text.Json; -using Microsoft.Extensions.Options; - -namespace Pims.Api.Areas.Property.Mapping.Parcel -{ - public class ParcelBuildingMap : IRegister - { - #region Variables - private readonly JsonSerializerOptions _serializerOptions; - #endregion - - #region Constructors - /// - /// Creates a new instance of a BuildingParcelMap, initializes with specified arguments. - /// - /// - public ParcelBuildingMap(IOptions serializerOptions) - { - _serializerOptions = serializerOptions.Value; - } - #endregion - - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.ParcelId, src => src.GetParcelId()) - .Map(dest => dest.ProjectNumbers, src => JsonSerializer.Deserialize>(src.ProjectNumbers ?? "[]", _serializerOptions)) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Agency, src => AgencyConverter.ConvertAgency(src.Agency)) - .Map(dest => dest.SubAgency, src => AgencyConverter.ConvertSubAgency(src.Agency)) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Classification, src => src.Classification.Name) - .Map(dest => dest.BuildingConstructionTypeId, src => src.BuildingConstructionTypeId) - .Map(dest => dest.BuildingConstructionType, src => src.GetConstructionType()) - .Map(dest => dest.BuildingOccupantTypeId, src => src.BuildingOccupantTypeId) - .Map(dest => dest.BuildingOccupantType, src => src.GetOccupantType()) - .Map(dest => dest.BuildingPredominateUseId, src => src.BuildingPredominateUseId) - .Map(dest => dest.BuildingPredominateUse, src => src.GetPredominateUse()) - .Map(dest => dest.BuildingTenancy, src => src.BuildingTenancy) - .Map(dest => dest.BuildingFloorCount, src => src.BuildingFloorCount) - .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry) - .Map(dest => dest.OccupantName, src => src.OccupantName) - .Map(dest => dest.RentableArea, src => src.RentableArea) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.IsVisibleToOtherAgencies, src => src.IsVisibleToOtherAgencies) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Inherits(); - - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Parcels, src => new List() { new Entity.ParcelBuilding() { ParcelId = src.ParcelId, BuildingId = src.Id } }) // TODO: Extend Mapster to handle this better. - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Location, src => src) - .Map(dest => dest.AddressId, src => src.Address == null ? 0 : src.Address.Id) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.BuildingConstructionTypeId, src => src.BuildingConstructionTypeId) - .Map(dest => dest.BuildingOccupantTypeId, src => src.BuildingOccupantTypeId) - .Map(dest => dest.BuildingPredominateUseId, src => src.BuildingPredominateUseId) - .Map(dest => dest.BuildingTenancy, src => src.BuildingTenancy) - .Map(dest => dest.BuildingFloorCount, src => src.BuildingFloorCount) - .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry) - .Map(dest => dest.OccupantName, src => src.OccupantName) - .Map(dest => dest.RentableArea, src => src.RentableArea) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.IsVisibleToOtherAgencies, src => src.IsVisibleToOtherAgencies) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Inherits(); - - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.Id, src => src.BuildingId) - .Map(dest => dest.ParcelId, src => src.ParcelId) - .Map(dest => dest.ProjectNumbers, src => JsonSerializer.Deserialize>(src.Building.ProjectNumbers ?? "[]", _serializerOptions)) - .Map(dest => dest.Name, src => src.Building.Name) - .Map(dest => dest.Description, src => src.Building.Description) - .Map(dest => dest.AgencyId, src => src.Building.AgencyId) - .Map(dest => dest.Agency, src => AgencyConverter.ConvertAgency(src.Building.Agency)) - .Map(dest => dest.SubAgency, src => AgencyConverter.ConvertSubAgency(src.Building.Agency)) - .Map(dest => dest.Latitude, src => src.Building.Location.Y) - .Map(dest => dest.Longitude, src => src.Building.Location.X) - .Map(dest => dest.Address, src => src.Building.Address) - .Map(dest => dest.ClassificationId, src => src.Building.ClassificationId) - .Map(dest => dest.Classification, src => src.Building.Classification.Name) - .Map(dest => dest.BuildingConstructionTypeId, src => src.Building.BuildingConstructionTypeId) - .Map(dest => dest.BuildingConstructionType, src => src.Building.BuildingConstructionType == null ? null : src.Building.BuildingConstructionType.Name) - .Map(dest => dest.BuildingOccupantTypeId, src => src.Building.BuildingOccupantTypeId) - .Map(dest => dest.BuildingOccupantType, src => src.Building.BuildingOccupantType == null ? null : src.Building.BuildingOccupantType.Name) - .Map(dest => dest.BuildingPredominateUseId, src => src.Building.BuildingPredominateUseId) - .Map(dest => dest.BuildingPredominateUse, src => src.Building.BuildingPredominateUse == null ? null : src.Building.BuildingPredominateUse.Name) - .Map(dest => dest.BuildingTenancy, src => src.Building.BuildingTenancy) - .Map(dest => dest.BuildingFloorCount, src => src.Building.BuildingFloorCount) - .Map(dest => dest.LeaseExpiry, src => src.Building.LeaseExpiry) - .Map(dest => dest.OccupantName, src => src.Building.OccupantName) - .Map(dest => dest.RentableArea, src => src.Building.RentableArea) - .Map(dest => dest.IsSensitive, src => src.Building.IsSensitive) - .Map(dest => dest.IsVisibleToOtherAgencies, src => src.Building.IsVisibleToOtherAgencies) - .Map(dest => dest.Evaluations, src => src.Building.Evaluations) - .Map(dest => dest.Fiscals, src => src.Building.Fiscals) - .Inherits(); - - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.BuildingId, src => src.Id) - .Map(dest => dest.ParcelId, src => src.ParcelId) - .Map(dest => dest.Building.Id, src => src.Id) - .Map(dest => dest.Building.Name, src => src.Name) - .Map(dest => dest.Building.Description, src => src.Description) - .Map(dest => dest.Building.AgencyId, src => src.AgencyId) - .Map(dest => dest.Building.Location, src => src) - .Map(dest => dest.Building.AddressId, src => src.Address == null ? 0 : src.Address.Id) - .Map(dest => dest.Building.Address, src => src.Address) - .Map(dest => dest.Building.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Building.BuildingConstructionTypeId, src => src.BuildingConstructionTypeId) - .Map(dest => dest.Building.BuildingOccupantTypeId, src => src.BuildingOccupantTypeId) - .Map(dest => dest.Building.BuildingPredominateUseId, src => src.BuildingPredominateUseId) - .Map(dest => dest.Building.BuildingTenancy, src => src.BuildingTenancy) - .Map(dest => dest.Building.BuildingFloorCount, src => src.BuildingFloorCount) - .Map(dest => dest.Building.LeaseExpiry, src => src.LeaseExpiry) - .Map(dest => dest.Building.OccupantName, src => src.OccupantName) - .Map(dest => dest.Building.RentableArea, src => src.RentableArea) - .Map(dest => dest.Building.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.Building.IsVisibleToOtherAgencies, src => src.IsVisibleToOtherAgencies) - .Map(dest => dest.Building.Evaluations, src => src.Evaluations) - .Map(dest => dest.Building.Fiscals, src => src.Fiscals) - .Inherits(); - - config.NewConfig() - .ConstructUsing(src => Dal.Helpers.GeometryHelper.CreatePoint(src.Longitude, src.Latitude)); - } - } -} diff --git a/backend/api/Areas/Property/Mapping/Parcel/ParcelEvaluationMap.cs b/backend/api/Areas/Property/Mapping/Parcel/ParcelEvaluationMap.cs deleted file mode 100644 index 27a6102985..0000000000 --- a/backend/api/Areas/Property/Mapping/Parcel/ParcelEvaluationMap.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Property.Models.Parcel; -using BModel = Pims.Api.Models; - -namespace Pims.Api.Areas.Property.Mapping.Parcel -{ - public class ParcelEvaluationMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.ParcelId, src => src.ParcelId) - .Map(dest => dest.Date, src => src.Date) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Map(dest => dest.Firm, src => src.Firm) - .Inherits(); - - - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.ParcelId, src => src.ParcelId) - .Map(dest => dest.Date, src => src.Date) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Map(dest => dest.Firm, src => src.Firm) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Property/Mapping/Parcel/ParcelFiscalMap.cs b/backend/api/Areas/Property/Mapping/Parcel/ParcelFiscalMap.cs deleted file mode 100644 index 28f3160186..0000000000 --- a/backend/api/Areas/Property/Mapping/Parcel/ParcelFiscalMap.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Property.Models.Parcel; -using BModel = Pims.Api.Models; - -namespace Pims.Api.Areas.Property.Mapping.Parcel -{ - public class ParcelFiscalMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.ParcelId, src => src.ParcelId) - .Map(dest => dest.FiscalYear, src => src.FiscalYear) - .Map(dest => dest.EffectiveDate, src => src.EffectiveDate) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.ParcelId, src => src.ParcelId) - .Map(dest => dest.FiscalYear, src => src.FiscalYear) - .Map(dest => dest.EffectiveDate, src => src.EffectiveDate) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Property/Mapping/Parcel/ParcelMap.cs b/backend/api/Areas/Property/Mapping/Parcel/ParcelMap.cs deleted file mode 100644 index 61a02d479c..0000000000 --- a/backend/api/Areas/Property/Mapping/Parcel/ParcelMap.cs +++ /dev/null @@ -1,99 +0,0 @@ -using Mapster; -using Pims.Api.Mapping.Converters; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Property.Models.Parcel; -using BModel = Pims.Api.Models; -using System.Text.Json; -using System.Collections.Generic; -using Microsoft.Extensions.Options; -using Pims.Dal.Helpers.Extensions; -using System.Linq; - -namespace Pims.Api.Areas.Property.Mapping.Parcel -{ - public class ParcelMap : IRegister - { - #region Variables - private readonly JsonSerializerOptions _serializerOptions; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ProjectMap, initializes with specified arguments. - /// - /// - public ParcelMap(IOptions serializerOptions) - { - _serializerOptions = serializerOptions.Value; - } - #endregion - - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.PropertyTypeId, src => src.PropertyTypeId) - .Map(dest => dest.ProjectWorkflow, src => src.GetLatestWorkflowCode()) - .Map(dest => dest.ProjectStatus, src => src.GetLatestProjectStatus()) - .Map(dest => dest.PID, src => src.ParcelIdentity) - .Map(dest => dest.PIN, src => src.PIN) - .Map(dest => dest.ProjectNumbers, src => JsonSerializer.Deserialize>(src.ProjectNumbers ?? "[]", _serializerOptions)) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Classification, src => src.Classification.Name) - .Map(dest => dest.EncumbranceReason, src => src.EncumbranceReason) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Agency, src => AgencyConverter.ConvertAgency(src.Agency)) - .Map(dest => dest.SubAgency, src => AgencyConverter.ConvertSubAgency(src.Agency)) - .Map(dest => dest.AgencyFullName, src => AgencyConverter.ConvertAgencyFullName(src.Agency)) - .Map(dest => dest.SubAgencyFullName, src => AgencyConverter.ConvertSubAgencyFullName(src.Agency)) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.LandArea, src => src.LandArea) - .Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription) - .Map(dest => dest.Zoning, src => src.Zoning) - .Map(dest => dest.ZoningPotential, src => src.ZoningPotential) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.IsVisibleToOtherAgencies, src => src.IsVisibleToOtherAgencies) - .Map(dest => dest.Buildings, src => src.Buildings) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Map(dest => dest.Parcels, src => src.Parcels) - .Map(dest => dest.Subdivisions, src => src.Subdivisions) - .Inherits(); - - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.PID, src => ParcelConverter.ConvertPID(src.PID)) - .Map(dest => dest.PIN, src => src.PIN) - .Map(dest => dest.ProjectNumbers, src => JsonSerializer.Serialize>(src.ProjectNumbers ?? Enumerable.Empty(), _serializerOptions)) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.EncumbranceReason, src => src.EncumbranceReason) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Location, src => src) - .Map(dest => dest.AddressId, src => src.Address == null ? 0 : src.Address.Id) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.LandArea, src => src.LandArea) - .Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription) - .Map(dest => dest.Zoning, src => src.Zoning) - .Map(dest => dest.ZoningPotential, src => src.ZoningPotential) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.IsVisibleToOtherAgencies, src => src.IsVisibleToOtherAgencies) - .Map(dest => dest.Buildings, src => src.Buildings) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Map(dest => dest.Parcels, src => src.Parcels) - .Map(dest => dest.Subdivisions, src => src.Subdivisions) - .Inherits(); - - config.NewConfig() - .ConstructUsing(src => Dal.Helpers.GeometryHelper.CreatePoint(src.Longitude, src.Latitude)); - } - } -} diff --git a/backend/api/Areas/Property/Mapping/Parcel/ParcelParcelMap.cs b/backend/api/Areas/Property/Mapping/Parcel/ParcelParcelMap.cs deleted file mode 100644 index d950f5e0cf..0000000000 --- a/backend/api/Areas/Property/Mapping/Parcel/ParcelParcelMap.cs +++ /dev/null @@ -1,79 +0,0 @@ -using Mapster; -using Pims.Api.Mapping.Converters; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Property.Models.Parcel; -using BModel = Pims.Api.Models; -using System.Text.Json; -using Microsoft.Extensions.Options; - -namespace Pims.Api.Areas.Property.Mapping.Parcel -{ - public class ParcelParcelMap : IRegister - { - #region Variables - private readonly JsonSerializerOptions _serializerOptions; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ParcelParcelMap, initializes with specified arguments. - /// - /// - public ParcelParcelMap(IOptions serializerOptions) - { - _serializerOptions = serializerOptions.Value; - } - #endregion - - public void Register(TypeAdapterConfig config) - { - //all mappings for mapping between a subdivision parcel that has divided parcels. Users cannot edit parcels/subdivisions through entity relationships so just pass ids. - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.PID, src => src.PID) - .Map(dest => dest.PIN, src => src.PIN) - .Inherits(); - - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.Id, src => src.Parcel.Id) - .Map(dest => dest.PID, src => src.Parcel.PID) - .Map(dest => dest.PIN, src => src.Parcel.PIN) - .Inherits(); - - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.ParcelId, src => src.Id) - .Map(dest => dest.Parcel.PID, src => ParcelConverter.ConvertPID(src.PID)) - .Inherits(); - - - - //all mappings for mapping between a divided parcel that has subdivisions. Users cannot edit parcels/subdivisions through entity relationships so just pass ids. - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.PID, src => src.PID) - .Map(dest => dest.PIN, src => src.PIN) - .Inherits(); - - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.Id, src => src.Id) - .Inherits(); - - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.Id, src => src.Subdivision.Id) - .Map(dest => dest.PID, src => src.Subdivision.PID) - .Map(dest => dest.PIN, src => src.Subdivision.PIN) - .Inherits(); - - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.SubdivisionId, src => src.Id) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Property/Mapping/Search/GeoJsonMap.cs b/backend/api/Areas/Property/Mapping/Search/GeoJsonMap.cs deleted file mode 100644 index bc0342d4bc..0000000000 --- a/backend/api/Areas/Property/Mapping/Search/GeoJsonMap.cs +++ /dev/null @@ -1,109 +0,0 @@ -using Mapster; -using Microsoft.Extensions.Options; -using NetTopologySuite.Geometries; -using System.Collections.Generic; -using System.Text.Json; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Property.Models.Search; - -namespace Pims.Api.Areas.Property.Mapping.Search -{ - public class GeoJsonMap : IRegister - { - #region Variables - private readonly JsonSerializerOptions _serializerOptions; - #endregion - - #region Constructors - /// - /// Creates a new instance of a BuildingMap, initializes with specified arguments. - /// - /// - public GeoJsonMap(IOptions serializerOptions) - { - _serializerOptions = serializerOptions.Value; - } - #endregion - public void Register(TypeAdapterConfig config) - { - config.NewConfig>() - .Map(dest => dest.Type, src => "Feature") - .Map(dest => dest.Geometry.Type, src => src.Location != null ? src.Location.GeometryType : "Point") - .Map(dest => dest.Geometry.Coordinates, src => src.Location) - .Map(dest => dest.Properties, src => src); - - config.NewConfig() - .Include() - .Include() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.PropertyTypeId, src => src.PropertyTypeId) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.ProjectNumbers, src => JsonSerializer.Deserialize>(src.ProjectNumbers ?? "[]", _serializerOptions)) - .Map(dest => dest.AddressId, src => src.AddressId) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.ProjectWorkflow, src => src.ProjectWorkflow) - .Map(dest => dest.AdministrativeArea, src => src.AdministrativeArea) - .Map(dest => dest.Classification, src => src.Classification) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Province, src => src.Province) - .Map(dest => dest.Postal, src => src.Postal) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Agency, src => src.Agency) - .Map(dest => dest.AgencyCode, src => src.AgencyCode) - .Map(dest => dest.SubAgency, src => src.SubAgency) - .Map(dest => dest.SubAgencyCode, src => src.SubAgencyCode) - - .Map(dest => dest.Market, src => src.Market) - .Map(dest => dest.MarketFiscalYear, src => src.MarketFiscalYear) - .Map(dest => dest.NetBook, src => src.NetBook) - .Map(dest => dest.NetBookFiscalYear, src => src.NetBookFiscalYear); - - config.NewConfig() - .Inherits() - .Map(dest => dest.PID, src => src.PID) - .Map(dest => dest.PIN, src => src.PIN) - .Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription) - .Map(dest => dest.LandArea, src => src.LandArea) - .Map(dest => dest.Zoning, src => src.Zoning) - .Map(dest => dest.ZoningPotential, src => src.ZoningPotential) - - .Map(dest => dest.AssessedLand, src => src.AssessedLand) - .Map(dest => dest.AssessedLandDate, src => src.AssessedLandDate) - .Map(dest => dest.AssessedBuilding, src => src.AssessedBuilding) - .Map(dest => dest.AssessedBuildingDate, src => src.AssessedBuildingDate); - - config.NewConfig() - .Inherits() - .Map(dest => dest.ConstructionTypeId, src => src.BuildingConstructionTypeId) - .Map(dest => dest.ConstructionType, src => src.BuildingConstructionType) - .Map(dest => dest.FloorCount, src => src.BuildingFloorCount) - .Map(dest => dest.PredominateUseId, src => src.BuildingPredominateUseId) - .Map(dest => dest.PredominateUse, src => src.BuildingPredominateUse) - .Map(dest => dest.Tenancy, src => src.BuildingTenancy) - .Map(dest => dest.RentableArea, src => src.RentableArea) - .Map(dest => dest.OccupantTypeId, src => src.BuildingOccupantTypeId) - .Map(dest => dest.OccupantType, src => src.BuildingOccupantType) - .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry) - .Map(dest => dest.OccupantName, src => src.OccupantName) - .Map(dest => dest.TransferLeaseOnSale, src => src.TransferLeaseOnSale) - - .Map(dest => dest.AssessedBuilding, src => src.Assessed) - .Map(dest => dest.AssessedBuildingDate, src => src.AssessedDate); - - config.NewConfig>() - .Map(dest => dest.Type, src => "Feature") - .Map(dest => dest.Geometry.Type, src => src.Location.GeometryType) - .Map(dest => dest.Geometry.Coordinates, src => src.Location) - .Map(dest => dest.Properties, src => src); - - config.NewConfig() - .ConstructUsing(src => new Point(src.Coordinate)); - - config.NewConfig() - .ConstructUsing(src => new Polygon(new LinearRing(src.Coordinates))); - } - } -} diff --git a/backend/api/Areas/Property/Mapping/Search/PropertyMap.cs b/backend/api/Areas/Property/Mapping/Search/PropertyMap.cs deleted file mode 100644 index b188670613..0000000000 --- a/backend/api/Areas/Property/Mapping/Search/PropertyMap.cs +++ /dev/null @@ -1,216 +0,0 @@ -using Mapster; -using Microsoft.Extensions.Options; -using Pims.Dal.Entities; -using Pims.Dal.Entities.Helpers.Extensions; -using Pims.Dal.Helpers.Extensions; -using Pims.Core.Extensions; -using System; -using System.Collections.Generic; -using System.Text.Json; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Property.Models.Search; - -namespace Pims.Api.Areas.Property.Mapping.Search -{ - public class PropertyMap : IRegister - { - #region Variables - private readonly JsonSerializerOptions _serializerOptions; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ProjectMap, initializes with specified arguments. - /// - /// - public PropertyMap(IOptions serializerOptions) - { - _serializerOptions = serializerOptions.Value; - } - #endregion - - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.PropertyTypeId, src => src.PropertyTypeId) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Classification, src => src.Classification == null ? null : src.Classification.Name) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.ProjectNumbers, src => JsonSerializer.Deserialize>(src.ProjectNumbers ?? "[]", _serializerOptions)) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Agency, src => src.Agency == null ? null : src.Agency.ParentId.HasValue ? src.Agency.Parent.Name : src.Agency.Name) - .Map(dest => dest.AgencyCode, src => src.Agency == null ? null : src.Agency.ParentId.HasValue ? src.Agency.Parent.Code : src.Agency.Code) - .Map(dest => dest.SubAgency, src => src.Agency == null ? null : src.Agency.ParentId.HasValue ? null : src.Agency.Name) - .Map(dest => dest.SubAgencyCode, src => src.Agency == null ? null : src.Agency.ParentId.HasValue ? null : src.Agency.Code) - - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Map(dest => dest.AddressId, src => src.AddressId) - .Map(dest => dest.Address, src => src.Address == null ? null : $"{src.Address.Address1} {src.Address.Address2}".Trim()) - .Map(dest => dest.Province, src => src.Address == null || src.Address.Province == null ? null : src.Address.Province.Name) - .Map(dest => dest.AdministrativeArea, src => src.Address == null ? null : src.Address.AdministrativeArea) - .Map(dest => dest.Postal, src => src.Address == null ? null : src.Address.Postal); - - config.NewConfig() - .Inherits() - .Map(dest => dest.PropertyTypeId, src => src.PropertyTypeId) - .Map(dest => dest.PID, src => src.ParcelIdentity) - .Map(dest => dest.PIN, src => src.PIN) - - .Map(dest => dest.LandArea, src => src.LandArea) - .Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription) - .Map(dest => dest.Zoning, src => src.Zoning) - .Map(dest => dest.ZoningPotential, src => src.ZoningPotential) - - .Map(dest => dest.Market, src => src.GetCurrentFiscal(FiscalKeys.Market)) - .Map(dest => dest.MarketFiscalYear, src => src.GetCurrentFiscalYear(FiscalKeys.Market)) - .Map(dest => dest.NetBook, src => src.GetCurrentFiscal(FiscalKeys.NetBook)) - .Map(dest => dest.NetBookFiscalYear, src => src.GetCurrentFiscalYear(FiscalKeys.NetBook)) - // TODO: Fix assessment values. - .Map(dest => dest.AssessedLand, src => src.GetCurrentEvaluation(EvaluationKeys.Assessed)) - .Map(dest => dest.AssessedLandDate, src => src.GetCurrentEvaluationDate(EvaluationKeys.Assessed)) - .Map(dest => dest.AssessedBuilding, src => src.GetCurrentEvaluation(EvaluationKeys.Improvements)) - .Map(dest => dest.AssessedBuildingDate, src => src.GetCurrentEvaluationDate(EvaluationKeys.Improvements)); - - config.NewConfig() - .Inherits() - .Map(dest => dest.PropertyTypeId, src => src.PropertyTypeId) - .Map(dest => dest.ConstructionTypeId, src => src.BuildingConstructionTypeId) - .Map(dest => dest.ConstructionType, src => src.GetConstructionType()) - .Map(dest => dest.PredominateUseId, src => src.BuildingPredominateUseId) - .Map(dest => dest.PredominateUse, src => src.GetPredominateUse()) - .Map(dest => dest.OccupantTypeId, src => src.BuildingOccupantTypeId) - .Map(dest => dest.OccupantType, src => src.GetOccupantType()) - .Map(dest => dest.OccupantName, src => src.OccupantName) - .Map(dest => dest.FloorCount, src => src.BuildingFloorCount) - .Map(dest => dest.Tenancy, src => src.BuildingTenancy) - .Map(dest => dest.TransferLeaseOnSale, src => src.TransferLeaseOnSale) - .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry) - .Map(dest => dest.RentableArea, src => src.RentableArea) - - .Map(dest => dest.PID, src => src.GetParcelIdentity()) - .Map(dest => dest.PIN, src => src.GetPIN()) - - .Map(dest => dest.Market, src => src.GetCurrentFiscal(FiscalKeys.Market)) - .Map(dest => dest.MarketFiscalYear, src => src.GetCurrentFiscalYear(FiscalKeys.Market)) - .Map(dest => dest.NetBook, src => src.GetCurrentFiscal(FiscalKeys.NetBook)) - .Map(dest => dest.NetBookFiscalYear, src => src.GetCurrentFiscalYear(FiscalKeys.NetBook)) - .Map(dest => dest.AssessedBuilding, src => src.GetCurrentEvaluation(EvaluationKeys.Assessed)) - .Map(dest => dest.AssessedBuildingDate, src => src.GetCurrentEvaluationDate(EvaluationKeys.Assessed)); - - config.NewConfig() - .Map(dest => dest.PropertyTypeId, src => src.PropertyTypeId) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.RowVersion, src => src.RowVersion == null ? null : Convert.ToBase64String(src.RowVersion)) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Classification, src => src.Classification) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Map(dest => dest.ProjectNumbers, src => JsonSerializer.Deserialize>(src.ProjectNumbers ?? "[]", _serializerOptions)) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Agency, src => src.Agency) - .Map(dest => dest.AgencyCode, src => src.AgencyCode) - .Map(dest => dest.SubAgency, src => src.SubAgency) - .Map(dest => dest.SubAgencyCode, src => src.SubAgencyCode) - - .Map(dest => dest.AddressId, src => src.AddressId) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.AdministrativeArea, src => src.AdministrativeArea) - .Map(dest => dest.Province, src => src.Province) - .Map(dest => dest.Postal, src => src.Postal) - - .Map(dest => dest.PID, src => src.ParcelIdentity) - .Map(dest => dest.PIN, src => src.PIN) - .Map(dest => dest.LandArea, src => src.LandArea) - .Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription) - .Map(dest => dest.Zoning, src => src.Zoning) - .Map(dest => dest.ZoningPotential, src => src.ZoningPotential) - - .Map(dest => dest.ConstructionTypeId, src => src.BuildingConstructionTypeId) - .Map(dest => dest.ConstructionType, src => src.BuildingConstructionType) - .Map(dest => dest.PredominateUseId, src => src.BuildingPredominateUseId) - .Map(dest => dest.PredominateUse, src => src.BuildingPredominateUse) - .Map(dest => dest.OccupantTypeId, src => src.BuildingOccupantTypeId) - .Map(dest => dest.OccupantType, src => src.BuildingOccupantType) - .Map(dest => dest.OccupantName, src => src.OccupantName) - .Map(dest => dest.FloorCount, src => src.BuildingFloorCount) - .Map(dest => dest.Tenancy, src => src.BuildingTenancy) - .Map(dest => dest.TransferLeaseOnSale, src => src.TransferLeaseOnSale) - .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry) - .Map(dest => dest.RentableArea, src => src.RentableArea) - - .Map(dest => dest.Market, src => src.MarketFiscalYear == DateTime.Now.GetFiscalYear() ? src.Market : null) - .Map(dest => dest.MarketFiscalYear, src => src.MarketFiscalYear == DateTime.Now.GetFiscalYear() ? src.MarketFiscalYear : null) - .Map(dest => dest.NetBook, src => src.NetBookFiscalYear == DateTime.Now.GetFiscalYear() ? src.NetBook : null) - .Map(dest => dest.NetBookFiscalYear, src => src.NetBookFiscalYear == DateTime.Now.GetFiscalYear() ? src.NetBookFiscalYear : null) - - .Map(dest => dest.AssessedLand, src => src.AssessedLandDate.HasValue ? src.AssessedLand : null) - .Map(dest => dest.AssessedLandDate, src => src.AssessedLandDate.HasValue ? src.AssessedLandDate : null) - .Map(dest => dest.AssessedBuilding, src => src.AssessedBuildingDate.HasValue ? src.AssessedBuilding : null) - .Map(dest => dest.AssessedBuildingDate, src => src.AssessedBuildingDate.HasValue ? src.AssessedBuildingDate : null); - - config.NewConfig() - .Map(dest => dest.PropertyTypeId, src => src.PropertyTypeId) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Classification, src => src.Classification) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Map(dest => dest.ProjectNumbers, src => JsonSerializer.Deserialize>(src.ProjectNumbers ?? "[]", _serializerOptions)) - .Map(dest => dest.ProjectStatus, src => src.ProjectStatus) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Agency, src => src.Agency) - .Map(dest => dest.AgencyCode, src => src.AgencyCode) - .Map(dest => dest.SubAgency, src => src.SubAgency) - .Map(dest => dest.SubAgencyCode, src => src.SubAgencyCode) - - .Map(dest => dest.AddressId, src => src.AddressId) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.AdministrativeArea, src => src.AdministrativeArea) - .Map(dest => dest.Province, src => src.Province) - .Map(dest => dest.Postal, src => src.Postal) - - .Map(dest => dest.PID, src => src.ParcelIdentity) - .Map(dest => dest.PIN, src => src.PIN) - .Map(dest => dest.LandArea, src => src.LandArea) - .Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription) - .Map(dest => dest.Zoning, src => src.Zoning) - .Map(dest => dest.ZoningPotential, src => src.ZoningPotential) - - .Map(dest => dest.ConstructionTypeId, src => src.BuildingConstructionTypeId) - .Map(dest => dest.ConstructionType, src => src.BuildingConstructionType) - .Map(dest => dest.PredominateUseId, src => src.BuildingPredominateUseId) - .Map(dest => dest.PredominateUse, src => src.BuildingPredominateUse) - .Map(dest => dest.OccupantTypeId, src => src.BuildingOccupantTypeId) - .Map(dest => dest.OccupantType, src => src.BuildingOccupantType) - .Map(dest => dest.OccupantName, src => src.OccupantName) - .Map(dest => dest.FloorCount, src => src.BuildingFloorCount) - .Map(dest => dest.Tenancy, src => src.BuildingTenancy) - .Map(dest => dest.TransferLeaseOnSale, src => src.TransferLeaseOnSale) - .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry) - .Map(dest => dest.RentableArea, src => src.RentableArea) - - .Map(dest => dest.Market, src => src.Market) - .Map(dest => dest.MarketFiscalYear, src => src.MarketFiscalYear) - .Map(dest => dest.NetBook, src => src.NetBook) - .Map(dest => dest.NetBookFiscalYear, src => src.NetBookFiscalYear) - - .Map(dest => dest.AssessedLand, src => src.AssessedLand) - .Map(dest => dest.AssessedLandDate, src => src.AssessedLandDate) - .Map(dest => dest.AssessedBuilding, src => src.AssessedBuilding) - .Map(dest => dest.AssessedBuildingDate, src => src.AssessedBuildingDate); - } - } -} diff --git a/backend/api/Areas/Property/Models/Building/BuildingEvaluationModel.cs b/backend/api/Areas/Property/Models/Building/BuildingEvaluationModel.cs deleted file mode 100644 index 2abd22ce7c..0000000000 --- a/backend/api/Areas/Property/Models/Building/BuildingEvaluationModel.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Model = Pims.Api.Models; -using System; - -namespace Pims.Api.Areas.Property.Models.Building -{ - public class BuildingEvaluationModel : Model.BaseModel - { - #region Properties - public int BuildingId { get; set; } - - public DateTime Date { get; set; } - - public string Key { get; set; } - - public decimal Value { get; set; } - - public string Note { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Property/Models/Building/BuildingFiscalModel.cs b/backend/api/Areas/Property/Models/Building/BuildingFiscalModel.cs deleted file mode 100644 index 4a29ae84b8..0000000000 --- a/backend/api/Areas/Property/Models/Building/BuildingFiscalModel.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using Model = Pims.Api.Models; - -namespace Pims.Api.Areas.Property.Models.Building -{ - public class BuildingFiscalModel : Model.BaseModel - { - #region Properties - public int BuildingId { get; set; } - - public int FiscalYear { get; set; } - - public DateTime? EffectiveDate { get; set; } - - public string Key { get; set; } - - public decimal Value { get; set; } - - public string Note { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Property/Models/Building/BuildingModel.cs b/backend/api/Areas/Property/Models/Building/BuildingModel.cs deleted file mode 100644 index 7be05a3754..0000000000 --- a/backend/api/Areas/Property/Models/Building/BuildingModel.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Pims.Api.Areas.Property.Models.Parcel; -using System; -using System.Collections.Generic; - -namespace Pims.Api.Areas.Property.Models.Building -{ - public class BuildingModel : PropertyModel - { - #region Properties - public int ParcelId { get; set; } - - public int BuildingConstructionTypeId { get; set; } - - public string BuildingConstructionType { get; set; } - - public int BuildingFloorCount { get; set; } - - public int BuildingPredominateUseId { get; set; } - - public string BuildingPredominateUse { get; set; } - - public int BuildingOccupantTypeId { get; set; } - - public string BuildingOccupantType { get; set; } - - public DateTime? LeaseExpiry { get; set; } - - public string OccupantName { get; set; } - - public bool TransferLeaseOnSale { get; set; } - - public string BuildingTenancy { get; set; } - - public DateTime? BuildingTenancyUpdatedOn { get; set; } - - public float RentableArea { get; set; } - - public float TotalArea { get; set; } - - public IEnumerable LeasedLandMetadata { get; set; } = new List(); - - public IEnumerable Parcels { get; set; } = new List(); - - public IEnumerable Evaluations { get; set; } = new List(); - - public IEnumerable Fiscals { get; set; } = new List(); - #endregion - } -} diff --git a/backend/api/Areas/Property/Models/Building/LeasedLandMetadataModel.cs b/backend/api/Areas/Property/Models/Building/LeasedLandMetadataModel.cs deleted file mode 100644 index c0e4a4ad86..0000000000 --- a/backend/api/Areas/Property/Models/Building/LeasedLandMetadataModel.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace Pims.Api.Areas.Property.Models.Building -{ - /// - /// LeasedLandMetadataModel class, provides a model to represent leased land so that a building can include this information. - /// - public class LeasedLandMetadataModel - { - #region Properties - /// - /// get/set - Note related to the ownership of the land associated to this building. - /// - public string OwnershipNote { get; set; } - - /// - /// get/set - An id used to associate this metadata with a parcel. - /// - public int ParcelId { get; set; } - - /// - /// get/set - the lease type - /// - public int Type { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Property/Models/Parcel/AddressModel.cs b/backend/api/Areas/Property/Models/Parcel/AddressModel.cs deleted file mode 100644 index 6a57c083b4..0000000000 --- a/backend/api/Areas/Property/Models/Parcel/AddressModel.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Model = Pims.Api.Models; - -namespace Pims.Api.Areas.Property.Models.Parcel -{ - public class AddressModel : Model.BaseModel - { - #region Properties - public int Id { get; set; } - - public string Line1 { get; set; } - - public string Line2 { get; set; } - - public string AdministrativeArea { get; set; } - - public string ProvinceId { get; set; } - - public string Province { get; set; } - - public string Postal { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Property/Models/Parcel/BuildingEvaluationModel.cs b/backend/api/Areas/Property/Models/Parcel/BuildingEvaluationModel.cs deleted file mode 100644 index cde2b5bb58..0000000000 --- a/backend/api/Areas/Property/Models/Parcel/BuildingEvaluationModel.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Model = Pims.Api.Models; -using System; - -namespace Pims.Api.Areas.Property.Models.Parcel -{ - public class BuildingEvaluationModel : Model.BaseModel - { - #region Properties - public int BuildingId { get; set; } - - public DateTime Date { get; set; } - - public string Key { get; set; } - - public decimal Value { get; set; } - - public string Note { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Property/Models/Parcel/BuildingFiscalModel.cs b/backend/api/Areas/Property/Models/Parcel/BuildingFiscalModel.cs deleted file mode 100644 index 37b9a76ad2..0000000000 --- a/backend/api/Areas/Property/Models/Parcel/BuildingFiscalModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Model = Pims.Api.Models; - -namespace Pims.Api.Areas.Property.Models.Parcel -{ - public class BuildingFiscalModel : Model.BaseModel - { - #region Properties - public int BuildingId { get; set; } - - public int FiscalYear { get; set; } - - public string Key { get; set; } - - public decimal Value { get; set; } - - public string Note { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Property/Models/Parcel/BuildingParcelModel.cs b/backend/api/Areas/Property/Models/Parcel/BuildingParcelModel.cs deleted file mode 100644 index 28483979b4..0000000000 --- a/backend/api/Areas/Property/Models/Parcel/BuildingParcelModel.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Pims.Api.Areas.Property.Models.Parcel -{ - public class BuildingParcelModel : ParcelModel - { - public int BuildingId { get; set; } - } -} diff --git a/backend/api/Areas/Property/Models/Parcel/CheckPidAvailabilityResponseModel.cs b/backend/api/Areas/Property/Models/Parcel/CheckPidAvailabilityResponseModel.cs deleted file mode 100644 index e2847c8467..0000000000 --- a/backend/api/Areas/Property/Models/Parcel/CheckPidAvailabilityResponseModel.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Pims.Api.Areas.Property.Models.Parcel -{ - public class CheckPidAvailabilityResponseModel - { - public bool Available { get; set; } - } -} diff --git a/backend/api/Areas/Property/Models/Parcel/ParcelBuildingModel.cs b/backend/api/Areas/Property/Models/Parcel/ParcelBuildingModel.cs deleted file mode 100644 index 3f4c30f3a1..0000000000 --- a/backend/api/Areas/Property/Models/Parcel/ParcelBuildingModel.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Api.Areas.Property.Models.Parcel -{ - public class ParcelBuildingModel : PropertyModel - { - #region Properties - public int ParcelId { get; set; } - - public int BuildingConstructionTypeId { get; set; } - - public string BuildingConstructionType { get; set; } - - public int BuildingFloorCount { get; set; } - - public int BuildingPredominateUseId { get; set; } - - public string BuildingPredominateUse { get; set; } - - public int BuildingOccupantTypeId { get; set; } - - public string BuildingOccupantType { get; set; } - - public DateTime? LeaseExpiry { get; set; } - - public string OccupantName { get; set; } - - public bool TransferLeaseOnSale { get; set; } - - public string BuildingTenancy { get; set; } - - public float RentableArea { get; set; } - - public IEnumerable Evaluations { get; set; } = new List(); - - public IEnumerable Fiscals { get; set; } = new List(); - #endregion - } -} diff --git a/backend/api/Areas/Property/Models/Parcel/ParcelEvaluationModel.cs b/backend/api/Areas/Property/Models/Parcel/ParcelEvaluationModel.cs deleted file mode 100644 index 518a684e75..0000000000 --- a/backend/api/Areas/Property/Models/Parcel/ParcelEvaluationModel.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Model = Pims.Api.Models; -using System; - -namespace Pims.Api.Areas.Property.Models.Parcel -{ - public class ParcelEvaluationModel : Model.BaseModel - { - #region Properties - public int ParcelId { get; set; } - - public DateTime Date { get; set; } - - public string Key { get; set; } - - public decimal Value { get; set; } - - public string Note { get; set; } - - public string Firm { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Property/Models/Parcel/ParcelFiscalModel.cs b/backend/api/Areas/Property/Models/Parcel/ParcelFiscalModel.cs deleted file mode 100644 index 754a2687fa..0000000000 --- a/backend/api/Areas/Property/Models/Parcel/ParcelFiscalModel.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using Model = Pims.Api.Models; - -namespace Pims.Api.Areas.Property.Models.Parcel -{ - public class ParcelFiscalModel : Model.BaseModel - { - #region Properties - public int ParcelId { get; set; } - - public int FiscalYear { get; set; } - - public DateTime? EffectiveDate { get; set; } - - public string Key { get; set; } - - public decimal Value { get; set; } - - public string Note { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Property/Models/Parcel/ParcelModel.cs b/backend/api/Areas/Property/Models/Parcel/ParcelModel.cs deleted file mode 100644 index fdbd72a297..0000000000 --- a/backend/api/Areas/Property/Models/Parcel/ParcelModel.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Collections.Generic; - -namespace Pims.Api.Areas.Property.Models.Parcel -{ - public class ParcelModel : PropertyModel - { - #region Properties - public string PID { get; set; } - - public int? PIN { get; set; } - - public float LandArea { get; set; } - - public string LandLegalDescription { get; set; } - - public string Zoning { get; set; } - - public string ZoningPotential { get; set; } - - public IEnumerable Evaluations { get; set; } = new List(); - - public IEnumerable Fiscals { get; set; } = new List(); - - public IEnumerable Buildings { get; set; } = new List(); - - /** - * All of the parcels related to this subdivision - */ - public IEnumerable Parcels { get; set; } = new List(); - - /** - * All of the subdivisions related to this parcel - */ - public IEnumerable Subdivisions { get; set; } = new List(); - #endregion - } -} diff --git a/backend/api/Areas/Property/Models/Parcel/ParcelSubdivisionModel.cs b/backend/api/Areas/Property/Models/Parcel/ParcelSubdivisionModel.cs deleted file mode 100644 index 52d8b6144c..0000000000 --- a/backend/api/Areas/Property/Models/Parcel/ParcelSubdivisionModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Model = Pims.Api.Models; - -namespace Pims.Api.Areas.Property.Models.Parcel -{ - public class ParcelSubdivisionModel : Model.BaseModel - { - public int Id { get; set; } - - public string PID { get; set; } - - public int? PIN { get; set; } - } -} diff --git a/backend/api/Areas/Property/Models/Parcel/PartialPropertyModel.cs b/backend/api/Areas/Property/Models/Parcel/PartialPropertyModel.cs deleted file mode 100644 index 78f7723ddf..0000000000 --- a/backend/api/Areas/Property/Models/Parcel/PartialPropertyModel.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Model = Pims.Api.Models; - -namespace Pims.Api.Areas.Property.Models.Parcel -{ - public class PartialPropertyModel : Model.BaseModel - { - #region Properties - public int Id { get; set; } - - public string Name { get; set; } - - public int StatusId { get; set; } - - public int ClassificationId { get; set; } - - public double Latitude { get; set; } - - public double Longitude { get; set; } - - public string Description { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Property/Models/Parcel/PropertyModel.cs b/backend/api/Areas/Property/Models/Parcel/PropertyModel.cs deleted file mode 100644 index 43274c382b..0000000000 --- a/backend/api/Areas/Property/Models/Parcel/PropertyModel.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.Collections.Generic; -using Model = Pims.Api.Models; - -namespace Pims.Api.Areas.Property.Models.Parcel -{ - public class PropertyModel : Model.BaseModel - { - #region Properties - public int Id { get; set; } - - public int PropertyTypeId { get; set; } - - public IEnumerable ProjectNumbers { get; set; } - - public string ProjectWorkflow { get; set; } - - public string ProjectStatus { get; set; } - - public string Name { get; set; } - - public string Description { get; set; } - - public int ClassificationId { get; set; } - - public string Classification { get; set; } - - public string EncumbranceReason { get; set; } - - public int AgencyId { get; set; } - - public virtual string SubAgency { get; set; } - - public string Agency { get; set; } - - public virtual string SubAgencyFullName { get; set; } - - public string AgencyFullName { get; set; } - - public AddressModel Address { get; set; } - - public double Latitude { get; set; } - - public double Longitude { get; set; } - - public bool IsSensitive { get; set; } - - public bool IsVisibleToOtherAgencies { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Property/Models/Parcel/SubdivisionParcelModel.cs b/backend/api/Areas/Property/Models/Parcel/SubdivisionParcelModel.cs deleted file mode 100644 index f933478acf..0000000000 --- a/backend/api/Areas/Property/Models/Parcel/SubdivisionParcelModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Model = Pims.Api.Models; - -namespace Pims.Api.Areas.Property.Models.Parcel -{ - public class SubdivisionParcelModel : Model.BaseModel - { - public int Id { get; set; } - - public string PID { get; set; } - - public int? PIN { get; set; } - } -} diff --git a/backend/api/Areas/Property/Models/Search/GeoJsonFilterModel.cs b/backend/api/Areas/Property/Models/Search/GeoJsonFilterModel.cs deleted file mode 100644 index adb3410833..0000000000 --- a/backend/api/Areas/Property/Models/Search/GeoJsonFilterModel.cs +++ /dev/null @@ -1,478 +0,0 @@ -using Pims.Core.Extensions; -using Pims.Dal.Entities.Models; -using Pims.Dal.Entities; -using System; -using System.Collections.Generic; -using System.Linq; -using System.ComponentModel; -using NetTopologySuite.Geometries; - -namespace Pims.Api.Areas.Property.Models.Search -{ - /// - /// GeoJsonFilterModel class, provides a model to contain the parcel and building filters. - /// - public class GeoJsonFilterModel : PageFilter - { - #region Properties - /// - /// get/set - Defines a rectangle region of the 2D cordinate plane. - /// - [DisplayName("bbox")] - public Envelope Boundary { get; set; } - - /// - /// get/set - The type of GIS webservice [WFS,WMS]. - /// - public string Service { get; set; } - - /// - /// get/set - The request name. - /// - public string Request { get; set; } - - /// - /// get/set - The layers that should be returned. - /// - public string Layers { get; set; } - - /// - /// get/set - Parcel classification Id. - /// - public int? ClassificationId { get; set; } - - /// - /// get/set - Parcel status Id. - /// - public int? StatusId { get; set; } - - /// - /// get/set - The property address. - /// - public string Address { get; set; } - - /// - /// get/set - The property administrative area (city, municipality, district, etc.). - /// - /// - public string AdministrativeArea { get; set; } - - /// - /// get/set - The SPP/RAEG project number. - /// - public string ProjectNumber { get; set; } - - /// - /// get/set - Flag indicating properties in projects should be ignored. - /// - public bool? IgnorePropertiesInProjects { get; set; } - - /// - /// get/set - Flag indicating to show only properties that belong to a project. - /// - public bool? InSurplusPropertyProgram { get; set; } - - /// - /// get/set - Flag indicating to show only properties in enhanced referral process. - /// - public bool? InEnhancedReferralProcess { get; set; } - - /// - /// get/set - A way to filter both Parcel.LandArea and the Building.BuildingRentableArea. - /// - public float? MinLotArea { get; set; } - - /// - /// get/set - A way to filter both Parcel.LandArea and the Building.BuildingRentableArea. - /// - public float? MaxLotArea { get; set; } - - /// - /// get/set - Building minimum market value. - /// - public decimal? MinMarketValue { get; set; } - - /// - /// get/set - Bare land only flag - /// - public bool? BareLandOnly { get; set; } - - /// - /// get/set - Building maximum market value. - /// - public decimal? MaxMarketValue { get; set; } - - /// - /// get/set - Parcel minimum assessed value. - /// - public decimal? MinAssessedValue { get; set; } - - /// - /// get/set - Parcel maximum assessed value. - /// - public decimal? MaxAssessedValue { get; set; } - - /// - /// get/set - An array of agencies. - /// - public int[] Agencies { get; set; } - - /// - /// get/set - Whether to include properties not owned by user's agency when searching. - /// - public bool IncludeAllProperties { get; set; } - - #region Parcel Filters - /// - /// get/set - The parcel PID. - /// - public string PID { get; set; } - - /// - /// get/set - Parcel minimum land area. - /// - public float? MinLandArea { get; set; } - - /// - /// get/set - Parcel maximum land area. - /// - public float? MaxLandArea { get; set; } - #endregion - - #region Building Filters - - /// - /// get/set - Building construction type Id. - /// - public int? ConstructionTypeId { get; set; } - - /// - /// get/set - Property name. - /// - /// - public string Name { get; set; } - - /// - /// get/set - Building predominant use Id. - /// - public int? PredominateUseId { get; set; } - - /// - /// get/set - Parent Parcel Id. - /// - public int? ParcelId { get; set; } - - /// - /// get/set - Parent Property Type Id. - /// - public PropertyTypes? PropertyType { get; set; } - - /// - /// get/set - Building floor count Id. - /// - public int? FloorCount { get; set; } - - /// - /// get/set - Building tenancy. - /// - public string Tenancy { get; set; } - - /// - /// get/set - Building minimum rentable area. - /// - public float? MinRentableArea { get; set; } - - /// - /// get/set - Building rentable area. - /// - public float? RentableArea { get; set; } - - /// - /// get/set - Building maximum rentable area. - /// - public float? MaxRentableArea { get; set; } - #endregion - - /// - /// get - Determine if the filter should include parcels. - /// - public bool IncludeParcels - { - get - { - return this.StatusId.HasValue - || this.ClassificationId.HasValue - || !String.IsNullOrWhiteSpace(this.ProjectNumber) - || !String.IsNullOrWhiteSpace(this.PID) - || !String.IsNullOrWhiteSpace(this.AdministrativeArea) - || this.MinLotArea.HasValue - || this.MaxLotArea.HasValue - || this.MinLandArea.HasValue - || this.MaxLandArea.HasValue; - } - } - - /// - /// get - Determine if the filter should include buildings. - /// - public bool IncludeBuildings - { - get - { - return this.StatusId.HasValue - || this.ClassificationId.HasValue - || !String.IsNullOrWhiteSpace(this.ProjectNumber) - || !String.IsNullOrWhiteSpace(this.Name) - || !String.IsNullOrWhiteSpace(this.AdministrativeArea) - || this.ConstructionTypeId.HasValue - || this.PredominateUseId.HasValue - || this.FloorCount.HasValue - || !String.IsNullOrWhiteSpace(this.Tenancy) - || this.MinRentableArea.HasValue - || this.MaxRentableArea.HasValue - || this.RentableArea.HasValue; - } - } - #endregion - - #region Constructors - /// - /// Creates a new instance of a GeoJsonFilterModel class. - /// - public GeoJsonFilterModel() { } - - /// - /// Creates a new instance of a GeoJsonFilterModel class. - /// - /// - public GeoJsonFilterModel(Envelope bbox) - { - this.Boundary = bbox; - } - - /// - /// Creates a new instance of a GeoJsonFilterModel class, initializes with the specified arguments. - /// - /// - public GeoJsonFilterModel(Dictionary query) : base(query) - { - // We want case-insensitive query parameter properties. - var filter = new Dictionary(query, StringComparer.OrdinalIgnoreCase); - - this.Service = filter.GetStringValue(nameof(this.Service)); - this.Request = filter.GetStringValue(nameof(this.Request)); - this.Layers = filter.GetStringValue(nameof(this.Layers)); - this.Boundary = filter.GetEnvelopNullValue("bbox"); - - this.IncludeAllProperties = filter.GetBoolValue(nameof(this.IncludeAllProperties)); - - this.Address = filter.GetStringValue(nameof(this.Address)); - this.AdministrativeArea = filter.GetStringValue(nameof(this.AdministrativeArea)); - - this.BareLandOnly = filter.GetBoolNullValue(nameof(this.BareLandOnly)); - this.StatusId = filter.GetIntNullValue(nameof(this.StatusId)); - this.ClassificationId = filter.GetIntNullValue(nameof(this.ClassificationId)); - this.ParcelId = filter.GetIntNullValue(nameof(this.ParcelId)); - this.PropertyType = Enum.TryParse(filter.GetStringValue(nameof(this.PropertyType), null), out PropertyTypes propType) ? (PropertyTypes?)propType : null; - this.ProjectNumber = filter.GetStringValue(nameof(this.ProjectNumber)); - this.IgnorePropertiesInProjects = filter.GetBoolNullValue(nameof(this.IgnorePropertiesInProjects)); - this.InSurplusPropertyProgram = filter.GetBoolNullValue(nameof(this.InSurplusPropertyProgram)); - this.InEnhancedReferralProcess = filter.GetBoolNullValue(nameof(this.InEnhancedReferralProcess)); - - this.MinMarketValue = filter.GetDecimalNullValue(nameof(this.MinMarketValue)); - this.MaxMarketValue = filter.GetDecimalNullValue(nameof(this.MaxMarketValue)); - this.MinAssessedValue = filter.GetDecimalNullValue(nameof(this.MinAssessedValue)); - this.MaxAssessedValue = filter.GetDecimalNullValue(nameof(this.MaxAssessedValue)); - - this.Agencies = filter.GetIntArrayValue(nameof(this.Agencies)).Where(a => a != 0).ToArray(); - this.Sort = filter.GetStringArrayValue(nameof(this.Sort)); - this.Name = filter.GetStringValue(nameof(this.Name)); - - // Parcel filters. - this.PID = filter.GetStringValue(nameof(this.PID)); - this.MinLandArea = filter.GetFloatNullValue(nameof(this.MinLandArea)) ?? filter.GetFloatNullValue(nameof(this.MinLotArea)); - this.MaxLandArea = filter.GetFloatNullValue(nameof(this.MaxLandArea)) ?? filter.GetFloatNullValue(nameof(this.MaxLotArea)); - - // Building filters. - this.ConstructionTypeId = filter.GetIntNullValue(nameof(this.ConstructionTypeId)); - this.PredominateUseId = filter.GetIntNullValue(nameof(this.PredominateUseId)); - this.FloorCount = filter.GetIntNullValue(nameof(this.FloorCount)); - this.Tenancy = filter.GetStringValue(nameof(this.Tenancy)); - this.MinRentableArea = filter.GetFloatNullValue(nameof(this.MinRentableArea)) ?? filter.GetFloatNullValue(nameof(this.MinLotArea)); - this.MaxRentableArea = filter.GetFloatNullValue(nameof(this.MaxRentableArea)) ?? filter.GetFloatNullValue(nameof(this.MaxLotArea)); - this.RentableArea = filter.GetFloatNullValue(nameof(this.RentableArea)) ?? filter.GetFloatNullValue(nameof(this.RentableArea)); - - } - #endregion - - #region Methods - /// - /// Convert to a ParcelFilter. - /// - /// - public static explicit operator ParcelFilter(GeoJsonFilterModel model) - { - var filter = new ParcelFilter - { - Page = model.Page, - Quantity = model.Quantity, - - SWLongitude = model.Boundary.MinX, - SWLatitude = model.Boundary.MaxX, - NELongitude = model.Boundary.MaxX, - NELatitude = model.Boundary.MaxY, - - ProjectNumber = model.ProjectNumber, - ClassificationId = model.ClassificationId, - Address = model.Address, - AdministrativeArea = model.AdministrativeArea, - - PID = model.PID, - MinLandArea = model.MinLandArea ?? model.MinLotArea, - MaxLandArea = model.MaxLandArea ?? model.MaxLotArea, - - MinMarketValue = model.MinMarketValue, - MaxMarketValue = model.MaxMarketValue, - MinAssessedValue = model.MinAssessedValue, - MaxAssessedValue = model.MaxAssessedValue, - - Agencies = model.Agencies, - Sort = model.Sort - }; - - return filter; - } - - /// - /// Convert to a BuildingFilter. - /// - /// - public static explicit operator BuildingFilter(GeoJsonFilterModel model) - { - var filter = new BuildingFilter - { - Page = model.Page, - Quantity = model.Quantity, - - SWLongitude = model.Boundary.MinX, - SWLatitude = model.Boundary.MaxX, - NELongitude = model.Boundary.MaxX, - NELatitude = model.Boundary.MaxY, - - ProjectNumber = model.ProjectNumber, - ClassificationId = model.ClassificationId, - Address = model.Address, - AdministrativeArea = model.AdministrativeArea, - - MinLandArea = model.MinLandArea ?? model.MinLotArea, - MaxLandArea = model.MaxLandArea ?? model.MaxLotArea, - - ConstructionTypeId = model.ConstructionTypeId, - PredominateUseId = model.PredominateUseId, - FloorCount = model.FloorCount, - Tenancy = model.Tenancy, - MinRentableArea = model.MinRentableArea ?? model.MinLotArea, - MaxRentableArea = model.MaxRentableArea ?? model.MaxLotArea, - RentableArea = model.RentableArea ?? model.RentableArea, - - MinMarketValue = model.MinMarketValue, - MaxMarketValue = model.MaxMarketValue, - MinAssessedValue = model.MinAssessedValue, - MaxAssessedValue = model.MaxAssessedValue, - - Agencies = model.Agencies, - Sort = model.Sort - }; - - return filter; - } - - /// - /// Convert to a ParcelFilter. - /// - /// - public static explicit operator AllPropertyFilter(GeoJsonFilterModel model) - { - var filter = new AllPropertyFilter - { - Page = model.Page, - Quantity = model.Quantity, - - SWLongitude = model.Boundary.MinX, - SWLatitude = model.Boundary.MaxX, - NELongitude = model.Boundary.MaxX, - NELatitude = model.Boundary.MaxY, - - BareLandOnly = model.BareLandOnly, - Name = model.Name, - ProjectNumber = model.ProjectNumber, - IgnorePropertiesInProjects = model.IgnorePropertiesInProjects, - InSurplusPropertyProgram = model.InSurplusPropertyProgram, - InEnhancedReferralProcess = model.InEnhancedReferralProcess, - ParcelId = model.ParcelId, - PropertyType = model.PropertyType, - ClassificationId = model.ClassificationId, - Address = model.Address, - AdministrativeArea = model.AdministrativeArea, - - PID = model.PID, - MinLandArea = model.MinLandArea ?? model.MinLotArea, - MaxLandArea = model.MaxLandArea ?? model.MaxLotArea, - - ConstructionTypeId = model.ConstructionTypeId, - PredominateUseId = model.PredominateUseId, - FloorCount = model.FloorCount, - Tenancy = model.Tenancy, - MinRentableArea = model.MinRentableArea ?? model.MinLotArea, - MaxRentableArea = model.MaxRentableArea ?? model.MaxLotArea, - RentableArea = model.RentableArea ?? model.RentableArea, - MinMarketValue = model.MinMarketValue, - MaxMarketValue = model.MaxMarketValue, - MinAssessedValue = model.MinAssessedValue, - MaxAssessedValue = model.MaxAssessedValue, - - Agencies = model.Agencies, - Sort = model.Sort - }; - - return filter; - } - - /// - /// Determine if a valid filter was provided. - /// - /// - public override bool IsValid() - { - return base.IsValid() - || this.Boundary.MinX != 0 - || this.Boundary.MinY != 0 - || this.Boundary.MaxX != -1 - || this.Boundary.MaxY != -1 - || !String.IsNullOrWhiteSpace(this.ProjectNumber) - || !String.IsNullOrWhiteSpace(this.Address) - || !String.IsNullOrWhiteSpace(this.AdministrativeArea) - || this.MaxAssessedValue.HasValue - || this.MinAssessedValue.HasValue - || this.MinMarketValue.HasValue - || this.MaxMarketValue.HasValue - || this.Agencies?.Any() == true - || this.PropertyType.HasValue - || this.StatusId.HasValue - || this.ClassificationId.HasValue - || this.MinLandArea.HasValue - || this.MaxLandArea.HasValue - || this.ConstructionTypeId.HasValue - || this.PredominateUseId.HasValue - || this.FloorCount.HasValue - || this.MinRentableArea.HasValue - || this.RentableArea.HasValue - || this.BareLandOnly == true - || this.MaxRentableArea.HasValue - || !String.IsNullOrWhiteSpace(this.PID) - || !String.IsNullOrWhiteSpace(this.Tenancy) - || !String.IsNullOrWhiteSpace(this.Name); - } - #endregion - } -} diff --git a/backend/api/Areas/Property/Models/Search/GeoJsonGeometryModel.cs b/backend/api/Areas/Property/Models/Search/GeoJsonGeometryModel.cs deleted file mode 100644 index 32aa4236f6..0000000000 --- a/backend/api/Areas/Property/Models/Search/GeoJsonGeometryModel.cs +++ /dev/null @@ -1,23 +0,0 @@ -using NetTopologySuite.Geometries; - -namespace Pims.Api.Areas.Property.Models.Search -{ - /// - /// GeoJson class, provides a model to represent the property whether Land or Building. - /// - public class GeoJsonGeometryModel - { - #region Properties - /// - /// get/set - The type of geometry. - /// - public string Type { get; set; } - - /// - /// get/set - The coordinates of the data structure. - /// - /// - public Geometry Coordinates { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Property/Models/Search/GeoJsonModel.cs b/backend/api/Areas/Property/Models/Search/GeoJsonModel.cs deleted file mode 100644 index 012db36d42..0000000000 --- a/backend/api/Areas/Property/Models/Search/GeoJsonModel.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace Pims.Api.Areas.Property.Models.Search -{ - /// - /// GeoJson class, provides a model to represent the property whether Land or Building. - /// - public class GeoJson where T : class - { - #region Properties - /// - /// get/set - The type of GeoJSON data structure. - /// - public string Type { get; set; } - - /// - /// get/set - The goemetry of the data structure. - /// - public GeoJsonGeometryModel Geometry { get; set; } - - /// - /// get/set - The properties of the data structure. - /// - public T Properties { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Property/Models/Search/PropertyFilterModel.cs b/backend/api/Areas/Property/Models/Search/PropertyFilterModel.cs deleted file mode 100644 index 2c7ee4223d..0000000000 --- a/backend/api/Areas/Property/Models/Search/PropertyFilterModel.cs +++ /dev/null @@ -1,507 +0,0 @@ -using Pims.Core.Extensions; -using Pims.Dal.Entities.Models; -using Pims.Dal.Entities; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Pims.Api.Areas.Property.Models.Search -{ - /// - /// PropertyFilterModel class, provides a model to contain the parcel and building filters. - /// - public class PropertyFilterModel : PageFilter - { - #region Properties - /// - /// get/set - North East Latitude. - /// - /// - public double? NELatitude { get; set; } - - /// - /// get/set - North East Longitude. - /// - /// - public double? NELongitude { get; set; } - - /// - /// get/set - South West Latitude. - /// - /// - public double? SWLatitude { get; set; } - - /// - /// get/set - South West Longitude. - /// - /// - public double? SWLongitude { get; set; } - - /// - /// get/set - Parcel classification Id. - /// - /// - public int? ClassificationId { get; set; } - - /// - /// get/set - Parcel status Id. - /// - /// - public int? StatusId { get; set; } - - /// - /// get/set - The property address. - /// - /// - public string Address { get; set; } - - /// - /// get/set - The property administrative area (city, municipality, district, etc.). - /// - /// - public string AdministrativeArea { get; set; } - - /// - /// get/set - The SPP/RAEG project number. - /// - /// - public string ProjectNumber { get; set; } - - /// - /// get/set - Flag indicating properties in projects should be ignored. - /// - /// - public bool? IgnorePropertiesInProjects { get; set; } - - /// - /// get/set - Flag indicating to show only properties that belong to a project. - /// - /// - - public bool? InSurplusPropertyProgram { get; set; } - - /// - /// get/set - Flag indicating to show only properties in enhanced referral process. - /// - /// - public bool? InEnhancedReferralProcess { get; set; } - - /// - /// get/set - Value of the property name to be filtered. - /// - /// - public string Name { get; set; } - - /// - /// get/set - A way to filter both Parcel.LandArea and the Building.BuildingRentableArea. - /// - /// - public float? MinLotArea { get; set; } - - /// - /// get/set - A way to filter both Parcel.LandArea and the Building.BuildingRentableArea. - /// - /// - public float? MaxLotArea { get; set; } - - /// - /// get/set - Building minimum market value. - /// - /// - public decimal? MinMarketValue { get; set; } - - /// - /// get/set - Building maximum market value. - /// - /// - public decimal? MaxMarketValue { get; set; } - - /// - /// get/set - Parcel minimum assessed value. - /// - /// - public decimal? MinAssessedValue { get; set; } - - /// - /// get/set - Parcel maximum assessed value. - /// - /// - public decimal? MaxAssessedValue { get; set; } - - /// - /// get/set - An array of agencies. - /// - /// - public int[] Agencies { get; set; } - - #region Parcel Filters - /// - /// get/set - The parcel PID. - /// - public string PID { get; set; } - - /// - /// get/set - Parcel minimum land area. - /// - /// - public float? MinLandArea { get; set; } - - /// - /// get/set - Parcel maximum land area. - /// - /// - public float? MaxLandArea { get; set; } - #endregion - - #region Building Filters - - /// - /// get/set - Building construction type Id. - /// - /// - public int? ConstructionTypeId { get; set; } - - /// - /// get/set - Building predominant use Id. - /// - /// - public int? PredominateUseId { get; set; } - - /// - /// get/set - Bare land only flag - /// - /// - public bool? BareLandOnly { get; set; } - - /// - /// get/set - Parent Parcel Id. - /// - /// - public int? ParcelId { get; set; } - - /// - /// get/set - Parent Property Type Id. - /// - /// - public PropertyTypes? PropertyType { get; set; } - - /// - /// get/set - Building floor count Id. - /// - /// - public int? FloorCount { get; set; } - - /// - /// get/set - Building tenancy. - /// - /// - public string Tenancy { get; set; } - - /// - /// get/set - Building minimum rentable area. - /// - /// - public float? MinRentableArea { get; set; } - - /// - /// get/set - Building rentable area. - /// - /// - public float? RentableArea { get; set; } - - /// - /// get/set - Building maximum rentable area. - /// - /// - public float? MaxRentableArea { get; set; } - #endregion - - /// - /// get - Determine if the filter should include parcels. - /// - /// - public bool IncludeParcels - { - get - { - return this.StatusId.HasValue - || this.ClassificationId.HasValue - || !String.IsNullOrWhiteSpace(this.ProjectNumber) - || !String.IsNullOrWhiteSpace(this.PID) - || !String.IsNullOrWhiteSpace(this.AdministrativeArea) - || this.MinLotArea.HasValue - || this.MaxLotArea.HasValue - || this.MinLandArea.HasValue - || this.MaxLandArea.HasValue; - } - } - - /// - /// get - Determine if the filter should include buildings. - /// - /// - public bool IncludeBuildings - { - get - { - return this.StatusId.HasValue - || this.ClassificationId.HasValue - || !String.IsNullOrWhiteSpace(this.ProjectNumber) - || !String.IsNullOrWhiteSpace(this.AdministrativeArea) - || this.ConstructionTypeId.HasValue - || this.PredominateUseId.HasValue - || this.FloorCount.HasValue - || !String.IsNullOrWhiteSpace(this.Tenancy) - || this.MinRentableArea.HasValue - || this.MaxRentableArea.HasValue; - } - } - #endregion - - #region Constructors - /// - /// Creates a new instance of a PropertyFilterModel class. - /// - public PropertyFilterModel() { } - - /// - /// Creates a new instance of a PropertyFilterModel class. - /// - /// - /// - /// - /// - public PropertyFilterModel(double neLat, double neLong, double swLat, double swLong) - { - this.NELatitude = neLat; - this.NELongitude = neLong; - this.SWLatitude = swLat; - this.SWLongitude = swLong; - } - - /// - /// Creates a new instance of a PropertyFilterModel class, initializes with the specified arguments. - /// - /// - public PropertyFilterModel(Dictionary query) : base(query) - { - // We want case-insensitive query parameter properties. - var filter = new Dictionary(query, StringComparer.OrdinalIgnoreCase); - - this.NELatitude = filter.GetDoubleNullValue(nameof(this.NELatitude)); - this.NELongitude = filter.GetDoubleNullValue(nameof(this.NELongitude)); - this.SWLatitude = filter.GetDoubleNullValue(nameof(this.SWLatitude)); - this.SWLongitude = filter.GetDoubleNullValue(nameof(this.SWLongitude)); - this.Address = filter.GetStringValue(nameof(this.Address)); - this.AdministrativeArea = filter.GetStringValue(nameof(this.AdministrativeArea)); - - this.StatusId = filter.GetIntNullValue(nameof(this.StatusId)); - this.ClassificationId = filter.GetIntNullValue(nameof(this.ClassificationId)); - this.ParcelId = filter.GetIntNullValue(nameof(this.ParcelId)); - this.PropertyType = Enum.TryParse(filter.GetStringValue(nameof(this.PropertyType), null), out PropertyTypes propType) ? (PropertyTypes?)propType : null; - this.ProjectNumber = filter.GetStringValue(nameof(this.ProjectNumber)); - this.IgnorePropertiesInProjects = filter.GetBoolNullValue(nameof(this.IgnorePropertiesInProjects)); - this.InSurplusPropertyProgram = filter.GetBoolNullValue(nameof(this.InSurplusPropertyProgram)); - this.InEnhancedReferralProcess = filter.GetBoolNullValue(nameof(this.InEnhancedReferralProcess)); - - this.MinMarketValue = filter.GetDecimalNullValue(nameof(this.MinMarketValue)); - this.MaxMarketValue = filter.GetDecimalNullValue(nameof(this.MaxMarketValue)); - this.MinAssessedValue = filter.GetDecimalNullValue(nameof(this.MinAssessedValue)); - this.MaxAssessedValue = filter.GetDecimalNullValue(nameof(this.MaxAssessedValue)); - this.Name = filter.GetStringValue(nameof(this.Name)); - - this.Agencies = filter.GetIntArrayValue(nameof(this.Agencies)).Where(a => a != 0).ToArray(); - this.Sort = filter.GetStringArrayValue(nameof(this.Sort)); - - // Parcel filters. - this.BareLandOnly = filter.GetBoolNullValue(nameof(this.BareLandOnly)); - this.PID = filter.GetStringValue(nameof(this.PID)); - this.MinLandArea = filter.GetFloatNullValue(nameof(this.MinLandArea)) ?? filter.GetFloatNullValue(nameof(this.MinLotArea)); - this.MaxLandArea = filter.GetFloatNullValue(nameof(this.MaxLandArea)) ?? filter.GetFloatNullValue(nameof(this.MaxLotArea)); - - // Building filters. - this.ConstructionTypeId = filter.GetIntNullValue(nameof(this.ConstructionTypeId)); - this.PredominateUseId = filter.GetIntNullValue(nameof(this.PredominateUseId)); - this.FloorCount = filter.GetIntNullValue(nameof(this.FloorCount)); - this.Tenancy = filter.GetStringValue(nameof(this.Tenancy)); - this.MinRentableArea = filter.GetFloatNullValue(nameof(this.MinRentableArea)) ?? filter.GetFloatNullValue(nameof(this.MinLotArea)); - this.MaxRentableArea = filter.GetFloatNullValue(nameof(this.MaxRentableArea)) ?? filter.GetFloatNullValue(nameof(this.MaxLotArea)); - this.RentableArea = filter.GetFloatNullValue(nameof(this.RentableArea)) ?? filter.GetFloatNullValue(nameof(this.RentableArea)); - } - #endregion - - #region Methods - /// - /// Convert to a ParcelFilter. - /// - /// - public static explicit operator ParcelFilter(PropertyFilterModel model) - { - var filter = new ParcelFilter - { - Page = model.Page, - Quantity = model.Quantity, - - NELatitude = model.NELatitude, - NELongitude = model.NELongitude, - SWLatitude = model.SWLatitude, - SWLongitude = model.SWLongitude, - - ProjectNumber = model.ProjectNumber, - ClassificationId = model.ClassificationId, - PropertyType = model.PropertyType, - Address = model.Address, - AdministrativeArea = model.AdministrativeArea, - - PID = model.PID, - MinLandArea = model.MinLandArea ?? model.MinLotArea, - MaxLandArea = model.MaxLandArea ?? model.MaxLotArea, - - MinMarketValue = model.MinMarketValue, - MaxMarketValue = model.MaxMarketValue, - MinAssessedValue = model.MinAssessedValue, - MaxAssessedValue = model.MaxAssessedValue, - - Agencies = model.Agencies, - Sort = model.Sort - }; - - return filter; - } - - /// - /// Convert to a BuildingFilter. - /// - /// - public static explicit operator BuildingFilter(PropertyFilterModel model) - { - var filter = new BuildingFilter - { - Page = model.Page, - Quantity = model.Quantity, - - NELatitude = model.NELatitude, - NELongitude = model.NELongitude, - SWLatitude = model.SWLatitude, - SWLongitude = model.SWLongitude, - - ProjectNumber = model.ProjectNumber, - ClassificationId = model.ClassificationId, - Address = model.Address, - AdministrativeArea = model.AdministrativeArea, - - MinLandArea = model.MinLandArea ?? model.MinLotArea, - MaxLandArea = model.MaxLandArea ?? model.MaxLotArea, - - ConstructionTypeId = model.ConstructionTypeId, - PredominateUseId = model.PredominateUseId, - FloorCount = model.FloorCount, - Tenancy = model.Tenancy, - MinRentableArea = model.MinRentableArea ?? model.MinLotArea, - MaxRentableArea = model.MaxRentableArea ?? model.MaxLotArea, - RentableArea = model.RentableArea ?? model.RentableArea, - - MinMarketValue = model.MinMarketValue, - MaxMarketValue = model.MaxMarketValue, - MinAssessedValue = model.MinAssessedValue, - MaxAssessedValue = model.MaxAssessedValue, - - Agencies = model.Agencies, - Sort = model.Sort - }; - - return filter; - } - - /// - /// Convert to a ParcelFilter. - /// - /// - public static explicit operator AllPropertyFilter(PropertyFilterModel model) - { - var filter = new AllPropertyFilter - { - Page = model.Page, - Quantity = model.Quantity, - - NELatitude = model.NELatitude, - NELongitude = model.NELongitude, - SWLatitude = model.SWLatitude, - SWLongitude = model.SWLongitude, - - ProjectNumber = model.ProjectNumber, - BareLandOnly = model.BareLandOnly, - IgnorePropertiesInProjects = model.IgnorePropertiesInProjects, - InSurplusPropertyProgram = model.InSurplusPropertyProgram, - InEnhancedReferralProcess = model.InEnhancedReferralProcess, - Name = model.Name, - ParcelId = model.ParcelId, - PropertyType = model.PropertyType, - ClassificationId = model.ClassificationId, - Address = model.Address, - AdministrativeArea = model.AdministrativeArea, - - PID = model.PID, - MinLandArea = model.MinLandArea ?? model.MinLotArea, - MaxLandArea = model.MaxLandArea ?? model.MaxLotArea, - - ConstructionTypeId = model.ConstructionTypeId, - PredominateUseId = model.PredominateUseId, - FloorCount = model.FloorCount, - Tenancy = model.Tenancy, - MinRentableArea = model.MinRentableArea ?? model.MinLotArea, - MaxRentableArea = model.MaxRentableArea ?? model.MaxLotArea, - RentableArea = model.RentableArea ?? model.RentableArea, - - - MinMarketValue = model.MinMarketValue, - MaxMarketValue = model.MaxMarketValue, - MinAssessedValue = model.MinAssessedValue, - MaxAssessedValue = model.MaxAssessedValue, - - Agencies = model.Agencies, - Sort = model.Sort - }; - - return filter; - } - - /// - /// Determine if a valid filter was provided. - /// - /// - public override bool IsValid() - { - return base.IsValid() - || this.NELatitude.HasValue - || this.NELongitude.HasValue - || this.SWLatitude.HasValue - || this.SWLongitude.HasValue - || !String.IsNullOrWhiteSpace(this.ProjectNumber) - || !String.IsNullOrWhiteSpace(this.Address) - || !String.IsNullOrWhiteSpace(this.AdministrativeArea) - || this.MaxAssessedValue.HasValue - || this.MinAssessedValue.HasValue - || this.MinMarketValue.HasValue - || this.MaxMarketValue.HasValue - || this.Agencies?.Any() == true - || this.BareLandOnly == true - || this.StatusId.HasValue - || this.ClassificationId.HasValue - || this.MinLandArea.HasValue - || this.MaxLandArea.HasValue - || this.ConstructionTypeId.HasValue - || this.PropertyType.HasValue - || this.PredominateUseId.HasValue - || this.FloorCount.HasValue - || this.MinRentableArea.HasValue - || this.MaxRentableArea.HasValue - || this.RentableArea.HasValue - || !String.IsNullOrWhiteSpace(this.PID) - || !String.IsNullOrWhiteSpace(this.Tenancy) - || !String.IsNullOrWhiteSpace(this.Name); - - } - #endregion - } -} diff --git a/backend/api/Areas/Property/Models/Search/PropertyModel.cs b/backend/api/Areas/Property/Models/Search/PropertyModel.cs deleted file mode 100644 index 0ddc8d0f29..0000000000 --- a/backend/api/Areas/Property/Models/Search/PropertyModel.cs +++ /dev/null @@ -1,281 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Api.Areas.Property.Models.Search -{ - /// - /// PropertyModel class, provides a model to represent the property whether Land or Building. - /// - public class PropertyModel - { - #region Properties - #region Identification - /// - /// get/set - The primary key to identify the property. - /// - public int Id { get; set; } - - /// - /// get/set - The concurrency row version. - /// - /// - public string RowVersion { get; set; } - - /// - /// get/set - The foreign key to the property type [Land, Building]. - /// - public int PropertyTypeId { get; set; } - - /// - /// get/set - The foreign key to the property status. - /// - public int StatusId { get; set; } - - /// - /// get/set - The status of the property. - /// - public string Status { get; set; } - - /// - /// get/set - The foreign key to the property classification. - /// - public int ClassificationId { get; set; } - - /// - /// get/set - The classification of the property. - /// - public string Classification { get; set; } - - /// - /// get/set - The GIS latitude location of the property. - /// - public double? Latitude { get; set; } - - /// - /// get/set - The GIS latitude location of the property. - /// - public double? Longitude { get; set; } - - /// - /// get/set - The property name. - /// - public string Name { get; set; } - - /// - /// get/set - The property description. - /// - public string Description { get; set; } - - /// - /// get/set - The property project numbers. - /// - public IEnumerable ProjectNumbers { get; set; } - - /// - /// get/set - The property project status. - /// - public string ProjectStatus { get; set; } - - /// - /// get/set - The workflow code of this project, if in a project. - /// - public string ProjectWorkflow { get; set; } - - /// - /// get/set - Whether the property is sensitive data. - /// - public bool IsSensitive { get; set; } - #endregion - - #region Agency - /// - /// get/set - The foreign key to the owning agency. - /// - public int? AgencyId { get; set; } - - /// - /// get/set - The owning agency name. - /// - public string Agency { get; set; } - - /// - /// get/set - The owning agency code. - /// - public string AgencyCode { get; set; } - - /// - /// get/set - The owning subagency name. - /// - public string SubAgency { get; set; } - - /// - /// get/set - The owning subagency code. - /// - public string SubAgencyCode { get; set; } - #endregion - - #region Address - /// - /// get/set - The foreign key to the address. - /// - public int AddressId { get; set; } - - /// - /// get/set - The address of the property. - /// - public string Address { get; set; } - - /// - /// get/set - The name of the administrative area (city, municipality, district, etc.). - /// - public string AdministrativeArea { get; set; } - - /// - /// get/set - The name of the province. - /// - public string Province { get; set; } - - /// - /// get/set - The postal code. - /// - public string Postal { get; set; } - #endregion - - #region Parcel Properties - /// - /// get/set - A unique identifier for the titled parcel. - /// - public string PID { get; set; } - - /// - /// get/set - A unique identifier for an untitled parcel. - /// - public string PIN { get; set; } - - /// - /// get/set - The land area of the parcel. - /// - public float? LandArea { get; set; } - - /// - /// get/set - The land legal description of the parcel. - /// - public string LandLegalDescription { get; set; } - - /// - /// get/set - The property zoning name. - /// - public string Zoning { get; set; } - - /// - /// get/set - The property zoning potential. - /// - public string ZoningPotential { get; set; } - #endregion - - #region Building Properties - /// - /// get/set - Foreign key to the construction type. - /// - public int? ConstructionTypeId { get; set; } - - /// - /// get/set - The construction type name. - /// - public string ConstructionType { get; set; } - - /// - /// get/set - The foreign key to the predominate use. - /// - public int? PredominateUseId { get; set; } - - /// - /// get/set - The predominate use name. - /// - public string PredominateUse { get; set; } - - /// - /// get/set - The foreign key to the occupant type. - /// - public int? OccupantTypeId { get; set; } - - /// - /// get/set - The occupant type name. - /// - public string OccupantType { get; set; } - - /// - /// get/set - The number of floors in the building. - /// - public int? FloorCount { get; set; } - - /// - /// get/set - A description of the building tenancy. - /// - public string Tenancy { get; set; } - - /// - /// get/set - The name of the occupant. - /// - public string OccupantName { get; set; } - - /// - /// get/set - The date the lease expires. - /// - public DateTime? LeaseExpiry { get; set; } - - /// - /// get/set - Whether the lease will transfer with the sale. - /// - public bool? TransferLeaseOnSale { get; set; } - - /// - /// get/set - The square feet of rentable area in the building. - /// - public float? RentableArea { get; set; } - #endregion - - #region Financials - /// - /// get/set - The property market value. - /// - public decimal? Market { get; set; } - - /// - /// get/set - The fiscal year of the market value. - /// - public int? MarketFiscalYear { get; set; } - - /// - /// get/set - The property netbook value. - /// - public decimal? NetBook { get; set; } - - /// - /// get/set - The fiscal year of the netbook value. - /// - public int? NetBookFiscalYear { get; set; } - - /// - /// get/set - The property assessed value. - /// - public decimal? AssessedLand { get; set; } - - /// - /// get/set - The date when the assessment occured. - /// - public DateTime? AssessedLandDate { get; set; } - - /// - /// get/set - The property appraised value. - /// - public decimal? AssessedBuilding { get; set; } - - /// - /// get/set - the date when the appraisal occured. - /// - public DateTime? AssessedBuildingDate { get; set; } - #endregion - #endregion - } -} diff --git a/backend/api/Areas/Reports/Controllers/ProjectController.cs b/backend/api/Areas/Reports/Controllers/ProjectController.cs deleted file mode 100644 index e834461c93..0000000000 --- a/backend/api/Areas/Reports/Controllers/ProjectController.cs +++ /dev/null @@ -1,157 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http.Extensions; -using Microsoft.AspNetCore.Mvc; -using Pims.Api.Areas.Reports.Models.Project; -using Pims.Api.Helpers.Constants; -using Pims.Api.Helpers.Exceptions; -using Pims.Api.Helpers.Extensions; -using Pims.Api.Helpers.Reporting; -using Pims.Api.Policies; -using Pims.Dal; -using Pims.Dal.Entities.Models; -using Pims.Dal.Security; -using Swashbuckle.AspNetCore.Annotations; -using System; - -namespace Pims.Api.Areas.Reports.Controllers -{ - /// - /// ProjectController class, provides endpoints for generating reports. - /// - [Authorize] - [ApiController] - [Area("reports")] - [ApiVersion("1.0")] - [Route("v{version:apiVersion}/[area]/projects")] - [Route("[area]/projects")] - public class ProjectController : ControllerBase - { - #region Variables - private readonly IPimsService _pimsService; - private readonly IMapper _mapper; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ReportController class, initializes it with the specified arguments. - /// - /// - /// - public ProjectController(IPimsService pimsService, IMapper mapper) - { - _pimsService = pimsService; - _mapper = mapper; - } - #endregion - - #region Endpoints - #region Export Properties - /// - /// Exports projects as CSV or Excel file. - /// Include 'Accept' header to request the appropriate expor - - /// ["text/csv", "application/application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"] - /// - /// - /// - [HttpGet] - [HasPermission(Permissions.ReportsView)] - [Produces(ContentTypes.CONTENT_TYPE_CSV, ContentTypes.CONTENT_TYPE_EXCELX)] - [ProducesResponseType(200)] - [SwaggerOperation(Tags = new[] { "project", "report" })] - public IActionResult ExportProjects(bool all = false) - { - var uri = new Uri(this.Request.GetDisplayUrl()); - var query = Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query); - return ExportProjects(new ProjectFilter(query), all); - } - - /// - /// Exports projects as CSV or Excel file. - /// Include 'Accept' header to request the appropriate expor - - /// ["text/csv", "application/application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"] - /// - /// - /// - /// - [HttpPost("filter")] - [HasPermission(Permissions.ReportsView)] - [Produces(ContentTypes.CONTENT_TYPE_CSV, ContentTypes.CONTENT_TYPE_EXCELX)] - [ProducesResponseType(200)] - [SwaggerOperation(Tags = new[] { "project", "report" })] - public IActionResult ExportProjects([FromBody] ProjectFilter filter, bool all = false) - { - filter.ThrowBadRequestIfNull($"The request must include a filter."); - if (!filter.IsValid()) throw new BadRequestException("Project filter must contain valid values."); - var accept = (string)this.Request.Headers["Accept"] ?? throw new BadRequestException($"HTTP request header 'Accept' is required."); - - if (accept != ContentTypes.CONTENT_TYPE_CSV && accept != ContentTypes.CONTENT_TYPE_EXCEL && accept != ContentTypes.CONTENT_TYPE_EXCELX) - throw new BadRequestException($"Invalid HTTP request header 'Accept:{accept}'."); - - filter.Quantity = all ? _pimsService.Project.Count() : filter.Quantity; - var page = _pimsService.Project.GetExcelPage(filter); - var report = _mapper.Map>(page); - - return accept.ToString() switch - { - ContentTypes.CONTENT_TYPE_CSV => ReportHelper.GenerateCsv(report.Items), - _ => ReportHelper.GenerateExcel(report.Items, "PIMS") - }; - } - #endregion - - #region Surplus Property List - /// - /// Exports projects as CSV or Excel file. - /// Include 'Accept' header to request the appropriate expor - - /// ["text/csv", "application/application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"] - /// - /// - [HttpGet("surplus/properties/list")] - [HasPermission(Permissions.ReportsView)] - [Produces(ContentTypes.CONTENT_TYPE_CSV, ContentTypes.CONTENT_TYPE_EXCELX)] - [ProducesResponseType(200)] - [SwaggerOperation(Tags = new[] { "project", "report" })] - public IActionResult SurplusPropertyList() - { - var uri = new Uri(this.Request.GetDisplayUrl()); - var query = Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query); - return SurplusPropertyList(new ProjectFilter(query)); - } - - /// - /// Exports projects as CSV or Excel file. - /// Include 'Accept' header to request the appropriate expor - - /// ["text/csv", "application/application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"] - /// - /// - /// - [HttpPost("surplus/properties/list/filter")] - [HasPermission(Permissions.ReportsSpl)] - [Produces(ContentTypes.CONTENT_TYPE_CSV, ContentTypes.CONTENT_TYPE_EXCELX)] - [ProducesResponseType(200)] - [SwaggerOperation(Tags = new[] { "project", "report" })] - public IActionResult SurplusPropertyList([FromBody] ProjectFilter filter) - { - filter.ThrowBadRequestIfNull($"The request must include a filter."); - if (!filter.IsValid()) throw new BadRequestException("Project filter must contain valid values."); - var accept = (string)this.Request.Headers["Accept"] ?? throw new BadRequestException($"HTTP request header 'Accept' is required."); - - if (accept != ContentTypes.CONTENT_TYPE_CSV && accept != ContentTypes.CONTENT_TYPE_EXCEL && accept != ContentTypes.CONTENT_TYPE_EXCELX) - throw new BadRequestException($"Invalid HTTP request header 'Accept:{accept}'."); - - filter.SPLWorkflow = true; - filter.Quantity = _pimsService.Project.Count(); - var page = _pimsService.Project.GetPage(filter); - var report = _mapper.Map>(page); - - return accept.ToString() switch - { - ContentTypes.CONTENT_TYPE_CSV => ReportHelper.GenerateCsv(report.Items), - _ => ReportHelper.GenerateExcel(report.Items, "PIMS") - }; - } - #endregion - #endregion - } -} diff --git a/backend/api/Areas/Reports/Controllers/PropertyController.cs b/backend/api/Areas/Reports/Controllers/PropertyController.cs deleted file mode 100644 index a165c55f48..0000000000 --- a/backend/api/Areas/Reports/Controllers/PropertyController.cs +++ /dev/null @@ -1,153 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http.Extensions; -using Microsoft.AspNetCore.Mvc; -using Pims.Api.Helpers.Constants; -using Pims.Api.Helpers.Exceptions; -using Pims.Api.Helpers.Extensions; -using Pims.Api.Helpers.Reporting; -using Pims.Api.Policies; -using Pims.Dal; -using Pims.Dal.Entities.Models; -using Pims.Dal.Security; -using Swashbuckle.AspNetCore.Annotations; -using System; - -namespace Pims.Api.Areas.Reports.Controllers -{ - /// - /// PropertyController class, provides endpoints for generating reports. - /// - [Authorize] - [ApiController] - [Area("reports")] - [ApiVersion("1.0")] - [Route("v{version:apiVersion}/[area]/properties")] - [Route("[area]/properties")] - public class PropertyController : ControllerBase - { - #region Variables - private readonly IPimsService _pimsService; - private readonly IMapper _mapper; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ReportController class, initializes it with the specified arguments. - /// - /// - /// - public PropertyController(IPimsService pimsService, IMapper mapper) - { - _pimsService = pimsService; - _mapper = mapper; - } - #endregion - - #region Endpoints - #region Export Properties - /// - /// Exports properties as CSV or Excel file. - /// Include 'Accept' header to request the appropriate expor - - /// ["text/csv", "application/application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"] - /// - /// - /// - [HttpGet] - [HasPermission(Permissions.PropertyView)] - [Produces(ContentTypes.CONTENT_TYPE_CSV, ContentTypes.CONTENT_TYPE_EXCELX)] - [ProducesResponseType(200)] - [SwaggerOperation(Tags = new[] { "property", "report" })] - public IActionResult ExportProperties(bool all = false) - { - var uri = new Uri(this.Request.GetDisplayUrl()); - var query = Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query); - return ExportProperties(new Property.Models.Search.PropertyFilterModel(query), all); - } - - /// - /// Exports properties as CSV or Excel file. - /// Include 'Accept' header to request the appropriate export - - /// ["text/csv", "application/application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"] - /// - /// - /// - /// - [HttpPost("filter")] - [HasPermission(Permissions.PropertyView)] - [Produces(ContentTypes.CONTENT_TYPE_CSV, ContentTypes.CONTENT_TYPE_EXCELX)] - [ProducesResponseType(200)] - [SwaggerOperation(Tags = new[] { "property", "report" })] - public IActionResult ExportProperties([FromBody] Property.Models.Search.PropertyFilterModel filter, bool all = false) - { - filter.ThrowBadRequestIfNull($"The request must include a filter."); - if (!filter.IsValid()) throw new BadRequestException("Property filter must contain valid values."); - var accept = (string)this.Request.Headers["Accept"] ?? throw new BadRequestException($"HTTP request header 'Accept' is required."); - - if (accept != ContentTypes.CONTENT_TYPE_CSV && accept != ContentTypes.CONTENT_TYPE_EXCEL && accept != ContentTypes.CONTENT_TYPE_EXCELX) - throw new BadRequestException($"Invalid HTTP request header 'Accept:{accept}'."); - - filter.Quantity = all ? _pimsService.Property.Count() : filter.Quantity; - var page = _pimsService.Property.GetPage((AllPropertyFilter)filter); - var report = _mapper.Map>(page); - - return accept.ToString() switch - { - ContentTypes.CONTENT_TYPE_CSV => ReportHelper.GenerateCsv(report.Items), - _ => ReportHelper.GenerateExcel(report.Items, "PIMS") - }; - - } - - #region Return All Properties - /// - /// Exports properties with all fields as an Excel file, only available for SRES - /// Include 'Accept' header to request the appropriate export - /// - /// - /// - [HttpGet("all/fields")] - [HasPermission(Permissions.AdminProperties)] - [Produces(ContentTypes.CONTENT_TYPE_EXCELX)] - [ProducesResponseType(200)] - [SwaggerOperation(Tags = new[] { "property", "report" })] - public IActionResult ExportPropertiesAllFields(bool all = false) - { - var uri = new Uri(this.Request.GetDisplayUrl()); - var query = Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query); - return ExportPropertiesAllFields(new Property.Models.Search.PropertyFilterModel(query), all); - } - - /// - /// Exports properties as Excel file. Has more fields than default export. - /// Only available for SRES - /// Include 'Accept' header to request the appropriate expor - /// - /// - /// - /// - [HttpPost("all/fields/filter")] - [HasPermission(Permissions.AdminProperties)] - [Produces(ContentTypes.CONTENT_TYPE_EXCELX)] - [ProducesResponseType(200)] - [SwaggerOperation(Tags = new[] { "property", "report" })] - public IActionResult ExportPropertiesAllFields([FromBody] Property.Models.Search.PropertyFilterModel filter, bool all = true) - { - filter.ThrowBadRequestIfNull($"The request must include a filter."); - if (!filter.IsValid()) throw new BadRequestException("Property filter must contain valid values."); - var accept = (string)this.Request.Headers["Accept"] ?? throw new BadRequestException($"HTTP request header 'Accept' is required."); - - if (accept != ContentTypes.CONTENT_TYPE_EXCEL && accept != ContentTypes.CONTENT_TYPE_EXCELX) - throw new BadRequestException($"Invalid HTTP request header 'Accept:{accept}'."); - - filter.Quantity = all ? _pimsService.Property.Count() : filter.Quantity; - var page = _pimsService.Property.GetPage((AllPropertyFilter)filter); - var report = _mapper.Map>(page); - - return ReportHelper.GenerateExcel(report.Items, "PIMS"); - } - #endregion - #endregion - #endregion - } -} diff --git a/backend/api/Areas/Reports/Controllers/UserController.cs b/backend/api/Areas/Reports/Controllers/UserController.cs deleted file mode 100644 index fcb8a2c68b..0000000000 --- a/backend/api/Areas/Reports/Controllers/UserController.cs +++ /dev/null @@ -1,106 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http.Extensions; -using Microsoft.AspNetCore.Mvc; -using Pims.Api.Helpers.Constants; -using Pims.Api.Helpers.Exceptions; -using Pims.Api.Helpers.Extensions; -using Pims.Api.Helpers.Reporting; -using Pims.Api.Policies; -using EModel = Pims.Dal.Entities.Models; -using Pims.Dal.Security; -using Pims.Dal.Services.Admin; -using Swashbuckle.AspNetCore.Annotations; -using System; - -namespace Pims.Api.Areas.Reports.Controllers -{ - /// - /// UserController class, provides endpoints for generating reports. - /// - [Authorize] - [ApiController] - [Area("reports")] - [ApiVersion("1.0")] - [Route("v{version:apiVersion}/[area]/users")] - [Route("[area]/users")] - public class UserController : ControllerBase - { - #region Variables - private readonly IPimsAdminService _pimsAdminService; - private readonly IMapper _mapper; - #endregion - - #region Constructors - /// - /// Creates a new instance of a UserController class, initializes it with the specified arguments. - /// - /// - /// - public UserController(IPimsAdminService pimsAdminService, IMapper mapper) - { - _pimsAdminService = pimsAdminService; - _mapper = mapper; - } - #endregion - - #region Endpoints - #region Export Users - /// - /// Exports users as CSV or Excel file. - /// Include 'Accept' header to request the appropriate expor - - /// ["text/csv", "application/application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"] - /// - /// - /// - [HttpGet] - [HasPermission(Permissions.AdminUsers)] - [Produces(ContentTypes.CONTENT_TYPE_CSV, ContentTypes.CONTENT_TYPE_EXCELX)] - [ProducesResponseType(typeof(Api.Models.PageModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 403)] - [SwaggerOperation(Tags = new[] { "user", "report" })] - public IActionResult ExportUsers(bool all = false) - { - var uri = new Uri(this.Request.GetDisplayUrl()); - var query = Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query); - return ExportUsers(new EModel.UserFilter(query), all); - } - - /// - /// Exports users as CSV or Excel file. - /// Include 'Accept' header to request the appropriate export - - /// ["text/csv", "application/application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"] - /// - /// - /// - /// - [HttpPost("filter")] - [HasPermission(Permissions.AdminUsers)] - [Produces(ContentTypes.CONTENT_TYPE_CSV, ContentTypes.CONTENT_TYPE_EXCELX)] - [ProducesResponseType(typeof(Api.Models.PageModel), 200)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)] - [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 403)] - [SwaggerOperation(Tags = new[] { "user", "report" })] - public IActionResult ExportUsers([FromBody] EModel.UserFilter filter, bool all = false) - { - filter.ThrowBadRequestIfNull($"The request must include a filter."); - var accept = (string)this.Request.Headers["Accept"] ?? throw new BadRequestException($"HTTP request header 'Accept' is required."); - - if (accept != ContentTypes.CONTENT_TYPE_CSV && accept != ContentTypes.CONTENT_TYPE_EXCEL && accept != ContentTypes.CONTENT_TYPE_EXCELX) - throw new BadRequestException($"Invalid HTTP request header 'Accept:{accept}'."); - - filter.Quantity = all ? _pimsAdminService.User.Count() : filter.Quantity; - var page = _pimsAdminService.User.Get(filter); - var report = _mapper.Map>(page); - - return accept.ToString() switch - { - ContentTypes.CONTENT_TYPE_CSV => ReportHelper.GenerateCsv(report.Items), - _ => ReportHelper.GenerateExcel(report.Items, "PIMS") - }; - } - #endregion - #endregion - } -} diff --git a/backend/api/Areas/Reports/Mapping/Project/ProjectMap.cs b/backend/api/Areas/Reports/Mapping/Project/ProjectMap.cs deleted file mode 100644 index a9674c3f07..0000000000 --- a/backend/api/Areas/Reports/Mapping/Project/ProjectMap.cs +++ /dev/null @@ -1,103 +0,0 @@ -using Mapster; -using Microsoft.Extensions.Options; -using Pims.Dal.Helpers.Extensions; -using Pims.Core.Extensions; -using System.Text.Json; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Reports.Models.Project; - -namespace Pims.Api.Areas.Reports.Mapping.Project -{ - public class ProjectMap : IRegister - { - #region Variables - private readonly JsonSerializerOptions _serializerOptions; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ProjectMap, initializes with specified arguments. - /// - /// - public ProjectMap(IOptions serializerOptions) - { - _serializerOptions = serializerOptions.Value; - } - #endregion - - #region Methods - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.ProjectNumber, src => src.ProjectNumber) - .Map(dest => dest.Location, src => src.GetPropertyLocation()) - .Map(dest => dest.PID, src => src.GetParcelPIDs()) - .Map(dest => dest.LotSize, src => src.GetParcelLotsize()) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.ReportedFiscalYearString, src => src.ReportedFiscalYear.FiscalYear()) - .Map(dest => dest.ActualFiscalYearString, src => src.ActualFiscalYear.FiscalYear()) - .Map(dest => dest.StatusCode, src => src.Status == null ? null : src.Status.Code) - .Map(dest => dest.Status, src => src.Status == null ? null : src.Status.Name) - .Map(dest => dest.Risk, src => src.Risk.Name) - .Map(dest => dest.TierLevel, src => src.TierLevel == null ? null : src.TierLevel.Name) - .Map(dest => dest.Ministry, src => src.Agency.ParentId.HasValue ? src.Agency.Parent.Code : src.Agency.Code) - .Map(dest => dest.Agency, src => src.Agency.Name) - .Map(dest => dest.UpdatedOn, src => src.UpdatedOn) - .Map(dest => dest.UpdatedBy, - src => src.UpdatedById != null ? src.UpdatedBy.DisplayName : null) - .Map(dest => dest.CreatedOn, src => src.CreatedOn) - .Map(dest => dest.CreatedBy, - src => src.CreatedById != null ? src.CreatedBy.DisplayName : null) - - #region Notes - .Map(dest => dest.Note, src => src.GetNoteText(Entity.NoteTypes.General)) - .Map(dest => dest.PublicNote, src => src.GetNoteText(Entity.NoteTypes.Public)) - .Map(dest => dest.PrivateNote, src => src.GetNoteText(Entity.NoteTypes.Private)) - .Map(dest => dest.AppraisedNote, src => src.GetNoteText(Entity.NoteTypes.Appraisal)) - .Map(dest => dest.ExemptionRationale, src => src.GetNoteText(Entity.NoteTypes.Exemption)) - .Map(dest => dest.OffersNote, src => src.GetNoteText(Entity.NoteTypes.Offer)) - #endregion - - #region Financial - .Map(dest => dest.NetBook, src => src.NetBook) - .Map(dest => dest.Market, src => src.Market) - .Map(dest => dest.Assessed, src => src.Assessed) - .Map(dest => dest.Appraised, src => src.Appraised) - #endregion - - #region Dates - .Map(dest => dest.SubmittedOn, src => src.SubmittedOn) - .Map(dest => dest.ApprovedOn, src => src.ApprovedOn) - .Map(dest => dest.DeniedOn, src => src.DeniedOn) - .Map(dest => dest.CancelledOn, src => src.CancelledOn) - .Map(dest => dest.CompletedOn, src => src.CompletedOn) - #endregion - - .AfterMapping((src, dest) => - { - var metadata = JsonSerializer.Deserialize(src.Metadata ?? "{}", _serializerOptions); - - dest.ExemptionRequested = metadata.ExemptionRequested; - dest.SalesCost = metadata.SalesCost; - dest.NetProceeds = metadata.NetProceeds; - dest.ProgramCost = metadata.ProgramCost; - dest.GainLoss = metadata.GainLoss; - dest.OcgFinancialStatement = metadata.OcgFinancialStatement; - dest.InterestComponent = metadata.InterestComponent; - dest.OfferAmount = metadata.OfferAmount; - dest.SaleWithLeaseInPlace = metadata.SaleWithLeaseInPlace; - dest.InitialNotificationSentOn = metadata.InitialNotificationSentOn; - dest.ThirtyDayNotificationSentOn = metadata.ThirtyDayNotificationSentOn; - dest.SixtyDayNotificationSentOn = metadata.SixtyDayNotificationSentOn; - dest.NinetyDayNotificationSentOn = metadata.NinetyDayNotificationSentOn; - dest.OnHoldNotificationSentOn = metadata.OnHoldNotificationSentOn; - dest.TransferredWithinGreOn = metadata.TransferredWithinGreOn; - dest.ClearanceNotificationSentOn = metadata.ClearanceNotificationSentOn; - dest.DisposedOn = metadata.DisposedOn; - dest.MarketedOn = metadata.MarketedOn; - dest.Purchaser = metadata.Purchaser; - }); - } - #endregion - } -} diff --git a/backend/api/Areas/Reports/Mapping/Project/ProjectPropertyMap.cs b/backend/api/Areas/Reports/Mapping/Project/ProjectPropertyMap.cs deleted file mode 100644 index d81f0c994a..0000000000 --- a/backend/api/Areas/Reports/Mapping/Project/ProjectPropertyMap.cs +++ /dev/null @@ -1,71 +0,0 @@ -using Mapster; -using Pims.Api.Areas.Reports.Models.Project; -using Pims.Api.Models; -using Pims.Dal.Entities; -using Pims.Dal.Entities.Helpers.Extensions; -using Pims.Dal.Helpers.Extensions; -using System.Linq; - -namespace Pims.Api.Areas.Reports.Mapping.Project -{ - public class ProjectPropertyMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - - config.NewConfig() - .Map(dest => dest.PropertyTypeId, - src => src.Building != null ? PropertyTypes.Building : PropertyTypes.Land) - .Map(dest => dest.Id, src => src.BuildingId ?? src.ParcelId) - .Map(dest => dest.Classification, - src => src.Building != null ? src.Building.Classification.Name : src.Parcel.Classification.Name) - .Map(dest => dest.Name, src => src.Building != null ? src.Building.Name : src.Parcel.Name) - .Map(dest => dest.Address, - src => src.Building != null - ? src.Building.Address.FormatAddress() - : src.Parcel.Address.FormatAddress()) - .Map(dest => dest.AdministrativeArea, - src => src.Building != null ? src.Building.Address.AdministrativeArea : src.Parcel.Address.AdministrativeArea) - .Map(dest => dest.Assessed, - src => src.Building != null - ? src.Building.GetCurrentEvaluation(EvaluationKeys.Assessed) - : src.Parcel.GetCurrentEvaluation(EvaluationKeys.Assessed)) - .Map(dest => dest.NetBook, - src => src.Building != null - ? src.Building.GetCurrentFiscal(FiscalKeys.NetBook) - : src.Parcel.GetCurrentFiscal(FiscalKeys.NetBook)) - .Map(dest => dest.Market, - src => src.Building != null - ? src.Building.GetCurrentFiscal(FiscalKeys.Market) - : src.Parcel.GetCurrentFiscal(FiscalKeys.Market)) - .Map(dest => dest.Zoning, src => src.Building != null ? src.Building.GetZoning().First() : src.Parcel.Zoning) - .Map(dest => dest.ZoningPotential, src => src.Building != null ? src.Building.GetZoningPotential().First() : src.Parcel.ZoningPotential) - - .Map(dest => dest.AgencyCode, - src => src.Building != null ? GetAgencyCode(src.Building.Agency) : GetAgencyCode(src.Parcel.Agency)) - .Map(dest => dest.SubAgency, - src => src.Building != null ? GetAgencyName(src.Building.Agency) : GetAgencyName(src.Parcel.Agency)) - - .Map(dest => dest.LandArea, src => src.Building != null ? GetLandArea(src.Building.Parcels.FirstOrDefault().Parcel) : GetLandArea(src.Parcel)) - .Map(dest => dest.ParcelId, src => src.Building != null ? src.Building.Parcels.FirstOrDefault().ParcelId : src.Parcel.GetId()) - .Inherits(); - - } - - private float? GetLandArea(Parcel parcel) - { - return parcel?.LandArea; - } - - private string GetAgencyCode(Agency agency) - { - return agency.Parent?.Code ?? agency.Code; - } - - private string GetAgencyName(Agency agency) - { - return agency != null ? agency.Name : ""; - } - - } -} diff --git a/backend/api/Areas/Reports/Mapping/Project/SurplusPropertyListMap.cs b/backend/api/Areas/Reports/Mapping/Project/SurplusPropertyListMap.cs deleted file mode 100644 index 1cd485809b..0000000000 --- a/backend/api/Areas/Reports/Mapping/Project/SurplusPropertyListMap.cs +++ /dev/null @@ -1,82 +0,0 @@ -using Mapster; -using Microsoft.Extensions.Options; -using Pims.Api.Mapping.Converters; -using Pims.Core.Extensions; -using Pims.Dal.Helpers.Extensions; -using System.Linq; -using System.Text.Json; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Reports.Models.Project; - -namespace Pims.Api.Areas.Reports.Mapping.Project -{ - public class SurplusPropertyListMap : IRegister - { - #region Variables - private readonly JsonSerializerOptions _serializerOptions; - #endregion - - #region Constructors - /// - /// Creates a new instance of a SurplusPropertyListMap, initializes with specified arguments. - /// - /// - public SurplusPropertyListMap(IOptions serializerOptions) - { - _serializerOptions = serializerOptions.Value; - } - #endregion - - #region Methods - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.ProjectNumber, src => src.ProjectNumber) - .Map(dest => dest.ReportedFiscalYear, src => src.ReportedFiscalYear.FiscalYear()) - .Map(dest => dest.ActualFiscalYear, src => src.ActualFiscalYear.FiscalYear()) - .Map(dest => dest.MajorActivity, src => src.Status.Name) - .Map(dest => dest.Status, src => SalesStatus(src)) // TODO: Need valid list and determine if it can be changed. - .Map(dest => dest.AgencyCode, src => AgencyConverter.ConvertAgency(src.Agency)) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.CurrentMarketValue, src => src.Market) - .Map(dest => dest.NetBookValue, src => src.NetBook) - .Map(dest => dest.Risk, src => src.Risk.Name) - .Map(dest => dest.CompletedOn, src => src.CompletedOn) - .Map(dest => dest.ItemType, src => (string)null) - .Map(dest => dest.Path, src => (string)null) - .Map(dest => dest.Manager, src => src.Manager) - .Map(dest => dest.ReportingNote, src => src.GetNoteText(Entity.NoteTypes.Reporting)) - .Map(dest => dest.FinancialNote, src => src.GetNoteText(Entity.NoteTypes.Financial)) - .Map(dest => dest.InterestFromEnhancedReferralNote, src => src.GetNoteText(Entity.NoteTypes.AgencyInterest)) - .AfterMapping((src, dest) => - { - var metadata = JsonSerializer.Deserialize(src.Metadata ?? "{}", _serializerOptions); - var priorSnapshot = src.Snapshots.Any() ? src.Snapshots.LastOrDefault() : null; - var prevMetadata = priorSnapshot != null ? JsonSerializer.Deserialize(priorSnapshot.Metadata ?? "{}", _serializerOptions) : null; - - dest.SalesCost = metadata.SalesCost; - dest.NetProceeds = metadata.NetProceeds; - dest.WeeklyIntegrityCheck = prevMetadata?.NetProceeds; - dest.BaselineIntegrityCheck = prevMetadata?.BaselineIntegrity; - dest.ProgramCost = metadata.ProgramCost; - dest.GainLoss = metadata.GainLoss; - dest.OcgFinancialStatement = metadata.OcgFinancialStatement; - dest.InterestComponent = metadata.InterestComponent; - dest.Slip = metadata.SaleWithLeaseInPlace; - dest.MarketedOn = metadata.MarketedOn; - dest.InterestedReceivedOn = metadata.InterestedReceivedOn; - }); - } - - private string SalesStatus(Entity.Project project) // TODO: Shouldn't be using hardcoded values. - { - return project.Status.Code switch - { - "SPL-CIP-C" => "Conditionally Sold", - "SPL-CIP-U" => "Unconditionally Sold", - _ => project.Status.Name - }; - } - #endregion - } -} diff --git a/backend/api/Areas/Reports/Mapping/Property/AllFieldsPropertyMap.cs b/backend/api/Areas/Reports/Mapping/Property/AllFieldsPropertyMap.cs deleted file mode 100644 index 744414c3f5..0000000000 --- a/backend/api/Areas/Reports/Mapping/Property/AllFieldsPropertyMap.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Reports.Models.AllPropertyFields; -using Pims.Core.Extensions; - -namespace Pims.Api.Areas.Reports.Mapping.AllPropertyFields -{ - public class AllFieldsPropertyMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Type, src => src.PropertyTypeId) - .Map(dest => dest.ProjectNumbers, src => src.ProjectNumbers.FormatProjectNumbers()) - .Map(dest => dest.Classification, src => src.Classification) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.Agency, src => src.Agency) - .Map(dest => dest.AgencyCode, src => src.AgencyCode) - .Map(dest => dest.SubAgency, src => src.SubAgency) - .Map(dest => dest.SubAgencyCode, src => src.SubAgencyCode) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.Province, src => src.Province) - .Map(dest => dest.AdministrativeArea, src => src.AdministrativeArea) - .Map(dest => dest.Postal, src => src.Postal) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.IsVisibleToOtherAgencies, src => src.IsVisibleToOtherAgencies) - - .Map(dest => dest.Market, src => src.Market) - .Map(dest => dest.MarketFiscalYear, src => src.MarketFiscalYear) - .Map(dest => dest.AssessedLand, src => src.AssessedLand) - .Map(dest => dest.AssessedLandDate, src => src.AssessedLandDate) - .Map(dest => dest.AssessedBuilding, src => src.AssessedBuilding) - .Map(dest => dest.AssessedBuildingDate, src => src.AssessedBuildingDate) - .Map(dest => dest.NetBook, src => src.NetBook) - .Map(dest => dest.NetBookFiscalYear, src => src.NetBookFiscalYear) - - .Map(dest => dest.PID, src => src.ParcelIdentity) - .Map(dest => dest.PIN, src => src.PIN) - .Map(dest => dest.LandArea, src => src.LandArea) - .Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription) - .Map(dest => dest.Zoning, src => src.Zoning) - - .Map(dest => dest.BuildingConstructionType, src => src.BuildingConstructionType) - .Map(dest => dest.BuildingPredominateUse, src => src.BuildingPredominateUse) - .Map(dest => dest.BuildingOccupantType, src => src.BuildingOccupantType) - .Map(dest => dest.BuildingTenancy, src => src.BuildingTenancy) - .Map(dest => dest.RentableArea, src => src.RentableArea) - .Map(dest => dest.OccupantName, src => src.OccupantName) - .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry) - .Map(dest => dest.TransferLeaseOnSale, src => src.TransferLeaseOnSale); - } - } -} diff --git a/backend/api/Areas/Reports/Mapping/Property/PropertyMap.cs b/backend/api/Areas/Reports/Mapping/Property/PropertyMap.cs deleted file mode 100644 index 356521876f..0000000000 --- a/backend/api/Areas/Reports/Mapping/Property/PropertyMap.cs +++ /dev/null @@ -1,53 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Pims.Core.Extensions; -using Model = Pims.Api.Areas.Reports.Models.Property; - -namespace Pims.Api.Areas.Reports.Mapping.Property -{ - public class PropertyMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Type, src => src.PropertyTypeId) - .Map(dest => dest.Classification, src => src.Classification) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.Ministry, src => src.AgencyCode) - .Map(dest => dest.Agency, src => src.SubAgency) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.AdministrativeArea, src => src.AdministrativeArea) - .Map(dest => dest.Postal, src => src.Postal) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - - .Map(dest => dest.AssessedLand, src => src.AssessedLand) - .Map(dest => dest.AssessedLandDate, src => src.AssessedLandDate != null ? src.AssessedLandDate.Value.Year.ToString() : "") - .Map(dest => dest.NetBookValue, src => src.NetBook) - .Map(dest => dest.NetbookDate, src => src.NetBookFiscalYear.FiscalYearNullable()) - .Map(dest => dest.AssessedBuilding, src => src.AssessedBuilding) - .Map(dest => dest.AssessedBuildingDate, src => src.AssessedBuildingDate != null ? src.AssessedBuildingDate.Value.Year.ToString() : "") - .Map(dest => dest.UpdatedOn, src => src.UpdatedOn) - .Map(dest => dest.UpdatedBy, src => src.DisplayName) - - .Map(dest => dest.PID, src => src.ParcelIdentity) - .Map(dest => dest.PIN, src => src.PIN) - .Map(dest => dest.LandArea, src => src.LandArea) - .Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription) - .Map(dest => dest.Zoning, src => src.Zoning) - - .Map(dest => dest.BuildingConstructionType, src => src.BuildingConstructionType) - .Map(dest => dest.BuildingPredominateUse, src => src.BuildingPredominateUse) - .Map(dest => dest.BuildingOccupantType, src => src.BuildingOccupantType) - .Map(dest => dest.BuildingTenancy, src => src.BuildingTenancy) - .Map(dest => dest.RentableArea, src => src.RentableArea) - .Map(dest => dest.OccupantName, src => src.OccupantName) - .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry) - .Map(dest => dest.TransferLeaseOnSale, src => src.TransferLeaseOnSale) - .Map(dest => dest.ProjectNumbers, src => src.ProjectNumbers.FormatProjectNumbers()); - - } - } -} diff --git a/backend/api/Areas/Reports/Mapping/User/UserMap.cs b/backend/api/Areas/Reports/Mapping/User/UserMap.cs deleted file mode 100644 index 5910c6f77d..0000000000 --- a/backend/api/Areas/Reports/Mapping/User/UserMap.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Mapster; -using System; -using System.Linq; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Reports.Models.User; - -namespace Pims.Api.Areas.Reports.Mapping.User -{ - public class UserMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.Username, src => src.Username) - .Map(dest => dest.Position, src => src.Position) - .Map(dest => dest.DisplayName, src => src.DisplayName) - .Map(dest => dest.FirstName, src => src.FirstName) - .Map(dest => dest.MiddleName, src => src.MiddleName) - .Map(dest => dest.LastName, src => src.LastName) - .Map(dest => dest.Email, src => src.Email) - .Map(dest => dest.Note, src => src.Note) - .Map(dest => dest.Agencies, src => String.Join(",", src.Agencies.Select(a => a.Agency.Name))) - .Map(dest => dest.Roles, src => String.Join(",", src.Roles.Select(a => a.Role.Name))) - .Map(dest => dest.LastLogin, src => src.LastLogin) - .Map(dest => dest.ApprovedBy, src => src.ApprovedBy != null ? src.ApprovedBy.DisplayName : null) - .Map(dest => dest.ApprovedOn, src => src.ApprovedOn); - } - } -} diff --git a/backend/api/Areas/Reports/Models/Project/ProjectModel.cs b/backend/api/Areas/Reports/Models/Project/ProjectModel.cs deleted file mode 100644 index a50b67706a..0000000000 --- a/backend/api/Areas/Reports/Models/Project/ProjectModel.cs +++ /dev/null @@ -1,306 +0,0 @@ -using System; -using System.ComponentModel; - -namespace Pims.Api.Areas.Reports.Models.Project -{ - /// - /// ProjectModel class, provides a model to represent the project. - /// - public class ProjectModel - { - #region Properties - /// - /// get/set - A unique project number to identify the project. - /// - public string ProjectNumber { get; set; } - - /// - /// get/set - The name to identify the project. - /// - public string Name { get; set; } - - /// - /// get/set - The project description. - /// - public string Description { get; set; } - - /// - /// get/set - The reported fiscal year this project. - /// - public int ReportedFiscalYear { get; set; } - - /// - /// get/set - The reported fiscal year this project. - /// - public string ReportedFiscalYearString { get; set; } - - /// - /// get/set - The actual or forecasted fiscal year. - /// - public int ActualFiscalYear { get; set; } - - /// - /// get/set - The actual or forecasted fiscal year. - /// - public string ActualFiscalYearString { get; set; } - - /// - /// get/set - The current workflow code. - /// - public string WorkflowCode { get; set; } - - /// - /// get/set - The current status code. - /// - public string StatusCode { get; set; } - - /// - /// get/set - The status label. - /// - public string Status { get; set; } - - /// - /// get/set - The tier level of the project. - /// - public string TierLevel { get; set; } - - /// - /// get/set - The project risk. - /// - public string Risk { get; set; } - - /// - /// get/set - The parent agency acronym. - /// - public string Ministry { get; set; } - - /// - /// get/set - The owning agency full name. - /// - public string Agency { get; set; } - - /// - /// get/set - User name - /// - public string UpdatedBy { get; set; } - - /// - /// get/set - When the project was last updated. - /// - public DateTime? UpdatedOn { get; set; } - - /// - /// get/set - User name - /// - public string CreatedBy { get; set; } - - /// - /// get/set - when the project was created. - /// - public DateTime CreatedOn { get; set; } - - #region Exemption - /// - /// get/set - Whether an exemption was requested for the ERP. - /// - public bool ExemptionRequested { get; set; } - - /// - /// get/set - The rational for the exemption from ERP. - /// - public string ExemptionRationale { get; set; } - #endregion - - #region Financial - /// - /// get/set - The netbook value. - /// - public decimal NetBook { get; set; } - - /// - /// get/set - The market value. - /// - public decimal Market { get; set; } - - /// - /// get/set - The assessed value. - /// - public decimal Assessed { get; set; } - - /// - /// get/set - The appraised value. - /// - public decimal Appraised { get; set; } - - /// - /// get/set - The sales cost. - /// - public decimal? SalesCost { get; set; } // TODO: Move to metadata property. - - /// - /// get/set - The net proceeds - /// - public decimal? NetProceeds { get; set; } // TODO: Move to metadata property. - - /// - /// get/set - The program cost. - /// - public decimal? ProgramCost { get; set; } // TODO: Move to metadata property. - - /// - /// get/set - The gain or loss from selling the properties. - /// - public decimal? GainLoss { get; set; } // TODO: Move to metadata property. - - /// - /// get/set - OCG final statement. - /// - public decimal? OcgFinancialStatement { get; set; } // TODO: Move to metadata property. - - /// - /// get/set - Record the interest component. - /// - public decimal? InterestComponent { get; set; } // TODO: Move to metadata property. - - /// - /// get/set - Amount offered during SPL - /// - public decimal? OfferAmount { get; set; } - - /// - /// get/set - Whether the sale includes a lease in place (SLIP). - /// - public bool? SaleWithLeaseInPlace { get; set; } // TODO: Move to metadata property. - #endregion - - #region Notes - /// - /// get/set - The project note. - /// - public string Note { get; set; } - - /// - /// get/set - The project note. - /// - public string PublicNote { get; set; } - - /// - /// get/set - The project note. - /// - public string PrivateNote { get; set; } - - /// - /// get/set - The appraised note - /// - public string AppraisedNote { get; set; } - - /// - /// get/set - Note summerizing agency responses to notifications. - /// - public string AgencyResponseNote { get; set; } - #endregion - - #region Dates - /// - /// get/set - When the project was submitted. - /// - public DateTime? SubmittedOn { get; set; } - - /// - /// get/set - When the project was approved. - /// - public DateTime? ApprovedOn { get; set; } - - /// - /// get/set - When the initial enhanced referral notification was sent. - /// - [DisplayName("ERP_Initial_Notification_Sent_On")] - [CsvHelper.Configuration.Attributes.Name("ERP_Initial_Notification_Sent_On")] - public DateTime? InitialNotificationSentOn { get; set; } - - /// - /// get/set - When the 30 day enhanced referral notification was sent. - /// - [DisplayName("ERP_Thirty_Day_Notification_Sent_On")] - [CsvHelper.Configuration.Attributes.Name("ERP_Thirty_Day_Notification_Sent_On")] - public DateTime? ThirtyDayNotificationSentOn { get; set; } - - /// - /// get/set - When the 60 day enhanced referral notification was sent. - /// - [DisplayName("ERP_Sixty_Day_Notification_Sent_On")] - [CsvHelper.Configuration.Attributes.Name("ERP_Sixty_Day_Notification_Sent_On")] - public DateTime? SixtyDayNotificationSentOn { get; set; } - - /// - /// get/set - When the 90 day enhanced referral notification was sent. - /// - [DisplayName("ERP_Ninety_Day_Notification_Sent_On")] - [CsvHelper.Configuration.Attributes.Name("ERP_Ninty_Day_Notification_Sent_On")] - public DateTime? NinetyDayNotificationSentOn { get; set; } - - /// - /// get/set - When the on hold enhanced referral notification was sent. - /// - [DisplayName("ERP_On_Hold_Notification_Sent_On")] - [CsvHelper.Configuration.Attributes.Name("ERP_On_Hold_Notification_Sent_On")] - public DateTime? OnHoldNotificationSentOn { get; set; } - - /// - /// get/set - When the project was transferred within the GRE. - /// - public DateTime? TransferredWithinGreOn { get; set; } - - /// - /// get/set - When the clearance enhanced referral notification was sent. - /// - [DisplayName("ERP_Clearance_Notification_Sent_On")] - [CsvHelper.Configuration.Attributes.Name("ERP_Clearance_Notification_Sent_On")] - public DateTime? ClearanceNotificationSentOn { get; set; } - - /// - /// get/set - When the project was denied. - /// - public DateTime? DeniedOn { get; set; } - - /// - /// get/set - When the project was cancelled. - /// - public DateTime? CancelledOn { get; set; } - - /// - /// get/set - When the project was disposed. - /// - public DateTime? DisposedOn { get; set; } - - /// - /// get/set - When the project was completed. - /// - public DateTime? CompletedOn { get; set; } - #endregion - - #region SPL - /// - /// get/set - When the project was externally marketed. - /// - public DateTime? MarketedOn { get; set; } // TODO: Move to metadata property. - - - /// - /// get/set - Note summerizing offers received. - /// - public string OffersNote { get; set; } - - /// - /// get/set - Text field describing project purchaser. - /// - public string Purchaser { get; set; } - - /// - /// get/set - Whether or not the contract for the project is conditional - /// - public bool? IsContractConditional { get; set; } - #endregion - #endregion - } -} diff --git a/backend/api/Areas/Reports/Models/Project/ProjectModelExcel.cs b/backend/api/Areas/Reports/Models/Project/ProjectModelExcel.cs deleted file mode 100644 index 3517c10361..0000000000 --- a/backend/api/Areas/Reports/Models/Project/ProjectModelExcel.cs +++ /dev/null @@ -1,316 +0,0 @@ -using System; -using System.ComponentModel; - -namespace Pims.Api.Areas.Reports.Models.Project -{ - /// - /// ProjectModel class, provides a model to represent the project. - /// - public class ProjectModelExcel - { - #region Properties - /// - /// get/set - A unique project number to identify the project. - /// - public string ProjectNumber { get; set; } - - /// - /// get/set - The name to identify the project. - /// - public string Location { get; set; } - - /// - /// get/set - The name to identify the project. - /// - public string PID { get; set; } - - /// - /// get/set - The name to identify the project. - /// - public float LotSize { get; set; } - - /// - /// get/set - The name to identify the project. - /// - public string Name { get; set; } - - /// - /// get/set - The project description. - /// - public string Description { get; set; } - - /// - /// get/set - The reported fiscal year this project. - /// - - [DisplayName("Reported Fiscal Year")] - [CsvHelper.Configuration.Attributes.Name("Reported Fiscal Year")] - public string ReportedFiscalYearString { get; set; } - - /// - /// get/set - The actual or forecasted fiscal year. - /// - - [DisplayName("Actual Fiscal Year")] - [CsvHelper.Configuration.Attributes.Name("Actual Fiscal Year")] - public string ActualFiscalYearString { get; set; } - - /// - /// get/set - The current workflow code. - /// - public string WorkflowCode { get; set; } - - /// - /// get/set - The current status code. - /// - public string StatusCode { get; set; } - - /// - /// get/set - The status label. - /// - public string Status { get; set; } - - /// - /// get/set - The tier level of the project. - /// - public string TierLevel { get; set; } - - /// - /// get/set - The project risk. - /// - public string Risk { get; set; } - - /// - /// get/set - The parent agency acronym. - /// - public string Ministry { get; set; } - - /// - /// get/set - The owning agency full name. - /// - public string Agency { get; set; } - - /// - /// get/set - User name - /// - public string UpdatedBy { get; set; } - - /// - /// get/set - When the project was last updated. - /// - public DateTime? UpdatedOn { get; set; } - - /// - /// get/set - User name - /// - public string CreatedBy { get; set; } - - /// - /// get/set - when the project was created. - /// - public DateTime CreatedOn { get; set; } - - #region Exemption - /// - /// get/set - Whether an exemption was requested for the ERP. - /// - public bool ExemptionRequested { get; set; } - - /// - /// get/set - The rational for the exemption from ERP. - /// - public string ExemptionRationale { get; set; } - #endregion - - #region Financial - /// - /// get/set - The netbook value. - /// - public decimal NetBook { get; set; } - - /// - /// get/set - The market value. - /// - public decimal Market { get; set; } - - /// - /// get/set - The assessed value. - /// - public decimal Assessed { get; set; } - - /// - /// get/set - The appraised value. - /// - public decimal Appraised { get; set; } - - /// - /// get/set - The sales cost. - /// - public decimal? SalesCost { get; set; } // TODO: Move to metadata property. - - /// - /// get/set - The net proceeds - /// - public decimal? NetProceeds { get; set; } // TODO: Move to metadata property. - - /// - /// get/set - The program cost. - /// - public decimal? ProgramCost { get; set; } // TODO: Move to metadata property. - - /// - /// get/set - The gain or loss from selling the properties. - /// - public decimal? GainLoss { get; set; } // TODO: Move to metadata property. - - /// - /// get/set - OCG final statement. - /// - public decimal? OcgFinancialStatement { get; set; } // TODO: Move to metadata property. - - /// - /// get/set - Record the interest component. - /// - public decimal? InterestComponent { get; set; } // TODO: Move to metadata property. - - /// - /// get/set - Amount offered during SPL - /// - public decimal? OfferAmount { get; set; } - - /// - /// get/set - Whether the sale includes a lease in place (SLIP). - /// - public bool? SaleWithLeaseInPlace { get; set; } // TODO: Move to metadata property. - #endregion - - #region Notes - /// - /// get/set - The project note. - /// - public string Note { get; set; } - - /// - /// get/set - The project note. - /// - public string PublicNote { get; set; } - - /// - /// get/set - The project note. - /// - public string PrivateNote { get; set; } - - /// - /// get/set - The appraised note - /// - public string AppraisedNote { get; set; } - - /// - /// get/set - Note summerizing agency responses to notifications. - /// - public string AgencyResponseNote { get; set; } - #endregion - - #region Dates - /// - /// get/set - When the project was submitted. - /// - public DateTime? SubmittedOn { get; set; } - - /// - /// get/set - When the project was approved. - /// - public DateTime? ApprovedOn { get; set; } - - /// - /// get/set - When the initial enhanced referral notification was sent. - /// - [DisplayName("ERP_Initial_Notification_Sent_On")] - [CsvHelper.Configuration.Attributes.Name("ERP_Initial_Notification_Sent_On")] - public DateTime? InitialNotificationSentOn { get; set; } - - /// - /// get/set - When the 30 day enhanced referral notification was sent. - /// - [DisplayName("ERP_Thirty_Day_Notification_Sent_On")] - [CsvHelper.Configuration.Attributes.Name("ERP_Thirty_Day_Notification_Sent_On")] - public DateTime? ThirtyDayNotificationSentOn { get; set; } - - /// - /// get/set - When the 60 day enhanced referral notification was sent. - /// - [DisplayName("ERP_Sixty_Day_Notification_Sent_On")] - [CsvHelper.Configuration.Attributes.Name("ERP_Sixty_Day_Notification_Sent_On")] - public DateTime? SixtyDayNotificationSentOn { get; set; } - - /// - /// get/set - When the 90 day enhanced referral notification was sent. - /// - [DisplayName("ERP_Ninety_Day_Notification_Sent_On")] - [CsvHelper.Configuration.Attributes.Name("ERP_Ninty_Day_Notification_Sent_On")] - public DateTime? NinetyDayNotificationSentOn { get; set; } - - /// - /// get/set - When the on hold enhanced referral notification was sent. - /// - [DisplayName("ERP_On_Hold_Notification_Sent_On")] - [CsvHelper.Configuration.Attributes.Name("ERP_On_Hold_Notification_Sent_On")] - public DateTime? OnHoldNotificationSentOn { get; set; } - - /// - /// get/set - When the project was transferred within the GRE. - /// - public DateTime? TransferredWithinGreOn { get; set; } - - /// - /// get/set - When the clearance enhanced referral notification was sent. - /// - [DisplayName("ERP_Clearance_Notification_Sent_On")] - [CsvHelper.Configuration.Attributes.Name("ERP_Clearance_Notification_Sent_On")] - public DateTime? ClearanceNotificationSentOn { get; set; } - - /// - /// get/set - When the project was denied. - /// - public DateTime? DeniedOn { get; set; } - - /// - /// get/set - When the project was cancelled. - /// - public DateTime? CancelledOn { get; set; } - - /// - /// get/set - When the project was disposed. - /// - public DateTime? DisposedOn { get; set; } - - /// - /// get/set - When the project was completed. - /// - public DateTime? CompletedOn { get; set; } - #endregion - - #region SPL - /// - /// get/set - When the project was externally marketed. - /// - public DateTime? MarketedOn { get; set; } // TODO: Move to metadata property. - - /// - /// get/set - Note summerizing offers received. - /// - public string OffersNote { get; set; } - - /// - /// get/set - Text field describing project purchaser. - /// - public string Purchaser { get; set; } - - /// - /// get/set - Whether or not the contract for the project is conditional - /// - public bool? IsContractConditional { get; set; } - #endregion - #endregion - } -} diff --git a/backend/api/Areas/Reports/Models/Project/ProjectPropertyModel.cs b/backend/api/Areas/Reports/Models/Project/ProjectPropertyModel.cs deleted file mode 100644 index ed9234852c..0000000000 --- a/backend/api/Areas/Reports/Models/Project/ProjectPropertyModel.cs +++ /dev/null @@ -1,95 +0,0 @@ -using Pims.Api.Models; - -namespace Pims.Api.Areas.Reports.Models.Project -{ - public class ProjectPropertyModel : BaseModel - { - #region Properties - /// - /// get/set - The primary key to identify the property. - /// - public int Id { get; set; } - - /// - /// get/set - The foreign key to the property type [Land, Building]. - /// - public int PropertyTypeId { get; set; } - - /// - /// get/set - property name. - /// - public string Name { get; set; } - - /// - /// get/set - The classification of the property. - /// - public string Classification { get; set; } - - /// - /// get/set - The foreign key to the owning agency. - /// - public int AgencyId { get; set; } - - /// - /// get/set - The owning agency name. - /// - public string Agency { get; set; } - - /// - /// get/set - The owning sub agency name. - /// - public string SubAgency { get; set; } - - /// - /// get/set - The owning agency code. - /// - public string AgencyCode { get; set; } - - /// - /// get/set - The address of the property. - /// - public string Address { get; set; } - - /// - /// get/set - The name of the administrative area (city, municipality, district, etc.). - /// - public string AdministrativeArea { get; set; } - - /// - /// get/set - The property netbook value. - /// - public decimal? NetBook { get; set; } - - /// - /// get/set - The property assessed value. - /// - public decimal? Assessed { get; set; } - - /// - /// get/set - The property market value. - /// - public decimal? Market { get; set; } - - /// - /// get/set - The land area of the parcel. - /// - public float LandArea { get; set; } - - - /// - /// get/set - The id of the parcel. - /// - public float ParcelId { get; set; } - - /// - /// get/set - The property zoning - /// - public string Zoning { get; set; } - - /// - /// get/set - The property zoning potential - /// - public string ZoningPotential { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Reports/Models/Project/SurplusPropertyListModel.cs b/backend/api/Areas/Reports/Models/Project/SurplusPropertyListModel.cs deleted file mode 100644 index 2723e73a1b..0000000000 --- a/backend/api/Areas/Reports/Models/Project/SurplusPropertyListModel.cs +++ /dev/null @@ -1,134 +0,0 @@ -using System; -using System.ComponentModel; - -namespace Pims.Api.Areas.Reports.Models.Project -{ - /// - /// SurplusPropertyListModel class, provides a model to represent the project. - /// - public class SurplusPropertyListModel - { - #region Properties - /// - /// get/set - A unique project number to identify the project. - /// - [DisplayName("RAEG#")] - [CsvHelper.Configuration.Attributes.Name("RAEG#")] - public string ProjectNumber { get; set; } - - /// - /// get/set - The actual fiscal year this project was completed, or the forecasted. - /// - [DisplayName("FY")] - [CsvHelper.Configuration.Attributes.Name("FY")] - public string ActualFiscalYear { get; set; } - - [DisplayName("Major_Activity")] - [CsvHelper.Configuration.Attributes.Name("Major_Activity")] - public string MajorActivity { get; set; } - - [DisplayName("Sales_Status")] - [CsvHelper.Configuration.Attributes.Name("Sales_Status")] - public string Status { get; set; } - - [DisplayName("Sector")] - [CsvHelper.Configuration.Attributes.Name("Sector")] - public string AgencyCode { get; set; } - - [DisplayName("Description")] - [CsvHelper.Configuration.Attributes.Name("Description")] - public string Name { get; set; } - - [DisplayName("CMV")] - [CsvHelper.Configuration.Attributes.Name("CMV")] - public decimal CurrentMarketValue { get; set; } - - [DisplayName("NBV")] - [CsvHelper.Configuration.Attributes.Name("NBV")] - public decimal NetBookValue { get; set; } - - [DisplayName("Sales_Cost")] - [CsvHelper.Configuration.Attributes.Name("Sales_Cost")] - public decimal? SalesCost { get; set; } - - [DisplayName("Net_Proceeds")] - [CsvHelper.Configuration.Attributes.Name("Net_Proceeds")] - public decimal? NetProceeds { get; set; } - - [DisplayName("Baseline_Integrity_Check")] - [CsvHelper.Configuration.Attributes.Name("Baseline_Integrity_Check")] - public decimal? BaselineIntegrityCheck { get; set; } - - [DisplayName("Status")] - [CsvHelper.Configuration.Attributes.Name("Status")] - public string Risk { get; set; } - - [DisplayName("Marketing_Start")] - [CsvHelper.Configuration.Attributes.Name("Marketing_Start")] - public DateTime? MarketedOn { get; set; } - - [DisplayName("Comp_Date")] - [CsvHelper.Configuration.Attributes.Name("Comp_Date")] - public DateTime? CompletedOn { get; set; } - - [DisplayName("Comment_Weekly_Review")] - [CsvHelper.Configuration.Attributes.Name("Comment_Weekly_Review")] - public string ReportingNote { get; set; } - - [DisplayName("Item Type")] - [CsvHelper.Configuration.Attributes.Name("Item Type")] - public string ItemType { get; set; } - - [DisplayName("Path")] - [CsvHelper.Configuration.Attributes.Name("Path")] - public string Path { get; set; } - - [DisplayName("Weekly_Integrity_Check")] - [CsvHelper.Configuration.Attributes.Name("Weekly_Integrity_Check")] - public decimal? WeeklyIntegrityCheck { get; set; } - - [DisplayName("Program_Cost")] - [CsvHelper.Configuration.Attributes.Name("Program_Cost")] - public decimal? ProgramCost { get; set; } - - [DisplayName("Gain_(Loss)")] - [CsvHelper.Configuration.Attributes.Name("Gain_(Loss)")] - public decimal? GainLoss { get; set; } - - [DisplayName("OCG_Fin_Stmts")] - [CsvHelper.Configuration.Attributes.Name("OCG_Fin_Stmts")] - public decimal? OcgFinancialStatement { get; set; } - - [DisplayName("Interest_Component")] - [CsvHelper.Configuration.Attributes.Name("Interest_Component")] - public decimal? InterestComponent { get; set; } - - /// - /// get/set - The reported fiscal year this project. - /// - [DisplayName("Rpt_FY")] - [CsvHelper.Configuration.Attributes.Name("Rpt_FY")] - public string ReportedFiscalYear { get; set; } - - [DisplayName("SLIP")] - [CsvHelper.Configuration.Attributes.Name("SLIP")] - public bool Slip { get; set; } - - [DisplayName("Manager")] - [CsvHelper.Configuration.Attributes.Name("Manager")] - public string Manager { get; set; } - - [DisplayName("Financial_Notes")] - [CsvHelper.Configuration.Attributes.Name("Financial_Notes")] - public string FinancialNote { get; set; } - - [DisplayName("Interest from Enhanced Referral")] - [CsvHelper.Configuration.Attributes.Name("Interest from Enhanced Referral")] - public string InterestFromEnhancedReferralNote { get; set; } - - [DisplayName("Date of Interest Rcvd")] - [CsvHelper.Configuration.Attributes.Name("Date of Interest Rcvd")] - public DateTime? InterestedReceivedOn { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Reports/Models/Property/AllFieldsPropertyModel.cs b/backend/api/Areas/Reports/Models/Property/AllFieldsPropertyModel.cs deleted file mode 100644 index 6a6c28cb5c..0000000000 --- a/backend/api/Areas/Reports/Models/Property/AllFieldsPropertyModel.cs +++ /dev/null @@ -1,277 +0,0 @@ -using Pims.Dal.Entities; -using System; -using System.ComponentModel; - -namespace Pims.Api.Areas.Reports.Models.AllPropertyFields -{ - public class AllFieldsPropertyModel - { - #region Properties - /// - /// get/set - The type of property [Land, Building]. - /// - /// - public PropertyTypes Type { get; set; } - - /// - /// get/set - The status of the property. - /// - public string Status { get; set; } - - /// - /// get/set - The project number - /// - [DisplayName("Project Number")] - [CsvHelper.Configuration.Attributes.Name("Project Number")] - public string ProjectNumbers { get; set; } - - /// - /// get/set - The current classification. - /// - public string Classification { get; set; } - - /// - /// get/set - The name of the property. - /// - public string Name { get; set; } - - /// - /// get/set - A description of the property. - /// - public string Description { get; set; } - - /// - /// get/set - The owning agency full name. - /// - public string Agency { get; set; } - - /// - /// get/set - The owning agency code. - /// - [DisplayName("Agency Code")] - [CsvHelper.Configuration.Attributes.Name("Agency Code")] - public string AgencyCode { get; set; } - - /// - /// get/set - The sub-agency full name. - /// - [DisplayName("Sub Agency")] - [CsvHelper.Configuration.Attributes.Name("Sub Agency")] - public string SubAgency { get; set; } - - /// - /// get/set - The sub-agency code. - /// - [DisplayName("Sub Agency Code")] - [CsvHelper.Configuration.Attributes.Name("Sub Agency Code")] - public string SubAgencyCode { get; set; } - - /// - /// get/set - The civic address of the property. - /// - public string Address { get; set; } - - /// - /// get/set - The location of the property (city, municipality, district, etc) - /// - [DisplayName("Location")] - [CsvHelper.Configuration.Attributes.Name("Location")] - public string AdministrativeArea { get; set; } - - /// - /// get/set - The province of the property - /// - public string Province { get; set; } - - /// - /// get/set - The postal code. - /// - public string Postal { get; set; } - - /// - /// get/set - The latitude location. - /// - public double Latitude { get; set; } - - /// - /// get/set - The longitude location. - /// - public double Longitude { get; set; } - - /// - /// get/set - Whether the property is sensitive. - /// - [DisplayName("Sensitive")] - [CsvHelper.Configuration.Attributes.Name("Sensitive")] - public bool IsSensitive { get; set; } - - /// - /// get/set - Whether the property is visible to other agencies outside the owning one. - /// - [DisplayName("Visible to Other Agencies")] - [CsvHelper.Configuration.Attributes.Name("Visible to Other Agencies")] - public bool IsVisibleToOtherAgencies { get; set; } - - #region Financials - /// - /// get/set - The most recent assessed land value. - /// - [DisplayName("Assessed Land Value")] - [CsvHelper.Configuration.Attributes.Name("Assessed Land Value")] - public decimal? AssessedLand { get; set; } - - /// - /// get/set - When the most recent assessment was taken. - /// - [DisplayName("Assessed Land Date")] - [CsvHelper.Configuration.Attributes.Name("Assessed Land Date")] - public DateTime? AssessedLandDate { get; set; } - - /// - /// get/set - The most recent assessed building value. - /// - [DisplayName("Assessed Building Value")] - [CsvHelper.Configuration.Attributes.Name("Assessed Building Value")] - public decimal? AssessedBuilding { get; set; } - - /// - /// get/set - When the most recent assessment was taken. - /// - [DisplayName("Assessed Building Date")] - [CsvHelper.Configuration.Attributes.Name("Assessed Building Date")] - public DateTime? AssessedBuildingDate { get; set; } - - /// - /// get/set - The most recent market value. - /// - [DisplayName("Market Value")] - [CsvHelper.Configuration.Attributes.Name("Market Value")] - public decimal Market { get; set; } - - /// - /// get/set - The fiscal year for the market value. - /// - [DisplayName("Market Fiscal Year")] - [CsvHelper.Configuration.Attributes.Name("Market Fiscal Year")] - public int? MarketFiscalYear { get; set; } - - /// - /// get/set - The most recent netbook value. - /// - [DisplayName("Net Book Value")] - [CsvHelper.Configuration.Attributes.Name("Net Book Value")] - public decimal? NetBook { get; set; } - - /// - /// get/set - The fiscal year netbook value. - /// - [DisplayName("Net Book Fiscal Year")] - [CsvHelper.Configuration.Attributes.Name("Net Book Fiscal Year")] - public int? NetBookFiscalYear { get; set; } - #endregion - - #region Parcel Properties - /// - /// get/set - The parcel PID. - /// - public string PID { get; set; } - - /// - /// get/set - The PIN if the parcel is not titled. - /// - public int? PIN { get; set; } - - /// - /// get/set - The land area. - /// - [DisplayName("Land Area")] - [CsvHelper.Configuration.Attributes.Name("Land Area")] - public float LandArea { get; set; } - - /// - /// get/set - The land legal description. - /// - [DisplayName("Legal Description")] - [CsvHelper.Configuration.Attributes.Name("Legal Description")] - public string LandLegalDescription { get; set; } - - /// - /// get/set - The current zoning. - /// - public string Zoning { get; set; } - - /// - /// get/set - Potential future Parcel zoning information - /// - [DisplayName("Zoning Potential")] - [CsvHelper.Configuration.Attributes.Name("Zoning Potential")] - public string ZoningPotential { get; set; } - #endregion - - #region Building Properties - /// - /// get/set - The building construction type. - /// - [DisplayName("Construction Type")] - [CsvHelper.Configuration.Attributes.Name("Construction Type")] - public string BuildingConstructionType { get; set; } - - /// - /// get/set - The parent parcel Id. - /// - [DisplayName("Parcel Id")] - [CsvHelper.Configuration.Attributes.Name("Parcel Id")] - public int? ParcelId { get; set; } - - /// - /// get/set - The building predominate use. - /// - [DisplayName("Predominate Use")] - [CsvHelper.Configuration.Attributes.Name("Predominate Use")] - public string BuildingPredominateUse { get; set; } - - /// - /// get/set - The building occupant type. - /// - [DisplayName("Occupant Type")] - [CsvHelper.Configuration.Attributes.Name("Occupant Type")] - public string BuildingOccupantType { get; set; } - - /// - /// get/set - The building tenancy. - /// - [DisplayName("Tenancy")] - [CsvHelper.Configuration.Attributes.Name("Tenancy")] - public string BuildingTenancy { get; set; } - - /// - /// get/set - The building rentable area. - /// - [DisplayName("Rentable Area")] - [CsvHelper.Configuration.Attributes.Name("Rentable Area")] - public float RentableArea { get; set; } - - /// - /// get/set - The building occupant name. - /// - [DisplayName("Occupant")] - [CsvHelper.Configuration.Attributes.Name("Occupant")] - public string OccupantName { get; set; } - - /// - /// get/set - The building lease expiry date. - /// - [DisplayName("Lease Expiry")] - [CsvHelper.Configuration.Attributes.Name("Lease Expiry")] - public DateTime? LeaseExpiry { get; set; } - - /// - /// get/set - Whether the lease on the building will transfer on sale. - /// - [DisplayName("Transfer Lease on Sale")] - [CsvHelper.Configuration.Attributes.Name("Transfer Lease on Sale")] - public bool TransferLeaseOnSale { get; set; } - #endregion - #endregion - } -} diff --git a/backend/api/Areas/Reports/Models/Property/PropertyModel.cs b/backend/api/Areas/Reports/Models/Property/PropertyModel.cs deleted file mode 100644 index c3ec9c5211..0000000000 --- a/backend/api/Areas/Reports/Models/Property/PropertyModel.cs +++ /dev/null @@ -1,233 +0,0 @@ -using Pims.Dal.Entities; -using System; -using System.ComponentModel; - -namespace Pims.Api.Areas.Reports.Models.Property -{ - public class PropertyModel - { - #region Properties - /// - /// get/set - The type of property [Land, Building]. - /// - /// - public PropertyTypes Type { get; set; } - - /// - /// get/set - The status of the property. - /// - public string Status { get; set; } - - /// - /// get/set - The current classification. - /// - public string Classification { get; set; } - - /// - /// get/set - The name of the property. - /// - public string Name { get; set; } - - /// - /// get/set - A description of the property. - /// - public string Description { get; set; } - - /// - /// get/set - The parent agency acronym. - /// - public string Ministry { get; set; } - - /// - /// get/set - The owning agency full name. - /// - public string Agency { get; set; } - - /// - /// get/set - The civic address of the property. - /// - public string Address { get; set; } - - /// - /// get/set - The location of the property (city, municipality, district, etc) - /// - [DisplayName("Location")] - [CsvHelper.Configuration.Attributes.Name("Location")] - public string AdministrativeArea { get; set; } - - /// - /// get/set - The postal code. - /// - public string Postal { get; set; } - - /// - /// get/set - The latitude location. - /// - public double Latitude { get; set; } - - /// - /// get/set - The longitude location. - /// - public double Longitude { get; set; } - - /// - /// get/set - Whether the property is sensitive. - /// - [DisplayName("Sensitive")] - [CsvHelper.Configuration.Attributes.Name("Sensitive")] - public bool IsSensitive { get; set; } - - /// - /// get/set - The date the property was last updated on. - /// - [DisplayName("Last Updated On")] - [CsvHelper.Configuration.Attributes.Name("Last Updated On")] - public DateTime? UpdatedOn { get; set; } - - /// - /// get/set - Who had last updated the property record - /// - [DisplayName("Updated By")] - [CsvHelper.Configuration.Attributes.Name("Updated By")] - public string UpdatedBy { get; set; } - - /// - /// get/set - The most recent assessed land value. - /// - [DisplayName("Assessed Land Value")] - [CsvHelper.Configuration.Attributes.Name("Assessed Land Value")] - public decimal? AssessedLand { get; set; } - - /// - /// get/set - The most recent assessed land year. - /// - [DisplayName("Land Assessment Year")] - [CsvHelper.Configuration.Attributes.Name("Land Assessment Year")] - public string AssessedLandDate { get; set; } - - /// - /// get/set - The most recent net book land value. - /// - [DisplayName("Netbook Value")] - [CsvHelper.Configuration.Attributes.Name("Netbook Value")] - public decimal? NetBookValue { get; set; } - - /// - /// get/set - The most recent netbook land value date. - /// - [DisplayName("Netbook Date")] - [CsvHelper.Configuration.Attributes.Name("Netbook Date")] - public string NetbookDate { get; set; } - /// - /// get/set - The most recent assessed building value. - /// - [DisplayName("Assessed Building Value")] - [CsvHelper.Configuration.Attributes.Name("Assessed Building Value")] - public decimal? AssessedBuilding { get; set; } - - /// - /// get/set - The most recent assessed building year. - /// - [DisplayName("Building Assessment Year")] - [CsvHelper.Configuration.Attributes.Name("Building Assessment Year")] - public string AssessedBuildingDate { get; set; } - - #region Parcel Properties - /// - /// get/set - The parcel PID. - /// - public string PID { get; set; } - - /// - /// get/set - The PIN if the parcel is not titled. - /// - public int? PIN { get; set; } - - /// - /// get/set - The land area. - /// - [DisplayName("Land Area")] - [CsvHelper.Configuration.Attributes.Name("Land Area")] - public float LandArea { get; set; } - - /// - /// get/set - The land legal description. - /// - [DisplayName("Legal Description")] - [CsvHelper.Configuration.Attributes.Name("Legal Description")] - public string LandLegalDescription { get; set; } - - /// - /// get/set - The current zoning. - /// - public string Zoning { get; set; } - #endregion - - #region Building Properties - /// - /// get/set - The building construction type. - /// - [DisplayName("Construction Type")] - [CsvHelper.Configuration.Attributes.Name("Construction Type")] - public string BuildingConstructionType { get; set; } - - /// - /// get/set - The building predominate use. - /// - [DisplayName("Predominate Use")] - [CsvHelper.Configuration.Attributes.Name("Predominate Use")] - public string BuildingPredominateUse { get; set; } - - /// - /// get/set - The building occupant type. - /// - [DisplayName("Occupant Type")] - [CsvHelper.Configuration.Attributes.Name("Occupant Type")] - public string BuildingOccupantType { get; set; } - - /// - /// get/set - The building tenancy. - /// - [DisplayName("Tenancy")] - [CsvHelper.Configuration.Attributes.Name("Tenancy")] - public string BuildingTenancy { get; set; } - - /// - /// get/set - The building rentable area. - /// - [DisplayName("Rentable Area")] - [CsvHelper.Configuration.Attributes.Name("Rentable Area")] - public float RentableArea { get; set; } - - /// - /// get/set - The building occupant name. - /// - [DisplayName("Occupant")] - [CsvHelper.Configuration.Attributes.Name("Occupant")] - public string OccupantName { get; set; } - - /// - /// get/set - The building lease expiry date. - /// - [DisplayName("Lease Expiry")] - [CsvHelper.Configuration.Attributes.Name("Lease Expiry")] - public DateTime? LeaseExpiry { get; set; } - - /// - /// get/set - Whether the lease on the building will transfer on sale. - /// - [DisplayName("Transfer Lease on Sale")] - [CsvHelper.Configuration.Attributes.Name("Transfer Lease on Sale")] - public bool TransferLeaseOnSale { get; set; } - - /// - /// get/set - The project number - /// - [DisplayName("Project Number")] - [CsvHelper.Configuration.Attributes.Name("Project Number")] - public string ProjectNumbers { get; set; } - - #endregion - #endregion - } -} diff --git a/backend/api/Areas/Reports/Models/User/UserModel.cs b/backend/api/Areas/Reports/Models/User/UserModel.cs deleted file mode 100644 index 20b96558c9..0000000000 --- a/backend/api/Areas/Reports/Models/User/UserModel.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System; - -namespace Pims.Api.Areas.Reports.Models.User -{ - /// - /// UserModel class, provides a model that represents a user. - /// - public class UserModel - { - #region Properties - /// - /// get/set - The user's unique identifier. - /// - public Guid Id { get; set; } - - /// - /// get/set - The user's unique identity. - /// - public string Username { get; set; } - - /// - /// get/set - The user's position title. - /// - public string Position { get; set; } - - /// - /// get/set - The user's display name. - /// - public string DisplayName { get; set; } - - /// - /// get/set - The user's given name. - /// - public string FirstName { get; set; } - - /// - /// get/set - The user's middlename. - /// - public string MiddleName { get; set; } - - /// - /// get/set - The user's surname. - /// - public string LastName { get; set; } - - /// - /// get/set - The user's email. - /// - public string Email { get; set; } - - /// - /// get/set - Whether the user is disabled. - /// - /// - public bool IsDisabled { get; set; } - - /// - /// get/set - Whether the email has been verified. - /// - /// - public bool EmailVerified { get; set; } - - /// - /// get/set - A note about the user. - /// - public string Note { get; set; } - - /// - /// get/set - User's last login timestamp - /// - public DateTime? LastLogin { get; set; } - - /// - /// get/set - Who approved this user. - /// - public string ApprovedBy { get; set; } - - /// - /// get/set - When this user was approved on. - /// - public DateTime? ApprovedOn { get; set; } - - /// - /// get/set - A comma-separated list of agencies the user belongs to. - /// - public string Agencies { get; set; } - - /// - /// get/set - A comma-separated list of roles the user is a member of. - /// - public string Roles { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Tools/Controllers/ChesController.cs b/backend/api/Areas/Tools/Controllers/ChesController.cs deleted file mode 100644 index d1f0d738ce..0000000000 --- a/backend/api/Areas/Tools/Controllers/ChesController.cs +++ /dev/null @@ -1,113 +0,0 @@ -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Pims.Api.Policies; -using Pims.Ches; -using Pims.Dal.Security; -using Swashbuckle.AspNetCore.Annotations; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Model = Pims.Ches.Models; - -namespace Pims.Api.Areas.Tools.Controllers -{ - /// - /// ChesController class, provides endpoints to integrate with Common Services CHES. - /// - https://bcgov.github.io/common-service-showcase/ - /// - https://ches-master-9f0fbe-prod.pathfinder.gov.bc.ca/api/v1/docs#operation/postPreview - /// - https://github.com/bcgov/common-hosted-email-service - /// - [Authorize] - [ApiController] - [Area("tools")] - [ApiVersion("1.0")] - [Route("v{version:apiVersion}/[area]/ches")] - [Route("[area]/ches")] - public class ChesController : ControllerBase - { - #region Variables - private readonly IChesService _chesService; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ChesController class. - /// - /// - public ChesController(IChesService chesService) - { - _chesService = chesService; - } - #endregion - - #region Endpoints - /// - /// Make a request to CHES to get the status of the specified 'messageId'. - /// - /// The unique message ID to identify the message you want the status for. - /// A response containing the message status. - [HttpGet("status/{messageId}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.StatusResponseModel), 200)] - [ProducesResponseType(typeof(Pims.Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "tools-ches" })] - [HasPermission(Permissions.AdminProjects)] - public async Task GetStatusAsync(Guid messageId) - { - var result = await _chesService.GetStatusAsync(messageId); - return new JsonResult(result); - } - - /// - /// Make a request to CHES to get the status of the specified 'filter'. - /// - /// An object to filter the results. - /// A response containing the message status. - [HttpPost("status")] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [ProducesResponseType(typeof(Pims.Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "tools-ches" })] - [HasPermission(Permissions.AdminProjects)] - public async Task GetStatusAsync([FromQuery] Model.StatusModel filter) - { - var result = await _chesService.GetStatusAsync(filter); - return new JsonResult(result); - } - - /// - /// Make a request to CHES to cancel the specified 'messageId'. - /// - /// The unique message ID to identify the message you want to cancel. - /// A response containing the message status. - [HttpDelete("cancel/{messageId}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.StatusResponseModel), 200)] - [ProducesResponseType(typeof(Pims.Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "tools-ches" })] - [HasPermission(Permissions.AdminProjects)] - public async Task CancelEmailAsync(Guid messageId) - { - var result = await _chesService.CancelEmailAsync(messageId); - return new JsonResult(result); - } - - /// - /// Make a request to CHES to cancel emails that match the specified 'filter'. - /// - /// An object to filter the messages that are cancelled. - /// A response containing the message status. - [HttpDelete("cancel")] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [ProducesResponseType(typeof(Pims.Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "tools-ches" })] - [HasPermission(Permissions.AdminProjects)] - public async Task CancelEmailAsync([FromQuery] Model.StatusModel filter) - { - var result = await _chesService.CancelEmailAsync(filter); - return new JsonResult(result); - } - #endregion - } -} diff --git a/backend/api/Areas/Tools/Controllers/GeocoderController.cs b/backend/api/Areas/Tools/Controllers/GeocoderController.cs deleted file mode 100644 index c92cee9402..0000000000 --- a/backend/api/Areas/Tools/Controllers/GeocoderController.cs +++ /dev/null @@ -1,88 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Pims.Api.Policies; -using Pims.Dal.Security; -using Pims.Geocoder; -using Pims.Geocoder.Extensions; -using Pims.Geocoder.Parameters; -using Swashbuckle.AspNetCore.Annotations; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Model = Pims.Api.Areas.Tools.Models.Geocoder; - -namespace Pims.Api.Areas.Tools.Controllers -{ - /// - /// GeocoderController class, provides endpoints to integrate with Data BC Geocoder. - /// - https://www2.gov.bc.ca/gov/content/data/geographic-data-services/location-services/geocoder - /// - https://catalogue.data.gov.bc.ca/dataset/bc-address-geocoder-web-service - /// - https://catalogue.data.gov.bc.ca/dataset/bc-address-geocoder-web-service/resource/40d6411e-ab98-4df9-a24e-67f81c45f6fa/view/1d3c42fc-53dc-4aab-ae3b-f4d056cb00e0 - /// - https://bcgov.github.io/ols-devkit/widget/ - /// - [Authorize] - [ApiController] - [Area("tools")] - [ApiVersion("1.0")] - [Route("v{version:apiVersion}/[area]/geocoder")] - [Route("[area]/geocoder")] - public class GeocoderController : ControllerBase - { - #region Variables - private readonly IGeocoderService _geocoderService; - private readonly IMapper _mapper; - #endregion - - #region Constructors - /// - /// Creates a new instance of a GeocoderController class. - /// - /// - /// - public GeocoderController(IGeocoderService geocoderService, IMapper mapper) - { - _geocoderService = geocoderService; - _mapper = mapper; - } - #endregion - - #region Endpoints - /// - /// Make a request to Data BC Geocoder for addresses that match the specified `search`. - /// - /// An address or part of an address to search for. - /// An array of address matches. - [HttpGet("addresses")] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [ProducesResponseType(typeof(Pims.Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "tools-geocoder" })] - [HasPermission(Permissions.PropertyEdit)] - public async Task FindAddressesAsync(string address) - { - var parameters = this.Request.QueryString.ParseQueryString(); - parameters.AddressString = address; - var result = await _geocoderService.GetSiteAddressesAsync(parameters); - return new JsonResult(_mapper.Map(result.Features)); - } - - /// - /// Make a request to Data BC Geocoder for PIDs that belong to the specified 'siteId'. - /// - /// The site identifier for a parcel. - /// An array of PIDs for the supplied 'siteId'. - [HttpGet("parcels/pids/{siteId}")] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [ProducesResponseType(typeof(Pims.Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "tools-geocoder" })] - [HasPermission(Permissions.PropertyEdit)] - public async Task FindPidsAsync(Guid siteId) - { - var result = await _geocoderService.GetPids(siteId); - return new JsonResult(_mapper.Map(result)); - } - #endregion - } -} diff --git a/backend/api/Areas/Tools/Controllers/ImportController.cs b/backend/api/Areas/Tools/Controllers/ImportController.cs deleted file mode 100644 index 21f4ff2f08..0000000000 --- a/backend/api/Areas/Tools/Controllers/ImportController.cs +++ /dev/null @@ -1,160 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Pims.Api.Areas.Tools.Helpers; -using Pims.Api.Policies; -using Pims.Dal; -using Pims.Dal.Security; -using Pims.Dal.Services.Admin; -using Swashbuckle.AspNetCore.Annotations; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text.Json; -using System.Text.Json.Serialization; -using Model = Pims.Api.Areas.Tools.Models.Import; - -namespace Pims.Api.Areas.Tools.Controllers -{ - /// - /// ImportController class, provides endpoints for managing parcels. - /// - [HasPermission(Permissions.SystemAdmin)] - [ApiController] - [Area("tools")] - [ApiVersion("1.0")] - [Route("v{version:apiVersion}/[area]/import")] - [Route("[area]/import")] - public class ImportController : ControllerBase - { - #region Variables - private readonly ILogger _logger; - private readonly IPimsService _pimsService; - private readonly IPimsAdminService _pimsAdminService; - private readonly IMapper _mapper; - private readonly IOptions _serializerOptions; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ImportController class. - /// - /// - /// - /// - /// - /// - public ImportController(ILogger logger, IPimsService pimsService, IPimsAdminService pimsAdminService, IMapper mapper, IOptions serializerOptions) - { - _logger = logger; - _pimsService = pimsService; - _pimsAdminService = pimsAdminService; - _mapper = mapper; - _serializerOptions = serializerOptions; - } - #endregion - - #region Endpoints - #region Properties - /// - /// POST - Add an array of new properties to the datasource. - /// Determines if the property is a parcel or a building and then adds or updates appropriately. - /// This will also add new lookup items to the following; cities, agencies, building construction types, building predominate uses. - /// - /// An array of property models. - /// The properties added. - [HttpPost("properties")] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [ProducesResponseType(typeof(Pims.Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "tools-import" })] - [HasPermission(Permissions.SystemAdmin)] - public IActionResult ImportProperties([FromBody] Model.ImportPropertyModel[] models) - { - if (models.Count() > 100) return BadRequest("Must not submit more than 100 properties in a single request."); - - var helper = new ImportPropertiesHelper(_pimsAdminService, _logger); - var entities = helper.AddUpdateProperties(models); - return new JsonResult(entities.ToList()); - } - - /// - /// POST - Update property financial values in the datasource. - /// If the property does not exist it will not be imported. - /// The financial values provided will overwrite existing data in the datasource. - /// - /// An array of property models. - /// The properties added. - [HttpPost("properties/financials")] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [ProducesResponseType(typeof(Pims.Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "tools-import" })] - [HasPermission(Permissions.SystemAdmin)] - public IActionResult ImportPropertyFinancials([FromBody] Model.ImportPropertyModel[] models) - { - if (models.Count() > 100) return BadRequest("Must not submit more than 100 properties in a single request."); - - var helper = new ImportPropertiesHelper(_pimsAdminService, _logger); - var entities = helper.UpdatePropertyFinancials(models); - var parcels = _mapper.Map(entities); - - return new JsonResult(parcels); - } - - /// - /// DELETE - An array of properties to delete from the datasource. - /// - /// An array of property models. - /// Only allow deletes to properties updated before this date. - /// The properties added. - [HttpDelete("properties")] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [ProducesResponseType(typeof(Pims.Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "tools-import" })] - [HasPermission(Permissions.SystemAdmin)] - public IActionResult DeleteProperties([FromBody] Model.ImportPropertyModel[] models, DateTime? updatedBefore = null) - { - if (models.Count() > 100) return BadRequest("Must not submit more than 100 properties in a single request."); - - var helper = new ImportPropertiesHelper(_pimsAdminService, _logger); - var entities = helper.DeleteProperties(models, updatedBefore); - var parcels = _mapper.Map(entities); - - return new JsonResult(parcels); - } - #endregion - - #region Projects - /// - /// POST - Add an array of new properties to the datasource. - /// Determines if the property is a parcel or a building and then adds or updates appropriately. - /// This will also add new lookup items to the following; cities, agencies, building construction types, building predominate uses. - /// - /// An array of property models. - /// Whether to throw an error if a failture occurs. - /// The date and time an SPL report should be generated from. - /// A semi-colon separated list of key=value pairs of default values for properties if they are null or not provided. - /// The properties added. - [HttpPost("projects")] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [ProducesResponseType(typeof(Pims.Api.Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "tools-import" })] - [HasPermission(Permissions.SystemAdmin)] - public IActionResult ImportProjects([FromBody] Model.ImportProjectModel[] models, bool stopOnError = true, DateTime? fromSnapshot = null, string defaults = null) - { - if (models.Count() > 100) return BadRequest("Must not submit more than 100 projects in a single request."); - - var helper = new ImportProjectsHelper(_pimsService, _pimsAdminService, _serializerOptions, _logger); - var entities = helper.AddUpdateProjects(models, stopOnError, fromSnapshot, defaults?.Split(";")); - var projects = _mapper.Map(entities); - - return new JsonResult(projects); - } - #endregion - #endregion - } -} diff --git a/backend/api/Areas/Tools/Controllers/LtsaController.cs b/backend/api/Areas/Tools/Controllers/LtsaController.cs deleted file mode 100644 index 72497d75f7..0000000000 --- a/backend/api/Areas/Tools/Controllers/LtsaController.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Pims.Api.Policies; -using Pims.Dal.Security; -using Pims.Ltsa; -using Swashbuckle.AspNetCore.Annotations; -using System; -using System.Threading.Tasks; -using LtsaModel = Pims.Core.Http.Models; - -namespace Pims.Api.Areas.Tools.Controllers -{ - /// - /// LtsaController class, provides an endpoint to make a request with the LTSA api. - /// - https://help.ltsa.ca/myltsa-enterprise/title-and-other-searches - /// - [Authorize] - [ApiController] - [ApiVersion("1.0")] - [Area("ltsa")] - [Route("v{version:apiVersion}/[area]/land")] - [Route("[area]/land")] - public class LtsaController : ControllerBase - { - private readonly ILtsaService _ltsaService; - - public LtsaController(ILtsaService ltsaService) - { - _ltsaService = ltsaService; - } - - [HttpGet("title")] - [HasPermission(Permissions.PropertyView)] - [Produces("application/json")] - [ProducesResponseType(typeof(LtsaModel.LtsaOrderModel), 200)] - [SwaggerOperation(Tags = new[] { "ltsa" })] - public async Task GetLandTitleInfo(string pid) - { - try - { - var landTitle = await _ltsaService.ProcessLTSARequest(pid); - return new JsonResult(landTitle); - } - catch (Exception ex) - { - return StatusCode(404, new { Message = $"Unable to find title summary for parcel id: {pid}", Exception = ex.Message }); - } - } - } -} diff --git a/backend/api/Areas/Tools/Helpers/ImportProjectsHelper.cs b/backend/api/Areas/Tools/Helpers/ImportProjectsHelper.cs deleted file mode 100644 index 71dd19f9e9..0000000000 --- a/backend/api/Areas/Tools/Helpers/ImportProjectsHelper.cs +++ /dev/null @@ -1,528 +0,0 @@ -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Pims.Core.Extensions; -using Pims.Dal; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Services.Admin; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text.Json; -using System.Text.RegularExpressions; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Tools.Models.Import; - -namespace Pims.Api.Areas.Tools.Helpers -{ - /// - /// ImportProjectsHelper class, provides a helper to import projects into PIMS. - /// - public class ImportProjectsHelper - { - #region Variables - private readonly IPimsService _service; - private readonly IPimsAdminService _adminService; - private readonly ILogger _logger; - private readonly IList _workflows; - private readonly IList _status; - private readonly IList _risks; - private readonly IList _agencies; - private readonly IList _tiers; - private readonly JsonSerializerOptions _serializerOptions; - - /// - /// An array of project status for marketed and beyond. - /// - /// - private static readonly string[] marketed = new[] { "SPL-M", "SPL-CIP-U", "SPL-CIP-C", "DIS" }; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ImportProjectsHelper, initializes with specified arguments. - /// - /// - /// - /// - /// - public ImportProjectsHelper(IPimsService service, IPimsAdminService adminService, IOptions serializerOptions, ILogger logger) - { - _service = service; - _adminService = adminService; - _serializerOptions = serializerOptions.Value; - _logger = logger; - - _workflows = adminService.Workflow.GetAll().ToArray(); - _status = adminService.ProjectStatus.GetAll().ToArray(); - _risks = adminService.ProjectRisk.GetAll().ToArray(); - _agencies = adminService.Agency.GetAll().ToArray(); - _tiers = adminService.TierLevel.GetAll().ToArray(); - } - #endregion - - #region Methods - /// - /// Add or update projects within PIMS. - /// - /// - /// - /// - /// - /// - public IEnumerable AddUpdateProjects(IEnumerable models, bool stopOnError = true, DateTime? fromSnapshot = null, string[] defaults = null) - { - var projects = new List(); - foreach (var model in models) - { - try - { - ApplyDefaults(model, fromSnapshot, defaults); - - _logger.LogDebug($"Importing Project '{model.ProjectNumber}', agency:'{model.Agency}', workflow:'{model.Workflow}', status:'{model.Status}'"); - var project = Merge(_adminService.Project.Get(model.ProjectNumber), model); - projects.Add(project); - } - catch (Exception ex) - { - _logger.LogError(ex, $"Failed to parse this project while importing '{model.ProjectNumber}' - {ex.GetAllMessages()}"); - if (stopOnError) throw; - } - } - - _adminService.Project.Add(projects.Where(p => p.Id == 0)); - _adminService.Project.Update(projects.Where(p => p.Id != 0)); - UpdateProjectNumbers(projects); - if (fromSnapshot.HasValue) - { - AddProjectReport(fromSnapshot.Value); - } - - return projects; - } - #endregion - - #region Helpers - /// - /// Override the model values with the specified defaults. - /// - /// - /// - /// - private void ApplyDefaults(Model.ImportProjectModel model, DateTime? fromSnapshot = null, string[] defaults = null) - { - // Use defaults if required - if (defaults?.Any() ?? false) - { - var props = typeof(Model.ImportProjectModel).GetCachedProperties(); - foreach (var kv in defaults) - { - var keyValue = kv.Trim().Split("="); - - if (keyValue.Length < 2) throw new ArgumentException($"Argument '{kv}' is not valid."); - - var prop = props.FirstOrDefault(p => String.Compare(p.Name, keyValue[0], true) == 0); - var modelValue = prop?.GetValue(model); - if (prop != null && modelValue == null || modelValue?.Equals(prop.PropertyType.GetDefault()) == true) - { - if (prop.PropertyType == typeof(DateTime) || prop.PropertyType == typeof(DateTime?)) - { - var value = DateTime.Parse(keyValue[1]); - prop.SetValue(model, value); - } - else - { - var value = Convert.ChangeType(keyValue[1], prop.PropertyType); - prop.SetValue(model, value); - } - } - } - } - - if (fromSnapshot.HasValue && !model.SnapshotOn.HasValue) - { - model.SnapshotOn = fromSnapshot; - } - } - - /// - /// Copy the 'model' project properties into existing projects, or add new projects to PIMS. - /// - /// - /// - /// - private Entity.Project Merge(Entity.Project project, Model.ImportProjectModel model) - { - var status = GetStatus(model.Status); - - // Default to the last workflow this status is associated with. - // This isn't ideal and could end up with projects associated with an incorrect workflow. - // Without better data from SIS it isn't entirely possible to determine the correct workflow automatically. - var workflow = !String.IsNullOrWhiteSpace(model.Workflow) ? GetWorkflow(model.Workflow) : model.Activity switch - { - "Completed Deal" => GetWorkflow("SPL"), - "Contract in Place" => GetWorkflow("SPL"), - "On Market" => GetWorkflow("SPL"), - "Pre-Market" => GetWorkflow("SPL"), - "Not In Spl" => GetWorkflow("SPL"), - _ => status.Code == "AP-!SPL" - ? _adminService.Workflow.Get(_workflows.FirstOrDefault(w => w.Code == "ERP").Id) - : _adminService.Workflow.GetForStatus(model.Status).OrderBy(w => w.SortOrder).Last() - }; - - project ??= new Entity.Project(); - - project.ProjectNumber = String.IsNullOrWhiteSpace(model.ProjectNumber) ? $"TEMP-{DateTime.UtcNow.Ticks:00000}" : model.ProjectNumber; - project.Name = model.Description.Truncate(100); - project.Description = model.Description + (String.IsNullOrWhiteSpace(model.Location) ? null : Environment.NewLine + model.Location); - project.Manager = model.Manager; - project.ActualFiscalYear = model.ActualFiscalYear; - project.ReportedFiscalYear = model.ReportedFiscalYear; - - project.Agency = GetAgency(model.Agency); - project.AgencyId = project.Agency.Id; - project.Workflow = workflow; - project.WorkflowId = workflow.Id; - project.Status = status; - project.StatusId = status.Id; - - // Extract properties from PID note. - var pidNote = model.Notes?.FirstOrDefault(n => n.Key == "PID").Value; - var pids = Regex.Matches(pidNote ?? "", "[0-9]{3}-[0-9]{3}-[0-9]{3}").Select(m => m.Value).NotNull().Distinct(); - project.TierLevel = GetTier(model.Market, project.Properties.Any() ? project.Properties.Count() : pids.Count()); // Most projects have no properties linked. - project.TierLevelId = project.TierLevel.Id; - project.Risk = GetRisk(model.Risk); - project.RiskId = project.Risk.Id; - - // If there are properties linked, load them into context. - decimal assessed = 0; - if (project.Properties.Any()) - { - project.Properties.Where(p => p.PropertyType == Entity.PropertyTypes.Land).ForEach(p => - { - var property = _service.Parcel.Get(p.ParcelId.Value); - assessed += property.Evaluations.Where(e => e.Key == Entity.EvaluationKeys.Assessed).OrderByDescending(e => e.Date).FirstOrDefault()?.Value ?? 0; - }); - } - - project.Assessed = model.Assessed ?? assessed; - project.NetBook = model.NetBook; - project.Market = model.Market; - project.Appraised = model.Appraised; - - project.SubmittedOn = new DateTime(model.ReportedFiscalYear - 1, 1, 1); // Don't have a source for this information. - project.ApprovedOn = project.SubmittedOn; // Don't have a source for this information. - project.CompletedOn = model.CompletedOn; - - var metadata = new Entity.Models.DisposalProjectSnapshotMetadata - { - InitialNotificationSentOn = model.InitialNotificationSentOn, - ThirtyDayNotificationSentOn = null, // Don't have a source for this information. - SixtyDayNotificationSentOn = null, // Don't have a source for this information. - NinetyDayNotificationSentOn = null, // Don't have a source for this information. - OnHoldNotificationSentOn = null, // Don't have a source for this information. - InterestedReceivedOn = model.InterestedReceivedOn, - TransferredWithinGreOn = null, // Don't have a source for this information. - ClearanceNotificationSentOn = model.ClearanceNotificationSentOn, - RequestForSplReceivedOn = model.RequestForSplReceivedOn, - ApprovedForSplOn = model.ApprovedForSplOn, - MarketedOn = marketed.Contains(project.Status.Code) ? model.MarketedOn : null, // Only assign the marketed on date if the project is in an appropriate status. - Purchaser = model.Purchaser, - OcgFinancialStatement = model.OcgFinancialStatement, - AppraisedBy = model.AppraisedBy, - AppraisedOn = model.AppraisedOn, - ProgramCost = model.ProgramCost, - SalesCost = model.SalesCost, - InterestComponent = model.InterestComponent, - NetProceeds = model.NetProceeds, - GainLoss = model.GainLoss, - SaleWithLeaseInPlace = model.SaleWithLeaseInPlace, - DisposedOn = model.DisposedOn ?? (project.Status.Code == "DIS" ? model.CompletedOn : null), - OfferAmount = project.Status.Code == "DIS" ? model.Market : (decimal?)null, // This value would only be accurate if the property is disposed. - OfferAcceptedOn = null, // Don't have a source for this information. - ExemptionRequested = model.ExemptionRequested - }; - - // A prior net proceeds was provided, which means a prior snapshot needs to be generated. - // If the project already exists, don't add prior snapshots. - // Only create snapshots if a `snapshotOn` date has been provided. - if (model.PriorNetProceeds.HasValue && project.Id == 0 && model.SnapshotOn.HasValue) - { - AddSnapshot(project, model, metadata); - } - - project.Metadata = JsonSerializer.Serialize(metadata, _serializerOptions); - - // The data doesn't provide the purchasing agency information so the response will be the current owning agency. - if (model.InterestedReceivedOn.HasValue) - { - var response = project.Responses.FirstOrDefault(r => r.AgencyId == project.AgencyId); - if (response == null) - { - project.Responses.Add(new Entity.ProjectAgencyResponse(project, project.Agency, Entity.NotificationResponses.Watch, model.InterestedReceivedOn)); - } - else - { - response.Response = Entity.NotificationResponses.Watch; - response.ReceivedOn = model.InterestedReceivedOn ?? response.ReceivedOn; - } - } - - foreach (var note in model.Notes) - { - AddNote(project, note.Key, note.Value); - } - - // Add tasks if they haven't been added already. - if (!project.Tasks.Any()) - { - // Assumption we'll need to add all tasks from Submit to SPL. - var tasks = _service.Task.GetForWorkflow("SUBMIT-DISPOSAL"); - tasks = tasks.Concat(_service.Task.GetForWorkflow("ASSESS-DISPOSAL")); - var distinctTasks = tasks.GetDistinctBy(t => t.Id).ToArray(); - project.AddTask(distinctTasks); - project.Tasks.ForEach(t => - { - t.IsCompleted = !t.Task.IsOptional; // Complete all required steps. - t.Task = null; - }); - - var erpTasks = _service.Task.GetForWorkflow("ERP"); - var splTasks = erpTasks.Concat(_service.Task.GetForWorkflow("SPL")); - distinctTasks = splTasks.Where(t => !distinctTasks.Any(dt => dt.Id == t.Id)).GetDistinctBy(t => t.Id).ToArray(); - project.AddTask(distinctTasks); - project.Tasks.ForEach(t => - { - t.IsCompleted = false; - t.Task = null; - }); - } - - _logger.LogDebug($"Parsed project '{project.ProjectNumber}' - '{project.Status.Code}'", project); - - return project; - } - - /// - /// If a project has a temporary number and it is not in the draft workflow it should have a proper number. - /// - /// - private void UpdateProjectNumbers(IEnumerable projects) - { - // If any project received a temporary number it may need to be updated. - foreach (var project in projects.Where(p => p.ProjectNumber.StartsWith("TEMP"))) - { - var workflow = _adminService.Workflow.Get(project.WorkflowId.Value); - if (workflow.Code != "SUBMIT-DISPOSAL") - { - var projectNumber = _adminService.Project.GenerateProjectNumber(); - _adminService.Project.UpdateProjectNumber(project, projectNumber); - } - } - - // Update all associated properties with the project number. - foreach (var project in projects) - { - foreach (var projectProperty in project.Properties) - { - if (projectProperty.PropertyType == Entity.PropertyTypes.Land) - { - var parcel = _adminService.Parcel.Find(projectProperty.ParcelId); - parcel.UpdateProjectNumbers(project.ProjectNumber); - _adminService.Parcel.Update(parcel); - } - else - { - var building = _adminService.Building.Find(projectProperty.BuildingId); - building.UpdateProjectNumbers(project.ProjectNumber); - _adminService.Building.Update(building); - } - } - } - } - - /// - /// Add a snapshot for the project. - /// - /// - /// - /// - private void AddSnapshot(Entity.Project project, Model.ImportProjectModel model, Entity.Models.DisposalProjectSnapshotMetadata metadata) - { - var today = model.SnapshotOn ?? DateTime.Today.ToUniversalTime(); // Allows for all imports done on the same day to create the same snapshot time. - metadata.NetProceeds = model.PriorNetProceeds; // Temporarily set it to the prior amount for the snapshot. - var snapshot = new Entity.ProjectSnapshot(project) - { - SnapshotOn = today, - Metadata = JsonSerializer.Serialize(metadata, _serializerOptions) - }; - project.Snapshots.Add(snapshot); - metadata.NetProceeds = model.NetProceeds; // Set it back to the current value. - } - - /// - /// Generate and add a project report that will contain any snapshots generated for the specified 'from' date and time. - /// - /// The date and time of the prior snapshots - private void AddProjectReport(DateTime from) - { - // Find any reports that are linked to the 'from' date and update them. - var reports = _service.ProjectReport.GetAll().Where(r => r.From == from).ToArray(); - if (reports.Any()) - { - foreach (var report in reports) - { - report.To = DateTime.UtcNow; - _service.ProjectReport.Update(report); - } - } - else - { - var report = new Entity.ProjectReport(Entity.ReportTypes.SPL, $"Project Import - {DateTime.UtcNow}", from, DateTime.UtcNow); - _service.ProjectReport.Add(report); - } - } - - /// - /// Append a new note to the project. - /// Parse the 'noteType' value, or set it as 'General'. - /// - /// - /// - /// - private void AddNote(Entity.Project project, string noteType, string note) - { - if (!String.IsNullOrWhiteSpace(note)) - { - if (!Enum.TryParse(noteType, true, out Entity.NoteTypes type)) - { - type = noteType switch - { - "Property" => Entity.NoteTypes.Public, - "PID" => Entity.NoteTypes.Public, - "LandLegalDescription" => Entity.NoteTypes.Public, - "Surplus Dec / Readiness Checklist" => Entity.NoteTypes.Public, - "TBL - CBA" => Entity.NoteTypes.Public, - "Enhanced Referral Comments" => Entity.NoteTypes.Private, - "Business Case Comments" => Entity.NoteTypes.Private, - "Business Case Submitted" => Entity.NoteTypes.Private, - "Clearance Letter Issued" => Entity.NoteTypes.Private, - "Interest from Enhanced Referral" => Entity.NoteTypes.AgencyInterest, - "Appraisal Date" => Entity.NoteTypes.Appraisal, - "Assessed & Appraised Comments" => Entity.NoteTypes.Appraisal, - "Weekly Review" => Entity.NoteTypes.Reporting, - _ => Entity.NoteTypes.General - }; - } - - var projectNote = project.Notes.FirstOrDefault(n => n.NoteType == type); - if (projectNote == null) - { - project.Notes.Add(new Entity.ProjectNote(project, type, note)); - } - else - { - if (!String.IsNullOrWhiteSpace(projectNote.Note)) - projectNote.Note += $"{Environment.NewLine}{Environment.NewLine}{noteType}{Environment.NewLine}{note}"; - else - projectNote.Note = note; - } - } - } - - /// - /// Find the property for the specified 'pid' in inventory and add it to the project. - /// Assumption is made that if the parcel is added, then also add all the buildings on the parcel. - /// - /// - /// - /// - private Entity.Project AddProperty(Entity.Project project, string pid) - { - try - { - var pidValue = Int32.Parse(pid.Replace("-", "")); - var parcel = _adminService.Parcel.GetByPid(pidValue); - project.AddProperty(parcel).ForEach(p => - { - p.Project = null; - p.Parcel = null; // Need to do this so that it isn't reattached. - }); - var buildings = parcel.Buildings.Select(b => b.Building).ToArray(); - project.AddProperty(buildings).ForEach(b => - { - b.Project = null; - b.Building = null; // Need to do this so that it isn't reattached. - }); - _logger.LogInformation($"Property '{pid}' added to project '{project.ProjectNumber}'."); - } - catch (KeyNotFoundException) - { - _logger.LogWarning($"Property '{pid}' not found on project '{project.ProjectNumber}'."); - } - catch (InvalidOperationException ex) - { - _logger.LogWarning(ex, $"Property '{pid}' not found on project '{project.ProjectNumber}'."); - } - return project; - } - - /// - /// Get the project risk based on the 'value' provided. - /// - /// - /// - private Entity.ProjectRisk GetRisk(string value) - { - return _adminService.ProjectRisk.Get(_risks.FirstOrDefault(r => r.Name.ToLower() == value?.ToLower())?.Id ?? throw new KeyNotFoundException($"Risk '{value}' does not exist.")); - } - - /// - /// Get the workflow based on the 'value' provided. - /// - /// - /// - private Entity.Workflow GetWorkflow(string value) - { - return _adminService.Workflow.Get(_workflows.FirstOrDefault(w => w.Code == value)?.Id ?? throw new KeyNotFoundException($"Workflow '{value}' does not exist.")); - } - - /// - /// Get the project status based on the 'value' provided. - /// - /// - /// - private Entity.ProjectStatus GetStatus(string value) - { - return _adminService.ProjectStatus.Get(_status.FirstOrDefault(a => a.Code == value)?.Id ?? throw new KeyNotFoundException($"Project status '{value}' does not exist.")); - } - - /// - /// Get the tier level based on the value and the number of properties. - /// - /// - /// - /// - private Entity.TierLevel GetTier(decimal value, int properties) - { - Entity.TierLevel tier; - if (value >= 10000000m && properties > 1) tier = _tiers.FirstOrDefault(t => t.Id == 4); - else if (value >= 10000000m) tier = _tiers.FirstOrDefault(t => t.Id == 3); - else if (value >= 1000000m) tier = _tiers.FirstOrDefault(t => t.Id == 2); - else tier = _tiers.FirstOrDefault(t => t.Id == 1); - - return _adminService.TierLevel.Get(tier.Id); - } - - /// - /// Get the agency for the specified code 'value'. - /// - /// - /// - private Entity.Agency GetAgency(string value) - { - return _adminService.Agency.Get(_agencies.FirstOrDefault(a => a.Name == value || a.Code == value)?.Id ?? throw new KeyNotFoundException($"Agency '{value}' does not exist.")); - } - #endregion - } -} - diff --git a/backend/api/Areas/Tools/Helpers/ImportPropertiesHelper.cs b/backend/api/Areas/Tools/Helpers/ImportPropertiesHelper.cs deleted file mode 100644 index 6632e38b07..0000000000 --- a/backend/api/Areas/Tools/Helpers/ImportPropertiesHelper.cs +++ /dev/null @@ -1,648 +0,0 @@ -using Microsoft.EntityFrameworkCore.Internal; -using Microsoft.Extensions.Logging; -using Pims.Core.Extensions; -using Pims.Core.Helpers; -using Pims.Dal.Services.Admin; -using System; -using System.Collections.Generic; -using System.Linq; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Tools.Models.Import; - -namespace Pims.Api.Areas.Tools.Helpers -{ - /// - /// ImportPropertiesHelper class, provides a way to import properties into the datasource. - /// - public class ImportPropertiesHelper - { - #region Variables - private readonly IPimsAdminService _pimsAdminService; - private readonly ILogger _logger; - private readonly IList _buildingConstructionTypes; - private readonly IList _buildingPredominateUses; - private readonly IList _propertyClassifications; - private readonly IList _agencies; - private readonly Dictionary _agencyCodeCorrections = new Dictionary() { { "BT", "BCT" }, { "ICOB", "ICBC" } }; // TODO: Move logic to converter tool - #endregion - - #region Constructors - /// - /// Creates a new instance of a ImportPropertiesHelper class, initializes it with the specified arguments. - /// - /// - /// - public ImportPropertiesHelper(IPimsAdminService pimsAdminService, ILogger logger) - { - _pimsAdminService = pimsAdminService; - _logger = logger; - - // Preload lookup lists so that they can be references quickly. - _buildingConstructionTypes = _pimsAdminService.BuildingConstructionType.GetAll().ToList(); - _buildingPredominateUses = _pimsAdminService.BuildingPredominateUse.GetAll().ToList(); - _propertyClassifications = _pimsAdminService.PropertyClassification.GetAll().ToList(); - _agencies = _pimsAdminService.Agency.GetAll().ToList(); - } - #endregion - - #region Methods - /// - /// Parse the value to extract the PID number. - /// If it's invalid it will return -1. - /// - /// - /// - private int ParsePid(string value) - { - if (int.TryParse(value?.Replace("-", ""), out int pid)) - return pid; - - return -1; - } - - /// - /// Delete properties from inventory that match the parcel PID or building name. - /// - /// - /// Only allow deletes to properties updated before this date. - /// - public IEnumerable DeleteProperties(IEnumerable properties, DateTime? updatedBefore = null) - { - if (properties == null) throw new ArgumentNullException(nameof(properties)); - - var results = new List(); - foreach (var property in properties) - { - var pid = ParsePid(property.ParcelId ?? property.PID); - _logger.LogDebug($"Requesting to remove property pid:{pid}, type:{property.PropertyType}, local:{property.LocalId}"); - - // Ignore invalid PID values or '000-000-000'. - if (pid < 1) continue; - - switch (property.PropertyType?.ToLower()) - { - case "parcel": - case "land": - var parcel = ExceptionHelper.HandleKeyNotFound(() => _pimsAdminService.Parcel.GetByPid(pid)); - // Only delete the parcel if it exists in inventory. - if (parcel != null && (updatedBefore == null || parcel.UpdatedOn == null || parcel.UpdatedOn < updatedBefore)) - { - _pimsAdminService.Parcel.Remove(parcel); - results.Add(parcel); - _logger.LogInformation($"Deleting parcel pid:{pid}"); - } - break; - case "building": - var name = $"{(String.IsNullOrWhiteSpace(property.LocalId) ? "" : $"{property.LocalId} ")}{property.Description}"; - // Searching for a name may result in multiple matches. - // - var buildings = ExceptionHelper.HandleKeyNotFound(() => _pimsAdminService.Building.GetByName(name)); - - foreach (var building in buildings.ToArray()) - { - _pimsAdminService.Building.LoadParcelsFor(building); - // Only delete the building if it exists in inventory - // If it hasn't been updated after the 'updatedBefore' date - // If the building exists on the specified 'pid' or the building address matches - if ((updatedBefore == null || building.UpdatedOn == null || building.UpdatedOn < updatedBefore) - && ((building.Parcels.Count() == 0 - && building.Address.Address1 == property.CivicAddress - && building.Address.AdministrativeArea == property.City) - || building.Parcels.Any(p => p.Parcel.PID == pid))) - { - _pimsAdminService.Building.Remove(building); - results.Add(building); - _logger.LogInformation($"Deleting building pid:{pid} name:{name}"); - } - } - break; - } - } - - return results; - } - - /// - /// Update the specified property financials only. - /// This will only add new financial year values to existing properties. - /// All other property metadata will remain unchanged. - /// - /// - /// - public IEnumerable UpdatePropertyFinancials(IEnumerable properties) - { - if (properties == null) throw new ArgumentNullException(nameof(properties)); - - var entities = new List(); - foreach (var property in properties) - { - var parcelId = property.ParcelId ?? property.PID; - _logger.LogDebug($"Update property financials pid:{parcelId}, type:{property.PropertyType}, fiscal:{property.FiscalYear}, local:{property.LocalId}"); - - var validPid = int.TryParse(parcelId?.Replace("-", ""), out int pid); - if (!validPid) continue; - - if (String.Compare(property.PropertyType, "Land") == 0) - { - entities.Add(UpdateParcelFinancials(property, pid)); - } - else if (String.Compare(property.PropertyType, "Building") == 0) - { - UpdateBuildingFinancials(property, pid); - } - } - - return entities; - } - - /// - /// Check if the parcel exists, if it does then it will update the financials if there are newer values provided. - /// - /// - /// - /// - private Entity.Parcel UpdateParcelFinancials(Model.ImportPropertyModel property, int pid) - { - var p_e = ExceptionHelper.HandleKeyNotFoundWithDefault(() => _pimsAdminService.Parcel.GetByPid(pid)); - var evaluationDate = new DateTime(property.FiscalYear, 1, 1); // Defaulting to Jan 1st because SIS data doesn't have the actual date. - - // Ignore properties that are not part of inventory. - if (p_e.Id == 0) return null; - - // Add a new fiscal values for each year. - if (!p_e.Fiscals.Any(e => e.FiscalYear == property.FiscalYear)) - { - p_e.Fiscals.Add(new Entity.ParcelFiscal(p_e, property.FiscalYear, Entity.FiscalKeys.NetBook, property.NetBook)); - } - - // Add a new evaluation if new. - if (!p_e.Evaluations.Any(e => e.Date == evaluationDate)) - { - p_e.Evaluations.Add(new Entity.ParcelEvaluation(p_e, evaluationDate, Entity.EvaluationKeys.Assessed, property.Assessed)); - } - - _pimsAdminService.Parcel.UpdateFinancials(p_e); - _logger.LogDebug($"Updating parcel '{property.PID}'"); - - return p_e; - } - - /// - /// Check if the building exists, if it does then it will update the financials if there are newer values provided. - /// - /// - /// - /// - private Entity.Building UpdateBuildingFinancials(Model.ImportPropertyModel property, int pid) - { - var lid = property.LocalId; - var b_e = ExceptionHelper.HandleKeyNotFoundWithDefault(() => _pimsAdminService.Building.GetByPid(pid, lid).FirstOrDefault()); - var evaluationDate = new DateTime(property.FiscalYear, 1, 1); // Defaulting to Jan 1st because SIS data doesn't have the actual date. - - // Ignore properties that are not part of inventory. - if (b_e.Id == 0) return null; - - // Add a new fiscal values for each year. - if (!b_e.Fiscals.Any(e => e.FiscalYear == property.FiscalYear)) - { - b_e.Fiscals.Add(new Entity.BuildingFiscal(b_e, property.FiscalYear, Entity.FiscalKeys.NetBook, property.NetBook)); - } - - // Add a new evaluation if new. - if (!b_e.Evaluations.Any(e => e.Date == evaluationDate)) - { - b_e.Evaluations.Add(new Entity.BuildingEvaluation(b_e, evaluationDate, Entity.EvaluationKeys.Assessed, property.Assessed)); - } - - _pimsAdminService.Building.UpdateFinancials(b_e); - _logger.LogDebug($"Updating building '{property.PID}:{property.LocalId}'"); - - return b_e; - } - - /// - /// Adds or updates the property in the datasource. - /// Determines if the property is a parcel or a building. - /// Massages some of the data to align with expected values. - /// - /// - /// - public IEnumerable AddUpdateProperties(IEnumerable properties) - { - if (properties == null) throw new ArgumentNullException(nameof(properties)); - - var propertiesAddedOrEdited = new List(); - foreach (var property in properties) - { - var parcelId = property.ParcelId ?? property.PID; - _logger.LogDebug($"Add/Update property pid:{parcelId}, type:{property.PropertyType}, fiscal:{property.FiscalYear}, local:{property.LocalId}"); - - var validPid = int.TryParse(parcelId?.Replace("-", ""), out int pid); - - if (!validPid && property.PropertyType == "Land" || (!validPid && property.PropertyType == "Building" && property.PID != null && property.PID != "")) - { - property.Added = false; - property.Updated = false; - property.Error = "Invalid or missing PID: " + property.PID; - propertiesAddedOrEdited.Add(property); - continue; - } - - // Fix postal. - property.Postal = new string(property.Postal?.Replace(" ", "").Take(6).ToArray()); - - var agency = GetOrCreateAgency(property); - if (property.Error != null && property.Error != "") - { - propertiesAddedOrEdited.Add(property); - continue; - } - - if (String.Compare(property.PropertyType, "Land") == 0) - { - // first check to see if there is an existing parcel with the pid in the database - var isPidAvailable = _pimsAdminService.Parcel.IsPidAvailable(pid); - try - { - AddUpdateParcel(property, pid, (Pims.Dal.Entities.Agency)agency); - // then set whether the property was updated or added based on whether the parcel was already in database or not - if (isPidAvailable) - { - property.Added = true; - property.Updated = false; - } - else - { - property.Added = false; - property.Updated = true; - } - } - catch (Exception e) - { - property.Added = false; - property.Updated = false; - property.Error = e.Message; - } - - propertiesAddedOrEdited.Add(property); - } - else if (String.Compare(property.PropertyType, "Building") == 0) - { - var isBuildingExisting = _pimsAdminService.Building.GetByPidNameWithoutTracking(pid, property.Name); - try - { - // need to check the count before a building gets added, as the previous variable gets updated once the building has been added - if (isBuildingExisting.Count() == 0) - { - property.Added = true; - property.Updated = false; - } - else if (isBuildingExisting.Count() >= 2) - { - // there seems to be more than one building with the same name and address.....need to determine which one to update? - throw new Exception(isBuildingExisting.Count() + " buildings were found with the same PID and name. Couldn't tell which one to update."); - } - else - { - property.Added = false; - property.Updated = true; - } - AddUpdateBuilding(property, pid, (Pims.Dal.Entities.Agency)agency); - } - catch (Exception e) - { - property.Added = false; - property.Updated = false; - property.Error = e.Message; - } - - propertiesAddedOrEdited.Add(property); - } - else - { - property.Added = false; - property.Updated = false; - property.Error = "Only Land or Building property types permitted."; - propertiesAddedOrEdited.Add(property); - } - } - - return propertiesAddedOrEdited; - } - - /// - /// Get or create a new agency for the specified property. - /// - /// - /// - private object GetOrCreateAgency(Model.ImportPropertyModel property) - { - // Find the parent agency. - var agencyCode = property.AgencyCode.ConvertToUTF8(); - var subAgencyName = property.SubAgency.ConvertToUTF8(); - var agency = _agencies.FirstOrDefault(a => a.Code == agencyCode); - if (agency == null) - { - // Set the error message in the Error property. - property.Error = $"Agency '{property.AgencyCode}' does not exist "; - return property; - } - - // Find or create a sub-agency. - if (!String.IsNullOrWhiteSpace(subAgencyName)) - { - var createCode = new string(subAgencyName.GetFirstLetterOfEachWord(true).Take(6).ToArray()).Trim(); - - //check if this agency mapping needs to be corrected. - if (_agencyCodeCorrections.TryGetValue(createCode, out string mappedCode)) - { - createCode = mappedCode; - } - var subAgency = _agencies.FirstOrDefault(a => - (a.ParentId == agency.Id && a.Name == subAgencyName) - || (a.ParentId == agency.Id && a.Code == createCode) - || a.Code == subAgencyName - || a.Name == subAgencyName); - - if (subAgency == null) - { - property.Error = $"Sub Agency: '{property.SubAgency}' does not exist "; - return property; - } - - return subAgency; - } - - return agency; - } - - /// - /// Add or update the parcel in the datasource. - /// - /// - /// - /// - /// - private Entity.Parcel AddUpdateParcel(Model.ImportPropertyModel property, int pid, Entity.Agency agency) - { - var p_e = ExceptionHelper.HandleKeyNotFoundWithDefault(() => _pimsAdminService.Parcel.GetByPidWithoutTracking(pid)); - p_e.PropertyTypeId = (int)Entity.PropertyTypes.Land; - var fiscalYear = property.FiscalYear; - var evaluationDate = new DateTime(fiscalYear, 1, 1); // Defaulting to Jan 1st because SIS data doesn't have the actual date. - - // Copy properties over to entity. - p_e.PID = pid; - - // Determine if the last evaluation or fiscal values in the datasource are older than the one currently being imported. - var fiscalNetBook = p_e.Fiscals.OrderByDescending(f => f.FiscalYear).FirstOrDefault(f => f.Key == Entity.FiscalKeys.NetBook && f.FiscalYear > fiscalYear); - var evaluationAssessed = p_e.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == Entity.EvaluationKeys.Assessed && e.Date > evaluationDate); - - // Only want to update the properties with the latest information. - if (p_e.Id == 0 || fiscalNetBook == null || evaluationAssessed == null) - { - p_e.AgencyId = agency?.Id ?? throw new KeyNotFoundException($"Agency '{property.Agency}' does not exist."); - p_e.Agency = agency; - p_e.Name = GenerateName(property.Name, property.Description); - p_e.Description = property.Description.ConvertToUTF8(false); - var lng = property.Longitude != 0 ? property.Longitude : p_e.Location?.X ?? 0; // This is to stop data from some imports resulting in removing the lat/long. - var lat = property.Latitude != 0 ? property.Latitude : p_e.Location?.Y ?? 0; - p_e.Location = new NetTopologySuite.Geometries.Point(lng, lat) { SRID = 4326 }; - p_e.LandArea = property.LandArea != 0 ? property.LandArea : p_e.LandArea; - p_e.LandLegalDescription = property.LandLegalDescription.ConvertToUTF8(); - - Entity.PropertyClassification propClassification; - if (String.Compare("Active", property.Status, true) == 0) - { - propClassification = _propertyClassifications.FirstOrDefault(pc => String.Compare(pc.Name, property.Classification, true) == 0) - ?? throw new KeyNotFoundException($"Property Classification '{property.Classification}' does not exist."); - } - else - { - propClassification = _propertyClassifications.FirstOrDefault(pc => pc.Name == "Disposed") ?? throw new KeyNotFoundException($"Property Classification '{property.Status}' does not exist."); - } - - p_e.ClassificationId = propClassification.Id; - p_e.Classification = propClassification; - - // See if the City matches an AdministrativeArea - var city = _pimsAdminService.AdministrativeArea.Get(property.City.ConvertToUTF8()); - if (city == null) - { - // No City match, see if RegionalDistrict was provided - if (property.RegionalDistrict != null && property.RegionalDistrict.Length > 0) - { - // Map to city if it exists, otherwise throw error - city = _pimsAdminService.AdministrativeArea.Get(property.RegionalDistrict.ConvertToUTF8()) ?? throw new InvalidOperationException($"Regional District '{property.RegionalDistrict}' does not exist in the datasource."); - } - else - { - // City didn't match, RegionalDistrict was not provided, throw error - throw new InvalidOperationException($"Administrative area '{property.City}' does not exist in the datasource and Regional District was not provided."); - } - } - - // Add/Update the address. - if (p_e.AddressId == 0) - { - _logger.LogDebug($"Adding address for parcel '{property.PID}'."); - - var address = new Entity.Address(property.CivicAddress.ConvertToUTF8(), null, city.Name, "BC", property.Postal.ConvertToUTF8()); - p_e.Address = address; - } - else - { - p_e.Address.Address1 = property.CivicAddress.ConvertToUTF8(); - p_e.Address.AdministrativeArea = city.Name; - p_e.Address.Postal = property.Postal.ConvertToUTF8(); - } - } - - // Add a new fiscal values for each year. - if (!p_e.Fiscals.Any(e => e.FiscalYear == fiscalYear)) - { - p_e.Fiscals.Add(new Entity.ParcelFiscal(p_e, fiscalYear, Entity.FiscalKeys.NetBook, property.NetBook)); - } - - // Add a new evaluation if new. - if (!p_e.Evaluations.Any(e => e.Date == evaluationDate)) - { - p_e.Evaluations.Add(new Entity.ParcelEvaluation(p_e, evaluationDate, Entity.EvaluationKeys.Assessed, property.Assessed)); - } - - // A new parcel. - if (p_e.Id == 0) - { - _pimsAdminService.Parcel.Add(p_e); - _logger.LogDebug($"Adding parcel '{property.PID}'"); - } - else - { - _pimsAdminService.Parcel.Update(p_e); - _logger.LogDebug($"Updating parcel '{property.PID}'"); - } - - return p_e; - } - - /// - /// Add or update the building in the datasource. - /// Additionally it will also add building construction types and building predominate uses. - /// - /// - /// - /// - /// - private Entity.Building AddUpdateBuilding(Model.ImportPropertyModel property, int pid, Entity.Agency agency) - { - var name = GenerateName(property.Name, property.Description, property.LocalId); - // Multiple buildings could be returned for the PID and Name. - var b_e = ExceptionHelper.HandleKeyNotFoundWithDefault(() => _pimsAdminService.Building.GetByPidWithoutTracking(pid).FirstOrDefault(n => n.Name == name) ?? throw new KeyNotFoundException()); - var evaluationDate = new DateTime(property.FiscalYear, 1, 1); // Defaulting to Jan 1st because SIS data doesn't have the actual date. - - // Find parcel if the building has an associated pid to a parcel, otherwise there is no parcel - var parcel = pid != 0 ? ExceptionHelper.HandleKeyNotFound(() => _pimsAdminService.Parcel.GetByPidWithoutTracking(pid)) : null; - - // Determine if the last evaluation or fiscal values are older than the one currently being imported. - var fiscalNetBook = b_e.Fiscals.OrderByDescending(f => f.FiscalYear).FirstOrDefault(f => f.Key == Entity.FiscalKeys.NetBook && f.FiscalYear > property.FiscalYear); - var evaluationAssessed = b_e.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == Entity.EvaluationKeys.Assessed && e.Date > evaluationDate); - - // If the parcel is null then the building isn't associated to a parcel, so do nothing --- removed code which added a parcel - - // Only want to update the properties with the latest information. - if (b_e.Id == 0 || fiscalNetBook == null || evaluationAssessed == null) - { - // Copy properties over to entity. - b_e.PropertyTypeId = (int)Entity.PropertyTypes.Building; - b_e.AgencyId = agency?.Id ?? throw new KeyNotFoundException($"Agency '{property.Agency}' does not exist."); - b_e.Agency = agency; - - // if the building has an associated land, then there will be a PID. This is where the association is created when a new ParcelBuilding entry is created for the building and the parcel. - if (property.PID != null && property.PID != "" && parcel != null) - b_e.Parcels.Add(new Entity.ParcelBuilding(parcel, b_e) { Parcel = null, Building = null }); - b_e.Name = name; - b_e.Description = property.Description.ConvertToUTF8(false); - var lng = property.Longitude != 0 ? property.Longitude : b_e.Location?.X ?? 0; // This is to stop data from some imports resulting in removing the lat/long. - var lat = property.Latitude != 0 ? property.Latitude : b_e.Location?.Y ?? 0; - b_e.Location = new NetTopologySuite.Geometries.Point(lng, lat) { SRID = 4326 }; - b_e.RentableArea = property.BuildingRentableArea; - b_e.BuildingFloorCount = property.BuildingFloorCount; - b_e.BuildingTenancy = property.BuildingTenancy.ConvertToUTF8(); - b_e.TransferLeaseOnSale = false; - - Entity.PropertyClassification propClassification; - if (String.Compare("Active", property.Status, true) == 0) - { - propClassification = _propertyClassifications.FirstOrDefault(pc => String.Compare(pc.Name, property.Classification, true) == 0) ?? - throw new KeyNotFoundException($"Property Classification '{property.Classification}' does not exist."); - } - else - { - propClassification = _propertyClassifications.FirstOrDefault(pc => pc.Name == "Disposed") ?? throw new KeyNotFoundException($"Property Classification '{property.Status}' does not exist."); - } - - b_e.ClassificationId = propClassification.Id; - b_e.Classification = propClassification; - - // Find foreign key. - var build_type = _buildingConstructionTypes.FirstOrDefault(bct => String.Compare(bct.Name, property.BuildingConstructionType, true) == 0); - var build_use = _buildingPredominateUses.FirstOrDefault(bpu => String.Compare(bpu.Name, property.BuildingPredominateUse, true) == 0); - - // If the building construction type doesn't exist, create it. - if (build_type == null) - { - var max_id = _buildingConstructionTypes.Max(pc => pc.Id) + 1; - build_type = new Entity.BuildingConstructionType(max_id, property.BuildingConstructionType); - _pimsAdminService.BuildingConstructionType.Add(build_type); - _buildingConstructionTypes.Add(build_type); - } - - // If the building predominate use doesn't exist, create it. - if (build_use == null) - { - var max_id = _buildingPredominateUses.Max(pc => pc.Id) + 1; - build_use = new Entity.BuildingPredominateUse(max_id, property.BuildingPredominateUse); - _pimsAdminService.BuildingPredominateUse.Add(build_use); - _buildingPredominateUses.Add(build_use); - } - - b_e.BuildingConstructionTypeId = build_type.Id; - b_e.BuildingConstructionType = build_type; - b_e.BuildingPredominateUseId = build_use.Id; - b_e.BuildingPredominateUse = build_use; - - - // See if the City matches an AdministrativeArea - var city = _pimsAdminService.AdministrativeArea.Get(property.City.ConvertToUTF8()); - if (city == null) - { - // No City match, see if RegionalDistrict was provided - if (property.RegionalDistrict != null && property.RegionalDistrict.Length > 0) - { - // Map to city if it exists, otherwise throw error - city = _pimsAdminService.AdministrativeArea.Get(property.RegionalDistrict.ConvertToUTF8()) ?? throw new InvalidOperationException($"Regional District '{property.RegionalDistrict}' does not exist in the datasource."); - } - else - { - // City didn't match, RegionalDistrict was not provided, throw error - throw new InvalidOperationException($"Administrative area '{property.City}' does not exist in the datasource and Regional District was not provided."); - } - } - - // Add/Update the address. - if (b_e.AddressId == 0) - { - _logger.LogDebug($"Adding address for building '{property.PID}'-''{property.LocalId}'."); - - var address = new Entity.Address(property.CivicAddress.ConvertToUTF8(), null, city.Name, "BC", property.Postal.ConvertToUTF8()); - b_e.Address = address; - } - else - { - b_e.Address.Address1 = property.CivicAddress.ConvertToUTF8(); - b_e.Address.AdministrativeArea = city.Name; - b_e.Address.Postal = property.Postal.ConvertToUTF8(); - } - } - - // Add a new fiscal values for each year. - if (!b_e.Fiscals.Any(e => e.FiscalYear == property.FiscalYear)) - { - b_e.Fiscals.Add(new Entity.BuildingFiscal(b_e, property.FiscalYear, Entity.FiscalKeys.NetBook, property.NetBook)); - } - - // Add a new evaluation if new. - if (!b_e.Evaluations.Any(e => e.Date == evaluationDate)) - { - b_e.Evaluations.Add(new Entity.BuildingEvaluation(b_e, evaluationDate, Entity.EvaluationKeys.Assessed, property.Assessed)); - } - - // A new building. - if (b_e.Id == 0) - { - _pimsAdminService.Building.Add(b_e); - _logger.LogDebug($"Adding building '{property.LocalId}' to parcel '{property.PID}'"); - } - else - { - _pimsAdminService.Building.Update(b_e); - _logger.LogDebug($"Updating building '{property.LocalId}' to parcel '{property.PID}'"); - } - - return b_e; - } - - /// - /// Generates a name with the specified parameters. - /// - /// - /// - /// - /// - private string GenerateName(string name, string description = null, string localId = null) - { - return (localId == null ? null : $"{localId.ConvertToUTF8()}") + - (name != null ? name.ConvertToUTF8() : description?.Substring(0, 150 < description.Length ? 150 : description.Length).Trim().ConvertToUTF8()); - } - #endregion - } -} diff --git a/backend/api/Areas/Tools/Mapping/Geocoder/AddressMap.cs b/backend/api/Areas/Tools/Mapping/Geocoder/AddressMap.cs deleted file mode 100644 index 1ddcc65073..0000000000 --- a/backend/api/Areas/Tools/Mapping/Geocoder/AddressMap.cs +++ /dev/null @@ -1,90 +0,0 @@ -using Mapster; -using System; -using System.Text; -using GModel = Pims.Geocoder.Models; -using Model = Pims.Api.Areas.Tools.Models.Geocoder; - -namespace Pims.Api.Areas.Tools.Mapping.Geocoder -{ - /// - /// AddressMap class, maps the model properties. - /// - public class AddressMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.SiteId, src => src.Properties.SiteID) - .Map(dest => dest.FullAddress, src => src.Properties.FullAddress) - .Map(dest => dest.Address1, src => GetAddress1(src.Properties)) - .Map(dest => dest.AdministrativeArea, src => GetAdministrativeArea(src.Properties)) - .Map(dest => dest.ProvinceCode, src => src.Properties.ProvinceCode) - .Map(dest => dest.Longitude, src => GetLongtitude(src.Geometry)) - .Map(dest => dest.Latitude, src => GetLatitude(src.Geometry)) - .Map(dest => dest.Score, src => src.Properties.Score); - } - - /// - /// Create an address based on the model property values. - /// - /// - /// - private string GetAddress1(GModel.PropertyModel properties) - { - var address = new StringBuilder(); - if (!String.IsNullOrWhiteSpace($"{ properties.CivicNumber}")) - address.Append($"{properties.CivicNumber} "); - - if (properties.IsStreetTypePrefix && !String.IsNullOrWhiteSpace(properties.StreetType)) - address.Append($"{properties.StreetType} "); - - if (properties.IsStreetDirectionPrefix && !String.IsNullOrWhiteSpace(properties.StreetDirection)) - address.Append($"{properties.StreetDirection} "); - - if (!String.IsNullOrWhiteSpace(properties.StreetName)) - address.Append(properties.StreetName); - - if (!String.IsNullOrWhiteSpace(properties.StreetQualifier)) - address.Append($" {properties.StreetQualifier}"); - - if (!properties.IsStreetDirectionPrefix && !String.IsNullOrWhiteSpace(properties.StreetDirection)) - address.Append($" {properties.StreetDirection}"); - - if (!properties.IsStreetTypePrefix && !String.IsNullOrWhiteSpace(properties.StreetType)) - address.Append($" {properties.StreetType}"); - return address.ToString(); - } - - /// - /// Get the administrative area name (city, municipality, district, etc.) based on the model property values. - /// - /// - /// - private string GetAdministrativeArea(GModel.PropertyModel properties) - { - return properties.LocalityName; - } - - /// - /// Get the latitude from the property value. - /// - /// - /// - private double GetLatitude(GModel.GeometryModel geometry) - { - if (geometry.Coordinates?.Length == 2) return geometry.Coordinates[1]; - return 0; - } - - /// - /// Get the longitude from the property value. - /// - /// - /// - private double GetLongtitude(GModel.GeometryModel geometry) - { - if (geometry.Coordinates?.Length >= 1) return geometry.Coordinates[0]; - return 0; - } - } -} diff --git a/backend/api/Areas/Tools/Mapping/Geocoder/PidsMap.cs b/backend/api/Areas/Tools/Mapping/Geocoder/PidsMap.cs deleted file mode 100644 index 7556baa56a..0000000000 --- a/backend/api/Areas/Tools/Mapping/Geocoder/PidsMap.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using Mapster; -using GModel = Pims.Geocoder.Models; -using Model = Pims.Api.Areas.Tools.Models.Geocoder; - -namespace Pims.Api.Areas.Tools.Mapping.Geocoder -{ - /// - /// PidsMap class, maps the model properties. - /// - public class PidsMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.SiteId, src => src.SiteID) - .Map(dest => dest.Pids, src => StringToList(src.Pids)); - } - - private IEnumerable StringToList(string commaSeparated) - { - return commaSeparated != null ? commaSeparated.Split(",") : Array.Empty(); - } - } -} diff --git a/backend/api/Areas/Tools/Mapping/Import/AddressMap.cs b/backend/api/Areas/Tools/Mapping/Import/AddressMap.cs deleted file mode 100644 index dfc2541844..0000000000 --- a/backend/api/Areas/Tools/Mapping/Import/AddressMap.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Mapster; -using System; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Tools.Models.Import; - -namespace Pims.Api.Areas.Tools.Mapping.Import -{ - public class AddressMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .IgnoreNonMapped(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Line1, src => src.Address1) - .Map(dest => dest.Line2, src => src.Address2) - .Map(dest => dest.AdministrativeArea, src => src.AdministrativeArea) - .Map(dest => dest.ProvinceId, src => src.ProvinceId) - .Map(dest => dest.Province, src => src.Province == null ? null : src.Province.Name) - .Map(dest => dest.Postal, src => src.Postal) - .Inherits(); - - - config.NewConfig() - .IgnoreNonMapped(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Address1, src => src.Line1) - .Map(dest => dest.Address2, src => src.Line2) - .Map(dest => dest.AdministrativeArea, src => src.AdministrativeArea) - .Map(dest => dest.ProvinceId, src => src.ProvinceId) - .Map(dest => dest.Province, src => String.IsNullOrWhiteSpace(src.Province) ? null : new Entity.Province(src.ProvinceId, src.Province)) - .Map(dest => dest.Postal, src => src.Postal) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Tools/Mapping/Import/BuildingEvaluationMap.cs b/backend/api/Areas/Tools/Mapping/Import/BuildingEvaluationMap.cs deleted file mode 100644 index 6d3da6d9dc..0000000000 --- a/backend/api/Areas/Tools/Mapping/Import/BuildingEvaluationMap.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Tools.Models.Import; - -namespace Pims.Api.Areas.Tools.Mapping.Import -{ - public class BuildingEvaluationMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .IgnoreNonMapped(true) - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.Date, src => src.Date) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - - - config.NewConfig() - .IgnoreNonMapped(true) - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.Date, src => src.Date) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Tools/Mapping/Import/BuildingFiscalMap.cs b/backend/api/Areas/Tools/Mapping/Import/BuildingFiscalMap.cs deleted file mode 100644 index bc6253ca8b..0000000000 --- a/backend/api/Areas/Tools/Mapping/Import/BuildingFiscalMap.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Tools.Models.Import; - -namespace Pims.Api.Areas.Tools.Mapping.Import -{ - public class BuildingFiscalMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .IgnoreNonMapped(true) - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.FiscalYear, src => src.FiscalYear) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - - - config.NewConfig() - .IgnoreNonMapped(true) - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.FiscalYear, src => src.FiscalYear) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Tools/Mapping/Import/ParcelBuildingMap.cs b/backend/api/Areas/Tools/Mapping/Import/ParcelBuildingMap.cs deleted file mode 100644 index 65447a6cf4..0000000000 --- a/backend/api/Areas/Tools/Mapping/Import/ParcelBuildingMap.cs +++ /dev/null @@ -1,65 +0,0 @@ -using Mapster; -using Pims.Dal.Helpers.Extensions; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Tools.Models.Import; - -namespace Pims.Api.Areas.Tools.Mapping.Import -{ - public class ParcelBuildingMap : IRegister - { - - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .IgnoreNonMapped(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.ParcelId, src => src.GetParcelId()) - .Map(dest => dest.BuildingConstructionTypeId, src => src.BuildingConstructionTypeId) - .Map(dest => dest.BuildingConstructionType, src => src.GetConstructionType()) - .Map(dest => dest.BuildingOccupantTypeId, src => src.BuildingOccupantTypeId) - .Map(dest => dest.BuildingOccupantType, src => src.GetOccupantType()) - .Map(dest => dest.BuildingPredominateUseId, src => src.BuildingPredominateUseId) - .Map(dest => dest.BuildingPredominateUse, src => src.GetPredominateUse()) - .Map(dest => dest.BuildingTenancy, src => src.BuildingTenancy) - .Map(dest => dest.BuildingFloorCount, src => src.BuildingFloorCount) - .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry) - .Map(dest => dest.OccupantName, src => src.OccupantName) - .Map(dest => dest.RentableArea, src => src.RentableArea) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Inherits(); - - config.NewConfig() - .IgnoreNonMapped(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Location, src => src) - .Map(dest => dest.AddressId, src => src.Address == null ? 0 : src.Address.Id) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.BuildingConstructionTypeId, src => src.BuildingConstructionTypeId) - .Map(dest => dest.BuildingOccupantTypeId, src => src.BuildingOccupantTypeId) - .Map(dest => dest.BuildingPredominateUseId, src => src.BuildingPredominateUseId) - .Map(dest => dest.BuildingTenancy, src => src.BuildingTenancy) - .Map(dest => dest.BuildingFloorCount, src => src.BuildingFloorCount) - .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry) - .Map(dest => dest.OccupantName, src => src.OccupantName) - .Map(dest => dest.RentableArea, src => src.RentableArea) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Inherits(); - - config.NewConfig() - .ConstructUsing(src => Dal.Helpers.GeometryHelper.CreatePoint(src.Longitude, src.Latitude)); - } - } -} diff --git a/backend/api/Areas/Tools/Mapping/Import/ParcelEvaluationMap.cs b/backend/api/Areas/Tools/Mapping/Import/ParcelEvaluationMap.cs deleted file mode 100644 index 5bf3519c78..0000000000 --- a/backend/api/Areas/Tools/Mapping/Import/ParcelEvaluationMap.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Tools.Models.Import; - -namespace Pims.Api.Areas.Tools.Mapping.Import -{ - public class ParcelEvaluationMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .IgnoreNonMapped(true) - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.ParcelId, src => src.ParcelId) - .Map(dest => dest.Date, src => src.Date) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - - - config.NewConfig() - .IgnoreNonMapped(true) - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.ParcelId, src => src.ParcelId) - .Map(dest => dest.Date, src => src.Date) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Tools/Mapping/Import/ParcelFiscalMap.cs b/backend/api/Areas/Tools/Mapping/Import/ParcelFiscalMap.cs deleted file mode 100644 index cf06b10ed0..0000000000 --- a/backend/api/Areas/Tools/Mapping/Import/ParcelFiscalMap.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Tools.Models.Import; - -namespace Pims.Api.Areas.Tools.Mapping.Import -{ - public class ParcelFiscalMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .IgnoreNonMapped(true) - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.ParcelId, src => src.ParcelId) - .Map(dest => dest.FiscalYear, src => src.FiscalYear) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - - - config.NewConfig() - .IgnoreNonMapped(true) - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.ParcelId, src => src.ParcelId) - .Map(dest => dest.FiscalYear, src => src.FiscalYear) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Tools/Mapping/Import/ParcelMap.cs b/backend/api/Areas/Tools/Mapping/Import/ParcelMap.cs deleted file mode 100644 index fbcaba3818..0000000000 --- a/backend/api/Areas/Tools/Mapping/Import/ParcelMap.cs +++ /dev/null @@ -1,61 +0,0 @@ -using Mapster; -using Pims.Api.Mapping.Converters; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Tools.Models.Import; - -namespace Pims.Api.Areas.Tools.Mapping.Import -{ - public class ParcelMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.PID, src => src.ParcelIdentity) - .Map(dest => dest.PIN, src => src.PIN) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Classification, src => src.Classification.Name) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Agency, src => AgencyConverter.ConvertAgency(src.Agency)) - .Map(dest => dest.SubAgency, src => AgencyConverter.ConvertSubAgency(src.Agency)) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.LandArea, src => src.LandArea) - .Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription) - .Map(dest => dest.Zoning, src => src.Zoning) - .Map(dest => dest.ZoningPotential, src => src.ZoningPotential) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.Buildings, src => src.Buildings) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.PID, src => ParcelConverter.ConvertPID(src.PID)) - .Map(dest => dest.PIN, src => src.PIN) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Location, src => src) - .Map(dest => dest.AddressId, src => src.Address == null ? 0 : src.Address.Id) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.LandArea, src => src.LandArea) - .Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription) - .Map(dest => dest.Zoning, src => src.Zoning) - .Map(dest => dest.ZoningPotential, src => src.ZoningPotential) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.Buildings, src => src.Buildings) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Inherits(); - - config.NewConfig() - .ConstructUsing(src => Dal.Helpers.GeometryHelper.CreatePoint(src.Longitude, src.Latitude)); - } - } -} diff --git a/backend/api/Areas/Tools/Mapping/Import/ProjectAgencyResponseMap.cs b/backend/api/Areas/Tools/Mapping/Import/ProjectAgencyResponseMap.cs deleted file mode 100644 index d244752382..0000000000 --- a/backend/api/Areas/Tools/Mapping/Import/ProjectAgencyResponseMap.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Tools.Models.Import; - -namespace Pims.Api.Areas.Tools.Mapping.Import -{ - public class ProjectAgencyResponseMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.AgencyCode, src => src.Agency.Code) - .Map(dest => dest.ReceivedOn, src => src.ReceivedOn) - .Map(dest => dest.Response, src => src.Response) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Tools/Mapping/Import/ProjectMap.cs b/backend/api/Areas/Tools/Mapping/Import/ProjectMap.cs deleted file mode 100644 index b2089e6a59..0000000000 --- a/backend/api/Areas/Tools/Mapping/Import/ProjectMap.cs +++ /dev/null @@ -1,92 +0,0 @@ -using Mapster; -using Microsoft.Extensions.Options; -using Pims.Api.Mapping.Converters; -using Pims.Dal.Helpers.Extensions; -using System.Text.Json; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Tools.Models.Import; - -namespace Pims.Api.Areas.Tools.Mapping.Import -{ - public class ProjectMap : IRegister - { - #region Variables - private readonly JsonSerializerOptions _serializerOptions; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ProjectMap, initializes with specified arguments. - /// - /// - public ProjectMap(IOptions serializerOptions) - { - _serializerOptions = serializerOptions.Value; - } - #endregion - - #region Methods - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.ProjectNumber, src => src.ProjectNumber) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.WorkflowCode, src => src.Workflow.Code) - .Map(dest => dest.Manager, src => src.Manager) - .Map(dest => dest.ReportedFiscalYear, src => src.ReportedFiscalYear) - .Map(dest => dest.ActualFiscalYear, src => src.ActualFiscalYear) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Agency, src => src.Agency.Name) - .Map(dest => dest.AgencyCode, src => src.Agency.Code) - .Map(dest => dest.SubAgency, src => AgencyConverter.ConvertAgency(src.Agency)) - .Map(dest => dest.SubAgencyCode, src => AgencyConverter.ConvertSubAgency(src.Agency)) - .Map(dest => dest.StatusId, src => src.StatusId) - .Map(dest => dest.Status, src => src.Status.Name) - .Map(dest => dest.StatusCode, src => src.Status.Code) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.TierLevelId, src => src.TierLevelId) - .Map(dest => dest.TierLevel, src => src.TierLevel.Name) - .Map(dest => dest.Metadata, src => src.Metadata) - .Map(dest => dest.SubmittedOn, src => src.SubmittedOn) - .Map(dest => dest.ApprovedOn, src => src.ApprovedOn) - .Map(dest => dest.DeniedOn, src => src.DeniedOn) - .Map(dest => dest.CancelledOn, src => src.CancelledOn) - .Map(dest => dest.CompletedOn, src => src.CompletedOn) - .Map(dest => dest.NetBook, src => src.NetBook) - .Map(dest => dest.Market, src => src.Market) - .Map(dest => dest.Assessed, src => src.Assessed) - .Map(dest => dest.Appraised, src => src.Appraised) - .Map(dest => dest.Note, src => src.GetNoteText(Entity.NoteTypes.General)) - .Map(dest => dest.PublicNote, src => src.GetNoteText(Entity.NoteTypes.Public)) - .Map(dest => dest.PrivateNote, src => src.GetNoteText(Entity.NoteTypes.Private)) - .Map(dest => dest.AppraisedNote, src => src.GetNoteText(Entity.NoteTypes.Appraisal)) - .Map(dest => dest.ExemptionRationale, src => src.GetNoteText(Entity.NoteTypes.Exemption)) - .Map(dest => dest.Notes, src => src.Notes) - .Map(dest => dest.Responses, src => src.Responses) - .AfterMapping((src, dest) => - { - var metadata = JsonSerializer.Deserialize(src.Metadata ?? "{}", _serializerOptions); - - dest.ExemptionRequested = metadata.ExemptionRequested; - dest.SalesCost = metadata.SalesCost; - dest.NetProceeds = metadata.NetProceeds; - dest.ProgramCost = metadata.ProgramCost; - dest.GainLoss = metadata.GainLoss; - dest.OcgFinancialStatement = metadata.OcgFinancialStatement; - dest.InterestComponent = metadata.InterestComponent; - dest.InitialNotificationSentOn = metadata.InitialNotificationSentOn; - dest.ThirtyDayNotificationSentOn = metadata.ThirtyDayNotificationSentOn; - dest.SixtyDayNotificationSentOn = metadata.SixtyDayNotificationSentOn; - dest.NinetyDayNotificationSentOn = metadata.NinetyDayNotificationSentOn; - dest.OnHoldNotificationSentOn = metadata.OnHoldNotificationSentOn; - dest.InterestedReceivedOn = metadata.InterestedReceivedOn; - dest.ClearanceNotificationSentOn = metadata.ClearanceNotificationSentOn; - dest.TransferredWithinGreOn = metadata.TransferredWithinGreOn; - dest.MarketedOn = metadata.MarketedOn; - }) - .Inherits(); - } - #endregion - } -} diff --git a/backend/api/Areas/Tools/Mapping/Import/ProjectNoteMap.cs b/backend/api/Areas/Tools/Mapping/Import/ProjectNoteMap.cs deleted file mode 100644 index fa917c19f8..0000000000 --- a/backend/api/Areas/Tools/Mapping/Import/ProjectNoteMap.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Tools.Models.Import; - -namespace Pims.Api.Areas.Tools.Mapping.Import -{ - public class ProjectNoteMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.NoteType, src => src.NoteType) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Tools/Mapping/Import/PropertyMap.cs b/backend/api/Areas/Tools/Mapping/Import/PropertyMap.cs deleted file mode 100644 index 825045fad1..0000000000 --- a/backend/api/Areas/Tools/Mapping/Import/PropertyMap.cs +++ /dev/null @@ -1,58 +0,0 @@ -using Mapster; -using Pims.Api.Mapping.Converters; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Tools.Models.Import; - -namespace Pims.Api.Areas.Tools.Mapping.Import -{ - public class PropertyMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Classification, src => src.Classification.Name) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Agency, src => AgencyConverter.ConvertAgency(src.Agency)) - .Map(dest => dest.SubAgency, src => AgencyConverter.ConvertSubAgency(src.Agency)) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Classification, src => src.Classification.Name) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Agency, src => AgencyConverter.ConvertAgency(src.Agency)) - .Map(dest => dest.SubAgency, src => AgencyConverter.ConvertSubAgency(src.Agency)) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Classification, src => src.Classification.Name) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Agency, src => AgencyConverter.ConvertAgency(src.Agency)) - .Map(dest => dest.SubAgency, src => AgencyConverter.ConvertSubAgency(src.Agency)) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Inherits(); - } - } -} diff --git a/backend/api/Areas/Tools/Models/Geocoder/AddressModel.cs b/backend/api/Areas/Tools/Models/Geocoder/AddressModel.cs deleted file mode 100644 index ea6a256836..0000000000 --- a/backend/api/Areas/Tools/Models/Geocoder/AddressModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace Pims.Api.Areas.Tools.Models.Geocoder -{ - public class AddressModel - { - #region Properties - public string SiteId { get; set; } - public string FullAddress { get; set; } - public string Address1 { get; set; } - public string AdministrativeArea { get; set; } - public string ProvinceCode { get; set; } - public double Latitude { get; set; } - public double Longitude { get; set; } - public int Score { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Tools/Models/Geocoder/SitePidsResponseModel.cs b/backend/api/Areas/Tools/Models/Geocoder/SitePidsResponseModel.cs deleted file mode 100644 index 48e0bfddca..0000000000 --- a/backend/api/Areas/Tools/Models/Geocoder/SitePidsResponseModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Api.Areas.Tools.Models.Geocoder -{ - public class SitePidsResponseModel - { - #region Properties - public Guid SiteId { get; set; } - public IEnumerable Pids { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Tools/Models/Import/AddressModel.cs b/backend/api/Areas/Tools/Models/Import/AddressModel.cs deleted file mode 100644 index 8fe072f16a..0000000000 --- a/backend/api/Areas/Tools/Models/Import/AddressModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Pims.Api.Areas.Tools.Models.Import -{ - public class AddressModel : Api.Models.BaseModel - { - #region Properties - public int Id { get; set; } - - public string Line1 { get; set; } - - public string Line2 { get; set; } - - public string AdministrativeArea { get; set; } - - public string ProvinceId { get; set; } - - public string Province { get; set; } - - public string Postal { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Tools/Models/Import/BuildingEvaluationModel.cs b/backend/api/Areas/Tools/Models/Import/BuildingEvaluationModel.cs deleted file mode 100644 index b2d4b3d492..0000000000 --- a/backend/api/Areas/Tools/Models/Import/BuildingEvaluationModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace Pims.Api.Areas.Tools.Models.Import -{ - public class BuildingEvaluationModel : Api.Models.BaseModel - { - #region Properties - public int BuildingId { get; set; } - - public DateTime Date { get; set; } - - public string Key { get; set; } - - public decimal Value { get; set; } - - public string Note { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Tools/Models/Import/BuildingFiscalModel.cs b/backend/api/Areas/Tools/Models/Import/BuildingFiscalModel.cs deleted file mode 100644 index c385908ff5..0000000000 --- a/backend/api/Areas/Tools/Models/Import/BuildingFiscalModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Pims.Api.Areas.Tools.Models.Import -{ - public class BuildingFiscalModel : Api.Models.BaseModel - { - #region Properties - public int BuildingId { get; set; } - - public int FiscalYear { get; set; } - - public string Key { get; set; } - - public decimal Value { get; set; } - - public string Note { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Tools/Models/Import/ImportProjectModel.cs b/backend/api/Areas/Tools/Models/Import/ImportProjectModel.cs deleted file mode 100644 index a228ae156f..0000000000 --- a/backend/api/Areas/Tools/Models/Import/ImportProjectModel.cs +++ /dev/null @@ -1,227 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Api.Areas.Tools.Models.Import -{ - /// - /// ImportProjectModel class, provides a way to import projects into PIMS. - /// - public class ImportProjectModel - { - #region Properties - #region Identity - /// - /// get/set - The unique ID for the project. - /// - public string ProjectNumber { get; set; } - - /// - /// get/set - The fiscal year the project was reported. - /// - public int ReportedFiscalYear { get; set; } - - /// - /// get/set - The forecasted or actual fiscal year the project was disposed. - /// - public int ActualFiscalYear { get; set; } - - /// - /// get/set - The major activity the project is currently under. - /// - public string Activity { get; set; } - - /// - /// get/set - The workflow the project is in. - /// If not provided the 'Status' will be used to determine the workflow. - /// - public string Workflow { get; set; } - - /// - /// get/set - The status of the project. - /// - public string Status { get; set; } - - /// - /// get/set - The agency name this project belongs to. - /// - public string Agency { get; set; } - - /// - /// get/set - The project description. - /// - public string Description { get; set; } - - /// - /// get/set - The parcel land legal description. - /// - public string LandLegalDescription { get; set; } - - /// - /// get/set - Risk value. - /// - public string Risk { get; set; } - - /// - /// get/set - The project manager information. - /// - public string Manager { get; set; } - - /// - /// get/set - The location of the project. - /// - public string Location { get; set; } - #endregion - - #region Dates - /// - /// get/set - The date the project was completed. - /// - public DateTime? CompletedOn { get; set; } - - /// - /// get/set - The date the project was disposed. - /// - public DateTime? DisposedOn { get; set; } - #endregion - - #region Notes - /// - /// get/set - Collection of notes whose type is identified by their 'key'. - /// - public ICollection> Notes { get; set; } = new List>(); - #endregion - - #region ERP - /// - /// get/set - Whether an exemption was requested for the ERP. - /// - public bool ExemptionRequested { get; set; } - - /// - /// get/set - When the initial enhanced referral notification was sent. - /// - public DateTime? InitialNotificationSentOn { get; set; } - - /// - /// get/set - When interest was received on. - /// - public DateTime? InterestedReceivedOn { get; set; } - - /// - /// get/set - When the clearance enhanced referral notification was sent. - /// - public DateTime? ClearanceNotificationSentOn { get; set; } - #endregion - - #region SPL - /// - /// get/set - When a request to be added to SPL was received. - /// - public DateTime? RequestForSplReceivedOn { get; set; } - - /// - /// get/set - When the project was approved to be added to SPL. - /// - public DateTime? ApprovedForSplOn { get; set; } - - /// - /// get/set - The date the project was marketed. - /// - public DateTime? MarketedOn { get; set; } - - /// - /// get/set - Text field describing project purchaser. - /// - public string Purchaser { get; set; } - - /// - /// get/set - Whether or not the contract for the project is conditional - /// - public bool? IsContractConditional { get; set; } - #endregion - - #region Financials - /// - /// get/set - The market value. - /// - public decimal Market { get; set; } - - /// - /// get/set - The net book value. - /// - public decimal NetBook { get; set; } - - /// - /// get/set - The assessed value. - /// - public decimal? Assessed { get; set; } - - /// - /// get/set - The appraised value. - /// - public decimal? Appraised { get; set; } - - /// - /// get/set - The firm that did the appraisal. - /// - public string AppraisedBy { get; set; } - - /// - /// get/set - The date the appraisal was provided. - /// - public DateTime? AppraisedOn { get; set; } - - /// - /// get/set - The program costs of the sale. - /// - public decimal? ProgramCost { get; set; } - - /// - /// get/set - The gain or loss of the sale. - /// - public decimal? GainLoss { get; set; } - - /// - /// get/set - The interest component of the sale. - /// - public decimal? InterestComponent { get; set; } - - /// - /// get/set - Costs of the sale. - /// - public decimal? SalesCost { get; set; } - - /// - /// get/set - The net proceeds of the sale. - /// - public decimal NetProceeds { get; set; } - - /// - /// get/set - The prior reported net proceeds of the sale. - /// - public decimal? PriorNetProceeds { get; set; } - - /// - /// get/set - The variance between the prior net proceeds and the current net proceeds. - /// - public decimal? Variance { get; set; } - - /// - /// get/set - OCG financial statement value. - /// - public decimal? OcgFinancialStatement { get; set; } - - /// - /// get/set - Whether the sale included a lease in the price. - /// - public bool SaleWithLeaseInPlace { get; set; } - - /// - /// get/set - The date to create the prior snapshot for. - /// - public DateTime? SnapshotOn { get; set; } - #endregion - - #endregion - } -} diff --git a/backend/api/Areas/Tools/Models/Import/ImportPropertyModel.cs b/backend/api/Areas/Tools/Models/Import/ImportPropertyModel.cs deleted file mode 100644 index 6dcb088bbf..0000000000 --- a/backend/api/Areas/Tools/Models/Import/ImportPropertyModel.cs +++ /dev/null @@ -1,39 +0,0 @@ -namespace Pims.Api.Areas.Tools.Models.Import -{ - public class ImportPropertyModel - { - #region Properties - public bool Updated { get; set; } - public bool Added { get; set; } - public string ParcelId { get; set; } - public string PID { get; set; } - public string PIN { get; set; } - public string Status { get; set; } - public int FiscalYear { get; set; } - public string Agency { get; set; } - public string AgencyCode { get; set; } - public string SubAgency { get; set; } - public string PropertyType { get; set; } - public string LocalId { get; set; } - public string Name { get; set; } - public string Description { get; set; } - public string Classification { get; set; } - public string CivicAddress { get; set; } - public string City { get; set; } - public string Postal { get; set; } - public double Latitude { get; set; } - public double Longitude { get; set; } - public float LandArea { get; set; } - public string LandLegalDescription { get; set; } - public int BuildingFloorCount { get; set; } - public string BuildingConstructionType { get; set; } - public string BuildingPredominateUse { get; set; } - public string BuildingTenancy { get; set; } - public float BuildingRentableArea { get; set; } - public decimal Assessed { get; set; } - public decimal NetBook { get; set; } - public string RegionalDistrict { get; set; } - public string Error { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Tools/Models/Import/ParcelBuildingModel.cs b/backend/api/Areas/Tools/Models/Import/ParcelBuildingModel.cs deleted file mode 100644 index 78185e91c2..0000000000 --- a/backend/api/Areas/Tools/Models/Import/ParcelBuildingModel.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Api.Areas.Tools.Models.Import -{ - public class ParcelBuildingModel : Pims.Api.Models.BaseModel - { - #region Properties - public int Id { get; set; } - - public int ParcelId { get; set; } - - public int AgencyId { get; set; } - - public string Name { get; set; } - - public string Description { get; set; } - - public AddressModel Address { get; set; } - - public double Latitude { get; set; } - - public double Longitude { get; set; } - - public int BuildingConstructionTypeId { get; set; } - - public string BuildingConstructionType { get; set; } - - public int BuildingFloorCount { get; set; } - - public int BuildingPredominateUseId { get; set; } - - public string BuildingPredominateUse { get; set; } - - public int BuildingOccupantTypeId { get; set; } - - public string BuildingOccupantType { get; set; } - - public string BuildingTenancy { get; set; } - - public float RentableArea { get; set; } - - public string OccupantName { get; set; } - - public DateTime? LeaseExpiry { get; set; } - - public bool IsSensitive { get; set; } - - public IEnumerable Evaluations { get; set; } = new List(); - - public IEnumerable Fiscals { get; set; } = new List(); - #endregion - } -} diff --git a/backend/api/Areas/Tools/Models/Import/ParcelEvaluationModel.cs b/backend/api/Areas/Tools/Models/Import/ParcelEvaluationModel.cs deleted file mode 100644 index 614db7f022..0000000000 --- a/backend/api/Areas/Tools/Models/Import/ParcelEvaluationModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace Pims.Api.Areas.Tools.Models.Import -{ - public class ParcelEvaluationModel : Api.Models.BaseModel - { - #region Properties - public int ParcelId { get; set; } - - public DateTime Date { get; set; } - - public string Key { get; set; } - - public decimal Value { get; set; } - - public string Note { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Tools/Models/Import/ParcelFiscalModel.cs b/backend/api/Areas/Tools/Models/Import/ParcelFiscalModel.cs deleted file mode 100644 index 838b360592..0000000000 --- a/backend/api/Areas/Tools/Models/Import/ParcelFiscalModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Pims.Api.Areas.Tools.Models.Import -{ - public class ParcelFiscalModel : Api.Models.BaseModel - { - #region Properties - public int ParcelId { get; set; } - - public int FiscalYear { get; set; } - - public string Key { get; set; } - - public decimal Value { get; set; } - - public string Note { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Tools/Models/Import/ParcelModel.cs b/backend/api/Areas/Tools/Models/Import/ParcelModel.cs deleted file mode 100644 index ae8c13bdc3..0000000000 --- a/backend/api/Areas/Tools/Models/Import/ParcelModel.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Collections.Generic; - -namespace Pims.Api.Areas.Tools.Models.Import -{ - public class ParcelModel : PropertyModel - { - #region Properties - public string PID { get; set; } - - public int PIN { get; set; } - - public float LandArea { get; set; } - - public string LandLegalDescription { get; set; } - - public string Zoning { get; set; } - - public string ZoningPotential { get; set; } - - public IEnumerable Evaluations { get; set; } = new List(); - - public IEnumerable Fiscals { get; set; } = new List(); - - public IEnumerable Buildings { get; set; } = new List(); - #endregion - } -} diff --git a/backend/api/Areas/Tools/Models/Import/ProjectAgencyResponseModel.cs b/backend/api/Areas/Tools/Models/Import/ProjectAgencyResponseModel.cs deleted file mode 100644 index ccc3c35a4f..0000000000 --- a/backend/api/Areas/Tools/Models/Import/ProjectAgencyResponseModel.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Pims.Dal.Entities; -using System; - -namespace Pims.Api.Areas.Tools.Models.Import -{ - /// - /// ProjectAgencyResponseModel class, provides a model to represent a project agency response. - /// - public class ProjectAgencyResponseModel : Pims.Api.Models.BaseModel - { - #region Properties - /// - /// get/set - The foreign key to the agency. - /// - public int AgencyId { get; set; } - - /// - /// get/set - The agency code. - /// - public string AgencyCode { get; set; } - - /// - /// get/set - When the response was received. - /// - public DateTime ReceivedOn { get; set; } - - /// - /// get/set - The response. - /// - public NotificationResponses Response { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Tools/Models/Import/ProjectModel.cs b/backend/api/Areas/Tools/Models/Import/ProjectModel.cs deleted file mode 100644 index 4b61248050..0000000000 --- a/backend/api/Areas/Tools/Models/Import/ProjectModel.cs +++ /dev/null @@ -1,284 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Api.Areas.Tools.Models.Import -{ - public class ProjectModel : Pims.Api.Models.BaseModel - { - #region Properties - /// - /// get/set - The primary key provides a unique identity for the project. - /// - public int Id { get; set; } - - /// - /// get/set - A unique identity for the project. - /// - public string ProjectNumber { get; set; } - - /// - /// get/set - A display name to identify the project. - /// - public string Name { get; set; } - - /// - /// get/set - The current workflow the project is in. - /// - public string WorkflowCode { get; set; } - - /// - /// get/set - The project manager name(s). - /// - public string Manager { get; set; } - - /// - /// get/set - The reported fiscal year this project. - /// - public int ReportedFiscalYear { get; set; } - - /// - /// get/set - The actual or forecasted fiscal year. - /// - public int ActualFiscalYear { get; set; } - - /// - /// get/set - The foreign key to the owning agency. - /// - public int AgencyId { get; set; } - - /// - /// get/set - The owning agency name. - /// - public string Agency { get; set; } - - /// - /// get/set - The owning agency code. - /// - public string AgencyCode { get; set; } - - /// - /// get/set - The owning subagency name. - /// - public string SubAgency { get; set; } - - /// - /// get/set - The owning subagency code. - /// - public string SubAgencyCode { get; set; } - - /// - /// get/set - The foreign key to the project status. - /// - public int StatusId { get; set; } - - /// - /// get/set - The project status. - /// - public string Status { get; set; } - - /// - /// get/set - The code of the project status. - /// - public string StatusCode { get; set; } - - /// - /// get/set - A description of the project. - /// - public string Description { get; set; } - - /// - /// get/set - A simple way to capture notes for the project. - /// - public string Note { get; set; } - - /// - /// get/set - The foreign key to the tier level. - /// - public int TierLevelId { get; set; } - - /// - /// get/set - The tier level. - /// - public string TierLevel { get; set; } - - /// - /// get/set - A shared note between SRES and agency. - /// - public string PublicNote { get; set; } - - /// - /// get/set - Appraised note - /// - public string AppraisedNote { get; set; } - - /// - /// get/set - A private note for SRES only. - /// - - public string PrivateNote { get; set; } - - /// - /// get/set - Additional serialized metadata. - /// - public string Metadata { get; set; } - - #region ERP - /// - /// get/set - Interests from ERP note. - /// - public string InterestFromEnhancedReferralNote { get; set; } - - /// - /// get/set - The date interest was received. - /// - public DateTime? InterestedReceivedOn { get; set; } - #endregion - - #region Dates - /// - /// get/set - When the project was submitted. - /// - public DateTime? SubmittedOn { get; set; } - - /// - /// get/set - When the project was approved. - /// - public DateTime? ApprovedOn { get; set; } - - /// - /// get/set - When the initial enhanced referral notification was sent. - /// - public DateTime? InitialNotificationSentOn { get; set; } - - /// - /// get/set - When the 30 day enhanced referral notification was sent. - /// - public DateTime? ThirtyDayNotificationSentOn { get; set; } - - /// - /// get/set - When the 60 day enhanced referral notification was sent. - /// - public DateTime? SixtyDayNotificationSentOn { get; set; } - - /// - /// get/set - When the 90 day enhanced referral notification was sent. - /// - public DateTime? NinetyDayNotificationSentOn { get; set; } - - /// - /// get/set - When the on hold enhanced referral notification was sent. - /// - public DateTime? OnHoldNotificationSentOn { get; set; } - - /// - /// get/set - When the project was transferred within the GRE. - /// - public DateTime? TransferredWithinGreOn { get; set; } - - /// - /// get/set - When the clearance enhanced referral notification was sent. - /// - public DateTime? ClearanceNotificationSentOn { get; set; } - - /// - /// get/set - When the project was denied. - /// - public DateTime? DeniedOn { get; set; } - - /// - /// get/set - When the project was cancelled. - /// - public DateTime? CancelledOn { get; set; } - - /// - /// get/set - When the project was externally marketed. - /// - public DateTime? MarketedOn { get; set; } - - /// - /// get/set - When the project was disposed. - /// - public DateTime? CompletedOn { get; set; } - #endregion - - #region Exemption - /// - /// get/set - Whether an exemption was requested for the ERP. - /// - public bool ExemptionRequested { get; set; } - - /// - /// get/set - The rational for the exemption from ERP. - /// - public string ExemptionRationale { get; set; } - #endregion - - #region Financials - /// - /// get/set - The netbook value. - /// - public decimal NetBook { get; set; } - - /// - /// get/set - The market value. - /// - public decimal Market { get; set; } - - /// - /// get/set - The appraised value. - /// - public decimal? Appraised { get; set; } - - /// - /// get/set - The assessed value. - /// - public decimal Assessed { get; set; } - - /// - /// get/set - The sales cost. - /// - public decimal? SalesCost { get; set; } - - /// - /// get/set - The net proceeds - /// - public decimal? NetProceeds { get; set; } - - /// - /// get/set - The program cost. - /// - public decimal? ProgramCost { get; set; } - - /// - /// get/set - The gain or loss from selling the properties. - /// - public decimal? GainLoss { get; set; } - - /// - /// get/set - OCG final statement. - /// - public decimal? OcgFinancialStatement { get; set; } - - /// - /// get/set - Record the interest component. - /// - public decimal? InterestComponent { get; set; } - #endregion - - ///// - ///// get - A collection of properties associated to this project. - ///// - //public IEnumerable Properties { get; set; } - - /// - /// get - A collection of notes for this project. - /// - public IEnumerable Notes { get; set; } - - /// - /// get - A collection of responses for this project. - /// - public IEnumerable Responses { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Tools/Models/Import/ProjectNoteModel.cs b/backend/api/Areas/Tools/Models/Import/ProjectNoteModel.cs deleted file mode 100644 index 901d74eabd..0000000000 --- a/backend/api/Areas/Tools/Models/Import/ProjectNoteModel.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Pims.Dal.Entities; - -namespace Pims.Api.Areas.Tools.Models.Import -{ - /// - /// ProjectNoteModel class, provides a model to represent a project note. - /// - public class ProjectNoteModel : Pims.Api.Models.BaseModel - { - #region Properties - /// - /// get/set - The primary key for the project note. - /// - public int Id { get; set; } - - /// - /// get/set - The type of note. - /// - public NoteTypes NoteType { get; set; } - - /// - /// get/set - The note. - /// - public string Note { get; set; } - #endregion - } -} diff --git a/backend/api/Areas/Tools/Models/Import/PropertyModel.cs b/backend/api/Areas/Tools/Models/Import/PropertyModel.cs deleted file mode 100644 index cbb5a8d52f..0000000000 --- a/backend/api/Areas/Tools/Models/Import/PropertyModel.cs +++ /dev/null @@ -1,37 +0,0 @@ -namespace Pims.Api.Areas.Tools.Models.Import -{ - public class PropertyModel : Pims.Api.Models.BaseModel - { - #region Properties - public int Id { get; set; } - - public string ProjectNumber { get; set; } - - public int StatusId { get; set; } - - public string Status { get; set; } - - public string Name { get; set; } - - public string Description { get; set; } - - public int ClassificationId { get; set; } - - public string Classification { get; set; } - - public int AgencyId { get; set; } - - public string SubAgency { get; set; } - - public string Agency { get; set; } - - public AddressModel Address { get; set; } - - public double Latitude { get; set; } - - public double Longitude { get; set; } - - public bool IsSensitive { get; set; } - #endregion - } -} diff --git a/backend/api/Controllers/AuthController.cs b/backend/api/Controllers/AuthController.cs deleted file mode 100644 index c5b3c62a10..0000000000 --- a/backend/api/Controllers/AuthController.cs +++ /dev/null @@ -1,126 +0,0 @@ -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Options; -using Pims.Core.Extensions; -using Pims.Dal; -using Swashbuckle.AspNetCore.Annotations; -using System; -using System.Collections.Generic; -using System.Linq; -using Model = Pims.Api.Models.Auth; - -namespace Pims.Api.Controllers -{ - /// - /// AuthController class, provides endpoints for authentication. - /// - [ApiController] - [ApiVersion("1.0")] - [Route("v{version:apiVersion}/auth")] - [Route("auth")] - public class AuthController : ControllerBase - { - #region Variables - private readonly Keycloak.Configuration.KeycloakOptions _optionsKeycloak; - private readonly IPimsService _pimsService; - - #endregion - - #region Constructors - /// - /// Creates a new instance of a AuthController class, initializes it with the specified arguments. - /// - /// - /// - public AuthController(IOptionsMonitor optionsKeycloak, IPimsService pimsService) - { - _optionsKeycloak = optionsKeycloak.CurrentValue; - _pimsService = pimsService; - } - #endregion - - #region Endpoints - /// - /// Activates the new authenticated user with PIMS. - /// If the user is new it will return 201 if successful. - /// If the user exists already it will return 200 if successful. - /// Note - This requires KeyCloak client mapping to include the appropriate claims to activate the user (email, family name, given name, groups, realm roles). - /// - /// - [Authorize] - [HttpPost("activate")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.UserModel), 200)] - [SwaggerOperation(Tags = new[] { "auth" })] - public IActionResult Activate() - { - string username = this.User.GetUsername(); - var exists = _pimsService.User.UserExists(username); - - var user = _pimsService.User.Activate(); - if (!exists) - { - return new CreatedResult($"{user.Id}", new Model.UserModel(user)); - } - - return new JsonResult(new Model.UserModel(user.Id, user.KeycloakUserId)); - } - - /// - /// Redirect user to registration page. - /// - /// - [HttpGet("register")] - [SwaggerOperation(Tags = new[] { "auth" })] - public IActionResult Register(string redirect_uri) - { - var uri = new UriBuilder($"{_optionsKeycloak.Authority}{_optionsKeycloak.OpenIdConnect.Register}"); - uri.AppendQuery("client_id", _optionsKeycloak.Client); - uri.AppendQuery("redirect_uri", redirect_uri); - return Redirect(uri.ToString()); - } - - /// - /// Redirect to the keycloak login page. - /// - /// - [HttpGet("login")] - [SwaggerOperation(Tags = new[] { "auth" })] - public IActionResult Login(string redirect_uri) - { - var uri = new UriBuilder($"{_optionsKeycloak.Authority}{_optionsKeycloak.OpenIdConnect.Login}"); - uri.AppendQuery("client_id", _optionsKeycloak.Client); - uri.AppendQuery("redirect_uri", redirect_uri); - return Redirect(uri.ToString()); - } - - /// - /// Log the current user out. - /// - /// - [HttpPost("logout")] - [SwaggerOperation(Tags = new[] { "auth" })] - public IActionResult Logout(string redirect_uri) - { - var uri = new UriBuilder($"{_optionsKeycloak.Authority}{_optionsKeycloak.OpenIdConnect.Logout}"); - uri.AppendQuery("client_id", _optionsKeycloak.Client); - uri.AppendQuery("redirect_uri", redirect_uri); - return Redirect(uri.ToString()); - } - - /// - /// Return a list of claims for the current user. - /// - /// - [Authorize] - [HttpGet("claims")] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [SwaggerOperation(Tags = new[] { "auth" })] - public IActionResult Claims() - { - return new JsonResult(User.Claims.Select(c => new Model.ClaimModel(c.Type, c.Value))); - } - #endregion - } -} diff --git a/backend/api/Controllers/ErrorController.cs b/backend/api/Controllers/ErrorController.cs deleted file mode 100644 index 99977327f8..0000000000 --- a/backend/api/Controllers/ErrorController.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Diagnostics; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; - -namespace Pims.Api.Controllers -{ - /// - /// ErrorController class, provides endpoints to handle exception errors. - /// - public class ErrorController : ControllerBase - { - #region Variables - private readonly ILogger _logger; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ErrorController class. - /// - /// - public ErrorController(ILogger logger) - { - _logger = logger; - } - #endregion - - #region Endpoints - /// - /// Returns a json result with the error details. - /// - /// - [AllowAnonymous] - [Produces("application/json")] - public IActionResult Error() - { - var exceptionHandlerPathFeature = HttpContext.Features.Get(); - _logger.LogError(exceptionHandlerPathFeature.Error, "Unhandled error occured."); - return new JsonResult(new { RequestId = System.Diagnostics.Activity.Current?.Id ?? HttpContext.TraceIdentifier }); - } - #endregion - } -} diff --git a/backend/api/Controllers/HealthController.cs b/backend/api/Controllers/HealthController.cs deleted file mode 100644 index 08a578e992..0000000000 --- a/backend/api/Controllers/HealthController.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -using Swashbuckle.AspNetCore.Annotations; -using Model = Pims.Api.Models.Health; - -namespace Pims.Api.Controllers -{ - /// - /// HealthController class, provides endpoints to check the health of the api. - /// - [ApiController] - [ApiVersion("1.0")] - [Route("v{version:apiVersion}/health")] - [Route("health")] - public class HealthController : ControllerBase - { - #region Variables - private readonly ILogger _logger; - private readonly IWebHostEnvironment _environment; - #endregion - - #region Constructors - /// - /// Creates a new instances of a HealthController class, initializes it with the specified arguments. - /// - /// - /// - public HealthController(IWebHostEnvironment environment, ILogger logger) - { - _logger = logger; - _environment = environment; - } - #endregion - - #region Endpoints - /// - /// Return environment information. - /// - /// - [HttpGet("env")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.EnvModel), 200)] - [SwaggerOperation(Tags = new[] { "health" })] - public IActionResult Environment() - { - return new JsonResult(new Model.EnvModel(_environment)); - } - #endregion - } -} diff --git a/backend/api/Controllers/LookupController.cs b/backend/api/Controllers/LookupController.cs deleted file mode 100644 index ab490bbaea..0000000000 --- a/backend/api/Controllers/LookupController.cs +++ /dev/null @@ -1,147 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Pims.Dal; -using Swashbuckle.AspNetCore.Annotations; -using System.Collections.Generic; -using System.Linq; -using Model = Pims.Api.Models.Lookup; - -namespace Pims.Api.Controllers -{ - /// - /// LookupController class, provides endpoints for code lookups. - /// - [Authorize] - [ApiController] - [ApiVersion("1.0")] - [Route("v{version:apiVersion}/lookup")] - [Route("lookup")] - public class LookupController : ControllerBase - { - #region Variables - private readonly IPimsService _pimsService; - private readonly IMapper _mapper; - #endregion - - #region Constructors - /// - /// Creates a new instance of a LookupController class. - /// - /// - /// - public LookupController(IPimsService pimsService, IMapper mapper) - { - _pimsService = pimsService; - _mapper = mapper; - } - #endregion - - #region Endpoints - /// - /// Get all of the agency code values - /// - /// - [HttpGet("agencies")] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable>), 200)] - [SwaggerOperation(Tags = new[] { "lookup" })] - public IActionResult GetAgencies() - { - var agencyCodes = _mapper.Map[]>(_pimsService.Lookup.GetAgencies()); - return new JsonResult(agencyCodes.ToArray()); - } - - /// - /// Get all of the role code values - /// - /// - [HttpGet("roles")] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), 200)] - [SwaggerOperation(Tags = new[] { "lookup" })] - public IActionResult GetRoles() - { - var roleCodes = _mapper.Map(_pimsService.Lookup.GetRoles()); - return new JsonResult(roleCodes.ToArray()); - } - - /// - /// Get all of the property classification code values - /// - /// - [HttpGet("property/classifications")] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable>), 200)] - [SwaggerOperation(Tags = new[] { "lookup" })] - public IActionResult GetPropertyClassifications() - { - var propertyClassificationCodes = _mapper.Map[]>(_pimsService.Lookup.GetPropertyClassifications()); - return new JsonResult(propertyClassificationCodes.ToArray()); - } - - /// - /// Get all of the project tier levels. - /// - /// - [HttpGet("project/tier/levels")] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable>), 200)] - [SwaggerOperation(Tags = new[] { "lookup" })] - public IActionResult GetTierLevels() - { - var tierLevels = _mapper.Map[]>(_pimsService.Lookup.GetTierLevels()); - return new JsonResult(tierLevels.ToArray()); - } - - /// - /// Get all of the project risks. - /// - /// - [HttpGet("project/risks")] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable>), 200)] - [SwaggerOperation(Tags = new[] { "lookup" })] - public IActionResult GetProjectRisks() - { - var risks = _mapper.Map[]>(_pimsService.Lookup.GetProjectRisks()); - return new JsonResult(risks.ToArray()); - } - - /// - /// Get all of the code values - /// - /// - [HttpGet("all")] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable>), 200)] - [SwaggerOperation(Tags = new[] { "lookup" })] - public IActionResult GetAll() - { - var agencyCodes = _mapper.Map[]>(_pimsService.Lookup.GetAgencies()); - var propertyClassificationCodes = _mapper.Map[]>(_pimsService.Lookup.GetPropertyClassifications()); - var roleCodes = _mapper.Map(_pimsService.Lookup.GetRoles()); - var provinceCodes = _mapper.Map[]>(_pimsService.Lookup.GetProvinces()); - var administrativeAreaCodes = _mapper.Map[]>(_pimsService.Lookup.GetAdministrativeAreas()); - var constructionTypeCodes = _mapper.Map[]>(_pimsService.Lookup.GetBuildingConstructionTypes()); - var predominateUseCodes = _mapper.Map[]>(_pimsService.Lookup.GetBuildingPredominateUses()); - var occupantTypeCodes = _mapper.Map[]>(_pimsService.Lookup.GetBuildingOccupantTypes()); - var tierLevelCodes = _mapper.Map[]>(_pimsService.Lookup.GetTierLevels()); - var riskCodes = _mapper.Map[]>(_pimsService.Lookup.GetProjectRisks()); - - var codes = new List(); - codes.AddRange(roleCodes); - codes.AddRange(agencyCodes); - codes.AddRange(propertyClassificationCodes); - codes.AddRange(provinceCodes); - codes.AddRange(administrativeAreaCodes); - codes.AddRange(constructionTypeCodes); - codes.AddRange(predominateUseCodes); - codes.AddRange(occupantTypeCodes); - codes.AddRange(tierLevelCodes); - codes.AddRange(riskCodes); - return new JsonResult(codes); - } - #endregion - } -} diff --git a/backend/api/Controllers/UserController.cs b/backend/api/Controllers/UserController.cs deleted file mode 100644 index 46eabe753d..0000000000 --- a/backend/api/Controllers/UserController.cs +++ /dev/null @@ -1,213 +0,0 @@ -using System.Collections.Generic; -using MapsterMapper; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Pims.Api.Helpers.Exceptions; -using Pims.Api.Helpers.Extensions; -using Pims.Api.Models.User; -using Pims.Core.Http; -using Pims.Dal; -using Swashbuckle.AspNetCore.Annotations; -using System; -using System.Linq; -using System.Threading.Tasks; -using Entity = Pims.Dal.Entities; -using KModel = Pims.Keycloak.Models; -using Model = Pims.Api.Models.User; - -namespace Pims.Api.Controllers -{ - /// - /// UserController class, provides endpoints for managing users. - /// - [Authorize] - [ApiController] - [ApiVersion("1.0")] - [Route("v{version:apiVersion}/users")] - [Route("users")] - public class UserController : ControllerBase - { - #region Variables - private readonly ILogger _logger; - private readonly Keycloak.Configuration.KeycloakOptions _optionsKeycloak; - private readonly IProxyRequestClient _requestClient; - private readonly IPimsService _pimsService; - private readonly IMapper _mapper; - private readonly PimsOptions _options; - #endregion - - #region Constructors - /// - /// Creates a new instance of a UserController class. - /// - /// - /// - /// - /// - /// - /// - public UserController(ILogger logger, IOptionsMonitor optionsKeycloak, IOptions options, IPimsService pimsService, IMapper mapper, IProxyRequestClient requestClient) - { - _logger = logger; - _optionsKeycloak = optionsKeycloak.CurrentValue; - _requestClient = requestClient; - _pimsService = pimsService; - _mapper = mapper; - _options = options.Value; - } - #endregion - - #region Endpoints - /// - /// Redirects user to the keycloak user info endpoint. - /// - /// - [HttpGet("info")] - [Produces("application/json")] - [ProducesResponseType(typeof(KModel.UserInfoModel), 200)] - [ProducesResponseType(typeof(Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "user" })] - public async Task UserInfoAsync() - { - _optionsKeycloak.Validate(); // TODO: Validate configuration automatically. - _optionsKeycloak.OpenIdConnect.Validate(); - var response = await _requestClient.ProxyGetAsync(Request, $"{_optionsKeycloak.Authority}{_optionsKeycloak.OpenIdConnect.UserInfo}"); - return await response.HandleResponseAsync(); - } - - #region Access Requests - /// - /// Get the most recent access request for the current user. - /// - /// - [HttpGet("access/requests")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.AccessRequestModel), 200)] - [ProducesResponseType(204)] - [SwaggerOperation(Tags = new[] { "user" })] - public IActionResult GetAccessRequest() - { - var accessRequest = _pimsService.User.GetAccessRequest(); - if (accessRequest == null) return NoContent(); - return new JsonResult(_mapper.Map(accessRequest)); - } - - /// - /// Get the most recent access request for the current user. - /// - /// - [HttpGet("access/requests/{id}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.AccessRequestModel), 200)] - [ProducesResponseType(typeof(Models.ErrorResponseModel), 400)] - [ProducesResponseType(typeof(Models.ErrorResponseModel), 403)] - [SwaggerOperation(Tags = new[] { "user" })] - public IActionResult GetAccessRequest(int id) - { - var accessRequest = _pimsService.User.GetAccessRequest(id); - return new JsonResult(_mapper.Map(accessRequest)); - } - - /// - /// POST /api/users/access/requests/${id} - Provides a way for a user to submit - /// an access request to the system, associating a role and agency to their user. - /// - /// - [HttpPost("access/requests")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.AccessRequestModel), 201)] - [ProducesResponseType(typeof(Models.ErrorResponseModel), 400)] - [SwaggerOperation(Tags = new[] { "user" })] - public async Task AddAccessRequestAsync([FromBody] Model.AccessRequestModel model) - { - if (model == null || model.Agencies == null || model.Roles == null) - { - throw new BadRequestException("Invalid access request specified"); - } - if (model.Agencies.Count() != 1) - { - throw new BadRequestException("Each access request can only contain one agency."); - } - if (model.Roles.Count() != 1) - { - throw new BadRequestException("Each access request can only contain one role."); - } - var accessRequest = _mapper.Map(model); - _pimsService.User.AddAccessRequest(accessRequest); - - // Send notification to administrators and RPD mailbox - try - { - var template = _pimsService.NotificationTemplate.Get(_options.AccessRequest.NotificationTemplate); - var templateForRPD = _pimsService.NotificationTemplate.Get(_options.AccessRequest.RPDNotificationTemplate); - var administrators = _pimsService.User.GetAdmininstrators(accessRequest.Agencies.Select(a => a.AgencyId).ToArray()); - var notification = _pimsService.NotificationQueue.GenerateNotification( - String.Join(";", administrators.Select(a => a.Email).Concat(new[] { _options.AccessRequest.SendTo }).Where(e => !String.IsNullOrWhiteSpace(e))), - "", - template, - new AccessRequestNotificationModel(accessRequest, _options)); - await _pimsService.NotificationQueue.SendNotificationsAsync(new[] { notification }); - - var notificationForRPD = _pimsService.NotificationQueue.GenerateNotification(templateForRPD, new AccessRequestNotificationModel(accessRequest, _options)); - await _pimsService.NotificationQueue.SendNotificationsAsync(new[] { notificationForRPD }); - - } - catch (Exception ex) - { - // Ignore email errors. - _logger.LogError(ex, "Error occurred while attempting to send an access request notification to administrators."); - } - - return CreatedAtAction(nameof(GetAccessRequest), new { id = accessRequest.Id }, _mapper.Map(accessRequest)); - } - - /// - /// PUT /api/users/access/requests/${id} - /// Provides a way for a user to update their access request. - /// - /// - [HttpPut("access/requests/{id}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.AccessRequestModel), 200)] - [ProducesResponseType(typeof(Models.ErrorResponseModel), 400)] - [ProducesResponseType(typeof(Models.ErrorResponseModel), 403)] - [SwaggerOperation(Tags = new[] { "user" })] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Parameter 'id' is used for consistent routing.")] - public IActionResult UpdateAccessRequest(int id, [FromBody] Model.AccessRequestModel model) - { - if (model == null || model.Agencies == null || model.Roles == null) - { - throw new BadRequestException("Invalid access request specified"); - } - if (model.Agencies.Count() != 1) - { - throw new BadRequestException("Each access request can only contain one agency."); - } - if (model.Roles.Count() != 1) - { - throw new BadRequestException("Each access request can only contain one role."); - } - var accessRequest = _mapper.Map(model); - _pimsService.User.UpdateAccessRequest(accessRequest); - return new JsonResult(_mapper.Map(accessRequest)); - } - - //TODO: "Modify the /activate endpoint to also return the users agencies, removing the need for this endpoint." - [HttpGet("agencies/{username}")] - [Produces("application/json")] - [ProducesResponseType(typeof(Model.AccessRequestModel), 200)] - [ProducesResponseType(typeof(Models.ErrorResponseModel), 400)] - [ProducesResponseType(typeof(Models.ErrorResponseModel), 403)] - [SwaggerOperation(Tags = new[] { "user" })] - public IActionResult GetUserAgencies(string username) - { - IEnumerable userAgencies = _pimsService.User.GetAgencies(username); - return new JsonResult(userAgencies); - } - - #endregion - #endregion - } -} diff --git a/backend/api/Helpers/Authorization/KeyCloakClaimTransformer.cs b/backend/api/Helpers/Authorization/KeyCloakClaimTransformer.cs deleted file mode 100644 index 9f94c1a646..0000000000 --- a/backend/api/Helpers/Authorization/KeyCloakClaimTransformer.cs +++ /dev/null @@ -1,64 +0,0 @@ -using Microsoft.AspNetCore.Authentication; -using System.Linq; -using System.Security.Claims; -using System.Text.Json; -using System.Threading.Tasks; - -namespace Pims.Api.Helpers.Authorization -{ - /// - /// KeycloakClaimTransformer class, provides a way to extract keycloak claims and convert them into role claims. - /// - public class KeycloakClaimTransformer : IClaimsTransformation - { - #region Variables - private const string REALM_ACCESS = "realm_access"; - - private readonly JsonSerializerOptions _options = new JsonSerializerOptions - { - PropertyNamingPolicy = JsonNamingPolicy.CamelCase, - WriteIndented = true, - PropertyNameCaseInsensitive = true - }; - #endregion - - #region Methods - /// - /// Transform the specified ClaimsPrincipal by extracting claim details from keycloak and creating new claims. - /// - /// - /// - public Task TransformAsync(ClaimsPrincipal principal) - { - // Parse the KeyCloak Claims to apply roles. - if (principal.HasClaim(c => c.Type == REALM_ACCESS)) - { - var realm_access_claim = principal.Claims.First(c => c.Type == REALM_ACCESS); - var value = realm_access_claim.Value.Replace("\\", ""); - var realm_access = JsonSerializer.Deserialize(value, _options); - var identity = ((ClaimsIdentity)principal.Identity); - foreach (var role in realm_access.Roles) - { - identity.AddClaim(new Claim(ClaimTypes.Role, role)); - } - } - - // var transformed = new ClaimsPrincipal (); - // transformed.AddIdentities (principal.Identities); - // transformed.AddIdentity (new ClaimsIdentity (new Claim[] { - // new Claim ("Role", "Administrator") - // })); - // return Task.FromResult (transformed); - return Task.FromResult(principal); - } - #endregion - } - - /// - /// RealmAccess private class, provides a way to deserialize the realm access. - /// - class RealmAccess - { - public string[] Roles { get; set; } - } -} diff --git a/backend/api/Helpers/Authorization/KeyCloakClaimsFactory.cs b/backend/api/Helpers/Authorization/KeyCloakClaimsFactory.cs deleted file mode 100644 index ab93f821a6..0000000000 --- a/backend/api/Helpers/Authorization/KeyCloakClaimsFactory.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Microsoft.AspNetCore.Identity; -using Microsoft.Extensions.Options; -using Pims.Api.Models.Membership; -using System.Security.Claims; -using System.Threading.Tasks; - -namespace Pims.Api.Helpers.Authorization -{ - /// - /// KeycloakClaimsFactory class, provides a way to add claims to a user. - /// - public class KeycloakClaimsFactory : UserClaimsPrincipalFactory - { - #region Constructors - /// - /// Creates a new instance of a KeycloakClaimsFactory class. - /// - /// - /// - /// - public KeycloakClaimsFactory( - UserManager userManager, - IOptions optionsAccessor) : base(userManager, optionsAccessor) { } - #endregion - - #region Methods - /// - /// Creates a ClaimsPrincipal for the specified user. - /// - /// - /// - public override Task CreateAsync(ApplicationUserModel user) - { - return base.CreateAsync(user); - } - - /// - /// Generates claims for the specified user. - /// - /// - /// - protected override async Task GenerateClaimsAsync(ApplicationUserModel user) - { - var identity = await base.GenerateClaimsAsync(user); - identity.AddClaim(new Claim("ContactName", "test")); - return identity; - } - #endregion - } -} diff --git a/backend/api/Helpers/Authorization/RealmAccessRoleHandler.cs b/backend/api/Helpers/Authorization/RealmAccessRoleHandler.cs deleted file mode 100644 index d104e151e9..0000000000 --- a/backend/api/Helpers/Authorization/RealmAccessRoleHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.AspNetCore.Authorization; -using System.Linq; -using System.Threading.Tasks; - -namespace Pims.Api.Helpers.Authorization -{ - /// - /// RealmAccessRoleHandler class, provides a way to validate whether the user has a specified role. - /// - public class RealmAccessRoleHandler : AuthorizationHandler - { - /// - /// Determine if the current user has the specified role. - /// - /// - /// - /// - protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, RealmAccessRoleRequirement requirement) - { - if (!context.User.HasClaim(c => c.Type == "realm_access")) - { - return Task.CompletedTask; - } - - var claim = context.User.Claims.First(c => c.Type == "realm_access"); - if (claim.Value.Contains($"\"{requirement.Role}\"")) - { - context.Succeed(requirement); - } - - return Task.CompletedTask; - } - } -} diff --git a/backend/api/Helpers/Authorization/RealmAccessRoleRequirement.cs b/backend/api/Helpers/Authorization/RealmAccessRoleRequirement.cs deleted file mode 100644 index 5d32049502..0000000000 --- a/backend/api/Helpers/Authorization/RealmAccessRoleRequirement.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.AspNetCore.Authorization; - -namespace Pims.Api.Helpers.Authorization -{ - /// - /// RealmAccessRequirement class, provides a way to ensure a user has the specified role. - /// - public class RealmAccessRoleRequirement : IAuthorizationRequirement - { - #region Properties - /// - /// get - The role to validate. - /// - /// - public string Role { get; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a RealmAccessRoleRequirement class. - /// - /// - public RealmAccessRoleRequirement(string role) - { - this.Role = role; - } - #endregion - } -} diff --git a/backend/api/Helpers/Constants/ContentTypes.cs b/backend/api/Helpers/Constants/ContentTypes.cs deleted file mode 100644 index 981a457620..0000000000 --- a/backend/api/Helpers/Constants/ContentTypes.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Pims.Api.Helpers.Constants -{ - /// - /// ContentTypes static class, provides constant values for Content-Type. - /// - public static class ContentTypes - { - #region Properties - public const string CONTENT_TYPE_CSV = "text/csv"; - public const string CONTENT_TYPE_EXCEL = "application/vnd.ms-excel"; - public const string CONTENT_TYPE_EXCELX = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; - #endregion - } -} diff --git a/backend/api/Helpers/Exceptions/ApiHttpRequestException.cs b/backend/api/Helpers/Exceptions/ApiHttpRequestException.cs deleted file mode 100644 index e946bceb71..0000000000 --- a/backend/api/Helpers/Exceptions/ApiHttpRequestException.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Net; -using System.Net.Http; - -namespace Pims.Api.Helpers.Exceptions -{ - /// - /// ApiHttpRequestException class, provides a way to express HTTP request exceptions that occur. - /// - public class ApiHttpRequestException : HttpRequestException - { - #region Properties - /// - /// get - The HTTP response message. - /// - public HttpResponseMessage Response { get; } - #endregion - - #region Constructors - /// - /// Creates a new instance of an ApiHttpRequestException class, initializes it with the specified arguments. - /// - /// - /// - /// - public ApiHttpRequestException(string message, HttpStatusCode statusCode = HttpStatusCode.InternalServerError) : base(message, null, statusCode) - { - } - - /// - /// Creates a new instance of an ApiHttpRequestException class, initializes it with the specified arguments. - /// - /// - /// - /// - /// - public ApiHttpRequestException(string message, Exception innerException, HttpStatusCode statusCode = HttpStatusCode.InternalServerError) : base(message, innerException, statusCode) - { - } - - /// - /// Creates a new instance of an ApiHttpRequestException class, initializes it with the specified arguments. - /// - /// - /// - public ApiHttpRequestException(HttpResponseMessage response) : base($"HTTP Request '{response.RequestMessage.RequestUri}' failed", null, response.StatusCode) - { - this.Response = response ?? throw new ArgumentNullException(nameof(response)); // NOSONAR - } - #endregion - } -} diff --git a/backend/api/Helpers/Exceptions/AuthenticationException.cs b/backend/api/Helpers/Exceptions/AuthenticationException.cs deleted file mode 100644 index fcf452ec45..0000000000 --- a/backend/api/Helpers/Exceptions/AuthenticationException.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; - -namespace Pims.Api.Helpers.Exceptions -{ - /// - /// AuthenticationException class, provides a way to handle exceptions that occur when validating authentication. - /// - public class AuthenticationException : Exception - { - #region Constructors - /// - /// Creates a new instance of a AuthenticationException object, initializes it with the specified arguments. - /// - /// - /// - public AuthenticationException(string message) : base(message) { } - - /// - /// Creates a new instance of a AuthenticationException object, initializes it with the specified arguments. - /// /// - /// - /// - /// - public AuthenticationException(string message, Exception innerException) : base(message, innerException) { } - #endregion - } -} diff --git a/backend/api/Helpers/Exceptions/BadRequestException.cs b/backend/api/Helpers/Exceptions/BadRequestException.cs deleted file mode 100644 index fabdf93b1d..0000000000 --- a/backend/api/Helpers/Exceptions/BadRequestException.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; - -namespace Pims.Api.Helpers.Exceptions -{ - /// - /// BadRequestException class, provides a way to handle bad request exceptions so that they are returned by the middleware in a standardized way. - /// - public class BadRequestException : Exception - { - #region Constructors - /// - /// Creates a new instance of a BadRequestException object, initializes it with the specified arguments. - /// - /// - /// - public BadRequestException(string message) : base(message) { } - - /// - /// Creates a new instance of a BadRequestException object, initializes it with the specified arguments. - /// /// - /// - /// - /// - public BadRequestException(string message, Exception innerException) : base(message, innerException) { } - #endregion - } -} diff --git a/backend/api/Helpers/Extensions/DateTimeExtensions.cs b/backend/api/Helpers/Extensions/DateTimeExtensions.cs deleted file mode 100644 index f2a1a0d013..0000000000 --- a/backend/api/Helpers/Extensions/DateTimeExtensions.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace Pims.Api.Helpers.Extensions -{ - public static class DateTimeExtensions - { - public static int ToFiscalYear(this DateTime dateTime) - { - return dateTime.Month >= 4 ? dateTime.AddYears(1).Year : dateTime.Year; - } - } -} diff --git a/backend/api/Helpers/Extensions/ExceptionExtensions.cs b/backend/api/Helpers/Extensions/ExceptionExtensions.cs deleted file mode 100644 index 03f89fb2c2..0000000000 --- a/backend/api/Helpers/Extensions/ExceptionExtensions.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Pims.Api.Helpers.Exceptions; -using System; -using Pims.Api.Models; - -namespace Pims.Api.Helpers.Extensions -{ - /// - /// ExceptionExtensions static class, provides extention methods for exceptions. - /// - public static class ExceptionExtensions - { - /// - /// Throw an BadRequestException if the item is null. - /// - /// - /// - /// - /// The item cannot be null. - public static T ThrowBadRequestIfNull(this T item, string message) where T : class - { - if (String.IsNullOrWhiteSpace(message)) throw new ArgumentException("Argument cannot be null, empty or whitespace.", nameof(message)); - return item ?? throw new BadRequestException(message); - } - - /// - /// Generate a user friendly error message if exception is referring to a duplicate constraint. - /// - /// - /// - /// User friendly error message if exception is caused by duplicate. Otherwise null. - public static ErrorResponseModel CheckErrorMessageForDuplicate(this Exception ex, string message) - { - if (ex.InnerException?.Message.Contains("duplicate") ?? false) - { - ErrorResponseModel error = new ErrorResponseModel(message, - "Ensure that you have not entered a duplicate name into the system."); - return error; - } - return null; - } - } -} diff --git a/backend/api/Helpers/Extensions/HttpResponseMessageExtensions.cs b/backend/api/Helpers/Extensions/HttpResponseMessageExtensions.cs deleted file mode 100644 index ea403af7d8..0000000000 --- a/backend/api/Helpers/Extensions/HttpResponseMessageExtensions.cs +++ /dev/null @@ -1,63 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -using System.IO; -using System.Net.Http; -using System.Text; -using System.Text.Json; -using System.Threading.Tasks; - -namespace Pims.Api.Helpers.Extensions -{ - /// - /// HttpResponseMessageExtensions static class, provides extension methods to help with HttpResponseMessageExtensions objects. - /// - public static class HttpResponseMessageExtensions - { - /// - /// Deserialize the response and return it as JSON, or return the failed response status to the original requester. - /// - /// - /// - /// - /// - public static async Task HandleResponseAsync(this HttpResponseMessage response, ILogger logger = null) - { - if (response.IsSuccessStatusCode) - { - using var responseStream = await response.Content.ReadAsStreamAsync(); - var data = await JsonSerializer.DeserializeAsync(responseStream); - return new JsonResult(data) - { - StatusCode = (int)response.StatusCode - }; - } - else - { - using var responseStream = await response.Content.ReadAsStreamAsync(); - - var readStream = new StreamReader(responseStream, Encoding.UTF8); - var error = readStream.ReadToEnd(); - logger?.LogError(error); - responseStream.Position = 0; - - if (response.Content.Headers.ContentType.MediaType == "application/json") - { - var data = await JsonSerializer.DeserializeAsync(responseStream); - var result = new JsonResult(data) - { - StatusCode = (int)response.StatusCode - }; - return result; - } - else - { - var result = new JsonResult(new Models.ErrorResponseModel(error, null)) - { - StatusCode = (int)response.StatusCode - }; - return result; - } - } - } - } -} diff --git a/backend/api/Helpers/Logging/LoggerExtension.cs b/backend/api/Helpers/Logging/LoggerExtension.cs deleted file mode 100644 index 194fc43170..0000000000 --- a/backend/api/Helpers/Logging/LoggerExtension.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.Extensions.Configuration; -using System; -using Microsoft.Extensions.DependencyInjection; -using Serilog; -using System.Diagnostics.CodeAnalysis; - -namespace Pims.Api.Helpers.Logging -{ - [ExcludeFromCodeCoverage] - public static class LoggerExtensions - { - public static IServiceCollection AddSerilogging( - this IServiceCollection services, IConfiguration configuration - ) - { - var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); - if (environment != null && !environment.EndsWith("Local")) - { - - Log.Logger = new LoggerConfiguration() - .Enrich.FromLogContext() - .Enrich.WithMachineName() - .WriteTo.Debug() - .WriteTo.Console() - .Enrich.WithProperty("Environment", environment) - .ReadFrom.Configuration(configuration) - .CreateLogger(); - } - return services; - } - } -} diff --git a/backend/api/Helpers/Mapping/ApplicationBuilderExtensions.cs b/backend/api/Helpers/Mapping/ApplicationBuilderExtensions.cs deleted file mode 100644 index f191e5dce8..0000000000 --- a/backend/api/Helpers/Mapping/ApplicationBuilderExtensions.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Mapster; -using Microsoft.AspNetCore.Builder; -using System.Diagnostics.CodeAnalysis; -using System.Reflection; - -namespace Pims.Api.Helpers.Mapping -{ - [ExcludeFromCodeCoverage] - public static class ApplicationBuilderExtensions - { - public static IApplicationBuilder UseMapster(this IApplicationBuilder app) - { - var config = new TypeAdapterConfig(); - config.Scan(Assembly.GetAssembly(typeof(Startup))); - - return app; - } - } -} diff --git a/backend/api/Helpers/Mapping/ServiceCollectionExtensions.cs b/backend/api/Helpers/Mapping/ServiceCollectionExtensions.cs deleted file mode 100644 index 1a2fd77941..0000000000 --- a/backend/api/Helpers/Mapping/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Mapster; -using MapsterMapper; -using Microsoft.Extensions.DependencyInjection; -using System; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Reflection; -using System.Text.Json; - -namespace Pims.Api.Helpers.Mapping -{ - /// - /// ServiceCollectionExtensions static class, provides extension methods for IServiceCollection. - /// - [ExcludeFromCodeCoverage] - public static class ServiceCollectionExtensions - { - /// - /// Add Mapster to the DI service collection. - /// By default this will scan the assembly for all mappers that inhert IRegister. - /// - /// - /// - /// - public static IServiceCollection AddMapster(this IServiceCollection services, Action options = null) - { - var config = TypeAdapterConfig.GlobalSettings; - config.Scan(Assembly.GetAssembly(typeof(Startup))); - - options?.Invoke(config); - - services.AddSingleton(config); - services.AddScoped(); - - return services; - } - - /// - /// Add Mapster to the DI service collection. - /// By default this will scan the assembly for all mappers that inhert IRegister. - /// - /// - /// - /// - /// - public static IServiceCollection AddMapster(this IServiceCollection services, JsonSerializerOptions serializerOptions, Action options = null) - { - var config = TypeAdapterConfig.GlobalSettings; - - var optionsSerializer = Microsoft.Extensions.Options.Options.Create(serializerOptions); - var assemblies = new[] { Assembly.GetAssembly(typeof(Startup)) }; - var registers = assemblies.Select(assembly => assembly.GetTypes() - .Where(x => typeof(IRegister).GetTypeInfo().IsAssignableFrom(x.GetTypeInfo()) && x.GetTypeInfo().IsClass && !x.GetTypeInfo().IsAbstract)) - .SelectMany(registerTypes => - registerTypes.Select(registerType => - registerType.GetConstructor(Type.EmptyTypes) == null - ? (IRegister)Activator.CreateInstance(registerType, new[] { optionsSerializer }) - : (IRegister)Activator.CreateInstance(registerType))).ToList(); - - config.Apply(registers); - - options?.Invoke(config); - - services.AddSingleton(config); - services.AddScoped(); - - return services; - } - } -} diff --git a/backend/api/Helpers/Middleware/ErrorHandlingMiddleware.cs b/backend/api/Helpers/Middleware/ErrorHandlingMiddleware.cs deleted file mode 100644 index 84e45076db..0000000000 --- a/backend/api/Helpers/Middleware/ErrorHandlingMiddleware.cs +++ /dev/null @@ -1,226 +0,0 @@ -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Microsoft.IdentityModel.Tokens; -using Pims.Api.Helpers.Exceptions; -using Pims.Core.Exceptions; -using Pims.Dal.Exceptions; -using System; -using System.Collections.Generic; -using System.IO; -using System.Net; -using System.Text; -using System.Text.Json; -using System.Threading.Tasks; - -namespace Pims.Api.Helpers.Middleware -{ - /// - /// ErrorHandlingMidleware class, provides a way to catch and handle unhandled errors in a generic way. - /// - public class ErrorHandlingMiddleware - { - #region Variables - private readonly RequestDelegate _next; - private readonly IWebHostEnvironment _env; - private readonly ILogger _logger; - private readonly JsonOptions _options; - #endregion - - #region Constructors - /// - /// Creates a new instance of an ErrorHandlingMiddleware class, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public ErrorHandlingMiddleware(RequestDelegate next, IWebHostEnvironment env, ILogger logger, IOptions options) - { - _next = next; - _env = env; - _logger = logger; - _options = options.Value; - } - #endregion - - #region Methods - /// - /// Handle the exception if one occurs. - /// - /// - /// - public async Task Invoke(HttpContext context) - { - try - { - await _next(context); - } - catch (Exception ex) - { - await HandleExceptionAsync(context, ex); - } - } - - /// - /// Handle the exception by returning an appropriate error message depending on type and environment. - /// - /// - /// - /// - private async Task HandleExceptionAsync(HttpContext context, Exception ex) - { - var code = HttpStatusCode.InternalServerError; - var message = "An unhandled error has occurred."; - string details = null; - - if (ex is SecurityTokenException) - { - code = HttpStatusCode.Unauthorized; - message = "The authentication token is invalid."; - } - else if (ex is SecurityTokenValidationException) - { - code = HttpStatusCode.Unauthorized; - message = "The authentication token is invalid."; - } - else if (ex is SecurityTokenExpiredException) - { - code = HttpStatusCode.Unauthorized; - message = "The authentication token has expired."; - } - else if (ex is SecurityTokenNotYetValidException) - { - code = HttpStatusCode.Unauthorized; - message = "The authentication token not yet valid."; - } - else if (ex is DbUpdateConcurrencyException) - { - code = HttpStatusCode.BadRequest; - message = "Data may have been modified or deleted since item was loaded."; - - _logger.LogDebug(ex, "Middleware caught unhandled exception."); - } - else if (ex is DbUpdateException) - { - code = HttpStatusCode.BadRequest; - message = "An error occurred while updating this item."; - - _logger.LogDebug(ex, "Middleware caught unhandled exception."); - } - else if (ex is KeyNotFoundException) - { - code = HttpStatusCode.BadRequest; - message = "Item does not exist."; - - _logger.LogDebug(ex, "Middleware caught unhandled exception."); - } - else if (ex is RowVersionMissingException) - { - code = HttpStatusCode.BadRequest; - message = "Item cannot be updated without a row version."; - - _logger.LogDebug(ex, "Middleware caught unhandled exception."); - } - else if (ex is NotAuthorizedException) - { - code = HttpStatusCode.Forbidden; - message = "User is not authorized to perform this action."; - - _logger.LogWarning(ex, ex.Message); - } - else if (ex is Core.Exceptions.ConfigurationException) - { - code = HttpStatusCode.InternalServerError; - message = "Application configuration details invalid or missing."; - - _logger.LogError(ex, ex.Message); - } - else if (ex is BadRequestException || ex is InvalidOperationException) - { - code = HttpStatusCode.BadRequest; - message = ex.Message; - - _logger.LogError(ex, "Invalid operation or bad request details."); - } - else if (ex is ApiHttpRequestException) - { - var exception = ex as ApiHttpRequestException; - code = exception.StatusCode ?? HttpStatusCode.InternalServerError; - message = ex.Message; - - try - { - using var responseStream = await exception?.Response.Content.ReadAsStreamAsync(); - responseStream.Position = 0; - using var readStream = new StreamReader(responseStream, Encoding.UTF8); - details = readStream.ReadToEnd(); // TODO: Rewrite this logic. - _logger.LogError(ex, details); - } - catch (Exception streamEx) - { - // Ignore for now. - _logger.LogError(streamEx, $"Failed to read the {nameof(ApiHttpRequestException)} error stream."); - } - } - else if (ex is ChesException) - { - var exception = ex as ChesException; - code = exception.StatusCode ?? HttpStatusCode.InternalServerError; - message = exception.Message; - details = exception.Detail; - - _logger.LogError(ex, "CHES unhandled exception."); - } - else if (ex is HttpClientRequestException || ex is ProxyRequestException) - { - var exception = ex as HttpClientRequestException; - code = exception.StatusCode ?? HttpStatusCode.InternalServerError; - message = ex.Message; - - try - { - using var responseStream = await exception?.Response.Content.ReadAsStreamAsync(); - responseStream.Position = 0; - using var readStream = new StreamReader(responseStream, Encoding.UTF8); - details = readStream.ReadToEnd(); // TODO: Rewrite this logic. - _logger.LogError(ex, details); - } - catch (Exception streamEx) - { - // Ignore for now. - _logger.LogError(streamEx, $"Failed to read the {nameof(HttpClientRequestException)} error stream."); - } - } - else if (ex is AuthenticationException) - { - var exception = ex as AuthenticationException; - message = exception.Message; - details = exception.InnerException.Message; - - _logger.LogError(ex, "Unable to validate authentication information."); - } - else - { - _logger.LogError(ex, "Middleware caught unhandled exception."); - } - - if (!context.Response.HasStarted) - { - var result = JsonSerializer.Serialize(new Models.ErrorResponseModel(_env, ex, message, details), _options.JsonSerializerOptions); - context.Response.ContentType = "application/json"; - context.Response.StatusCode = (int)code; - await context.Response.WriteAsync(result); - } - else - { - // Had to do this because odd errors were occurring when bearer tokens were failing. - await context.Response.WriteAsync(string.Empty); - } - } - #endregion - } -} diff --git a/backend/api/Helpers/Middleware/LogRequestMiddleware.cs b/backend/api/Helpers/Middleware/LogRequestMiddleware.cs deleted file mode 100644 index 7d9245fbf7..0000000000 --- a/backend/api/Helpers/Middleware/LogRequestMiddleware.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.Extensions.Logging; -using Pims.Core.Extensions; -using System.Diagnostics.CodeAnalysis; -using System.Threading.Tasks; - -namespace Pims.Api.Helpers.Middleware -{ - /// - /// LogRequestMiddleware class, provides a way to log requests inbound to the API. - /// - [ExcludeFromCodeCoverage] - public class LogRequestMiddleware - { - #region Variables - private readonly RequestDelegate _next; - private readonly ILogger _logger; - #endregion - - #region Constructors - /// - /// Creates a new instance of an LogRequestMiddleware class, and initializes it with the specified arguments. - /// - /// - /// - public LogRequestMiddleware(RequestDelegate next, ILogger logger) - { - _next = next; - _logger = logger; - } - #endregion - - #region Methods - /// - /// Add a log message for the request. - /// - /// - /// - public async Task Invoke(HttpContext context) - { - _logger.LogInformation($"Received HTTP Request {context.Request.Method} user:{context.User.GetDisplayName()} {context.Request.Scheme}://{context.Request.Host}{context.Request.Path}{context.Request.QueryString}"); - - await _next(context); - } - #endregion - } -} diff --git a/backend/api/Helpers/Middleware/ResponseTimeMiddleware.cs b/backend/api/Helpers/Middleware/ResponseTimeMiddleware.cs deleted file mode 100644 index 6f2e8b5aba..0000000000 --- a/backend/api/Helpers/Middleware/ResponseTimeMiddleware.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Microsoft.AspNetCore.Http; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.Threading.Tasks; - -namespace Pims.Api.Helpers.Middleware -{ - /// - /// ResponseTimeMiddleware class, provides a way to include the response time in the header. - /// - [ExcludeFromCodeCoverage] - public class ResponseTimeMiddleware - { - #region Variables - private readonly RequestDelegate _next; - #endregion - - #region Constructors - /// - /// Creates a new instance of an ResponseTimeMiddleware class, and initializes it with the specified arguments. - /// - /// - public ResponseTimeMiddleware(RequestDelegate next) - { - _next = next; - } - #endregion - - #region Methods - /// - /// Add a log message for the request. - /// - /// - /// - public async Task Invoke(HttpContext context) - { - var watch = Stopwatch.StartNew(); - - context.Response.OnStarting(() => - { - watch.Stop(); - context.Response.Headers["X-Response-Time-ms"] = $"{watch.ElapsedMilliseconds}"; - return Task.CompletedTask; - }); - - await _next(context); - } - #endregion - } -} diff --git a/backend/api/Helpers/Reporting/ReportHelper.cs b/backend/api/Helpers/Reporting/ReportHelper.cs deleted file mode 100644 index dadb358795..0000000000 --- a/backend/api/Helpers/Reporting/ReportHelper.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Pims.Api.Helpers.Constants; -using Pims.Core.Helpers; -using System.Collections.Generic; -using System.IO; - -namespace Pims.Api.Helpers.Reporting -{ - /// - /// ReportHelper static class, provides helper functions to generate reports. - /// - public static class ReportHelper - { - #region Methods - /// - /// Generates a CSV file for the specified 'items'. - /// - /// - /// - /// - public static ContentResult GenerateCsv(IEnumerable items) - { - var csv = items.ConvertToCSV(); - var result = new ContentResult - { - Content = csv, - ContentType = ContentTypes.CONTENT_TYPE_CSV - }; - return result; - } - - /// - /// Generates an Excel document for the specified 'items'. - /// - /// - /// - /// - /// - public static FileStreamResult GenerateExcel(IEnumerable items, string sheetName) - { - var data = items.ConvertToDataTable(sheetName); - var excel = data.ConvertToXLWorkbook(sheetName); - var stream = new MemoryStream(); - excel.SaveAs(stream); - stream.Position = 0; - - return new FileStreamResult(stream, ContentTypes.CONTENT_TYPE_EXCELX); - } - #endregion - } -} diff --git a/backend/api/Helpers/Routes/Constraints/PidConstraint.cs b/backend/api/Helpers/Routes/Constraints/PidConstraint.cs deleted file mode 100644 index 2a7bb3e1f1..0000000000 --- a/backend/api/Helpers/Routes/Constraints/PidConstraint.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Routing; -using System; -using System.Globalization; -using System.Text.RegularExpressions; - -namespace Pims.Api.Helpers.Routes.Constraints -{ - /// - /// PidConstraint class, provides a way to add a formatted PID (i.e. 123-123-123) constraint to a route template. - /// - public class PidConstraint : IRouteConstraint - { - #region Variables - private readonly Regex _regex; - #endregion - - #region Constructors - /// - /// Creates a new instance of a PidConstraint object. - /// - public PidConstraint() - { - _regex = new Regex(@"^[0-9]{3}-[0-9]{3}-[0-9]{3}$", RegexOptions.None, TimeSpan.FromMilliseconds(100)); - } - #endregion - - #region Methods - /// - /// Determines if the constraint matches the PID format (i.e. 123-123-123). - /// - /// - /// - /// - /// - /// - /// - public bool Match(HttpContext httpContext, IRouter router, string routeKey, RouteValueDictionary values, RouteDirection routeDirection) - { - if (values.TryGetValue(routeKey, out object value)) - { - var parameterValueString = Convert.ToString(value, CultureInfo.InvariantCulture); - if (parameterValueString == null) return false; - return _regex.IsMatch(parameterValueString); - } - - return false; - } - #endregion - } -} diff --git a/backend/api/Helpers/Swagger/ConfigureSwaggerOptions.cs b/backend/api/Helpers/Swagger/ConfigureSwaggerOptions.cs deleted file mode 100644 index d12ededb80..0000000000 --- a/backend/api/Helpers/Swagger/ConfigureSwaggerOptions.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Microsoft.AspNetCore.Mvc.ApiExplorer; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; -using Microsoft.OpenApi.Models; -using Swashbuckle.AspNetCore.SwaggerGen; -using System; - -namespace Pims.Api.Helpers.Swagger -{ - - /// - /// Configures the Swagger generation options. - /// - /// This allows API versioning to define a Swagger document per API version after the - /// service has been resolved from the service container. - public class ConfigureSwaggerOptions : IConfigureOptions - { - readonly IApiVersionDescriptionProvider provider; - - /// - /// Initializes a new instance of the class. - /// - /// The provider used to generate Swagger documents. - public ConfigureSwaggerOptions(IApiVersionDescriptionProvider provider) => this.provider = provider; - - /// - public void Configure(SwaggerGenOptions options) - { - // add a swagger document for each discovered API version - // note: you might choose to skip or document deprecated API versions differently - foreach (var description in provider.ApiVersionDescriptions) - { - options.SwaggerDoc(description.GroupName, CreateInfoForApiVersion(description)); - } - } - - static OpenApiInfo CreateInfoForApiVersion(ApiVersionDescription description) - { - var info = new OpenApiInfo() - { - Title = "PIMS API", // TODO: From configuration - Version = description.ApiVersion.ToString(), - Description = "Property Inventory Management System", // TODO: From configuration - Contact = new OpenApiContact() { Name = "Support", Email = "support@pims.gov.bc.ca" }, // TODO: From configuration - License = new OpenApiLicense() { Name = "APACHE", Url = new Uri("https://github.com/bcgov/PIMS/blob/dev/LICENSE") } // TODO: From configuration - }; - - if (description.IsDeprecated) - { - info.Description += " (This API version has been deprecated)."; - } - - return info; - } - } -} diff --git a/backend/api/Helpers/Swagger/SwaggerDefaultValues.cs b/backend/api/Helpers/Swagger/SwaggerDefaultValues.cs deleted file mode 100644 index 24ec2c3b88..0000000000 --- a/backend/api/Helpers/Swagger/SwaggerDefaultValues.cs +++ /dev/null @@ -1,52 +0,0 @@ -using Microsoft.AspNetCore.Mvc.ApiExplorer; -using Microsoft.OpenApi.Any; -using Microsoft.OpenApi.Models; -using Swashbuckle.AspNetCore.SwaggerGen; -using System.Linq; - -namespace Pims.Api.Helpers.Swagger -{ - /// - /// Represents the Swagger/Swashbuckle operation filter used to document the implicit API version parameter. - /// - /// This is only required due to bugs in the . - /// Once they are fixed and published, this class can be removed. - public class SwaggerDefaultValues : IOperationFilter - { - /// - /// Applies the filter to the specified operation using the given context. - /// - /// The operation to apply the filter to. - /// The current operation filter context. - public void Apply(OpenApiOperation operation, OperationFilterContext context) - { - var apiDescription = context.ApiDescription; - - operation.Deprecated |= apiDescription.IsDeprecated(); - - if (operation.Parameters == null) - { - return; - } - - // REF: https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/412 - // REF: https://github.com/domaindrivendev/Swashbuckle.AspNetCore/pull/413 - foreach (var parameter in operation.Parameters) - { - var description = apiDescription.ParameterDescriptions.First(p => p.Name == parameter.Name); - - if (parameter.Description == null) - { - parameter.Description = description.ModelMetadata?.Description; - } - - if (parameter.Schema.Default == null && description.DefaultValue != null) - { - parameter.Schema.Default = new OpenApiString(description.DefaultValue.ToString()); - } - - parameter.Required |= description.IsRequired; - } - } - } -} diff --git a/backend/api/Helpers/Swagger/SwaggerDocumentFilter.cs b/backend/api/Helpers/Swagger/SwaggerDocumentFilter.cs deleted file mode 100644 index 8a975ce3de..0000000000 --- a/backend/api/Helpers/Swagger/SwaggerDocumentFilter.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.Extensions.Configuration; -using Microsoft.OpenApi.Models; -using Swashbuckle.AspNetCore.SwaggerGen; - -namespace Pims.Api.Helpers.Swagger -{ - /// - /// SwaggerDocumentFilter class, provides a way to modify the swagger document information. - /// - public class SwaggerDocumentFilter : IDocumentFilter - { - #region Variables - private readonly IHttpContextAccessor _context; - private readonly string _basePath; - #endregion - - #region Constructors - /// - /// Creates a new instance of a SwaggerDocumentFilter object, initializes it with the specified arguments. - /// - /// - /// - public SwaggerDocumentFilter(IHttpContextAccessor httpContextAccessor, IConfiguration configuration) - { - _context = httpContextAccessor; - _basePath = configuration.GetValue("BaseUrl"); - } - #endregion - - #region Methods - /// - /// Apply the requested host to the document servers. - /// - /// - /// - public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context) - { - swaggerDoc.Servers.Add(new OpenApiServer() { Url = $"{_context.HttpContext.Request.Scheme}://{_context.HttpContext.Request.Host}{_basePath}" }); - } - #endregion - } -} diff --git a/backend/api/Mapping/BaseMap.cs b/backend/api/Mapping/BaseMap.cs deleted file mode 100644 index 65bc2e9828..0000000000 --- a/backend/api/Mapping/BaseMap.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Mapster; -using System; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Mapping -{ - public class BaseMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.CreatedOn, src => src.CreatedOn) - .Map(dest => dest.UpdatedOn, src => src.UpdatedOn) - .Map(dest => dest.UpdatedByName, src => src.UpdatedBy != null ? src.UpdatedBy.DisplayName : src.CreatedBy != null ? src.CreatedBy.DisplayName : "unknown") - .Map(dest => dest.UpdatedByEmail, src => src.UpdatedBy != null ? src.UpdatedBy.Email : src.CreatedBy != null ? src.CreatedBy.Email : "unknown") - .Map(dest => dest.RowVersion, src => src.RowVersion == null ? null : Convert.ToBase64String(src.RowVersion)); - - config.NewConfig() - .Map(dest => dest.CreatedOn, src => src.CreatedOn) - .Map(dest => dest.UpdatedOn, src => src.UpdatedOn) - .Map(dest => dest.RowVersion, src => src.RowVersion == null ? null : Convert.FromBase64String(src.RowVersion)); - } - } -} diff --git a/backend/api/Mapping/Building/AddressMap.cs b/backend/api/Mapping/Building/AddressMap.cs deleted file mode 100644 index 9e8f97632b..0000000000 --- a/backend/api/Mapping/Building/AddressMap.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Mapster; -using System; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Models.Building; - -namespace Pims.Api.Mapping.Building -{ - public class AddressMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Line1, src => src.Address1) - .Map(dest => dest.Line2, src => src.Address2) - .Map(dest => dest.AdministrativeArea, src => src.AdministrativeArea) - .Map(dest => dest.ProvinceId, src => src.ProvinceId) - .Map(dest => dest.Province, src => src.Province == null ? null : src.Province.Name) - .Map(dest => dest.Postal, src => src.Postal) - .Inherits(); - - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Address1, src => src.Line1) - .Map(dest => dest.Address2, src => src.Line2) - .Map(dest => dest.AdministrativeArea, src => src.AdministrativeArea) - .Map(dest => dest.ProvinceId, src => src.ProvinceId) - .Map(dest => dest.Province, src => String.IsNullOrWhiteSpace(src.Province) ? null : new Entity.Province(src.ProvinceId, src.Province)) - .Map(dest => dest.Postal, src => src.Postal) - .Inherits(); - } - } -} diff --git a/backend/api/Mapping/Building/BuildingEvaluationMap.cs b/backend/api/Mapping/Building/BuildingEvaluationMap.cs deleted file mode 100644 index 4855c80de7..0000000000 --- a/backend/api/Mapping/Building/BuildingEvaluationMap.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Models.Building; - -namespace Pims.Api.Mapping.Building -{ - public class BuildingEvaluationMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.Date, src => src.Date) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - - - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.Date, src => src.Date) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - } - } -} diff --git a/backend/api/Mapping/Building/BuildingFiscalMap.cs b/backend/api/Mapping/Building/BuildingFiscalMap.cs deleted file mode 100644 index 29e5a26844..0000000000 --- a/backend/api/Mapping/Building/BuildingFiscalMap.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Models.Building; - -namespace Pims.Api.Mapping.Building -{ - public class BuildingFiscalMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.FiscalYear, src => src.FiscalYear) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - - - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.FiscalYear, src => src.FiscalYear) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - } - } -} diff --git a/backend/api/Mapping/Building/BuildingMap.cs b/backend/api/Mapping/Building/BuildingMap.cs deleted file mode 100644 index ea9df68755..0000000000 --- a/backend/api/Mapping/Building/BuildingMap.cs +++ /dev/null @@ -1,93 +0,0 @@ -using Mapster; -using Microsoft.Extensions.Options; -using Pims.Api.Mapping.Converters; -using Pims.Dal.Helpers.Extensions; -using System.Collections.Generic; -using System.Linq; -using System.Text.Json; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Models.Building; - -namespace Pims.Api.Mapping.Building -{ - public class BuildingMap : IRegister - { - #region Variables - private readonly JsonSerializerOptions _serializerOptions; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ProjectMap, initializes with specified arguments. - /// - /// - public BuildingMap(IOptions serializerOptions) - { - _serializerOptions = serializerOptions.Value; - } - #endregion - - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.ParcelId, src => src.GetParcelId()) - .Map(dest => dest.ProjectNumbers, src => JsonSerializer.Deserialize>(src.ProjectNumbers ?? "[]", _serializerOptions)) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Classification, src => src.Classification.Name) - .Map(dest => dest.EncumbranceReason, src => src.EncumbranceReason) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Agency, src => AgencyConverter.ConvertAgency(src.Agency)) - .Map(dest => dest.SubAgency, src => AgencyConverter.ConvertSubAgency(src.Agency)) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.BuildingConstructionTypeId, src => src.BuildingConstructionTypeId) - .Map(dest => dest.BuildingConstructionType, src => src.GetConstructionType()) - .Map(dest => dest.BuildingOccupantTypeId, src => src.BuildingOccupantTypeId) - .Map(dest => dest.BuildingOccupantType, src => src.GetOccupantType()) - .Map(dest => dest.BuildingPredominateUseId, src => src.BuildingPredominateUseId) - .Map(dest => dest.BuildingPredominateUse, src => src.GetPredominateUse()) - .Map(dest => dest.BuildingTenancy, src => src.BuildingTenancy) - .Map(dest => dest.BuildingFloorCount, src => src.BuildingFloorCount) - .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry) - .Map(dest => dest.OccupantName, src => src.OccupantName) - .Map(dest => dest.RentableArea, src => src.RentableArea) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Parcels, src => new List() { new Entity.ParcelBuilding() { ParcelId = src.ParcelId, BuildingId = src.Id } }) - .Map(dest => dest.ProjectNumbers, src => JsonSerializer.Serialize>(src.ProjectNumbers ?? Enumerable.Empty(), _serializerOptions)) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Classification, src => src.Classification) - .Map(dest => dest.EncumbranceReason, src => src.EncumbranceReason) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.Location, src => src) - .Map(dest => dest.AddressId, src => src.Address == null ? 0 : src.Address.Id) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.BuildingConstructionTypeId, src => src.BuildingConstructionTypeId) - .Map(dest => dest.BuildingOccupantTypeId, src => src.BuildingOccupantTypeId) - .Map(dest => dest.BuildingPredominateUseId, src => src.BuildingPredominateUseId) - .Map(dest => dest.BuildingTenancy, src => src.BuildingTenancy) - .Map(dest => dest.BuildingFloorCount, src => src.BuildingFloorCount) - .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry) - .Map(dest => dest.OccupantName, src => src.OccupantName) - .Map(dest => dest.RentableArea, src => src.RentableArea) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Inherits(); - - config.NewConfig() - .ConstructUsing(src => Dal.Helpers.GeometryHelper.CreatePoint(src.Longitude, src.Latitude)); - } - } -} diff --git a/backend/api/Mapping/Building/PartialBuildingMap.cs b/backend/api/Mapping/Building/PartialBuildingMap.cs deleted file mode 100644 index caea7472ab..0000000000 --- a/backend/api/Mapping/Building/PartialBuildingMap.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Models.Building; - -namespace Pims.Api.Mapping.Building -{ - public class PartialBuildingMap : IRegister - { - - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Inherits(); - } - } -} diff --git a/backend/api/Mapping/CodeMap.cs b/backend/api/Mapping/CodeMap.cs deleted file mode 100644 index 0fdb7025a7..0000000000 --- a/backend/api/Mapping/CodeMap.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Mapster; -using System; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Mapping -{ - public class CodeMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig, Models.CodeModel>() - .Map(dest => dest.Code, src => src.Code) - .Inherits, Models.LookupModel>(); - - config.NewConfig, Entity.CodeEntity>() - .Map(dest => dest.Code, src => src.Code) - .Inherits, Entity.LookupEntity>(); - - - config.NewConfig, Models.CodeModel>() - .Map(dest => dest.Code, src => src.Code) - .Inherits, Models.LookupModel>(); - - config.NewConfig, Entity.CodeEntity>() - .Map(dest => dest.Code, src => src.Code) - .Inherits, Entity.LookupEntity>(); - - - config.NewConfig, Models.CodeModel>() - .Map(dest => dest.Code, src => src.Code) - .Inherits, Models.LookupModel>(); - - config.NewConfig, Entity.CodeEntity>() - .Map(dest => dest.Code, src => src.Code) - .Inherits, Entity.LookupEntity>(); - - - config.NewConfig, Models.CodeModel>() - .Map(dest => dest.Code, src => src.Code) - .Inherits, Models.LookupModel>(); - } - } -} diff --git a/backend/api/Mapping/Converters/AgencyConverter.cs b/backend/api/Mapping/Converters/AgencyConverter.cs deleted file mode 100644 index 4a72f4da95..0000000000 --- a/backend/api/Mapping/Converters/AgencyConverter.cs +++ /dev/null @@ -1,54 +0,0 @@ -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Mapping.Converters -{ - /// - /// AgencyConverter static class, provides converters for agency. - /// - public static class AgencyConverter - { - /// - /// Extracts the agency code, or the specified 'agency' is a child it will return the parent code. - /// - /// - /// - public static string ConvertAgency(Entity.Agency source) - { - if (source?.ParentId == null) return source?.Code; - return source.Parent?.Code; - } - - /// - /// Extract the sub-agency code. - /// If the specified 'agency' is a parent it will return null. - /// - /// - /// - public static string ConvertSubAgency(Entity.Agency source) - { - return source?.ParentId == null ? null : source.Code; - } - - /// - /// Extracts the agency name, or the specified 'agency' is a child it will return the parent code. - /// - /// - /// - public static string ConvertAgencyFullName(Entity.Agency source) - { - if (source?.ParentId == null) return source?.Name; - return source.Parent?.Name; - } - - /// - /// Extract the sub-agency name. - /// If the specified 'agency' is a parent it will return null. - /// - /// - /// - public static string ConvertSubAgencyFullName(Entity.Agency source) - { - return source?.ParentId == null ? null : source.Name; - } - } -} diff --git a/backend/api/Mapping/Converters/ParcelConverter.cs b/backend/api/Mapping/Converters/ParcelConverter.cs deleted file mode 100644 index 03ab802a3b..0000000000 --- a/backend/api/Mapping/Converters/ParcelConverter.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace Pims.Api.Mapping.Converters -{ - /// - /// ParcelConverter static class, provides converters for parcels. - /// - public static class ParcelConverter - { - /// - /// Convert the formatted PID string into a number. - /// - /// - /// - public static int ConvertPID(string pid) - { - int.TryParse(pid?.Replace("-", "") ?? "", out int value); - return value; - } - } -} diff --git a/backend/api/Mapping/Lookup/CodeMap.cs b/backend/api/Mapping/Lookup/CodeMap.cs deleted file mode 100644 index 350c1b65be..0000000000 --- a/backend/api/Mapping/Lookup/CodeMap.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Mapping.Lookup -{ - public class CodeMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig>() - .Map(dest => dest.Code, src => src.Code) - .Map(dest => dest.ParentId, src => src.ParentId) - .Inherits, Models.LookupModel>(); - - config.NewConfig>() - .Map(dest => dest.Code, src => src.Abbreviation) - .Inherits, Models.LookupModel>(); - } - } -} diff --git a/backend/api/Mapping/Lookup/LookupMap.cs b/backend/api/Mapping/Lookup/LookupMap.cs deleted file mode 100644 index 6253b59144..0000000000 --- a/backend/api/Mapping/Lookup/LookupMap.cs +++ /dev/null @@ -1,86 +0,0 @@ -using Mapster; -using System; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Mapping.Lookup -{ - public class LookupMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig>() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Type, src => src.GetType().Name) - .Inherits(); - - config.NewConfig>() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.SortOrder, src => src.SortOrder) - .Map(dest => dest.Type, src => src.GetType().Name) - .Inherits(); - - - config.NewConfig>() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.SortOrder, src => src.SortOrder) - .Map(dest => dest.Type, src => src.GetType().Name) - .Inherits(); - - - config.NewConfig>() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.IsVisible, src => Convert(src)) - .Map(dest => dest.SortOrder, src => src.SortOrder) - .Map(dest => dest.Type, src => src.GetType().Name) - .Inherits(); - - - config.NewConfig>() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.SortOrder, src => src.SortOrder) - .Map(dest => dest.Type, src => src.GetType().Name) - .Inherits(); - - - config.NewConfig>() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.SortOrder, src => src.SortOrder) - .Map(dest => dest.Type, src => src.GetType().Name) - .Inherits(); - - - config.NewConfig>() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.SortOrder, src => src.SortOrder) - .Map(dest => dest.Type, src => src.GetType().Name) - .Inherits(); - - - config.NewConfig>() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.SortOrder, src => src.SortOrder) - .Map(dest => dest.Type, src => src.GetType().Name) - .Inherits(); - } - - private bool? Convert(Entity.PropertyClassification classification) - { - return classification.IsVisible; - } - } -} diff --git a/backend/api/Mapping/Lookup/RoleMap.cs b/backend/api/Mapping/Lookup/RoleMap.cs deleted file mode 100644 index a9edc99615..0000000000 --- a/backend/api/Mapping/Lookup/RoleMap.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Mapster; -using System; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Models.Lookup; - -namespace Pims.Api.Mapping.Lookup -{ - public class RoleMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.IsPublic, src => src.IsPublic) - .Inherits, Models.LookupModel>(); - - config.NewConfig() - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.IsPublic, src => src.IsPublic) - .Inherits, Entity.LookupEntity>(); - } - } -} diff --git a/backend/api/Mapping/LookupMap.cs b/backend/api/Mapping/LookupMap.cs deleted file mode 100644 index 78b1bcfac6..0000000000 --- a/backend/api/Mapping/LookupMap.cs +++ /dev/null @@ -1,68 +0,0 @@ -using Mapster; -using System; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Mapping -{ - public class LookupMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig, Models.LookupModel>() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.SortOrder, src => src.SortOrder) - .Map(dest => dest.Type, src => src.GetType().Name) - .Inherits(); - - config.NewConfig, Entity.LookupEntity>() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.SortOrder, src => src.SortOrder) - .Inherits(); - - - config.NewConfig, Models.LookupModel>() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.SortOrder, src => src.SortOrder) - .Map(dest => dest.Type, src => src.GetType().Name) - .Inherits(); - - config.NewConfig, Entity.LookupEntity>() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.SortOrder, src => src.SortOrder) - .Inherits(); - - - config.NewConfig, Models.LookupModel>() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.SortOrder, src => src.SortOrder) - .Map(dest => dest.Type, src => src.GetType().Name) - .Inherits(); - - config.NewConfig, Entity.LookupEntity>() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.SortOrder, src => src.SortOrder) - .Inherits(); - - - config.NewConfig, Models.LookupModel>() - .Map(dest => dest.Id, src => src.Id.ToString()) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.SortOrder, src => src.SortOrder) - .Map(dest => dest.Type, src => src.GetType().Name) - .Inherits(); - } - } -} diff --git a/backend/api/Mapping/PageModelMap.cs b/backend/api/Mapping/PageModelMap.cs deleted file mode 100644 index 18c6b70a28..0000000000 --- a/backend/api/Mapping/PageModelMap.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Mapster; -using Pims.Api.Models; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Mapping -{ - public class PageModelMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.ForType(typeof(Entity.Models.Paged<>), typeof(PageModel<>)) - .Map(nameof(PageModel.Items), nameof(PageModel.Items)) - .Map(nameof(PageModel.Page), nameof(PageModel.Page)) - .Map(nameof(PageModel.Quantity), nameof(PageModel.Quantity)) - .Map(nameof(PageModel.Total), nameof(PageModel.Total)); - } - } -} diff --git a/backend/api/Mapping/Parcel/AddressMap.cs b/backend/api/Mapping/Parcel/AddressMap.cs deleted file mode 100644 index 95a379dd2f..0000000000 --- a/backend/api/Mapping/Parcel/AddressMap.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Mapster; -using Pims.Core.Extensions; -using System; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Models.Parcel; - -namespace Pims.Api.Mapping.Parcel -{ - public class AddressMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Line1, src => src.Address1) - .Map(dest => dest.Line2, src => src.Address2) - .Map(dest => dest.AdministrativeArea, src => src.AdministrativeArea) - .Map(dest => dest.ProvinceId, src => src.ProvinceId) - .Map(dest => dest.Province, src => src.Province == null ? null : src.Province.Name) - .Map(dest => dest.Postal, src => src.Postal.FormatAsPostal()) - .Inherits(); - - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Address1, src => src.Line1) - .Map(dest => dest.Address2, src => src.Line2) - .Map(dest => dest.AdministrativeArea, src => src.AdministrativeArea) - .Map(dest => dest.ProvinceId, src => src.ProvinceId) - .Map(dest => dest.Province, src => String.IsNullOrWhiteSpace(src.Province) ? null : new Entity.Province(src.ProvinceId, src.Province)) - .Map(dest => dest.Postal, src => src.Postal.Replace(" ", "")) - .Inherits(); - } - } -} diff --git a/backend/api/Mapping/Parcel/BuildingEvaluationMap.cs b/backend/api/Mapping/Parcel/BuildingEvaluationMap.cs deleted file mode 100644 index 5587116abe..0000000000 --- a/backend/api/Mapping/Parcel/BuildingEvaluationMap.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Models.Parcel; - -namespace Pims.Api.Mapping.Parcel -{ - public class BuildingEvaluationMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.Date, src => src.Date) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - - - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.Date, src => src.Date) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - } - } -} diff --git a/backend/api/Mapping/Parcel/BuildingFiscalMap.cs b/backend/api/Mapping/Parcel/BuildingFiscalMap.cs deleted file mode 100644 index aaf0f3e791..0000000000 --- a/backend/api/Mapping/Parcel/BuildingFiscalMap.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Models.Parcel; - -namespace Pims.Api.Mapping.Parcel -{ - public class BuildingFiscalMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.FiscalYear, src => src.FiscalYear) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - - - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.BuildingId, src => src.BuildingId) - .Map(dest => dest.FiscalYear, src => src.FiscalYear) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - } - } -} diff --git a/backend/api/Mapping/Parcel/ParcelBuildingMap.cs b/backend/api/Mapping/Parcel/ParcelBuildingMap.cs deleted file mode 100644 index 54cc0de93a..0000000000 --- a/backend/api/Mapping/Parcel/ParcelBuildingMap.cs +++ /dev/null @@ -1,93 +0,0 @@ -using Mapster; -using Microsoft.Extensions.Options; -using Pims.Api.Mapping.Converters; -using Pims.Dal.Helpers.Extensions; -using System.Collections.Generic; -using System.Text.Json; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Models.Parcel; - -namespace Pims.Api.Mapping.Parcel -{ - public class ParcelBuildingMap : IRegister - { - #region Variables - private readonly JsonSerializerOptions _serializerOptions; - #endregion - - #region Constructors - /// - /// Creates a new instance of a BuildingParcelMap, initializes with specified arguments. - /// - /// - public ParcelBuildingMap(IOptions serializerOptions) - { - _serializerOptions = serializerOptions.Value; - } - #endregion - - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.ParcelId, src => src.GetParcelId()) - .Map(dest => dest.ProjectNumbers, src => JsonSerializer.Deserialize>(src.ProjectNumbers ?? "[]", _serializerOptions)) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Agency, src => AgencyConverter.ConvertAgency(src.Agency)) - .Map(dest => dest.SubAgency, src => AgencyConverter.ConvertSubAgency(src.Agency)) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Classification, src => src.Classification.Name) - .Map(dest => dest.BuildingConstructionTypeId, src => src.BuildingConstructionTypeId) - .Map(dest => dest.BuildingConstructionType, src => src.GetConstructionType()) - .Map(dest => dest.BuildingOccupantTypeId, src => src.BuildingOccupantTypeId) - .Map(dest => dest.BuildingOccupantType, src => src.GetOccupantType()) - .Map(dest => dest.BuildingPredominateUseId, src => src.BuildingPredominateUseId) - .Map(dest => dest.BuildingPredominateUse, src => src.GetPredominateUse()) - .Map(dest => dest.BuildingTenancy, src => src.BuildingTenancy) - .Map(dest => dest.BuildingFloorCount, src => src.BuildingFloorCount) - .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry) - .Map(dest => dest.OccupantName, src => src.OccupantName) - .Map(dest => dest.RentableArea, src => src.RentableArea) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.IsVisibleToOtherAgencies, src => src.IsVisibleToOtherAgencies) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Inherits(); - - - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Parcels, src => new List() { new Entity.ParcelBuilding() { ParcelId = src.ParcelId, BuildingId = src.Id } }) // TODO: Extend Mapster to handle this better. - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Location, src => src) - .Map(dest => dest.AddressId, src => src.Address == null ? 0 : src.Address.Id) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.BuildingConstructionTypeId, src => src.BuildingConstructionTypeId) - .Map(dest => dest.BuildingOccupantTypeId, src => src.BuildingOccupantTypeId) - .Map(dest => dest.BuildingPredominateUseId, src => src.BuildingPredominateUseId) - .Map(dest => dest.BuildingTenancy, src => src.BuildingTenancy) - .Map(dest => dest.BuildingFloorCount, src => src.BuildingFloorCount) - .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry) - .Map(dest => dest.OccupantName, src => src.OccupantName) - .Map(dest => dest.RentableArea, src => src.RentableArea) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.IsVisibleToOtherAgencies, src => src.IsVisibleToOtherAgencies) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Inherits(); - - config.NewConfig() - .ConstructUsing(src => Dal.Helpers.GeometryHelper.CreatePoint(src.Longitude, src.Latitude)); - } - } -} diff --git a/backend/api/Mapping/Parcel/ParcelEvaluationMap.cs b/backend/api/Mapping/Parcel/ParcelEvaluationMap.cs deleted file mode 100644 index 47639103e2..0000000000 --- a/backend/api/Mapping/Parcel/ParcelEvaluationMap.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Models.Parcel; - -namespace Pims.Api.Mapping.Parcel -{ - public class ParcelEvaluationMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.ParcelId, src => src.ParcelId) - .Map(dest => dest.Date, src => src.Date) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Map(dest => dest.Firm, src => src.Firm) - .Inherits(); - - - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.ParcelId, src => src.ParcelId) - .Map(dest => dest.Date, src => src.Date) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Map(dest => dest.Firm, src => src.Firm) - .Inherits(); - } - } -} diff --git a/backend/api/Mapping/Parcel/ParcelFiscalMap.cs b/backend/api/Mapping/Parcel/ParcelFiscalMap.cs deleted file mode 100644 index a62adbaf65..0000000000 --- a/backend/api/Mapping/Parcel/ParcelFiscalMap.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Models.Parcel; - -namespace Pims.Api.Mapping.Parcel -{ - public class ParcelFiscalMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.ParcelId, src => src.ParcelId) - .Map(dest => dest.FiscalYear, src => src.FiscalYear) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - - - config.NewConfig() - .EnumMappingStrategy(EnumMappingStrategy.ByName) - .Map(dest => dest.ParcelId, src => src.ParcelId) - .Map(dest => dest.FiscalYear, src => src.FiscalYear) - .Map(dest => dest.Key, src => src.Key) - .Map(dest => dest.Value, src => src.Value) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - } - } -} diff --git a/backend/api/Mapping/Parcel/ParcelMap.cs b/backend/api/Mapping/Parcel/ParcelMap.cs deleted file mode 100644 index 5abb69b00f..0000000000 --- a/backend/api/Mapping/Parcel/ParcelMap.cs +++ /dev/null @@ -1,87 +0,0 @@ -using Mapster; -using Microsoft.Extensions.Options; -using Pims.Api.Mapping.Converters; -using System.Collections.Generic; -using System.Linq; -using System.Text.Json; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Models.Parcel; - -namespace Pims.Api.Mapping.Parcel -{ - public class ParcelMap : IRegister - { - #region Variables - private readonly JsonSerializerOptions _serializerOptions; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ProjectMap, initializes with specified arguments. - /// - /// - public ParcelMap(IOptions serializerOptions) - { - _serializerOptions = serializerOptions.Value; - } - #endregion - - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.PID, src => src.ParcelIdentity) - .Map(dest => dest.PIN, src => src.PIN) - .Map(dest => dest.ProjectNumbers, src => JsonSerializer.Deserialize>(src.ProjectNumbers ?? "[]", _serializerOptions)) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Classification, src => src.Classification.Name) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Agency, src => AgencyConverter.ConvertAgency(src.Agency)) - .Map(dest => dest.SubAgency, src => AgencyConverter.ConvertSubAgency(src.Agency)) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.LandArea, src => src.LandArea) - .Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription) - .Map(dest => dest.Zoning, src => src.Zoning) - .Map(dest => dest.ZoningPotential, src => src.ZoningPotential) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.IsVisibleToOtherAgencies, src => src.IsVisibleToOtherAgencies) - .Map(dest => dest.Buildings, src => src.Buildings) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Inherits(); - - - config.NewConfig() - .EnableNonPublicMembers(true) - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.PID, src => ParcelConverter.ConvertPID(src.PID)) - .Map(dest => dest.PIN, src => src.PIN) - .Map(dest => dest.ProjectNumbers, src => JsonSerializer.Serialize>(src.ProjectNumbers ?? Enumerable.Empty(), _serializerOptions)) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Name, src => src.Name) - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.AgencyId, src => src.AgencyId) - .Map(dest => dest.Location, src => src) - .Map(dest => dest.AddressId, src => src.Address == null ? 0 : src.Address.Id) - .Map(dest => dest.Address, src => src.Address) - .Map(dest => dest.LandArea, src => src.LandArea) - .Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription) - .Map(dest => dest.Zoning, src => src.Zoning) - .Map(dest => dest.ZoningPotential, src => src.ZoningPotential) - .Map(dest => dest.IsSensitive, src => src.IsSensitive) - .Map(dest => dest.IsVisibleToOtherAgencies, src => src.IsVisibleToOtherAgencies) - .Map(dest => dest.Buildings, src => src.Buildings) - .Map(dest => dest.Evaluations, src => src.Evaluations) - .Map(dest => dest.Fiscals, src => src.Fiscals) - .Inherits(); - - config.NewConfig() - .ConstructUsing(src => Dal.Helpers.GeometryHelper.CreatePoint(src.Longitude, src.Latitude)); - } - } -} diff --git a/backend/api/Mapping/Parcel/PartialParcelMap.cs b/backend/api/Mapping/Parcel/PartialParcelMap.cs deleted file mode 100644 index 28c3b4a981..0000000000 --- a/backend/api/Mapping/Parcel/PartialParcelMap.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Models.Parcel; - -namespace Pims.Api.Mapping.Parcel -{ - public class PartialParcelMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.PID, src => src.ParcelIdentity) - .Map(dest => dest.PIN, src => src.PIN) - .Map(dest => dest.ClassificationId, src => src.ClassificationId) - .Map(dest => dest.Latitude, src => src.Location.Y) - .Map(dest => dest.Longitude, src => src.Location.X) - .Inherits(); - } - } -} diff --git a/backend/api/Mapping/Project/DisposalProjectMetadataMap.cs b/backend/api/Mapping/Project/DisposalProjectMetadataMap.cs deleted file mode 100644 index 5c87f129ca..0000000000 --- a/backend/api/Mapping/Project/DisposalProjectMetadataMap.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Mapster; -using Microsoft.Extensions.Options; -using System.Text.Json; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Mapping.Project -{ - public class DisposalProjectMetatdataMap : IRegister - { - #region Variables - private readonly JsonSerializerOptions _serializerOptions; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ProjectMap, initializes with specified arguments. - /// - /// - public DisposalProjectMetatdataMap(IOptions serializerOptions) - { - _serializerOptions = serializerOptions.Value; - } - #endregion - - #region Methods - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .BeforeMapping((src, dest) => JsonSerializer.Deserialize(src ?? "{}", _serializerOptions)); - - config.NewConfig() - .BeforeMapping((src, dest) => JsonSerializer.Serialize(src, _serializerOptions)); - } - #endregion - } -} diff --git a/backend/api/Mapping/Project/ProjectNoteMap.cs b/backend/api/Mapping/Project/ProjectNoteMap.cs deleted file mode 100644 index 82ac8c7a69..0000000000 --- a/backend/api/Mapping/Project/ProjectNoteMap.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Mapping.Project -{ - public class ProjectNoteMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest, src => src.Note); - } - } -} diff --git a/backend/api/Mapping/User/AccessRequestAgencyMap.cs b/backend/api/Mapping/User/AccessRequestAgencyMap.cs deleted file mode 100644 index 5e72f76581..0000000000 --- a/backend/api/Mapping/User/AccessRequestAgencyMap.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Models.User; - -namespace Pims.Api.Mapping.User -{ - public class AccessRequestAgencyMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.AgencyId) - .Map(dest => dest.Name, src => src.Agency == null ? null : src.Agency.Name) - .Map(dest => dest.Description, src => src.Agency == null ? null : src.Agency.Description) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.AgencyId, src => src.Id) - .Inherits(); - } - } -} diff --git a/backend/api/Mapping/User/AccessRequestMap.cs b/backend/api/Mapping/User/AccessRequestMap.cs deleted file mode 100644 index b041d78f98..0000000000 --- a/backend/api/Mapping/User/AccessRequestMap.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Models.User; - -namespace Pims.Api.Mapping.User -{ - public class AccessRequestMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Status, src => src.Status) - .Map(dest => dest.Agencies, src => src.Agencies) - .Map(dest => dest.Roles, src => src.Roles) - .Map(dest => dest.UserId, src => src.UserId) - .Map(dest => dest.User, src => src.User) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Status, src => src.Status) - .Map(dest => dest.Agencies, src => src.Agencies) - .Map(dest => dest.Roles, src => src.Roles) - .Map(dest => dest.UserId, src => src.UserId) - .Map(dest => dest.User, src => src.User) - .Map(dest => dest.Note, src => src.Note) - .Inherits(); - } - } -} diff --git a/backend/api/Mapping/User/AccessRequestRoleMap.cs b/backend/api/Mapping/User/AccessRequestRoleMap.cs deleted file mode 100644 index cdcb197c04..0000000000 --- a/backend/api/Mapping/User/AccessRequestRoleMap.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Models.User; - -namespace Pims.Api.Mapping.User -{ - public class AccessRequestRoleMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.RoleId) - .Map(dest => dest.Description, src => src.Role.Description) - .Map(dest => dest.Name, src => src.Role.Name) - .Map(dest => dest.IsDisabled, src => src.Role.IsDisabled) - .Map(dest => dest.SortOrder, src => src.Role.SortOrder) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.RoleId, src => src.Id) - .Inherits(); - } - } -} diff --git a/backend/api/Mapping/User/AccessRequestUserMap.cs b/backend/api/Mapping/User/AccessRequestUserMap.cs deleted file mode 100644 index dc413404c7..0000000000 --- a/backend/api/Mapping/User/AccessRequestUserMap.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Models.User; - -namespace Pims.Api.Mapping.User -{ - public class AccessRequestUserMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Username, src => src.Username) - .Map(dest => dest.DisplayName, src => src.DisplayName) - .Map(dest => dest.FirstName, src => src.FirstName) - .Map(dest => dest.MiddleName, src => src.MiddleName) - .Map(dest => dest.LastName, src => src.LastName) - .Map(dest => dest.Email, src => src.Email) - .Map(dest => dest.Position, src => src.Position) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Username, src => src.Username) - .Map(dest => dest.DisplayName, src => src.DisplayName) - .Map(dest => dest.FirstName, src => src.FirstName) - .Map(dest => dest.MiddleName, src => src.MiddleName) - .Map(dest => dest.LastName, src => src.LastName) - .Map(dest => dest.Email, src => src.Email) - .Map(dest => dest.Position, src => src.Position) - .Inherits(); - } - } -} diff --git a/backend/api/Mapping/User/AgencyMap.cs b/backend/api/Mapping/User/AgencyMap.cs deleted file mode 100644 index e215d6fb87..0000000000 --- a/backend/api/Mapping/User/AgencyMap.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Models.User; - -namespace Pims.Api.Mapping.User -{ - public class AgencyMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.Parent, src => src.Parent) - .Map(dest => dest.Children, src => src.Children) - .Map(dest => dest.Users, src => src.Users) - .Inherits, Models.CodeModel>(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.ParentId, src => src.Parent == null ? (int?)null : src.Parent.Id) - .Map(dest => dest.Parent, src => src.Parent) - .Map(dest => dest.Children, src => src.Children) - .Map(dest => dest.Users, src => src.Users) - .Inherits, Entity.CodeEntity>(); - } - } -} diff --git a/backend/api/Mapping/User/RoleMap.cs b/backend/api/Mapping/User/RoleMap.cs deleted file mode 100644 index eba62083b1..0000000000 --- a/backend/api/Mapping/User/RoleMap.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Mapster; -using System; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Models.User; - -namespace Pims.Api.Mapping.User -{ - public class RoleMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.IsPublic, src => src.IsPublic) - .Map(dest => dest.Users, src => src.Users) - .Inherits, Models.LookupModel>(); - - config.NewConfig() - .Map(dest => dest.Description, src => src.Description) - .Map(dest => dest.IsPublic, src => src.IsPublic) - .Map(dest => dest.Users, src => src.Users) - .Inherits, Entity.LookupEntity>(); - } - } -} diff --git a/backend/api/Mapping/User/UserMap.cs b/backend/api/Mapping/User/UserMap.cs deleted file mode 100644 index 2d50106bd9..0000000000 --- a/backend/api/Mapping/User/UserMap.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Mapster; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Models.User; - -namespace Pims.Api.Mapping.User -{ - public class UserMap : IRegister - { - public void Register(TypeAdapterConfig config) - { - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.Username, src => src.Username) - .Map(dest => dest.Position, src => src.Position) - .Map(dest => dest.DisplayName, src => src.DisplayName) - .Map(dest => dest.FirstName, src => src.FirstName) - .Map(dest => dest.MiddleName, src => src.MiddleName) - .Map(dest => dest.LastName, src => src.LastName) - .Map(dest => dest.Email, src => src.Email) - .Map(dest => dest.Note, src => src.Note) - .Map(dest => dest.Agencies, src => src.Agencies) - .Map(dest => dest.Roles, src => src.Roles) - .Inherits(); - - config.NewConfig() - .Map(dest => dest.Id, src => src.Id) - .Map(dest => dest.IsDisabled, src => src.IsDisabled) - .Map(dest => dest.Username, src => src.Username) - .Map(dest => dest.Position, src => src.Position) - .Map(dest => dest.DisplayName, src => src.DisplayName) - .Map(dest => dest.FirstName, src => src.FirstName) - .Map(dest => dest.MiddleName, src => src.MiddleName) - .Map(dest => dest.LastName, src => src.LastName) - .Map(dest => dest.Email, src => src.Email) - .Map(dest => dest.Note, src => src.Note) - .Map(dest => dest.Agencies, src => src.Agencies) - .Map(dest => dest.Roles, src => src.Roles) - .Inherits(); - } - } -} diff --git a/backend/api/Models/Auth/ClaimModel.cs b/backend/api/Models/Auth/ClaimModel.cs deleted file mode 100644 index 8931bb4ae3..0000000000 --- a/backend/api/Models/Auth/ClaimModel.cs +++ /dev/null @@ -1,40 +0,0 @@ -namespace Pims.Api.Models.Auth -{ - /// - /// ClaimModel class, provides a model to represent a claim. - /// - public class ClaimModel - { - #region Properties - /// - /// get/set - The claim name. - /// - /// - public string Claim { get; set; } - - /// - /// get/set - The claim value. - /// - /// - public string Value { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a ClaimModel object. - /// - public ClaimModel() { } - - /// - /// Creates a new instance of a ClaimModel object, initializes it with specified arguments. - /// - /// - /// - public ClaimModel(string claim, string value) - { - this.Claim = claim; - this.Value = value; - } - #endregion - } -} diff --git a/backend/api/Models/Auth/UserModel.cs b/backend/api/Models/Auth/UserModel.cs deleted file mode 100644 index 9e6090bca2..0000000000 --- a/backend/api/Models/Auth/UserModel.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Models.Auth -{ - /// - /// UserModel class, provides a model to represent a user. - /// - public class UserModel - { - #region Properties - /// - /// get/set - The user id. - /// - /// - public Guid Id { get; set; } - - /// - /// get/set - The user's keycloak id. - /// - public Guid? KeycloakUserId { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a UserModel object. - /// - public UserModel() { } - - /// - /// Creates a new instance of a UserModel object, initializes it with specified arguments. - /// - /// - /// - public UserModel(Guid id, Guid? keycloakUserId) - { - this.Id = id; - this.KeycloakUserId = keycloakUserId; - } - - /// - /// Creates a new instance of a UserModel object, initializes it with specified arguments. - /// - /// - public UserModel(Entity.User user) - { - this.Id = user.Id; - this.KeycloakUserId = user.KeycloakUserId; - } - #endregion - } -} diff --git a/backend/api/Models/BaseModel.cs b/backend/api/Models/BaseModel.cs deleted file mode 100644 index fb9af2ba8a..0000000000 --- a/backend/api/Models/BaseModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace Pims.Api.Models -{ - public abstract class BaseModel - { - #region Properties - public DateTime CreatedOn { get; set; } - - public DateTime? UpdatedOn { get; set; } - - public string UpdatedByName { get; set; } - - public string UpdatedByEmail { get; set; } - - public string RowVersion { get; set; } - #endregion - } -} diff --git a/backend/api/Models/Building/AddressModel.cs b/backend/api/Models/Building/AddressModel.cs deleted file mode 100644 index 43ec765ab1..0000000000 --- a/backend/api/Models/Building/AddressModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Pims.Api.Models.Building -{ - public class AddressModel : BaseModel - { - #region Properties - public int Id { get; set; } - - public string Line1 { get; set; } - - public string Line2 { get; set; } - - public string AdministrativeArea { get; set; } - - public string ProvinceId { get; set; } - - public string Province { get; set; } - - public string Postal { get; set; } - #endregion - } -} diff --git a/backend/api/Models/Building/BuildingEvaluationModel.cs b/backend/api/Models/Building/BuildingEvaluationModel.cs deleted file mode 100644 index a675a72dd1..0000000000 --- a/backend/api/Models/Building/BuildingEvaluationModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace Pims.Api.Models.Building -{ - public class BuildingEvaluationModel : BaseModel - { - #region Properties - public int BuildingId { get; set; } - - public DateTime Date { get; set; } - - public string Key { get; set; } - - public decimal Value { get; set; } - - public string Note { get; set; } - #endregion - } -} diff --git a/backend/api/Models/Building/BuildingFiscalModel.cs b/backend/api/Models/Building/BuildingFiscalModel.cs deleted file mode 100644 index 2c7f0c99f7..0000000000 --- a/backend/api/Models/Building/BuildingFiscalModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Pims.Api.Models.Building -{ - public class BuildingFiscalModel : BaseModel - { - #region Properties - public int BuildingId { get; set; } - - public int FiscalYear { get; set; } - - public string Key { get; set; } - - public decimal Value { get; set; } - - public string Note { get; set; } - #endregion - } -} diff --git a/backend/api/Models/Building/BuildingModel.cs b/backend/api/Models/Building/BuildingModel.cs deleted file mode 100644 index 3168c5225d..0000000000 --- a/backend/api/Models/Building/BuildingModel.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Pims.Api.Models.Parcel; -using System; -using System.Collections.Generic; - -namespace Pims.Api.Models.Building -{ - public class BuildingModel : PropertyModel - { - #region Properties - public int ParcelId { get; set; } - - public int BuildingConstructionTypeId { get; set; } - - public string BuildingConstructionType { get; set; } - - public int BuildingFloorCount { get; set; } - - public int BuildingPredominateUseId { get; set; } - - public string BuildingPredominateUse { get; set; } - - public int BuildingOccupantTypeId { get; set; } - - public string BuildingOccupantType { get; set; } - - public DateTime? LeaseExpiry { get; set; } - - public string OccupantName { get; set; } - - public bool TransferLeaseOnSale { get; set; } - - public string BuildingTenancy { get; set; } - - public float RentableArea { get; set; } - - public IEnumerable Evaluations { get; set; } = new List(); - - public IEnumerable Fiscals { get; set; } = new List(); - #endregion - } -} diff --git a/backend/api/Models/Building/PartialBuildingModel.cs b/backend/api/Models/Building/PartialBuildingModel.cs deleted file mode 100644 index 1414f2315b..0000000000 --- a/backend/api/Models/Building/PartialBuildingModel.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Pims.Api.Models.Parcel; - -namespace Pims.Api.Models.Building -{ - public class PartialBuildingModel : PartialPropertyModel - { - #region Properties - #endregion - } -} diff --git a/backend/api/Models/CodeModel.cs b/backend/api/Models/CodeModel.cs deleted file mode 100644 index a95b7de14d..0000000000 --- a/backend/api/Models/CodeModel.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace Pims.Api.Models -{ - /// - /// CodeModel class, provides a model that represents a code code item. - /// - /// - public class CodeModel : LookupModel - { - #region Properties - /// - /// get/set - The item's unique code. - /// - /// - public string Code { get; set; } - - /// - /// get/set - The parent id of this item. - /// - public int? ParentId { get; set; } // TODO: this isn't ideal as it will only currently be used by agency. - #endregion - } -} diff --git a/backend/api/Models/Create/BaseModel.cs b/backend/api/Models/Create/BaseModel.cs deleted file mode 100644 index 8d1eb852b9..0000000000 --- a/backend/api/Models/Create/BaseModel.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Pims.Api.Models.Create -{ - public abstract class BaseModel - { - #region Properties - #endregion - } -} diff --git a/backend/api/Models/ErrorResponseModel.cs b/backend/api/Models/ErrorResponseModel.cs deleted file mode 100644 index 4e26296c3d..0000000000 --- a/backend/api/Models/ErrorResponseModel.cs +++ /dev/null @@ -1,73 +0,0 @@ -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Hosting; -using Pims.Core.Extensions; -using System; - -namespace Pims.Api.Models -{ - /// - /// ErrorResponseModel class, provides a standardized error message for unhandled exceptions. - /// - public class ErrorResponseModel - { - #region Properties - /// - /// get/set - The error message. - /// - /// - public string Error { get; set; } - - /// - /// get/set - The exception type that threw thew exception. - /// - /// - public string Type { get; set; } - - /// - /// get/set - The details of the error (all the inner exceptions.) - /// - /// - public string Details { get; set; } - - /// - /// get/set - The stack trace. - /// - /// - public string StackTrace { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of an ErrorResponseModel object. - /// - public ErrorResponseModel() { } - - /// - /// Creates a new instance of an ErrorResponseModel object, initializes with specified arguments. - /// - /// - /// - /// - /// - public ErrorResponseModel(IWebHostEnvironment environment, Exception ex, string message = null, string details = null) - { - var showError = !environment.IsProduction(); - this.Error = showError ? ex.Message : message; - this.Type = ex.GetType().Name; - this.Details = showError ? details ?? ex.GetAllMessages() : null; - this.StackTrace = showError ? ex.StackTrace : null; - } - - /// - /// Creates a new instance of an ErrorResponseModel object, initializes with specified arguments. - /// - /// - /// - public ErrorResponseModel(string message, string details) - { - this.Error = message; - this.Details = details; - } - #endregion - } -} diff --git a/backend/api/Models/Health/EnvModel.cs b/backend/api/Models/Health/EnvModel.cs deleted file mode 100644 index bf8376ff0b..0000000000 --- a/backend/api/Models/Health/EnvModel.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Microsoft.AspNetCore.Hosting; -using System.Reflection; - -namespace Pims.Api.Models.Health -{ - /// - /// EnvModel class, provides a model to represent a user. - /// - public class EnvModel - { - #region Properties - /// - /// get/set - The environment name. - /// - /// - public string Environment { get; set; } - - /// - /// get/set - The version. - /// - /// - public string Version { get; set; } - - /// - /// get/set - The file version. - /// - /// - public string FileVersion { get; set; } - - /// - /// get/set - The information version. - /// - /// - public string InformationalVersion { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a EnvModel object. - /// - public EnvModel() { } - - /// - /// Creates a new instance of a EnvModel object, initializes it with specified arguments. - /// - /// - public EnvModel(IWebHostEnvironment environment) - { - this.Environment = environment.EnvironmentName; - this.Version = this.GetType().Assembly.GetName().Version.ToString(); - this.FileVersion = Assembly.GetEntryAssembly().GetCustomAttribute().Version; - this.InformationalVersion = Assembly.GetEntryAssembly().GetCustomAttribute().InformationalVersion; - } - #endregion - } -} diff --git a/backend/api/Models/Lookup/RoleModel.cs b/backend/api/Models/Lookup/RoleModel.cs deleted file mode 100644 index 98435de13e..0000000000 --- a/backend/api/Models/Lookup/RoleModel.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace Pims.Api.Models.Lookup -{ - public class RoleModel : LookupModel - { - #region Properties - public string Description { get; set; } - public bool IsPublic { get; set; } - #endregion - } -} diff --git a/backend/api/Models/LookupModel.cs b/backend/api/Models/LookupModel.cs deleted file mode 100644 index e7b7edf80d..0000000000 --- a/backend/api/Models/LookupModel.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace Pims.Api.Models -{ - /// - /// LookupModel class, provides a model that represents a code lookup item. - /// - /// - public class LookupModel : BaseModel - { - #region Properties - /// - /// get/set - The item's unique identifier. - /// - /// - public TKey Id { get; set; } - - /// - /// get/set - The item's name. - /// - /// - public string Name { get; set; } - - /// - /// get/set - Whether the item is disabled. - /// - /// - public bool IsDisabled { get; set; } - - /// - /// get/set - Whether this item is visible. - /// - public bool? IsVisible { get; set; } - - /// - /// get/set - The item's sort order. - /// - /// - public int SortOrder { get; set; } - - /// - /// get/set - The item's type. - /// - /// - public string Type { get; set; } - #endregion - } -} diff --git a/backend/api/Models/Membership/ApplicationUserModel.cs b/backend/api/Models/Membership/ApplicationUserModel.cs deleted file mode 100644 index 6bccffbe1c..0000000000 --- a/backend/api/Models/Membership/ApplicationUserModel.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; - -namespace Pims.Api.Models.Membership -{ - /// - /// ApplicationUserModel class, provides a way to manage application users. - /// - public class ApplicationUserModel - { - #region Properties - public Guid Id { get; set; } - public string FirstName { get; set; } - public string LastName { get; set; } - #endregion - - #region Constructors - public ApplicationUserModel() { } - - public ApplicationUserModel(Guid id, string firstName, string lastName) - { - this.Id = id; - this.FirstName = firstName; - this.LastName = lastName; - } - #endregion - } -} diff --git a/backend/api/Models/PageModel.cs b/backend/api/Models/PageModel.cs deleted file mode 100644 index b285e67136..0000000000 --- a/backend/api/Models/PageModel.cs +++ /dev/null @@ -1,82 +0,0 @@ -using Pims.Dal.Entities.Models; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Pims.Api.Models -{ - /// - /// PageModel class, provides a model that represents a single page of items. - /// - /// - public class PageModel - { - #region Properties - /// - /// get/set - The items on the page. - /// - public IEnumerable Items { get; set; } - - /// - /// get/set - The page number. - /// - public int Page { get; set; } - - /// - /// get/set - The requested number of item per page. - /// - public int Quantity { get; set; } - - /// - /// get/set - The total items for the specified type and query (not the number of items on the page). - /// - public int Total { get; set; } - #endregion - - #region Constructors - /// - /// Create a new instance of a PageModel of type 'T'. - /// - public PageModel() { } - - /// - /// Create a new instance of a PageModel of type 'T', initialize with specified arguments. - /// - /// - /// - /// - public PageModel(IEnumerable items, int page = 1, int quantity = 10) - : this(items, page, quantity, items?.Count() ?? 0) - { - } - - /// - /// Create a new instance of a PageModel of type 'T', initialize with specified arguments. - /// - /// - /// - /// - /// - public PageModel(IEnumerable items, int page, int quantity, int total) - { - if (page < 1) throw new ArgumentException("Must be greater than or equal to 1.", nameof(page)); - if (quantity < 1) throw new ArgumentException("Must be greater than or equal to 1.", nameof(quantity)); - if (total < 0) throw new ArgumentException("Must be greater than or equal to 0.", nameof(total)); - - this.Items = items ?? throw new ArgumentNullException(nameof(items)); - this.Page = page; - this.Quantity = quantity; - this.Total = total; - } - - /// - /// Create a new instance of a PageModel of type 'T', initialize with specified arguments. - /// - /// - public PageModel(Paged page) - : this(page.Items, page.Page, page.Quantity, page.Total) - { - } - #endregion - } -} diff --git a/backend/api/Models/Parcel/AddressModel.cs b/backend/api/Models/Parcel/AddressModel.cs deleted file mode 100644 index 089e9e293e..0000000000 --- a/backend/api/Models/Parcel/AddressModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Pims.Api.Models.Parcel -{ - public class AddressModel : BaseModel - { - #region Properties - public int Id { get; set; } - - public string Line1 { get; set; } - - public string Line2 { get; set; } - - public string AdministrativeArea { get; set; } - - public string ProvinceId { get; set; } - - public string Province { get; set; } - - public string Postal { get; set; } - #endregion - } -} diff --git a/backend/api/Models/Parcel/BuildingEvaluationModel.cs b/backend/api/Models/Parcel/BuildingEvaluationModel.cs deleted file mode 100644 index c131f921ce..0000000000 --- a/backend/api/Models/Parcel/BuildingEvaluationModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace Pims.Api.Models.Parcel -{ - public class BuildingEvaluationModel : BaseModel - { - #region Properties - public int BuildingId { get; set; } - - public DateTime Date { get; set; } - - public string Key { get; set; } - - public decimal Value { get; set; } - - public string Note { get; set; } - #endregion - } -} diff --git a/backend/api/Models/Parcel/BuildingFiscalModel.cs b/backend/api/Models/Parcel/BuildingFiscalModel.cs deleted file mode 100644 index 06cc3adb62..0000000000 --- a/backend/api/Models/Parcel/BuildingFiscalModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Pims.Api.Models.Parcel -{ - public class BuildingFiscalModel : BaseModel - { - #region Properties - public int BuildingId { get; set; } - - public int FiscalYear { get; set; } - - public string Key { get; set; } - - public decimal Value { get; set; } - - public string Note { get; set; } - #endregion - } -} diff --git a/backend/api/Models/Parcel/BuildingParcelModel.cs b/backend/api/Models/Parcel/BuildingParcelModel.cs deleted file mode 100644 index cab0257f1f..0000000000 --- a/backend/api/Models/Parcel/BuildingParcelModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.Generic; - -namespace Pims.Api.Models.Parcel -{ - public class BuildingParcelModel : ParcelModel - { - public override IEnumerable Buildings { get; set; } = new List(); - public string OwnershipNote { get; set; } - public int BuildingId { get; set; } - } -} diff --git a/backend/api/Models/Parcel/CheckPidAvailabilityResponseModel.cs b/backend/api/Models/Parcel/CheckPidAvailabilityResponseModel.cs deleted file mode 100644 index a123c7b5e5..0000000000 --- a/backend/api/Models/Parcel/CheckPidAvailabilityResponseModel.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Pims.Api.Models.Parcel -{ - public class CheckPidAvailabilityResponseModel - { - public bool Available { get; set; } - } -} diff --git a/backend/api/Models/Parcel/ParcelBuildingModel.cs b/backend/api/Models/Parcel/ParcelBuildingModel.cs deleted file mode 100644 index d02a577ad6..0000000000 --- a/backend/api/Models/Parcel/ParcelBuildingModel.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Api.Models.Parcel -{ - public class ParcelBuildingModel : PropertyModel - { - #region Properties - public int ParcelId { get; set; } - - public int BuildingConstructionTypeId { get; set; } - - public string BuildingConstructionType { get; set; } - - public int BuildingFloorCount { get; set; } - - public int BuildingPredominateUseId { get; set; } - - public string BuildingPredominateUse { get; set; } - - public int BuildingOccupantTypeId { get; set; } - - public string BuildingOccupantType { get; set; } - - public DateTime? LeaseExpiry { get; set; } - - public string OccupantName { get; set; } - - public bool TransferLeaseOnSale { get; set; } - - public string BuildingTenancy { get; set; } - - public float RentableArea { get; set; } - - public IEnumerable Evaluations { get; set; } = new List(); - - public IEnumerable Fiscals { get; set; } = new List(); - #endregion - } -} diff --git a/backend/api/Models/Parcel/ParcelEvaluationModel.cs b/backend/api/Models/Parcel/ParcelEvaluationModel.cs deleted file mode 100644 index e08cb382ae..0000000000 --- a/backend/api/Models/Parcel/ParcelEvaluationModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; - -namespace Pims.Api.Models.Parcel -{ - public class ParcelEvaluationModel : BaseModel - { - #region Properties - public int ParcelId { get; set; } - - public DateTime Date { get; set; } - - public string Key { get; set; } - - public decimal Value { get; set; } - - public string Note { get; set; } - - public string Firm { get; set; } - #endregion - } -} diff --git a/backend/api/Models/Parcel/ParcelFiscalModel.cs b/backend/api/Models/Parcel/ParcelFiscalModel.cs deleted file mode 100644 index 11d67fc217..0000000000 --- a/backend/api/Models/Parcel/ParcelFiscalModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Pims.Api.Models.Parcel -{ - public class ParcelFiscalModel : BaseModel - { - #region Properties - public int ParcelId { get; set; } - - public int FiscalYear { get; set; } - - public string Key { get; set; } - - public decimal Value { get; set; } - - public string Note { get; set; } - #endregion - } -} diff --git a/backend/api/Models/Parcel/ParcelModel.cs b/backend/api/Models/Parcel/ParcelModel.cs deleted file mode 100644 index f07051f98a..0000000000 --- a/backend/api/Models/Parcel/ParcelModel.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Collections.Generic; - -namespace Pims.Api.Models.Parcel -{ - public class ParcelModel : PropertyModel - { - #region Properties - public string PID { get; set; } - - public int? PIN { get; set; } - - public float LandArea { get; set; } - - public string LandLegalDescription { get; set; } - - public string Zoning { get; set; } - - public string ZoningPotential { get; set; } - - public IEnumerable Evaluations { get; set; } = new List(); - - public IEnumerable Fiscals { get; set; } = new List(); - - public virtual IEnumerable Buildings { get; set; } = new List(); - #endregion - } -} diff --git a/backend/api/Models/Parcel/PartialParcelModel.cs b/backend/api/Models/Parcel/PartialParcelModel.cs deleted file mode 100644 index 692d32a8a1..0000000000 --- a/backend/api/Models/Parcel/PartialParcelModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Pims.Api.Models.Parcel -{ - public class PartialParcelModel : PartialPropertyModel - { - #region Properties - public string PID { get; set; } - - public string PIN { get; set; } - - public string Zoning { get; set; } - - public string ZoningPotential { get; set; } - #endregion - } -} diff --git a/backend/api/Models/Parcel/PartialPropertyModel.cs b/backend/api/Models/Parcel/PartialPropertyModel.cs deleted file mode 100644 index 608e38dd6a..0000000000 --- a/backend/api/Models/Parcel/PartialPropertyModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Pims.Api.Models.Parcel -{ - public class PartialPropertyModel : BaseModel - { - #region Properties - public int Id { get; set; } - - public string Name { get; set; } - - public int StatusId { get; set; } - - public int ClassificationId { get; set; } - - public double Latitude { get; set; } - - public double Longitude { get; set; } - - public string Description { get; set; } - #endregion - } -} diff --git a/backend/api/Models/Parcel/PropertyModel.cs b/backend/api/Models/Parcel/PropertyModel.cs deleted file mode 100644 index 1668da6461..0000000000 --- a/backend/api/Models/Parcel/PropertyModel.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Collections.Generic; - -namespace Pims.Api.Models.Parcel -{ - public class PropertyModel : BaseModel - { - #region Properties - public int Id { get; set; } - - public IEnumerable ProjectNumbers { get; set; } - - public string Name { get; set; } - - public string Description { get; set; } - - public int ClassificationId { get; set; } - - public string Classification { get; set; } - - public string EncumbranceReason { get; set; } - - public int AgencyId { get; set; } - - public virtual string SubAgency { get; set; } - - public string Agency { get; set; } - - public AddressModel Address { get; set; } - - public double Latitude { get; set; } - - public double Longitude { get; set; } - - public bool IsSensitive { get; set; } - - public bool IsVisibleToOtherAgencies { get; set; } - #endregion - } -} diff --git a/backend/api/Models/Update/BaseModel.cs b/backend/api/Models/Update/BaseModel.cs deleted file mode 100644 index 15c1395ce0..0000000000 --- a/backend/api/Models/Update/BaseModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Pims.Api.Models.Update -{ - public abstract class BaseModel - { - #region Properties - public string RowVersion { get; set; } - #endregion - } -} diff --git a/backend/api/Models/User/AccessRequestAgencyModel.cs b/backend/api/Models/User/AccessRequestAgencyModel.cs deleted file mode 100644 index fe93e72ae4..0000000000 --- a/backend/api/Models/User/AccessRequestAgencyModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Pims.Api.Models.User -{ - public class AccessRequestAgencyModel : CodeModel - { - #region Properties - public string Description { get; set; } - #endregion - } -} diff --git a/backend/api/Models/User/AccessRequestModel.cs b/backend/api/Models/User/AccessRequestModel.cs deleted file mode 100644 index 96ba945311..0000000000 --- a/backend/api/Models/User/AccessRequestModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Pims.Dal.Entities; -using System; -using System.Collections.Generic; - -namespace Pims.Api.Models.User -{ - public class AccessRequestModel : BaseModel - { - #region Properties - public int Id { get; set; } - public Guid UserId { get; set; } - public AccessRequestUserModel User { get; set; } - public IEnumerable Agencies { get; set; } - public AccessRequestStatus Status { get; set; } - public IEnumerable Roles { get; set; } - public string Note { get; set; } - #endregion - } -} diff --git a/backend/api/Models/User/AccessRequestNotificationModel.cs b/backend/api/Models/User/AccessRequestNotificationModel.cs deleted file mode 100644 index 9c0c427efa..0000000000 --- a/backend/api/Models/User/AccessRequestNotificationModel.cs +++ /dev/null @@ -1,52 +0,0 @@ -using Pims.Dal; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Models.User -{ - /// - /// AccessRequestNotificationModel class, provides a model that is used to generate access request notifications. - /// - public class AccessRequestNotificationModel - { - #region Properties - /// - /// get/ste - The access request. - /// - public Entity.AccessRequest AccessRequest { get; set; } - - /// - /// get/set - Environment configuration settings. - /// - public Entity.Models.EnvironmentModel Environment { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of an AccessRequestNotificationModel. - /// - public AccessRequestNotificationModel() { } - - /// - /// Creates a new instance of an AccessRequestNotificationModel, initializes it with specified arguments. - /// - /// - /// - public AccessRequestNotificationModel(Entity.AccessRequest accessRequest, Entity.Models.EnvironmentModel env) - { - this.AccessRequest = accessRequest; - this.Environment = env; - } - - /// - /// Creates a new instance of an AccessRequestNotificationModel, initializes it with specified arguments. - /// - /// - /// - public AccessRequestNotificationModel(Entity.AccessRequest accessRequest, PimsOptions options) - { - this.AccessRequest = accessRequest; - this.Environment = new Entity.Models.EnvironmentModel(options.Environment.Uri, options.Environment.Name, options.Environment.Title); - } - #endregion - } -} diff --git a/backend/api/Models/User/AccessRequestRoleModel.cs b/backend/api/Models/User/AccessRequestRoleModel.cs deleted file mode 100644 index c0f3bd9bf8..0000000000 --- a/backend/api/Models/User/AccessRequestRoleModel.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace Pims.Api.Models.User -{ - /// - /// AccessRequestRoleModel class, provides a model that represents a role attached to an access request. - /// - public class AccessRequestRoleModel : LookupModel - { - #region Properties - public string Description { get; set; } - #endregion - } -} diff --git a/backend/api/Models/User/AccessRequestUserModel.cs b/backend/api/Models/User/AccessRequestUserModel.cs deleted file mode 100644 index 39ab2e12a4..0000000000 --- a/backend/api/Models/User/AccessRequestUserModel.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; - -namespace Pims.Api.Models.User -{ - /// - /// AccessRequestUserModel class, provides a model that represents a user attached to an access request. - /// - public class AccessRequestUserModel : BaseModel - { - #region Properties - /// - /// get/set - The user's unique identifier. - /// - /// - public Guid Id { get; set; } - - /// - /// get/set - The user's unique username. - /// - /// - public string Username { get; set; } - - /// - /// get/set - The user's display name. - /// - /// - public string DisplayName { get; set; } - - /// - /// get/set - The user's given name. - /// - /// - public string FirstName { get; set; } - - /// - /// get/set - The user's middlename. - /// - /// - public string MiddleName { get; set; } - - /// - /// get/set - The user's surname. - /// - /// - public string LastName { get; set; } - - /// - /// get/set - The user's email. - /// - /// - public string Email { get; set; } - - /// - /// get/set - The user's position title. - /// - /// - public string Position { get; set; } - #endregion - } -} diff --git a/backend/api/Models/User/AgencyModel.cs b/backend/api/Models/User/AgencyModel.cs deleted file mode 100644 index 9bc36757aa..0000000000 --- a/backend/api/Models/User/AgencyModel.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Collections.Generic; - -namespace Pims.Api.Models.User -{ - public class AgencyModel : CodeModel - { - #region Properties - public string Description { get; set; } - public AgencyModel Parent { get; set; } - public ICollection Children { get; } = new List(); - public ICollection Users { get; } = new List(); - #endregion - } -} diff --git a/backend/api/Models/User/RoleModel.cs b/backend/api/Models/User/RoleModel.cs deleted file mode 100644 index bb10162893..0000000000 --- a/backend/api/Models/User/RoleModel.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Api.Models.User -{ - public class RoleModel : LookupModel - { - #region Properties - public string Description { get; set; } - public bool IsPublic { get; set; } - public ICollection Users { get; } = new List(); - #endregion - } -} diff --git a/backend/api/Models/User/UserModel.cs b/backend/api/Models/User/UserModel.cs deleted file mode 100644 index 54b74f03e9..0000000000 --- a/backend/api/Models/User/UserModel.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Api.Models.User -{ - public class UserModel : Pims.Api.Models.BaseModel - { - #region Properties - public Guid Id { get; set; } - - public bool IsDisabled { get; set; } - - public string Username { get; set; } - - public string Position { get; set; } - - public string DisplayName { get; set; } - - public string FirstName { get; set; } - - public string MiddleName { get; set; } - - public string LastName { get; set; } - - public string Email { get; set; } - - public string Note { get; set; } - - public IEnumerable Agencies { get; set; } - - public IEnumerable Roles { get; set; } - #endregion - } -} diff --git a/backend/api/Pims.Api.csproj b/backend/api/Pims.Api.csproj deleted file mode 100644 index dce019f9df..0000000000 --- a/backend/api/Pims.Api.csproj +++ /dev/null @@ -1,64 +0,0 @@ - - - - net7.0 - 0ef6255f-9ea0-49ec-8c65-c172304b4926 - 8.0 - 0.1.0.0-alpha - 0.1.0.0 - true - $(NoWarn);1591 - 16BC0468-78F6-4C91-87DA-7403C919E646 - - - - - - - - - - - - - - - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/api/Policies/HasPermissionAttribute.cs b/backend/api/Policies/HasPermissionAttribute.cs deleted file mode 100644 index 4f3269f685..0000000000 --- a/backend/api/Policies/HasPermissionAttribute.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Pims.Dal.Security; -using System; - -namespace Pims.Api.Policies -{ - /// - /// HasPermissionAttribute class, provides an attribute that will authorize a users claims to determine if they have permission to perform the requested action. - /// - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)] - public class HasPermissionAttribute : TypeFilterAttribute - { - #region Constructors - /// - /// Creates a new instance of a HasPermissionAttribute, initializes it with the specified permission. - /// This will ensure the user has the specified permission. - /// - /// - /// - public HasPermissionAttribute(Permissions permission) : base(typeof(PermissionFilter)) - { - this.Arguments = new object[] { permission }; - } - - /// - /// Creates a new instance of a HasPermissionAttribute, initializes it with the specified permissions. - /// This will ensure the user has at least one of the specified permissions. - /// - /// - /// - public HasPermissionAttribute(params Permissions[] permissions) : base(typeof(PermissionFilter)) - { - this.Arguments = new object[] { permissions }; - } - #endregion - } -} diff --git a/backend/api/Policies/PermissionFilter.cs b/backend/api/Policies/PermissionFilter.cs deleted file mode 100644 index ed1aa09f82..0000000000 --- a/backend/api/Policies/PermissionFilter.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Filters; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System.Linq; - -namespace Pims.Api.Policies -{ - /// - /// PermissionFilter class, provides a authorization filter that validates the specified permissions. - /// - public class PermissionFilter : IAuthorizationFilter - { - #region Variables - readonly Permissions[] _permissions; - #endregion - - #region Constructors - /// - /// Creates a new instance of a PermissionFilter class, initializes it with the specified permission. - /// This will ensure the user has the specified permission. - /// - /// - public PermissionFilter(Permissions permission) - { - _permissions = new[] { permission }; - } - - /// - /// Creates a new instance of a PermissionFilter class, initializes it with the specified permissions. - /// This will ensure the user has at least one of the specified permissions. - /// - /// - public PermissionFilter(params Permissions[] permissions) - { - _permissions = permissions; - } - #endregion - - #region Methods - /// - /// On the authorization trigger validated that the user has the specified claim permissions. - /// If they do not return an HTTP 403. - /// - /// - public void OnAuthorization(AuthorizationFilterContext context) - { - var hasRole = context.HttpContext.User.HasPermission(_permissions.ToArray()); - if (!hasRole) - { - context.Result = new ForbidResult(); - } - } - #endregion - } -} diff --git a/backend/api/Program.cs b/backend/api/Program.cs deleted file mode 100644 index 314be4d38c..0000000000 --- a/backend/api/Program.cs +++ /dev/null @@ -1,60 +0,0 @@ -using Microsoft.AspNetCore; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using System; -using Serilog; -using System.Diagnostics.CodeAnalysis; - -namespace Pims.Api -{ - /// - /// Program class, provides the main program starting point for the Geo-spatial application. - /// - [ExcludeFromCodeCoverage] - public class Program - { - /// - /// The primary entry point for the application. - /// - /// - public static void Main(string[] args) - { - // ConfigureLogging(); - var builder = CreateWebHostBuilder(args); - builder.Build().Run(); - } - - /// - /// Create a default configuration and setup for a web application. - /// - /// - /// - public static IWebHostBuilder CreateWebHostBuilder(string[] args) - { - DotNetEnv.Env.Load(); - var env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); - var config = new ConfigurationBuilder() - .AddEnvironmentVariables() - .AddCommandLine(args) - .Build(); - - return WebHost.CreateDefaultBuilder(args) - .ConfigureAppConfiguration((hostingContext, config) => - { - config.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true); - config.AddJsonFile($"appsettings.{env}.json", optional: true, reloadOnChange: true); - config.AddJsonFile("connectionstrings.json", optional: true, reloadOnChange: true); - config.AddJsonFile($"connectionstrings.{env}.json", optional: true, reloadOnChange: true); - config.AddJsonFile("geocoder.json", optional: false, reloadOnChange: true); - config.AddJsonFile($"geocoder.{env}.json", optional: true, reloadOnChange: true); - config.AddJsonFile("ches.json", optional: false, reloadOnChange: true); - config.AddJsonFile($"ches.{env}.json", optional: true, reloadOnChange: true); - config.AddEnvironmentVariables(); - config.AddCommandLine(args); - }) - .UseSerilog() - .UseUrls(config.GetValue("ASPNETCORE_URLS")) - .UseStartup(); - } - } -} diff --git a/backend/api/Properties/launchSettings.json b/backend/api/Properties/launchSettings.json deleted file mode 100644 index fa5f208261..0000000000 --- a/backend/api/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:5000/", - "sslPort": 44342 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": false, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Local" - } - }, - "Pims.Api": { - "commandName": "Project", - "launchBrowser": false, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Local" - }, - "applicationUrl": "https://localhost:5000" - } - } -} diff --git a/backend/api/Startup.cs b/backend/api/Startup.cs deleted file mode 100644 index 4ac2bc6cb6..0000000000 --- a/backend/api/Startup.cs +++ /dev/null @@ -1,358 +0,0 @@ -using HealthChecks.UI.Client; -using Mapster; -using Microsoft.AspNetCore.Authentication; -using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Diagnostics.HealthChecks; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.HttpOverrides; -using Microsoft.AspNetCore.Mvc.ApiExplorer; -using Microsoft.AspNetCore.Mvc.Versioning; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Diagnostics.HealthChecks; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Options; -using Microsoft.IdentityModel.Tokens; -using Microsoft.OpenApi.Models; -using Pims.Api.Helpers.Authorization; -using Pims.Api.Helpers.Mapping; -using Pims.Api.Helpers.Middleware; -using Pims.Api.Helpers.Routes.Constraints; -using Pims.Ches; -using Pims.Core.Converters; -using Pims.Core.Http; -using Pims.Dal; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Keycloak; -using Pims.Geocoder; -using Pims.Ltsa; -using Pims.Notifications; -using Swashbuckle.AspNetCore.SwaggerGen; -using System; -using System.Collections.Generic; -using System.Data.SqlClient; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Security.Claims; -using System.Text; -using System.Text.Json; -using System.Text.Json.Serialization; -using System.Threading.Tasks; -using Pims.Api.Helpers.Logging; -using Prometheus; -using Pims.Api.Helpers.Exceptions; -using System.Diagnostics.CodeAnalysis; - -namespace Pims.Api -{ - /// - /// Startup class, provides a way to startup the .netcore RESTful API and configure it. - /// - [ExcludeFromCodeCoverage] - public class Startup - { - #region Properties - /// - /// get - The application configuration settings. - /// - /// - public IConfiguration Configuration { get; } - - /// - /// get/set - The environment settings for the application. - /// - /// - public IWebHostEnvironment Environment { get; } - #endregion - - #region Constructors - /// - /// Creates a new instances of a Startup class. - /// - /// - /// - public Startup(IConfiguration configuration, IWebHostEnvironment env) - { - this.Configuration = configuration; - this.Environment = env; - } - #endregion - - #region Methods - /// - /// This method gets called by the runtime. Use this method to add services to the container. - /// - /// - public void ConfigureServices(IServiceCollection services) - { - services.AddSerilogging(this.Configuration); - var jsonSerializerOptions = new JsonSerializerOptions() - { - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, - PropertyNameCaseInsensitive = !String.IsNullOrWhiteSpace(this.Configuration["Serialization:Json:PropertyNameCaseInsensitive"]) && Boolean.Parse(this.Configuration["Serialization:Json:PropertyNameCaseInsensitive"]), - PropertyNamingPolicy = this.Configuration["Serialization:Json:PropertyNamingPolicy"] == "CamelCase" ? JsonNamingPolicy.CamelCase : null, - WriteIndented = !string.IsNullOrWhiteSpace(this.Configuration["Serialization:Json:WriteIndented"]) && Boolean.Parse(this.Configuration["Serialization:Json:WriteIndented"]) - }; - services.AddMapster(jsonSerializerOptions, options => - { - options.Default.IgnoreNonMapped(true); - options.Default.IgnoreNullValues(true); - options.AllowImplicitDestinationInheritance = true; - options.AllowImplicitSourceInheritance = true; - options.Default.UseDestinationValue(member => - member.SetterModifier == AccessModifier.None && - member.Type.IsGenericType && - member.Type.GetGenericTypeDefinition() == typeof(ICollection<>)); - }); - services.Configure(options => - { - options.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull; - options.PropertyNameCaseInsensitive = jsonSerializerOptions.PropertyNameCaseInsensitive; - options.PropertyNamingPolicy = jsonSerializerOptions.PropertyNamingPolicy; - options.WriteIndented = jsonSerializerOptions.WriteIndented; - options.Converters.Add(new JsonStringEnumConverter()); - options.Converters.Add(new Int32ToStringJsonConverter()); - }); - services.Configure(this.Configuration.GetSection("Keycloak")); - services.Configure(this.Configuration.GetSection("Keycloak:OpenIdConnect")); - services.Configure(this.Configuration.GetSection("Keycloak")); - services.Configure(this.Configuration.GetSection("Pims")); - services.AddOptions(); - - services.AddControllers() - .AddJsonOptions(options => - { - options.JsonSerializerOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull; - options.JsonSerializerOptions.PropertyNameCaseInsensitive = jsonSerializerOptions.PropertyNameCaseInsensitive; - options.JsonSerializerOptions.PropertyNamingPolicy = jsonSerializerOptions.PropertyNamingPolicy; - options.JsonSerializerOptions.WriteIndented = jsonSerializerOptions.WriteIndented; - options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter()); - options.JsonSerializerOptions.Converters.Add(new Int32ToStringJsonConverter()); - options.JsonSerializerOptions.Converters.Add(new GeometryJsonConverter()); - }); - - services.AddMvcCore() - .AddJsonOptions(options => - { - options.JsonSerializerOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull; - options.JsonSerializerOptions.PropertyNameCaseInsensitive = jsonSerializerOptions.PropertyNameCaseInsensitive; - options.JsonSerializerOptions.PropertyNamingPolicy = jsonSerializerOptions.PropertyNamingPolicy; - options.JsonSerializerOptions.WriteIndented = jsonSerializerOptions.WriteIndented; - options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter()); - options.JsonSerializerOptions.Converters.Add(new Int32ToStringJsonConverter()); - options.JsonSerializerOptions.Converters.Add(new GeometryJsonConverter()); - }); - - services.AddRouting(options => - { - options.ConstraintMap.Add("pid", typeof(PidConstraint)); - }); - - services.AddAuthentication(options => - { - options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; - options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; - }) - .AddJwtBearer(options => - { - var key = Encoding.ASCII.GetBytes(this.Configuration["Keycloak:Secret"]); - options.RequireHttpsMetadata = false; - options.Authority = this.Configuration["Keycloak:Authority"]; - options.Audience = this.Configuration["Keycloak:Audience"]; - options.SaveToken = true; - options.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters() - { - ValidateIssuerSigningKey = true, - ValidateIssuer = false, - ValidateAudience = false - }; - if (key.Length > 0) options.TokenValidationParameters.IssuerSigningKey = new SymmetricSecurityKey(key); - options.Events = new JwtBearerEvents() - { - OnTokenValidated = context => - { - return Task.CompletedTask; - }, - OnAuthenticationFailed = context => - { - context.NoResult(); - context.Response.StatusCode = StatusCodes.Status401Unauthorized; - throw new AuthenticationException("Failed to authenticate", context.Exception); - }, - OnForbidden = context => - { - return Task.CompletedTask; - } - }; - }); - - services.AddAuthorization(options => - { - options.AddPolicy("Administrator", policy => policy.Requirements.Add(new RealmAccessRoleRequirement("administrator"))); - }); - - // Generate the database connection string. - var csBuilder = new SqlConnectionStringBuilder(this.Configuration.GetConnectionString("PIMS")); - var pwd = this.Configuration["DB_PASSWORD"]; - if (!String.IsNullOrEmpty(pwd)) - { - csBuilder.Password = pwd; - } - - services.AddHttpClient(); - services.AddPimsContext(this.Environment, csBuilder.ConnectionString); - services.AddPimsServices(); - services.AddPimsKeycloakService(); - services.AddGeocoderService(this.Configuration.GetSection("Geocoder")); // TODO: Determine if a default value could be used instead. - services.AddChesService(this.Configuration.GetSection("Ches")); - services.AddLtsaService(this.Configuration.GetSection("Ltsa")); - services.AddNotificationsService(this.Configuration.GetSection("Notifications")); - services.AddSingleton(); - services.AddSingleton(this.Configuration); - services.AddTransient(); - services.AddHttpContextAccessor(); - services.AddTransient(s => s.GetService().HttpContext.User); - services.AddScoped(); - services.AddScoped(); - - services.AddHealthChecks() - .AddCheck("liveliness", () => HealthCheckResult.Healthy()) - .AddSqlServer(csBuilder.ConnectionString, tags: new[] { "services" }); - - services.AddApiVersioning(options => - { - options.ReportApiVersions = true; - options.AssumeDefaultVersionWhenUnspecified = true; - options.ApiVersionReader = new HeaderApiVersionReader("api-version"); - // options.DefaultApiVersion = new ApiVersion(1, 0); - }); - services.AddVersionedApiExplorer(options => - { - // add the versioned api explorer, which also adds IApiVersionDescriptionProvider service - // note: the specified format code will format the version as "'v'major[.minor][-status]" - options.GroupNameFormat = "'v'VVV"; - - // note: this option is only necessary when versioning by url segment. the SubstitutionFormat - // can also be used to control the format of the API version in route templates - options.SubstituteApiVersionInUrl = true; - - }); - services.AddTransient, Helpers.Swagger.ConfigureSwaggerOptions>(); - - services.AddSwaggerGen(options => - { - options.EnableAnnotations(false, true); - options.CustomSchemaIds(o => o.FullName); - options.OperationFilter(); - options.DocumentFilter(); - options.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme - { - Name = "Authorization", - In = ParameterLocation.Header, - Description = "Please enter into field the word 'Bearer' following by space and JWT", - Type = SecuritySchemeType.ApiKey - }); - options.AddSecurityRequirement(new OpenApiSecurityRequirement() - { - { - new OpenApiSecurityScheme - { - Reference = new OpenApiReference - { - Type = ReferenceType.SecurityScheme, - Id = "Bearer" - }, - Scheme = "oauth2", - Name = "Bearer", - In = ParameterLocation.Header, - - }, - new List() - } - }); - - var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml"; - var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile); - options.IncludeXmlComments(xmlPath); - }); - - services.Configure(options => - { - options.ForwardedHeaders = ForwardedHeaders.All; - options.AllowedHosts = this.Configuration.GetValue("AllowedHosts")?.Split(';').ToList(); - }); - } - - /// - /// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - /// - /// - /// - /// - public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IApiVersionDescriptionProvider provider) - { - app.UseMetricServer(); - app.UseHttpMetrics(); - - if (!env.IsProduction()) - { - app.UseDeveloperExceptionPage(); - app.UseMigrationsEndPoint(); - } - - app.UpdateDatabase(); - - var baseUrl = this.Configuration.GetValue("BaseUrl"); - app.UsePathBase(baseUrl); - app.UseForwardedHeaders(); - - app.UseSwagger(options => - { - options.RouteTemplate = this.Configuration.GetValue("Swagger:RouteTemplate"); - }); - app.UseSwaggerUI(options => - { - foreach (var description in provider.ApiVersionDescriptions) - { - options.SwaggerEndpoint(String.Format(this.Configuration.GetValue("Swagger:EndpointPath"), description.GroupName), description.GroupName); - } - options.RoutePrefix = this.Configuration.GetValue("Swagger:RoutePrefix"); - }); - - app.UseMiddleware(typeof(ErrorHandlingMiddleware)); - app.UseMiddleware(typeof(ResponseTimeMiddleware)); - - //app.UseHttpsRedirection(); - - app.UseRouting(); - app.UseCors(); - - app.UseMiddleware(typeof(LogRequestMiddleware)); - - app.UseAuthentication(); - app.UseAuthorization(); - - var healthPort = this.Configuration.GetValue("HealthChecks:Port"); - app.UseHealthChecks(this.Configuration.GetValue("HealthChecks:LivePath"), healthPort, new HealthCheckOptions - { - Predicate = r => r.Name.Contains("liveliness"), - ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse - }); - app.UseHealthChecks(this.Configuration.GetValue("HealthChecks:ReadyPath"), healthPort, new HealthCheckOptions - { - Predicate = r => r.Tags.Contains("services"), - ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse - }); - - app.UseEndpoints(config => - { - config.MapControllers(); - }); - } - #endregion - } -} diff --git a/backend/api/appsettings.Development.json b/backend/api/appsettings.Development.json deleted file mode 100644 index afd1047938..0000000000 --- a/backend/api/appsettings.Development.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "Serilog": { - "MinimumLevel": { - "Default": "Debug", - "Override": { - "Microsoft": "Warning", - "System": "Warning", - "Microsoft.Hosting.Lifetime": "Information", - "System.Net.Http.HttpClient": "Error", - "HealthChecks.UI": "Error" - } - } - }, - "ConnectionStrings": { - "PIMS": "Server=database,1433;User ID=admin;Database=pims;Encrypt=False" - }, - "Pims": { - "Environment": { - "Uri": "https://pims-dev.apps.silver.devops.gov.bc.ca", - "Name": "Development" - }, - "Notifications": { - "ThrowExceptions": true - } - }, - "Keycloak": { - "Authority": "https://dev.loginproxy.gov.bc.ca/auth/realms/standard", - "Audience": "pims-backend-4403", - "Secret": "[USE SECRETS]", - "Client": "pims-backend-4403", - "ServiceAccount": { - "Audience": "service-account-team-1256-4368", - "Secret": "[USE SECRETS]", - "Client": "service-account-team-1256-4368" - }, - "Admin": { - "Authority": "https://dev.loginproxy.gov.bc.ca/auth/realms/standard" - } - }, - "Ltsa": { - "AuthUrl": "https://appsuat.ltsa.ca/iam/api/auth/login/integrator", - "HostUri": "https://tduat-x42b.ltsa.ca/titledirect/search/api/", - "IntegratorUsername": "[USE SECRETS]", - "IntegratorPassword": "[USE SECRETS]", - "UserName": "[USE SECRETS]", - "UserPassword": "[USE SECRETS]" - } -} diff --git a/backend/api/appsettings.Local.json b/backend/api/appsettings.Local.json deleted file mode 100644 index 364a73dbfd..0000000000 --- a/backend/api/appsettings.Local.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "Serilog": { - "MinimumLevel": { - "Default": "Debug", - "Override": { - "Microsoft": "Warning", - "System": "Warning", - "Microsoft.Hosting.Lifetime": "Information", - "System.Net.Http.HttpClient": "Error", - "HealthChecks.UI": "Error" - } - } - }, - "ConnectionStrings": { - "PIMS": "Server=database,1433;User ID=admin;Database=pims;Encrypt=False" - }, - "Pims": { - "Environment": { - "Uri": "http://localhost:3000", - "Name": "Development" - }, - "Notifications": { - "ThrowExceptions": true - } - }, - "Keycloak": { - "Authority": "https://dev.loginproxy.gov.bc.ca/auth/realms/standard", - "Audience": "pims-api-sa-4366", - "Secret": "[USE SECRETS]", - "Client": "pims-api-sa-4366", - "ServiceAccount": { - "Audience": "service-account-team-1256-4368", - "Secret": "[USE SECRETS]", - "Client": "service-account-team-1256-4368" - }, - "FrontendClientId": "[USE ENV VAR]", - "Admin": { - "Authority": "https://dev.loginproxy.gov.bc.ca/auth/realms/standard" - } - }, - "Ltsa": { - "AuthUrl": "https://appsuat.ltsa.ca/iam/api/auth/login/integrator", - "HostUri": "https://tduat-x42b.ltsa.ca/titledirect/search/api/", - "IntegratorUsername": "[USE ENV VAR]", - "IntegratorPassword": "[USE ENV VAR]", - "UserName": "[USE ENV VAR]", - "UserPassword": "[USE ENV VAR]" - } -} diff --git a/backend/api/appsettings.Test.json b/backend/api/appsettings.Test.json deleted file mode 100644 index d6ef9599f2..0000000000 --- a/backend/api/appsettings.Test.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "Serilog": { - "MinimumLevel": { - "Default": "Information", - "Override": { - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - } - }, - "ConnectionStrings": { - "PIMS": "Server=pims-db-test,1433;User ID=admin;Database=pims;Encrypt=False" - }, - "Pims": { - "Environment": { - "Uri": "https://pims-test.apps.silver.devops.gov.bc.ca", - "Name": "Testing" - } - }, - "Keycloak": { - "Authority": "https://test.loginproxy.gov.bc.ca/auth/realms/standard", - "Audience": "pims-backend-4403", - "Secret": "[USE SECRETS]", - "Client": "pims-backend-4403", - "ServiceAccount": { - "Audience": "service-account-team-1256-4368", - "Secret": "[USE SECRETS]", - "Client": "service-account-team-1256-4368" - }, - "Admin": { - "Authority": "https://test.loginproxy.gov.bc.ca/auth/realms/standard" - } - }, - "Ltsa": { - "AuthUrl": "https://appsuat.ltsa.ca/iam/api/auth/login/integrator", - "HostUri": "https://tduat-x42b.ltsa.ca/titledirect/search/api/", - "IntegratorUsername": "[USE SECRETS]", - "IntegratorPassword": "[USE SECRETS]", - "UserName": "[USE SECRETS]", - "UserPassword": "[USE SECRETS]" - } -} diff --git a/backend/api/appsettings.json b/backend/api/appsettings.json deleted file mode 100644 index f120b65b80..0000000000 --- a/backend/api/appsettings.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "BaseUrl": "/api", - "HealthChecks": { - "Port": "8080", - "LivePath": "/health/live", - "ReadyPath": "/health/ready" - }, - "Swagger": { - "RoutePrefix": "api-docs", - "RouteTemplate": "/api-docs/swagger/{documentname}/swagger.json", - "EndpointPath": "/api-docs/swagger/{0}/swagger.json" - }, - "https_port": 443, - "Serilog": { - "MinimumLevel": { - "Default": "Information", - "Override": { - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information", - "System.Net.Http.HttpClient": "Error", - "HealthChecks.UI": "Error" - } - } - }, - "AllowedHosts": "*", - "Pims": { - "AccessRequest": { - "NotificationTemplate": "Access Request" - }, - "ServiceAccount": { - "Email": "support@pims.gov.bc.ca" - }, - "Project": { - "DraftFormat": "DRAFT-{0:00000}", - "NumberFormat": "SPP-{0:00000}", - "AssessmentWorkflows": [ - "ASSESS-DISPOSAL", - "ASSESS-EXEMPTION" - ], - "DraftWorkflows": [ - "SUBMIT-DISPOSAL" - ] - }, - "Environment": { - "Uri": "https://pims.gov.bc.ca", - "Title": "Property Inventory Management System", - "Name": "Production" - } - }, - "Keycloak": { - "Authority": "https://loginproxy.gov.bc.ca/auth/realms/standard", - "Audience": "pims-backend-4403", - "Secret": "[USE SECRETS]", - "Client": "pims-backend-4403", - "ServiceAccount": { - "Audience": "service-account-team-1256-4368", - "Secret": "[USE SECRETS]", - "Client": "service-account-team-1256-4368" - }, - "FrontendClientId": "[USE ENV VAR]", - "OpenIdConnect": { - "Login": "/protocol/openid-connect/auth", - "Logout": "/protocol/openid-connect/logout", - "Register": "/protocol/openid-connect/registrations", - "Token": "/protocol/openid-connect/token", - "TokenIntrospect": "/protocol/openid-connect/token/introspect", - "UserInfo": "/protocol/openid-connect/userinfo" - }, - "Admin": { - "Authority": "https://api.loginproxy.gov.bc.ca/api/v1", - "Users": "/users" - }, - "BaseURL": "https://api.loginproxy.gov.bc.ca/api/v1/" - }, - "ConnectionStrings": { - "PIMS": "Server=pims-db-prod,1433;User ID=admin;Database=pims;Encrypt=False" - }, - "Serialization": { - "Json": { - "PropertyNameCaseInsensitive": true, - "PropertyNamingPolicy": "CamelCase", - "IgnoreNullValues": true - } - }, - "Ltsa": { - "AuthUrl": "https://apps.ltsa.ca/iam/api/auth/login/integrator", - "HostUri": "https://td-x42b.ltsa.ca/titledirect/search/api/", - "IntegratorUsername": "[USE SECRETS]", - "IntegratorPassword": "[USE SECRETS]", - "UserName": "[USE SECRETS]", - "UserPassword": "[USE SECRETS]" - } -} diff --git a/backend/api/ches.Development.json b/backend/api/ches.Development.json deleted file mode 100644 index 34d666592c..0000000000 --- a/backend/api/ches.Development.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "Ches": { - "AuthUrl": "https://dev.loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token", - "HostUri": "https://ches-dev.api.gov.bc.ca/api/v1", - "BccUser": true - } -} diff --git a/backend/api/ches.Local.json b/backend/api/ches.Local.json deleted file mode 100644 index 34d666592c..0000000000 --- a/backend/api/ches.Local.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "Ches": { - "AuthUrl": "https://dev.loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token", - "HostUri": "https://ches-dev.api.gov.bc.ca/api/v1", - "BccUser": true - } -} diff --git a/backend/api/ches.Test.json b/backend/api/ches.Test.json deleted file mode 100644 index caf717e7d3..0000000000 --- a/backend/api/ches.Test.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "Ches": { - "AuthUrl": "https://test.loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token", - "HostUri": "https://ches-test.api.gov.bc.ca/api/v1", - "BccUser": true - } -} diff --git a/backend/api/ches.json b/backend/api/ches.json deleted file mode 100644 index d0a4a83732..0000000000 --- a/backend/api/ches.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Ches": { - "AuthUrl": "https://loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token", - "HostUri": "https://ches.api.gov.bc.ca/api/v1", - "From": "Property Inventory Management System ", - "EmailEnabled": true - } -} diff --git a/backend/api/geocoder.Development.json b/backend/api/geocoder.Development.json deleted file mode 100644 index 42d9df2a1f..0000000000 --- a/backend/api/geocoder.Development.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "Geocoder": { - "HostUri": "https://geocoder.api.gov.bc.ca" - } -} diff --git a/backend/api/geocoder.Local.json b/backend/api/geocoder.Local.json deleted file mode 100644 index 42d9df2a1f..0000000000 --- a/backend/api/geocoder.Local.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "Geocoder": { - "HostUri": "https://geocoder.api.gov.bc.ca" - } -} diff --git a/backend/api/geocoder.Test.json b/backend/api/geocoder.Test.json deleted file mode 100644 index 42d9df2a1f..0000000000 --- a/backend/api/geocoder.Test.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "Geocoder": { - "HostUri": "https://geocoder.api.gov.bc.ca" - } -} diff --git a/backend/api/geocoder.json b/backend/api/geocoder.json deleted file mode 100644 index 42d9df2a1f..0000000000 --- a/backend/api/geocoder.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "Geocoder": { - "HostUri": "https://geocoder.api.gov.bc.ca" - } -} diff --git a/backend/api/ltsa.local.json b/backend/api/ltsa.local.json deleted file mode 100644 index 14354ca918..0000000000 --- a/backend/api/ltsa.local.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "Ltsa": { - "AuthUrl": "https://appsuat.ltsa.ca/iam/api/auth/login/integrator", - "HostUri": "https://tduat-x42b.ltsa.ca/titledirect/search/api/" - } -} diff --git a/backend/ches/ChesService.cs b/backend/ches/ChesService.cs deleted file mode 100644 index b1e94275dd..0000000000 --- a/backend/ches/ChesService.cs +++ /dev/null @@ -1,369 +0,0 @@ -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Pims.Ches.Configuration; -using Pims.Ches.Models; -using Pims.Core.Exceptions; -using Pims.Core.Extensions; -using Pims.Core.Http; -using Pims.Core.Http.Models; -using System; -using System.Collections.Generic; -using System.IdentityModel.Tokens.Jwt; -using System.Linq; -using System.Net.Http; -using System.Security.Claims; -using System.Text; -using System.Threading.Tasks; -using System.Web; - -namespace Pims.Ches -{ - /// - /// ChesService class, provides a service for integration with Ches API services. - /// - public class ChesService : IChesService - { - #region Variables - private readonly ClaimsPrincipal _user; - private TokenModel _token = null; - private readonly JwtSecurityTokenHandler _tokenHandler; - private readonly ILogger _logger; - #endregion - - #region Properties - protected IHttpRequestClient Client { get; } - public ChesOptions Options { get; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a ChesService, initializes with specified arguments. - /// - /// - /// - /// - /// - /// - public ChesService(IOptions options, ClaimsPrincipal user, IHttpRequestClient client, JwtSecurityTokenHandler tokenHandler, ILogger logger) - { - this.Options = options.Value; - _user = user; - this.Client = client; - _tokenHandler = tokenHandler; - _logger = logger; - } - #endregion - - #region Methods - /// - /// Generates the full URL including the host. - /// - /// - /// - /// - private string GenerateUrl(string endpoint) - { - return $"{this.Options.HostUri}{endpoint}"; - } - - /// - /// Ensure we have an active access token. - /// Make an HTTP request if one is needed. - /// - /// - private async Task RefreshAccessTokenAsync() - { - // Check if token has expired. If it has refresh it. - if (_token == null || String.IsNullOrWhiteSpace(_token.AccessToken) || _tokenHandler.ReadJwtToken(_token.AccessToken).ValidTo <= DateTime.UtcNow) - { - _token = await GetTokenAsync(); - } - } - - /// - /// Send a request to the specified endpoint. - /// - /// - /// - /// - /// - private async Task SendAsync(string endpoint, HttpMethod method) - { - await RefreshAccessTokenAsync(); - - var url = GenerateUrl(endpoint); - - var headers = new HttpRequestMessage().Headers; - headers.Add("Authorization", $"Bearer {_token.AccessToken}"); - - try - { - var response = await this.Client.SendAsync(url, method, headers); - return await response.Content.ReadAsStringAsync(); - } - catch (HttpClientRequestException ex) - { - _logger.LogError(ex, $"Failed to send/receive request: {ex.StatusCode} {url}"); - var response = await this.Client?.DeserializeAsync(ex.Response); - throw new ChesException(ex, this.Client, response); - } - } - - /// - /// Send a request to the specified endpoint. - /// - /// - /// - /// - /// - private async Task SendAsync(string endpoint, HttpMethod method) - { - await RefreshAccessTokenAsync(); - - var url = GenerateUrl(endpoint); - - var headers = new HttpRequestMessage().Headers; - headers.Add("Authorization", $"Bearer {_token.AccessToken}"); - - try - { - return await this.Client.SendAsync(url, method, headers); - } - catch (HttpClientRequestException ex) - { - _logger.LogError(ex, $"Failed to send/receive request: {ex.StatusCode} {url}"); - var response = await this.Client?.DeserializeAsync(ex.Response); - throw new ChesException(ex, this.Client, response); - } - } - - /// - /// Send a request to the specified endpoint. - /// Make a request to get an access token if required. - /// - /// - /// - /// - /// - /// - /// - private async Task SendAsync(string endpoint, HttpMethod method, TD data) - where TD : class - { - await RefreshAccessTokenAsync(); - - var url = GenerateUrl(endpoint); - - var headers = new HttpRequestMessage().Headers; - headers.Add("Authorization", $"Bearer {_token.AccessToken}"); - - try - { - return await this.Client.SendJsonAsync(url, method, headers, data); - } - catch (HttpClientRequestException ex) - { - _logger.LogError(ex, $"Failed to send/receive request: {ex.StatusCode} {url}"); - var response = await this.Client?.DeserializeAsync(ex.Response); - throw new ChesException(ex, this.Client, response); - } - } - - /// - /// Make an HTTP request to CHES to get an access token for the specified 'username' and 'password'. - /// - /// - /// - /// - public async Task GetTokenAsync(string username = null, string password = null) - { - var headers = new HttpRequestMessage().Headers; - var creds = Convert.ToBase64String(ASCIIEncoding.ASCII.GetBytes($"{username ?? this.Options.Username}:{password ?? this.Options.Password}")); - headers.Add("Authorization", $"Basic {creds}"); - headers.Add("ContentType", "application/x-www-form-urlencoded"); - - var form = new List> - { - new KeyValuePair("grant_type", "client_credentials") - }; - var content = new FormUrlEncodedContent(form); - - try - { - return await this.Client.SendAsync(this.Options.AuthUrl, HttpMethod.Post, headers, content); - } - catch (HttpClientRequestException ex) - { - _logger.LogError(ex, $"Failed to send/receive request: {ex.StatusCode} {this.Options.AuthUrl}"); - var response = await this.Client?.DeserializeAsync(ex.Response); - throw new ChesException(ex, this.Client, response); - } - } - - /// - /// Send an HTTP request to CHES to send the specified 'email'. - /// - /// - /// - public async Task SendEmailAsync(IEmail email) - { - if (email == null) throw new ArgumentNullException(nameof(email)); - - email.From = this.Options.From ?? email.From; - - if (this.Options.BccUser) - { - email.Bcc = new[] { _user.GetEmail() }.Concat(email.Bcc?.Any() ?? false ? email.Bcc : Array.Empty()); - } - if (!String.IsNullOrWhiteSpace(this.Options.AlwaysBcc)) - { - email.Bcc = this.Options.AlwaysBcc.Split(";").Select(e => e?.Trim()).Concat(email.Bcc?.Any() ?? false ? email.Bcc : Array.Empty()); - } - if (!String.IsNullOrWhiteSpace(this.Options.OverrideTo) || !this.Options.EmailAuthorized) - { - email.To = !String.IsNullOrWhiteSpace(this.Options.OverrideTo) ? this.Options.OverrideTo?.Split(";").Select(e => e?.Trim()) : new[] { _user.GetEmail() }; - email.Cc = email.Cc.Any() ? new[] { _user.GetEmail() } : Array.Empty(); - email.Bcc = Array.Empty(); - } - if (this.Options.AlwaysDelay.HasValue) - { - email.SendOn = email.SendOn.AddSeconds(this.Options.AlwaysDelay.Value); - } - - // Make sure there are no blank CC or BCC; - email.To = email.To.NotNullOrWhiteSpace(); - email.Cc = email.Cc?.NotNullOrWhiteSpace(); - email.Bcc = email.Bcc?.NotNullOrWhiteSpace(); - - if (this.Options.EmailEnabled) - return await SendAsync("/email", HttpMethod.Post, email); - - return new EmailResponseModel(); - } - - /// - /// Send an HTTP request to CHES to send the specified 'email'. - /// - /// - /// - public async Task SendEmailAsync(IEmailMerge email) - { - if (email == null) throw new ArgumentNullException(nameof(email)); - - email.From = this.Options.From ?? email.From; - - if (this.Options.BccUser) - { - var address = new[] { _user.GetEmail() }; - email.Contexts.ForEach(c => - { - c.Bcc = address.Concat(c.Bcc?.Any() ?? false ? c.Bcc : Array.Empty()); - }); - } - if (!String.IsNullOrWhiteSpace(this.Options.AlwaysBcc)) - { - email.Contexts.ForEach(c => - { - c.Bcc = this.Options.AlwaysBcc.Split(";").Select(e => e?.Trim()).Concat(c.Bcc?.Any() ?? false ? c.Bcc : Array.Empty()); - }); - } - if (!String.IsNullOrWhiteSpace(this.Options.OverrideTo) || !this.Options.EmailAuthorized) - { - var address = !String.IsNullOrWhiteSpace(this.Options.OverrideTo) ? this.Options.OverrideTo?.Split(";").Select(e => e?.Trim()) : new[] { _user.GetEmail() }; - email.Contexts.ForEach(c => - { - c.To = address; - c.Cc = Array.Empty(); - c.Bcc = Array.Empty(); - }); - } - if (this.Options.AlwaysDelay.HasValue) - { - email.Contexts.ForEach(c => - c.SendOn = c.SendOn.AddSeconds(this.Options.AlwaysDelay.Value)); - } - - // Make sure there are no blank CC or BCC; - email.Contexts.ForEach(c => - { - c.To = c.To.NotNullOrWhiteSpace(); - c.Cc = c.Cc.NotNullOrWhiteSpace(); - c.Bcc = c.Bcc.NotNullOrWhiteSpace(); - }); - - if (this.Options.EmailEnabled) - return await SendAsync("/emailMerge", HttpMethod.Post, email); - - return new EmailResponseModel(); - } - - /// - /// Send an HTTP request to get the current status of the message for the specified 'messageId'. - /// - /// - /// - public async Task GetStatusAsync(Guid messageId) - { - return await SendAsync($"/status/{messageId}", HttpMethod.Get); - } - - /// - /// Send an HTTP request to get the current status of the message(s) for the specified 'filter'. - /// - /// - /// - public async Task> GetStatusAsync(StatusModel filter) - { - if (filter == null) throw new ArgumentNullException(nameof(filter)); - if (!filter.MessageId.HasValue && !filter.TransactionId.HasValue && String.IsNullOrWhiteSpace(filter.Status) && String.IsNullOrWhiteSpace(filter.Tag)) throw new ArgumentException("At least one parameter must be specified."); - - var query = HttpUtility.ParseQueryString(String.Empty); - if (filter.MessageId.HasValue) query.Add("msgId", $"{filter.MessageId}"); - if (!String.IsNullOrEmpty(filter.Status)) query.Add("status", $"{filter.Status}"); - if (!String.IsNullOrEmpty(filter.Tag)) query.Add("tag", $"{filter.Tag}"); - if (filter.TransactionId.HasValue) query.Add("txId", $"{filter.TransactionId}"); - - return await SendAsync>($"/status?{query}", HttpMethod.Get); - } - - /// - /// Send a cancel HTTP request to CHES for the specified 'messageId'. - /// - /// - /// - public async Task CancelEmailAsync(Guid messageId) - { - // Need to determine if we can cancel the email. - var response = await GetStatusAsync(messageId); - if (response.Status == "accepted" || response.Status == "pending") - { - await SendAsync($"/cancel/{messageId}", HttpMethod.Delete); - response.Status = "cancelled"; - } - return response; - } - - /// - /// Send a cancel HTTP request to CHES for the specified 'filter'. - /// - /// - /// - public async Task> CancelEmailAsync(StatusModel filter) - { - if (filter == null) throw new ArgumentNullException(nameof(filter)); - if (!filter.MessageId.HasValue && !filter.TransactionId.HasValue && String.IsNullOrWhiteSpace(filter.Status) && String.IsNullOrWhiteSpace(filter.Tag)) throw new ArgumentException("At least one parameter must be specified."); - - var query = HttpUtility.ParseQueryString(String.Empty); - if (filter.MessageId.HasValue) query.Add("msgId", $"{filter.MessageId}"); - if (!String.IsNullOrEmpty(filter.Status)) query.Add("status", $"{filter.Status}"); - if (!String.IsNullOrEmpty(filter.Tag)) query.Add("tag", $"{filter.Tag}"); - if (filter.TransactionId.HasValue) query.Add("txId", $"{filter.TransactionId}"); - - // TODO: This will probably not work as CHES currently doesn't like if you attempt to cancel a message that can't be cancelled. - // Additionally CHES fails (times-out) if you make a request for the status of a cancelled message. - await SendAsync($"/cancel?{query}", HttpMethod.Delete); - return await GetStatusAsync(filter); - } - #endregion - } -} diff --git a/backend/ches/Configuration/ChesOptions.cs b/backend/ches/Configuration/ChesOptions.cs deleted file mode 100644 index 10861b87ca..0000000000 --- a/backend/ches/Configuration/ChesOptions.cs +++ /dev/null @@ -1,66 +0,0 @@ -namespace Pims.Ches.Configuration -{ - /// - /// ChesOptions class, provides a way to configure the Ches. - /// - public class ChesOptions - { - #region Properties - /// - /// get/set - The authentication URL. - /// - public string AuthUrl { get; set; } - - /// - /// get/set - The URI to the Ches API service. - /// - public string HostUri { get; set; } - - /// - /// get/set - The email address that all emails will be 'from'. - /// - public string From { get; set; } - - /// - /// get/set - The API username. - /// - public string Username { get; set; } - - /// - /// get/set - The API user password. - /// - public string Password { get; set; } - - /// - /// get/set - Whether to send email to CHES. - /// - public bool EmailEnabled { get; set; } - - /// - /// get/set - When not authorized, email will only be sent to the current user. - /// - public bool EmailAuthorized { get; set; } - - /// - /// get/set - Send all emails to this email address instead of their original recipients. - /// - public string OverrideTo { get; set; } - - /// - /// get/set - Send emails to the currently user as Bcc. - /// - public bool BccUser { get; set; } - - /// - /// get/set - Always BCC the specified email address. - /// - public string AlwaysBcc { get; set; } - - /// - /// get/set - Number of seconds to delay sending notifications from their configured 'send on' date and time. - /// - /// - public int? AlwaysDelay { get; set; } - #endregion - } -} diff --git a/backend/ches/Exceptions/ChesException.cs b/backend/ches/Exceptions/ChesException.cs deleted file mode 100644 index b145e43ece..0000000000 --- a/backend/ches/Exceptions/ChesException.cs +++ /dev/null @@ -1,81 +0,0 @@ -using Pims.Ches.Models; -using Pims.Core.Http; -using System; -using System.Linq; -using System.Net; -using System.Net.Http; - -namespace Pims.Core.Exceptions -{ - /// - /// ChesException class, provides a way to express HTTP request exceptions that occur. - /// - public class ChesException : HttpClientRequestException - { - #region Properties - /// - /// get - Additional detail on the error. - /// - public string Detail { get; } - - /// - /// get - The HTTP request client the exception originated from. - /// - public IHttpRequestClient Client { get; } - #endregion - - #region Constructors - /// - /// Creates a new instance of an ChesException class, initializes it with the specified arguments. - /// - /// - /// - /// - public ChesException(HttpClientRequestException exception, IHttpRequestClient client, ErrorResponseModel model) - : this($"{exception.Message}{Environment.NewLine}", exception, exception?.StatusCode ?? HttpStatusCode.InternalServerError) - { - this.Client = client; - this.Detail = $"{model.Title}{Environment.NewLine}{model.Detail}{Environment.NewLine}{model.Type}{Environment.NewLine}{String.Join(Environment.NewLine, model.Errors.Select(e => $"\t{e.Message}"))}"; - } - - /// - /// Creates a new instance of an ChesException class, initializes it with the specified arguments. - /// - /// - /// - /// - public ChesException(string message, HttpStatusCode statusCode = HttpStatusCode.InternalServerError) : base(message, statusCode) - { - } - - /// - /// Creates a new instance of an ChesException class, initializes it with the specified arguments. - /// - /// - /// - /// - /// - public ChesException(string message, Exception innerException, HttpStatusCode statusCode = HttpStatusCode.InternalServerError) : base(message, innerException, statusCode) - { - } - - /// - /// Creates a new instance of an ChesException class, initializes it with the specified arguments. - /// - /// - /// - public ChesException(HttpResponseMessage response) : base(response) - { - } - - /// - /// Creates a new instance of an ChesException class, initializes it with the specified arguments. - /// - /// - /// - public ChesException(HttpResponseMessage response, Exception innerException) : base(response, innerException) - { - } - #endregion - } -} diff --git a/backend/ches/Extensions/ServiceCollectionExtensions.cs b/backend/ches/Extensions/ServiceCollectionExtensions.cs deleted file mode 100644 index b2b252d6a2..0000000000 --- a/backend/ches/Extensions/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Pims.Core.Http; -using System.IdentityModel.Tokens.Jwt; - -namespace Pims.Ches -{ - /// - /// ServiceCollectionExtensions static class, provides extension methods for ServiceCollection objects. - /// - public static class ServiceCollectionExtensions - { - /// - /// Add the AddChesService to the dependency injection service collection. - /// - /// - /// - /// - public static IServiceCollection AddChesService(this IServiceCollection services, IConfigurationSection section) - { - return services - .Configure(section) - .AddScoped() - .AddScoped() - .AddTransient(); - } - } -} diff --git a/backend/ches/IChesService.cs b/backend/ches/IChesService.cs deleted file mode 100644 index 481f3dd6f5..0000000000 --- a/backend/ches/IChesService.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Pims.Ches.Models; -using Pims.Core.Http.Models; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Pims.Ches -{ - public interface IChesService - { - Task GetTokenAsync(string username = null, string password = null); - Task SendEmailAsync(IEmail email); - Task SendEmailAsync(IEmailMerge email); - Task GetStatusAsync(Guid messageId); - Task> GetStatusAsync(StatusModel filter); - Task CancelEmailAsync(Guid messageId); - Task> CancelEmailAsync(StatusModel filter); - } -} diff --git a/backend/ches/Models/AttachmentModel.cs b/backend/ches/Models/AttachmentModel.cs deleted file mode 100644 index 0c93557e79..0000000000 --- a/backend/ches/Models/AttachmentModel.cs +++ /dev/null @@ -1,30 +0,0 @@ -namespace Pims.Ches.Models -{ - /// - /// AttachmentModel class, provides a model that represents an attachment to an email. - /// - public class AttachmentModel : IAttachment - { - #region Properties - /// - /// get/set - The content of the attachment. - /// - public string Content { get; set; } - - /// - /// get/set - The content type. - /// - public string ContentType { get; set; } - - /// - /// get/set - The encoding of the attachment. - /// - public string Encoding { get; set; } - - /// - /// get/set - The file name of the attachment. - /// - public string Filename { get; set; } - #endregion - } -} diff --git a/backend/ches/Models/EmailBodyTypes.cs b/backend/ches/Models/EmailBodyTypes.cs deleted file mode 100644 index f21ec17c99..0000000000 --- a/backend/ches/Models/EmailBodyTypes.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Pims.Core.Json; - -namespace Pims.Ches.Models -{ - /// - /// EmailBodyTypes enum, provides email body type options. - /// - public enum EmailBodyTypes - { - [EnumValue("html")] - Html = 0, - [EnumValue("text")] - Text = 1 - } -} diff --git a/backend/ches/Models/EmailContextModel.cs b/backend/ches/Models/EmailContextModel.cs deleted file mode 100644 index 547b914c47..0000000000 --- a/backend/ches/Models/EmailContextModel.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Ches.Models -{ - /// - /// EmailContextModel class, provides a way to generate multiple emails from the same template. - /// - public class EmailContextModel : IEmailContext - { - #region Properties - /// - /// get/set - An array of email addresses the email will be sent to. - /// - public IEnumerable To { get; set; } = new List(); - - /// - /// get/set - An array of email addresses that the email will be carbon-copied. - /// - public IEnumerable Cc { get; set; } = new List(); - - /// - /// get/set - An array of email addresses that the email will be blind carbon-copied. - /// - public IEnumerable Bcc { get; set; } = new List(); - - /// - /// get/set - A structure that provides the template variables values. - /// - public object Context { get; set; } - - /// - /// get/set - When the email will be sent. - /// - public DateTime SendOn { get; set; } - - /// - /// get/set - A way to identify related emails. - /// - public string Tag { get; set; } - #endregion - } -} diff --git a/backend/ches/Models/EmailEncodings.cs b/backend/ches/Models/EmailEncodings.cs deleted file mode 100644 index 8552eadb8c..0000000000 --- a/backend/ches/Models/EmailEncodings.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Pims.Core.Json; - -namespace Pims.Ches.Models -{ - /// - /// EmailEncodings enum, provides notification encoding options. - /// - public enum EmailEncodings - { - [EnumValue("utf-8")] - Utf8 = 0, - [EnumValue("base64")] - Base64 = 1, - [EnumValue("binary")] - Binary = 2, - [EnumValue("hex")] - Hex = 3 - } -} diff --git a/backend/ches/Models/EmailMergeModel.cs b/backend/ches/Models/EmailMergeModel.cs deleted file mode 100644 index 71db17a599..0000000000 --- a/backend/ches/Models/EmailMergeModel.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.Collections.Generic; - -namespace Pims.Ches.Models -{ - /// - /// EmailMergeModel class, provides a way to generate multiple emails with a single template. - /// - public class EmailMergeModel : IEmailMerge - { - #region Properties - /// - /// get/set - Who the emails will be from (i.e. First Last ). - /// - public string From { get; set; } - - /// - /// get/set - The email encoding. - /// - public EmailEncodings Encoding { get; set; } = EmailEncodings.Utf8; - - /// - /// get/set - The email priority. - /// - public EmailPriorities Priority { get; set; } = EmailPriorities.Normal; - - /// - /// get/set - The email body type. - /// - public EmailBodyTypes BodyType { get; set; } = EmailBodyTypes.Html; - - /// - /// get/set - The email subject (template). - /// - public string Subject { get; set; } - - /// - /// get/set - The email body (template). - /// - public string Body { get; set; } - - /// - /// get/set - A way to identify related emails. - /// - public string Tag { get; set; } - - /// - /// get/set - The context provides the template variables for each individual email. - /// - public IEnumerable Contexts { get; set; } = new List(); - - /// - /// get/set - Attachments to include with the email. - /// - public IEnumerable Attachments { get; set; } = new List(); - #endregion - } -} diff --git a/backend/ches/Models/EmailModel.cs b/backend/ches/Models/EmailModel.cs deleted file mode 100644 index 207c0e7953..0000000000 --- a/backend/ches/Models/EmailModel.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Ches.Models -{ - /// - /// EmailModel class, provides a model that represents and controls an email that will be sent. - /// - public class EmailModel : IEmail - { - #region Properties - /// - /// get/set - The email address that the message will be sent from. - /// - public string From { get; set; } - - /// - /// get/set - An array of email addresses to send the message to. - /// - public IEnumerable To { get; set; } = new List(); - - /// - /// get/set - An array of email addresses to send the message to. - /// - public IEnumerable Bcc { get; set; } = new List(); - - /// - /// get/set - An array of email addresses to send the message to. - /// - public IEnumerable Cc { get; set; } = new List(); - - /// - /// get/set - The email encoding. - /// - public EmailEncodings Encoding { get; set; } = EmailEncodings.Utf8; - - /// - /// get/set - The email priority. - /// - public EmailPriorities Priority { get; set; } = EmailPriorities.Normal; - - /// - /// get/set - The email subject. - /// - public string Subject { get; set; } - - /// - /// get/set - The email body type. - /// - public EmailBodyTypes BodyType { get; set; } = EmailBodyTypes.Html; - - /// - /// get/set - The email body. - /// - public string Body { get; set; } - - /// - /// get/set - A tag to identify related messages. - /// - public string Tag { get; set; } - - /// - /// get/set - When the message will be sent. - /// - public DateTime SendOn { get; set; } - - /// - /// get/set - An array of attachments. - /// - public IEnumerable Attachments { get; set; } = new List(); - #endregion - } -} diff --git a/backend/ches/Models/EmailPriorities.cs b/backend/ches/Models/EmailPriorities.cs deleted file mode 100644 index 579aa549bd..0000000000 --- a/backend/ches/Models/EmailPriorities.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Pims.Core.Json; - -namespace Pims.Ches.Models -{ - /// - /// EmailPriorities enum, provides email priority options. - /// - public enum EmailPriorities - { - [EnumValue("low")] - Low = 0, - [EnumValue("normal")] - Normal = 1, - [EnumValue("high")] - High = 2 - } -} diff --git a/backend/ches/Models/EmailResponseModel.cs b/backend/ches/Models/EmailResponseModel.cs deleted file mode 100644 index fe1f00a6b8..0000000000 --- a/backend/ches/Models/EmailResponseModel.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text.Json.Serialization; - -namespace Pims.Ches.Models -{ - /// - /// EmailResponseModel class, provides a model that represents the response when an email has been sent to CHES. - /// - public class EmailResponseModel - { - #region Properties - /// - /// get/set - The transaction ID to identify a group of messages. - /// - [JsonPropertyName("txId")] - public Guid TransactionId { get; set; } - - /// - /// get/set - An array of messages that were sent. - /// - public IEnumerable Messages { get; set; } = new List(); - public bool Message { get; set; } - #endregion - } -} diff --git a/backend/ches/Models/ErrorModel.cs b/backend/ches/Models/ErrorModel.cs deleted file mode 100644 index 724741b1e7..0000000000 --- a/backend/ches/Models/ErrorModel.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace Pims.Ches.Models -{ - /// - /// ErrorModel class, provides a model that represents an error detail. - /// - public class ErrorModel - { - #region Properties - /// - /// get/set - The error message. - /// - public string Message { get; set; } - - /// - /// get/set - The error object value. - /// - public object Value { get; set; } - #endregion - } -} diff --git a/backend/ches/Models/ErrorResponseModel.cs b/backend/ches/Models/ErrorResponseModel.cs deleted file mode 100644 index f3a55e6dac..0000000000 --- a/backend/ches/Models/ErrorResponseModel.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Collections.Generic; - -namespace Pims.Ches.Models -{ - /// - /// ErrorResponseModel class, provides a model that represents an error returned from CHES. - /// - public class ErrorResponseModel - { - #region Properties - /// - /// get/set - The error type. - /// - public string Type { get; set; } - - /// - /// get/set - The error title. - /// - public string Title { get; set; } - - /// - /// get/set - The error status. - /// - public string Status { get; set; } - - /// - /// get/set - The error details. - /// - public string Detail { get; set; } - - /// - /// get/set - An array of error messages. - /// - public IEnumerable Errors { get; set; } = new List(); - #endregion - } -} diff --git a/backend/ches/Models/IAttachment.cs b/backend/ches/Models/IAttachment.cs deleted file mode 100644 index 13396490c5..0000000000 --- a/backend/ches/Models/IAttachment.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Pims.Ches.Models -{ - public interface IAttachment - { - string Content { get; set; } - string ContentType { get; set; } - string Encoding { get; set; } - string Filename { get; set; } - } -} \ No newline at end of file diff --git a/backend/ches/Models/IEmail.cs b/backend/ches/Models/IEmail.cs deleted file mode 100644 index 1540d62941..0000000000 --- a/backend/ches/Models/IEmail.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Pims.Core.Converters; -using System; -using System.Collections.Generic; -using System.Text.Json.Serialization; - -namespace Pims.Ches.Models -{ - public interface IEmail - { - string From { get; set; } - IEnumerable To { get; set; } - IEnumerable Cc { get; set; } - IEnumerable Bcc { get; set; } - - [JsonConverter(typeof(EnumValueJsonConverter))] - EmailBodyTypes BodyType { get; set; } - - [JsonConverter(typeof(EnumValueJsonConverter))] - EmailEncodings Encoding { get; set; } - - [JsonConverter(typeof(EnumValueJsonConverter))] - EmailPriorities Priority { get; set; } - string Subject { get; set; } - string Body { get; set; } - string Tag { get; set; } - - [JsonConverter(typeof(MicrosecondEpochJsonConverter))] - [JsonPropertyName("delayTS")] - DateTime SendOn { get; set; } - - IEnumerable Attachments { get; set; } - } -} diff --git a/backend/ches/Models/IEmailContext.cs b/backend/ches/Models/IEmailContext.cs deleted file mode 100644 index 6bf2b4ca12..0000000000 --- a/backend/ches/Models/IEmailContext.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Pims.Core.Converters; -using System; -using System.Collections.Generic; -using System.Text.Json.Serialization; - -namespace Pims.Ches.Models -{ - public interface IEmailContext - { - IEnumerable Bcc { get; set; } - IEnumerable Cc { get; set; } - object Context { get; set; } - - [JsonConverter(typeof(MicrosecondEpochJsonConverter))] - [JsonPropertyName("delayTS")] - DateTime SendOn { get; set; } - - string Tag { get; set; } - IEnumerable To { get; set; } - } -} diff --git a/backend/ches/Models/IEmailMerge.cs b/backend/ches/Models/IEmailMerge.cs deleted file mode 100644 index cdbaa11c30..0000000000 --- a/backend/ches/Models/IEmailMerge.cs +++ /dev/null @@ -1,60 +0,0 @@ -using Pims.Core.Converters; -using System.Collections.Generic; -using System.Text.Json.Serialization; - -namespace Pims.Ches.Models -{ - /// - /// IEmailMerge interface, provides a structure to manage generating multiple emails with a single template. - /// - public interface IEmailMerge - { - /// - /// get/set - Who the email are from (i.e. First Last ). - /// - string From { get; set; } - - /// - /// get/set - The email encoding. - /// - [JsonConverter(typeof(EnumValueJsonConverter))] - EmailEncodings Encoding { get; set; } - - /// - /// get/set - The email priority. - /// - [JsonConverter(typeof(EnumValueJsonConverter))] - EmailPriorities Priority { get; set; } - - /// - /// get/set - The email body type. - /// - [JsonConverter(typeof(EnumValueJsonConverter))] - EmailBodyTypes BodyType { get; set; } - - /// - /// get/set - The email subject (template). - /// - string Subject { get; set; } - - /// - /// get/set - The email body (template). - /// - string Body { get; set; } - - /// - /// get/set - A way to identify related email. - /// - string Tag { get; set; } - - /// - /// get/set - An array of template variables. - /// - IEnumerable Contexts { get; set; } - - /// - /// get/set - An array of attachments. - /// - IEnumerable Attachments { get; set; } - } -} diff --git a/backend/ches/Models/MessageResponseModel.cs b/backend/ches/Models/MessageResponseModel.cs deleted file mode 100644 index 192bf921c3..0000000000 --- a/backend/ches/Models/MessageResponseModel.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text.Json.Serialization; - -namespace Pims.Ches.Models -{ - /// - /// MessageResponseModel class, provides a model that represents the response when a message was added to the CHES queue. - /// - public class MessageResponseModel - { - #region Properties - /// - /// get/set - The message ID that uniquely identifies it. - /// - [JsonPropertyName("msgId")] - public Guid MessageId { get; set; } - - /// - /// get/set - The tag that provides a way to identify related messages. - /// - public string Tag { get; set; } - - /// - /// get/set - An array of email addresses that the message was sent to. - /// - public IEnumerable To { get; set; } = new List(); - #endregion - } -} diff --git a/backend/ches/Models/StatusHistoryResponseModel.cs b/backend/ches/Models/StatusHistoryResponseModel.cs deleted file mode 100644 index 1b33766d74..0000000000 --- a/backend/ches/Models/StatusHistoryResponseModel.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Pims.Core.Converters; -using System; -using System.Text.Json.Serialization; - -namespace Pims.Ches.Models -{ - /// - /// StatusHistoryResponseModel class, provides a model that represents the status history of a message. - /// - public class StatusHistoryResponseModel - { - #region Properties - /// - /// get/set - A description of the status. - /// - public string Description { get; set; } - - /// - /// get/set - The status. - /// - public string Status { get; set; } - - /// - /// get/set - When the status was set. - /// - [JsonConverter(typeof(MicrosecondEpochJsonConverter))] - public DateTime Timestamp { get; set; } - #endregion - } -} diff --git a/backend/ches/Models/StatusModel.cs b/backend/ches/Models/StatusModel.cs deleted file mode 100644 index 7f02b5b087..0000000000 --- a/backend/ches/Models/StatusModel.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Text.Json.Serialization; - -namespace Pims.Ches.Models -{ - public class StatusModel - { - #region Properties - /// - /// get/set - The transaction Id to identify a group of messages. - /// - [JsonPropertyName("txId")] - public Guid? TransactionId { get; set; } - - /// - /// get/set - The transaction Id to identify a group of messages. - /// - [JsonPropertyName("msgId")] - public Guid? MessageId { get; set; } - - /// - /// get/set - The status of the message. - /// - public string Status { get; set; } - - /// - /// get/set - A tag to identify a related message. - /// - public string Tag { get; set; } - #endregion - } -} diff --git a/backend/ches/Models/StatusResponseModel.cs b/backend/ches/Models/StatusResponseModel.cs deleted file mode 100644 index 41f0463b0c..0000000000 --- a/backend/ches/Models/StatusResponseModel.cs +++ /dev/null @@ -1,63 +0,0 @@ -using Pims.Core.Converters; -using System; -using System.Collections.Generic; -using System.Text.Json.Serialization; - -namespace Pims.Ches.Models -{ - /// - /// StatusResponseModel class, provides a model that represents the status response. - /// - public class StatusResponseModel - { - #region Properties - /// - /// get/set - The transaction Id to identify a group of messages. - /// - [JsonPropertyName("txId")] - public Guid TransactionId { get; set; } - - /// - /// get/set - The transaction Id to identify a group of messages. - /// - [JsonPropertyName("msgId")] - public Guid MessageId { get; set; } - - /// - /// get/set - When the message was created. - /// - [JsonConverter(typeof(MicrosecondEpochJsonConverter))] - [JsonPropertyName("createdTS")] - public DateTime CreatedOn { get; set; } - - /// - /// get/set - When the message has been schedule to be sent. - /// - [JsonConverter(typeof(MicrosecondEpochJsonConverter))] - [JsonPropertyName("delayTS")] - public DateTime SendOn { get; set; } - - /// - /// get/set - When the message was last updated. - /// - [JsonConverter(typeof(MicrosecondEpochJsonConverter))] - [JsonPropertyName("updatedTS")] - public DateTime UpdatedOn { get; set; } - - /// - /// get/set - The current status of the message. - /// - public string Status { get; set; } - - /// - /// get/set - A tag to identify related messages. - /// - public string Tag { get; set; } - - /// - /// get/set - An array of status history of the message. - /// - public IEnumerable StatusHistory { get; set; } = new List(); - #endregion - } -} diff --git a/backend/ches/Pims.Ches.csproj b/backend/ches/Pims.Ches.csproj deleted file mode 100644 index 8e439c2b6b..0000000000 --- a/backend/ches/Pims.Ches.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - net7.0 - Library - 1.0.0.0 - 1.0.0.0 - 08A82D74-0854-498F-9C74-E0A7242FE430 - - - - - - - - - - - - - - - - diff --git a/backend/core/Comparers/DeepPropertyCompare.cs b/backend/core/Comparers/DeepPropertyCompare.cs deleted file mode 100644 index 1f43d61872..0000000000 --- a/backend/core/Comparers/DeepPropertyCompare.cs +++ /dev/null @@ -1,117 +0,0 @@ -using Pims.Core.Extensions; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Reflection; - -namespace Pims.Core.Comparers -{ - /// - /// DeepPropertyCompare class, provides a simple way to deep compare two objects of the same type. - /// - public class DeepPropertyCompare : IEqualityComparer - { - #region Methods - /// - /// Determines if the objects public properties are equal. - /// - /// - /// - /// - public new bool Equals([AllowNull] object x, [AllowNull] object y) - { - // Only root objects cannot be null. Child objects that are null will be equal. - if (x == null || y == null || GetHashCode(x) != GetHashCode(y) || x.GetType() != y.GetType()) return false; - if (x == y) return true; - - var type = x.GetType(); - var children = type.GetCachedProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.GetProperty).Where(p => !p.PropertyType.IsValueType && p.PropertyType != typeof(string) && !p.PropertyType.IsEnumerable()); - foreach (var p in children.Where(p => !p.GetIndexParameters().Any())) - { - var cx = p.GetValue(x); - var cy = p.GetValue(y); - if ((cx == null && cy != null) || (cx != null && cy == null)) return false; - if (cx == null && cy == null) return true; // Both are null, therefore equal. - - var sct = typeof(DeepPropertyCompare<>); - var scgt = sct.MakeGenericType(p.PropertyType); - var csc = Activator.CreateInstance(scgt); - var method = scgt.GetMethod(nameof(Equals), BindingFlags.Public | BindingFlags.Instance, null, new[] { p.PropertyType, p.PropertyType }, null) - ?? scgt.GetMethod(nameof(Equals), BindingFlags.Public | BindingFlags.Instance, null, new[] { typeof(object), typeof(object) }, null); - - if (!(bool)method.Invoke(csc, new[] { cx, cy })) return false; - } - - var collections = type.GetCachedProperties().Where(p => p.PropertyType != typeof(string) && p.PropertyType.IsEnumerable()); - foreach (var p in collections) - { - var cx = p.GetValue(x); - var cy = p.GetValue(y); - - // Have to manually force them into lists... I hate this way. - var lcx = new ArrayList(); - foreach (var item in (IEnumerable)cx) - { - lcx.Add(item); - } - - var lcy = new ArrayList(); - foreach (var item in (IEnumerable)cy) - { - lcy.Add(item); - } - - if (lcx.Count != lcy.Count) return false; - - for (var i = 0; i < lcx.Count; i++) - { - var cxitem = lcx[i]; - var cyitem = lcy[i]; - - if ((cxitem == null && cyitem != null) || (cxitem != null && cyitem == null)) return false; - if (cxitem == null && cyitem == null) return true; // Both are null, therefore equal. - - var ctype = p.PropertyType.GetItemType(); - var sct = typeof(DeepPropertyCompare<>); - var scgt = sct.MakeGenericType(ctype); - var csc = Activator.CreateInstance(scgt); - var method = scgt.GetMethod(nameof(Equals), BindingFlags.Public | BindingFlags.Instance, null, new[] { ctype, ctype }, null) - ?? scgt.GetMethod(nameof(Equals), BindingFlags.Public | BindingFlags.Instance, null, new[] { typeof(object), typeof(object) }, null); - - if (!(bool)method.Invoke(csc, new[] { cxitem, cyitem })) return false; - } - } - - return true; - } - - /// - /// Get the hash code for all the public properties. - /// Ignores child objects. - /// - /// - /// - public int GetHashCode([DisallowNull] object obj) - { - var hash = new HashCode(); - - var props = obj.GetType().GetCachedProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.GetProperty); - - foreach (var p in props.Where(p => !p.GetIndexParameters().Any())) - { - if (p.PropertyType.IsValueType || p.PropertyType == typeof(string) || p.PropertyType.IsNullableType()) - hash.Add(p.GetValue(obj)); - else if (p.PropertyType == typeof(byte[])) - { - var value = (byte[])p.GetValue(obj); - value.ForEach(v => hash.Add(v)); - } - } - - return hash.ToHashCode(); - } - #endregion - } -} diff --git a/backend/core/Comparers/DeepPropertyCompare`.cs b/backend/core/Comparers/DeepPropertyCompare`.cs deleted file mode 100644 index 209a98d963..0000000000 --- a/backend/core/Comparers/DeepPropertyCompare`.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Diagnostics.CodeAnalysis; - -namespace Pims.Core.Comparers -{ - /// - /// DeepPropertyCompare class, provides a simple way to deep compare two objects of the same type. - /// - /// - public class DeepPropertyCompare : DeepPropertyCompare - { - /// - /// Determines if the objects public properties are equal. - /// - /// - /// - /// - public bool Equals([AllowNull] T x, [AllowNull] T y) - { - return base.Equals(x, y); - } - - /// - /// Get the hash code for all the public properties. - /// Ignores child objects. - /// - /// - /// - public int GetHashCode([DisallowNull] T obj) - { - return base.GetHashCode(obj); - } - } -} diff --git a/backend/core/Comparers/ShallowPropertyCompare.cs b/backend/core/Comparers/ShallowPropertyCompare.cs deleted file mode 100644 index c8c6faec6a..0000000000 --- a/backend/core/Comparers/ShallowPropertyCompare.cs +++ /dev/null @@ -1,59 +0,0 @@ -using Pims.Core.Extensions; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Reflection; - -namespace Pims.Core.Comparers -{ - /// - /// ShallowPropertyCompare class, provides a simple way to shallow compare two objects of the same type. - /// This compares only public properties, but ignores most non-value type properties (i.e Classes) - /// - public class ShallowPropertyCompare : IEqualityComparer - { - #region Methods - /// - /// Determines if the objects public properties are equal. - /// - /// - /// - /// - public new bool Equals([AllowNull] object x, [AllowNull] object y) - { - if (x == null || y == null || GetHashCode(x) != GetHashCode(y)) return false; - return true; - } - - /// - /// Get the hash code for all the public properties. - /// Ignores child objects. - /// - /// - /// - public int GetHashCode(object obj) - { - var hash = new HashCode(); - - var props = obj.GetType().GetCachedProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.GetProperty); - - foreach (var p in props.OrderBy(p => p.Name)) - { - var value = p.GetValue(obj); - - if (value == null) continue; - if (p.PropertyType.IsValueType || p.PropertyType == typeof(string) || p.PropertyType.IsNullableType()) - hash.Add(value); - else if (p.PropertyType == typeof(byte[])) - { - var data = (byte[])p.GetValue(obj); - data.ForEach(v => hash.Add(v)); - } - } - - return hash.ToHashCode(); - } - #endregion - } -} diff --git a/backend/core/Comparers/ShallowPropertyCompare`.cs b/backend/core/Comparers/ShallowPropertyCompare`.cs deleted file mode 100644 index d495161622..0000000000 --- a/backend/core/Comparers/ShallowPropertyCompare`.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Diagnostics.CodeAnalysis; - -namespace Pims.Core.Comparers -{ - /// - /// ShallowPropertyCompare class, provides a simple way to shallow compare two objects of the same type. - /// This compares only public properties, but ignores most non-value type properties (i.e Classes) - /// - /// - public class ShallowPropertyCompare : ShallowPropertyCompare - { - #region Methods - /// - /// Determines if the objects public properties are equal. - /// - /// - /// - /// - public bool Equals([AllowNull] T x, [AllowNull] T y) - { - return base.Equals(x, y); - } - - /// - /// Get the hash code for all the public properties. - /// Ignores child objects. - /// - /// - /// - /// - public int GetHashCode([DisallowNull] T obj) - { - return base.GetHashCode(obj); - } - #endregion - } -} diff --git a/backend/core/Converters/BooleanJsonConverter.cs b/backend/core/Converters/BooleanJsonConverter.cs deleted file mode 100644 index b259b2626c..0000000000 --- a/backend/core/Converters/BooleanJsonConverter.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Pims.Core.Converters -{ - /// - /// BooleanJsonConverter class, provides a json converter for boolean values. - /// Converters boolean values into lowercase string. - /// - public class BooleanJsonConverter : JsonConverter - { - #region Methods - /// - /// Convert string into boolean, or default to false. - /// - /// - /// - /// - /// - public override bool Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - var value = reader.GetString(); - - return Boolean.TryParse(value, out bool result) && result; - } - - /// - /// Return boolean value as lowercase string [true, false]. - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, bool value, JsonSerializerOptions options) - { - writer.WriteStringValue($"{value}".ToLower()); - } - #endregion - } -} diff --git a/backend/core/Converters/EnumValueJsonConverter.cs b/backend/core/Converters/EnumValueJsonConverter.cs deleted file mode 100644 index 5055354128..0000000000 --- a/backend/core/Converters/EnumValueJsonConverter.cs +++ /dev/null @@ -1,75 +0,0 @@ -using Pims.Core.Json; -using System; -using System.Reflection; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Pims.Core.Converters -{ - /// - /// EnumValueJsonConverter class, provides a way to convert enum values. - /// Serialization - Extract value from 'EnumValueAttribute' otherwise lowercase the enum name value. - /// Deserialization - Ignore case. - /// - /// - public class EnumValueJsonConverter : JsonConverter - where ET : struct, IConvertible - { - #region Methods - /// - /// Ignore case when parsing, otherwise return default. - /// - /// - /// - /// - /// - public override ET Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - var value = reader.GetString(); - - var valid = Enum.TryParse(value, true, out ET result); - - if (valid) - { - return result; - } - else - { - var fields = Enum.GetValues(typeof(ET)); - foreach (var field in fields) - { - var mi = typeof(ET).GetMember(field.ToString()); - var attr = mi[0].GetCustomAttribute(); - if (attr != null && String.CompareOrdinal(value, attr.Value) == 0) - { - return (ET)field; - } - } - } - - return default; - } - - /// - /// Extract name from 'EnumJsonAttribute' if exists, or return enum property naem in lowercase. - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ET value, JsonSerializerOptions options) - { - var fi = typeof(ET).GetField(value.ToString()); - var attr = fi.GetCustomAttribute(); - - if (attr != null) - { - writer.WriteStringValue(attr.Value); - } - else - { - writer.WriteStringValue($"{value}".ToLower()); - } - } - #endregion - } -} diff --git a/backend/core/Converters/GeometryJsonConverter.cs b/backend/core/Converters/GeometryJsonConverter.cs deleted file mode 100644 index 2ebfb5702b..0000000000 --- a/backend/core/Converters/GeometryJsonConverter.cs +++ /dev/null @@ -1,100 +0,0 @@ -using NetTopologySuite.Geometries; -using Pims.Core.Extensions; -using System; -using System.Linq; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Pims.Core.Converters -{ - /// - /// GeometryJsonConverter class, provides a way to serialize and deserialize geometry objects. - /// - public class GeometryJsonConverter : JsonConverter - { - #region Methods - /// - /// Deserialize a geometry object. - /// - /// - /// - /// - /// - public override Geometry Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - // TODO: Deserialize other geometric shapes. - return reader.TokenType switch - { - JsonTokenType.String => Create(typeToConvert, reader.GetString()), - _ => null, - }; - } - - /// - /// Serialize a geometery object. - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, Geometry value, JsonSerializerOptions options) - { - switch (value.GeometryType) - { - case Geometry.TypeNamePoint: - var point = value as Point; - writer.WriteStartArray(); - writer.WriteNumberValue(point.X); - writer.WriteNumberValue(point.Y); - writer.WriteEndArray(); - break; - case Geometry.TypeNamePolygon: - var polygon = value as Polygon; - writer.WriteStartArray(); - polygon.Coordinates.ForEach(c => - { - writer.WriteStartArray(); - writer.WriteNumberValue(c.X); - writer.WriteNumberValue(c.Y); - writer.WriteEndArray(); - }); - writer.WriteEndArray(); - break; - } - } - - /// - /// Create a Geometry of the specified type 'T'. - /// - /// - /// - /// - private Geometry Create(string value) - where T : Geometry - { - return Create(typeof(T), value); - } - - /// - /// Create a Geometry of the specified 'type'. - /// - /// - /// - /// - private Geometry Create(Type type, string value) - { - if (String.IsNullOrWhiteSpace(value)) return null; - - switch (type.Name) - { - case nameof(Point): - { - var values = value.Split(',').Select(v => double.Parse(v)).ToArray(); - return new Point(new Coordinate(values[0], values[1])); - } - default: - return null; - } - } - #endregion - } -} diff --git a/backend/core/Converters/Int32ToStringJsonConverter.cs b/backend/core/Converters/Int32ToStringJsonConverter.cs deleted file mode 100644 index 047a1d194b..0000000000 --- a/backend/core/Converters/Int32ToStringJsonConverter.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Pims.Core.Converters -{ - public class Int32ToStringJsonConverter : JsonConverter - { - #region Methods - public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - return reader.TokenType switch - { - (JsonTokenType.String) => reader.GetString(), - (JsonTokenType.Number) => reader.TryGetInt32(out int result) ? $"{result}" : "", - _ => null, - }; - } - - public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options) - { - writer.WriteStringValue(value); - } - #endregion - } -} diff --git a/backend/core/Converters/JsonEnumValueConverter.cs b/backend/core/Converters/JsonEnumValueConverter.cs deleted file mode 100644 index b8a53486b8..0000000000 --- a/backend/core/Converters/JsonEnumValueConverter.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Pims.Core.Json; -using System; -using System.Linq; -using System.Reflection; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Pims.Core.Converters -{ - /// - /// Converter to convert enums to and from strings. - /// Handles enum values that have 'EnumValueAttribute' to define valid values. - /// - public sealed class JsonEnumValueConverter : JsonConverterFactory - { - private readonly JsonStringEnumConverter _converter; - - /// - /// Creates a new instance of a JsonEnumValueConverter, initializes with specified arguments. - /// - /// - /// - public JsonEnumValueConverter(JsonNamingPolicy namingPolicy = null, bool allowIntegerValues = true) - { - _converter = new JsonStringEnumConverter(namingPolicy, allowIntegerValues); - } - - /// - /// Only can convert enum type. - /// - /// - /// - public override bool CanConvert(Type type) - { - return type.IsEnum; - } - - /// - /// If the enum has 'EnumValueAttribute' return the 'EnumValueJsonConverter', - /// otherwise return the 'JsonStringEnumConverter'. - /// - /// - /// - /// - public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options) - { - var values = Enum.GetValues(typeToConvert); - - foreach (var value in values) - { - var mi = typeToConvert.GetMember(value.ToString()); - var evmi = mi.FirstOrDefault(m => m.DeclaringType == typeToConvert); - var attr = evmi.GetCustomAttribute(); - if (attr != null) - { - return (JsonConverter)Activator.CreateInstance(typeof(EnumValueJsonConverter<>).MakeGenericType(typeToConvert)); - } - } - return _converter.CreateConverter(typeToConvert, options); - } - } -} diff --git a/backend/core/Converters/MicrosecondEpochJsonConverter.cs b/backend/core/Converters/MicrosecondEpochJsonConverter.cs deleted file mode 100644 index a587ce79a5..0000000000 --- a/backend/core/Converters/MicrosecondEpochJsonConverter.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Pims.Core.Converters -{ - /// - /// MicrosecondEpochJsonConverter class, provides a way to convert unix timestamps into DateTime values and vise-versa. - /// - public class MicrosecondEpochJsonConverter : JsonConverter - { - #region Methods - /// - /// Read the 'long' value from JSON and return a DateTime. - /// - /// - /// - /// - /// - public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - long value; - value = reader.TokenType switch - { - JsonTokenType.Number => reader.GetInt64(), - JsonTokenType.String => Int64.TryParse(reader.GetString(), out long result) ? result : 0, - _ => 0 - }; - return DateTimeOffset.UnixEpoch.AddMilliseconds(value).UtcDateTime; - } - - /// - /// Convert the DateTime to a long value. - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, DateTime value, JsonSerializerOptions options) - { - var date = ((DateTimeOffset)value); - if (date <= DateTime.UtcNow.AddHours(1)) - { - writer.WriteNumberValue(0); - } - else - { - long unixTime = date.ToUnixTimeMilliseconds(); - writer.WriteNumberValue(unixTime); - } - } - #endregion - } -} diff --git a/backend/core/Exceptions/ConfigurationException.cs b/backend/core/Exceptions/ConfigurationException.cs deleted file mode 100644 index 2d1e041c55..0000000000 --- a/backend/core/Exceptions/ConfigurationException.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; - -namespace Pims.Core.Exceptions -{ - /// - /// ConfigurationException class, provides a way to throw an exception when a configuration is invalid. - /// - public class ConfigurationException : Exception - { - #region Constructors - /// - /// Creates a new instance of a ConfigurationException class. - /// - /// - public ConfigurationException() : base() { } - - /// - /// Creates a new instance of a ConfigurationException class, and initializes it with the specified arguments. - /// - /// - /// - public ConfigurationException(string message) : base(message) { } - - /// - /// Creates a new instance of a ConfigurationException class, and initializes it with the specified arguments. - /// - /// - /// - /// - public ConfigurationException(string message, Exception innerException) : base(message, innerException) { } - #endregion - } -} diff --git a/backend/core/Exceptions/HttpClientRequestException.cs b/backend/core/Exceptions/HttpClientRequestException.cs deleted file mode 100644 index 0a8661119a..0000000000 --- a/backend/core/Exceptions/HttpClientRequestException.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Net; -using System.Net.Http; - -namespace Pims.Core.Exceptions -{ - /// - /// HttpClientRequestException class, provides a way to express HTTP request exceptions that occur. - /// - public class HttpClientRequestException : HttpRequestException - { - #region Properties - /// - /// get - The HTTP response message. - /// - /// - public HttpResponseMessage Response { get; } - #endregion - - #region Constructors - /// - /// Creates a new instance of an HttpClientRequestException class, initializes it with the specified arguments. - /// - /// - /// - /// - public HttpClientRequestException(string message, HttpStatusCode statusCode = HttpStatusCode.InternalServerError) : base(message, null, statusCode) - { - } - - /// - /// Creates a new instance of an HttpClientRequestException class, initializes it with the specified arguments. - /// - /// - /// - /// - /// - public HttpClientRequestException(string message, Exception innerException, HttpStatusCode statusCode = HttpStatusCode.InternalServerError) : base(message, innerException, statusCode) - { - if (innerException is HttpClientRequestException) - { - this.Response = ((HttpClientRequestException)innerException).Response; - } - } - - /// - /// Creates a new instance of an HttpClientRequestException class, initializes it with the specified arguments. - /// - /// - /// - public HttpClientRequestException(HttpResponseMessage response) : base($"HTTP Request '{response?.RequestMessage.RequestUri}' failed", null, response?.StatusCode) - { - this.Response = response ?? throw new ArgumentNullException(nameof(response)); // NOSONAR - // TODO: Extract error response details into innerException. - } - - /// - /// Creates a new instance of an HttpClientRequestException class, initializes it with the specified arguments. - /// - /// - /// - public HttpClientRequestException(HttpResponseMessage response, string message) : base(message, null, response?.StatusCode) - { - this.Response = response ?? throw new ArgumentNullException(nameof(response)); // NOSONAR - // TODO: Extract error response details into innerException. - } - - /// - /// Creates a new instance of an HttpClientRequestException class, initializes it with the specified arguments. - /// - /// - /// - public HttpClientRequestException(HttpResponseMessage response, Exception innerException) : base($"HTTP Request '{response?.RequestMessage.RequestUri}' failed", innerException, response?.StatusCode) - { - this.Response = response ?? throw new ArgumentNullException(nameof(response)); // NOSONAR - // TODO: Extract error response details into innerException. - } - #endregion - } -} diff --git a/backend/core/Exceptions/ProxyRequestException.cs b/backend/core/Exceptions/ProxyRequestException.cs deleted file mode 100644 index 3513cb1f60..0000000000 --- a/backend/core/Exceptions/ProxyRequestException.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Net; -using System.Net.Http; - -namespace Pims.Core.Exceptions -{ - /// - /// ProxyRequestException class, provides a way to express HTTP request exceptions that occur. - /// - public class ProxyRequestException : HttpClientRequestException - { - #region Constructors - /// - /// Creates a new instance of an ProxyRequestException class, initializes it with the specified arguments. - /// - /// - /// - /// - public ProxyRequestException(string message, HttpStatusCode statusCode = HttpStatusCode.InternalServerError) : base(message, statusCode) { } - - /// - /// Creates a new instance of an ProxyRequestException class, initializes it with the specified arguments. - /// - /// - /// - /// - /// - public ProxyRequestException(string message, Exception innerException, HttpStatusCode statusCode = HttpStatusCode.InternalServerError) : base(message, innerException, statusCode) { } - - /// - /// Creates a new instance of an ProxyRequestException class, initializes it with the specified arguments. - /// - /// - /// - public ProxyRequestException(HttpResponseMessage response) : base(response) { } - - /// - /// Creates a new instance of an ProxyRequestException class, initializes it with the specified arguments. - /// - /// - /// - public ProxyRequestException(HttpResponseMessage response, Exception innerException) : base(response, innerException) { } - #endregion - } -} diff --git a/backend/core/Extensions/ArrayExtensions.cs b/backend/core/Extensions/ArrayExtensions.cs deleted file mode 100644 index 938d27f6be..0000000000 --- a/backend/core/Extensions/ArrayExtensions.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Linq; - -namespace Pims.Core.Extensions -{ - /// - /// ArrayExtensions static class, provides extension methods for arrays. - /// - public static class ArrayExtensions - { - /// - /// Join all the specified arrays into a new array. - /// Some argue that the CopyTo method is faster than the LINQ Concat. - /// - /// - /// - /// - /// - public static T[] JoinAll(this T[] first, params T[][] next) - { - var length = first.Length + next.Sum(a => a.Length); - var newArray = new T[length]; - first.CopyTo(newArray, 0); - var index = first.Length; - next.ForEach(n => - { - n.CopyTo(newArray, index); - index += n.Length; - }); - return newArray; - } - } -} diff --git a/backend/core/Extensions/CollectionExtensions.cs b/backend/core/Extensions/CollectionExtensions.cs deleted file mode 100644 index db4a565d7f..0000000000 --- a/backend/core/Extensions/CollectionExtensions.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Pims.Core.Extensions -{ - /// - /// CollectionExtensions static class, provides extension methods for Enumerables. - /// - public static class CollectionExtensions - { - /// - /// Provides a way to mutate a collection by removing all items that match the 'find' statement. - /// - /// - /// - /// - /// - public static ICollection RemoveAll(this ICollection items, Func find) - { - var remove = items.Where(find).ToArray(); - - foreach (var item in remove) - { - items.Remove(item); - } - - return items; - } - } -} diff --git a/backend/core/Extensions/DateExtensions.cs b/backend/core/Extensions/DateExtensions.cs deleted file mode 100644 index eb78ea4336..0000000000 --- a/backend/core/Extensions/DateExtensions.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; - -namespace Pims.Core.Extensions -{ - /// - /// DateExtensions static class, provides extension methods for dates. - /// - public static class DateExtensions - { - /// - /// Return the appropriate year that represents the fiscal year for the specified 'date'. - /// The beginning of the fiscal year is April 1st. - /// - /// - /// mm/dd/yyyy - /// 12/01/2018 = 2018/2019 - /// 01/01/2019 = 2018/2019 - /// 05/01/2019 = 2019/2020 - /// - /// - /// - public static int GetFiscalYear(this DateTime date) - { - return date.Month >= 4 ? date.Year + 1 : date.Year; - } - - - /// - /// Generate the fiscal year string value (i.e. 20/21). - /// The result treats the specified 'fiscalYear' as the last year. - /// - /// - /// - public static string FiscalYear(this int fiscalYear) - { - return fiscalYear > 0 ? $"{(fiscalYear - 1).ToString().Substring(2, 2)}/{(fiscalYear).ToString().Substring(2, 2)}" : ""; - } - /// - /// Generate the fiscal year string value (i.e. 20/21). - /// The result treats the specified 'fiscalYear' as the last year. - /// - /// - /// - public static string FiscalYearNullable(this int? fiscalYear) - { - return fiscalYear > 0 ? $"{(fiscalYear - 1).ToString().Substring(2, 2)}/{(fiscalYear).ToString().Substring(2, 2)}" : ""; - } - } -} diff --git a/backend/core/Extensions/DictionaryExtensions.cs b/backend/core/Extensions/DictionaryExtensions.cs deleted file mode 100644 index c93f686db8..0000000000 --- a/backend/core/Extensions/DictionaryExtensions.cs +++ /dev/null @@ -1,290 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Pims.Core.Extensions -{ - /// - /// DictionaryExtensions static class, provides extension methods for dictionary objects. - /// - public static class DictionaryExtensions - { - /// - /// Get the value from the dictionary for the specified 'key' and return it as an int. - /// - /// - /// - /// - /// - public static int GetIntValue(this IDictionary dict, string key, int defaultValue = 0) - { - return dict.TryGetValue(key, out Microsoft.Extensions.Primitives.StringValues dValue) && int.TryParse(dValue, out int value) ? value : defaultValue; - } - - /// - /// Get the value from the dictionary for the specified 'key' and return it as an int. - /// - /// - /// - /// - /// - public static int? GetIntNullValue(this IDictionary dict, string key, int? defaultValue = null) - { - return dict.TryGetValue(key, out Microsoft.Extensions.Primitives.StringValues dValue) && int.TryParse(dValue, out int value) ? value : defaultValue; - } - - /// - /// Get the value from the dictionary for the specified 'key' and return it as an array of int. - /// - /// - /// - /// - /// - public static int[] GetIntArrayValue(this IDictionary dict, string key, string separator = ",") - { - return dict.TryGetValue(key, out Microsoft.Extensions.Primitives.StringValues value) ? value.ToString().Split(separator).Select(v => { return int.TryParse(v, out int iv) ? (int?)iv : null; }).Where(v => v != null).Select(v => (int)v).ToArray() : new int[0]; - } - - /// - /// Get the value from the dictionary for the specified 'key' and return it as an float. - /// - /// - /// - /// - /// - public static float GetFloatValue(this IDictionary dict, string key, float defaultValue = 0) - { - return dict.TryGetValue(key, out Microsoft.Extensions.Primitives.StringValues dValue) && float.TryParse(dValue, out float value) ? value : defaultValue; - } - - /// - /// Get the value from the dictionary for the specified 'key' and return it as an boolean. - /// - /// - /// - /// - /// - public static bool GetBoolValue(this IDictionary dict, string key, bool defaultValue = false) - { - return dict.TryGetValue(key, out Microsoft.Extensions.Primitives.StringValues dValue) && bool.TryParse(dValue, out bool value) ? value : defaultValue; - } - - /// - /// Get the value from the dictionary for the specified 'key' and return it as an float. - /// - /// - /// - /// - public static float? GetFloatNullValue(this IDictionary dict, string key, float? defaultValue = null) - { - return dict.TryGetValue(key, out Microsoft.Extensions.Primitives.StringValues dValue) && float.TryParse(dValue, out float value) ? value : defaultValue; - } - - /// - /// Get the value from the dictionary for the specified 'key' and return it as an float. - /// - /// - /// - /// - /// - public static decimal GetDecimalValue(this IDictionary dict, string key, decimal defaultValue = 0) - { - return dict.TryGetValue(key, out Microsoft.Extensions.Primitives.StringValues dValue) && decimal.TryParse(dValue, out decimal value) ? value : defaultValue; - } - - /// - /// Get the value from the dictionary for the specified 'key' and return it as an float. - /// - /// - /// - /// - /// - public static decimal? GetDecimalNullValue(this IDictionary dict, string key, decimal? defaultValue = null) - { - return dict.TryGetValue(key, out Microsoft.Extensions.Primitives.StringValues dValue) && decimal.TryParse(dValue, out decimal value) ? value : defaultValue; - } - - /// - /// Get the value from the dictionary for the specified 'key' and return it as an double. - /// - /// - /// - /// - /// - public static double GetDoubleValue(this IDictionary dict, string key, double defaultValue = 0) - { - return dict.TryGetValue(key, out Microsoft.Extensions.Primitives.StringValues dValue) && double.TryParse(dValue, out double value) ? value : defaultValue; - } - - /// - /// Get the value from the dictionary for the specified 'key' and return it as an double. - /// - /// - /// - /// - /// - public static double? GetDoubleNullValue(this IDictionary dict, string key, double? defaultValue = null) - { - return dict.TryGetValue(key, out Microsoft.Extensions.Primitives.StringValues dValue) && double.TryParse(dValue, out double value) ? value : defaultValue; - } - - /// - /// Get the value from the dictionary for the specified 'key' and return it as an string. - /// - /// - /// - /// - /// - public static string GetStringValue(this IDictionary dict, string key, string defaultValue = null) - { - return dict.TryGetValue(key, out Microsoft.Extensions.Primitives.StringValues value) ? value.ToString() : defaultValue; - } - - /// - /// Get the value from the dictionary for the specified 'key' and return it as an array of string. - /// - /// - /// - /// - /// - public static string[] GetStringArrayValue(this IDictionary dict, string key, string separator = ",") - { - return dict.TryGetValue(key, out Microsoft.Extensions.Primitives.StringValues value) ? value.ToString().Split(separator) : new string[0]; - } - - /// - /// Get the value from the dictionary for the specified 'key' and return it as an Guid. - /// - /// - /// - /// - /// - public static Guid GetGuidValue(this IDictionary dict, string key, Guid defaultValue = default) - { - return dict.TryGetValue(key, out Microsoft.Extensions.Primitives.StringValues dValue) && Guid.TryParse(dValue, out Guid value) ? value : defaultValue; - } - - /// - /// Get the value from the dictionary for the specified 'key' and return it as an Guid. - /// - /// - /// - /// - /// - public static Guid? GetGuidNullValue(this IDictionary dict, string key, Guid? defaultValue = null) - { - return dict.TryGetValue(key, out Microsoft.Extensions.Primitives.StringValues dValue) && Guid.TryParse(dValue, out Guid value) ? value : defaultValue; - } - - /// - /// Get the value from the dictionary for the specified 'key' and return it as an DateTime. - /// - /// - /// - /// - /// - public static DateTime GetDateTimeValue(this IDictionary dict, string key, DateTime defaultValue = default) - { - return dict.TryGetValue(key, out Microsoft.Extensions.Primitives.StringValues dValue) && DateTime.TryParse(dValue, out DateTime value) ? value : defaultValue; - } - - /// - /// Get the value from the dictionary for the specified 'key' and return it as an DateTime. - /// - /// - /// - /// - /// - public static DateTime? GetDateTimeNullValue(this IDictionary dict, string key, DateTime? defaultValue = null) - { - return dict.TryGetValue(key, out Microsoft.Extensions.Primitives.StringValues dValue) && DateTime.TryParse(dValue, out DateTime value) ? value : defaultValue; - } - - /// - /// Get the value from the dictionary for the specified 'key' and return it as an Enum of type 'T'. - /// - /// - /// - /// - /// - /// - /// - public static T GetEnumValue(this IDictionary dict, string key, bool ignoreCase = true, T defaultValue = default) - { - return dict.TryGetValue(key, out Microsoft.Extensions.Primitives.StringValues dValue) && Enum.TryParse(typeof(T), dValue, ignoreCase, out object value) ? (T)value : defaultValue; - } - - /// - /// Get the value from the dictionary for the specified 'key' and return it as an Enum of type 'T'. - /// - /// - /// - /// - /// - /// - /// - public static T? GetEnumNullValue(this IDictionary dict, string key, bool ignoreCase = true, T? defaultValue = null) - where T : struct - { - return dict.TryGetValue(key, out Microsoft.Extensions.Primitives.StringValues dValue) && Enum.TryParse(typeof(T), dValue, ignoreCase, out object value) ? (T)value : defaultValue; - } - - /// - /// Get the value from the dictionary for the specified 'key' and return it as an Envelope. - /// - /// - /// - /// - /// - public static NetTopologySuite.Geometries.Envelope GetEnvelopNullValue(this IDictionary dict, string key, NetTopologySuite.Geometries.Envelope defaultValue = null) - { - if (!dict.TryGetValue(key, out Microsoft.Extensions.Primitives.StringValues value)) - return defaultValue; - - var values = value.ToString().Split(','); - return NetTopologySuite.Geometries.Envelope.Parse($"Env[{values[0]}:{values[1]},{values[2]}:{values[3]}]"); - } - - /// - /// Get the value from the dictionary for the specified 'key' and return it as the specified type 'T'. - /// If the value doesn't convert correctly it will return a default value of the specified type 'T'. - /// - /// - /// - /// - /// - public static T GetValue(this IDictionary dict, string key, T defaultValue = default) - { - var type = typeof(T); - var nullabletype = Nullable.GetUnderlyingType(type); - var baseType = nullabletype ?? type; - var found = dict.TryGetValue(key, out Microsoft.Extensions.Primitives.StringValues value); - - if (!found) return defaultValue; - - try - { - return (T)Convert.ChangeType(value.ToString(), baseType); - } - catch - { - // Ignore exception and return default value. - return defaultValue; - } - } - - /// - /// Get the value from the dictionary for the specified 'key' and return it as a boolean. - /// - /// - /// - /// - /// - public static bool? GetBoolNullValue( - this IDictionary dict, string key, - bool? defaultValue = null) - { - return dict.GetValue(key, defaultValue); - } - } -} diff --git a/backend/core/Extensions/EnumExtensions.cs b/backend/core/Extensions/EnumExtensions.cs deleted file mode 100644 index 589edb9d30..0000000000 --- a/backend/core/Extensions/EnumExtensions.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Linq; - -namespace Pims.Core.Extensions -{ - /// - /// EnumExtensions static class, provides extension methods for enums. - /// - public static class EnumExtensions - { - #region Methods - /// - /// Returns to name of the enum in lowercase. - /// - /// - /// - public static string ToLower(this Enum value) - { - return value.ToString().ToLower(); - } - - /// - /// Provides a way to do a Contains function with the specified values. - /// - /// - /// - /// - /// - public static bool In(this T val, params T[] values) where T : struct - { - return values.Contains(val); - } - - /// - /// Convert the enum value to the destination enum value with the same name. - /// - /// - /// - /// - /// - public static DestinationT ConvertTo(this SourceT value) - where SourceT : struct, IConvertible - where DestinationT : struct, IConvertible - { - return Enum.TryParse(typeof(DestinationT), value.ToString(), out object result) ? (DestinationT)result : default; - } - #endregion - } -} diff --git a/backend/core/Extensions/EnumerableExtensions.cs b/backend/core/Extensions/EnumerableExtensions.cs deleted file mode 100644 index 457d9f2f7a..0000000000 --- a/backend/core/Extensions/EnumerableExtensions.cs +++ /dev/null @@ -1,135 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Pims.Core.Extensions -{ - /// - /// EnumerableExtensions static class, provides extension methods for Enumerables. - /// - public static class EnumerableExtensions - { - /// - /// Iterates through the enumerable collection and performs the specified action. - /// - /// - /// - /// - public static void ForEach(this IEnumerable items, Action action) - { - foreach (var item in items) - { - action.Invoke(item); - } - } - - /// - /// Iterates through the enumerable collection and performs the specified action. - /// Increments the index and passes it to the action. - /// - /// - /// - /// - public static void ForEach(this IEnumerable items, Action action) - { - var i = 0; - foreach (var item in items) - { - action.Invoke(item, i++); - } - } - - /// - /// Iterates through the enumerable collection and performs the specified action. - /// - /// - /// - /// - public static async Task ForEachAsync(this IEnumerable items, Func action) - { - await Task.WhenAll(items.Select(i => action.Invoke(i)).ToArray()); - } - - /// - /// Iterates through the enumerable collection and performs the specified action. - /// Increments the index and passes it to the action. - /// - /// - /// - /// - public static async Task ForEachAsync(this IEnumerable items, Func action) - { - var index = 0; - await Task.WhenAll(items.Select(i => action.Invoke(i, index++)).ToArray()); - } - - /// - /// Quick way to skip and take one. - /// - /// - /// - /// - /// - public static T Next(this IEnumerable items, int skip) - { - if (skip < 0) throw new ArgumentException("Argument must be greater than or equal to zero.", nameof(skip)); - return items.Skip(skip).First(); - } - - /// - /// Quick way to skip and take the specified quantity. - /// - /// - /// - /// - /// - /// - public static IEnumerable Next(this IEnumerable items, int skip, int take) - { - if (skip < 0) throw new ArgumentException("Argument must be greater than or equal to zero.", nameof(skip)); - if (take < 1) throw new ArgumentException("Argument must be greater than or equal to 1.", nameof(take)); - return items.Skip(skip).Take(take); - } - - /// - /// Return a new enumerable by extracting all items that are null. - /// - /// - /// - public static IEnumerable NotNull(this IEnumerable items) - { - return items.Where(v => v != null); - } - - /// - /// Return a new enumerable by extracting all items that are null or empty or whitespace. - /// - /// - /// - public static IEnumerable NotNullOrWhiteSpace(this IEnumerable items) - { - return items.Where(v => v != null && !String.IsNullOrWhiteSpace($"{v}")); - } - - /// - /// Return a new enumerable with only distinct values based on the comparer. - /// - /// - /// - /// - /// - /// - public static IEnumerable GetDistinctBy(this IEnumerable source, Func keySelector) - { - var seenKeys = new HashSet(); - foreach (TSource element in source) - { - if (seenKeys.Add(keySelector(element))) - { - yield return element; - } - } - } - } -} diff --git a/backend/core/Extensions/ExceptionExtensions.cs b/backend/core/Extensions/ExceptionExtensions.cs deleted file mode 100644 index c4d894b9bf..0000000000 --- a/backend/core/Extensions/ExceptionExtensions.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; - -namespace Pims.Core.Extensions -{ - /// - /// ExceptionExtensions static class, provides extention methods for exceptions. - /// - public static class ExceptionExtensions - { - /// - /// Get all inner error messages - /// - /// - /// - public static string GetAllMessages(this Exception ex) - { - return $"{ex.Message} {ex.InnerException?.GetAllMessages()}"; - } - - /// - /// Throw an ArgumentNullException if the value is null. - /// - /// - /// - /// - /// The argument value cannot be null. - public static T ThrowIfNull(this T value, string paramName) where T : class - { - return value ?? throw new ArgumentNullException(paramName); - } - } -} diff --git a/backend/core/Extensions/GeometryExtensions.cs b/backend/core/Extensions/GeometryExtensions.cs deleted file mode 100644 index cebb66fa82..0000000000 --- a/backend/core/Extensions/GeometryExtensions.cs +++ /dev/null @@ -1,80 +0,0 @@ -using NetTopologySuite.Geometries; - -namespace Pims.Core.Extensions -{ - /// - /// GeometryExtensions static class, provides extension methods for geometry objects. - /// - public static class GeometryExtensions - { - /// - /// Convert an Envelope to a Polygon. - /// - /// - /// - public static Polygon ToPolygon(this Envelope envelope) - { - if (envelope != null && envelope.MinX <= envelope.MaxX && envelope.MinY <= envelope.MaxY) - { - var pfactory = new GeometryFactory(); - var bounds = new[] - { - new Coordinate(envelope.MinX, envelope.MinY), - new Coordinate(envelope.MaxX, envelope.MinY), - new Coordinate(envelope.MaxX, envelope.MaxY), - new Coordinate(envelope.MinX, envelope.MaxY), - new Coordinate(envelope.MinX, envelope.MinY), - }; - - var poly = pfactory.CreatePolygon(new LinearRing(bounds)); - poly.SRID = 4326; - return poly; - } - return null; - } - - /// - /// Convert an array of Coordinate to a Polygon. - /// If the coordinate array is only a length of two it will be treated like a boundary. - /// If the coordinate array does not self close, it will by default close with the inital coordinates. - /// The coordinate array should be expressed counter-clockwise. - /// - /// - /// - public static Polygon ToPolygon(this Coordinate[] coords) - { - if (coords != null && coords.Length > 1) - { - var pfactory = new GeometryFactory(); - Coordinate[] bounds; - if (coords.Length == 2) - { - bounds = new[] - { - new Coordinate(coords[0].X, coords[0].Y), - new Coordinate(coords[1].X, coords[0].Y), - new Coordinate(coords[1].X, coords[1].Y), - new Coordinate(coords[0].X, coords[1].Y), - new Coordinate(coords[0].X, coords[0].Y), - }; - } - else if (!coords[0].Equals(coords[^1])) - { - // Make sure the ring is closed. - bounds = new Coordinate[coords.Length + 1]; - coords.CopyTo(bounds, 0); - bounds[coords.Length] = coords[0]; - } - else - { - bounds = coords; - } - - var poly = pfactory.CreatePolygon(new LinearRing(bounds)); - poly.SRID = 4326; - return poly; - } - return null; - } - } -} diff --git a/backend/core/Extensions/IdentityExtensions.cs b/backend/core/Extensions/IdentityExtensions.cs deleted file mode 100644 index 63a3a1c56f..0000000000 --- a/backend/core/Extensions/IdentityExtensions.cs +++ /dev/null @@ -1,150 +0,0 @@ -using System; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Core.Extensions -{ - /// - /// IdentityExtensions static class, provides extension methods for user identity. - /// - public static class IdentityExtensions - { - /// - /// Get the currently logged in user's ClaimTypes.NameIdentifier. - /// Return an empty Guid if no user is logged in. - /// - /// - /// - public static Guid GetGuid(this ClaimsPrincipal user) - { - string sub = user.Claims.First(c => c.Type == ClaimTypes.NameIdentifier)?.Value?.ToString(); - string guid = sub.Split("@")[0]; - - return String.IsNullOrWhiteSpace(guid) ? Guid.Empty : new Guid(guid); - } - - /// - /// Get the user's username. - /// - /// - /// String username - public static string GetUsername(this ClaimsPrincipal user) - { - // The BCeID and IDIR JWTs have different property names for some values, we must first get the identity provider - string identity_provider = user.GetIdentityProvider(); - // Get the username by using the correct field name, dependent on the identity_provider - // TODO: Make an enum/array of identity providers to keep it D.R.Y. - if (identity_provider == "idir") - { - string value = user.Claims.First(c => c.Type == "idir_username")?.Value.ToString().ToLower() + "@idir"; - return value; - } - else if (identity_provider == "bceidbusiness" || identity_provider == "bceidboth") - { - string value = user.Claims.First(c => c.Type == "bceid_username")?.Value.ToString().ToLower() + "@bceid"; - return value; - } - else if (identity_provider == "unit_testing") - { - string value = user.Claims.First(c => c.Type == "test_username")?.Value.ToString().ToLower(); - return value; - } - return ""; - } - - /// - /// Get the user's preferred username. - /// Preferred username is a Keycloak Gold claim which contains the user's GUID followed by @ + the identity provider they used. - /// - /// - /// String preferred_username - public static string GetPreferredUsername(this ClaimsPrincipal user) - { - return user.Claims.First(c => c.Type == "preferred_username").Value; - } - - /// - /// Get the user's display name. - /// - /// - /// - public static string GetDisplayName(this ClaimsPrincipal user) - { - var value = user?.FindFirstValue("name"); - return value; - } - - /// - /// Get the user's first name. - /// - /// - /// - public static string GetFirstName(this ClaimsPrincipal user) - { - var value = user?.FindFirstValue(ClaimTypes.GivenName); - return value; - } - - /// - /// Get the user's last name. - /// - /// - /// - public static string GetLastName(this ClaimsPrincipal user) - { - var value = user?.FindFirstValue(ClaimTypes.Surname); - return value; - } - - /// - /// Get the user's email. - /// - /// - /// - public static string GetEmail(this ClaimsPrincipal user) - { - var value = user?.FindFirstValue(ClaimTypes.Email); - return value; - } - - /// - /// Determine if the user any of the specified roles. - /// - /// - /// - /// True if the user has any of the roles. - public static bool HasRole(this ClaimsPrincipal user, params string[] role) - { - if (role == null) throw new ArgumentNullException(nameof(role)); - if (role.Length == 0) throw new ArgumentOutOfRangeException(nameof(role)); - - return user.Claims.Any(c => c.Type == ClaimTypes.Role && role.Contains(c.Value)); - } - - /// - /// Determine if the user all of the specified roles. - /// - /// - /// - /// True if the user has all of the roles. - public static bool HasRoles(this ClaimsPrincipal user, params string[] role) - { - if (role == null) throw new ArgumentNullException(nameof(role)); - if (role.Length == 0) throw new ArgumentOutOfRangeException(nameof(role)); - - var count = user.Claims.Count(c => c.Type == ClaimTypes.Role && role.Contains(c.Value)); - - return count == role.Length; - } - /// - /// Get the identity provider from the given user - /// - /// - /// - public static string GetIdentityProvider(this ClaimsPrincipal user) - { - string identity_provider = user.Claims.First(c => c.Type == "identity_provider")?.Value.ToString(); - return identity_provider; - } - } -} diff --git a/backend/core/Extensions/JsonSerializerExtensions.cs b/backend/core/Extensions/JsonSerializerExtensions.cs deleted file mode 100644 index 4a7d9234ec..0000000000 --- a/backend/core/Extensions/JsonSerializerExtensions.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System.IO; -using System.Text.Json; -using System.Text.Json.Serialization; -using System.Threading.Tasks; - -namespace Pims.Core.Extensions -{ - /// - /// JsonSerializerExtensions static class, provides extension methods for JSON serialization and deserialization. - /// - public static class JsonSerializerExtensions - { - #region Variables - /// - /// JSON formatting options. - /// - /// - private static readonly JsonSerializerOptions _jsonFormatOptions = new JsonSerializerOptions - { - PropertyNameCaseInsensitive = true, - PropertyNamingPolicy = JsonNamingPolicy.CamelCase, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, - WriteIndented = true - }; - #endregion - - #region Methods - /// - /// Deserialize the specified string into the specified object of type 'T'. - /// - /// - /// - /// - public static async Task DeserializeAsync(this Stream utf8Json) - { - return await JsonSerializer.DeserializeAsync(utf8Json, _jsonFormatOptions); - } - - /// - /// Deserialize the specified string into the specified object of type 'T'. - /// - /// - /// - /// - public static T Deserialize(this string json) - { - return JsonSerializer.Deserialize(json, _jsonFormatOptions); - } - - /// - /// Serialize the object into a JSON string. - /// - /// - /// - /// - public static string Serialize(this T item) - { - return JsonSerializer.Serialize(item, _jsonFormatOptions); - } - - /// - /// Serialize the object into a JSON string within the stream. - /// - /// - /// - /// - /// - public static async Task SerializeAsync(this Stream utf8Json, T item) - { - await JsonSerializer.SerializeAsync(utf8Json, item, _jsonFormatOptions); - } - #endregion - } -} diff --git a/backend/core/Extensions/ObjectExtensions.cs b/backend/core/Extensions/ObjectExtensions.cs deleted file mode 100644 index d2683a6793..0000000000 --- a/backend/core/Extensions/ObjectExtensions.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Linq; -using System.Reflection; - -namespace Pims.Core.Extensions -{ - /// - /// ObjectExtensions static class, provides extension methods for generic objects. - /// - public static class ObjectExtensions - { - /// - /// Copies the public properties from the 'source' object to the 'destination' object. - /// It will only copy public properties that have a 'set' and are of the following types, primitive, enum, string. - /// Or an array of those same types. - /// - /// - /// - /// - /// - public static DT CopyValues(this ST source, DT destination) - where ST : class - where DT : class - { - if (destination == null) throw new ArgumentNullException(nameof(destination)); - - var type = typeof(DT); - if (!type.IsClass || (type.IsValueType && !type.IsEnum)) throw new ArgumentException($"The destination type must be an object or struct.", nameof(source)); - - var sProps = typeof(ST) - .GetCachedProperties(BindingFlags.Instance | BindingFlags.Public) - .Where(p => p.PropertyType.IsPrimitive - || p.PropertyType.IsEnum - || p.PropertyType == typeof(string) - || (p.PropertyType.IsGenericType - && p.PropertyType.GetGenericTypeDefinition() == typeof(Nullable<>) - && Nullable.GetUnderlyingType(p.PropertyType).IsPrimitive) - || (p.PropertyType.IsEnumerable() - && p.PropertyType.GetItemType().IsPrimitive)).ToDictionary(p => p.Name); - var dProps = type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.SetProperty); - - foreach (var dProp in dProps) - { - if (!sProps.ContainsKey(dProp.Name)) continue; - var sProp = sProps[dProp.Name]; - - if (sProp.PropertyType == dProp.PropertyType) - { - var value = sProp.GetValue(source); - if (dProp.PropertyType.IsEnumerable()) - { - if (dProp.PropertyType.IsArray) - { - var array = value as Array; - dProp.SetValue(destination, array, null); - } - } - else - { - dProp.SetValue(destination, value); - } - } - } - - return destination; - } - } -} diff --git a/backend/core/Extensions/QueryableExtensions.cs b/backend/core/Extensions/QueryableExtensions.cs deleted file mode 100644 index 961e5320b1..0000000000 --- a/backend/core/Extensions/QueryableExtensions.cs +++ /dev/null @@ -1,161 +0,0 @@ -using System; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; - -namespace Pims.Core.Extensions -{ - /// - /// QueryableExtensions static class, provides extension methods for IQueryable. - /// - public static class QueryableExtensions - { - #region Variables - private static readonly string[] _orderByDescending = new[] { "desc", "descending" }; - private static readonly MethodInfo OrderByMethod = typeof(Queryable).GetMethods().Single(method => method.Name == "OrderBy" && method.GetParameters().Length == 2); - private static readonly MethodInfo OrderByDescendingMethod = typeof(Queryable).GetMethods().Single(method => method.Name == "OrderByDescending" && method.GetParameters().Length == 2); - private static readonly MethodInfo GeneratePropertyPathLambdaMethod = typeof(QueryableExtensions).GetMethod(nameof(GeneratePropertyPathLambda), BindingFlags.NonPublic | BindingFlags.Static); - #endregion - - /// - /// Check if the specified property exists in the specified type. - /// - /// - /// - /// - private static bool PropertyExists(string propertyName) - { - return typeof(T).GetProperty(propertyName, BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Instance) != null; - } - - /// - /// Order the query results by the specified property names. - /// Each property can also specify the direction of the sort (i.e. "Name asc", "Name ascending", "Name desc", "Name descending"). - /// - /// - /// - /// - /// - public static IQueryable OrderByProperty(this IQueryable source, params string[] propertyName) - { - if (propertyName == null) return source; - var query = source; - foreach (var prop in propertyName) - { - var parts = prop?.Split(' ') ?? throw new ArgumentNullException(nameof(propertyName)); - - if (parts.Length > 2) throw new ArgumentOutOfRangeException(nameof(propertyName), "Argument 'propertyName' must not have more than two parts (i.e. 'Name asc' or 'Name desc')"); - if (parts.Length == 2 && _orderByDescending.Contains(parts[1].ToLower())) - { - query = query.OrderByPropertyDescending(parts[0]); - } - else - { - var rType = GetPropertyPathType(parts[0]) ?? throw new InvalidOperationException($"The property path '{typeof(T).Name}.{parts[0]}' did not return a type."); - var convertMethod = GeneratePropertyPathLambdaMethod.MakeGenericMethod(new[] { typeof(T), rType }); - var orderExpression = convertMethod.Invoke(null, new[] { parts[0] }); - if (orderExpression != null) - { - var genericMethod = OrderByMethod.MakeGenericMethod(typeof(T), rType); - query = (IQueryable)genericMethod.Invoke(null, new[] { query, orderExpression }); - } - else - { - if (!PropertyExists(parts[0])) continue; - ParameterExpression parameterExpression = Expression.Parameter(typeof(T)); - Expression orderByProperty = Expression.Property(parameterExpression, parts[0]); - LambdaExpression lambda = Expression.Lambda(orderByProperty, parameterExpression); - MethodInfo genericMethod = OrderByMethod.MakeGenericMethod(typeof(T), orderByProperty.Type); - query = (IQueryable)genericMethod.Invoke(null, new object[] { query, lambda }); - } - } - - } - return query; - } - - /// - /// Order the query results by the specified property names. - /// Any property name that doesn't exist will be ignored. - /// - /// - /// - /// - /// - public static IQueryable OrderByPropertyDescending(this IQueryable source, params string[] propertyName) - { - if (propertyName == null) return source; - var query = source; - foreach (var prop in propertyName) - { - var rType = GetPropertyPathType(prop); - var convertMethod = GeneratePropertyPathLambdaMethod.MakeGenericMethod(new[] { typeof(T), rType }); - var orderExpression = convertMethod.Invoke(null, new[] { prop }); - if (orderExpression != null) - { - var genericMethod = OrderByDescendingMethod.MakeGenericMethod(typeof(T), rType); - query = (IQueryable)genericMethod.Invoke(null, new[] { query, orderExpression }); - } - else - { - if (!PropertyExists(prop)) return query; - ParameterExpression parameterExpression = Expression.Parameter(typeof(T)); - Expression orderByProperty = Expression.Property(parameterExpression, prop); - LambdaExpression lambda = Expression.Lambda(orderByProperty, parameterExpression); - MethodInfo genericMethod = OrderByDescendingMethod.MakeGenericMethod(typeof(T), orderByProperty.Type); - query = (IQueryable)genericMethod.Invoke(null, new object[] { query, lambda }); - } - } - return query; - } - - /// - /// Get the 'Type' of the object specified by the 'path'. - /// Fetches the properties from cache so that it doesn't haven't to iterate with reflection each time it is is called. - /// - /// - /// - /// - private static Type GetPropertyPathType(string path) - { - var type = typeof(T); - foreach (var part in path.Split('.')) - { - var prop = type.GetCachedProperties().FirstOrDefault(p => p.Name == part) ?? throw new ArgumentException($"Property path '{type.Name}.{path}' is invalid.", nameof(path)); - type = prop.PropertyType.IsEnumerable() && prop.PropertyType != typeof(string) ? prop.PropertyType.GetItemType() : prop.PropertyType; - } - - return type; - } - - /// - /// Generates a LambdaExpression for the specified 'Type' and 'path'. - /// - /// - /// - /// - public static LambdaExpression MakeSelector(this Type objectType, string path) - { - var parameter = Expression.Parameter(objectType, "x"); - var body = path.Split('.').Aggregate((Expression)parameter, Expression.PropertyOrField); - return Expression.Lambda(body, parameter); - } - - /// - /// Generates an Expression for the specified 'path'. - /// - /// - /// - /// - /// - /// - private static Expression> GeneratePropertyPathLambda(string path) - where T : class - { - if (!path.Contains('.')) return null; - - var parameter = Expression.Parameter(typeof(T), "x"); - return Expression.Lambda>(path.Split('.').Aggregate((Expression)parameter, Expression.PropertyOrField), parameter); - } - } -} diff --git a/backend/core/Extensions/StringExtensions.cs b/backend/core/Extensions/StringExtensions.cs deleted file mode 100644 index 480517e67d..0000000000 --- a/backend/core/Extensions/StringExtensions.cs +++ /dev/null @@ -1,119 +0,0 @@ -using System; -using System.Net.Http; -using System.Text; - -namespace Pims.Core.Extensions -{ - /// - /// StringExtensions static class, provides extension methods for strings. - /// - public static class StringExtensions - { - /// - /// Extracts the first letter of each word from the text and returns the value. - /// - /// - /// - /// - public static string GetFirstLetterOfEachWord(this string text, bool uppercase = true) - { - var result = new StringBuilder(); - var split = text.Split(" ", StringSplitOptions.RemoveEmptyEntries); - foreach (var part in split) - { - var letter = part.Substring(0, 1); - result.Append(uppercase ? letter.ToUpper() : letter); - } - return result.ToString(); - } - - /// - /// Checks if the current hosting environment name is Production. - /// - /// The environment name. - /// True if the environment name is Production, otherwise false. - public static bool IsProduction(this string env) - { - return env != null && env.Equals("Production", StringComparison.OrdinalIgnoreCase); - } - - /// - /// Formats the specified postal value. - /// - /// The specified postal value - /// Postal with format XXX XXX. - public static string FormatAsPostal(this string postal) - { - if (postal?.Length == 6 && (!postal?.Contains(" ") ?? false)) - return postal?.ToUpper().Insert(3, " "); - return postal?.ToUpper(); - } - - /// - /// Lowercases the first character of the specified 'word'. - /// - /// - /// - public static string LowercaseFirstCharacter(this string word) - { - if (!String.IsNullOrWhiteSpace(word) && !char.IsUpper(word[0])) - { - return char.ToLower(word[0]) + (word.Length > 1 ? word.Substring(1) : null); - } - return word; - } - - /// - /// Determine what HTTP method to use. - /// - /// - /// - public static HttpMethod GetHttpMethod(this string method) - { - return (method?.ToLower()) switch - { - ("get") => HttpMethod.Get, - ("delete") => HttpMethod.Delete, - ("put") => HttpMethod.Put, - _ => HttpMethod.Post, - }; - } - - /// - /// Convert the specified 'value' from default to UTF8 encoding. - /// Replace linebreaks with spaces. - /// - /// - /// - /// - public static string ConvertToUTF8(this string value, bool replaceLineBreaks = true) - { - if (value == null) return value; - var bytes = Encoding.Default.GetBytes(replaceLineBreaks ? value.Replace("\r\n", " ") : value); - return Encoding.UTF8.GetString(bytes); - } - - /// - /// Truncate the specified 'value' to the specified 'length'. - /// - /// - /// - /// - public static string Truncate(this string value, int maxLength) - { - if (string.IsNullOrEmpty(value)) return value; - return value.Length <= maxLength ? value : value.Substring(0, maxLength); - } - - /// - /// Clean up the project numbers array format and get rid of double quotes, brackets, and commas. - /// - /// - /// - public static string FormatProjectNumbers(this string value) - { - if (string.IsNullOrEmpty(value)) return value; - return value.Replace("\"", "").Replace("[", "").Replace("]", "").Replace(",", System.Environment.NewLine); - } - } -} diff --git a/backend/core/Extensions/TypeExtensions.cs b/backend/core/Extensions/TypeExtensions.cs deleted file mode 100644 index bb69604397..0000000000 --- a/backend/core/Extensions/TypeExtensions.cs +++ /dev/null @@ -1,239 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Linq; -using System.Reflection; -using System.Runtime.CompilerServices; - -namespace Pims.Core.Extensions -{ - /// - /// TypeExtensions static class, provides extension methods for Type objects. - /// - public static class TypeExtensions - { - #region Variables - /// - /// To speed things up so that we don't have to use reflection to gather properties every time we cache them after doing it the first time. - /// - private static readonly ConcurrentDictionary> _typeCache = new ConcurrentDictionary>(); - private static readonly ConcurrentDictionary> _typeConstructorCache = new ConcurrentDictionary>(); - #endregion - - #region Methods - /// - /// Creates a basic new instance of the specified type. - /// - /// - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Argument is required for extension method.")] - public static T CreateInstance(this Type type) - { - return (T)Activator.CreateInstance(); - } - - /// - /// Get the properties for the specified and cache them in memory. - /// This method is only useful for instance type objects. - /// - /// - /// - /// - public static IEnumerable GetCachedProperties(this Type type, BindingFlags bindingFlags = BindingFlags.Public | BindingFlags.Instance) - { - return _typeCache.GetOrAdd(type, (key) => from p in type.GetProperties(bindingFlags) - select p); - } - - /// - /// Get the properties for the specified and cache them in memory. - /// This method is only useful for instance type objects. - /// Note - /// If there are multiple property members with the same name this will throw an exception - /// because it's expecting unique property names. - /// - /// - /// - /// - public static IDictionary GetCachedPropertiesAsDictionary(this Type type, BindingFlags bindingFlags = BindingFlags.Public | BindingFlags.Instance) - { - return _typeCache.GetOrAdd(type, (key) => from p in type.GetProperties(bindingFlags) - select p).ToImmutableDictionary(p => p.Name); - } - - /// - /// Get the constructors for the specified and cache them in memory. - /// This method is only useful for instance type objects. - /// - /// - /// - /// - public static IEnumerable GetCachedConstructors(this Type type, BindingFlags bindingFlags = BindingFlags.Public | BindingFlags.Instance) - { - return _typeConstructorCache.GetOrAdd(type, (key) => from p in type.GetConstructors(bindingFlags) - select p); - } - - /// - /// Determine if the specified type is an enumerable. - /// - /// - /// - public static bool IsEnumerable(this Type type, bool notString = true) - { - return typeof(IEnumerable).IsAssignableFrom(type) && (!notString || type != typeof(string)); - } - - /// - /// Determine if the specified type is an IEnumerable. - /// - /// - /// - public static bool IsIEnumerable(this Type type) - { - return type.GetInterfaces().Any(t => t.IsGenericType && t.GetGenericTypeDefinition() == typeof(IEnumerable<>)); - } - - /// - /// Determine if the specified type is a ICollection. - /// - /// - /// - public static bool IsICollection(this Type type) - { - return type.GetInterfaces().Any(t => t.IsGenericType && t.GetGenericTypeDefinition() == typeof(ICollection<>)); - } - - /// - /// Determine if the type/object is a nullable type. - /// - /// - /// - /// True if the type/object is nullable. - public static bool IsNullable(this T obj) - { - if (obj == null) return true; - var type = typeof(T); - if (!type.IsValueType) return true; - if (Nullable.GetUnderlyingType(type) != null) return true; - return false; - } - - /// - /// Determine if the type/object is a nullable type. - /// - /// - /// - /// True if the type/object is nullable. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Argument is required for extension method.")] - public static bool IsNullableType(this T obj) - { - var type = typeof(T); - return Nullable.GetUnderlyingType(type) != null; - } - - /// - /// Determine if the type/object is of the specified type. - /// - /// - /// - /// - /// True if the type/object is of the specified type. - public static bool IsType(this T obj, Type type) - { - if (type == null) - throw new ArgumentNullException(nameof(type)); - - return typeof(T) == type || obj?.GetType() == type; - } - - /// - /// Determine if the type/object is one of the specified types. - /// - /// - /// - /// - /// True if the type/object is one of the specified types. - public static bool IsType(this T obj, params Type[] type) - { - return type.Contains(typeof(T)) || type.Contains(obj?.GetType()); - } - - /// - /// Get the generic item type of the enumerable type, otherwise just return the type. - /// - /// - /// - public static Type GetItemType(this Type type) - { - if (!type.IsGenericType) - { - if (type.IsEnumerable()) - return type.GetElementType(); - return type; - } - return type.GetGenericArguments()[0]; - } - - /// - /// Get the method for the specified 'name', 'bindingFlags' and 'parameterTypes'. - /// - /// - /// - /// - /// - /// - public static MethodInfo FindMethod(this Type type, string name, BindingFlags bindingFlags, params Type[] parameterTypes) - { - if (String.IsNullOrWhiteSpace(name)) throw new ArgumentException($"Argument cannot be null, empty or whitespace.", nameof(name)); - - return type.GetMethod(name, bindingFlags, null, CallingConventions.Any, parameterTypes, null); - } - - /// - /// Get the default public instance method for the specified 'name' and 'parameterTypes'. - /// By default it will find the method without parameters. - /// - /// - /// - /// - /// - public static MethodInfo FindMethod(this Type type, string name, params Type[] parameterTypes) - { - if (!parameterTypes.Any()) parameterTypes = new Type[0]; - return type.FindMethod(name, BindingFlags.Instance | BindingFlags.Public, parameterTypes); - } - - /// - /// Determine if the specified type is an anonymous type. - /// - /// - /// - public static bool IsAnonymousType(this Type type) - { - if (type == null) - throw new ArgumentNullException("type"); - - // HACK: The only way to detect anonymous types right now. - return Attribute.IsDefined(type, typeof(CompilerGeneratedAttribute), false) - && type.IsGenericType && type.Name.Contains("AnonymousType") - && (type.Name.StartsWith("<>") || type.Name.StartsWith("VB$")) - && type.Attributes.HasFlag(TypeAttributes.NotPublic); - } - - /// - /// Create a default value for the specified 'type'. - /// - /// - /// - public static object GetDefault(this Type type) - { - if (type.IsValueType) - return Activator.CreateInstance(type); - return null; - } - #endregion - } -} diff --git a/backend/core/Extensions/UriBuilderExtensions.cs b/backend/core/Extensions/UriBuilderExtensions.cs deleted file mode 100644 index 24d47a9c92..0000000000 --- a/backend/core/Extensions/UriBuilderExtensions.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Web; - -namespace Pims.Core.Extensions -{ - /// - /// UriBuilderExtensions static class, provides extension methods for UriBuilder objects. - /// - public static class UriBuilderExtensions - { - /// - /// Append the query key=value to the query string. - /// By default it will not add empty parameters. - /// - /// - /// - /// - /// - public static void AppendQuery(this UriBuilder builder, string key, string value, bool addIfEmpty = false) - { - if (String.IsNullOrWhiteSpace(key)) throw new ArgumentException("Argument cannot be null, empty or whitespace", nameof(key)); - - if (addIfEmpty || !String.IsNullOrWhiteSpace(value)) - { - var query = HttpUtility.ParseQueryString(builder.Query); - query[key] = value; - builder.Query = query.ToString(); - } - } - } -} diff --git a/backend/core/Helpers/CsvHelper.cs b/backend/core/Helpers/CsvHelper.cs deleted file mode 100644 index 01fce2d0c3..0000000000 --- a/backend/core/Helpers/CsvHelper.cs +++ /dev/null @@ -1,122 +0,0 @@ -using CsvHelper; -using CsvHelper.Configuration; -using Pims.Core.Extensions; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Globalization; -using System.IO; -using System.Reflection; -using System.Linq; - -namespace Pims.Core.Helpers -{ - /// - /// CsvHelper static class, provides helper methods to generate CSV data. - /// - public static class CsvHelper - { - /// - /// Converts the specified 'data' into a CSV string. - /// - /// - /// - /// - /// - public static string ConvertToCSV(this IEnumerable data, string delimiter = ",") - { - using var writer = new StringWriter(); - var config = new CsvConfiguration(CultureInfo.InvariantCulture) - { - IgnoreBlankLines = true, - Delimiter = delimiter, - }; - using var csvWriter = new CsvWriter(writer, config); - csvWriter.WriteRecords(data); - return writer.ToString(); - } - - /// - /// Converts the specified 'data' into a DataTable. - /// - /// - /// - /// - /// - public static DataTable ConvertToDataTable(this IEnumerable data, string tableName) - { - var dt = new DataTable() - { - TableName = tableName - }; - var columns = new Dictionary(); - var index = 0; - var type = typeof(T) == typeof(Object) ? data.GetType().GetItemType() : typeof(T); - var properties = type.GetCachedProperties(); - properties.ForEach(p => - { - var pType = p.PropertyType; - var isNullable = pType.IsGenericType && pType.GetGenericTypeDefinition() == typeof(Nullable<>); - // Only include simple data types. - if (pType.IsPrimitive || pType == typeof(string) || (!pType.IsEnumerable() && !pType.IsClass)) - { - var type = isNullable ? Nullable.GetUnderlyingType(pType) : pType; - if (type.IsEnum) type = typeof(string); // Need to do this because enums are converted to strings. - var displayAttr = p.GetCustomAttribute(); - var name = displayAttr?.DisplayName ?? p.Name; - var column = new DataColumn(name, type) { AllowDBNull = isNullable || type == typeof(string) }; - dt.Columns.Add(column); - columns.Add(index++, new ExportColumn(p, column)); - } - }); - - dt.BeginLoadData(); - data.ForEach(item => - { - var values = columns.Select(c => { - var value = c.Value.PropertyInfo.GetValue(item); - if (c.Value.Column.DataType == typeof(DateTime) && value != null && (DateTime)value == DateTime.MinValue) - return null; - return value; - }).ToArray(); - dt.LoadDataRow(values, true); - }); - dt.EndLoadData(); - - return dt; - } - } - - /// - /// ExportColumn private class, provides an object to maintain the original property and the column information. - /// This is only used in the CsvHelper. - /// - class ExportColumn - { - #region Properties - /// - /// get/set - The original object property information. - /// - public PropertyInfo PropertyInfo { get; set; } - - /// - /// get/set - The column that will contain the property value. - /// - public DataColumn Column { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a ExportColumn object, initializes it with specified arguments. - /// - /// - /// - public ExportColumn(PropertyInfo member, DataColumn column) - { - this.PropertyInfo = member; - this.Column = column; - } - #endregion - } -} diff --git a/backend/core/Helpers/ExceptionHelper.cs b/backend/core/Helpers/ExceptionHelper.cs deleted file mode 100644 index fe145e5e4b..0000000000 --- a/backend/core/Helpers/ExceptionHelper.cs +++ /dev/null @@ -1,104 +0,0 @@ -using System; - -namespace Pims.Core.Helpers -{ - /// - /// ExceptionHelpers static class, provides methods to help with handling exceptions. - /// /// - public static class ExceptionHelper - { - /// - /// Provides a simple try+catch wrapper to set a variable. - /// - /// - /// - /// Default of type 'T'. - public static T HandleKeyNotFound(Func getter) - { - try - { - return getter(); - } - catch (System.Collections.Generic.KeyNotFoundException) - { - return default; - } - } - - /// - /// Provides a simple try+catch wrapper to set a variable. - /// - /// - /// - /// - /// - public static T HandleKeyNotFound(Func getter, Func setter) - { - try - { - return getter(); - } - catch (System.Collections.Generic.KeyNotFoundException) - { - return setter(); - } - } - - /// - /// Provides a simple try+catch wrapper to set a variable. - /// - /// - /// - /// - /// - public static T HandleKeyNotFound(Func getter, T defaultValue) - { - try - { - return getter(); - } - catch (System.Collections.Generic.KeyNotFoundException) - { - return defaultValue; - } - } - - /// - /// Provides a simple try+catch wrapper to set a variable. - /// This will create a default instance of type 'T' if the 'getter' fails. - /// - /// - /// - /// - public static T HandleKeyNotFoundWithDefault(Func getter) - { - try - { - return getter(); - } - catch (System.Collections.Generic.KeyNotFoundException) - { - return Activator.CreateInstance(); - } - } - - /// - /// Provides a simple try+catch wrapper to set a variable. - /// This will create a default instance of type 'T' if the 'getter' fails. - /// - /// - /// - /// - public static T HandleExceptionWithDefault(Func getter) - { - try - { - return getter(); - } - catch (Exception) - { - return Activator.CreateInstance(); - } - } - } -} diff --git a/backend/core/Helpers/StringHelper.cs b/backend/core/Helpers/StringHelper.cs deleted file mode 100644 index ec53a7d86b..0000000000 --- a/backend/core/Helpers/StringHelper.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Linq; - -namespace Pims.Core.Helpers -{ - /// - /// StringHelpers static class, provides helper methods for strings. - /// - public static class StringHelper - { - #region Variables - private static readonly Random rand = new Random(DateTime.Now.Second); - #endregion - - #region Methods - /// - /// Generate a random set of characters to the specified 'length'. - /// The longer the length, the more random the value. - /// - /// - /// - public static string Generate(int length) - { - if (length < 2) throw new ArgumentException("Length must be greater than or equal to 2.", nameof(length)); - - var constonants = new[] { "b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "l", "n", "p", "q", "r", "s", "t", "v", "w", "x" }; - var vowels = new[] { "a", "e", "i", "o", "u", "y" }; - var numbers = new[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" }; - var symbols = new[] { "_", "+", "-", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "?" }; - var all = constonants.Concat(vowels).Concat(numbers).Concat(symbols).ToArray(); - - string value = ""; - value += constonants[rand.Next(constonants.Length)].ToUpper(); - value += vowels[rand.Next(vowels.Length)]; - int b = 2; //b tells how many times a new letter has been added. It's 2 right now because the first two letters are already in the name. - while (b < length) - { - value += all[rand.Next(all.Length)]; - b++; - } - - return value; - } - #endregion - } -} diff --git a/backend/core/Helpers/XmlHelper.cs b/backend/core/Helpers/XmlHelper.cs deleted file mode 100644 index 89f244d5f8..0000000000 --- a/backend/core/Helpers/XmlHelper.cs +++ /dev/null @@ -1,25 +0,0 @@ -using ClosedXML.Excel; -using System.Data; - -namespace Pims.Core.Helpers -{ - /// - /// XmlHelper static class, provides helper methods to generate XML data. - /// - public static class XmlHelper - { - /// - /// Creates a new XLWorkbook based on the specified 'data'. - /// - /// - /// - /// - public static XLWorkbook ConvertToXLWorkbook(this DataTable data, string sheetName = "Sheet 1") - { - var wb = new XLWorkbook(); - wb.Worksheets.Add(data, sheetName); - - return wb; - } - } -} diff --git a/backend/core/Http/Configuration/AuthClientOptions.cs b/backend/core/Http/Configuration/AuthClientOptions.cs deleted file mode 100644 index 3b6db8a7a2..0000000000 --- a/backend/core/Http/Configuration/AuthClientOptions.cs +++ /dev/null @@ -1,58 +0,0 @@ -using Pims.Core.Exceptions; -using System; -using System.ComponentModel.DataAnnotations; - -namespace Pims.Core.Http.Configuration -{ - /// - /// OpenIdConnectOptions class, provides a way to configure Open ID Connect. - /// - public class AuthClientOptions - { - #region Properties - /// - /// get/set - The open id connect 'authority' URL. - /// - /// - [Required(ErrorMessage = "Configuration 'Authority' is required.")] - public string Authority { get; set; } - - /// - /// get/set - The open id connect 'audience'. - /// - /// - [Required(ErrorMessage = "Configuration 'Audience' is required.")] - public string Audience { get; set; } - - /// - /// get/set - The open id connect client 'secret'. - /// - /// - public string Secret { get; set; } - - /// - /// get/set - The open id connect 'client' id. - /// - /// - [Required(ErrorMessage = "Configuration 'Client' is required.")] - public string Client { get; set; } - public string FrontendClientId { get; set; } - #endregion - - #region Methods - /// - /// Validates the configuration for keycloak. - /// - /// If the configuration property is invald. - public virtual void Validate() - { - if (String.IsNullOrWhiteSpace(this.Authority)) - throw new ConfigurationException("The configuration for OpenIdConnect:Authority is invalid or missing."); - if (String.IsNullOrWhiteSpace(this.Audience)) - throw new ConfigurationException("The configuration for OpenIdConnect:Audience is invalid or missing."); - if (String.IsNullOrWhiteSpace(this.Client)) - throw new ConfigurationException("The configuration for OpenIdConnect:Client is invalid or missing."); - } - #endregion - } -} diff --git a/backend/core/Http/Configuration/OpenIdConnectOptions.cs b/backend/core/Http/Configuration/OpenIdConnectOptions.cs deleted file mode 100644 index ab0b46765d..0000000000 --- a/backend/core/Http/Configuration/OpenIdConnectOptions.cs +++ /dev/null @@ -1,64 +0,0 @@ -using Pims.Core.Exceptions; -using System; - -namespace Pims.Core.Http.Configuration -{ - /// - /// OpenIdConnectOptions class, provides a way to configure keycloak open id connect endpoints. - /// - public class OpenIdConnectOptions - { - #region Properties - /// - /// get/set - The login endpoint path. - /// - /// - public string Login { get; set; } - - /// - /// get/set - The logout endpoint path. - /// - /// - public string Logout { get; set; } - - /// - /// get/set - The register endpoint path. - /// - /// - public string Register { get; set; } - - /// - /// get/set - The token endpoint path. - /// - /// - public string Token { get; set; } - - /// - /// get/set - The token introspect path. - /// - /// - public string TokenIntrospect { get; set; } - - /// - /// get/set - the user info path. - /// - /// - public string UserInfo { get; set; } - #endregion - - #region Methods - /// - /// Validate the configuration. - /// - /// The configuration is missing or invalid. - public virtual void Validate() - { - if (String.IsNullOrWhiteSpace(this.Token)) - throw new ConfigurationException("The configuration for Keycloak:OpenIdConnect:Token is invalid or missing."); - - if (String.IsNullOrWhiteSpace(this.UserInfo)) - throw new ConfigurationException("The configuration for Keycloak:OpenIdConnect:UserInfo is invalid or missing."); - } - #endregion - } -} diff --git a/backend/core/Http/HttpRequestClient.cs b/backend/core/Http/HttpRequestClient.cs deleted file mode 100644 index 8085f2581e..0000000000 --- a/backend/core/Http/HttpRequestClient.cs +++ /dev/null @@ -1,692 +0,0 @@ -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Pims.Core.Exceptions; -using System; -using System.Net.Http; -using System.Net.Http.Headers; -using System.Text; -using System.Text.Json; -using System.Text.Json.Serialization; -using System.Threading.Tasks; - -namespace Pims.Core.Http -{ - /// - /// HttpRequestClient class, provides a generic way to make HTTP requests to other services. - /// - public class HttpRequestClient : IHttpRequestClient - { - #region Variables - private readonly JsonSerializerOptions _serializeOptions; - private readonly ILogger _logger; - #endregion - - #region Properties - /// - /// get - The HttpClient use to make requests. - /// - public HttpClient Client { get; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a HttpRequestClient class, initializes it with the specified arguments. - /// - /// - /// - /// - public HttpRequestClient(IHttpClientFactory clientFactory, IOptionsMonitor options, ILogger logger) - { - this.Client = clientFactory.CreateClient(); - _serializeOptions = options?.CurrentValue ?? new JsonSerializerOptions() - { - PropertyNameCaseInsensitive = true, - PropertyNamingPolicy = JsonNamingPolicy.CamelCase, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull - }; - _logger = logger; - } - #endregion - - #region Methods - /// - /// Dispose the HttpClient. - /// - public void Dispose() - { - this.Client.Dispose(); - } - - /// - /// Deserialize the specified 'response' into the specified type of 'TModel'. - /// - /// - /// - /// - public async Task DeserializeAsync(HttpResponseMessage response) - { - var data = await response.Content.ReadAsByteArrayAsync(); - var contentType = response.Content.Headers.ContentType; - try - { - if (contentType.MediaType.Contains("json", StringComparison.InvariantCultureIgnoreCase)) - return JsonSerializer.Deserialize(data, _serializeOptions); - } - catch (Exception ex) - { - var body = Encoding.Default.GetString(data); - _logger.LogError(ex, $"Failed to deserialize response: {body}"); - throw; - } - - throw new HttpClientRequestException(response, $"Response must contain JSON but was '{contentType.MediaType}'."); - } - - #region HttpResponseMessage Methods - /// - /// Send an HTTP request to the specified 'url'. - /// - /// - /// - /// - /// - public virtual async Task SendJsonAsync(string url, HttpMethod method = null, T data = null) - where T : class - { - return await SendJsonAsync(url, method, null, data); - } - - /// - /// Send an HTTP request to the specified 'url'. - /// - /// - /// - /// - /// - public virtual async Task SendAsync(string url, HttpMethod method = null, HttpContent content = null) - { - return await SendAsync(url, method, null, content); - } - - /// - /// Send an HTTP request to the specified 'url'. - /// - /// - /// - /// - /// - /// - public virtual async Task SendJsonAsync(string url, HttpMethod method, HttpRequestHeaders headers, T data = null) - where T : class - { - HttpContent content = null; - - if (data != null) - { - var json = JsonSerializer.Serialize(data, _serializeOptions); - content = new StringContent(json, Encoding.UTF8, "application/json"); - } - - return await SendAsync(url, method, headers, content); - } - - /// - /// Send an HTTP request to the specified 'url'. - /// - /// - /// - /// - /// - /// - public virtual async Task SendAsync(string url, HttpMethod method, HttpRequestHeaders headers, HttpContent content = null) - { - if (String.IsNullOrWhiteSpace(url)) throw new ArgumentException($"Argument '{nameof(url)}' must be a valid URL."); - - if (method == null) method = HttpMethod.Get; - - var message = new HttpRequestMessage(method, url); - message.Headers.Add("User-Agent", "Pims.Api"); - message.Content = content; - - if (headers != null) - { - foreach (var header in headers) - { - message.Headers.Add(header.Key, header.Value); - } - } - - _logger.LogInformation($"HTTP request made '{message.RequestUri}'"); - return await this.Client.SendAsync(message); - } - - /// - /// GET request to the specified 'url'. - /// - /// - /// - public async Task GetAsync(string url) - { - return await SendAsync(url, HttpMethod.Get); - } - - /// - /// POST request to the specified 'url'. - /// - /// - /// - /// - public async Task PostJsonAsync(string url, T data = null) - where T : class - { - return await SendJsonAsync(url, HttpMethod.Post, data); - } - - /// - /// POST request to the specified 'url'. - /// - /// - /// - /// - public async Task PostAsync(string url, HttpContent content = null) - { - return await SendAsync(url, HttpMethod.Post, content); - } - - /// - /// PUT request to the specified 'url'. - /// - /// - /// - /// - public async Task PutJsonAsync(string url, T data = null) - where T : class - { - return await SendJsonAsync(url, HttpMethod.Put, data); - } - - /// - /// PUT request to the specified 'url'. - /// - /// - /// - /// - public async Task PutAsync(string url, HttpContent content = null) - { - return await SendAsync(url, HttpMethod.Put, content); - } - - /// - /// DELETE request to the specified 'url'. - /// - /// - /// - /// - public async Task DeleteJsonAsync(string url, T data = null) - where T : class - { - return await SendJsonAsync(url, HttpMethod.Delete, data); - } - - /// - /// DELETE request to the specified 'url'. - /// - /// - /// - /// - public async Task DeleteAsync(string url, HttpContent content = null) - { - return await SendAsync(url, HttpMethod.Delete, content); - } - - /// - /// Send an HTTP request to the specified 'uri'. - /// - /// - /// - /// - /// - public virtual async Task SendJsonAsync(Uri uri, HttpMethod method = null, T data = null) - where T : class - { - return await SendJsonAsync(uri, method, null, data); - } - - /// - /// Send an HTTP request to the specified 'uri'. - /// - /// - /// - /// - /// - public virtual async Task SendAsync(Uri uri, HttpMethod method = null, HttpContent content = null) - { - return await SendAsync(uri, method, null, content); - } - - /// - /// Send an HTTP request to the specified 'uri'. - /// - /// - /// - /// - /// - /// - public virtual async Task SendJsonAsync(Uri uri, HttpMethod method, HttpRequestHeaders headers, T data = null) - where T : class - { - return await SendJsonAsync(uri.OriginalString, method, headers, data); - } - - /// - /// Send an HTTP request to the specified 'uri'. - /// - /// - /// - /// - /// - /// - public virtual async Task SendAsync(Uri uri, HttpMethod method, HttpRequestHeaders headers, HttpContent content = null) - { - return await SendAsync(uri.OriginalString, method, headers, content); - } - - /// - /// GET request to the specified 'uri'. - /// - /// - /// - public async Task GetAsync(Uri uri) - { - return await SendAsync(uri, HttpMethod.Get); - } - - /// - /// POST request to the specified 'uri'. - /// - /// - /// - /// - public async Task PostJsonAsync(Uri uri, T data = null) - where T : class - { - return await SendJsonAsync(uri, HttpMethod.Post, data); - } - - /// - /// POST request to the specified 'uri'. - /// - /// - /// - /// - public async Task PostAsync(Uri uri, HttpContent content = null) - { - return await SendAsync(uri, HttpMethod.Post, content); - } - - /// - /// PUT request to the specified 'uri'. - /// - /// - /// - /// - public async Task PutJsonAsync(Uri uri, T data = null) - where T : class - { - return await SendJsonAsync(uri, HttpMethod.Put, data); - } - - /// - /// PUT request to the specified 'uri'. - /// - /// - /// - /// - public async Task PutAsync(Uri uri, HttpContent content = null) - { - return await SendAsync(uri, HttpMethod.Put, content); - } - - /// - /// DELETE request to the specified 'uri'. - /// - /// - /// - /// - public async Task DeleteJsonAsync(Uri uri, T data = null) - where T : class - { - return await SendJsonAsync(uri, HttpMethod.Delete, data); - } - - /// - /// DELETE request to the specified 'uri'. - /// - /// - /// - /// - public async Task DeleteAsync(Uri uri, HttpContent content = null) - { - return await SendAsync(uri, HttpMethod.Delete, content); - } - #endregion - - #region Serialization Methods - /// - /// Send an HTTP request to the specified 'url'. - /// - /// - /// - /// - /// - /// Response did not return a success status code. - /// - public virtual async Task SendJsonAsync(string url, HttpMethod method = null, T data = null, Func onError = null) - where T : class - { - return await SendJsonAsync(url, method, null, data, onError); - } - - /// - /// Send an HTTP request to the specified 'url'. - /// - /// - /// - /// - /// - /// Response did not return a success status code. - /// - public virtual async Task SendAsync(string url, HttpMethod method = null, HttpContent content = null, Func onError = null) - { - return await SendAsync(url, method, null, content, onError); - } - - /// - /// Send an HTTP request to the specified 'url'. - /// - /// - /// - /// - /// - /// - /// Response did not return a success status code. - /// - public virtual async Task SendJsonAsync(string url, HttpMethod method, HttpRequestHeaders headers, T data = null, Func onError = null) - where T : class - { - StringContent content = null; - - if (data != null) - { - var json = JsonSerializer.Serialize(data, _serializeOptions); - content = new StringContent(json, Encoding.UTF8, "application/json"); - } - - return await SendAsync(url, method, headers, content, onError); - } - - /// - /// Send an HTTP request to the specified 'url'. - /// - /// - /// - /// - /// - /// - /// Response did not return a success status code. - /// - public virtual async Task SendAsync(string url, HttpMethod method, HttpRequestHeaders headers, HttpContent content = null, Func onError = null) - { - var response = await SendAsync(url, method, headers, content); - - if (response.IsSuccessStatusCode) - { - return await DeserializeAsync(response); - } - - // If the error handle is not provided, or if it returns false throw an error. - if ((onError?.Invoke(response) ?? false) == false) - { - var error = new HttpClientRequestException(response); - _logger.LogError(error, error.Message); - throw error; - } - - return default; - } - - /// - /// GET request to the specified 'url'. - /// - /// - /// Response did not return a success status code. - /// - public async Task GetAsync(string url) - { - return await SendAsync(url, HttpMethod.Get); - } - - /// - /// POST request to the specified 'url'. - /// - /// - /// - /// Response did not return a success status code. - /// - public async Task PostJsonAsync(string url, T data = null) - where T : class - { - return await SendJsonAsync(url, HttpMethod.Post, data); - } - - /// - /// POST request to the specified 'url'. - /// - /// - /// - /// Response did not return a success status code. - /// - public async Task PostAsync(string url, HttpContent content = null) - { - return await SendAsync(url, HttpMethod.Post, content); - } - - /// - /// PUT request to the specified 'url'. - /// - /// - /// - /// Response did not return a success status code. - /// - public async Task PutJsonAsync(string url, T data = null) - where T : class - { - return await SendJsonAsync(url, HttpMethod.Put, data); - } - - /// - /// PUT request to the specified 'url'. - /// - /// - /// - /// Response did not return a success status code. - /// - public async Task PutAsync(string url, HttpContent content = null) - { - return await SendAsync(url, HttpMethod.Put, content); - } - - /// - /// DELETE request to the specified 'url'. - /// - /// - /// - /// Response did not return a success status code. - /// - public async Task DeleteJsonAsync(string url, T data = null) - where T : class - { - return await SendJsonAsync(url, HttpMethod.Delete, data); - } - - /// - /// DELETE request to the specified 'url'. - /// - /// - /// - /// Response did not return a success status code. - /// - public async Task DeleteAsync(string url, HttpContent content = null) - { - return await SendAsync(url, HttpMethod.Delete, content); - } - - /// - /// Send an HTTP request to the specified 'uri'. - /// - /// - /// - /// - /// - /// Response did not return a success status code. - /// - public virtual async Task SendJsonAsync(Uri uri, HttpMethod method = null, T data = null, Func onError = null) - where T : class - { - return await SendJsonAsync(uri, method, null, data, onError); - } - - /// - /// Send an HTTP request to the specified 'uri'. - /// - /// - /// - /// - /// - /// Response did not return a success status code. - /// - public virtual async Task SendAsync(Uri uri, HttpMethod method = null, HttpContent content = null, Func onError = null) - { - return await SendAsync(uri, method, null, content, onError); - } - - /// - /// Send an HTTP request to the specified 'uri'. - /// - /// - /// - /// - /// - /// - /// Response did not return a success status code. - /// - public virtual async Task SendJsonAsync(Uri uri, HttpMethod method, HttpRequestHeaders headers, T data = null, Func onError = null) - where T : class - { - return await SendJsonAsync(uri.OriginalString, method, headers, data, onError); - } - - /// - /// Send an HTTP request to the specified 'uri'. - /// - /// - /// - /// - /// - /// - /// Response did not return a success status code. - /// - public virtual async Task SendAsync(Uri uri, HttpMethod method, HttpRequestHeaders headers, HttpContent content = null, Func onError = null) - { - return await SendAsync(uri.OriginalString, method, headers, content, onError); - } - - /// - /// GET request to the specified 'uri'. - /// - /// - /// Response did not return a success status code. - /// - public async Task GetAsync(Uri uri) - { - return await SendAsync(uri, HttpMethod.Get); - } - - /// - /// POST request to the specified 'uri'. - /// - /// - /// - /// Response did not return a success status code. - /// - public async Task PostJsonAsync(Uri uri, T data = null) - where T : class - { - return await SendJsonAsync(uri, HttpMethod.Post, data); - } - - /// - /// POST request to the specified 'uri'. - /// - /// - /// - /// Response did not return a success status code. - /// - public async Task PostAsync(Uri uri, HttpContent content = null) - { - return await SendAsync(uri, HttpMethod.Post, content); - } - - /// - /// PUT request to the specified 'uri'. - /// - /// - /// - /// Response did not return a success status code. - /// - public async Task PutJsonAsync(Uri uri, T data = null) - where T : class - { - return await SendJsonAsync(uri, HttpMethod.Put, data); - } - - /// - /// PUT request to the specified 'uri'. - /// - /// - /// - /// Response did not return a success status code. - /// - public async Task PutAsync(Uri uri, HttpContent content = null) - { - return await SendAsync(uri, HttpMethod.Put, content); - } - - /// - /// DELETE request to the specified 'uri'. - /// - /// - /// - /// Response did not return a success status code. - /// - public async Task DeleteJsonAsync(Uri uri, T data = null) - where T : class - { - return await SendJsonAsync(uri, HttpMethod.Delete, data); - } - - /// - /// DELETE request to the specified 'uri'. - /// - /// - /// - /// Response did not return a success status code. - /// - public async Task DeleteAsync(Uri uri, HttpContent content = null) - { - return await SendAsync(uri, HttpMethod.Delete, content); - } - #endregion - #endregion - } -} diff --git a/backend/core/Http/IHttpRequestClient.cs b/backend/core/Http/IHttpRequestClient.cs deleted file mode 100644 index 5a66644603..0000000000 --- a/backend/core/Http/IHttpRequestClient.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using System.Net.Http; -using System.Net.Http.Headers; -using System.Threading.Tasks; - -namespace Pims.Core.Http -{ - public interface IHttpRequestClient : IDisposable - { - HttpClient Client { get; } - Task DeserializeAsync(HttpResponseMessage response); - - Task SendJsonAsync(string url, HttpMethod method = null, T data = null) where T : class; - Task SendJsonAsync(string url, HttpMethod method, HttpRequestHeaders headers, T data = null) where T : class; - Task PostJsonAsync(string url, T data = null) where T : class; - Task PutJsonAsync(string url, T data = null) where T : class; - Task DeleteJsonAsync(string url, T data = null) where T : class; - - Task SendAsync(string url, HttpMethod method = null, HttpContent content = null); - Task SendAsync(string url, HttpMethod method, HttpRequestHeaders headers, HttpContent content = null); - Task GetAsync(string url); - Task PostAsync(string url, HttpContent content = null); - Task PutAsync(string url, HttpContent content = null); - Task DeleteAsync(string url, HttpContent content = null); - - Task SendJsonAsync(Uri url, HttpMethod method = null, T data = null) where T : class; - Task SendJsonAsync(Uri url, HttpMethod method, HttpRequestHeaders headers, T data = null) where T : class; - Task PostJsonAsync(Uri url, T data = null) where T : class; - Task PutJsonAsync(Uri url, T data = null) where T : class; - Task DeleteJsonAsync(Uri url, T data = null) where T : class; - - Task SendAsync(Uri url, HttpMethod method = null, HttpContent content = null); - Task SendAsync(Uri url, HttpMethod method, HttpRequestHeaders headers, HttpContent content = null); - Task GetAsync(Uri url); - Task PostAsync(Uri url, HttpContent content = null); - Task PutAsync(Uri url, HttpContent content = null); - Task DeleteAsync(Uri url, HttpContent content = null); - - Task SendJsonAsync(string url, HttpMethod method = null, T data = null, Func onError = null) where T : class; - Task SendJsonAsync(string url, HttpMethod method, HttpRequestHeaders headers, T data = null, Func onError = null) where T : class; - Task PostJsonAsync(string url, T data = null) where T : class; - Task PutJsonAsync(string url, T data = null) where T : class; - Task DeleteJsonAsync(string url, T data = null) where T : class; - - Task SendAsync(string url, HttpMethod method = null, HttpContent content = null, Func onError = null); - Task SendAsync(string url, HttpMethod method, HttpRequestHeaders headers, HttpContent content = null, Func onError = null); - Task GetAsync(string url); - Task PostAsync(string url, HttpContent content = null); - Task PutAsync(string url, HttpContent content = null); - Task DeleteAsync(string url, HttpContent content = null); - - Task SendJsonAsync(Uri url, HttpMethod method = null, T data = null, Func onError = null) where T : class; - Task SendJsonAsync(Uri url, HttpMethod method, HttpRequestHeaders headers, T data = null, Func onError = null) where T : class; - Task PostJsonAsync(Uri url, T data = null) where T : class; - Task PutJsonAsync(Uri url, T data = null) where T : class; - Task DeleteJsonAsync(Uri url, T data = null) where T : class; - - Task SendAsync(Uri url, HttpMethod method = null, HttpContent content = null, Func onError = null); - Task SendAsync(Uri url, HttpMethod method, HttpRequestHeaders headers, HttpContent content = null, Func onError = null); - Task GetAsync(Uri url); - Task PostAsync(Uri url, HttpContent content = null); - Task PutAsync(Uri url, HttpContent content = null); - Task DeleteAsync(Uri url, HttpContent content = null); - } -} diff --git a/backend/core/Http/IOpenIdConnectRequestClient.cs b/backend/core/Http/IOpenIdConnectRequestClient.cs deleted file mode 100644 index bab75331fa..0000000000 --- a/backend/core/Http/IOpenIdConnectRequestClient.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Pims.Core.Http.Configuration; -using System.Net.Http; -using System.Threading.Tasks; - -namespace Pims.Core.Http -{ - public interface IOpenIdConnectRequestClient : IHttpRequestClient - { - AuthClientOptions AuthClientOptions { get; } - OpenIdConnectOptions OpenIdConnectOptions { get; } - Task GetOpenIdConnectEndpoints(); - Task RequestAccessToken(); - Task RequestToken(); - Task RefreshToken(string refreshToken); - } -} diff --git a/backend/core/Http/IProxyRequestClient.cs b/backend/core/Http/IProxyRequestClient.cs deleted file mode 100644 index 6b63bc7b79..0000000000 --- a/backend/core/Http/IProxyRequestClient.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Microsoft.AspNetCore.Http; -using System; -using System.Net.Http; -using System.Threading.Tasks; - -namespace Pims.Core.Http -{ - public interface IProxyRequestClient : IDisposable - { - Task ProxySendAsync(HttpRequest request, string url, HttpMethod method = null, HttpContent content = null); - Task ProxyGetAsync(HttpRequest request, string url); - Task ProxyPostAsync(HttpRequest request, string url, HttpContent content = null); - Task ProxyPutAsync(HttpRequest request, string url, HttpContent content = null); - Task ProxyDeleteAsync(HttpRequest request, string url, HttpContent content = null); - } -} diff --git a/backend/core/Http/Models/LtsaOrderModel.cs b/backend/core/Http/Models/LtsaOrderModel.cs deleted file mode 100644 index 668de5b2ee..0000000000 --- a/backend/core/Http/Models/LtsaOrderModel.cs +++ /dev/null @@ -1,237 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text.Json.Serialization; - -namespace Pims.Core.Http.Models -{ - public class LtsaOrderModel - { - [JsonPropertyName("order")] - public LtsaOrder Order { get; set; } - } - - public class LtsaOrder - { - [JsonPropertyName("productType")] - public string ProductType { get; set; } - - [JsonPropertyName("fileReference")] - public string FileReference { get; set; } - - [JsonPropertyName("productOrderParameters")] - public LtsaProductOrderParameters ProductOrderParameters { get; set; } - - [JsonPropertyName("orderId")] - public Guid OrderId { get; set; } - - [JsonPropertyName("status")] - public string Status { get; set; } - - [JsonPropertyName("billingInfo")] - public LtsaBillingInfo BillingInfo { get; set; } - - [JsonPropertyName("orderedProduct")] - public LtsaOrderedProduct OrderedProduct { get; set; } - } - - public class LtsaProductOrderParameters - { - [JsonPropertyName("titleNumber")] - public string TitleNumber { get; set; } - - [JsonPropertyName("landTitleDistrictCode")] - public string LandTitleDistrictCode { get; set; } - - [JsonPropertyName("includeCancelledInfo")] - public bool IncludeCancelledInfo { get; set; } - } - - public class LtsaBillingInfo - { - [JsonPropertyName("billingModel")] - public string BillingModel { get; set; } - - [JsonPropertyName("productName")] - public string ProductName { get; set; } - - [JsonPropertyName("productCode")] - public string ProductCode { get; set; } - - [JsonPropertyName("feeExempted")] - public bool FeeExempted { get; set; } - - [JsonPropertyName("productFee")] - public decimal ProductFee { get; set; } - - [JsonPropertyName("serviceCharge")] - public double ServiceCharge { get; set; } - - [JsonPropertyName("subtotalFee")] - public double SubtotalFee { get; set; } - - [JsonPropertyName("productFeeTax")] - public int ProductFeeTax { get; set; } - - [JsonPropertyName("serviceChargeTax")] - public double ServiceChargeTax { get; set; } - - [JsonPropertyName("totalTax")] - public double TotalTax { get; set; } - - [JsonPropertyName("totalFee")] - public double TotalFee { get; set; } - } - - public class LtsaOrderedProduct - { - [JsonPropertyName("fieldedData")] - public LtsaFieldedData FieldedData { get; set; } - } - - public class LtsaFieldedData - { - [JsonPropertyName("titleStatus")] - public string TitleStatus { get; set; } - - [JsonPropertyName("titleIdentifier")] - public LtsaTitleIdentifier TitleIdentifier { get; set; } - - [JsonPropertyName("tombstone")] - public LtsaTombstone Tombstone { get; set; } - - [JsonPropertyName("ownershipGroups")] - public List OwnershipGroups { get; set; } - - [JsonPropertyName("taxAuthorities")] - public List TaxAuthorities { get; set; } - - [JsonPropertyName("descriptionsOfLand")] - public List DescriptionsOfLand { get; set; } - - [JsonPropertyName("legalNotationsOnTitle")] - public List LegalNotationsOnTitle { get; set; } - - [JsonPropertyName("duplicateCertificatesOfTitle")] - public List DuplicateCertificatesOfTitle { get; set; } - - [JsonPropertyName("titleTransfersOrDispositions")] - public List TitleTransfersOrDispositions { get; set; } - } - - public class LtsaTitleIdentifier - { - [JsonPropertyName("titleNumber")] - public string TitleNumber { get; set; } - - [JsonPropertyName("landTitleDistrict")] - public string LandTitleDistrict { get; set; } - } - - public class LtsaTombstone - { - [JsonPropertyName("applicationReceivedDate")] - public DateTime ApplicationReceivedDate { get; set; } - - [JsonPropertyName("enteredDate")] - public DateTime EnteredDate { get; set; } - - [JsonPropertyName("titleRemarks")] - public string TitleRemarks { get; set; } - - [JsonPropertyName("rootOfTitle")] - public string RootOfTitle { get; set; } - - [JsonPropertyName("marketValueAmount")] - public string MarketValueAmount { get; set; } - - [JsonPropertyName("fromTitles")] - public List FromTitles { get; set; } - - [JsonPropertyName("natureOfTransfers")] - public List NatureOfTransfers { get; set; } - } - - public class LtsaNatureOfTransfer - { - [JsonPropertyName("transferReason")] - public string TransferReason { get; set; } - } - - public class LtsaOwnershipGroup - { - [JsonPropertyName("jointTenancyIndication")] - public bool JointTenancyIndication { get; set; } - - [JsonPropertyName("interestFractionNumerator")] - public string InterestFractionNumerator { get; set; } - - [JsonPropertyName("interestFractionDenominator")] - public string InterestFractionDenominator { get; set; } - - [JsonPropertyName("ownershipRemarks")] - public string OwnershipRemarks { get; set; } - - [JsonPropertyName("titleOwners")] - public List TitleOwners { get; set; } - } - - public class LtsaTitleOwner - { - [JsonPropertyName("lastNameOrCorpName1")] - public string LastNameOrCorpName1 { get; set; } - - [JsonPropertyName("givenName")] - public string GivenName { get; set; } - - [JsonPropertyName("incorporationNumber")] - public string IncorporationNumber { get; set; } - - [JsonPropertyName("occupationDescription")] - public string OccupationDescription { get; set; } - - [JsonPropertyName("address")] - public LtsaAddress Address { get; set; } - } - - public class LtsaAddress - { - [JsonPropertyName("addressLine1")] - public string AddressLine1 { get; set; } - - [JsonPropertyName("addressLine2")] - public string AddressLine2 { get; set; } - - [JsonPropertyName("city")] - public string City { get; set; } - - [JsonPropertyName("province")] - public string Province { get; set; } - - [JsonPropertyName("provinceName")] - public string ProvinceName { get; set; } - - [JsonPropertyName("country")] - public string Country { get; set; } - - [JsonPropertyName("postalCode")] - public string PostalCode { get; set; } - } - - public class LtsaTaxAuthority - { - [JsonPropertyName("authorityName")] - public string AuthorityName { get; set; } - } - - public class LtsaDescriptionOfLand - { - [JsonPropertyName("parcelIdentifier")] - public string ParcelIdentifier { get; set; } - - [JsonPropertyName("fullLegalDescription")] - public string FullLegalDescription { get; set; } - - [JsonPropertyName("parcelStatus")] - public string ParcelStatus { get; set; } - } -} diff --git a/backend/core/Http/Models/LtsaTitleSummaryModel.cs b/backend/core/Http/Models/LtsaTitleSummaryModel.cs deleted file mode 100644 index ef6eebead3..0000000000 --- a/backend/core/Http/Models/LtsaTitleSummaryModel.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.Collections.Generic; -using System.Text.Json.Serialization; - -namespace Pims.Core.Http.Models -{ - /// - /// Represents the response structure for LTSA Title summaries. - /// - public class LtsaTitleSummaryResponse - { - /// - /// Gets or sets the list of title summaries. - /// - [JsonPropertyName("titleSummaries")] - public List TitleSummaries { get; set; } - } - - /// - /// Represents a single LTSA Title summary. - /// - public class LtsaTitleSummaryModel - { - /// - /// Gets or sets the title number. - /// - [JsonPropertyName("titleNumber")] - public string TitleNumber { get; set; } - - /// - /// Gets or sets the land title district code. - /// - [JsonPropertyName("landTitleDistrictCode")] - public string LandTitleDistrictCode { get; set; } - - /// - /// Gets or sets the parcel identifier. - /// - [JsonPropertyName("parcelIdentifier")] - public string ParcelIdentifier { get; set; } - - /// - /// Gets or sets the status. - /// - [JsonPropertyName("status")] - public string Status { get; set; } - - /// - /// Gets or sets the first owner. - /// - [JsonPropertyName("firstOwner")] - public string FirstOwner { get; set; } - } -} diff --git a/backend/core/Http/Models/LtsaTokenModel.cs b/backend/core/Http/Models/LtsaTokenModel.cs deleted file mode 100644 index 310561bf0a..0000000000 --- a/backend/core/Http/Models/LtsaTokenModel.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Pims.Core.Http.Models -{ - /// - /// LtsaTokenModel class, provides a model that represents a response for requesting an LTSA access token. - /// - public class LtsaTokenModel - { - #region Properties - /// - /// get/set - The access token. - /// - [JsonPropertyName("accessToken")] - public string AccessToken { get; set; } - - /// - /// get/set - The refresh token. - /// - [JsonPropertyName("refreshToken")] - public string RefreshToken { get; set; } - #endregion - } -} diff --git a/backend/core/Http/Models/OpenIdConnectModel.cs b/backend/core/Http/Models/OpenIdConnectModel.cs deleted file mode 100644 index 2e96bb6fc7..0000000000 --- a/backend/core/Http/Models/OpenIdConnectModel.cs +++ /dev/null @@ -1,76 +0,0 @@ -namespace Pims.Core.Http.Models -{ - /// - /// OpenIdConnectModel class, provides a model to represent the open Id connect information. - /// - public class OpenIdConnectModel - { - #region Properties - /// - /// get/set - The issuer of the token. - /// - /// - public string Issuer { get; set; } - - /// - /// get/set - The authorization endpoint URL. - /// - /// - public string Authorization_endpoint { get; set; } - - /// - /// get/set - The token endpoint URL. - /// - /// - public string Token_endpoint { get; set; } - - /// - /// get/set - The user info endpoint URL. - /// - /// - public string Userinfo_endpoint { get; set; } - - /// - /// get/set - The logout endpoint URL. - /// - /// - public string End_session_endpoint { get; set; } - - /// - /// get/set - The JWKS URI. - /// - /// - public string Jwks_uri { get; set; } - - /// - /// get/set - An array of grant types supported. - /// - /// - public string[] Grant_types_supported { get; set; } - - /// - /// get/set - An array of response types supported. - /// - /// - public string[] Response_types_supported { get; set; } - - /// - /// get/set - An array of subject types supported. - /// - /// - public string[] Subject_types_supported { get; set; } - - /// - /// get/set - An array of Id token signing algorythims supported. - /// - /// - public string[] Id_token_signing_alg_values_supported { get; set; } - - /// - /// get/set - An array of response modes supported. - /// - /// - public string[] Response_modes_supported { get; set; } - #endregion - } -} diff --git a/backend/core/Http/Models/TokenModel.cs b/backend/core/Http/Models/TokenModel.cs deleted file mode 100644 index ee129d7b65..0000000000 --- a/backend/core/Http/Models/TokenModel.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Text.Json.Serialization; - -namespace Pims.Core.Http.Models -{ - /// - /// TokenModel class, provides a model that represents a response for requesting an access token. - /// - public class TokenModel - { - #region Properties - /// - /// get/set - The access token. - /// - [JsonPropertyName("access_token")] - public string AccessToken { get; set; } - - /// - /// get/set - When the access token expires. - /// - [JsonPropertyName("expires_in")] - public int ExpiresIn { get; set; } - - /// - /// get/set - When the refresh token expires. - /// - [JsonPropertyName("refresh_expires_in")] - public int RefreshExpiresIn { get; set; } - - /// - /// get/set - The refresh token. - /// - [JsonPropertyName("refresh_token")] - public string RefreshToken { get; set; } - - /// - /// get/set - The access token type. - /// - [JsonPropertyName("token_type")] - public string TokenType { get; set; } - - /// - /// get/set - The session state ID. - /// - [JsonPropertyName("session_state")] - public Guid SessionState { get; set; } - - /// - /// get/set - The scope of the token. - /// - public string Scope { get; set; } - #endregion - } -} diff --git a/backend/core/Http/OpenIdConnectRequestClient.cs b/backend/core/Http/OpenIdConnectRequestClient.cs deleted file mode 100644 index 462de0ee59..0000000000 --- a/backend/core/Http/OpenIdConnectRequestClient.cs +++ /dev/null @@ -1,255 +0,0 @@ -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Pims.Core.Exceptions; -using Pims.Core.Extensions; -using Pims.Core.Http.Configuration; -using System; -using System.Collections.Generic; -using System.IdentityModel.Tokens.Jwt; -using System.Net.Http; -using System.Net.Http.Headers; -using System.Text.Json; -using System.Threading.Tasks; - -namespace Pims.Core.Http -{ - /// - /// OpenIdConnectRequestClient class, provides a common structure to make requests to an OpenIdConnect server. - /// - public class OpenIdConnectRequestClient : HttpRequestClient, IOpenIdConnectRequestClient - { - #region Variables - public Models.TokenModel _accessToken = null; - private readonly JwtSecurityTokenHandler _tokenHandler; - #endregion - - #region Properties - /// - /// get - The configuration options. - /// - public AuthClientOptions AuthClientOptions { get; } - /// - /// get - The configuration options. - /// - public OpenIdConnectOptions OpenIdConnectOptions { get; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a KeycloakRequestClient class, initializes it with the specified arguments. - /// - /// - /// - /// - /// - /// - /// - public OpenIdConnectRequestClient( - IHttpClientFactory clientFactory, - JwtSecurityTokenHandler tokenHandler, - IOptionsMonitor authClientOptions, - IOptionsMonitor openIdConnectOptions, - IOptionsMonitor serializerOptions, - ILogger logger) - : base(clientFactory, serializerOptions, logger) - { - this.AuthClientOptions = authClientOptions.CurrentValue; - this.OpenIdConnectOptions = openIdConnectOptions.CurrentValue; - _tokenHandler = tokenHandler; - } - #endregion - - #region Methods - /// - /// Make a request to fetch the OpenIdConnect endpoints. - /// - /// - public async Task GetOpenIdConnectEndpoints() - { - var authority = this.AuthClientOptions.Authority ?? - throw new ConfigurationException($"Configuration 'OpenIdConnect:Authority' is missing or invalid."); - - var response = await this.Client.GetAsync($"{authority}/.well-known/openid-configuration"); - - if (response.IsSuccessStatusCode) - { - using var responseStream = await response.Content.ReadAsStreamAsync(); - return await responseStream.DeserializeAsync(); - } - else - { - throw new HttpClientRequestException(response); - } - } - - /// - /// Make a request to the OpenIdConnect token endpoint as the Service Account to fetch the 'access_token'. - /// This requires configuration of the following keys. - /// OpenIdConnect:Authority - /// OpenIdConnect:Client - /// OpenIdConnect:Secret - /// OpenIdConnect:Audience - /// - /// If the request fails. - /// - public async Task RequestAccessToken() - { - HttpResponseMessage response; - if (_accessToken == null || String.IsNullOrWhiteSpace(_accessToken.AccessToken) || (!String.IsNullOrWhiteSpace(_accessToken.RefreshToken) && _tokenHandler.ReadJwtToken(_accessToken.RefreshToken).ValidTo <= DateTime.UtcNow)) - { - // If there is no access token, or the refresh token has expired. - response = await RequestToken(); - } - else if (_accessToken != null - && !String.IsNullOrWhiteSpace(_accessToken.AccessToken) - && _tokenHandler.ReadJwtToken(_accessToken.AccessToken).ValidTo <= DateTime.UtcNow - && !String.IsNullOrWhiteSpace(_accessToken.RefreshToken) - && _tokenHandler.ReadJwtToken(_accessToken.RefreshToken).ValidTo > DateTime.UtcNow) - { - // If the access token has expired, but not the refresh token has not expired. - response = await RefreshToken(_accessToken.RefreshToken); - } - else - { - // We have a valid token, keep on using it. - return $"Bearer {_accessToken.AccessToken}"; // NOSONAR - } - - // Extract the JWT token to use when making the request. - if (response.IsSuccessStatusCode) - { - using var responseStream = await response.Content.ReadAsStreamAsync(); - _accessToken = await responseStream.DeserializeAsync(); - return $"Bearer {_accessToken.AccessToken}"; - } - else - { - throw new HttpClientRequestException(response); - } - } - - #region Service Account Requests - /// - /// Make a request to the OpenIdConnect token endpoint as the Service Account. - /// This requires configuration of the following keys. - /// OpenIdConnect:Authority - /// OpenIdConnect:Client - /// OpenIdConnect:Secret - /// OpenIdConnect:Audience - /// - /// - public async Task RequestToken() - { - var authority = this.AuthClientOptions.Authority ?? - throw new ConfigurationException($"Configuration 'OpenIdConnect:Authority' is missing or invalid."); - var client = this.AuthClientOptions.Client ?? - throw new ConfigurationException($"Configuration 'OpenIdConnect:Client' is missing or invalid."); - var clientSecret = this.AuthClientOptions.Secret ?? - throw new ConfigurationException($"Configuration 'OpenIdConnect:Secret' is missing or invalid."); - var audience = this.AuthClientOptions.Audience ?? - throw new ConfigurationException($"Configuration 'OpenIdConnect:Audience' is missing or invalid."); - // Use the configuration settings if available, or make a request to Keycloak for the appropriate endpoint URL. - var keycloakTokenUrl = this.OpenIdConnectOptions.Token; - if (String.IsNullOrWhiteSpace(keycloakTokenUrl)) - { - var endpoints = await GetOpenIdConnectEndpoints(); - keycloakTokenUrl = endpoints.Token_endpoint; - } - else if (!keycloakTokenUrl.StartsWith("http")) - { - keycloakTokenUrl = $"{authority}{keycloakTokenUrl}"; - } - - using var tokenMessage = new HttpRequestMessage(HttpMethod.Post, keycloakTokenUrl); - var p = new Dictionary - { { "client_id", client }, - { "grant_type", "client_credentials" }, - { "client_secret", clientSecret }, - { "audience", audience } - }; - var form = new FormUrlEncodedContent(p); - form.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/x-www-form-urlencoded"); - tokenMessage.Content = form; - return await this.Client.SendAsync(tokenMessage); - } - - /// - /// Refresh the access token via the specified 'refreshToken'. - /// - /// - /// - public async Task RefreshToken(string refreshToken) - { - var authority = this.AuthClientOptions.Authority ?? - throw new ConfigurationException($"Configuration 'OpenIdConnect:Authority' is missing or invalid."); - var client = this.AuthClientOptions.Client ?? - throw new ConfigurationException($"Configuration 'OpenIdConnect:Client' is missing or invalid."); - var clientSecret = this.AuthClientOptions.Secret ?? - throw new ConfigurationException($"Configuration 'OpenIdConnect:Secret' is missing or invalid."); - - // Use the configuration settings if available, or make a request to Keycloak for the appropriate endpoint URL. - var keycloakTokenUrl = this.OpenIdConnectOptions.Token; - if (String.IsNullOrWhiteSpace(keycloakTokenUrl)) - { - var endpoints = await GetOpenIdConnectEndpoints(); - keycloakTokenUrl = endpoints.Token_endpoint; - } - else if (!keycloakTokenUrl.StartsWith("http")) - { - keycloakTokenUrl = $"{authority}{keycloakTokenUrl}"; - } - - using var tokenMessage = new HttpRequestMessage(HttpMethod.Post, keycloakTokenUrl); - var p = new Dictionary - { { "client_id", client }, - { "grant_type", "refresh_token" }, - { "client_secret", clientSecret }, - { "refresh_token", refreshToken } - }; - var form = new FormUrlEncodedContent(p); - form.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/x-www-form-urlencoded"); - tokenMessage.Content = form; - return await this.Client.SendAsync(tokenMessage); - } - #endregion - - #region Send Methods - /// - /// Make a request to the specified 'url', with the specified HTTP 'method', with the specified 'content'. - /// Make a request to the open id connect server for an authentication token if required. - /// - /// - /// - /// - /// - public override async Task SendAsync(string url, HttpMethod method, HttpContent content = null) - { - return await SendAsync(url, method, new HttpRequestMessage().Headers, content); - } - - /// - /// Make a request to the specified 'url', with the specified HTTP 'method', with the specified 'content'. - /// Make a request to the open id connect server for an authentication token if required. - /// - /// - /// - /// - /// - /// - public override async Task SendAsync(string url, HttpMethod method, HttpRequestHeaders headers, HttpContent content = null) - { - if (String.IsNullOrWhiteSpace(url)) throw new ArgumentException($"Argument '{nameof(url)}' must be a valid URL."); - method ??= HttpMethod.Get; - headers ??= new HttpRequestMessage().Headers; - - var token = await RequestAccessToken(); - - if (!String.IsNullOrWhiteSpace(token)) headers.Add("Authorization", token.ToString()); - - return await base.SendAsync(url, method, headers, content); - - } - #endregion - #endregion - } -} diff --git a/backend/core/Http/ProxyRequestClient.cs b/backend/core/Http/ProxyRequestClient.cs deleted file mode 100644 index c681bd6431..0000000000 --- a/backend/core/Http/ProxyRequestClient.cs +++ /dev/null @@ -1,116 +0,0 @@ -using Microsoft.AspNetCore.Http; -using System; -using System.Net.Http; -using System.Threading.Tasks; - -namespace Pims.Core.Http -{ - public class ProxyRequestClient : IProxyRequestClient - { - #region Properties - /// - /// get/set - The HttpClient use to make requests. - /// - protected HttpClient Client { get; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a ProxyRequestClient class, initializes it with the specified arguments. - /// - /// - public ProxyRequestClient(IHttpClientFactory clientFactory) - { - this.Client = clientFactory.CreateClient(); - } - #endregion - - #region Methods - /// - /// Dispose the HttpClient. - /// - public void Dispose() - { - this.Client.Dispose(); - } - - #region Proxy Methods - /// - /// Proxy the request on behalf of the original requestor to the specified 'url'. - /// - /// - /// - /// - /// - /// - public virtual async Task ProxySendAsync(HttpRequest request, string url, HttpMethod method = null, HttpContent content = null) - { - if (request == null) throw new ArgumentNullException(nameof(request)); - if (String.IsNullOrWhiteSpace(url)) throw new ArgumentException($"Argument '{nameof(url)}' must be a valid URL."); - - // Extract the original requests authorization token. - var token = request.Headers["Authorization"]; - if (method == null) method = HttpMethod.Get; - - var message = new HttpRequestMessage(method, url); - if (!String.IsNullOrWhiteSpace(token)) message.Headers.Add("Authorization", token.ToString()); - message.Headers.Add("X-Forwarded-For", request.Host.Value); - message.Headers.Add("X-Forwarded-Proto", request.Scheme); - message.Headers.Add("ProxyPreserveHost", "On"); - message.Headers.Add("User-Agent", "Pims.Api"); - message.Content = content; - - return await this.Client.SendAsync(message); - } - - /// - /// Proxy a GET request to the specified 'url'. - /// This will use the original requests Authorization token in the server request. - /// - /// - /// - /// - public async Task ProxyGetAsync(HttpRequest request, string url) - { - return await ProxySendAsync(request, url, HttpMethod.Get); - } - - /// - /// Proxy a POST request to the specified 'url'. - /// This will use the original requests Authorization token in the server request. - /// - /// - /// - /// - public async Task ProxyPostAsync(HttpRequest request, string url, HttpContent content = null) - { - return await ProxySendAsync(request, url, HttpMethod.Post, content); - } - - /// - /// Proxy a PUT request to the specified 'url'. - /// This will use the original requests Authorization token in the server request. - /// - /// - /// - /// - public async Task ProxyPutAsync(HttpRequest request, string url, HttpContent content = null) - { - return await ProxySendAsync(request, url, HttpMethod.Put, content); - } - - /// - /// Proxy a DELETE request to the specified 'url'. - /// This will use the original requests Authorization token in the server request. - /// - /// - /// - /// - public async Task ProxyDeleteAsync(HttpRequest request, string url, HttpContent content = null) - { - return await ProxySendAsync(request, url, HttpMethod.Delete, content); - } - #endregion - #endregion - } -} diff --git a/backend/core/Json/EnumValueAttribute.cs b/backend/core/Json/EnumValueAttribute.cs deleted file mode 100644 index 814e2a69e2..0000000000 --- a/backend/core/Json/EnumValueAttribute.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; - -namespace Pims.Core.Json -{ - /// - /// EnumValueAttribute class, provides a way to specify the text value of an enum value. - /// - [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] - public class EnumValueAttribute : Attribute - { - #region Properties - /// - /// get/set - The value that should be used when serialized. - /// - public string Value { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of an EnumValueAttribute, initializes it with the specified arguments. - /// - /// - public EnumValueAttribute(string value) - { - this.Value = value; - } - #endregion - } -} diff --git a/backend/core/Pims.Core.csproj b/backend/core/Pims.Core.csproj deleted file mode 100644 index cbf33cdda2..0000000000 --- a/backend/core/Pims.Core.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - net7.0 - Library - 1.0.0.0 - 1.0.0.0 - AC8F04FF-3164-41FB-9EDF-E468B8B77837 - Debug;Release - - - - - - - - - - - diff --git a/backend/core/Properties/launchSettings.json b/backend/core/Properties/launchSettings.json deleted file mode 100644 index 3d7b366afe..0000000000 --- a/backend/core/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:16003/", - "sslPort": 44309 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Pims.Core": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "https://localhost:5001;http://localhost:5000" - } - } -} \ No newline at end of file diff --git a/backend/dal.keycloak/Extensions/ServiceCollectionExtensions.cs b/backend/dal.keycloak/Extensions/ServiceCollectionExtensions.cs deleted file mode 100644 index 0e2342285f..0000000000 --- a/backend/dal.keycloak/Extensions/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Pims.Keycloak; - -namespace Pims.Dal.Keycloak -{ - /// - /// ServiceCollectionExtensions static class, provides extension methods for ServiceCollection objects. - /// - public static class ServiceCollectionExtensions - { - /// - /// Add the PimsKeycloakService to the dependency injection service collection. - /// - /// - /// - public static IServiceCollection AddPimsKeycloakService(this IServiceCollection services) - { - return services.AddScoped() - .AddScoped(); - } - } -} diff --git a/backend/dal.keycloak/IPimsKeycloakService.cs b/backend/dal.keycloak/IPimsKeycloakService.cs deleted file mode 100644 index d960e2cfc4..0000000000 --- a/backend/dal.keycloak/IPimsKeycloakService.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Entity = Pims.Dal.Entities; - -namespace Pims.Dal.Keycloak -{ - public interface IPimsKeycloakService - { - #region Roles - Task> SyncRolesAsync(); - Task> GetRolesAsync(int page = 1, int quantity = 10, string search = null); - Task GetRoleAsync(Guid id); - Task UpdateRoleAsync(Entity.Role role); - #endregion - - #region Users - Task SyncUserAsync(Guid id); - Task> GetUsersAsync(int page = 1, int quantity = 10, string search = null); - Task GetUserAsync(Guid id); - Task UpdateUserAsync(Entity.User user); - Task UpdateAccessRequestAsync(Entity.AccessRequest entity); - #endregion - } -} diff --git a/backend/dal.keycloak/Partials/PimsKeycloakRoleService.cs b/backend/dal.keycloak/Partials/PimsKeycloakRoleService.cs deleted file mode 100644 index 9c234b4642..0000000000 --- a/backend/dal.keycloak/Partials/PimsKeycloakRoleService.cs +++ /dev/null @@ -1,122 +0,0 @@ -using Pims.Core.Helpers; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Entity = Pims.Dal.Entities; -using KModel = Pims.Keycloak.Models; - -namespace Pims.Dal.Keycloak -{ - /// - /// PimsKeycloakService class, provides a way to integrate both PIMS and Keycloak datasources. - /// - public partial class PimsKeycloakService : IPimsKeycloakService - { - #region Methods - /// - /// Sync all the groups in keycloak with PIMS. - /// This will delete any additional roles within PIMS. - /// - /// - public async Task> SyncRolesAsync() - { - var gcount = await _keycloakService.GetGroupCountAsync(); - - var roles = new List(); - for (var i = 0; i < gcount; i += 10) - { - var kgroups = await _keycloakService.GetGroupsAsync(i, 10); - - foreach (var kgroup in kgroups) - { - var erole = _pimsAdminService.Role.GetByName(kgroup.Name); - - if (erole == null) - { - // Need to add the group as a role within PIMS. - erole = _mapper.Map(kgroup); - _pimsAdminService.Role.AddOne(erole); - } - else - { - _mapper.Map(kgroup, erole); - _pimsAdminService.Role.UpdateOne(erole); - } - - roles.Add(erole); - } - - _pimsAdminService.CommitTransaction(); - } - - // Remove groups in PIMS that don't exist in keycloak. - var roleIds = roles.Select(g => g.Id).ToArray(); - _pimsAdminService.Role.RemoveAll(roleIds); - - return roles; - } - - /// - /// Get an array of roles from keycloak and PIMS. - /// - /// - /// - /// - /// - public async Task> GetRolesAsync(int page = 1, int quantity = 10, string search = null) - { - var kgroups = await _keycloakService.GetGroupsAsync((page - 1) * quantity, quantity, search); - - // TODO: Need better performing solution. - var eroles = kgroups.Select(g => ExceptionHelper.HandleKeyNotFound(() => _pimsAdminService.Role.GetByKeycloakId(g.Id)) ?? _mapper.Map(g)); - - return eroles; - } - - /// - /// Get the role specified by the 'id', if they exist in keycloak and PIMS. - /// - /// - /// User does not exist in keycloak or PIMS. - /// - public async Task GetRoleAsync(Guid id) - { - var role = ExceptionHelper.HandleKeyNotFound(() => _pimsAdminService.Role.Get(id)); - if (role == null) - { - var kgroup = await _keycloakService.GetGroupAsync(id) ?? throw new KeyNotFoundException(); - return _mapper.Map(kgroup); - } - return role; - } - - /// - /// Update the specified role in keycloak and PIMS. - /// This will add the role to PIMS if it does not current exist. - /// - /// - /// User does not exist in keycloak or PIMS. - /// - public async Task UpdateRoleAsync(Entity.Role role) - { - if (await _keycloakService.GetGroupAsync(role.Id) == null) throw new KeyNotFoundException(); - - // Role does not exist in PIMS, it needs to be added. - if (_pimsAdminService.Role.Find(role.Id) == null) - { - _pimsAdminService.Role.Add(role); - } - else - { - _pimsAdminService.Role.Update(role); - } - - var kmodel = _mapper.Map(role); - await _keycloakService.UpdateGroupAsync(kmodel); - - return role; - } - } - #endregion -} diff --git a/backend/dal.keycloak/Partials/PimsKeycloakUserService.cs b/backend/dal.keycloak/Partials/PimsKeycloakUserService.cs deleted file mode 100644 index 95a2148dbe..0000000000 --- a/backend/dal.keycloak/Partials/PimsKeycloakUserService.cs +++ /dev/null @@ -1,248 +0,0 @@ -using Pims.Core.Extensions; -using Pims.Core.Helpers; -using Pims.Dal.Entities.Comparers; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Entity = Pims.Dal.Entities; -using KModel = Pims.Keycloak.Models; -using Microsoft.Extensions.Logging; - -namespace Pims.Dal.Keycloak -{ - /// - /// PimsKeycloakService class, provides a way to integrate both PIMS and Keycloak datasources. - /// - public partial class PimsKeycloakService : IPimsKeycloakService - { - #region Methods - /// - /// Sync the user for the specified 'keycloakUserId' from keycloak to PIMS. - /// If the user doesn't exist in PIMS it will add it. - /// - /// - /// User does not exist in keycloak or PIMS. - /// - public async Task SyncUserAsync(Guid keycloakUserId) - { - var kuser = await _keycloakService.GetUserAsync(keycloakUserId) ?? throw new KeyNotFoundException(); - var kgroups = await _keycloakService.GetUserGroupsAsync(keycloakUserId); - - var euser = _pimsAdminService.User.GetForKeycloakUserId(keycloakUserId); - if (euser == null) - { - // The user does not exist in PIMS, it needs to be added. - euser = _mapper.Map(kuser); - foreach (var group in kgroups) - { - var erole = _pimsAdminService.Role.Find(group.Id); - - // If the role doesn't exist, create it. - if (erole == null) - { - erole = _mapper.Map(group); - _pimsAdminService.Role.AddOne(erole); - } - - euser.Roles.Add(new Entity.UserRole(euser, erole)); - } - _pimsAdminService.User.AddOne(euser); - } - else - { - // The user exists in PIMS, it only needs to be updated. - var roles = euser?.Roles.ToArray(); - _mapper.Map(kuser, euser); - foreach (var group in kgroups) - { - var erole = _pimsAdminService.Role.Find(group.Id); - - // If the role doesn't exist, create it. - if (erole == null) - { - erole = _mapper.Map(group); - _pimsAdminService.Role.AddOne(erole); - } - - // If the user isn't associated with the role, add a link. - if (!roles.Any(r => r.RoleId == group.Id)) - { - euser.Roles.Add(new Entity.UserRole(euser, erole)); - } - } - _pimsAdminService.User.UpdateOne(euser); - } - _pimsAdminService.CommitTransaction(); - - return euser; - } - - /// - /// Get an array of users from keycloak and PIMS. - /// - /// - /// - /// - /// - public async Task> GetUsersAsync(int page = 1, int quantity = 10, string search = null) - { - var kusers = await _keycloakService.GetUsersAsync((page - 1) * quantity, quantity, search); - - // TODO: Need better performing solution. - var eusers = kusers.Select(u => ExceptionHelper.HandleKeyNotFound(() => _pimsAdminService.User.GetForKeycloakUserId(u.Id)) ?? _mapper.Map(u)); - - return eusers; - } - - /// - /// Get the user specified for the 'keycloakUserId', only if they exist in Keycloak and PIMS. - /// - /// - /// User does not exist in keycloak or PIMS. - /// - public async Task GetUserAsync(Guid keycloakUserId) - { - var kuser = await _keycloakService.GetUserAsync(keycloakUserId) ?? throw new KeyNotFoundException(); - return _pimsAdminService.User.GetForKeycloakUserId(kuser.Id); - } - - /// - /// Update the specified user in keycloak and PIMS. - /// - /// - /// User does not exist in keycloak or PIMS. - /// - public async Task UpdateUserAsync(Entity.User user) - { - var kuser = await _keycloakService.GetUserAsync(user.KeycloakUserId.Value) ?? throw new KeyNotFoundException("User does not exist in Keycloak"); - var euser = _pimsAdminService.User.GetForKeycloakUserId(user.KeycloakUserId.Value); - - if (user.Username != kuser.Username) throw new InvalidOperationException($"Cannot change the username from '{kuser.Username}' to '{user.Username}'."); - - var addRoles = user.Roles.Except(euser.Roles, new UserRoleRoleIdComparer()).ToArray(); - var removeRoles = euser.Roles.Except(user.Roles, new UserRoleRoleIdComparer()).ToArray(); - var addAgencies = user.Agencies.Except(euser.Agencies, new UserAgencyAgencyIdComparer()).ToArray(); - var removeAgencies = euser.Agencies.Except(user.Agencies, new UserAgencyAgencyIdComparer()).ToArray(); - - // Update PIMS - _mapper.Map(user, euser); - - // Remove all keycloak groups from user. // TODO: Only add/remove the ones that should be removed. - var userGroups = await _keycloakService.GetUserGroupsAsync(euser.KeycloakUserId.Value); - foreach (var group in userGroups) - { - await _keycloakService.RemoveGroupFromUserAsync(user.KeycloakUserId.Value, group.Id); - } - foreach (var r in user.Roles) - { - var role = _pimsAdminService.Role.Find(r.RoleId) ?? throw new KeyNotFoundException("Cannot assign a role to a user, when the role does not exist."); - if (role.KeycloakGroupId == null) throw new KeyNotFoundException("PIMS has not been synced with Keycloak."); - _logger.LogInformation($"Adding keycloak group '{role.Name}' to user '{euser.Username}'."); - await _keycloakService.AddGroupToUserAsync(user.KeycloakUserId.Value, role.KeycloakGroupId.Value); - } - - // Update Roles. - removeRoles.ForEach(r => - { - var role = _pimsAdminService.Role.Find(r.RoleId) ?? throw new KeyNotFoundException("Cannot remove a role from a user, when the role does not exist."); - if (role.KeycloakGroupId == null) throw new KeyNotFoundException("PIMS has not been synced with Keycloak."); - euser.Roles.Remove(r); - }); - addRoles.ForEach(r => - { - var role = _pimsAdminService.Role.Find(r.RoleId) ?? throw new KeyNotFoundException("Cannot assign a role to a user, when the role does not exist."); - if (role.KeycloakGroupId == null) throw new KeyNotFoundException("PIMS has not been synced with Keycloak."); - euser.Roles.Add(new Entity.UserRole(euser, role)); - }); - - // Update Agencies - addAgencies.ForEach(a => - { - var agency = _pimsAdminService.Agency.Find(a.AgencyId) ?? throw new KeyNotFoundException("Cannot assign an agency to a user, when the agency does not exist."); - euser.Agencies.Add(new Entity.UserAgency(euser, agency)); - }); - removeAgencies.ForEach(a => - { - euser.Agencies.Remove(a); - }); - - _pimsAdminService.User.Update(euser); - - // Now update keycloak - var kmodel = _mapper.Map(user); - kmodel.Id = user.KeycloakUserId.Value; - kmodel.Attributes = new Dictionary - { - ["agencies"] = _pimsService.User.GetAgencies(euser.Id).Select(a => a.ToString()).ToArray(), - ["displayName"] = new[] { user.DisplayName } - }; - _logger.LogInformation($"Updating keycloak agency attribute '{kmodel.Attributes["agencies"]}' for user '{euser.Username}'."); - await _keycloakService.UpdateUserAsync(kmodel); // TODO: Fix issue where EmailVerified will be set to false. - - return euser; - } - - /// - /// Updates the specified access request in the datasource. if the request is granted, - /// update the associated user as well. - /// - /// - /// Entity does not exist in the datasource. - /// - public async Task UpdateAccessRequestAsync(Entity.AccessRequest accessRequest) - { - accessRequest.ThrowIfNull(nameof(accessRequest)); - accessRequest.ThrowIfNull(nameof(accessRequest.UserId)); - - // User approving/denying the request must be authorized to do so. - _user.ThrowIfNotAuthorized(Permissions.AdminUsers, Permissions.AgencyAdmin); - - var existingAccessRequest = _pimsAdminService.User.GetAccessRequest(accessRequest.Id); - // If user is being granted access. - if (existingAccessRequest.Status != Entity.AccessRequestStatus.Approved && accessRequest.Status == Entity.AccessRequestStatus.Approved) - { - var user = _pimsAdminService.User.Get(existingAccessRequest.UserId); - - // Add Agency to user to update. - accessRequest.Agencies.ForEach((accessRequestAgency) => - { - if (!user.Agencies.Any(a => a.AgencyId == accessRequestAgency.AgencyId)) - { - user.Agencies.Add(new Entity.UserAgency() - { - User = user, - AgencyId = accessRequestAgency.AgencyId - }); - } - }); - - _logger.LogDebug($"Test Logging for Keycloak before going into GetUsersPreferredUsername using keycloakuserid: '{user.KeycloakUserId}' and idp should be IDIR: '{user.Username.Split("@").Last()}'"); - // Add role to user to update, and add role in keycloak. - var preferred_username = await _pimsAdminService.User.GetUsersPreferredUsername(user.KeycloakUserId ?? Guid.Empty, user.Username.Split("@").Last()); - accessRequest.Roles.ForEach(async (accessRequestRole) => - { - if (!user.Roles.Any(r => r.RoleId == accessRequestRole.RoleId)) - { - var roleEntity = _pimsAdminService.Role.Get(accessRequestRole.RoleId); - await _pimsAdminService.User.AddRoleToUser(preferred_username, roleEntity.Name); - user.Roles.Add(new Entity.UserRole() - { - User = user, - RoleId = accessRequestRole.RoleId - }); - } - }); - - // Update user in datasource. - _pimsAdminService.User.Update(user); - } - - // Update Access Request and approvedById + approvedOn. - return _pimsAdminService.User.UpdateAccessRequest(accessRequest); - } - } - #endregion -} diff --git a/backend/dal.keycloak/Pims.Dal.Keycloak.csproj b/backend/dal.keycloak/Pims.Dal.Keycloak.csproj deleted file mode 100644 index 196746f258..0000000000 --- a/backend/dal.keycloak/Pims.Dal.Keycloak.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - net7.0 - Library - 1.0.0.0 - 1.0.0.0 - 5697DD19-62CC-4377-ABA8-1E192376F4F6 - - - - - - - - - - - - - - diff --git a/backend/dal.keycloak/PimsKeycloakService.cs b/backend/dal.keycloak/PimsKeycloakService.cs deleted file mode 100644 index 777e92f78b..0000000000 --- a/backend/dal.keycloak/PimsKeycloakService.cs +++ /dev/null @@ -1,44 +0,0 @@ -using MapsterMapper; -using Microsoft.Extensions.Logging; -using Pims.Dal.Services.Admin; -using Pims.Keycloak; -using System.Security.Claims; - -namespace Pims.Dal.Keycloak -{ - /// - /// PimsKeycloakService class, provides a way to integrate both PIMS and Keycloak datasources. - /// - public partial class PimsKeycloakService : IPimsKeycloakService - { - #region Variable - private readonly IKeycloakService _keycloakService; - private readonly IPimsService _pimsService; - private readonly IPimsAdminService _pimsAdminService; - private readonly IMapper _mapper; - private readonly ClaimsPrincipal _user; - private readonly ILogger _logger; - #endregion - - #region Constructors - /// - /// Creates a new instance of a PimsKeycloakService object, initializes with the specified arguments. - /// - /// - /// - /// - /// - /// - /// - public PimsKeycloakService(IKeycloakService keycloakService, IPimsService pimsService, IPimsAdminService pimsAdminService, ClaimsPrincipal user, IMapper mapper, ILogger logger) - { - _keycloakService = keycloakService; - _pimsService = pimsService; - _pimsAdminService = pimsAdminService; - _mapper = mapper; - _user = user; - _logger = logger; - } - #endregion - } -} diff --git a/backend/dal/Configuration/AccessRequestAgencyConfiguration.cs b/backend/dal/Configuration/AccessRequestAgencyConfiguration.cs deleted file mode 100644 index 4a22c799b3..0000000000 --- a/backend/dal/Configuration/AccessRequestAgencyConfiguration.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// AccessRequestAgencyConfiguration class, provides a way to configure AccessRequest Agencies in the database. - /// - public class AccessRequestAgencyConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("AccessRequestAgencies"); - - builder.HasKey(m => new { m.AccessRequestId, m.AgencyId }); - - builder.Property(m => m.AccessRequestId).IsRequired(); - builder.Property(m => m.AccessRequestId).ValueGeneratedNever(); - - builder.Property(m => m.AgencyId).IsRequired(); - builder.Property(m => m.AgencyId).ValueGeneratedNever(); - - builder.HasOne(m => m.AccessRequest).WithMany(m => m.Agencies).HasForeignKey(m => m.AccessRequestId).OnDelete(DeleteBehavior.ClientCascade); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/AccessRequestConfiguration.cs b/backend/dal/Configuration/AccessRequestConfiguration.cs deleted file mode 100644 index 91e54a108e..0000000000 --- a/backend/dal/Configuration/AccessRequestConfiguration.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// AccessRequestConfiguration class, provides a way to configure users access requests in the database. - /// - public class AccessRequestConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("AccessRequests"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).IsRequired(); - builder.Property(m => m.Id).ValueGeneratedOnAdd(); - - builder.Property(m => m.Status); - - builder.HasOne(m => m.User).WithMany().HasForeignKey(m => m.UserId).OnDelete(DeleteBehavior.ClientSetNull); - - builder.HasIndex(m => new { m.Status }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/AccessRequestRoleConfiguration.cs b/backend/dal/Configuration/AccessRequestRoleConfiguration.cs deleted file mode 100644 index 698900aac4..0000000000 --- a/backend/dal/Configuration/AccessRequestRoleConfiguration.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// AccessRequestRoleConfiguration class, provides a way to configure AccessRequest Roles in the database. - /// - public class AccessRequestRoleConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("AccessRequestRoles"); - - builder.HasKey(m => new { m.AccessRequestId, m.RoleId }); - - builder.Property(m => m.AccessRequestId).IsRequired(); - builder.Property(m => m.AccessRequestId).ValueGeneratedNever(); - - builder.Property(m => m.RoleId).IsRequired(); - builder.Property(m => m.RoleId).ValueGeneratedNever(); - - builder.HasOne(m => m.AccessRequest).WithMany(m => m.Roles).HasForeignKey(m => m.AccessRequestId).OnDelete(DeleteBehavior.ClientCascade); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/AddressConfiguration.cs b/backend/dal/Configuration/AddressConfiguration.cs deleted file mode 100644 index 466b63d94d..0000000000 --- a/backend/dal/Configuration/AddressConfiguration.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// AddressConfiguration class, provides a way to configure addresses in the database. - /// - public class AddressConfiguration : BaseEntityConfiguration
- { - #region Methods - public override void Configure(EntityTypeBuilder
builder) - { - builder.ToTable("Addresses"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).ValueGeneratedOnAdd(); - - builder.Property(m => m.Address1).HasMaxLength(150); - - builder.Property(m => m.Address2).HasMaxLength(150); - - builder.Property(m => m.Postal).HasMaxLength(6); - - builder.Property(m => m.ProvinceId).HasMaxLength(2); - builder.Property(m => m.ProvinceId).IsRequired(); - - builder.HasOne(m => m.Province).WithMany().HasForeignKey(m => m.ProvinceId).OnDelete(DeleteBehavior.ClientSetNull); - - builder.HasIndex(m => new { m.Id, m.AdministrativeArea }).IncludeProperties(m => new { m.Address1, m.Address2 }); - builder.HasIndex(m => new { m.Id, m.Postal }).IncludeProperties(m => new { m.Address1, m.Address2 }); - builder.HasIndex(m => new { m.Id, m.Address1 }).IncludeProperties(m => new { m.Address2 }); - builder.HasIndex(m => new { m.AdministrativeArea, m.ProvinceId }).IncludeProperties(m => new { m.Address1, m.Address2 }); - builder.HasIndex(m => new { m.Id, m.ProvinceId, m.AdministrativeArea, m.Postal, m.Address1 }).IncludeProperties(m => new { m.Address2 }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/AdministrativeAreaConfiguration.cs b/backend/dal/Configuration/AdministrativeAreaConfiguration.cs deleted file mode 100644 index 8d2323a1ec..0000000000 --- a/backend/dal/Configuration/AdministrativeAreaConfiguration.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// AdministrativeAreaConfiguration class, provides a way to configure administrative areas in the database. - /// - public class AdministrativeAreaConfiguration : LookupEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("AdministrativeAreas"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).IsRequired(); - builder.Property(m => m.Id).ValueGeneratedOnAdd(); - - builder.Property(m => m.Name).IsRequired(); - builder.Property(m => m.Name).HasMaxLength(150); - - builder.Property(m => m.Abbreviation).HasMaxLength(100); - builder.Property(m => m.BoundaryType).HasMaxLength(50); - builder.Property(m => m.GroupName).HasMaxLength(250); - - builder.HasIndex(m => m.Name ).IsUnique(); - builder.HasIndex(m => new { m.Id, m.IsDisabled, m.Name, m.SortOrder }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/AgencyConfiguration.cs b/backend/dal/Configuration/AgencyConfiguration.cs deleted file mode 100644 index 23c87d7433..0000000000 --- a/backend/dal/Configuration/AgencyConfiguration.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// AgencyConfiguration class, provides a way to configure agencies in the database. - /// - public class AgencyConfiguration : CodeEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("Agencies"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).ValueGeneratedOnAdd(); - - builder.Property(m => m.Code).HasMaxLength(6); - builder.Property(m => m.Code).IsRequired(); - - builder.Property(m => m.Name).HasMaxLength(150); - builder.Property(m => m.Name).IsRequired(); - - builder.Property(m => m.Email).HasMaxLength(250); - builder.Property(m => m.CCEmail).HasMaxLength(250); - builder.Property(m => m.AddressTo).HasMaxLength(100); - - builder.Property(m => m.Description).HasMaxLength(500); - - builder.HasOne(m => m.Parent).WithMany(m => m.Children).HasForeignKey(m => m.ParentId).OnDelete(DeleteBehavior.ClientSetNull); - - builder.HasIndex(m => new { m.Code, m.ParentId }).IsUnique(); - builder.HasIndex(m => new { m.IsDisabled, m.Code, m.Name, m.ParentId, m.SortOrder }); - - base.LookupConfigure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/BaseEntityConfiguration`.cs b/backend/dal/Configuration/BaseEntityConfiguration`.cs deleted file mode 100644 index 05b3b9c4a0..0000000000 --- a/backend/dal/Configuration/BaseEntityConfiguration`.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// BaseEntityConfiguration class, provides a way to configure base entity in the database. - /// - public abstract class BaseEntityConfiguration : IEntityTypeConfiguration where TBase : BaseEntity - { - #region Methods - protected void BaseConfigure(EntityTypeBuilder builder) - { - builder.Property(m => m.CreatedOn).HasColumnType("DATETIME2"); - builder.Property(m => m.CreatedOn).HasDefaultValueSql("GETUTCDATE()"); - builder.Property(m => m.UpdatedOn).HasColumnType("DATETIME2"); - builder.Property(m => m.RowVersion).IsRowVersion(); - - builder.HasOne(m => m.CreatedBy).WithMany().HasForeignKey(m => m.CreatedById).OnDelete(DeleteBehavior.ClientSetNull); - builder.HasOne(m => m.UpdatedBy).WithMany().HasForeignKey(m => m.UpdatedById).OnDelete(DeleteBehavior.ClientSetNull); - } - - public virtual void Configure(EntityTypeBuilder builder) - { - BaseConfigure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/BuildingConfiguration.cs b/backend/dal/Configuration/BuildingConfiguration.cs deleted file mode 100644 index 6cef4d245f..0000000000 --- a/backend/dal/Configuration/BuildingConfiguration.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// BuildingConfiguration class, provides a way to configure buildings in the database. - /// - public class BuildingConfiguration : PropertyConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("Buildings"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).ValueGeneratedOnAdd(); - - builder.Property(m => m.LeasedLandMetadata).HasColumnType("NVARCHAR(MAX)"); - - builder.Property(m => m.BuildingFloorCount).IsRequired(); - builder.Property(m => m.BuildingTenancy).IsRequired(); - builder.Property(m => m.LeaseExpiry).HasColumnType("DATETIME2"); - builder.Property(m => m.BuildingTenancyUpdatedOn).HasColumnType("DATETIME2"); - builder.Property(m => m.TransferLeaseOnSale).HasDefaultValue(false); - builder.Property(m => m.OccupantName).HasMaxLength(100); - builder.Property(m => m.EncumbranceReason).HasMaxLength(500); - - builder.HasOne(m => m.Agency).WithMany(m => m.Buildings).HasForeignKey(m => m.AgencyId).OnDelete(DeleteBehavior.ClientSetNull); - builder.HasOne(m => m.BuildingConstructionType).WithMany().HasForeignKey(m => m.BuildingConstructionTypeId).OnDelete(DeleteBehavior.ClientSetNull); - builder.HasOne(m => m.BuildingPredominateUse).WithMany().HasForeignKey(m => m.BuildingPredominateUseId).OnDelete(DeleteBehavior.ClientSetNull); - builder.HasOne(m => m.BuildingOccupantType).WithMany().HasForeignKey(m => m.BuildingOccupantTypeId).OnDelete(DeleteBehavior.ClientSetNull); - - builder.HasOne(m => m.PropertyType).WithOne().HasPrincipalKey(m => m.Id).HasForeignKey(m => m.PropertyTypeId).OnDelete(DeleteBehavior.ClientNoAction); - - builder.HasIndex(m => m.PropertyTypeId).IsUnique(false); - builder.HasIndex(m => new { m.Id, m.IsSensitive, m.AgencyId, m.ClassificationId, m.AddressId, m.ProjectNumbers, m.BuildingConstructionTypeId, m.BuildingPredominateUseId, m.BuildingOccupantTypeId, m.BuildingFloorCount, m.BuildingTenancy }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/BuildingConstructionTypeConfiguration.cs b/backend/dal/Configuration/BuildingConstructionTypeConfiguration.cs deleted file mode 100644 index 9b0a7d8751..0000000000 --- a/backend/dal/Configuration/BuildingConstructionTypeConfiguration.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// BuildingConstructionTypeConfiguration class, provides a way to configure building construction types in the database. - /// - public class BuildingConstructionTypeConfiguration : LookupEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("BuildingConstructionTypes"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).IsRequired(); - builder.Property(m => m.Id).ValueGeneratedNever(); - - builder.Property(m => m.Name).IsRequired(); - builder.Property(m => m.Name).HasMaxLength(150); - - builder.HasIndex(m => new { m.Name }).IsUnique(); - builder.HasIndex(m => new { m.IsDisabled, m.Name, m.SortOrder }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/BuildingEvaluationConfiguration.cs b/backend/dal/Configuration/BuildingEvaluationConfiguration.cs deleted file mode 100644 index 41125e6163..0000000000 --- a/backend/dal/Configuration/BuildingEvaluationConfiguration.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// BuildingEvaluationConfiguration class, provides a way to configure building evaluations in the database. - /// - public class BuildingEvaluationConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("BuildingEvaluations"); - - builder.HasKey(m => new { m.BuildingId, m.Date, m.Key }); - - builder.Property(m => m.BuildingId).IsRequired(); - builder.Property(m => m.BuildingId).ValueGeneratedNever(); - - builder.Property(m => m.Date).HasColumnType("DATE").IsRequired(); - - builder.Property(m => m.Key).IsRequired(); - - builder.Property(m => m.Value).HasColumnType("MONEY"); - builder.Property(m => m.Note).HasMaxLength(500); - - builder.HasOne(m => m.Building).WithMany(m => m.Evaluations).HasForeignKey(m => m.BuildingId).OnDelete(DeleteBehavior.ClientCascade); - - builder.HasIndex(m => new { m.BuildingId, m.Key }); - builder.HasIndex(m => new { m.BuildingId, m.Date, m.Key, m.Value }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/BuildingFiscalConfiguration.cs b/backend/dal/Configuration/BuildingFiscalConfiguration.cs deleted file mode 100644 index 5f2c4235e6..0000000000 --- a/backend/dal/Configuration/BuildingFiscalConfiguration.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// BuildingFiscalConfiguration class, provides a way to configure building fiscals in the database. - /// - public class BuildingFiscalConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("BuildingFiscals"); - - builder.HasKey(m => new { m.BuildingId, m.FiscalYear, m.Key }); - - builder.Property(m => m.BuildingId).IsRequired(); - builder.Property(m => m.BuildingId).ValueGeneratedNever(); - - builder.Property(m => m.FiscalYear).IsRequired(); - builder.Property(m => m.FiscalYear).ValueGeneratedNever(); - - builder.Property(m => m.EffectiveDate).HasColumnType("DATE"); - - builder.Property(m => m.Key).IsRequired(); - - builder.Property(m => m.Value).HasColumnType("MONEY"); - builder.Property(m => m.Note).HasMaxLength(500); - - builder.HasOne(m => m.Building).WithMany(m => m.Fiscals).HasForeignKey(m => m.BuildingId).OnDelete(DeleteBehavior.ClientCascade); - - builder.HasIndex(m => new { m.BuildingId, m.Key }); - builder.HasIndex(m => new { m.BuildingId, m.FiscalYear, m.Key, m.Value }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/BuildingOccupantTypeConfiguration.cs b/backend/dal/Configuration/BuildingOccupantTypeConfiguration.cs deleted file mode 100644 index 6fb6000c83..0000000000 --- a/backend/dal/Configuration/BuildingOccupantTypeConfiguration.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// BuildingOccupantTypeConfiguration class, provides a way to configure building occupant type in the database. - /// - public class BuildingOccupantTypeConfiguration : LookupEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("BuildingOccupantTypes"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).IsRequired(); - builder.Property(m => m.Id).ValueGeneratedNever(); - - builder.Property(m => m.Name).IsRequired(); - builder.Property(m => m.Name).HasMaxLength(150); - - builder.HasIndex(m => new { m.Name }).IsUnique(); - builder.HasIndex(m => new { m.IsDisabled, m.Name, m.SortOrder }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/BuildingPredominateUseConfiguration.cs b/backend/dal/Configuration/BuildingPredominateUseConfiguration.cs deleted file mode 100644 index 6eedbfc749..0000000000 --- a/backend/dal/Configuration/BuildingPredominateUseConfiguration.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// BuildingPredominateUseConfiguration class, provides a way to configure building predominate uses in the database. - /// - public class BuildingPredominateUseConfiguration : LookupEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("BuildingPredominateUses"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).IsRequired(); - builder.Property(m => m.Id).ValueGeneratedNever(); - - builder.Property(m => m.Name).IsRequired(); - builder.Property(m => m.Name).HasMaxLength(150); - - builder.HasIndex(m => new { m.Name }).IsUnique(); - builder.HasIndex(m => new { m.IsDisabled, m.Name, m.SortOrder }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/ClaimConfiguration.cs b/backend/dal/Configuration/ClaimConfiguration.cs deleted file mode 100644 index eef5ab0b1e..0000000000 --- a/backend/dal/Configuration/ClaimConfiguration.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// ClaimConfiguration class, provides a way to configure claims in the database. - /// - public class ClaimConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("Claims"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).IsRequired(); - builder.Property(m => m.Id).ValueGeneratedNever(); - - builder.Property(m => m.Name).IsRequired(); - builder.Property(m => m.Name).HasMaxLength(100); - - builder.Property(m => m.Description).HasMaxLength(500); - - builder.HasIndex(m => new { m.Name }).IsUnique(); - builder.HasIndex(m => new { m.IsDisabled, m.Name }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/CodeEntityConfiguration`.cs b/backend/dal/Configuration/CodeEntityConfiguration`.cs deleted file mode 100644 index f93a1dced9..0000000000 --- a/backend/dal/Configuration/CodeEntityConfiguration`.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// BaseEntityConfiguration class, provides a way to configure base entity in the database. - /// - public abstract class CodeEntityConfiguration : LookupEntityConfiguration - where TBase : CodeEntity - { - #region Methods - protected void CodeConfigure(EntityTypeBuilder builder) - { - builder.Property(m => m.Code).IsRequired(); - - builder.HasIndex(m => new { m.Code }).IsUnique(); - - base.Configure(builder); - } - - public override void Configure(EntityTypeBuilder builder) - { - CodeConfigure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/Generators/IntIdentityGenerator.cs b/backend/dal/Configuration/Generators/IntIdentityGenerator.cs deleted file mode 100644 index a16734742c..0000000000 --- a/backend/dal/Configuration/Generators/IntIdentityGenerator.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.EntityFrameworkCore.InMemory.ValueGeneration.Internal; - -namespace Pims.Dal.Configuration.Generators -{ - /// - /// IntIdentityGenerator class, provides a way to control the generation of identity seeds in memory. - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "EF1001:Internal EF Core API usage.", Justification = "For testing purposes only.")] - public class IntIdentityGenerator : InMemoryIntegerValueGenerator - { - #region Constructors - /// - /// Creates a new instance of a IntIdentityGenerator object. - /// - public IntIdentityGenerator() : base(1) - { - - } - #endregion - } -} diff --git a/backend/dal/Configuration/LookupEntityConfiguration`.cs b/backend/dal/Configuration/LookupEntityConfiguration`.cs deleted file mode 100644 index 0a1ed58cb2..0000000000 --- a/backend/dal/Configuration/LookupEntityConfiguration`.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// BaseEntityConfiguration class, provides a way to configure base entity in the database. - /// - public abstract class LookupEntityConfiguration : BaseEntityConfiguration - where TBase : LookupEntity - { - #region Methods - protected void LookupConfigure(EntityTypeBuilder builder) - { - builder.Property(m => m.SortOrder).HasDefaultValue(0); - builder.Property(m => m.IsDisabled).HasDefaultValue(false); - - base.Configure(builder); - } - - public override void Configure(EntityTypeBuilder builder) - { - LookupConfigure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/NotificationQueueConfiguration.cs b/backend/dal/Configuration/NotificationQueueConfiguration.cs deleted file mode 100644 index 2de6a5d24c..0000000000 --- a/backend/dal/Configuration/NotificationQueueConfiguration.cs +++ /dev/null @@ -1,53 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; -using System; - -namespace Pims.Dal.Configuration -{ - /// - /// NotificationQueueConfiguration class, provides a way to manage a notification queue in the database. - /// - public class NotificationQueueConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("NotificationQueue"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).ValueGeneratedOnAdd(); - - builder.Property(m => m.SendOn).HasColumnType("DATETIME2"); - - builder.Property(m => m.Priority).HasMaxLength(50) - .HasConversion(v => v.ToString(), v => (NotificationPriorities)Enum.Parse(typeof(NotificationPriorities), v)); - builder.Property(m => m.Encoding).HasMaxLength(50) - .HasConversion(v => v.ToString(), v => (NotificationEncodings)Enum.Parse(typeof(NotificationEncodings), v)); - builder.Property(m => m.BodyType).HasMaxLength(50) - .HasConversion(v => v.ToString(), v => (NotificationBodyTypes)Enum.Parse(typeof(NotificationBodyTypes), v)); - - builder.Property(m => m.Subject).IsRequired(); - builder.Property(m => m.Subject).HasMaxLength(200); - - builder.Property(m => m.Body).IsRequired(); - - builder.Property(m => m.Tag).HasMaxLength(50); - - builder.Property(m => m.To).HasMaxLength(500); - builder.Property(m => m.Bcc).HasMaxLength(500); - builder.Property(m => m.Cc).HasMaxLength(500); - - builder.HasOne(m => m.Project).WithMany(m => m.Notifications).HasForeignKey(m => m.ProjectId).OnDelete(DeleteBehavior.ClientCascade); - builder.HasOne(m => m.ToAgency).WithMany(m => m.Notifications).HasForeignKey(m => m.ToAgencyId).OnDelete(DeleteBehavior.ClientSetNull); - builder.HasOne(m => m.Template).WithMany(m => m.Notifications).HasForeignKey(m => m.TemplateId).OnDelete(DeleteBehavior.ClientSetNull); - - builder.HasIndex(m => new { m.Key }).IsUnique(); - builder.HasIndex(m => new { m.Status, m.SendOn, m.Subject }); - builder.HasIndex(m => new { m.ProjectId, m.TemplateId, m.ToAgencyId }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/NotificationTemplateConfiguration.cs b/backend/dal/Configuration/NotificationTemplateConfiguration.cs deleted file mode 100644 index 617503ebf5..0000000000 --- a/backend/dal/Configuration/NotificationTemplateConfiguration.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; -using System; - -namespace Pims.Dal.Configuration -{ - /// - /// NotificationTemplateConfiguration class, provides a way to configure notification templates in the database. - /// - public class NotificationTemplateConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("NotificationTemplates"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).ValueGeneratedOnAdd(); - - builder.Property(m => m.Name).IsRequired(); - builder.Property(m => m.Name).HasMaxLength(100); - - builder.Property(m => m.Description).HasMaxLength(500); - - builder.Property(m => m.Audience).HasMaxLength(50) - .HasConversion(v => v.ToString(), v => (NotificationAudiences)Enum.Parse(typeof(NotificationAudiences), v)); - builder.Property(m => m.Priority).HasMaxLength(50) - .HasConversion(v => v.ToString(), v => (NotificationPriorities)Enum.Parse(typeof(NotificationPriorities), v)); - builder.Property(m => m.Encoding).HasMaxLength(50) - .HasConversion(v => v.ToString(), v => (NotificationEncodings)Enum.Parse(typeof(NotificationEncodings), v)); - builder.Property(m => m.BodyType).HasMaxLength(50) - .HasConversion(v => v.ToString(), v => (NotificationBodyTypes)Enum.Parse(typeof(NotificationBodyTypes), v)); - - builder.Property(m => m.Subject).IsRequired(); - builder.Property(m => m.Subject).HasMaxLength(200); - - builder.Property(m => m.To).HasMaxLength(500); - builder.Property(m => m.Cc).HasMaxLength(500); - builder.Property(m => m.Bcc).HasMaxLength(500); - - builder.Property(m => m.Tag).HasMaxLength(50); - - builder.HasIndex(m => m.Name).IsUnique(); - builder.HasIndex(m => new { m.IsDisabled, m.Tag }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/ParcelBuildingConfiguration.cs b/backend/dal/Configuration/ParcelBuildingConfiguration.cs deleted file mode 100644 index 4e4caa3743..0000000000 --- a/backend/dal/Configuration/ParcelBuildingConfiguration.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// ParcelBuildingConfiguration class, provides a way to configure parcel and building relationships in the database. - /// - public class ParcelBuildingConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("ParcelBuildings"); - - builder.HasKey(m => new { m.ParcelId, m.BuildingId }); - - builder.Property(m => m.ParcelId).IsRequired(); - builder.Property(m => m.ParcelId).ValueGeneratedNever(); - - builder.Property(m => m.BuildingId).IsRequired(); - builder.Property(m => m.BuildingId).ValueGeneratedNever(); - - builder.HasOne(m => m.Parcel).WithMany(m => m.Buildings).HasForeignKey(m => m.ParcelId).OnDelete(DeleteBehavior.ClientCascade); - builder.HasOne(m => m.Building).WithMany(m => m.Parcels).HasForeignKey(m => m.BuildingId).OnDelete(DeleteBehavior.ClientCascade); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/ParcelConfiguration.cs b/backend/dal/Configuration/ParcelConfiguration.cs deleted file mode 100644 index 87f33c0066..0000000000 --- a/backend/dal/Configuration/ParcelConfiguration.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// ParcelConfiguration class, provides a way to configure parcels in the database. - /// - public class ParcelConfiguration : PropertyConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("Parcels"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).ValueGeneratedOnAdd(); - - builder.Property(m => m.PID).IsRequired(); - builder.Property(m => m.Zoning).HasMaxLength(50); - builder.Property(m => m.ZoningPotential).HasMaxLength(50); - builder.Property(m => m.LandLegalDescription).HasMaxLength(500); - builder.Property(m => m.EncumbranceReason).HasMaxLength(500); - builder.Property(m => m.NotOwned).HasDefaultValue(false); - - builder.HasOne(m => m.Agency).WithMany(m => m.Parcels).HasForeignKey(m => m.AgencyId).OnDelete(DeleteBehavior.ClientSetNull); - builder.HasOne(m => m.PropertyType).WithOne().HasForeignKey(m => m.PropertyTypeId).OnDelete(DeleteBehavior.ClientNoAction); - - builder.HasIndex(m => m.PropertyTypeId).IsUnique(false); - builder.HasIndex(m => new { m.PID, m.PIN }).IsUnique(); // This will allow for Crown Land to set ParcelId=0 and PIN=#######. - builder.HasIndex(m => new { m.Id, m.AgencyId, m.IsSensitive, m.AddressId }); - builder.HasIndex(m => new { m.Id, m.IsSensitive, m.AgencyId, m.ClassificationId, m.PID, m.PIN, m.AddressId, m.ProjectNumbers, m.LandArea, m.Zoning, m.ZoningPotential }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/ParcelEvaluationConfiguration.cs b/backend/dal/Configuration/ParcelEvaluationConfiguration.cs deleted file mode 100644 index 4a0547361b..0000000000 --- a/backend/dal/Configuration/ParcelEvaluationConfiguration.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// ParcelEvaluationConfiguration class, provides a way to configure parcel evaluations in the database. - /// - public class ParcelEvaluationConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("ParcelEvaluations"); - - builder.HasKey(m => new { m.ParcelId, m.Date, m.Key }); - - builder.Property(m => m.ParcelId).IsRequired(); - builder.Property(m => m.ParcelId).ValueGeneratedNever(); - - builder.Property(m => m.Date).HasColumnType("DATE").IsRequired(); - - builder.Property(m => m.Key).IsRequired(); - - builder.Property(m => m.Value).HasColumnType("MONEY"); - builder.Property(m => m.Note).HasMaxLength(500); - builder.Property(m => m.Firm).HasMaxLength(150); - - builder.HasOne(m => m.Parcel).WithMany(m => m.Evaluations).HasForeignKey(m => m.ParcelId).OnDelete(DeleteBehavior.ClientCascade); - - builder.HasIndex(m => new { m.ParcelId, m.Date, m.Key, m.Value }); - builder.HasIndex(m => new { m.ParcelId, m.Key }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/ParcelFiscalConfiguration.cs b/backend/dal/Configuration/ParcelFiscalConfiguration.cs deleted file mode 100644 index 5b849e3b48..0000000000 --- a/backend/dal/Configuration/ParcelFiscalConfiguration.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// ParcelFiscalConfiguration class, provides a way to configure parcel fiscals in the database. - /// - public class ParcelFiscalConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("ParcelFiscals"); - - builder.HasKey(m => new { m.ParcelId, m.FiscalYear, m.Key }); - - builder.Property(m => m.ParcelId).IsRequired(); - builder.Property(m => m.ParcelId).ValueGeneratedNever(); - - builder.Property(m => m.FiscalYear).IsRequired(); - builder.Property(m => m.FiscalYear).ValueGeneratedNever(); - - builder.Property(m => m.EffectiveDate).HasColumnType("DATE"); - - builder.Property(m => m.Key).IsRequired(); - - builder.Property(m => m.Value).HasColumnType("MONEY"); - builder.Property(m => m.Note).HasMaxLength(500); - - builder.HasOne(m => m.Parcel).WithMany(m => m.Fiscals).HasForeignKey(m => m.ParcelId).OnDelete(DeleteBehavior.ClientCascade); - - builder.HasIndex(m => new { m.ParcelId, m.FiscalYear, m.Key, m.Value }); - builder.HasIndex(m => new { m.ParcelId, m.Key }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/ParcelParcelsConfiguration.cs b/backend/dal/Configuration/ParcelParcelsConfiguration.cs deleted file mode 100644 index 564a331d2a..0000000000 --- a/backend/dal/Configuration/ParcelParcelsConfiguration.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// ParcelParcelsConfiguration class, provides a way to configure parcel and parcels(Subdivision) relationships in the database. - /// - public class ParcelParcelsConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("ParcelParcels"); - - builder.HasKey(m => new { m.ParcelId, m.SubdivisionId }); - - builder.Property(m => m.ParcelId).IsRequired(); - builder.Property(m => m.ParcelId).ValueGeneratedNever(); - - builder.Property(m => m.SubdivisionId).IsRequired(); - builder.Property(m => m.SubdivisionId).ValueGeneratedNever(); - - - //I had some trouble getting this to work as A->A Many to Many relationships aren't documented well on the fluent efcore site. Based on: - // https://stackoverflow.com/questions/49214748/many-to-many-self-referencing-relationship/49219124#49219124 - builder.HasOne(m => m.Parcel).WithMany(m => m.Subdivisions).HasForeignKey(m => m.ParcelId).OnDelete(DeleteBehavior.Restrict); - builder.HasOne(m => m.Subdivision).WithMany(m => m.Parcels).HasForeignKey(m => m.SubdivisionId).OnDelete(DeleteBehavior.ClientCascade); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/ProjectAgencyResponseConfiguration.cs b/backend/dal/Configuration/ProjectAgencyResponseConfiguration.cs deleted file mode 100644 index a5d1298c7a..0000000000 --- a/backend/dal/Configuration/ProjectAgencyResponseConfiguration.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// ProjectAgencyResponseConfiguration class, provides a way to record agency responses to project notifications in the database. - /// - public class ProjectAgencyResponseConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("ProjectAgencyResponses"); - - builder.HasKey(m => new { m.ProjectId, m.AgencyId }); - builder.Property(m => m.ProjectId).ValueGeneratedNever(); - builder.Property(m => m.AgencyId).ValueGeneratedNever(); - builder.Property(m => m.OfferAmount).HasColumnType("MONEY"); - - builder.HasOne(m => m.Project).WithMany(m => m.Responses).HasForeignKey(m => m.ProjectId).OnDelete(DeleteBehavior.ClientCascade); - builder.HasOne(m => m.Agency).WithMany(m => m.ProjectResponses).HasForeignKey(m => m.AgencyId).OnDelete(DeleteBehavior.ClientCascade); - builder.HasOne(m => m.Notification).WithMany(m => m.Responses).HasForeignKey(m => m.NotificationId).OnDelete(DeleteBehavior.ClientCascade).IsRequired(false); - - builder.Property(m => m.Note).HasMaxLength(2000); - builder.Property(m => m.ReceivedOn).HasColumnType("DATETIME2"); - - builder.HasIndex(m => new { m.ProjectId, m.AgencyId, m.Response, m.ReceivedOn, m.Note }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/ProjectConfiguration.cs b/backend/dal/Configuration/ProjectConfiguration.cs deleted file mode 100644 index b91e017ef1..0000000000 --- a/backend/dal/Configuration/ProjectConfiguration.cs +++ /dev/null @@ -1,57 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// ProjectConfiguration class, provides a way to configure projects in the database. - /// - public class ProjectConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("Projects"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).IsRequired(); - builder.Property(m => m.Id).ValueGeneratedOnAdd(); - - builder.Property(m => m.ProjectNumber).IsRequired(); - builder.Property(m => m.ProjectNumber).HasMaxLength(25); - - builder.Property(m => m.Name).IsRequired(); - builder.Property(m => m.Name).HasMaxLength(100); - - builder.Property(m => m.Manager).HasMaxLength(150); - builder.Property(m => m.Description).HasMaxLength(1000); - - builder.Property(m => m.Metadata).HasColumnType("NVARCHAR(MAX)"); - - builder.Property(m => m.SubmittedOn).HasColumnType("DATETIME2"); - builder.Property(m => m.ApprovedOn).HasColumnType("DATETIME2"); - builder.Property(m => m.DeniedOn).HasColumnType("DATETIME2"); - builder.Property(m => m.CancelledOn).HasColumnType("DATETIME2"); - builder.Property(m => m.CompletedOn).HasColumnType("DATETIME2"); - - builder.Property(m => m.NetBook).HasColumnType("MONEY"); - builder.Property(m => m.Market).HasColumnType("MONEY"); - builder.Property(m => m.Assessed).HasColumnType("MONEY"); - builder.Property(m => m.Appraised).HasColumnType("MONEY"); - - builder.HasOne(m => m.Status).WithMany(s => s.Projects).HasForeignKey(m => m.StatusId).OnDelete(DeleteBehavior.Cascade); - builder.HasOne(m => m.Agency).WithMany(a => a.Projects).HasForeignKey(m => m.AgencyId).OnDelete(DeleteBehavior.ClientCascade); - builder.HasOne(m => m.TierLevel).WithMany(t => t.Projects).HasForeignKey(m => m.TierLevelId).OnDelete(DeleteBehavior.ClientCascade); - builder.HasOne(m => m.Workflow).WithMany(m => m.Projects).HasForeignKey(m => m.WorkflowId).OnDelete(DeleteBehavior.ClientSetNull); - builder.HasOne(m => m.Risk).WithMany(m => m.Projects).HasForeignKey(m => m.RiskId).OnDelete(DeleteBehavior.ClientCascade); - - builder.HasIndex(m => m.ProjectNumber).IsUnique(); - builder.HasIndex(m => new { m.Name, m.StatusId, m.TierLevelId, m.AgencyId }); - builder.HasIndex(m => new { m.Assessed, m.NetBook, m.Market, m.ReportedFiscalYear, m.ActualFiscalYear }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/ProjectNoteConfiguration.cs b/backend/dal/Configuration/ProjectNoteConfiguration.cs deleted file mode 100644 index cf416d970a..0000000000 --- a/backend/dal/Configuration/ProjectNoteConfiguration.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// ProjectNoteConfiguration class, provides a way to configure project notes in the database. - /// - public class ProjectNoteConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("ProjectNotes"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).IsRequired(); - builder.Property(m => m.Id).ValueGeneratedOnAdd(); - - builder.Property(m => m.ProjectId).IsRequired(); - builder.Property(m => m.NoteType).IsRequired(); - - builder.Property(m => m.Note).IsRequired(); - builder.Property(m => m.Note).HasColumnType("NVARCHAR(MAX)"); - - builder.HasOne(m => m.Project).WithMany(m => m.Notes).HasForeignKey(m => m.ProjectId).OnDelete(DeleteBehavior.ClientCascade); - - builder.HasIndex(m => new { m.ProjectId, m.NoteType }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/ProjectNumberConfiguration.cs b/backend/dal/Configuration/ProjectNumberConfiguration.cs deleted file mode 100644 index 28dea5d352..0000000000 --- a/backend/dal/Configuration/ProjectNumberConfiguration.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// ProjectNumberConfiguration class, provides a way to configure project numbers in the database. - /// - public class ProjectNumberConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("ProjectNumbers"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).IsRequired(); - builder.Property(m => m.Id).ValueGeneratedOnAdd(); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/ProjectPropertyConfiguration.cs b/backend/dal/Configuration/ProjectPropertyConfiguration.cs deleted file mode 100644 index 589550bb41..0000000000 --- a/backend/dal/Configuration/ProjectPropertyConfiguration.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// ProjectPropertyConfiguration class, provides a way to configure project properties in the database. - /// - public class ProjectPropertyConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("ProjectProperties"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).ValueGeneratedOnAdd(); - - builder.Property(m => m.ProjectId).IsRequired(); - - builder.HasOne(m => m.Project).WithMany(m => m.Properties).HasForeignKey(m => m.ProjectId).OnDelete(DeleteBehavior.Cascade); - builder.HasOne(m => m.Parcel).WithMany(m => m.Projects).HasForeignKey(m => m.ParcelId).OnDelete(DeleteBehavior.Cascade); - builder.HasOne(m => m.Building).WithMany(m => m.Projects).HasForeignKey(m => m.BuildingId).OnDelete(DeleteBehavior.Cascade); - - builder.HasIndex(m => new { m.ProjectId, m.ParcelId, m.BuildingId }).IsUnique(); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/ProjectReportConfiguration.cs b/backend/dal/Configuration/ProjectReportConfiguration.cs deleted file mode 100644 index da36790e46..0000000000 --- a/backend/dal/Configuration/ProjectReportConfiguration.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Core.Extensions; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// ProjectReportConfiguration class, provides a way to configure project reports in the database. - /// - public class ProjectReportConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("ProjectReports"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).IsRequired(); - builder.Property(m => m.Id).ValueGeneratedOnAdd(); - - builder.Property(m => m.Name).HasMaxLength(250).IsNullable(); - - builder.Property(m => m.From).HasColumnType("DATETIME2"); - builder.Property(m => m.To).HasColumnType("DATETIME2").IsRequired(); - - builder.HasIndex(m => new { m.Id, m.To, m.From, m.IsFinal }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/ProjectRiskConfiguration.cs b/backend/dal/Configuration/ProjectRiskConfiguration.cs deleted file mode 100644 index 42233b4b5f..0000000000 --- a/backend/dal/Configuration/ProjectRiskConfiguration.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// ProjectRiskConfiguration class, provides a way to configure project risks in the database. - /// - public class ProjectRiskConfiguration : CodeEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("ProjectRisks"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).ValueGeneratedOnAdd(); - - builder.Property(m => m.Code).HasMaxLength(10); - builder.Property(m => m.Code).IsRequired(); - - builder.Property(m => m.Name).HasMaxLength(150); - builder.Property(m => m.Name).IsRequired(); - - builder.Property(m => m.Description).HasMaxLength(500); - - builder.HasIndex(m => new { m.Code }).IsUnique(); - builder.HasIndex(m => new { m.IsDisabled, m.Code, m.Name, m.SortOrder }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/ProjectSnapshotConfiguration.cs b/backend/dal/Configuration/ProjectSnapshotConfiguration.cs deleted file mode 100644 index 1537ce9644..0000000000 --- a/backend/dal/Configuration/ProjectSnapshotConfiguration.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// ProjectSnapshotConfiguration class, provides a way to configure project Snapshot in the database. - /// - public class ProjectSnapshotConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("ProjectSnapshots"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).ValueGeneratedOnAdd(); - - builder.Property(m => m.ProjectId).IsRequired(); - - builder.Property(m => m.SnapshotOn).HasColumnType("DATETIME2"); - - builder.Property(m => m.Market).HasColumnType("MONEY"); - builder.Property(m => m.Assessed).HasColumnType("MONEY"); - builder.Property(m => m.Appraised).HasColumnType("MONEY"); - builder.Property(m => m.NetBook).HasColumnType("MONEY"); - - builder.Property(m => m.Metadata).HasColumnType("NVARCHAR(MAX)"); - - builder.HasOne(m => m.Project).WithMany(p => p.Snapshots).HasForeignKey(m => m.ProjectId).OnDelete(DeleteBehavior.Cascade); - - builder.HasIndex(m => new { m.ProjectId, m.SnapshotOn }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/ProjectStatusConfiguration.cs b/backend/dal/Configuration/ProjectStatusConfiguration.cs deleted file mode 100644 index 032bebb05c..0000000000 --- a/backend/dal/Configuration/ProjectStatusConfiguration.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// ProjectStatusConfiguration class, provides a way to configure project status in the database. - /// - public class ProjectStatusConfiguration : LookupEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("ProjectStatus"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).IsRequired(); - builder.Property(m => m.Id).ValueGeneratedOnAdd(); - - builder.Property(m => m.Code).IsRequired(); - builder.Property(m => m.Code).HasMaxLength(10); - - builder.Property(m => m.Name).IsRequired(); - builder.Property(m => m.Name).HasMaxLength(150); - builder.Property(m => m.GroupName).HasMaxLength(150); - - builder.Property(m => m.Description).HasMaxLength(1000); - - builder.Property(m => m.IsMilestone).HasDefaultValue(false); - builder.Property(m => m.IsTerminal).HasDefaultValue(false); - - builder.Property(m => m.Route).IsRequired(); - builder.Property(m => m.Route).HasMaxLength(150); - - builder.HasIndex(m => new { m.Code }).IsUnique(); - builder.HasIndex(m => new { m.IsDisabled, m.Name, m.Code, m.SortOrder }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/ProjectStatusHistoryConfiguration.cs b/backend/dal/Configuration/ProjectStatusHistoryConfiguration.cs deleted file mode 100644 index 32f943f631..0000000000 --- a/backend/dal/Configuration/ProjectStatusHistoryConfiguration.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// ProjectStatusHistoryConfiguration class, provides a way to keep project status history in the database. - /// - public class ProjectStatusHistoryConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("ProjectStatusHistory"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id) - .IsRequired() - .ValueGeneratedOnAdd(); - - builder.HasOne(m => m.Project).WithMany(s => s.StatusHistory).HasForeignKey(m => m.ProjectId).OnDelete(DeleteBehavior.Cascade); - builder.HasOne(m => m.Status).WithMany().HasForeignKey(m => m.StatusId).OnDelete(DeleteBehavior.Restrict); - builder.HasOne(m => m.Workflow).WithMany().HasForeignKey(m => m.WorkflowId).OnDelete(DeleteBehavior.Restrict); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/ProjectStatusNotificationConfiguration.cs b/backend/dal/Configuration/ProjectStatusNotificationConfiguration.cs deleted file mode 100644 index a0ce4dd0b2..0000000000 --- a/backend/dal/Configuration/ProjectStatusNotificationConfiguration.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// ProjectStatusNotificationConfiguration class, provides a way to configure valid project status notifications in the database. - /// - public class ProjectStatusNotificationConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("ProjectStatusNotifications"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).ValueGeneratedOnAdd(); - - builder.HasOne(m => m.Template).WithMany(m => m.Status).HasForeignKey(m => m.TemplateId).OnDelete(DeleteBehavior.ClientCascade); - builder.HasOne(m => m.FromStatus).WithMany().HasForeignKey(m => m.FromStatusId).OnDelete(DeleteBehavior.ClientCascade); - builder.HasOne(m => m.ToStatus).WithMany().HasForeignKey(m => m.ToStatusId).OnDelete(DeleteBehavior.ClientCascade); - - builder.HasIndex(m => new { m.FromStatusId, m.ToStatusId }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/ProjectStatusTransitionConfiguration.cs b/backend/dal/Configuration/ProjectStatusTransitionConfiguration.cs deleted file mode 100644 index 6c31ebfa2a..0000000000 --- a/backend/dal/Configuration/ProjectStatusTransitionConfiguration.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// ProjectStatusTransitionConfiguration class, provides a way to configure project status transitions in the database. - /// - public class ProjectStatusTransitionConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("ProjectStatusTransitions"); - - builder.HasKey(m => new { m.FromWorkflowId, m.FromStatusId, m.ToWorkflowId, m.ToStatusId }); - builder.Property(m => m.FromWorkflowId).IsRequired(); - builder.Property(m => m.FromWorkflowId).ValueGeneratedNever(); - builder.Property(m => m.FromStatusId).IsRequired(); - builder.Property(m => m.FromStatusId).ValueGeneratedNever(); - builder.Property(m => m.ToWorkflowId).IsRequired(); - builder.Property(m => m.ToWorkflowId).ValueGeneratedNever(); - builder.Property(m => m.ToStatusId).IsRequired(); - builder.Property(m => m.ToStatusId).ValueGeneratedNever(); - - builder.Property(m => m.Action).HasMaxLength(100); - - builder.HasOne(m => m.FromWorkflowStatus).WithMany(m => m.ToStatus).HasForeignKey(m => new { m.FromWorkflowId, m.FromStatusId }).OnDelete(DeleteBehavior.Cascade); - builder.HasOne(m => m.ToWorkflowStatus).WithMany(m => m.FromStatus).HasForeignKey(m => new { m.ToWorkflowId, m.ToStatusId }).OnDelete(DeleteBehavior.ClientCascade); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/ProjectTaskConfiguration.cs b/backend/dal/Configuration/ProjectTaskConfiguration.cs deleted file mode 100644 index e820f1a1cb..0000000000 --- a/backend/dal/Configuration/ProjectTaskConfiguration.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// ProjectTaskConfiguration class, provides a way to configure project tasks in the database. - /// - public class ProjectTaskConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("ProjectTasks"); - - builder.HasKey(m => new { m.ProjectId, m.TaskId }); - builder.Property(m => m.ProjectId).IsRequired(); - builder.Property(m => m.ProjectId).ValueGeneratedNever(); - builder.Property(m => m.TaskId).IsRequired(); - builder.Property(m => m.TaskId).ValueGeneratedNever(); - - builder.Property(m => m.CompletedOn).HasColumnType("DATETIME2"); - - builder.HasOne(m => m.Project).WithMany(m => m.Tasks).HasForeignKey(m => m.ProjectId).OnDelete(DeleteBehavior.Cascade); - builder.HasOne(m => m.Task).WithMany().HasForeignKey(m => m.TaskId).OnDelete(DeleteBehavior.Cascade); - - builder.HasIndex(m => new { m.ProjectId, m.TaskId, m.IsCompleted, m.CompletedOn }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/PropertyClassificationConfiguration.cs b/backend/dal/Configuration/PropertyClassificationConfiguration.cs deleted file mode 100644 index 1e54bade51..0000000000 --- a/backend/dal/Configuration/PropertyClassificationConfiguration.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// PropertyClassificationConfiguration class, provides a way to configure property classifications in the database. - /// - public class PropertyClassificationConfiguration : LookupEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("PropertyClassifications"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).IsRequired(); - builder.Property(m => m.Id).ValueGeneratedNever(); - - builder.Property(m => m.Name).IsRequired(); - builder.Property(m => m.Name).HasMaxLength(150); - - builder.HasIndex(m => new { m.Name }).IsUnique(); - builder.HasIndex(m => new { m.IsDisabled, m.Name }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/PropertyConfiguration`.cs b/backend/dal/Configuration/PropertyConfiguration`.cs deleted file mode 100644 index 7c25bb5ee3..0000000000 --- a/backend/dal/Configuration/PropertyConfiguration`.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// PropertyConfiguration class, provides a way to configure properties in the database. - /// - public abstract class PropertyConfiguration : BaseEntityConfiguration - where TBase : Property - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.Property(m => m.ProjectNumbers).HasMaxLength(2000); - builder.Property(m => m.Name).HasMaxLength(250); - builder.Property(m => m.Description).HasMaxLength(2000); - builder.Property(m => m.Location).HasColumnType("GEOGRAPHY").IsRequired(); - builder.Property(m => m.Boundary).HasColumnType("GEOGRAPHY"); - builder.Property(m => m.IsSensitive).HasDefaultValue(false); - builder.Property(m => m.IsVisibleToOtherAgencies).HasDefaultValue(false); - - builder.HasOne(m => m.Classification).WithMany().HasForeignKey(m => m.ClassificationId).IsRequired().OnDelete(DeleteBehavior.ClientSetNull); - builder.HasOne(m => m.Address).WithMany().HasForeignKey(m => m.AddressId).OnDelete(DeleteBehavior.ClientSetNull); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/PropertyTypeConfiguration.cs b/backend/dal/Configuration/PropertyTypeConfiguration.cs deleted file mode 100644 index 1eba3210e1..0000000000 --- a/backend/dal/Configuration/PropertyTypeConfiguration.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// PropertyTypeConfiguration class, provides a way to configure property types in the database. - /// - public class PropertyTypeConfiguration : LookupEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("PropertyTypes"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).IsRequired(); - builder.Property(m => m.Id).ValueGeneratedNever(); - - builder.Property(m => m.Name).IsRequired(); - builder.Property(m => m.Name).HasMaxLength(150); - - builder.HasIndex(m => new { m.Name }).IsUnique(); - builder.HasIndex(m => new { m.IsDisabled, m.Name, m.SortOrder }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/ProvinceConfiguration.cs b/backend/dal/Configuration/ProvinceConfiguration.cs deleted file mode 100644 index f10f649ff4..0000000000 --- a/backend/dal/Configuration/ProvinceConfiguration.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// ProvinceConfiguration class, provides a way to configure provinces in the database. - /// - public class ProvinceConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("Provinces"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).IsRequired(); - builder.Property(m => m.Id).ValueGeneratedNever(); - builder.Property(m => m.Id).HasMaxLength(2); - - builder.Property(m => m.Name).IsRequired(); - builder.Property(m => m.Name).HasMaxLength(150); - - builder.HasIndex(m => new { m.Name }).IsUnique(); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/RoleClaimConfiguration.cs b/backend/dal/Configuration/RoleClaimConfiguration.cs deleted file mode 100644 index ce5809d84e..0000000000 --- a/backend/dal/Configuration/RoleClaimConfiguration.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// RoleClaimConfiguration class, provides a way to configure user roles in the database. - /// - public class RoleClaimConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("RoleClaims"); - - builder.HasKey(m => new { m.RoleId, m.ClaimId }); - - builder.Property(m => m.RoleId).IsRequired(); - builder.Property(m => m.RoleId).ValueGeneratedNever(); - - builder.Property(m => m.ClaimId).IsRequired(); - builder.Property(m => m.ClaimId).ValueGeneratedNever(); - - builder.HasOne(m => m.Role).WithMany(m => m.Claims).HasForeignKey(m => m.RoleId).OnDelete(DeleteBehavior.ClientCascade); - builder.HasOne(m => m.Claim).WithMany(m => m.Roles).HasForeignKey(m => m.ClaimId).OnDelete(DeleteBehavior.ClientCascade); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/RoleConfiguration.cs b/backend/dal/Configuration/RoleConfiguration.cs deleted file mode 100644 index e44443b9b8..0000000000 --- a/backend/dal/Configuration/RoleConfiguration.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// RoleConfiguration class, provides a way to configure roles in the database. - /// - public class RoleConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("Roles"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).IsRequired(); - builder.Property(m => m.Id).ValueGeneratedNever(); - - builder.Property(m => m.Name).IsRequired(); - builder.Property(m => m.Name).HasMaxLength(100); - - builder.Property(m => m.Description).HasMaxLength(500); - - builder.HasIndex(m => new { m.Name }).IsUnique(); - builder.HasIndex(m => new { m.IsDisabled, m.Name }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/TaskConfiguration.cs b/backend/dal/Configuration/TaskConfiguration.cs deleted file mode 100644 index e236d45941..0000000000 --- a/backend/dal/Configuration/TaskConfiguration.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// TaskConfiguration class, provides a way to configure process tasks in the database. - /// - public class TaskConfiguration : LookupEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("Tasks"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).ValueGeneratedOnAdd(); - - builder.Property(m => m.Name).IsRequired(); - builder.Property(m => m.Name).HasMaxLength(150); - - builder.Property(m => m.Description).HasMaxLength(1000); - - builder.HasOne(m => m.Status).WithMany(m => m.Tasks).HasForeignKey(m => m.StatusId).OnDelete(DeleteBehavior.ClientSetNull); - - builder.HasIndex(m => new { m.IsDisabled, m.IsOptional, m.Name, m.SortOrder }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/TierLevelConfiguration.cs b/backend/dal/Configuration/TierLevelConfiguration.cs deleted file mode 100644 index 75516946a3..0000000000 --- a/backend/dal/Configuration/TierLevelConfiguration.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// TierLevelConfiguration class, provides a way to configure project tier levels in the database. - /// - public class TierLevelConfiguration : LookupEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("TierLevels"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).IsRequired(); - builder.Property(m => m.Id).ValueGeneratedOnAdd(); - - builder.Property(m => m.Name).IsRequired(); - builder.Property(m => m.Name).HasMaxLength(150); - - builder.Property(m => m.Description).HasMaxLength(1000); - - builder.HasIndex(m => new { m.Name }).IsUnique(); - builder.HasIndex(m => new { m.IsDisabled, m.Name, m.SortOrder }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/UserAgencyConfiguration.cs b/backend/dal/Configuration/UserAgencyConfiguration.cs deleted file mode 100644 index 1f871e42ef..0000000000 --- a/backend/dal/Configuration/UserAgencyConfiguration.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// UserAgencyConfiguration class, provides a way to configure user agencies in the database. - /// - public class UserAgencyConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("UserAgencies"); - - builder.HasKey(m => new { m.UserId, m.AgencyId }); - - builder.Property(m => m.UserId).IsRequired(); - builder.Property(m => m.UserId).ValueGeneratedNever(); - - builder.Property(m => m.AgencyId).IsRequired(); - builder.Property(m => m.AgencyId).ValueGeneratedNever(); - - builder.HasOne(m => m.User).WithMany(m => m.Agencies).HasForeignKey(m => m.UserId).OnDelete(DeleteBehavior.ClientCascade); - builder.HasOne(m => m.Agency).WithMany(m => m.Users).HasForeignKey(m => m.AgencyId).OnDelete(DeleteBehavior.ClientCascade); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/UserConfiguration.cs b/backend/dal/Configuration/UserConfiguration.cs deleted file mode 100644 index e25f0f4ee0..0000000000 --- a/backend/dal/Configuration/UserConfiguration.cs +++ /dev/null @@ -1,59 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// UserConfiguration class, provides a way to configure users in the database. - /// - public class UserConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("Users"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).IsRequired(); - builder.Property(m => m.Id).ValueGeneratedNever(); - - builder.Property(m => m.Username).IsRequired(); - builder.Property(m => m.Username).HasMaxLength(25); - - builder.Property(m => m.DisplayName).IsRequired(); - builder.Property(m => m.DisplayName).HasMaxLength(100); - - builder.Property(m => m.FirstName).IsRequired(); - builder.Property(m => m.FirstName).HasMaxLength(100); - - builder.Property(m => m.MiddleName).HasMaxLength(100); - - builder.Property(m => m.LastName).IsRequired(); - builder.Property(m => m.LastName).HasMaxLength(100); - - builder.Property(m => m.Email).IsRequired(); - builder.Property(m => m.Email).HasMaxLength(100); - - builder.Property(m => m.Position).HasMaxLength(100); - builder.Property(m => m.Note).HasMaxLength(1000); - - builder.Property(m => m.EmailVerified).HasDefaultValue(false); - builder.Property(m => m.IsDisabled).HasDefaultValue(false); - - builder.HasIndex(m => new { m.Email }).IsUnique(); - builder.HasIndex(m => new { m.Username }).IsUnique(); - builder.HasIndex(m => new { m.IsDisabled, m.LastName, m.FirstName }); - - builder.Property(m => m.ApprovedOn).HasColumnType("DATETIME2"); - builder.Property(m => m.LastLogin).HasColumnType("DATETIME2"); - - builder.HasOne(m => m.ApprovedBy).WithMany().HasForeignKey(m => m.ApprovedById).OnDelete(DeleteBehavior.ClientSetNull); - - builder.HasIndex(m => new { m.KeycloakUserId, m.Username, m.Email }).IsUnique(true); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/UserRoleConfiguration.cs b/backend/dal/Configuration/UserRoleConfiguration.cs deleted file mode 100644 index ad6fdac877..0000000000 --- a/backend/dal/Configuration/UserRoleConfiguration.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// UserRoleConfiguration class, provides a way to configure user roles in the database. - /// - public class UserRoleConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("UserRoles"); - - builder.HasKey(m => new { m.UserId, m.RoleId }); - - builder.Property(m => m.UserId).IsRequired(); - builder.Property(m => m.UserId).ValueGeneratedNever(); - - builder.Property(m => m.RoleId).IsRequired(); - builder.Property(m => m.RoleId).ValueGeneratedNever(); - - builder.HasOne(m => m.User).WithMany(m => m.Roles).HasForeignKey(m => m.UserId).OnDelete(DeleteBehavior.ClientCascade); - builder.HasOne(m => m.Role).WithMany(m => m.Users).HasForeignKey(m => m.RoleId).OnDelete(DeleteBehavior.ClientCascade); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/Views/PropertyConfiguration.cs b/backend/dal/Configuration/Views/PropertyConfiguration.cs deleted file mode 100644 index 28745f145f..0000000000 --- a/backend/dal/Configuration/Views/PropertyConfiguration.cs +++ /dev/null @@ -1,153 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; -using System.Linq; -using System; - -namespace Pims.Dal.Configuration.Views -{ - /// - /// PropertyConfiguration class, provides a way to configure the properties view in the database. - /// - public class PropertyConfiguration : IEntityTypeConfiguration - { - #region Properties - public PimsContext Context { get; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a PropertyConfiguration object, initializes with specified parameters. - /// - /// - public PropertyConfiguration(PimsContext context) - { - this.Context = context; - } - #endregion - - #region Methods - public virtual void Configure(EntityTypeBuilder builder) - { - if (!this.Context.Database.IsInMemory()) - { - builder.ToView("View_Properties"); - builder.HasNoKey(); - } - else - { - // This is required to support unit-testing the view in the InMemory database. - builder - .HasNoKey() - .ToInMemoryQuery(() => ( - from b in this.Context.Buildings - select new Entities.Views.Property() - { - Id = b.Id, - PropertyTypeId = PropertyTypes.Building, - ClassificationId = b.ClassificationId, - Classification = b.Classification.Name, - Name = b.Name, - Description = b.Description, - IsSensitive = b.IsSensitive, - IsVisibleToOtherAgencies = b.IsVisibleToOtherAgencies, - Location = b.Location, - Boundary = b.Boundary, - - Address = $"{b.Address.Address1} {b.Address.Address2})".Trim(), - AdministrativeArea = b.Address.AdministrativeArea, - Province = b.Address.Province.Name, - Postal = b.Address.Postal, - - AgencyId = b.AgencyId, - Agency = b.Agency.ParentId.HasValue ? b.Agency.Parent.Name : b.Agency.Name, - AgencyCode = b.Agency.ParentId.HasValue ? b.Agency.Parent.Code : b.Agency.Code, - SubAgency = b.Agency.ParentId.HasValue ? null : b.Agency.Name, - SubAgencyCode = b.Agency.ParentId.HasValue ? null : b.Agency.Code, - - Market = b.Fiscals.Any(f => f.Key == FiscalKeys.Market) ? b.Fiscals.OrderByDescending(f => f.FiscalYear).FirstOrDefault(f => f.Key == FiscalKeys.Market).Value : (decimal?)null, - MarketFiscalYear = b.Fiscals.Any(f => f.Key == FiscalKeys.Market) ? b.Fiscals.OrderByDescending(f => f.FiscalYear).FirstOrDefault(f => f.Key == FiscalKeys.Market).FiscalYear : (int?)null, - NetBook = b.Fiscals.Any(f => f.Key == FiscalKeys.NetBook) ? b.Fiscals.OrderByDescending(f => f.FiscalYear).FirstOrDefault(f => f.Key == FiscalKeys.NetBook).Value : (decimal?)null, - NetBookFiscalYear = b.Fiscals.Any(f => f.Key == FiscalKeys.NetBook) ? b.Fiscals.OrderByDescending(f => f.FiscalYear).FirstOrDefault(f => f.Key == FiscalKeys.NetBook).FiscalYear : (int?)null, - AssessedLand = b.Evaluations.Any(f => f.Key == EvaluationKeys.Assessed) ? b.Evaluations.OrderByDescending(f => f.Date).FirstOrDefault(f => f.Key == EvaluationKeys.Assessed).Value : (decimal?)null, - AssessedLandDate = b.Evaluations.Any(f => f.Key == EvaluationKeys.Assessed) ? b.Evaluations.OrderByDescending(f => f.Date).FirstOrDefault(f => f.Key == EvaluationKeys.Assessed).Date : (DateTime?)null, - AssessedBuilding = b.Evaluations.Any(f => f.Key == EvaluationKeys.Improvements) ? b.Evaluations.OrderByDescending(f => f.Date).FirstOrDefault(f => f.Key == EvaluationKeys.Improvements).Value : (decimal?)null, - AssessedBuildingDate = b.Evaluations.Any(f => f.Key == EvaluationKeys.Improvements) ? b.Evaluations.OrderByDescending(f => f.Date).FirstOrDefault(f => f.Key == EvaluationKeys.Improvements).Date : (DateTime?)null, - - RentableArea = b.RentableArea, - BuildingFloorCount = b.BuildingFloorCount, - BuildingConstructionTypeId = b.BuildingConstructionTypeId, - BuildingConstructionType = b.BuildingConstructionType.Name, - BuildingOccupantTypeId = b.BuildingOccupantTypeId, - BuildingOccupantType = b.BuildingOccupantType.Name, - BuildingPredominateUseId = b.BuildingPredominateUseId, - BuildingPredominateUse = b.BuildingPredominateUse.Name, - BuildingTenancy = b.BuildingTenancy, - - PID = b.Parcels.FirstOrDefault().Parcel.PID, - PIN = b.Parcels.FirstOrDefault().Parcel.PIN, - Zoning = b.Parcels.FirstOrDefault().Parcel.Zoning, - ZoningPotential = b.Parcels.FirstOrDefault().Parcel.ZoningPotential, - LandArea = b.Parcels.FirstOrDefault().Parcel.LandArea, - LandLegalDescription = b.Parcels.FirstOrDefault().Parcel.LandLegalDescription, - UpdatedOn = b.UpdatedOn - }) - .Union( - from p in this.Context.Parcels - select new Entities.Views.Property() - { - Id = p.Id, - PropertyTypeId = PropertyTypes.Land, - ClassificationId = p.ClassificationId, - Classification = p.Classification.Name, - Name = p.Name, - Description = p.Description, - IsSensitive = p.IsSensitive, - IsVisibleToOtherAgencies = p.IsVisibleToOtherAgencies, - Location = p.Location, - Boundary = p.Boundary, - - Address = $"{p.Address.Address1} {p.Address.Address2})".Trim(), - AdministrativeArea = p.Address.AdministrativeArea, - Province = p.Address.Province.Name, - Postal = p.Address.Postal, - - AgencyId = p.AgencyId, - Agency = p.Agency.ParentId.HasValue ? p.Agency.Parent.Name : p.Agency.Name, - AgencyCode = p.Agency.ParentId.HasValue ? p.Agency.Parent.Code : p.Agency.Code, - SubAgency = p.Agency.ParentId.HasValue ? null : p.Agency.Name, - SubAgencyCode = p.Agency.ParentId.HasValue ? null : p.Agency.Code, - - Market = p.Fiscals.Any(f => f.Key == FiscalKeys.Market) ? p.Fiscals.OrderByDescending(f => f.FiscalYear).FirstOrDefault(f => f.Key == FiscalKeys.Market).Value : (decimal?)null, - MarketFiscalYear = p.Fiscals.Any(f => f.Key == FiscalKeys.Market) ? p.Fiscals.OrderByDescending(f => f.FiscalYear).FirstOrDefault(f => f.Key == FiscalKeys.Market).FiscalYear : (int?)null, - NetBook = p.Fiscals.Any(f => f.Key == FiscalKeys.NetBook) ? p.Fiscals.OrderByDescending(f => f.FiscalYear).FirstOrDefault(f => f.Key == FiscalKeys.NetBook).Value : (decimal?)null, - NetBookFiscalYear = p.Fiscals.Any(f => f.Key == FiscalKeys.NetBook) ? p.Fiscals.OrderByDescending(f => f.FiscalYear).FirstOrDefault(f => f.Key == FiscalKeys.NetBook).FiscalYear : (int?)null, - AssessedLand = p.Evaluations.Any(f => f.Key == EvaluationKeys.Assessed) ? p.Evaluations.OrderByDescending(f => f.Date).FirstOrDefault(f => f.Key == EvaluationKeys.Assessed).Value : (decimal?)null, - AssessedLandDate = p.Evaluations.Any(f => f.Key == EvaluationKeys.Assessed) ? p.Evaluations.OrderByDescending(f => f.Date).FirstOrDefault(f => f.Key == EvaluationKeys.Assessed).Date : (DateTime?)null, - AssessedBuilding = p.Evaluations.Any(f => f.Key == EvaluationKeys.Improvements) ? p.Evaluations.OrderByDescending(f => f.Date).FirstOrDefault(f => f.Key == EvaluationKeys.Improvements).Value : (decimal?)null, - AssessedBuildingDate = p.Evaluations.Any(f => f.Key == EvaluationKeys.Improvements) ? p.Evaluations.OrderByDescending(f => f.Date).FirstOrDefault(f => f.Key == EvaluationKeys.Improvements).Date : (DateTime?)null, - - RentableArea = 0, - BuildingFloorCount = 0, - BuildingConstructionTypeId = 0, - BuildingConstructionType = null, - BuildingOccupantTypeId = 0, - BuildingOccupantType = null, - BuildingPredominateUseId = 0, - BuildingPredominateUse = null, - BuildingTenancy = null, - - PID = p.PID, - PIN = p.PIN, - Zoning = p.Zoning, - ZoningPotential = p.ZoningPotential, - LandArea = p.LandArea, - LandLegalDescription = p.LandLegalDescription, - UpdatedOn = p.UpdatedOn - } - )); - } - } - #endregion - } -} diff --git a/backend/dal/Configuration/WorkflowConfiguration.cs b/backend/dal/Configuration/WorkflowConfiguration.cs deleted file mode 100644 index fb68633f3e..0000000000 --- a/backend/dal/Configuration/WorkflowConfiguration.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// WorkflowConfiguration class, provides a way to configure workflow in the database. - /// - public class WorkflowConfiguration : LookupEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("Workflows"); - - builder.HasKey(m => m.Id); - builder.Property(m => m.Id).IsRequired(); - builder.Property(m => m.Id).ValueGeneratedOnAdd(); - - builder.Property(m => m.Name).IsRequired(); - builder.Property(m => m.Name).HasMaxLength(150); - - builder.Property(m => m.Code).IsRequired(); - builder.Property(m => m.Code).HasMaxLength(20); - - builder.Property(m => m.Description).IsRequired(); - builder.Property(m => m.Description).HasMaxLength(500); - - builder.HasIndex(m => new { m.Name }).IsUnique(); - builder.HasIndex(m => new { m.Code }).IsUnique(); - builder.HasIndex(m => new { m.IsDisabled, m.Name, m.SortOrder }); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Configuration/WorkflowProjectStatusConfiguration.cs b/backend/dal/Configuration/WorkflowProjectStatusConfiguration.cs deleted file mode 100644 index 224c70c054..0000000000 --- a/backend/dal/Configuration/WorkflowProjectStatusConfiguration.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Pims.Dal.Entities; - -namespace Pims.Dal.Configuration -{ - /// - /// WorkflowProjectStatusConfiguration class, provides a way to configure project properties in the database. - /// - public class WorkflowProjectStatusConfiguration : BaseEntityConfiguration - { - #region Methods - public override void Configure(EntityTypeBuilder builder) - { - builder.ToTable("WorkflowProjectStatus"); - - builder.HasKey(m => new { m.WorkflowId, m.StatusId }); - builder.Property(m => m.WorkflowId).IsRequired(); - builder.Property(m => m.WorkflowId).ValueGeneratedNever(); - builder.Property(m => m.StatusId).IsRequired(); - builder.Property(m => m.StatusId).ValueGeneratedNever(); - - builder.HasOne(m => m.Workflow).WithMany(m => m.Status).HasForeignKey(m => m.WorkflowId).OnDelete(DeleteBehavior.Cascade); - builder.HasOne(m => m.Status).WithMany(m => m.Workflows).HasForeignKey(m => m.StatusId).OnDelete(DeleteBehavior.Cascade); - - base.Configure(builder); - } - #endregion - } -} diff --git a/backend/dal/Exceptions/ConfigurationException.cs b/backend/dal/Exceptions/ConfigurationException.cs deleted file mode 100644 index 1eb243b14c..0000000000 --- a/backend/dal/Exceptions/ConfigurationException.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; - -namespace Pims.Dal.Exceptions -{ - /// - /// ConfigurationException class, provides a way to throw an exception when a configuration is invalid. - /// - public class ConfigurationException : Exception - { - #region Constructors - /// - /// Creates a new instance of a ConfigurationException class. - /// - /// - public ConfigurationException() : base() { } - - /// - /// Creates a new instance of a ConfigurationException class, and initializes it with the specified arguments. - /// - /// - /// - public ConfigurationException(string message) : base(message) { } - - /// - /// Creates a new instance of a ConfigurationException class, and initializes it with the specified arguments. - /// - /// - /// - /// - public ConfigurationException(string message, Exception innerException) : base(message, innerException) { } - #endregion - } -} diff --git a/backend/dal/Exceptions/NotAuthorizedException.cs b/backend/dal/Exceptions/NotAuthorizedException.cs deleted file mode 100644 index 0b484f26a7..0000000000 --- a/backend/dal/Exceptions/NotAuthorizedException.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; - -namespace Pims.Dal.Exceptions -{ - /// - /// NotAuthorizedException class, provides a way to throw an exception when a user is not authorized to perform an action. - /// - public class NotAuthorizedException : Exception - { - #region Constructors - /// - /// Creates a new instance of a NotAuthorizedException class. - /// - /// - public NotAuthorizedException() : base() { } - - /// - /// Creates a new instance of a NotAuthorizedException class, and initializes it with the specified arguments. - /// - /// - /// - public NotAuthorizedException(string message) : base(message ?? "User is not authorized to perform this action.") { } - - /// - /// Creates a new instance of a NotAuthorizedException class, and initializes it with the specified arguments. - /// - /// - /// - /// - public NotAuthorizedException(string message, Exception innerException) : base(message ?? "User is not authorized to perform this action.", innerException) { } - #endregion - } -} diff --git a/backend/dal/Exceptions/RowVersionMissingException.cs b/backend/dal/Exceptions/RowVersionMissingException.cs deleted file mode 100644 index 9088097daa..0000000000 --- a/backend/dal/Exceptions/RowVersionMissingException.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; - -namespace Pims.Dal.Exceptions -{ - /// - /// RowVersionMissingException class, provides a way to throw an exception when an attempt to update or remove an item does not include a RowVersion value. - /// - public class RowVersionMissingException : Exception - { - #region Constructors - /// - /// Creates a new instance of a RowVersionMissingException class. - /// - /// - public RowVersionMissingException() : base() { } - - /// - /// Creates a new instance of a RowVersionMissingException class, and initializes it with the specified arguments. - /// - /// - /// - public RowVersionMissingException(string message) : base(message) { } - - /// - /// Creates a new instance of a RowVersionMissingException class, and initializes it with the specified arguments. - /// - /// - /// - /// - public RowVersionMissingException(string message, Exception innerException) : base(message, innerException) { } - #endregion - } -} diff --git a/backend/dal/Helpers/Extensions/AddressExtensions.cs b/backend/dal/Helpers/Extensions/AddressExtensions.cs deleted file mode 100644 index 4c414fb079..0000000000 --- a/backend/dal/Helpers/Extensions/AddressExtensions.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Pims.Dal.Entities; - -namespace Pims.Dal.Helpers.Extensions -{ - /// - /// AddressExtensions static class, provides extension methods for projects. - /// - public static class AddressExtensions - { - /// - /// Format address to string. - /// - /// - /// - public static string FormatAddress(this Address address) - { - return address != null ? $"{address.Address1} {address.Address2}".Trim() : ""; - } - } -} diff --git a/backend/dal/Helpers/Extensions/ApplicationBuilderExtensions.cs b/backend/dal/Helpers/Extensions/ApplicationBuilderExtensions.cs deleted file mode 100644 index 130263abed..0000000000 --- a/backend/dal/Helpers/Extensions/ApplicationBuilderExtensions.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using System; -using System.Diagnostics.CodeAnalysis; - -namespace Pims.Dal.Helpers.Extensions -{ - /// - /// ApplicationBuilderExtensions static class, provides extension methods for ApplicationBuilder objects. - /// - /// - [ExcludeFromCodeCoverage] - public static class ApplicationBuilderExtensions - { - /// - /// Initialize the database when the application starts. - /// This isn't an ideal way to do this, but will work for our purposes. - /// - /// - public static void UpdateDatabase(this IApplicationBuilder app) - { - using var serviceScope = app.ApplicationServices - .GetRequiredService() - .CreateScope(); - var logger = serviceScope.ServiceProvider.GetService>(); - - try - { - using var context = serviceScope.ServiceProvider.GetService(); - context.Database.Migrate(); - } - catch (Exception ex) - { - logger.LogCritical(ex, "Database migration failed on startup."); - } - } - } -} diff --git a/backend/dal/Helpers/Extensions/BuildingExtensions.cs b/backend/dal/Helpers/Extensions/BuildingExtensions.cs deleted file mode 100644 index 4d7fad2d05..0000000000 --- a/backend/dal/Helpers/Extensions/BuildingExtensions.cs +++ /dev/null @@ -1,255 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Pims.Core.Extensions; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using Entity = Pims.Dal.Entities; - -namespace Pims.Dal.Helpers.Extensions -{ - /// - /// BuildingExtensions static class, provides extension methods for buildings. - /// - public static class BuildingExtensions - { - /// - /// Make a query to determine if the building names are unique. - /// - No two buildings should have the same name on a parcel. - /// - /// - /// - /// - /// The name within a parcel should be unique. - public static void ThrowIfNotUnique(this PimsContext context, Entity.Parcel parcel, Entity.Building building) - { - if (parcel == null || String.IsNullOrEmpty(building.Name)) - { - return; - } - var parcelBuildings = context.Parcels.Where(p => p.Id == parcel.Id).SelectMany(p => p.Buildings).Where(b => b.BuildingId != building.Id).Select(b => b.Building.Name).Distinct().ToArray(); - var alreadyExists = parcelBuildings.Contains(building.Name); - if (alreadyExists) throw new DbUpdateException("A building name must be unique on the parcel."); - } - - /// - /// Generate a query for the specified 'filter'. - /// - /// - /// - /// - /// - public static IQueryable GenerateQuery(this PimsContext context, ClaimsPrincipal user, Entity.Models.BuildingFilter filter) - { - filter.ThrowIfNull(nameof(filter)); - filter.ThrowIfNull(nameof(user)); - - //Fetching user's agencies from database - Guid? userId = context.Users.FirstOrDefault(u => u.Username == user.GetUsername())?.Id; - int[] userAgencies = context.UserAgencies.Where(ua => ua.UserId == userId).Select(ua => ua.AgencyId).ToArray(); - int[] subAgencies = context.Agencies.Where(a => a.ParentId != null && userAgencies.Contains(a.ParentId.Value)).Select(a => a.Id).ToArray(); - userAgencies = userAgencies.Concat(subAgencies).ToArray(); - - // Check if user has the ability to view sensitive properties. - bool viewSensitive = user.HasPermission(Permissions.SensitiveView); - bool isAdmin = user.HasPermission(Permissions.AdminProperties); - - // Users may only view sensitive properties if they have the `sensitive-view` claim and belong to the owning agency. - var query = context.Buildings.AsNoTracking(); - - if (!isAdmin) - { - query = query.Where(b => - b.IsVisibleToOtherAgencies - || ((!b.IsSensitive || viewSensitive) - && userAgencies.Contains(b.AgencyId.Value))); - } - - if (filter.NELatitude.HasValue && filter.NELongitude.HasValue && filter.SWLatitude.HasValue && filter.SWLongitude.HasValue) - { - var poly = new NetTopologySuite.Geometries.Envelope(filter.NELongitude.Value, filter.SWLongitude.Value, filter.NELatitude.Value, filter.SWLatitude.Value).ToPolygon(); - query = query.Where(p => poly.Contains(p.Location)); - } - - if (filter.Agencies?.Any() == true) - { - // Get list of sub-agencies for any agency selected in the filter. - var filterAgencies = filter.Agencies.Select(a => (int?)a); - var agencies = filterAgencies.Concat(context.Agencies.AsNoTracking().Where(a => filterAgencies.Contains(a.Id)).SelectMany(a => a.Children.Select(ac => (int?)ac.Id)).ToArray()).Distinct(); - query = query.Where(p => agencies.Contains(p.AgencyId)); - } - if (filter.ClassificationId.HasValue) - query = query.Where(p => p.ClassificationId == filter.ClassificationId); - if (!String.IsNullOrWhiteSpace(filter.ProjectNumber)) - query = query.Where(p => p.ProjectNumbers.Contains(filter.ProjectNumber)); - if (!String.IsNullOrWhiteSpace(filter.Description)) - query = query.Where(p => EF.Functions.Like(p.Description, $"%{filter.Description}%")); - if (filter.ConstructionTypeId.HasValue) - query = query.Where(b => b.BuildingConstructionTypeId == filter.ConstructionTypeId); - if (filter.PredominateUseId.HasValue) - query = query.Where(b => b.BuildingPredominateUseId == filter.PredominateUseId); - if (filter.FloorCount.HasValue) - query = query.Where(b => b.BuildingFloorCount == filter.FloorCount); - if (!String.IsNullOrWhiteSpace(filter.Tenancy)) - query = query.Where(b => EF.Functions.Like(b.BuildingTenancy, $"%{filter.Tenancy}%")); - - if (!String.IsNullOrWhiteSpace(filter.AdministrativeArea)) - query = query.Where(b => b.Parcels.Any(p => EF.Functions.Like(p.Parcel.Address.AdministrativeArea, $"%{filter.AdministrativeArea}%"))); - if (!String.IsNullOrWhiteSpace(filter.Zoning)) - query = query.Where(b => b.Parcels.Any(p => EF.Functions.Like(p.Parcel.Zoning, $"%{filter.Zoning}%"))); - if (!String.IsNullOrWhiteSpace(filter.ZoningPotential)) - query = query.Where(b => b.Parcels.Any(p => EF.Functions.Like(p.Parcel.ZoningPotential, $"%{filter.ZoningPotential}%"))); - - if (!String.IsNullOrWhiteSpace(filter.Address)) // TODO: Parse the address information by City, Postal, etc. - query = query.Where(b => EF.Functions.Like(b.Address.Address1, $"%{filter.Address}%") || EF.Functions.Like(b.Address.AdministrativeArea, $"%{filter.Address}%")); - - if (filter.MinRentableArea.HasValue) - query = query.Where(b => b.RentableArea >= filter.MinRentableArea); - if (filter.MaxRentableArea.HasValue) - query = query.Where(b => b.RentableArea <= filter.MaxRentableArea); - - // TODO: Review performance of the evaluation query component. - if (filter.MinMarketValue.HasValue) - query = query.Where(b => - filter.MinMarketValue <= b.Fiscals - .FirstOrDefault(e => e.FiscalYear == context.ParcelFiscals - .Where(pe => pe.ParcelId == b.Id && pe.Key == Entity.FiscalKeys.Market) - .Max(pe => pe.FiscalYear)) - .Value); - if (filter.MaxMarketValue.HasValue) - query = query.Where(b => - filter.MaxMarketValue >= b.Fiscals - .FirstOrDefault(e => e.FiscalYear == context.ParcelFiscals - .Where(pe => pe.ParcelId == b.Id && pe.Key == Entity.FiscalKeys.Market) - .Max(pe => pe.FiscalYear)) - .Value); - - // TODO: Review performance of the evaluation query component. - if (filter.MinAssessedValue.HasValue) - query = query.Where(b => - filter.MinAssessedValue <= b.Evaluations - .FirstOrDefault(e => e.Date == context.ParcelEvaluations - .Where(pe => pe.ParcelId == b.Id && pe.Key == Entity.EvaluationKeys.Assessed) - .Max(pe => pe.Date)) - .Value); - if (filter.MaxAssessedValue.HasValue) - query = query.Where(b => - filter.MaxAssessedValue >= b.Evaluations - .FirstOrDefault(e => e.Date == context.ParcelEvaluations - .Where(pe => pe.ParcelId == b.Id && pe.Key == Entity.EvaluationKeys.Assessed) - .Max(pe => pe.Date)) - .Value); - - if (filter.Sort?.Any() == true) - query = query.OrderByProperty(filter.Sort); - else - query = query.OrderBy(b => b.Id); - - return query; - } - - /// - /// Get a building zoning - /// - /// - /// - public static string[] GetZoning(this Entity.Building building) - { - return building.Parcels.Select(p => p.Parcel.Zoning).Where(s => !String.IsNullOrWhiteSpace(s)).ToArray(); - } - - /// - /// Get a building zoning potential - /// - /// - /// - public static string[] GetZoningPotential(this Entity.Building building) - { - return building.Parcels.Select(p => p.Parcel.ZoningPotential).Where(s => !String.IsNullOrWhiteSpace(s)).ToArray(); - } - - /// - /// Get the building construction type name. - /// - /// - /// - public static string GetConstructionType(this Entity.Building building) - { - return building.BuildingConstructionType?.Name; - } - - /// - /// Get the building occupant type name. - /// - /// - /// - public static string GetOccupantType(this Entity.Building building) - { - return building.BuildingOccupantType?.Name; - } - - /// - /// Get the building preduminate use name. - /// - /// - /// - public static string GetPredominateUse(this Entity.Building building) - { - return building.BuildingPredominateUse?.Name; - } - - /// - /// Get the first parcel this building is located on. - /// - /// - /// - public static int? GetParcelId(this Entity.Building building) - { - return building.Parcels.FirstOrDefault()?.ParcelId; - } - - /// - /// Update building financials - /// - /// - /// - /// - /// - public static void UpdateBuildingFinancials(this PimsContext context, Entity.Building building, - ICollection buildingEvaluations, ICollection buildingFiscals) - { - - foreach (var buildingEvaluation in buildingEvaluations) - { - var existingEvaluation = building.Evaluations - .FirstOrDefault(e => e.Date == buildingEvaluation.Date && e.Key == buildingEvaluation.Key); - var updateEvaluation = existingEvaluation?.Value != buildingEvaluation.Value; - - if (existingEvaluation == null) - { - building.Evaluations.Add(buildingEvaluation); - } - else if (updateEvaluation) - { - context.Entry(existingEvaluation).CurrentValues.SetValues(buildingEvaluation); - } - } - foreach (var buildingFiscal in buildingFiscals) - { - var originalBuildingFiscal = building.Fiscals - .FirstOrDefault(e => e.FiscalYear == buildingFiscal.FiscalYear && e.Key == buildingFiscal.Key); - - var updateFiscal = originalBuildingFiscal?.Value != buildingFiscal.Value || originalBuildingFiscal?.EffectiveDate != buildingFiscal.EffectiveDate; - if (originalBuildingFiscal == null) - { - building.Fiscals.Add(buildingFiscal); - } - else if (updateFiscal) - { - context.Entry(originalBuildingFiscal).CurrentValues.SetValues(buildingFiscal); - } - } - } - } -} diff --git a/backend/dal/Helpers/Extensions/DbContextExtensions.cs b/backend/dal/Helpers/Extensions/DbContextExtensions.cs deleted file mode 100644 index 5e8221eed1..0000000000 --- a/backend/dal/Helpers/Extensions/DbContextExtensions.cs +++ /dev/null @@ -1,58 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Pims.Core.Extensions; -using Pims.Dal.Entities; - -namespace Pims.Dal.Helpers.Extensions -{ - /// - /// DbContextExtensions static class, provides extension methods for DbContext objects. - /// - public static class DbContextExtensions - { - /// - /// When manipulating entities it is necessary to reset the original value for 'RowVersion' so that concurrency checking can occur. - /// - /// - /// - /// - public static void SetOriginalRowVersion(this DbContext context, T source) where T : BaseEntity - { - context.Entry(source).OriginalValues[nameof(BaseEntity.RowVersion)] = source.RowVersion; - } - - /// - /// Detach the entity from the context. - /// - /// - /// - /// - public static void Detach(this DbContext context, T entity) where T : BaseEntity - { - context.Entry(entity).State = EntityState.Detached; - } - - /// - /// Update the project number for the specified 'project' with the specified 'projectNumber'. - /// - /// - /// - /// - public static void UpdateProjectNumber(this PimsContext context, Project project, string projectNumber) - { - var originalProjectNumber = project.ProjectNumber; - project.ProjectNumber = projectNumber; - context.Update(project); - - project.Properties.ForEach(p => - { - if (p.PropertyType == PropertyTypes.Land && p.Parcel == null) - p.Parcel = context.Parcels.Find(p.ParcelId); - else if (p.PropertyType == PropertyTypes.Building && p.Building == null) - p.Building = context.Buildings.Find(p.BuildingId); - - context.Update(p.UpdateProjectNumbers(projectNumber)); - context.Update(p.RemoveProjectNumber(originalProjectNumber)); - }); - } - } -} diff --git a/backend/dal/Helpers/Extensions/EntityExtensions.cs b/backend/dal/Helpers/Extensions/EntityExtensions.cs deleted file mode 100644 index f872ca69ba..0000000000 --- a/backend/dal/Helpers/Extensions/EntityExtensions.cs +++ /dev/null @@ -1,92 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using Pims.Dal.Security; -using System.Security.Claims; - -namespace Pims.Dal.Helpers.Extensions -{ - /// - /// EntityExtensions static class, provides extensions methods for entities. - /// - public static class EntityExtensions - { - /// - /// Throw exception if the user is not allowed to edit the specified entity. - /// - /// - /// - /// - /// - /// - /// - /// Entity argument cannot be null. - /// Entity.RowVersion cannot be null. - /// User must have specified 'role'. - /// - public static T ThrowIfNotAllowedToEdit(this T entity, string paramName, ClaimsPrincipal user, string role, string message = null) where T : BaseEntity - { - entity.ThrowIfNull(paramName); - entity.ThrowIfRowVersionNull(paramName); - user.ThrowIfNotAuthorized(role, message); - - return entity; - } - - /// - /// Throw exception if the 'user' is not allowed to edit the specified 'entity'. - /// - /// - /// - /// - /// - /// - /// - /// Entity argument cannot be null. - /// Entity.RowVersion cannot be null. - /// User must have specified 'role'. - /// - public static T ThrowIfNotAllowedToEdit(this T entity, string paramName, ClaimsPrincipal user, Permissions permission, string message = null) where T : BaseEntity - { - entity.ThrowIfNull(paramName); - entity.ThrowIfRowVersionNull(paramName); - user.ThrowIfNotAuthorized(permission, message); - - return entity; - } - - /// - /// Throw exception if the 'user' is not allowed to edit the specified 'entity'. - /// - /// - /// - /// - /// - /// - /// - /// - /// Entity argument cannot be null. - /// Entity.RowVersion cannot be null. - /// User must have specified 'role'. - /// - public static T ThrowIfNotAllowedToEdit(this T entity, string paramName, ClaimsPrincipal user, Permissions[] permission, bool requireAll = false, string message = null) where T : BaseEntity - { - entity.ThrowIfNull(paramName); - entity.ThrowIfRowVersionNull(paramName); - if (requireAll) user.ThrowIfNotAllAuthorized(permission); - else user.ThrowIfNotAuthorized(permission, message); - - return entity; - } - - /// - /// When manipulating entities it is necessary to reset the original value for 'RowVersion' so that concurrency checking can occur. - /// - /// - /// - public static void SetOriginalRowVersion(this T source, DbContext context) where T : BaseEntity - { - context.SetOriginalRowVersion(source); - } - } -} diff --git a/backend/dal/Helpers/Extensions/EnumExtensions.cs b/backend/dal/Helpers/Extensions/EnumExtensions.cs deleted file mode 100644 index da446ae102..0000000000 --- a/backend/dal/Helpers/Extensions/EnumExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Pims.Dal.Security; -using System.ComponentModel.DataAnnotations; -using System.Linq; - -namespace Pims.Dal.Helpers.Extensions -{ - /// - /// EnumExtensions static class, provides extension methods for enum values. - /// - public static class EnumExtensions - { - /// - /// Get the Keycloak name value of the specified permission. - /// - /// - /// - public static string GetName(this Permissions permission) - { - var enumType = typeof(Permissions); - var memberInfos = enumType.GetMember(permission.ToString()); - var enumValueMemberInfo = memberInfos.FirstOrDefault(m => m.DeclaringType == enumType); - var attribute = (DisplayAttribute)enumValueMemberInfo.GetCustomAttributes(typeof(DisplayAttribute), false).FirstOrDefault(); - return attribute.Name; - } - } -} diff --git a/backend/dal/Helpers/Extensions/IdentityExtensions.cs b/backend/dal/Helpers/Extensions/IdentityExtensions.cs deleted file mode 100644 index 31bff2e4b5..0000000000 --- a/backend/dal/Helpers/Extensions/IdentityExtensions.cs +++ /dev/null @@ -1,216 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using Pims.Dal.Exceptions; -using Pims.Dal.Security; -using System; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Helpers.Extensions -{ - /// - /// IdentityExtensions static class, provides extension methods for user identity. - /// - public static class IdentityExtensions - { - /// - /// Determine if the user any of the specified permission. - /// - /// - /// - /// True if the user has any of the permission. - public static bool HasPermission(this ClaimsPrincipal user, params Permissions[] permission) - { - string[] usersRoles = user.Claims.Where(c => c.Type == "client_roles").Select(c => c.Value).ToArray(); - if (permission == null) throw new ArgumentNullException(nameof(permission)); - if (permission.Length == 0) throw new ArgumentOutOfRangeException(nameof(permission)); - - var roles = permission.Select(r => r.GetName()).ToArray(); - return usersRoles.Any(c => roles.Contains(c)); - } - - /// - /// Determine if the user all of the specified permissions. - /// - /// - /// - /// True if the user has all of the permissions. - public static bool HasPermissions(this ClaimsPrincipal user, params Permissions[] permission) - { - if (permission == null) throw new ArgumentNullException(nameof(permission)); - if (permission.Length == 0) throw new ArgumentOutOfRangeException(nameof(permission)); - - string[] roles = permission.Select(r => r.GetName()).ToArray(); - string[] usersRoles = user.Claims.Where(c => c.Type == "client_roles").Select(c => c.Value).ToArray(); - return usersRoles.All(c => roles.Contains(c)); - } - - /// - /// If the user does has not been authenticated throw a NotAuthorizedException. - /// - /// - /// - /// User does not have the specified 'role'. - /// - public static ClaimsPrincipal ThrowIfNotAuthorized(this ClaimsPrincipal user, string message = null) - { - if (user == null || !user.Identity.IsAuthenticated) throw new NotAuthorizedException(message); - return user; - } - - /// - /// If the user does not have the specified 'role' throw a NotAuthorizedException. - /// - /// - /// - /// - /// User does not have the specified 'role'. - /// - public static ClaimsPrincipal ThrowIfNotAuthorized(this ClaimsPrincipal user, string role, string message) - { - if (user == null || !user.HasRole(role)) throw new NotAuthorizedException(message); - return user; - } - - /// - /// If the user does not have the specified 'permission' throw a NotAuthorizedException. - /// - /// - /// - /// - /// User does not have the specified 'permission'. - /// - public static ClaimsPrincipal ThrowIfNotAuthorized(this ClaimsPrincipal user, Permissions permission, string message = null) - { - if (user == null || !user.HasPermission(permission)) throw new NotAuthorizedException(message); - return user; - } - - /// - /// If the user does not have any of the specified 'permission' throw a NotAuthorizedException. - /// - /// - /// - /// User does not have the specified 'role'. - /// - public static ClaimsPrincipal ThrowIfNotAuthorized(this ClaimsPrincipal user, params Permissions[] permission) - { - if (user == null || !user.HasPermission(permission)) throw new NotAuthorizedException(); - return user; - } - - /// - /// If the user does not have the all specified 'permission' throw a NotAuthorizedException. - /// - /// - /// - /// - /// User does not have the specified 'permission'. - /// - public static ClaimsPrincipal ThrowIfNotAllAuthorized(this ClaimsPrincipal user, Permissions permission, string message = null) - { - if (user == null || !user.HasPermissions(permission)) throw new NotAuthorizedException(message); - return user; - } - - /// - /// If the user does not have all of the specified 'permission' throw a NotAuthorizedException. - /// - /// - /// - /// User does not have the specified 'role'. - /// - public static ClaimsPrincipal ThrowIfNotAllAuthorized(this ClaimsPrincipal user, params Permissions[] permission) - { - if (user == null || !user.HasPermissions(permission)) throw new NotAuthorizedException(); - return user; - } - - /// - /// If the user does not have any of the specified 'permission' throw a NotAuthorizedException. - /// - /// - /// - /// - /// User does not have the specified 'role'. - /// - public static ClaimsPrincipal ThrowIfNotAuthorized(this ClaimsPrincipal user, Permissions[] permission, string message = null) - { - if (user == null || !user.HasPermission(permission)) throw new NotAuthorizedException(message); - return user; - } - - /// - /// Throw exception if the 'user' is not allowed to edit the specified entity. - /// - /// - /// - /// - /// - /// - /// - /// Entity argument cannot be null. - /// Entity.RowVersion cannot be null. - /// User must have specified 'role'. - /// - public static T ThrowIfNotAllowedToEdit(this ClaimsPrincipal user, string paramName, T entity, Permissions permission, string message = null) where T : BaseEntity - { - entity.ThrowIfNull(paramName); - entity.ThrowIfRowVersionNull(paramName); - user.ThrowIfNotAuthorized(permission, message); - - return entity; - } - - /// - /// Throw exception if the 'user' is not allowed to edit the specified entity. - /// - /// - /// - /// - /// - /// - /// - /// Entity argument cannot be null. - /// Entity.RowVersion cannot be null. - /// User must have specified 'role'. - /// - public static T ThrowIfNotAllowedToEdit(this ClaimsPrincipal user, string paramName, T entity, Permissions[] permission, string message = null) where T : BaseEntity - { - entity.ThrowIfNull(paramName); - entity.ThrowIfRowVersionNull(paramName); - user.ThrowIfNotAuthorized(permission, message); - - return entity; - } - - /// - /// A user is supposed to only belong to one child agency or one parent agency. - /// While in Keycloak these rules can be broken, we have to assume the first parent agency, or the first child agency is the user's primary. - /// - /// - /// - /// - public static Agency GetAgency(this ClaimsPrincipal user, PimsContext context) - { - //Fetching user's agencies from database - Guid? userId = context.Users.FirstOrDefault(u => u.Username == user.GetUsername())?.Id; - int[] agencyIds = context.UserAgencies.Where(ua => ua.UserId == userId).Select(ua => ua.AgencyId).ToArray(); - int[] subAgencies = context.Agencies.Where(a => a.ParentId != null && agencyIds.Contains(a.ParentId.Value)).Select(a => a.Id).ToArray(); - agencyIds = agencyIds.Concat(subAgencies).ToArray(); - - if (agencyIds == null || !agencyIds.Any()) return null; - - var agencies = context.Agencies.Where(a => agencyIds.Contains(a.Id)).OrderBy(a => a.ParentId); - - // If one of the agencies is a parent, return it. - var parentAgency = agencies.FirstOrDefault(a => a.ParentId == null); - if (parentAgency != null) - return parentAgency; - - // Assume the first agency is their primary - return agencies.FirstOrDefault(); - } - } -} diff --git a/backend/dal/Helpers/Extensions/NoteExtensions.cs b/backend/dal/Helpers/Extensions/NoteExtensions.cs deleted file mode 100644 index ba99f17e36..0000000000 --- a/backend/dal/Helpers/Extensions/NoteExtensions.cs +++ /dev/null @@ -1,71 +0,0 @@ -using Pims.Dal.Entities; -using System.Linq; - -namespace Pims.Dal.Helpers.Extensions -{ - /// - /// NoteExtensions static class, provides extension methods for notes. - /// - public static class NoteExtensions - { - /// - /// Add or update the note for the specified 'type' on the 'project'. - /// Presently only one note of each type is supported. - /// - /// - /// - /// - /// - public static ProjectNote AddOrUpdateNote(this Project project, NoteTypes type, string text) - { - var note = project.GetNote(type); - - if (note == null) - { - note = new ProjectNote(project, type, text); - project.Notes.Add(note); - } - else - { - note.Note = text; - } - - return note; - } - - /// - /// Add or update every note in the project with the specified 'src' project notes. - /// - /// - /// - public static void AddOrUpdateNotes(this Project dest, Project src) - { - foreach (var note in src.Notes) - { - dest.AddOrUpdateNote(note.NoteType, note.Note); - } - } - - /// - /// Get the note for the specified 'type' if it exists. - /// - /// - /// - /// Note for specified type, or null if one isn't found. - public static ProjectNote GetNote(this Project project, NoteTypes type) - { - return project.Notes.FirstOrDefault(n => n.NoteType == type); - } - - /// - /// Get the note text for the specified 'type' if it exists. - /// - /// - /// - /// Note for specified type, or null if one isn't found. - public static string GetNoteText(this Project project, NoteTypes type) - { - return project.GetNote(type)?.Note; - } - } -} diff --git a/backend/dal/Helpers/Extensions/NotificationQueueExtensions.cs b/backend/dal/Helpers/Extensions/NotificationQueueExtensions.cs deleted file mode 100644 index 32bfa1cc0e..0000000000 --- a/backend/dal/Helpers/Extensions/NotificationQueueExtensions.cs +++ /dev/null @@ -1,63 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Pims.Core.Extensions; -using System; -using System.Linq; -using System.Security.Claims; -using Entity = Pims.Dal.Entities; - -namespace Pims.Dal.Helpers.Extensions -{ - /// - /// NotificationQueueExtensions static class, provides extension methods for notification queue. - /// - public static class NotificationQueueExtensions - { - #region Methods - /// - /// Generate a query for the specified 'filter'. - /// - /// - /// - /// - /// - public static IQueryable GenerateQuery(this PimsContext context, ClaimsPrincipal user, Entity.Models.NotificationQueueFilter filter) - { - filter.ThrowIfNull(nameof(user)); - filter.ThrowIfNull(nameof(filter)); - - var query = context.NotificationQueue.AsNoTracking(); - - if (filter.Key.HasValue) - query = query.Where(p => p.Key == filter.Key); - if (filter.Status.HasValue) - query = query.Where(p => p.Status == filter.Status); - if (filter.ProjectId.HasValue) - query = query.Where(p => p.ProjectId == filter.ProjectId); - if (filter.AgencyId.HasValue) - query = query.Where(p => p.ToAgencyId == filter.AgencyId); - if (!String.IsNullOrWhiteSpace(filter.ProjectNumber)) - query = query.Where(p => p.Project.ProjectNumber == filter.ProjectNumber); - if (!String.IsNullOrWhiteSpace(filter.To)) - query = query.Where(p => EF.Functions.Like(p.To, $"%{filter.To}%")); - if (!String.IsNullOrWhiteSpace(filter.Subject)) - query = query.Where(p => EF.Functions.Like(p.Subject, $"%{filter.Subject}%")); - if (!String.IsNullOrWhiteSpace(filter.Body)) - query = query.Where(p => EF.Functions.Like(p.Body, $"%{filter.Body}%")); - if (!String.IsNullOrWhiteSpace(filter.Tag)) - query = query.Where(p => EF.Functions.Like(p.Tag, $"%{filter.Tag}%")); - - if (filter.MinSendOn.HasValue) - query = query.Where(p => p.SendOn >= filter.MinSendOn); - if (filter.MaxSendOn.HasValue) - query = query.Where(p => p.SendOn <= filter.MaxSendOn); - - if (filter.Sort?.Any() == true) - query = query.OrderByProperty(filter.Sort); - else - query = query.OrderBy(p => p.SendOn).ThenBy(p => p.Status); - - return query; - } - #endregion - } -} diff --git a/backend/dal/Helpers/Extensions/ParcelExtensions.cs b/backend/dal/Helpers/Extensions/ParcelExtensions.cs deleted file mode 100644 index cf990ea68d..0000000000 --- a/backend/dal/Helpers/Extensions/ParcelExtensions.cs +++ /dev/null @@ -1,256 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Pims.Core.Extensions; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using Entity = Pims.Dal.Entities; - -namespace Pims.Dal.Helpers.Extensions -{ - /// - /// ParcelExtensions static class, provides extension methods for parcels. - /// - public static class ParcelExtensions - { - /// - /// Make a query to determine if the parcel PID and PIN are unique. - /// - No two parcels should have the same PID (exception below) - /// - No two parcels should have the same PIN - /// - A Crown Land parcel without a Title will have a PID=0 and a unique PIN. - /// - /// - /// - /// The PID and PIN must be unique. - public static void ThrowIfNotUnique(this DbSet parcels, Entity.Parcel parcel) - { - if (parcel.PropertyTypeId == (int)Entity.PropertyTypes.Subdivision) - { - return; - } - var alreadyExists = parcels.Any(p => p.Id != parcel.Id && ((parcel.PID > 0 && p.PID == parcel.PID) || (parcel.PIN != null && p.PIN == parcel.PIN))); - if (alreadyExists) throw new DbUpdateException("PID and PIN values must be unique."); - } - - /// - /// Generate a query for the specified 'filter'. - /// - /// - /// - /// - /// - public static IQueryable GenerateQuery(this PimsContext context, ClaimsPrincipal user, Entity.Models.ParcelFilter filter) - { - filter.ThrowIfNull(nameof(user)); - filter.ThrowIfNull(nameof(filter)); - - //Fetching user's agencies from database - Guid? userId = context.Users.FirstOrDefault(u => u.Username == user.GetUsername())?.Id; - int[] userAgencies = context.UserAgencies.Where(ua => ua.UserId == userId).Select(ua => ua.AgencyId).ToArray(); - int[] subAgencies = context.Agencies.Where(a => a.ParentId != null && userAgencies.Contains(a.ParentId.Value)).Select(a => a.Id).ToArray(); - userAgencies = userAgencies.Concat(subAgencies).ToArray(); - - // Check if user has the ability to view sensitive properties. - var viewSensitive = user.HasPermission(Permissions.SensitiveView); - var isAdmin = user.HasPermission(Permissions.AdminProperties); - - // Users may only view sensitive properties if they have the `sensitive-view` claim and belong to the owning agency. - var query = context.Parcels.Include(p => p.Classification) - .Include(p => p.Address) - .Include(p => p.Address.Province) - .Include(p => p.Agency) - .Include(p => p.Agency.Parent) - .Include(p => p.Evaluations) - .Include(p => p.Fiscals).AsNoTracking(); - - if (!isAdmin) - { - query = query.Where(p => - p.IsVisibleToOtherAgencies - || ((!p.IsSensitive || viewSensitive) - && userAgencies.Contains(p.AgencyId.Value))); - } - - if (filter.NELatitude.HasValue && filter.NELongitude.HasValue && filter.SWLatitude.HasValue && filter.SWLongitude.HasValue) - { - var poly = new NetTopologySuite.Geometries.Envelope(filter.NELongitude.Value, filter.SWLongitude.Value, filter.NELatitude.Value, filter.SWLatitude.Value).ToPolygon(); - query = query.Where(p => poly.Contains(p.Location)); - } - - if (filter.Agencies?.Any() == true) - { - // Get list of sub-agencies for any agency selected in the filter. - var filterAgencies = filter.Agencies.Select(a => (int?)a); - var agencies = filterAgencies.Concat(context.Agencies.AsNoTracking().Where(a => filterAgencies.Contains(a.Id)).SelectMany(a => a.Children.Select(ac => (int?)ac.Id)).ToArray()).Distinct(); - query = query.Where(p => agencies.Contains(p.AgencyId)); - } - if (!String.IsNullOrWhiteSpace(filter.PID)) - { - var pidValue = filter.PID.Replace("-", "").Trim(); - if (Int32.TryParse(pidValue, out int pid)) - query = query.Include(p => p.Buildings) - .Include(p => p.CreatedBy) - .Include(p => p.UpdatedBy) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Address) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Address.Province) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.BuildingConstructionType) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.BuildingPredominateUse) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.BuildingOccupantType) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Evaluations) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Fiscals) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Classification) - .Include(p => p.Parcels).ThenInclude(pp => pp.Parcel) - .Include(p => p.Subdivisions).ThenInclude(pp => pp.Subdivision) - .Include(p => p.Projects).ThenInclude(pp => pp.Project).ThenInclude(p => p.Workflow).Where(p => p.PID == pid || p.PIN == pid); - } - if (!String.IsNullOrWhiteSpace(filter.PIN)) - { - var pinValue = filter.PIN.Trim(); - if (Int32.TryParse(pinValue, out int pin)) - query = query.Include(p => p.Buildings) - .Include(p => p.CreatedBy) - .Include(p => p.UpdatedBy) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Address) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Address.Province) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.BuildingConstructionType) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.BuildingPredominateUse) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.BuildingOccupantType) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Evaluations) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Fiscals) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Classification) - .Include(p => p.Parcels).ThenInclude(pp => pp.Parcel) - .Include(p => p.Subdivisions).ThenInclude(pp => pp.Subdivision) - .Include(p => p.Projects).ThenInclude(pp => pp.Project).ThenInclude(p => p.Workflow).Where(p => p.PIN == pin); - } - if (filter.ClassificationId.HasValue) - query = query.Where(p => p.ClassificationId == filter.ClassificationId); - if (!String.IsNullOrWhiteSpace(filter.ProjectNumber)) - query = query.Where(p => p.ProjectNumbers.Contains(filter.ProjectNumber)); - if (!String.IsNullOrWhiteSpace(filter.Description)) - query = query.Where(p => EF.Functions.Like(p.Description, $"%{filter.Description}%")); - if (!String.IsNullOrWhiteSpace(filter.AdministrativeArea)) - query = query.Where(p => EF.Functions.Like(p.Address.AdministrativeArea, $"%{filter.AdministrativeArea}%")); - if (!String.IsNullOrWhiteSpace(filter.Zoning)) - query = query.Where(p => EF.Functions.Like(p.Zoning, $"%{filter.Zoning}%")); - if (!String.IsNullOrWhiteSpace(filter.ZoningPotential)) - query = query.Where(p => EF.Functions.Like(p.ZoningPotential, $"%{filter.ZoningPotential}%")); - - // TODO: Parse the address information by City, Postal, etc. - if (!String.IsNullOrWhiteSpace(filter.Address)) - query = query.Where(p => EF.Functions.Like(p.Address.Address1, $"%{filter.Address}%") || EF.Functions.Like(p.Address.AdministrativeArea, $"%{filter.Address}%")); - - if (filter.MinLandArea.HasValue) - query = query.Where(p => p.LandArea >= filter.MinLandArea); - if (filter.MaxLandArea.HasValue) - query = query.Where(p => p.LandArea <= filter.MaxLandArea); - - // TODO: Review performance of the evaluation query component. - if (filter.MinMarketValue.HasValue) - query = query.Where(p => - filter.MinMarketValue <= p.Fiscals - .FirstOrDefault(e => e.FiscalYear == context.ParcelFiscals - .Where(pe => pe.ParcelId == p.Id && pe.Key == Entity.FiscalKeys.Market) - .Max(pe => pe.FiscalYear)) - .Value); - if (filter.MaxMarketValue.HasValue) - query = query.Where(p => - filter.MaxMarketValue >= p.Fiscals - .FirstOrDefault(e => e.FiscalYear == context.ParcelFiscals - .Where(pe => pe.ParcelId == p.Id && pe.Key == Entity.FiscalKeys.Market) - .Max(pe => pe.FiscalYear)) - .Value); - - // TODO: Review performance of the evaluation query component. - if (filter.MinAssessedValue.HasValue) - query = query.Where(p => - filter.MinAssessedValue <= p.Evaluations - .FirstOrDefault(e => e.Date == context.ParcelEvaluations - .Where(pe => pe.ParcelId == p.Id && pe.Key == Entity.EvaluationKeys.Assessed) - .Max(pe => pe.Date)) - .Value); - if (filter.MaxAssessedValue.HasValue) - query = query.Where(p => - filter.MaxAssessedValue >= p.Evaluations - .FirstOrDefault(e => e.Date == context.ParcelEvaluations - .Where(pe => pe.ParcelId == p.Id && pe.Key == Entity.EvaluationKeys.Assessed) - .Max(pe => pe.Date)) - .Value); - - if (filter.Sort?.Any() == true) - query = query.OrderByProperty(filter.Sort); - else - query = query.OrderBy(p => p.Id); - - return query; - } - - /// - /// Get a parcel id - /// - /// - /// - public static int? GetId(this Entity.Parcel parcel) - { - return parcel?.Id; - } - - /// - /// Get unique a pin that will uniquely identify a parcel using a pre-existing pid. - /// - /// - /// - public static int GetUniquePidPin(this PimsContext context, int existingPid) - { - // by getting the parcel with the "largest" pin, we can be sure that incrementing this PIN by one will result in a unique PIN (and therefore a unique PID/PIN). - var matchingParcel = context.Parcels.Where(p => p.PID == existingPid).AsNoTracking().OrderByDescending(p => p.PIN == null ? 0 : p.PIN).FirstOrDefault(); - return (int)(matchingParcel?.PIN == null ? 1 : ++matchingParcel.PIN); - - } - - /// - /// Update parcel financials - /// - /// - /// - /// - /// - public static void UpdateParcelFinancials(this PimsContext context, Entity.Parcel parcel, - ICollection parcelEvaluations, ICollection parcelFiscals) - { - foreach (var parcelEvaluation in parcelEvaluations) - { - var originalEvaluation = parcel.Evaluations - .FirstOrDefault(e => e.Date == parcelEvaluation.Date && e.Key == parcelEvaluation.Key); - - if (originalEvaluation == null) - { - parcel.Evaluations.Add(parcelEvaluation); - } - else - { - originalEvaluation.Note = parcelEvaluation.Note; - originalEvaluation.Value = parcelEvaluation.Value; - originalEvaluation.Firm = parcelEvaluation.Firm; - } - } - - foreach (var parcelFiscal in parcelFiscals) - { - var originalParcelFiscal = parcel.Fiscals - .FirstOrDefault(e => e.FiscalYear == parcelFiscal.FiscalYear && e.Key == parcelFiscal.Key); - - if (originalParcelFiscal == null) - { - parcel.Fiscals.Add(parcelFiscal); - } - else - { - originalParcelFiscal.Note = parcelFiscal.Note; - originalParcelFiscal.Value = parcelFiscal.Value; - originalParcelFiscal.EffectiveDate = parcelFiscal.EffectiveDate; - } - } - } - } -} diff --git a/backend/dal/Helpers/Extensions/ProjectExtensions.cs b/backend/dal/Helpers/Extensions/ProjectExtensions.cs deleted file mode 100644 index 95fda179fe..0000000000 --- a/backend/dal/Helpers/Extensions/ProjectExtensions.cs +++ /dev/null @@ -1,911 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using Entity = Pims.Dal.Entities; - -namespace Pims.Dal.Helpers.Extensions -{ - /// - /// ProjectExtensions static class, provides extension methods for projects. - /// - public static class ProjectExtensions - { - /// - /// Generate a project query for the specified 'filter'. - /// - /// - /// - /// - /// - /// - public static IQueryable GenerateQuery(this PimsContext context, ClaimsPrincipal user, Entity.Models.ProjectFilter filter, ProjectOptions options) - { - filter.ThrowIfNull(nameof(user)); - filter.ThrowIfNull(nameof(filter)); - - //Fetching user's agencies from database - Guid? userId = context.Users.FirstOrDefault(u => u.Username == user.GetUsername())?.Id; - int[] userAgencies = context.UserAgencies.Where(ua => ua.UserId == userId).Select(ua => ua.AgencyId).ToArray(); - int[] subAgencies = context.Agencies.Where(a => a.ParentId != null && userAgencies.Contains(a.ParentId.Value)).Select(a => a.Id).ToArray(); - userAgencies = userAgencies.Concat(subAgencies).ToArray(); - - // Check if user has the ability to view sensitive properties. - var isAdmin = user.HasPermission(Permissions.AdminProjects); - - // Users may only view sensitive properties if they have the `sensitive-view` claim and belong to the owning agency. - var query = context.Projects - .Include(p => p.CreatedBy) - .Include(p => p.UpdatedBy) - .Include(p => p.Status) - .Include(p => p.TierLevel) - .Include(p => p.Risk) - .Include(p => p.Agency) - .Include(p => p.Workflow) - .Include(p => p.Agency).ThenInclude(a => a.Parent) - .Include(p => p.Notes) - .AsNoTracking(); - - if (filter.SPLWorkflow == true) - { - query = query.Where(p => p.Workflow.Code == "SPL" && p.Status.Code != "CA" && p.Status.Code != "T-GRE"); - } - - if (!String.IsNullOrWhiteSpace(filter.ProjectNumber)) - query = query.Where(p => EF.Functions.Like(p.ProjectNumber, $"%{filter.ProjectNumber}%")); - if (!String.IsNullOrWhiteSpace(filter.Name)) - query = query.Where(p => EF.Functions.Like(p.Name, $"%{filter.Name}%") || EF.Functions.Like(p.ProjectNumber, $"%{filter.Name}%")); - if (filter.TierLevelId.HasValue) - query = query.Where(p => p.TierLevelId == filter.TierLevelId); - if (filter.CreatedByMe.HasValue && filter.CreatedByMe.Value) - { - var keycloakUserId = context.Users.FirstOrDefault(u => u.Username == user.GetUsername())?.Id; ; - query = query.Where(p => p.CreatedById.Equals(userId)); - } - - if (filter.WorkflowId.HasValue) - { - query = query.Where(p => p.WorkflowId == filter.WorkflowId); - } - - if (filter.FiscalYear.HasValue) - { - query = query.Where(p => p.ActualFiscalYear == filter.FiscalYear); - } - - if (filter.Active.HasValue && filter.Active.Value) - { - query = query.Where(p => !p.Status.IsTerminal); - } - - if (filter.StatusId?.Any() == true) - { - query = query.Where(p => filter.StatusId.Contains(p.StatusId)); - } - - if (filter.NotStatusId?.Any() == true) - { - query = query.Where(p => !filter.NotStatusId.Contains(p.StatusId)); - } - - if (filter.Agencies?.Any() == true) - { - // Get list of sub-agencies for any agency selected in the filter. - var agencies = filter.Agencies.Concat(context.Agencies.AsNoTracking().Where(a => filter.Agencies.Contains(a.Id)).SelectMany(a => a.Children.Select(ac => ac.Id)).ToArray()).Distinct(); - query = query.Where(p => agencies.Contains(p.AgencyId)); - } - - if (filter.Workflows?.Any() == true) - { - query = query.Where(p => p.Status.Workflows.Any(w => filter.Workflows.Contains(w.Workflow.Code))); - } - - if (filter.ReportId.HasValue) - { - query = query.Include(p => p.Snapshots); - } - // Only admins can view all agency projects. - if (!isAdmin) - { - query = query.Where(p => userAgencies.Contains(p.AgencyId)); - } - - if (filter.Sort?.Any() == true) - query = query.OrderByProperty(filter.Sort); - else - query = query.OrderByDescending(p => p.ActualFiscalYear).OrderByDescending(p => p.ReportedFiscalYear).OrderByDescending(p => p.ProjectNumber).OrderByDescending(p => p.CreatedOn); - - return query; - } - - public static IQueryable GenerateExcelQuery(this PimsContext context, ClaimsPrincipal user, Entity.Models.ProjectFilter filter, ProjectOptions options) - { - filter.ThrowIfNull(nameof(user)); - filter.ThrowIfNull(nameof(filter)); - - //Fetching user's agencies from database - Guid? userId = context.Users.FirstOrDefault(u => u.Username == user.GetUsername())?.Id; - int[] userAgencies = context.UserAgencies.Where(ua => ua.UserId == userId).Select(ua => ua.AgencyId).ToArray(); - int[] subAgencies = context.Agencies.Where(a => a.ParentId != null && userAgencies.Contains(a.ParentId.Value)).Select(a => a.Id).ToArray(); - userAgencies = userAgencies.Concat(subAgencies).ToArray(); - - // Check if user has the ability to view sensitive properties. - var isAdmin = user.HasPermission(Permissions.AdminProjects); - - // Users may only view sensitive properties if they have the `sensitive-view` claim and belong to the owning agency. - var query = context.Projects - .Include(p => p.CreatedBy) - .Include(p => p.UpdatedBy) - .Include(p => p.Status) - .Include(p => p.TierLevel) - .Include(p => p.Risk) - .Include(p => p.Agency) - .Include(p => p.Workflow) - .Include(p => p.Agency).ThenInclude(a => a.Parent) - .Include(p => p.Notes) - .Include(p => p.Properties).ThenInclude(prop => prop.Parcel).ThenInclude(p => p.Address) - .Include(p => p.Properties).ThenInclude(prop => prop.Building).ThenInclude(b => b.Address) - .AsNoTracking(); - - - if (filter.SPLWorkflow == true) - { - query = query.Where(p => p.Workflow.Code == "SPL" && p.Status.Code != "CA" && p.Status.Code != "T-GRE"); - } - - if (!String.IsNullOrWhiteSpace(filter.ProjectNumber)) - query = query.Where(p => EF.Functions.Like(p.ProjectNumber, $"%{filter.ProjectNumber}%")); - if (!String.IsNullOrWhiteSpace(filter.Name)) - query = query.Where(p => EF.Functions.Like(p.Name, $"%{filter.Name}%") || EF.Functions.Like(p.ProjectNumber, $"%{filter.Name}%")); - if (filter.TierLevelId.HasValue) - query = query.Where(p => p.TierLevelId == filter.TierLevelId); - if (filter.CreatedByMe.HasValue && filter.CreatedByMe.Value) - { - var keycloakUserId = context.Users.FirstOrDefault(u => u.Username == user.GetUsername())?.Id; ; - query = query.Where(p => p.CreatedById.Equals(userId)); - } - - if (filter.WorkflowId.HasValue) - { - query = query.Where(p => p.WorkflowId == filter.WorkflowId); - } - - if (filter.FiscalYear.HasValue) - { - query = query.Where(p => p.ActualFiscalYear == filter.FiscalYear); - } - - if (filter.Active.HasValue && filter.Active.Value) - { - query = query.Where(p => !p.Status.IsTerminal); - } - - if (filter.StatusId?.Any() == true) - { - query = query.Where(p => filter.StatusId.Contains(p.StatusId)); - } - - if (filter.NotStatusId?.Any() == true) - { - query = query.Where(p => !filter.NotStatusId.Contains(p.StatusId)); - } - - if (filter.Agencies?.Any() == true) - { - // Get list of sub-agencies for any agency selected in the filter. - var agencies = filter.Agencies.Concat(context.Agencies.AsNoTracking().Where(a => filter.Agencies.Contains(a.Id)).SelectMany(a => a.Children.Select(ac => ac.Id)).ToArray()).Distinct(); - query = query.Where(p => agencies.Contains(p.AgencyId)); - } - - if (filter.Workflows?.Any() == true) - { - query = query.Where(p => p.Status.Workflows.Any(w => filter.Workflows.Contains(w.Workflow.Code))); - } - - if (filter.ReportId.HasValue) - { - query = query.Include(p => p.Snapshots); - } - // Only admins can view all agency projects. - if (!isAdmin) - { - query = query.Where(p => userAgencies.Contains(p.AgencyId)); - } - - if (filter.Sort?.Any() == true) - query = query.OrderByProperty(filter.Sort); - else - query = query.OrderByDescending(p => p.ActualFiscalYear).OrderByDescending(p => p.ReportedFiscalYear).OrderByDescending(p => p.ProjectNumber).OrderByDescending(p => p.CreatedOn); - - return query; - } - - - /// Generate a new project number in the database. - /// NOTE - this saves current changes to the datasource and should be called before other changes. - /// If the subsequent save to the database fails the project number will be unused and result in an orphan. - /// - /// - /// - public static Entity.ProjectNumber GenerateProjectNumber(this PimsContext context) - { - var projectNumber = new Entity.ProjectNumber(); - context.ProjectNumbers.Add(projectNumber); - context.SaveChanges(); - return projectNumber; - } - - /// - /// Generate a new project number in the database. - /// NOTE - this saves current changes to the datasource and should be called before other changes. - /// If the subsequent save to the database fails the project number will be unused and result in an orphan. - /// - /// - /// - /// - public static string GenerateProjectNumber(this PimsContext context, string format) - { - var projectNumber = context.GenerateProjectNumber(); - return projectNumber.Generate(format); - } - - /// - /// Generate a formatted project number for a project for the specified `projectNumber`. - /// - /// - /// - /// - public static string Generate(this Entity.ProjectNumber projectNumber, string format) - { - return String.Format(format, projectNumber.Id); - } - - /// - /// Add a parcel(s) to the project. - /// - /// - /// - /// - public static IEnumerable AddProperty(this Entity.Project project, params Entity.Property[] properties) - { - var result = new List(); - foreach (var p in properties) - { - var pp = new Entity.ProjectProperty(project, p); - project.Properties.Add(pp); - result.Add(pp); - } - return result; - } - - /// - /// Add a parcel(s) to the project. - /// - /// - /// - /// - public static IEnumerable AddProperty(this Entity.Project project, params Entity.Parcel[] parcels) - { - var result = new List(); - foreach (var p in parcels) - { - var pp = new Entity.ProjectProperty(project, p); - project.Properties.Add(pp); - result.Add(pp); - } - return result; - } - - /// - /// Add a building(s) to the project. - /// - /// - /// - /// - public static IEnumerable AddProperty(this Entity.Project project, params Entity.Building[] buildings) - { - var result = new List(); - foreach (var b in buildings) - { - var pp = new Entity.ProjectProperty(project, b); - project.Properties.Add(pp); - result.Add(pp); - } - return result; - } - - /// - /// Update the originalProperty.agencyId and originalProperty.classificationId using the specified property. - /// - /// - /// - /// - public static Entity.Property UpdateProjectProperty(this Entity.ProjectProperty originalProperty, Entity.ProjectProperty property) - { - switch (property.PropertyType) - { - case (Entity.PropertyTypes.Land): - if (originalProperty.Parcel == null || property.Parcel == null) throw new InvalidOperationException("Unable to transfer parcel."); - originalProperty.Parcel.AgencyId = property.Parcel.AgencyId; - originalProperty.Parcel.ClassificationId = property.Parcel.ClassificationId; - originalProperty.Parcel.ProjectNumbers = "[]"; - originalProperty.Parcel.PropertyTypeId = (int)PropertyTypes.Land; // when an agency transition occurs, and subdivisions should transition into parcels. - return originalProperty.Parcel; - case (Entity.PropertyTypes.Building): - if (originalProperty.Building == null || property.Building == null) throw new InvalidOperationException("Unable to transfer building."); - originalProperty.Building.AgencyId = property.Building.AgencyId; - originalProperty.Building.ClassificationId = property.Building.ClassificationId; - originalProperty.Building.ProjectNumbers = "[]"; - return originalProperty.Building; - } - - return null; - } - - /// - /// Add a tasks to the project. - /// - /// - /// - /// - public static Entity.Project AddTask(this Entity.Project project, params Entity.Task[] tasks) - { - tasks.ForEach(t => - { - project.Tasks.Add(new Entity.ProjectTask(project, t)); - }); - return project; - } - - /// - /// Determine the financial year the project is based on. - /// Scans properties and gets the most recent evaluation date. - /// - /// - /// - public static DateTime GetProjectFinancialDate(this Entity.Project project) // TODO: This is most likely invalid, but for now will work. - { - return project.Properties.Where(p => p.PropertyType == Entity.PropertyTypes.Land).Select(p => p.Parcel).SelectMany(p => p.Evaluations).Max(p => (DateTime?)p.Date) - ?? project.Properties.Where(p => p.PropertyType == Entity.PropertyTypes.Building).Select(p => p.Building).SelectMany(p => p.Evaluations).Max(b => (DateTime?)b.Date) - ?? project.Properties.Where(p => p.PropertyType == Entity.PropertyTypes.Land).Select(p => p.Parcel).SelectMany(p => p.Fiscals).Max(b => (DateTime?)new DateTime(b.FiscalYear, 1, 1)) - ?? project.Properties.Where(p => p.PropertyType == Entity.PropertyTypes.Building).Select(p => p.Building).SelectMany(p => p.Fiscals).Max(b => (DateTime?)new DateTime(b.FiscalYear, 1, 1)) - ?? DateTime.UtcNow; - } - - /// /// - /// Get the Property Location for a project. - /// /// - /// /// - /// /// - - public static string GetPropertyLocation(this Project project) - { - var adminArea = ""; - - if (project == null) - { - throw new ArgumentNullException(nameof(project)); - } - if (project.Properties == null) - { - return ""; - } - - var properties = project.Properties.FirstOrDefault(); - if (properties == null) - { - return ""; - } - - adminArea = properties.PropertyType == Entity.PropertyTypes.Land ? - properties.Parcel.Address.AdministrativeArea : - properties.Building.Address.AdministrativeArea; - - return adminArea; - } - - /// /// - /// Get the PIDs for a project. - /// /// - /// /// - /// /// - - public static string GetParcelPIDs(this Project project) - { - if (project == null) - { - throw new ArgumentNullException(nameof(project)); - } - if (project.Properties == null) - { - return ""; - } - var parcels = project.Properties.Where(p => p.PropertyType == Entity.PropertyTypes.Land) - .Select(p => p.Parcel); - var PIDs = ""; - foreach (var parcel in parcels) - { - PIDs = PIDs + $"{parcel.PID: 000-000-000}" + ", "; - } - - return PIDs.Length > 0 ? PIDs.Substring(0, (PIDs.Length) - 2) : ""; - } - - /// /// - /// Get the Lotsize for a project. - /// /// - /// /// - /// /// - - public static float GetParcelLotsize(this Project project) - { - if (project == null) - { - throw new ArgumentNullException(nameof(project)); - } - if (project.Properties == null) - { - return 0; - } - var parcels = project.Properties.Where(p => p.PropertyType == Entity.PropertyTypes.Land) - .Select(p => p.Parcel); - float LotSize = 0; - foreach (var parcel in parcels) - { - LotSize = LotSize + parcel.LandArea; - } - return LotSize; - } - - - /// - /// Release properties from project, such as during the deny or cancelled statuses - /// - /// - /// - /// - public static void ReleaseProjectProperties(this PimsContext context, Entity.Project project) - { - project.Properties.ForEach(p => - { - context.Update(p.RemoveProjectNumber(project.ProjectNumber)); - }); - } - - /// - /// Dispose properties from project, during the disposed workflow status. - /// - /// - /// - /// - public static void DisposeProjectProperties(this PimsContext context, Entity.Project project) - { - var disposed = context.PropertyClassifications.AsNoTracking().FirstOrDefault(c => c.Name == "Disposed") ?? throw new KeyNotFoundException("Classification 'Disposed' not found."); - var parentParcels = GetSubdivisionParentParcels(project); - DisposeSubdivisionParentParcels(context, parentParcels); - project.Properties.Where(p => !parentParcels.Any(pp => pp.Id == p.Id)).ForEach(p => - { - switch (p.PropertyType) - { - case (Entity.PropertyTypes.Land): - if (p.Parcel == null) throw new InvalidOperationException("Unable to update parcel status."); - p.Parcel.ClassificationId = disposed.Id; - p.Parcel.PropertyTypeId = (int)PropertyTypes.Land; // all subdivisions should be transitioned to parcels after they are disposed. - p.Parcel.Parcels.Clear(); // remove all references to parent parcels. - break; - case (Entity.PropertyTypes.Building): - if (p.Building == null) throw new InvalidOperationException("Unable to update building status."); - p.Building.ClassificationId = disposed.Id; - break; - } - context.Update(p); - }); - - } - - /// - /// Disposes parent parcels of subdivisions by setting the classification to subdivided - /// - /// - /// - public static void DisposeSubdivisionParentParcels(this PimsContext context, IEnumerable parentParcels) - { - var subdivided = context.PropertyClassifications.AsNoTracking().FirstOrDefault(c => c.Name == "Subdivided") ?? throw new KeyNotFoundException("Classification 'Subdivided' not found."); - parentParcels.ForEach(parentParcel => - { - parentParcel.ClassificationId = subdivided.Id; - context.Update(parentParcel); - }); - } - - /// - /// Returns all parcels in project that contain at least one subdivision parcel (with an array of parent parcels). - /// - /// - public static IEnumerable GetSubdivisionParentParcels(this Entity.Project originalProject) - { - var projectParcels = originalProject.Properties.Select(p => p.Parcel).Where(p => p != null); - return projectParcels.SelectMany(pp => pp.Parcels).Where(p => p?.Parcel != null).Select(p => p.Parcel); - } - - /// - /// Transfer Project properties to a new agency with updated classifications - /// - /// - /// - /// - /// - public static void TransferProjectProperties(this PimsContext context, Entity.Project originalProject, Entity.Project project) - { - var parentParcels = originalProject.GetSubdivisionParentParcels(); - context.DisposeSubdivisionParentParcels(parentParcels); - var propertiesWithNoSubdivisions = originalProject.Properties.Where(p => !parentParcels.Any(pp => p.Parcel?.Id == pp.Id)); - propertiesWithNoSubdivisions.ForEach(p => - { - var matchingProperty = project.Properties.First(property => p.Id == property.Id); - context.Update(p.UpdateProjectProperty(matchingProperty)); - }); - } - - /// - /// Determine if the project is editable to the specified 'user'. - /// - /// - /// - /// - public static bool IsProjectEditable(this Entity.Project project, ClaimsPrincipal user, ProjectOptions options) - { - return user.HasPermission(Permissions.AdminProjects) || (user.HasPermission(Permissions.ProjectEdit) && project.IsProjectInDraft(options)); - } - - /// - /// Determine if the project is in draft. - /// - /// - /// - /// - public static bool IsProjectInDraft(this Entity.Project project, ProjectOptions options) - { - if (project.Workflow == null) throw new ArgumentNullException(nameof(project), "The 'Workflow' cannot be null."); - return options.DraftWorkflows.Contains(project.Workflow.Code); - } - - /// - /// Determine if the project is closed or complete. - /// - /// - /// - public static bool IsProjectClosed(this Entity.Project project) - { - if (project.Status == null) throw new ArgumentNullException(nameof(project.Status)); - - return project.Status.IsTerminal; - } - - /// - /// Merge the specified 'updatedProject' changes into the specified 'originalProject'. - /// - /// - /// - /// - public static void Merge(this Entity.Project originalProject, Entity.Project updatedProject, PimsContext context) - { - // Update a project - var agency = originalProject.Agency; - var originalMetadata = context.Deserialize(originalProject.Metadata ?? "{}"); // TODO: Need to test whether automatically overwriting the metadata is correct. - - var createdById = originalProject.CreatedById; - var updatedById = originalProject.UpdatedById; - context.Entry(originalProject).CurrentValues.SetValues(updatedProject); - originalProject.Agency = agency; // Don't want to allow agency to change through this method. - originalProject.CreatedById = createdById; // Don't want these updated externally. - originalProject.UpdatedById = updatedById; // Don't want these updated externally. - context.SetOriginalRowVersion(originalProject); - - var agencies = originalProject.Agency.ParentId.HasValue ? new[] { originalProject.AgencyId } : context.Agencies.Where(a => a.ParentId == originalProject.AgencyId || a.Id == originalProject.AgencyId).Select(a => a.Id).ToArray(); - - // Update all properties - foreach (var property in updatedProject.Properties) - { - var existingProperty = originalProject.Properties - .FirstOrDefault(b => b.PropertyType == Entity.PropertyTypes.Land - && b.ParcelId == property.ParcelId - && b.ProjectId == updatedProject.Id - || - b.PropertyType == Entity.PropertyTypes.Building - && b.ProjectId == updatedProject.Id - && b.BuildingId == property.BuildingId); - - if (existingProperty == null) - { - //Todo: Navigation properties on project object were causing concurrency exceptions. - var eproperty = property.PropertyType == Entity.PropertyTypes.Land ? context.Parcels.Find(property.ParcelId) : context.Buildings.Find(property.BuildingId) as Entity.Property; - // Ignore properties that don't exist. - if (eproperty != null) - { - if (property.PropertyType == Entity.PropertyTypes.Land) - { - var existingParcel = context.Parcels - .Include(p => p.Agency) - .Include(p => p.Evaluations) - .Include(p => p.Fiscals) - .FirstOrDefault(p => p.Id == property.ParcelId); - existingParcel.ThrowIfPropertyNotInProjectAgency(agencies); - existingParcel.UpdateProjectNumbers(updatedProject.ProjectNumber); - } - else - { - var existingBuilding = context.Buildings - .Include(b => b.Agency) - .Include(p => p.Evaluations) - .Include(p => p.Fiscals) - .FirstOrDefault(p => p.Id == property.BuildingId); - existingBuilding.ThrowIfPropertyNotInProjectAgency(agencies); - existingBuilding.UpdateProjectNumbers(updatedProject.ProjectNumber); - } - originalProject.AddProperty(eproperty); - } - } - else - { - if (property.PropertyType == Entity.PropertyTypes.Land) - { - // Only allow editing the classification and evaluations/fiscals for now - existingProperty.UpdateProjectNumbers(updatedProject.ProjectNumber); - if (property.Parcel != null) - { - context.Entry(existingProperty.Parcel).Collection(p => p.Evaluations).Load(); - existingProperty.Parcel.ClassificationId = property.Parcel.ClassificationId; - existingProperty.Parcel.Zoning = property.Parcel.Zoning; - existingProperty.Parcel.ZoningPotential = property.Parcel.ZoningPotential; - foreach (var evaluation in property.Parcel.Evaluations) - { - var existingEvaluation = existingProperty.Parcel.Evaluations - .FirstOrDefault(e => e.Date == evaluation.Date && e.Key == evaluation.Key); - - if (existingEvaluation == null) - { - existingProperty.Parcel.Evaluations.Add(evaluation); - } - else - { - context.Entry(existingEvaluation).CurrentValues.SetValues(evaluation); - } - } - - existingProperty.Parcel.RemoveEvaluationsWithinOneYear(property.Parcel, originalMetadata.DisposedOn); - - context.Entry(existingProperty.Parcel).Collection(p => p.Fiscals).Load(); - foreach (var fiscal in property.Parcel.Fiscals) - { - var existingFiscal = existingProperty.Parcel.Fiscals - .FirstOrDefault(e => e.FiscalYear == fiscal.FiscalYear && e.Key == fiscal.Key); - - if (existingFiscal == null) - { - existingProperty.Parcel.Fiscals.Add(fiscal); - } - else - { - context.Entry(existingFiscal).CurrentValues.SetValues(fiscal); - } - } - } - } - else if (property.PropertyType == Entity.PropertyTypes.Building) - { - // Only allow editing the classification and evaluations/fiscals for now - context.Entry(existingProperty.Building).Collection(p => p.Evaluations).Load(); - existingProperty.UpdateProjectNumbers(updatedProject.ProjectNumber); - if (property.Building != null) - { - existingProperty.Building.ClassificationId = property.Building.ClassificationId; - foreach (var evaluation in property.Building.Evaluations) - { - var existingEvaluation = existingProperty.Building.Evaluations - .FirstOrDefault(e => e.Date == evaluation.Date && e.Key == evaluation.Key); - - if (existingEvaluation == null) - { - existingProperty.Building.Evaluations.Add(evaluation); - } - else - { - context.Entry(existingEvaluation).CurrentValues.SetValues(evaluation); - } - } - existingProperty.Building.RemoveEvaluationsWithinOneYear(property.Building, originalMetadata.DisposedOn); - - context.Entry(existingProperty.Building).Collection(p => p.Fiscals).Load(); - foreach (var fiscal in property.Building.Fiscals) - { - var existingFiscal = existingProperty.Building.Fiscals - .FirstOrDefault(e => e.FiscalYear == fiscal.FiscalYear && e.Key == fiscal.Key); - - if (existingFiscal == null) - { - existingProperty.Building.Fiscals.Add(fiscal); - } - else - { - context.Entry(existingFiscal).CurrentValues.SetValues(fiscal); - } - } - } - } - } - } - - // Remove any properties from this project that are no longer associated. - var removePropertyIds = originalProject.Properties.Where(p => p.Id != 0).Select(p => p.Id).Except(updatedProject.Properties.Where(p => p.Id != 0).Select(p => p.Id)); - var removeProperties = originalProject.Properties.Where(p => removePropertyIds.Contains(p.Id)); - - var removeParcelIds = removeProperties.Where(p => p.ParcelId.HasValue).Select(p => p.ParcelId.Value).ToArray(); - var removeParcels = context.Parcels.Where(p => removeParcelIds.Contains(p.Id)); - removeParcels.ForEach(p => - { - p.RemoveProjectNumber(updatedProject.ProjectNumber); - context.Parcels.Update(p); - }); - - var removeBuildingIds = removeProperties.Where(b => b.BuildingId.HasValue).Select(p => p.BuildingId.Value).ToArray(); - var removeBuildings = context.Buildings.Where(p => removeBuildingIds.Contains(p.Id)); - removeBuildings.ForEach(b => - { - b.RemoveProjectNumber(updatedProject.ProjectNumber); - context.Buildings.Update(b); - }); - - originalProject.Properties.RemoveAll(p => removePropertyIds.Contains(p.Id)); - - // Update tasks - foreach (var task in updatedProject.Tasks) - { - var originalProjectTask = originalProject.Tasks.FirstOrDefault(t => t.TaskId == task.TaskId); - - if (originalProjectTask == null) - { - originalProject.Tasks.Add(task); - } - else - { - context.Entry(originalProjectTask).CurrentValues.SetValues(task); - } - } - - // Update responses - foreach (var response in updatedProject.Responses) - { - var originalProjectResponse = originalProject.Responses.FirstOrDefault(r => r.AgencyId == response.AgencyId); - - if (originalProjectResponse == null) - { - originalProject.Responses.Add(response); - } - else - { - context.Entry(originalProjectResponse).CurrentValues.SetValues(response); - } - } - - // Update notes - foreach (var note in updatedProject.Notes) - { - var originalNote = originalProject.Notes.FirstOrDefault(r => r.Id == note.Id && note.Id > 0); - - if (originalNote == null) - { - originalProject.Notes.Add(note); - } - else - { - context.Entry(originalNote).CurrentValues.SetValues(note); - } - } - - var toStatus = context.ProjectStatus - .Include(s => s.Tasks) - .FirstOrDefault(s => s.Id == updatedProject.StatusId); - updatedProject.Status = toStatus; - - // If the tasks haven't been specified, generate them. - var taskIds = updatedProject.Tasks.Select(t => t.TaskId).ToArray(); - // Add the tasks for project status if they are not already added. - foreach (var task in toStatus.Tasks.Where(t => !taskIds.Contains(t.Id))) - { - originalProject.Tasks.Add(new Entity.ProjectTask(updatedProject, task)); - } - } - - /// - /// Set Project properties' visibility to other agencies - /// - /// - /// - /// - public static void SetProjectPropertiesVisiblity(this PimsContext context, Entity.Project project, bool visibility) - { - project.Properties.ForEach(p => - { - if (p.BuildingId.HasValue) - { - p.Building.IsVisibleToOtherAgencies = visibility; - context.Buildings.Update(p.Building); - } - else if (p.ParcelId.HasValue) - { - p.Parcel.IsVisibleToOtherAgencies = visibility; - context.Parcels.Update(p.Parcel); - } - }); - } - - /// - /// Add responses to the project. - /// - /// - /// - /// - public static Entity.Project AddResponses(this Entity.Project project, params Entity.ProjectAgencyResponse[] responses) - { - responses.ForEach(r => - { - project.Responses.Add(r); - }); - return project; - } - - /// Get a collection of responses that have changed from the original to the updated project. - /// - /// - /// - /// - public static IEnumerable GetResponseChanges(this Entity.Project originalProject, Entity.Project updatedProject) - { - if (updatedProject == null) throw new ArgumentNullException(nameof(updatedProject)); - - var responses = new List(updatedProject.Responses.Count()); - foreach (var response in updatedProject.Responses) - { - var originalResponse = originalProject.Responses.FirstOrDefault(r => r.ProjectId == response.ProjectId && r.AgencyId == response.AgencyId); - if (originalResponse == null || originalResponse.Response != response.Response) - { - responses.Add(response); - } - } - - // Any responses that were deleted should now be ignored. - foreach (var response in originalProject.Responses) - { - // Look for original response in the update project. - var updatedResponse = updatedProject.Responses.FirstOrDefault(r => r.ProjectId == response.ProjectId && r.AgencyId == response.AgencyId); - if (updatedResponse == null) - { - response.Response = NotificationResponses.Unsubscribe; - responses.Add(response); - } - } - return responses; - } - - /// - /// Removes any responses from the original project that have been removed from the updated project. - /// - /// - /// - public static void UpdateResponses(this Entity.Project originalProject, Entity.Project updatedProject) - { - var responseIds = updatedProject.Responses.Select(r => r.AgencyId).ToArray(); - var removeResponses = originalProject.Responses.Where(r => !responseIds.Contains(r.AgencyId)).ToArray(); - foreach (var response in removeResponses) - { - originalProject.Responses.Remove(response); - } - } - } -} diff --git a/backend/dal/Helpers/Extensions/PropertyExtensions.cs b/backend/dal/Helpers/Extensions/PropertyExtensions.cs deleted file mode 100644 index bf566226f1..0000000000 --- a/backend/dal/Helpers/Extensions/PropertyExtensions.cs +++ /dev/null @@ -1,392 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Pims.Core.Extensions; -using Pims.Dal.Exceptions; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using Entity = Pims.Dal.Entities; - -namespace Pims.Dal.Helpers.Extensions -{ - /// - /// PropertyExtensions static class, provides extension methods for propertys. - /// - public static class PropertyExtensions - { - /// - /// Generate an SQL statement for the specified 'user' and 'filter'. - /// - /// - /// - /// - /// - /// - private static IQueryable GenerateCommonQuery(this PimsContext context, IQueryable query, ClaimsPrincipal user, Entity.Models.AllPropertyFilter filter) - { - filter.ThrowIfNull(nameof(filter)); - filter.ThrowIfNull(nameof(user)); - - //Fetching user's agencies from database - Guid? userId = context.Users.FirstOrDefault(u => u.Username == user.GetUsername())?.Id; - int[] userAgencies = context.UserAgencies.Where(ua => ua.UserId == userId).Select(ua => ua.AgencyId).ToArray(); - int[] subAgencies = context.Agencies.Where(a => a.ParentId != null && userAgencies.Contains(a.ParentId.Value)).Select(a => a.Id).ToArray(); - userAgencies = userAgencies.Concat(subAgencies).ToArray(); - - // Check if user has the ability to view sensitive properties. - var viewSensitive = user.HasPermission(Permissions.SensitiveView); - var isAdmin = user.HasPermission(Permissions.AdminProperties); - - // By default do not include the following property classifications. - if (filter.ClassificationId.HasValue) - query = query.Where(p => p.ClassificationId == filter.ClassificationId); - else - query = query.Where(p => p.ClassificationId != (int)Entities.ClassificationTypes.Disposed - && p.ClassificationId != (int)Entities.ClassificationTypes.Demolished - && p.ClassificationId != (int)Entities.ClassificationTypes.Subdivided); - - // Users are not allowed to view sensitive properties outside of their agency or sub-agencies. - if (!viewSensitive) - query = query.Where(p => !p.IsSensitive); - - // Display buildings or land/subdivisions - if (filter.PropertyType == Entities.PropertyTypes.Building) - query = query.Where(p => p.PropertyTypeId == Entities.PropertyTypes.Building); - else if (filter.PropertyType == Entities.PropertyTypes.Land) - query = query.Where(p => p.PropertyTypeId == Entities.PropertyTypes.Land || p.PropertyTypeId == Entities.PropertyTypes.Subdivision); - - // Where rentable area is less than or equal to the filter. - if (filter.RentableArea.HasValue) - query = query.Where(p => p.RentableArea <= filter.RentableArea); - - if (filter.BareLandOnly == true) - { - query = from p in query - join pa in context.Parcels on new { p.Id, PropertyTypeId = (int)p.PropertyTypeId } equals new { pa.Id, PropertyTypeId = (int)pa.PropertyTypeId } - where p.PropertyTypeId == Entity.PropertyTypes.Land - && pa.Buildings.Count() == 0 - select p; - } - - if (filter.NELatitude.HasValue && filter.NELongitude.HasValue && filter.SWLatitude.HasValue && filter.SWLongitude.HasValue) - { - var poly = new NetTopologySuite.Geometries.Envelope(filter.NELongitude.Value, filter.SWLongitude.Value, filter.NELatitude.Value, filter.SWLatitude.Value).ToPolygon(); - query = query.Where(p => poly.Contains(p.Location)); - } - - if (filter.Agencies?.Any() == true) - { - IEnumerable filterAgencies; - if (!isAdmin) - { - // Users can only search their own agencies. - filterAgencies = filter.Agencies.Intersect(userAgencies.Select(a => (int)a)).Select(a => (int?)a); - } - else - { - // TODO: Ideally this list would be provided by the frontend, as it is expensive to do it here. - // Get list of sub-agencies for any agency selected in the filter. - filterAgencies = filter.Agencies.Select(a => (int?)a); - } - if (filterAgencies.Any()) - { - var agencies = filterAgencies.Concat(context.Agencies.AsNoTracking().Where(a => filterAgencies.Contains(a.Id)).SelectMany(a => a.Children.Select(ac => (int?)ac.Id)).ToArray()).Distinct(); - query = query.Where(p => agencies.Contains(p.AgencyId)); - } - } - if (filter.ParcelId.HasValue) - query = query.Where(p => p.ParcelId == filter.ParcelId); - if (!String.IsNullOrWhiteSpace(filter.ProjectNumber)) - query = query.Where(p => p.ProjectNumbers.Contains(filter.ProjectNumber)); - if (filter.IgnorePropertiesInProjects == true) - query = query.Where(p => p.ProjectNumbers == null || p.ProjectNumbers == "[]"); - if (filter.InSurplusPropertyProgram == true) - query = query.Where(p => !String.IsNullOrWhiteSpace(p.ProjectNumbers) && p.ProjectNumbers != "[]"); - if (!String.IsNullOrWhiteSpace(filter.Description)) - query = query.Where(p => EF.Functions.Like(p.Description, $"%{filter.Description}%")); - if (!String.IsNullOrWhiteSpace(filter.Name)) - query = query.Where(p => EF.Functions.Like(p.Name, $"%{filter.Name}%")); - - if (!String.IsNullOrWhiteSpace(filter.PID)) - { - var pidValue = filter.PID.Replace("-", "").Trim(); - if (Int32.TryParse(pidValue, out int pid)) - query = query.Where(p => p.PID == pid || p.PIN == pid); - } - if (!String.IsNullOrWhiteSpace(filter.AdministrativeArea)) - query = query.Where(p => EF.Functions.Like(p.AdministrativeArea, $"%{filter.AdministrativeArea}%")); - if (!String.IsNullOrWhiteSpace(filter.Zoning)) - query = query.Where(p => EF.Functions.Like(p.Zoning, $"%{filter.Zoning}%")); - if (!String.IsNullOrWhiteSpace(filter.ZoningPotential)) - query = query.Where(p => EF.Functions.Like(p.ZoningPotential, $"%{filter.ZoningPotential}%")); - - if (filter.ConstructionTypeId.HasValue) - query = query.Where(p => p.BuildingConstructionTypeId == filter.ConstructionTypeId); - if (filter.PredominateUseId.HasValue) - query = query.Where(p => p.BuildingPredominateUseId == filter.PredominateUseId); - if (filter.FloorCount.HasValue) - query = query.Where(p => p.BuildingFloorCount == filter.FloorCount); - if (!String.IsNullOrWhiteSpace(filter.Tenancy)) - query = query.Where(p => EF.Functions.Like(p.BuildingTenancy, $"%{filter.Tenancy}%")); - - if (!String.IsNullOrWhiteSpace(filter.Address)) - query = query.Where(p => EF.Functions.Like(p.Address, $"%{filter.Address}%") || EF.Functions.Like(p.AdministrativeArea, $"%{filter.Address}%")); - - if (filter.MinLandArea.HasValue) - query = query.Where(p => p.LandArea >= filter.MinLandArea); - if (filter.MaxLandArea.HasValue) - query = query.Where(b => b.LandArea <= filter.MaxLandArea); - - if (filter.MinRentableArea.HasValue) - query = query.Where(p => p.RentableArea >= filter.MinRentableArea); - if (filter.MaxRentableArea.HasValue) - query = query.Where(b => b.RentableArea <= filter.MaxRentableArea); - - if (filter.MinMarketValue.HasValue) - query = query.Where(p => p.Market >= filter.MinMarketValue); - if (filter.MaxMarketValue.HasValue) - query = query.Where(p => p.Market <= filter.MaxMarketValue); - - if (filter.MinAssessedValue.HasValue) - query = query.Where(p => p.AssessedLand >= filter.MinAssessedValue || p.AssessedBuilding >= filter.MinAssessedValue); - if (filter.MaxAssessedValue.HasValue) - query = query.Where(p => p.AssessedLand <= filter.MaxAssessedValue || p.AssessedBuilding <= filter.MaxAssessedValue); - - if (filter.Sort?.Any() == true) - query = query.OrderByProperty(filter.Sort); - else - query = query.OrderBy(p => p.AgencyCode).ThenBy(p => p.PID).ThenBy(p => p.PIN).ThenBy(p => p.PropertyTypeId); - - return query; - } - - /// - /// Generates a query that returns properties in ERP and/or SPL. - /// Note - this does not filter properties that a user shouldn't not be able to view. - /// Note - this will return sensitive properties. - /// - /// - /// - /// - private static IQueryable GenerateProjectQuery(this PimsContext context, Entity.Models.AllPropertyFilter filter) - { - filter.ThrowIfNull(nameof(filter)); - - if (filter.InEnhancedReferralProcess == true || filter.InSurplusPropertyProgram == true) - { - var workflowCodes = new List(); - if (filter.InEnhancedReferralProcess == true) workflowCodes.Add("ERP"); // TODO: This should be configurable, not hardcoded. - if (filter.InSurplusPropertyProgram == true) workflowCodes.Add("SPL"); // TODO: This should be configurable, not hardcoded. - var codes = workflowCodes.ToArray(); - - var doNotIncludeCodes = new[] { "DE", "DIS", "CA", "T-GRE" }; // TODO: This should be configurable, not hardcoded. - - // Generate a query that finds all properties in projects that match the specified workflow. - var properties = (from vp in context.Properties - join pp in ( - context.Projects - .Where(p => codes.Contains(p.Workflow.Code) && !doNotIncludeCodes.Contains(p.Status.Code)) - .SelectMany(p => p.Properties) - .Where(p => p.PropertyType == Entities.PropertyTypes.Land - || p.PropertyType == Entities.PropertyTypes.Subdivision) - .Select(p => p.Parcel) - ) on new { vp.Id, PropertyTypeId = (int)vp.PropertyTypeId } equals new { pp.Id, PropertyTypeId = (int)pp.PropertyTypeId } - select new { vp.Id, vp.PropertyTypeId }) - .Union(from vp in context.Properties - join pp in ( - context.Projects - .Where(p => codes.Contains(p.Workflow.Code) && !doNotIncludeCodes.Contains(p.Status.Code)) - .SelectMany(p => p.Properties) - .Where(p => p.PropertyType == Entities.PropertyTypes.Building) - .Select(p => p.Building) - ) on new { vp.Id, PropertyTypeId = (int)vp.PropertyTypeId } equals new { pp.Id, PropertyTypeId = (int)pp.PropertyTypeId } - select new { vp.Id, vp.PropertyTypeId }) - .Distinct(); - - // Join result of prior query to view this way because spatial data types cannot be included in a union statement. - return (from p in context.Properties - join pp in properties on new { p.Id, p.PropertyTypeId } equals new { pp.Id, pp.PropertyTypeId } - select p).AsNoTracking(); - } - - return context.Properties.AsNoTracking(); - } - - /// - /// Generate a query for the specified 'filter'. - /// Only includes properties that belong to the user's agency or sub-agencies. - /// - /// - /// - /// - /// - public static IQueryable GenerateQuery(this PimsContext context, ClaimsPrincipal user, Entity.Models.AllPropertyFilter filter) - { - filter.ThrowIfNull(nameof(filter)); - filter.ThrowIfNull(nameof(user)); - - // Users may only view sensitive properties if they have the `sensitive-view` claim and belong to the owning agency. - var query = context.GenerateProjectQuery(filter); - - // Users can only view their agency or sub-agency properties. - var isAdmin = user.HasPermission(Permissions.AdminProperties); - if (!isAdmin) - { - //Fetching user's agencies from database - Guid? userId = context.Users.FirstOrDefault(u => u.Username == user.GetUsername())?.Id; - int[] userAgencies = context.UserAgencies.Where(ua => ua.UserId == userId).Select(ua => ua.AgencyId).ToArray(); - int[] subAgencies = context.Agencies.Where(a => a.ParentId != null && userAgencies.Contains(a.ParentId.Value)).Select(a => a.Id).ToArray(); - userAgencies = userAgencies.Concat(subAgencies).ToArray(); - query = query.Where(p => userAgencies.Contains(p.AgencyId.Value)); - } - - query = context.GenerateCommonQuery(query, user, filter); - - return query; - } - - /// - /// Generate a query for the specified 'filter'. - /// Returns all properties, even properties that don't belong to the user's agency or sub-agencies. - /// The results of this query must be 'cleaned' so that only appropriate data is returned to API. - /// - /// - /// - /// - /// - public static IQueryable GenerateAllPropertyQuery(this PimsContext context, ClaimsPrincipal user, Entity.Models.AllPropertyFilter filter) - { - filter.ThrowIfNull(nameof(filter)); - filter.ThrowIfNull(nameof(user)); - - var query = context.GenerateProjectQuery(filter); - - // Only return properties owned by user's agency or sub-agencies. - if (!filter.IncludeAllProperties) - { - //Fetching user's agencies from database - Guid? userId = context.Users.FirstOrDefault(u => u.Username == user.GetUsername())?.Id; - int[] userAgencies = context.UserAgencies.Where(ua => ua.UserId == userId).Select(ua => ua.AgencyId).ToArray(); - int[] subAgencies = context.Agencies.Where(a => a.ParentId != null && userAgencies.Contains(a.ParentId.Value)).Select(a => a.Id).ToArray(); - userAgencies = userAgencies.Concat(subAgencies).ToArray(); - query = query.Where(p => userAgencies.Contains(p.AgencyId.Value)); - } - - query = context.GenerateCommonQuery(query, user, filter); - - return query; - } - - /// - /// Throw an exception if the passed property is not in the same agency or sub agency as this project. - /// - /// - /// - /// - public static void ThrowIfPropertyNotInProjectAgency(this Entity.Property parcel, IEnumerable projectAgencyIds) - { - // properties may be in the same agency or sub-agency of a project. A parcel in a parent agency may not be added to a sub-agency project. - if (!parcel.AgencyId.HasValue || !projectAgencyIds.Contains(parcel.AgencyId.Value)) - throw new InvalidOperationException("Properties may not be added to Projects with a different agency."); - } - - /// - /// Throw an exception if the passed property is in an SPP project that is in a non-draft status. - /// - /// - /// - /// - public static void ThrowIfPropertyInSppProject(this Entity.Property property, ClaimsPrincipal user) - { - var isAdmin = user.HasPermission(Permissions.AdminProperties); - if (!isAdmin && property?.ProjectNumbers?.Contains("SPP") == true) throw new NotAuthorizedException("User may not remove buildings that are in a SPP Project."); - } - - /// - /// Get the latest project associated to this property, using the workflow sort order. - /// - /// - /// The workflow code of the latest workflow associated to this property - public static Entity.Project GetLatestProject(this Entity.Property property) - { - Entity.Project latestProject = null; - if (property is Entity.Parcel parcel && parcel.Projects.Select(pp => pp.Project).Any()) - { - latestProject = parcel.Projects.Select(pp => pp.Project). - Aggregate((Entity.Project projectWithLatestWorkflow, Entity.Project current) => current.Workflow?.SortOrder > projectWithLatestWorkflow?.Workflow?.SortOrder && current?.Status?.IsTerminal == false ? current : projectWithLatestWorkflow); - } - else if (property is Entity.Building building && building.Projects.Select(pp => pp.Project).Any()) - { - latestProject = building.Projects.Select(pp => pp.Project). - Aggregate((Entity.Project projectWithLatestWorkflow, Entity.Project current) => current?.Workflow?.SortOrder > projectWithLatestWorkflow?.Workflow?.SortOrder && current?.Status?.IsTerminal == false ? current : projectWithLatestWorkflow); - } - if (latestProject?.Status?.IsTerminal == true) - { - return null; - } - return latestProject; - } - - /// - /// Get the latest non-terminal workflow associated to this property, using the workflow sort order. - /// - /// - /// The workflow code of the latest workflow associated to this property - public static String GetLatestWorkflowCode(this Entity.Property property) - { - Entity.Project latestProject = GetLatestProject(property); - return latestProject?.Workflow?.Code; - } - - /// - /// Get the latest non-terminal project status associated to this property, using the workflow sort order. - /// - /// - /// The status of the latest project associated to this property - public static String GetLatestProjectStatus(this Entity.Property property) - { - Entity.Project latestProject = GetLatestProject(property); - return latestProject?.Status?.Name; - } - - /// - /// The user may create an evaluation older then the most recent evaluation stored in PIMS. To support this, remove any evaluations that are within one year of the passed date. - /// - /// - /// - /// - public static void RemoveEvaluationsWithinOneYear(this Entity.Property property, Entity.Property updatedProperty, DateTime? disposedOn = null) - { - foreach (Entity.EvaluationKeys key in Enum.GetValues(typeof(Entity.EvaluationKeys))) - { - DateTime? mostRecentDate = null; - DateTime? date = null; - if (property is Entity.Parcel parcel) - { - mostRecentDate = parcel.Evaluations.Where(d => d.Key == key).OrderByDescending(d => d.Date).FirstOrDefault()?.Date; - date = ((Entity.Parcel)updatedProperty).Evaluations.FirstOrDefault(e => e.Key == key)?.Date; - } - else if (property is Entity.Building building) - { - mostRecentDate = building.Evaluations.Where(d => d.Key == key).OrderByDescending(d => d.Date).FirstOrDefault()?.Date; - date = ((Entity.Building)updatedProperty).Evaluations.FirstOrDefault(e => e.Key == key)?.Date; - } - //If the date passed in is the most recent, we don't need to do any removal logic. - if (mostRecentDate == null || date == null || mostRecentDate == date) - { - continue; - } - var maxDate = (disposedOn ?? date)?.AddYears(1); - if (property is Entity.Parcel parcelProperty) - { - parcelProperty.Evaluations.RemoveAll(e => e.Date > date && e.Date < maxDate && key == e.Key); - } - else if (property is Entity.Building building) - { - building.Evaluations.RemoveAll(e => e.Date > date && e.Date < maxDate && key == e.Key); - } - } - } - } -} diff --git a/backend/dal/Helpers/Extensions/RowVersionExtensions.cs b/backend/dal/Helpers/Extensions/RowVersionExtensions.cs deleted file mode 100644 index 7398193bb0..0000000000 --- a/backend/dal/Helpers/Extensions/RowVersionExtensions.cs +++ /dev/null @@ -1,85 +0,0 @@ -using Pims.Dal.Entities; -using Pims.Dal.Exceptions; -using System; - -namespace Pims.Dal.Helpers.Extensions -{ - /// - /// RowVersionExtensions static class, provides extension methods for RowVersions. - /// - public static class RowVersionExtensions - { - /// - /// Convert the string rowversion to a byte array. - /// - /// - /// - public static byte[] ConvertRowVersion(this string rowversion) - { - return Convert.FromBase64String(rowversion); - } - - /// - /// Convert the byte array rowversion to a string. - /// - /// - /// - public static string ConvertRowVersion(this byte[] rowversion) - { - return Convert.ToBase64String(rowversion); - } - - /// - /// Extract the rowversion from the entity and convert to a string. - /// - /// - /// - public static string GetRowVersion(this BaseEntity entity) - { - return Convert.ToBase64String(entity.RowVersion); - } - - /// - /// Copy the rowversion into the destination entity so that EF concurrency will work. - /// - /// - /// - public static void SetRowVersion(this BaseEntity dest, string rowversion) - { - var rv = Convert.FromBase64String(rowversion); - Buffer.BlockCopy(rv, 0, dest.RowVersion, 0, rv.Length); - } - - /// - /// Copy the rowversion from the source entity to the destination entity so that EF concurrency will work. - /// - /// - /// - public static void CopyRowVersionTo(this BaseEntity source, BaseEntity dest) - { - if (source.RowVersion != null) - { - if (dest.RowVersion == null) - { - dest.RowVersion = source.RowVersion; - } - else - { - Buffer.BlockCopy(source.RowVersion, 0, dest.RowVersion, 0, source.RowVersion.Length); - } - } - } - - /// - /// If the RowVersion of the specified entity is null it will throw a RowVersionMissingException. - /// - /// - /// - /// - /// The RowVersion cannot be null. - public static void ThrowIfRowVersionNull(this T entity, string message = null) where T : BaseEntity - { - if (entity?.RowVersion == null) throw new RowVersionMissingException(message); - } - } -} diff --git a/backend/dal/Helpers/Extensions/ServiceCollectionExtensions.cs b/backend/dal/Helpers/Extensions/ServiceCollectionExtensions.cs deleted file mode 100644 index 961ebce63b..0000000000 --- a/backend/dal/Helpers/Extensions/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,111 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; -using System; -using System.Diagnostics.CodeAnalysis; - -namespace Pims.Dal -{ - /// - /// ServiceCollectionExtensions static class, provides extension methods for IServiceCollection. - /// - /// - [ExcludeFromCodeCoverage] - public static class ServiceCollectionExtensions - { - /// - /// Add PimsService and PimsAdminService objects to dependency injection service collection. - /// - /// - /// - public static IServiceCollection AddPimsServices(this IServiceCollection services) - { - return services - .AddPimsService() - .AddPimsAdminService(); - } - - /// - /// Add PimsService objects to the dependency injection service collection. - /// - /// - /// - public static IServiceCollection AddPimsService(this IServiceCollection services) - { - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - return services; // TODO: Use reflection to find all services. - } - - /// - /// Add PimsAdminService objects to the dependency injection service collection. - /// - /// - /// - public static IServiceCollection AddPimsAdminService(this IServiceCollection services) - { - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - return services; // TODO: Use reflection to find all services. - } - - /// - /// Add the PIMS DB Context to the service collection. - /// - /// - /// - /// - /// - public static IServiceCollection AddPimsContext(this IServiceCollection services, IHostEnvironment env, string connectionString) - { - if (String.IsNullOrWhiteSpace(connectionString)) throw new ArgumentException("Argument is required and cannot be null, empty or whitespace.", nameof(connectionString)); - - services.AddDbContext(options => - { - var sql = options.UseSqlServer(connectionString, options => - { - options.CommandTimeout((int)TimeSpan.FromMinutes(5).TotalSeconds); - options.UseNetTopologySuite(); - }); - if (!env.IsProduction()) - { - var debugLoggerFactory = LoggerFactory.Create(builder => { builder.AddDebug(); }); // NOSONAR - sql.UseLoggerFactory(debugLoggerFactory); - options.EnableSensitiveDataLogging(); - } - }); - - return services; - } - } -} diff --git a/backend/dal/Helpers/Extensions/ServiceExtensions.cs b/backend/dal/Helpers/Extensions/ServiceExtensions.cs deleted file mode 100644 index 2d8928407b..0000000000 --- a/backend/dal/Helpers/Extensions/ServiceExtensions.cs +++ /dev/null @@ -1,86 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Pims.Dal.Exceptions; -using Pims.Dal.Services; -using System.Linq; -using Entity = Pims.Dal.Entities; - -namespace Pims.Dal.Helpers.Extensions -{ - /// - /// ServiceExtensions static class, provides extension methods for services. - /// - public static class ServiceExtensions - { - /// - /// A parcel can only be updated or removed if not within an active project or user has admin-properties permission - /// - /// - /// - /// - /// - public static void ThrowIfNotAllowedToUpdate(this BaseService service, Entity.Parcel parcel, ProjectOptions options) - { - if (parcel.ProjectNumbers != null) - { - var project = service.GetContext().Projects - .Include(p => p.Workflow) - .FirstOrDefault(p => parcel.ProjectNumbers.Contains(p.ProjectNumber)); - if (project != null && !project.IsProjectEditable(service.GetUser(), options)) - { - throw new NotAuthorizedException("Cannot update or delete a parcel that is within an active project."); - } - } - } - - /// - /// A building can only be updated or removed if not within an active project or user has admin-properties permission - /// - /// - /// - /// - /// - public static void ThrowIfNotAllowedToUpdate(this BaseService service, Entity.Building building, ProjectOptions options) - { - var context = service.GetContext(); - bool changed() => context.Entry(building).State == EntityState.Modified || - context.Entry(building).State == EntityState.Deleted; - if (building.ProjectNumbers != null && changed()) - { - var project = context.Projects - .Include(p => p.Workflow) - .FirstOrDefault(p => building.ProjectNumbers.Contains(p.ProjectNumber)); - if (project != null && !project.IsProjectEditable(service.GetUser(), options)) - { - throw new NotAuthorizedException("Cannot update or delete a building that is within an active project."); - } - } - } - - /// - /// A parcel can only be updated or removed if not within an active project or user has admin-properties permission - /// - /// - /// - /// - /// - public static void ThrowIfNotAllowedToUpdate(this BaseService service, Entity.Project project, ProjectOptions options) - { - if (project != null && !project.IsProjectEditable(service.GetUser(), options)) - { - throw new NotAuthorizedException("Cannot update or delete an active project."); - } - } - - /// - /// A parcel can only be updated or removed if not within an active project or user has admin-properties permission - /// - /// - /// - /// - /// - public static bool IsAllowedToUpdate(this BaseService service, Entity.Project project, ProjectOptions options) - { - return project != null && project.IsProjectEditable(service.GetUser(), options); - } - } -} diff --git a/backend/dal/Helpers/Extensions/WorkflowExtensions.cs b/backend/dal/Helpers/Extensions/WorkflowExtensions.cs deleted file mode 100644 index 4ec037bebb..0000000000 --- a/backend/dal/Helpers/Extensions/WorkflowExtensions.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Pims.Dal.Entities; -using System.Linq; - -namespace Pims.Dal.Helpers.Extensions -{ - /// - /// WorkflowExtensions static class, provides extension methods for workflows. - /// - public static class WorkflowExtensions - { - /// - /// Add a new project status to the specified 'workflow'. - /// - /// - /// - /// - /// - public static WorkflowProjectStatus AddStatus(this Workflow workflow, ProjectStatus status, int sortOrder) - { - var workflowStatus = new WorkflowProjectStatus(workflow, status, sortOrder); - workflow.Status.Add(workflowStatus); - return workflowStatus; - } - - /// - /// Add a workflow project status transition to the specified workflow project status 'workflowStatus'. - /// This adds a status to the current workflow and a transition from the source 'workflowStatus' to the destination 'toStatus'. - /// Creates a new instance of a WorkflowProjectStatus. - /// Creates a new instance of a ProjectStatusTransition. - /// - /// The workflow project status to add a transition to. - /// The action name to describe the transition. - /// The project status that will be transitions to. - /// The order that the workflow project status is in. - /// - public static WorkflowProjectStatus AddTransition(this WorkflowProjectStatus workflowStatus, string action, ProjectStatus toStatus, int sortOrder) - { - var toWorkflowStatus = workflowStatus.Workflow.AddStatus(toStatus, sortOrder); - workflowStatus.AddTransition(action, toWorkflowStatus); - return toWorkflowStatus; - } - - /// - /// Add a workflow project status transition to the specified workflow project status 'workflowStatus'. - /// This adds a status to the destionation workflow 'toWorkflow' and a transition from the source 'workflowStatus' to the destination workflow 'toWorkflow' and 'toStatus'. - /// Creates a new instance of a WorkflowProjectStatus. - /// Creates a new instance of a ProjectStatusTransition. - /// - /// The workflow project status to add a transition to. - /// The action name to describe the transition. - /// The workflow that will be transitioned to. - /// The project status that will be transitions to. - /// The order that the workflow project status is in. - /// - public static WorkflowProjectStatus AddTransition(this WorkflowProjectStatus workflowStatus, string action, Workflow toWorkflow, ProjectStatus toStatus, int sortOrder) - { - var toWorkflowStatus = toWorkflow.Status.FirstOrDefault(s => s.StatusId == toStatus.Id) ?? toWorkflow.AddStatus(toStatus, sortOrder); - workflowStatus.AddTransition(action, toWorkflowStatus); - return toWorkflowStatus; - } - - /// - /// Add a workflow project status transition to the specified workflow project status 'toWorkflowStatus'. - /// Creates a new instance of a ProjectStatusTransition. - /// - /// The workflow project status to add a transition to. - /// The action name to describe the transition. - /// The workflow project status that will be transitioned to. - /// - public static ProjectStatusTransition AddTransition(this WorkflowProjectStatus workflowStatus, string action, WorkflowProjectStatus toWorkflowStatus) - { - var toTransition = workflowStatus.ToStatus.FirstOrDefault(s => s.ToStatusId == toWorkflowStatus.StatusId) ?? new ProjectStatusTransition(workflowStatus, action, toWorkflowStatus); - return toTransition; - } - } -} diff --git a/backend/dal/Helpers/GeometryHelper.cs b/backend/dal/Helpers/GeometryHelper.cs deleted file mode 100644 index 03162fc078..0000000000 --- a/backend/dal/Helpers/GeometryHelper.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace Pims.Dal.Helpers -{ - /// - /// GeometryHelper static class, provides methods to help with goemetric shapes. - /// - public static class GeometryHelper - { - /// - /// Create a goemetric point object for the specified 'longitude' and 'latitude'. - /// - /// - /// - /// - public static NetTopologySuite.Geometries.Point CreatePoint(double longitude, double latitude) - { - /// Spatial Reference Identifier (SRID) is a unique identifier associated with a specific coordinate system, tolerance, and resolution (default 4326). - return new NetTopologySuite.Geometries.Point(longitude, latitude) { SRID = 4326 }; - } - } -} diff --git a/backend/dal/Helpers/Migrations/ModelBuilderExtensions.cs b/backend/dal/Helpers/Migrations/ModelBuilderExtensions.cs deleted file mode 100644 index 6e3cbec560..0000000000 --- a/backend/dal/Helpers/Migrations/ModelBuilderExtensions.cs +++ /dev/null @@ -1,77 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using System; -using System.Linq; -using System.Reflection; - -namespace Pims.Dal.Helpers.Migrations -{ - /// - /// ModelBuilderExtensions static class, provides extension methods for ModelBuilder objects. - /// - public static class ModelBuilderExtensions - { - #region Methods - /// - /// Applies all of the IEntityTypeConfiguration objects in all of the assemblies of the current domain. - /// - /// - /// - public static ModelBuilder ApplyAllConfigurations(this ModelBuilder modelBuilder) - { - var assemblies = AppDomain.CurrentDomain.GetAssemblies(); - - foreach (var assembly in assemblies) - { - modelBuilder.ApplyAllConfigurations(assembly); - } - - return modelBuilder; - } - - /// - /// Applies all of the IEntityTypeConfiguration objects in the assembly of the specified type. - /// - /// - /// - /// - /// - public static ModelBuilder ApplyAllConfigurations(this ModelBuilder modelBuilder, Type type, PimsContext context = null) - { - if (type == null) throw new ArgumentNullException(nameof(type)); - return modelBuilder.ApplyAllConfigurations(type.Assembly, context); - } - - /// - /// Applies all of the IEntityTypeConfiguration objects in the specified assembly. - /// - /// - /// - /// - /// - public static ModelBuilder ApplyAllConfigurations(this ModelBuilder modelBuilder, Assembly assembly, PimsContext context = null) - { - if (assembly == null) throw new ArgumentNullException(nameof(assembly)); - - // Find all the configuration classes. - var type = typeof(IEntityTypeConfiguration<>); - var configurations = assembly.GetTypes().Where(t => t.IsClass && t.GetInterfaces().Any(i => i.Name.Equals(type.Name))); - - // Fetch the ApplyConfiguration method so that it can be called on each configuration. - var method = typeof(ModelBuilder).GetMethods(BindingFlags.Instance | BindingFlags.Public).Where(m => m.Name.Equals(nameof(ModelBuilder.ApplyConfiguration)) && m.GetParameters()[0].ParameterType.GetGenericTypeDefinition() == type).First(); - foreach (var config in configurations) - { - if (!config.ContainsGenericParameters) - { - var includeContext = config.GetConstructors().Any(c => c.GetParameters().Any(p => p.ParameterType == typeof(PimsContext))); - var entityConfig = includeContext ? Activator.CreateInstance(config, context) : Activator.CreateInstance(config); - var entityType = config.GetInterfaces().FirstOrDefault().GetGenericArguments()[0]; - var applyConfigurationMethod = method.MakeGenericMethod(entityType); - applyConfigurationMethod.Invoke(modelBuilder, new[] { entityConfig }); - } - } - - return modelBuilder; - } - #endregion - } -} diff --git a/backend/dal/Helpers/Migrations/SeedMigration.cs b/backend/dal/Helpers/Migrations/SeedMigration.cs deleted file mode 100644 index 9a6a15af03..0000000000 --- a/backend/dal/Helpers/Migrations/SeedMigration.cs +++ /dev/null @@ -1,176 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.IO; -using System.Linq; -using System.Reflection; - -namespace Pims.Dal.Helpers.Migrations -{ - /// - /// SeedMigration abstract class, provides a way to execute sql script during migrations. - /// - public abstract class SeedMigration : Migration - { - #region Variables - private readonly string _migrationPath; - #endregion - - #region Properties - /// - /// get - The migration version number. - /// - public string Version - { - get - { - var type = this.GetType(); - var attr = type.GetCustomAttribute(true); - - return $"{attr?.Id.Substring(15) ?? type.Name}"; - } - } - - /// - /// get - The default migrations path. - /// - public string DefaultMigrationsPath - { - get - { - return _migrationPath; - } - } - #endregion - - #region Constructors - /// - /// Creates a new instances of a SeedMigration object. - /// - public SeedMigration() - { - _migrationPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Migrations"); - } - #endregion - - #region Methods - /// - /// Execute any scripts in the migration \Up\ folder. - /// - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - if (migrationBuilder == null) throw new ArgumentNullException(nameof(migrationBuilder)); - migrationBuilder.Sql($"PRINT 'Up Scripts'"); - - ScriptDeploy(migrationBuilder, Path.Combine(this.DefaultMigrationsPath, this.Version, "Up")); - } - - /// - /// Execute any scripts in the migration \Up\PreUp\ folder. - /// - /// - protected void PreUp(MigrationBuilder migrationBuilder) - { - if (migrationBuilder == null) throw new ArgumentNullException(nameof(migrationBuilder)); - migrationBuilder.Sql($"PRINT 'PreUp Scripts'"); - - ScriptDeploy(migrationBuilder, Path.Combine(this.DefaultMigrationsPath, this.Version, Path.Combine("Up", "PreUp"))); - } - - /// - /// Execute any scripts in the migration \Up\PostUp\ folder. - /// - /// - protected void PostUp(MigrationBuilder migrationBuilder) - { - if (migrationBuilder == null) throw new ArgumentNullException(nameof(migrationBuilder)); - migrationBuilder.Sql($"PRINT 'PostUp Scripts'"); - - ScriptDeploy(migrationBuilder, Path.Combine(this.DefaultMigrationsPath, this.Version, Path.Combine("Up", "PostUp"))); - } - - /// - /// Execute any scripts in the migration \Down\ folder. - /// - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - if (migrationBuilder == null) throw new ArgumentNullException(nameof(migrationBuilder)); - migrationBuilder.Sql($"PRINT 'Down Scripts'"); - - ScriptDeploy(migrationBuilder, Path.Combine(this.DefaultMigrationsPath, this.Version, "Down")); - } - - /// - /// Execute any scripts in the migration \Up\PreDown\ folder. - /// - /// - protected void PreDown(MigrationBuilder migrationBuilder) - { - if (migrationBuilder == null) throw new ArgumentNullException(nameof(migrationBuilder)); - migrationBuilder.Sql($"PRINT 'PreDown Scripts'"); - - ScriptDeploy(migrationBuilder, Path.Combine(this.DefaultMigrationsPath, this.Version, Path.Combine("Down", "PreDown"))); - } - - /// - /// Execute any scripts in the migration \Down\PostDown\ folder. - /// - /// - protected void PostDown(MigrationBuilder migrationBuilder) - { - if (migrationBuilder == null) throw new ArgumentNullException(nameof(migrationBuilder)); - migrationBuilder.Sql($"PRINT 'PostDown Scripts'"); - - ScriptDeploy(migrationBuilder, Path.Combine(this.DefaultMigrationsPath, this.Version, Path.Combine("Down", "PostDown"))); - } - - /// - /// Execute the specified script or scripts in the specified folder. - /// - /// - /// - protected void ScriptDeploy(MigrationBuilder migrationBuilder, string path) - { - if (migrationBuilder == null) throw new ArgumentNullException(nameof(migrationBuilder)); - if (path == null) throw new ArgumentNullException(nameof(path)); - - if (!Directory.Exists(path) && !File.Exists(path)) - { - migrationBuilder.Sql($"PRINT 'Script does not exist {path}.'"); - return; - } - - var attr = File.GetAttributes(path); - if ((attr & FileAttributes.Directory) == FileAttributes.Directory) - { - var seed_files = System.IO.Directory.GetFiles(path, "*.sql").OrderBy(n => n); - foreach (var file_name in seed_files) - { - ExecuteScript(migrationBuilder, file_name); - } - } - else - { - ExecuteScript(migrationBuilder, path); - } - } - - /// - /// Execute the specified script. - /// - /// - /// - private void ExecuteScript(MigrationBuilder migrationBuilder, string path) - { - migrationBuilder.Sql($"PRINT '---------------> {path}'"); - var sql = File.ReadAllText(path).Trim(); - - if (!String.IsNullOrEmpty(sql)) - { - migrationBuilder.Sql(sql); - } - } - #endregion - } -} diff --git a/backend/dal/IPimsService.cs b/backend/dal/IPimsService.cs deleted file mode 100644 index 7ab12ef8fd..0000000000 --- a/backend/dal/IPimsService.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Pims.Dal.Services; -using System.Security.Claims; - -namespace Pims.Dal -{ - /// - /// IPimsService interface, provides a way to interface with the backend datasource. - /// - public interface IPimsService : IService - { - #region Properties - ClaimsPrincipal Principal { get; } - ILookupService Lookup { get; } - - IUserService User { get; } - - #region Properties - IPropertyService Property { get; } - IBuildingService Building { get; } - IParcelService Parcel { get; } - #endregion - - #region Notifications - INotificationTemplateService NotificationTemplate { get; } - INotificationQueueService NotificationQueue { get; } - #endregion - - #region Projects - IProjectService Project { get; } - IProjectReportService ProjectReport { get; } - IProjectNotificationService ProjectNotification { get; } - IProjectStatusService ProjectStatus { get; } - ITaskService Task { get; } - IWorkflowService Workflow { get; } - #endregion - #endregion - - #region Methods - #endregion - } -} diff --git a/backend/dal/IService.cs b/backend/dal/IService.cs deleted file mode 100644 index 805187b9f7..0000000000 --- a/backend/dal/IService.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Pims.Dal -{ - public interface IService - { - T OriginalValue(object entity, string propertyName); - } -} diff --git a/backend/dal/Migrations/20200722193504_Initial.Designer.cs b/backend/dal/Migrations/20200722193504_Initial.Designer.cs deleted file mode 100644 index 4a0b73f167..0000000000 --- a/backend/dal/Migrations/20200722193504_Initial.Designer.cs +++ /dev/null @@ -1,3341 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20200722193504_Initial")] - partial class Initial - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.5") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("CityId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CityId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Postal", "Address1"); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(true); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LocalId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectNumber") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Latitude", "Longitude", "LocalId", "IsSensitive", "AgencyId", "ClassificationId", "ProjectNumber", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.City", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(4)") - .HasMaxLength(4); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Cities"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Municipality") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("Name") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumber") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Latitude", "Longitude", "IsSensitive", "AgencyId", "ClassificationId", "ProjectNumber", "LandArea", "Municipality", "Zoning", "ZoningPotential", "Description"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("AgencyId1") - .HasColumnType("int"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Estimated") - .HasColumnType("MONEY"); - - b.Property("ExemptionRationale") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("ExemptionRequested") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("OffersNote") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PrivateNote") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("PublicNote") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("AgencyId1"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Estimated", "ReportedFiscalYear", "ActualFiscalYear", "ExemptionRequested"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Estimated") - .HasColumnType("MONEY"); - - b.Property("GainLoss") - .HasColumnType("MONEY"); - - b.Property("InterestComponent") - .HasColumnType("MONEY"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("NetProceeds") - .HasColumnType("MONEY"); - - b.Property("OcgFinancialStatement") - .HasColumnType("MONEY"); - - b.Property("ProgramCost") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SaleWithLeaseInPlace") - .HasColumnType("bit"); - - b.Property("SalesCost") - .HasColumnType("MONEY"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "CreatedOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("datetime2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("ProjectStatusId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId1") - .HasColumnType("int"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectStatusId"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId1"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.City", "City") - .WithMany() - .HasForeignKey("CityId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.City", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId"); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", null) - .WithMany("Projects") - .HasForeignKey("AgencyId1"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany() - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", null) - .WithMany("FromWorkflows") - .HasForeignKey("ProjectStatusId"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Workflow", null) - .WithMany("FromStatus") - .HasForeignKey("WorkflowId1"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20200722193504_Initial.cs b/backend/dal/Migrations/20200722193504_Initial.cs deleted file mode 100644 index b2f9c69ca0..0000000000 --- a/backend/dal/Migrations/20200722193504_Initial.cs +++ /dev/null @@ -1,2806 +0,0 @@ -using System; -using Pims.Dal.Helpers.Migrations; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class Initial : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - migrationBuilder.CreateTable( - name: "Users", - columns: table => new - { - Id = table.Column(nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Username = table.Column(maxLength: 25, nullable: false), - DisplayName = table.Column(maxLength: 100, nullable: false), - FirstName = table.Column(maxLength: 100, nullable: false), - MiddleName = table.Column(maxLength: 100, nullable: true), - LastName = table.Column(maxLength: 100, nullable: false), - Email = table.Column(maxLength: 100, nullable: false), - Position = table.Column(maxLength: 100, nullable: true), - IsDisabled = table.Column(nullable: false, defaultValue: false), - EmailVerified = table.Column(nullable: false, defaultValue: false), - Note = table.Column(maxLength: 1000, nullable: true), - IsSystem = table.Column(nullable: false), - LastLogin = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Users", x => x.Id); - table.ForeignKey( - name: "FK_Users_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Users_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "AccessRequests", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - UserId = table.Column(nullable: false), - Note = table.Column(nullable: true), - Status = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AccessRequests", x => x.Id); - table.ForeignKey( - name: "FK_AccessRequests_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_AccessRequests_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_AccessRequests_Users_UserId", - column: x => x.UserId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Agencies", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Name = table.Column(maxLength: 150, nullable: false), - IsDisabled = table.Column(nullable: false, defaultValue: false), - SortOrder = table.Column(nullable: false, defaultValue: 0), - Code = table.Column(maxLength: 6, nullable: false), - Description = table.Column(maxLength: 500, nullable: true), - ParentId = table.Column(nullable: true), - Email = table.Column(maxLength: 250, nullable: true), - SendEmail = table.Column(nullable: false, defaultValue: true), - AddressTo = table.Column(maxLength: 100, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Agencies", x => x.Id); - table.ForeignKey( - name: "FK_Agencies_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Agencies_Agencies_ParentId", - column: x => x.ParentId, - principalTable: "Agencies", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Agencies_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "BuildingConstructionTypes", - columns: table => new - { - Id = table.Column(nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Name = table.Column(maxLength: 150, nullable: false), - IsDisabled = table.Column(nullable: false, defaultValue: false), - SortOrder = table.Column(nullable: false, defaultValue: 0) - }, - constraints: table => - { - table.PrimaryKey("PK_BuildingConstructionTypes", x => x.Id); - table.ForeignKey( - name: "FK_BuildingConstructionTypes_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_BuildingConstructionTypes_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "BuildingOccupantTypes", - columns: table => new - { - Id = table.Column(nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Name = table.Column(maxLength: 150, nullable: false), - IsDisabled = table.Column(nullable: false, defaultValue: false), - SortOrder = table.Column(nullable: false, defaultValue: 0) - }, - constraints: table => - { - table.PrimaryKey("PK_BuildingOccupantTypes", x => x.Id); - table.ForeignKey( - name: "FK_BuildingOccupantTypes_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_BuildingOccupantTypes_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "BuildingPredominateUses", - columns: table => new - { - Id = table.Column(nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Name = table.Column(maxLength: 150, nullable: false), - IsDisabled = table.Column(nullable: false, defaultValue: false), - SortOrder = table.Column(nullable: false, defaultValue: 0) - }, - constraints: table => - { - table.PrimaryKey("PK_BuildingPredominateUses", x => x.Id); - table.ForeignKey( - name: "FK_BuildingPredominateUses_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_BuildingPredominateUses_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Cities", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Name = table.Column(maxLength: 150, nullable: false), - IsDisabled = table.Column(nullable: false, defaultValue: false), - SortOrder = table.Column(nullable: false, defaultValue: 0), - Code = table.Column(maxLength: 4, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Cities", x => x.Id); - table.ForeignKey( - name: "FK_Cities_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Cities_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Claims", - columns: table => new - { - Id = table.Column(nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Name = table.Column(maxLength: 100, nullable: false), - KeycloakRoleId = table.Column(nullable: true), - Description = table.Column(maxLength: 500, nullable: true), - IsDisabled = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Claims", x => x.Id); - table.ForeignKey( - name: "FK_Claims_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Claims_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "NotificationTemplates", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Name = table.Column(maxLength: 100, nullable: false), - Description = table.Column(maxLength: 500, nullable: true), - To = table.Column(maxLength: 500, nullable: true), - Cc = table.Column(maxLength: 500, nullable: true), - Bcc = table.Column(maxLength: 500, nullable: true), - Audience = table.Column(maxLength: 50, nullable: false), - Encoding = table.Column(maxLength: 50, nullable: false), - BodyType = table.Column(maxLength: 50, nullable: false), - Priority = table.Column(maxLength: 50, nullable: false), - Subject = table.Column(maxLength: 200, nullable: false), - Body = table.Column(nullable: true), - IsDisabled = table.Column(nullable: false), - Tag = table.Column(maxLength: 50, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_NotificationTemplates", x => x.Id); - table.ForeignKey( - name: "FK_NotificationTemplates_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_NotificationTemplates_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "ProjectNumbers", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ProjectNumbers", x => x.Id); - table.ForeignKey( - name: "FK_ProjectNumbers_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ProjectNumbers_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "ProjectRisks", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Name = table.Column(maxLength: 150, nullable: false), - IsDisabled = table.Column(nullable: false, defaultValue: false), - SortOrder = table.Column(nullable: false, defaultValue: 0), - Code = table.Column(maxLength: 10, nullable: false), - Description = table.Column(maxLength: 500, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ProjectRisks", x => x.Id); - table.ForeignKey( - name: "FK_ProjectRisks_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ProjectRisks_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "ProjectStatus", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Name = table.Column(maxLength: 150, nullable: false), - IsDisabled = table.Column(nullable: false, defaultValue: false), - SortOrder = table.Column(nullable: false, defaultValue: 0), - Code = table.Column(maxLength: 10, nullable: false), - GroupName = table.Column(maxLength: 150, nullable: true), - Description = table.Column(maxLength: 1000, nullable: true), - IsMilestone = table.Column(nullable: false, defaultValue: false), - IsTerminal = table.Column(nullable: false, defaultValue: false), - Route = table.Column(maxLength: 150, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ProjectStatus", x => x.Id); - table.ForeignKey( - name: "FK_ProjectStatus_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ProjectStatus_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "PropertyClassifications", - columns: table => new - { - Id = table.Column(nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Name = table.Column(maxLength: 150, nullable: false), - IsDisabled = table.Column(nullable: false, defaultValue: false), - SortOrder = table.Column(nullable: false, defaultValue: 0), - IsVisible = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_PropertyClassifications", x => x.Id); - table.ForeignKey( - name: "FK_PropertyClassifications_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_PropertyClassifications_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "PropertyTypes", - columns: table => new - { - Id = table.Column(nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Name = table.Column(maxLength: 150, nullable: false), - IsDisabled = table.Column(nullable: false, defaultValue: false), - SortOrder = table.Column(nullable: false, defaultValue: 0) - }, - constraints: table => - { - table.PrimaryKey("PK_PropertyTypes", x => x.Id); - table.ForeignKey( - name: "FK_PropertyTypes_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_PropertyTypes_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Provinces", - columns: table => new - { - Id = table.Column(maxLength: 2, nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Name = table.Column(maxLength: 150, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Provinces", x => x.Id); - table.ForeignKey( - name: "FK_Provinces_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Provinces_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Roles", - columns: table => new - { - Id = table.Column(nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Name = table.Column(maxLength: 100, nullable: false), - IsDisabled = table.Column(nullable: false), - SortOrder = table.Column(nullable: false), - KeycloakGroupId = table.Column(nullable: true), - Description = table.Column(maxLength: 500, nullable: true), - IsPublic = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Roles", x => x.Id); - table.ForeignKey( - name: "FK_Roles_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Roles_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "TierLevels", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Name = table.Column(maxLength: 150, nullable: false), - IsDisabled = table.Column(nullable: false, defaultValue: false), - SortOrder = table.Column(nullable: false, defaultValue: 0), - Description = table.Column(maxLength: 1000, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_TierLevels", x => x.Id); - table.ForeignKey( - name: "FK_TierLevels_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_TierLevels_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Workflows", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Name = table.Column(maxLength: 150, nullable: false), - IsDisabled = table.Column(nullable: false, defaultValue: false), - SortOrder = table.Column(nullable: false, defaultValue: 0), - Code = table.Column(maxLength: 20, nullable: false), - Description = table.Column(maxLength: 500, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Workflows", x => x.Id); - table.ForeignKey( - name: "FK_Workflows_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Workflows_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "AccessRequestAgencies", - columns: table => new - { - AccessRequestId = table.Column(nullable: false), - AgencyId = table.Column(nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AccessRequestAgencies", x => new { x.AccessRequestId, x.AgencyId }); - table.ForeignKey( - name: "FK_AccessRequestAgencies_AccessRequests_AccessRequestId", - column: x => x.AccessRequestId, - principalTable: "AccessRequests", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_AccessRequestAgencies_Agencies_AgencyId", - column: x => x.AgencyId, - principalTable: "Agencies", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AccessRequestAgencies_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_AccessRequestAgencies_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "UserAgencies", - columns: table => new - { - UserId = table.Column(nullable: false), - AgencyId = table.Column(nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_UserAgencies", x => new { x.UserId, x.AgencyId }); - table.ForeignKey( - name: "FK_UserAgencies_Agencies_AgencyId", - column: x => x.AgencyId, - principalTable: "Agencies", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_UserAgencies_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_UserAgencies_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_UserAgencies_Users_UserId", - column: x => x.UserId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "ProjectStatusNotifications", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - TemplateId = table.Column(nullable: false), - FromStatusId = table.Column(nullable: true), - ToStatusId = table.Column(nullable: true), - Priority = table.Column(nullable: false), - Delay = table.Column(nullable: false), - DelayDays = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ProjectStatusNotifications", x => x.Id); - table.ForeignKey( - name: "FK_ProjectStatusNotifications_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ProjectStatusNotifications_ProjectStatus_FromStatusId", - column: x => x.FromStatusId, - principalTable: "ProjectStatus", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ProjectStatusNotifications_NotificationTemplates_TemplateId", - column: x => x.TemplateId, - principalTable: "NotificationTemplates", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ProjectStatusNotifications_ProjectStatus_ToStatusId", - column: x => x.ToStatusId, - principalTable: "ProjectStatus", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ProjectStatusNotifications_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Tasks", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Name = table.Column(maxLength: 150, nullable: false), - IsDisabled = table.Column(nullable: false, defaultValue: false), - SortOrder = table.Column(nullable: false, defaultValue: 0), - Description = table.Column(maxLength: 1000, nullable: true), - IsOptional = table.Column(nullable: false), - StatusId = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Tasks", x => x.Id); - table.ForeignKey( - name: "FK_Tasks_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Tasks_ProjectStatus_StatusId", - column: x => x.StatusId, - principalTable: "ProjectStatus", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Tasks_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Addresses", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Address1 = table.Column(maxLength: 150, nullable: true), - Address2 = table.Column(maxLength: 150, nullable: true), - CityId = table.Column(nullable: false), - ProvinceId = table.Column(maxLength: 2, nullable: false), - Postal = table.Column(maxLength: 6, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Addresses", x => x.Id); - table.ForeignKey( - name: "FK_Addresses_Cities_CityId", - column: x => x.CityId, - principalTable: "Cities", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Addresses_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Addresses_Provinces_ProvinceId", - column: x => x.ProvinceId, - principalTable: "Provinces", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Addresses_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "AccessRequestRoles", - columns: table => new - { - AccessRequestId = table.Column(nullable: false), - RoleId = table.Column(nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AccessRequestRoles", x => new { x.AccessRequestId, x.RoleId }); - table.ForeignKey( - name: "FK_AccessRequestRoles_AccessRequests_AccessRequestId", - column: x => x.AccessRequestId, - principalTable: "AccessRequests", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_AccessRequestRoles_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_AccessRequestRoles_Roles_RoleId", - column: x => x.RoleId, - principalTable: "Roles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AccessRequestRoles_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "RoleClaims", - columns: table => new - { - RoleId = table.Column(nullable: false), - ClaimId = table.Column(nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_RoleClaims", x => new { x.RoleId, x.ClaimId }); - table.ForeignKey( - name: "FK_RoleClaims_Claims_ClaimId", - column: x => x.ClaimId, - principalTable: "Claims", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_RoleClaims_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_RoleClaims_Roles_RoleId", - column: x => x.RoleId, - principalTable: "Roles", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_RoleClaims_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "UserRoles", - columns: table => new - { - UserId = table.Column(nullable: false), - RoleId = table.Column(nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_UserRoles", x => new { x.UserId, x.RoleId }); - table.ForeignKey( - name: "FK_UserRoles_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_UserRoles_Roles_RoleId", - column: x => x.RoleId, - principalTable: "Roles", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_UserRoles_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_UserRoles_Users_UserId", - column: x => x.UserId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Projects", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - ProjectNumber = table.Column(maxLength: 25, nullable: false), - Name = table.Column(maxLength: 100, nullable: false), - WorkflowId = table.Column(nullable: true), - Manager = table.Column(maxLength: 150, nullable: true), - ReportedFiscalYear = table.Column(nullable: false), - ActualFiscalYear = table.Column(nullable: false), - AgencyId = table.Column(nullable: false), - StatusId = table.Column(nullable: false), - Description = table.Column(maxLength: 1000, nullable: true), - Note = table.Column(maxLength: 2000, nullable: true), - TierLevelId = table.Column(nullable: false), - RiskId = table.Column(nullable: false), - PublicNote = table.Column(maxLength: 2000, nullable: true), - PrivateNote = table.Column(maxLength: 2000, nullable: true), - Metadata = table.Column(type: "NVARCHAR(MAX)", nullable: true), - OffersNote = table.Column(maxLength: 2000, nullable: true), - SubmittedOn = table.Column(type: "DATETIME2", nullable: true), - ApprovedOn = table.Column(type: "DATETIME2", nullable: true), - DeniedOn = table.Column(type: "DATETIME2", nullable: true), - CancelledOn = table.Column(type: "DATETIME2", nullable: true), - CompletedOn = table.Column(type: "DATETIME2", nullable: true), - ExemptionRequested = table.Column(nullable: false, defaultValue: false), - ExemptionRationale = table.Column(maxLength: 2000, nullable: true), - NetBook = table.Column(type: "MONEY", nullable: false), - Estimated = table.Column(type: "MONEY", nullable: false), - Assessed = table.Column(type: "MONEY", nullable: false), - AgencyId1 = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Projects", x => x.Id); - table.ForeignKey( - name: "FK_Projects_Agencies_AgencyId", - column: x => x.AgencyId, - principalTable: "Agencies", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Projects_Agencies_AgencyId1", - column: x => x.AgencyId1, - principalTable: "Agencies", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Projects_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Projects_ProjectRisks_RiskId", - column: x => x.RiskId, - principalTable: "ProjectRisks", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Projects_ProjectStatus_StatusId", - column: x => x.StatusId, - principalTable: "ProjectStatus", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Projects_TierLevels_TierLevelId", - column: x => x.TierLevelId, - principalTable: "TierLevels", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Projects_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Projects_Workflows_WorkflowId", - column: x => x.WorkflowId, - principalTable: "Workflows", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "WorkflowProjectStatus", - columns: table => new - { - WorkflowId = table.Column(nullable: false), - StatusId = table.Column(nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - SortOrder = table.Column(nullable: false), - IsOptional = table.Column(nullable: false), - ProjectStatusId = table.Column(nullable: true), - WorkflowId1 = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkflowProjectStatus", x => new { x.WorkflowId, x.StatusId }); - table.ForeignKey( - name: "FK_WorkflowProjectStatus_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_WorkflowProjectStatus_ProjectStatus_ProjectStatusId", - column: x => x.ProjectStatusId, - principalTable: "ProjectStatus", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_WorkflowProjectStatus_ProjectStatus_StatusId", - column: x => x.StatusId, - principalTable: "ProjectStatus", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_WorkflowProjectStatus_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_WorkflowProjectStatus_Workflows_WorkflowId", - column: x => x.WorkflowId, - principalTable: "Workflows", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_WorkflowProjectStatus_Workflows_WorkflowId1", - column: x => x.WorkflowId1, - principalTable: "Workflows", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Parcels", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - ProjectNumber = table.Column(maxLength: 50, nullable: true), - Name = table.Column(maxLength: 150, nullable: true), - Description = table.Column(maxLength: 2000, nullable: true), - ClassificationId = table.Column(nullable: false), - AgencyId = table.Column(nullable: true), - AddressId = table.Column(nullable: false), - Latitude = table.Column(nullable: false), - Longitude = table.Column(nullable: false), - IsSensitive = table.Column(nullable: false, defaultValue: false), - IsVisibleToOtherAgencies = table.Column(nullable: false, defaultValue: false), - PID = table.Column(nullable: false), - PIN = table.Column(nullable: true), - LandArea = table.Column(nullable: false), - LandLegalDescription = table.Column(maxLength: 500, nullable: true), - Municipality = table.Column(maxLength: 250, nullable: true), - Zoning = table.Column(maxLength: 50, nullable: true), - ZoningPotential = table.Column(maxLength: 50, nullable: true), - NotOwned = table.Column(nullable: false, defaultValue: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Parcels", x => x.Id); - table.ForeignKey( - name: "FK_Parcels_Addresses_AddressId", - column: x => x.AddressId, - principalTable: "Addresses", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Parcels_Agencies_AgencyId", - column: x => x.AgencyId, - principalTable: "Agencies", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Parcels_PropertyClassifications_ClassificationId", - column: x => x.ClassificationId, - principalTable: "PropertyClassifications", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Parcels_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Parcels_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "NotificationQueue", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Key = table.Column(nullable: false), - Status = table.Column(nullable: false), - Priority = table.Column(maxLength: 50, nullable: false), - Encoding = table.Column(maxLength: 50, nullable: false), - SendOn = table.Column(type: "DATETIME2", nullable: false), - To = table.Column(maxLength: 500, nullable: true), - Subject = table.Column(maxLength: 200, nullable: false), - BodyType = table.Column(maxLength: 50, nullable: false), - Body = table.Column(nullable: false), - Bcc = table.Column(maxLength: 500, nullable: true), - Cc = table.Column(maxLength: 500, nullable: true), - Tag = table.Column(maxLength: 50, nullable: true), - ProjectId = table.Column(nullable: true), - ToAgencyId = table.Column(nullable: true), - TemplateId = table.Column(nullable: true), - ChesMessageId = table.Column(nullable: true), - ChesTransactionId = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_NotificationQueue", x => x.Id); - table.ForeignKey( - name: "FK_NotificationQueue_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_NotificationQueue_Projects_ProjectId", - column: x => x.ProjectId, - principalTable: "Projects", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_NotificationQueue_NotificationTemplates_TemplateId", - column: x => x.TemplateId, - principalTable: "NotificationTemplates", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_NotificationQueue_Agencies_ToAgencyId", - column: x => x.ToAgencyId, - principalTable: "Agencies", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_NotificationQueue_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "ProjectNotes", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - ProjectId = table.Column(nullable: false), - NoteType = table.Column(nullable: false), - Note = table.Column(type: "NVARCHAR(MAX)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ProjectNotes", x => x.Id); - table.ForeignKey( - name: "FK_ProjectNotes_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ProjectNotes_Projects_ProjectId", - column: x => x.ProjectId, - principalTable: "Projects", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ProjectNotes_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "ProjectSnapshots", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - ProjectId = table.Column(nullable: false), - NetBook = table.Column(type: "MONEY", nullable: false), - Estimated = table.Column(type: "MONEY", nullable: false), - Assessed = table.Column(type: "MONEY", nullable: false), - SalesCost = table.Column(type: "MONEY", nullable: false), - NetProceeds = table.Column(type: "MONEY", nullable: false), - ProgramCost = table.Column(type: "MONEY", nullable: false), - GainLoss = table.Column(type: "MONEY", nullable: false), - OcgFinancialStatement = table.Column(type: "MONEY", nullable: true), - InterestComponent = table.Column(type: "MONEY", nullable: false), - SaleWithLeaseInPlace = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ProjectSnapshots", x => x.Id); - table.ForeignKey( - name: "FK_ProjectSnapshots_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ProjectSnapshots_Projects_ProjectId", - column: x => x.ProjectId, - principalTable: "Projects", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_ProjectSnapshots_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "ProjectTasks", - columns: table => new - { - ProjectId = table.Column(nullable: false), - TaskId = table.Column(nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - IsCompleted = table.Column(nullable: false), - CompletedOn = table.Column(type: "DATETIME2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ProjectTasks", x => new { x.ProjectId, x.TaskId }); - table.ForeignKey( - name: "FK_ProjectTasks_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ProjectTasks_Projects_ProjectId", - column: x => x.ProjectId, - principalTable: "Projects", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_ProjectTasks_Tasks_TaskId", - column: x => x.TaskId, - principalTable: "Tasks", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_ProjectTasks_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "ProjectStatusTransitions", - columns: table => new - { - FromWorkflowId = table.Column(nullable: false), - FromStatusId = table.Column(nullable: false), - ToWorkflowId = table.Column(nullable: false), - ToStatusId = table.Column(nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Action = table.Column(maxLength: 100, nullable: true), - ValidateTasks = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ProjectStatusTransitions", x => new { x.FromWorkflowId, x.FromStatusId, x.ToWorkflowId, x.ToStatusId }); - table.ForeignKey( - name: "FK_ProjectStatusTransitions_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ProjectStatusTransitions_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ProjectStatusTransitions_WorkflowProjectStatus_FromWorkflowId_FromStatusId", - columns: x => new { x.FromWorkflowId, x.FromStatusId }, - principalTable: "WorkflowProjectStatus", - principalColumns: new[] { "WorkflowId", "StatusId" }, - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_ProjectStatusTransitions_WorkflowProjectStatus_ToWorkflowId_ToStatusId", - columns: x => new { x.ToWorkflowId, x.ToStatusId }, - principalTable: "WorkflowProjectStatus", - principalColumns: new[] { "WorkflowId", "StatusId" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Buildings", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - ProjectNumber = table.Column(maxLength: 50, nullable: true), - Name = table.Column(maxLength: 150, nullable: true), - Description = table.Column(maxLength: 2000, nullable: true), - ClassificationId = table.Column(nullable: false), - AgencyId = table.Column(nullable: true), - AddressId = table.Column(nullable: false), - Latitude = table.Column(nullable: false), - Longitude = table.Column(nullable: false), - IsSensitive = table.Column(nullable: false, defaultValue: false), - IsVisibleToOtherAgencies = table.Column(nullable: false, defaultValue: false), - ParcelId = table.Column(nullable: false), - LocalId = table.Column(maxLength: 50, nullable: true), - BuildingConstructionTypeId = table.Column(nullable: false), - BuildingFloorCount = table.Column(nullable: false), - BuildingPredominateUseId = table.Column(nullable: false), - BuildingTenancy = table.Column(nullable: false), - RentableArea = table.Column(nullable: false), - BuildingOccupantTypeId = table.Column(nullable: false), - LeaseExpiry = table.Column(type: "DATETIME2", nullable: true), - OccupantName = table.Column(maxLength: 100, nullable: true), - TransferLeaseOnSale = table.Column(nullable: false, defaultValue: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Buildings", x => x.Id); - table.ForeignKey( - name: "FK_Buildings_Addresses_AddressId", - column: x => x.AddressId, - principalTable: "Addresses", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Buildings_Agencies_AgencyId", - column: x => x.AgencyId, - principalTable: "Agencies", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Buildings_BuildingConstructionTypes_BuildingConstructionTypeId", - column: x => x.BuildingConstructionTypeId, - principalTable: "BuildingConstructionTypes", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Buildings_BuildingOccupantTypes_BuildingOccupantTypeId", - column: x => x.BuildingOccupantTypeId, - principalTable: "BuildingOccupantTypes", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Buildings_BuildingPredominateUses_BuildingPredominateUseId", - column: x => x.BuildingPredominateUseId, - principalTable: "BuildingPredominateUses", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Buildings_PropertyClassifications_ClassificationId", - column: x => x.ClassificationId, - principalTable: "PropertyClassifications", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Buildings_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Buildings_Parcels_ParcelId", - column: x => x.ParcelId, - principalTable: "Parcels", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Buildings_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "ParcelEvaluations", - columns: table => new - { - ParcelId = table.Column(nullable: false), - Date = table.Column(type: "DATE", nullable: false), - Key = table.Column(nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Firm = table.Column(maxLength: 150, nullable: true), - Value = table.Column(type: "MONEY", nullable: false), - Note = table.Column(maxLength: 500, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ParcelEvaluations", x => new { x.ParcelId, x.Date, x.Key }); - table.ForeignKey( - name: "FK_ParcelEvaluations_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ParcelEvaluations_Parcels_ParcelId", - column: x => x.ParcelId, - principalTable: "Parcels", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ParcelEvaluations_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "ParcelFiscals", - columns: table => new - { - ParcelId = table.Column(nullable: false), - FiscalYear = table.Column(nullable: false), - Key = table.Column(nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Value = table.Column(type: "MONEY", nullable: false), - Note = table.Column(maxLength: 500, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ParcelFiscals", x => new { x.ParcelId, x.FiscalYear, x.Key }); - table.ForeignKey( - name: "FK_ParcelFiscals_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ParcelFiscals_Parcels_ParcelId", - column: x => x.ParcelId, - principalTable: "Parcels", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ParcelFiscals_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "ProjectAgencyResponses", - columns: table => new - { - ProjectId = table.Column(nullable: false), - AgencyId = table.Column(nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - OfferAmount = table.Column(type: "MONEY", nullable: false), - NotificationId = table.Column(nullable: true), - Response = table.Column(nullable: false), - ReceivedOn = table.Column(type: "DATETIME2", nullable: true), - Note = table.Column(maxLength: 2000, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ProjectAgencyResponses", x => new { x.ProjectId, x.AgencyId }); - table.ForeignKey( - name: "FK_ProjectAgencyResponses_Agencies_AgencyId", - column: x => x.AgencyId, - principalTable: "Agencies", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ProjectAgencyResponses_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ProjectAgencyResponses_NotificationQueue_NotificationId", - column: x => x.NotificationId, - principalTable: "NotificationQueue", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ProjectAgencyResponses_Projects_ProjectId", - column: x => x.ProjectId, - principalTable: "Projects", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ProjectAgencyResponses_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "BuildingEvaluations", - columns: table => new - { - BuildingId = table.Column(nullable: false), - Date = table.Column(type: "DATE", nullable: false), - Key = table.Column(nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Value = table.Column(type: "MONEY", nullable: false), - Note = table.Column(maxLength: 500, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_BuildingEvaluations", x => new { x.BuildingId, x.Date, x.Key }); - table.ForeignKey( - name: "FK_BuildingEvaluations_Buildings_BuildingId", - column: x => x.BuildingId, - principalTable: "Buildings", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_BuildingEvaluations_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_BuildingEvaluations_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "BuildingFiscals", - columns: table => new - { - BuildingId = table.Column(nullable: false), - FiscalYear = table.Column(nullable: false), - Key = table.Column(nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Value = table.Column(type: "MONEY", nullable: false), - Note = table.Column(maxLength: 500, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_BuildingFiscals", x => new { x.BuildingId, x.FiscalYear, x.Key }); - table.ForeignKey( - name: "FK_BuildingFiscals_Buildings_BuildingId", - column: x => x.BuildingId, - principalTable: "Buildings", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_BuildingFiscals_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_BuildingFiscals_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "ProjectProperties", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - ProjectId = table.Column(nullable: false), - PropertyType = table.Column(nullable: false), - ParcelId = table.Column(nullable: true), - BuildingId = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ProjectProperties", x => x.Id); - table.ForeignKey( - name: "FK_ProjectProperties_Buildings_BuildingId", - column: x => x.BuildingId, - principalTable: "Buildings", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_ProjectProperties_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ProjectProperties_Parcels_ParcelId", - column: x => x.ParcelId, - principalTable: "Parcels", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_ProjectProperties_Projects_ProjectId", - column: x => x.ProjectId, - principalTable: "Projects", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_ProjectProperties_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateIndex( - name: "IX_AccessRequestAgencies_AgencyId", - table: "AccessRequestAgencies", - column: "AgencyId"); - - migrationBuilder.CreateIndex( - name: "IX_AccessRequestAgencies_CreatedById", - table: "AccessRequestAgencies", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_AccessRequestAgencies_UpdatedById", - table: "AccessRequestAgencies", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_AccessRequestRoles_CreatedById", - table: "AccessRequestRoles", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_AccessRequestRoles_RoleId", - table: "AccessRequestRoles", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "IX_AccessRequestRoles_UpdatedById", - table: "AccessRequestRoles", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_AccessRequests_CreatedById", - table: "AccessRequests", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_AccessRequests_Status", - table: "AccessRequests", - column: "Status"); - - migrationBuilder.CreateIndex( - name: "IX_AccessRequests_UpdatedById", - table: "AccessRequests", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_AccessRequests_UserId", - table: "AccessRequests", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_Addresses_CityId", - table: "Addresses", - column: "CityId"); - - migrationBuilder.CreateIndex( - name: "IX_Addresses_CreatedById", - table: "Addresses", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Addresses_ProvinceId", - table: "Addresses", - column: "ProvinceId"); - - migrationBuilder.CreateIndex( - name: "IX_Addresses_UpdatedById", - table: "Addresses", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Addresses_Postal_Address1", - table: "Addresses", - columns: new[] { "Postal", "Address1" }); - - migrationBuilder.CreateIndex( - name: "IX_Agencies_CreatedById", - table: "Agencies", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Agencies_ParentId", - table: "Agencies", - column: "ParentId"); - - migrationBuilder.CreateIndex( - name: "IX_Agencies_UpdatedById", - table: "Agencies", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Agencies_Code_ParentId", - table: "Agencies", - columns: new[] { "Code", "ParentId" }, - unique: true, - filter: "[ParentId] IS NOT NULL"); - - migrationBuilder.CreateIndex( - name: "IX_Agencies_IsDisabled_Code_Name_ParentId_SortOrder", - table: "Agencies", - columns: new[] { "IsDisabled", "Code", "Name", "ParentId", "SortOrder" }); - - migrationBuilder.CreateIndex( - name: "IX_BuildingConstructionTypes_CreatedById", - table: "BuildingConstructionTypes", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_BuildingConstructionTypes_Name", - table: "BuildingConstructionTypes", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_BuildingConstructionTypes_UpdatedById", - table: "BuildingConstructionTypes", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_BuildingConstructionTypes_IsDisabled_Name_SortOrder", - table: "BuildingConstructionTypes", - columns: new[] { "IsDisabled", "Name", "SortOrder" }); - - migrationBuilder.CreateIndex( - name: "IX_BuildingEvaluations_CreatedById", - table: "BuildingEvaluations", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_BuildingEvaluations_UpdatedById", - table: "BuildingEvaluations", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_BuildingEvaluations_BuildingId_Date_Key_Value", - table: "BuildingEvaluations", - columns: new[] { "BuildingId", "Date", "Key", "Value" }); - - migrationBuilder.CreateIndex( - name: "IX_BuildingFiscals_CreatedById", - table: "BuildingFiscals", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_BuildingFiscals_UpdatedById", - table: "BuildingFiscals", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_BuildingFiscals_BuildingId_FiscalYear_Key_Value", - table: "BuildingFiscals", - columns: new[] { "BuildingId", "FiscalYear", "Key", "Value" }); - - migrationBuilder.CreateIndex( - name: "IX_BuildingOccupantTypes_CreatedById", - table: "BuildingOccupantTypes", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_BuildingOccupantTypes_Name", - table: "BuildingOccupantTypes", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_BuildingOccupantTypes_UpdatedById", - table: "BuildingOccupantTypes", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_BuildingOccupantTypes_IsDisabled_Name_SortOrder", - table: "BuildingOccupantTypes", - columns: new[] { "IsDisabled", "Name", "SortOrder" }); - - migrationBuilder.CreateIndex( - name: "IX_BuildingPredominateUses_CreatedById", - table: "BuildingPredominateUses", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_BuildingPredominateUses_Name", - table: "BuildingPredominateUses", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_BuildingPredominateUses_UpdatedById", - table: "BuildingPredominateUses", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_BuildingPredominateUses_IsDisabled_Name_SortOrder", - table: "BuildingPredominateUses", - columns: new[] { "IsDisabled", "Name", "SortOrder" }); - - migrationBuilder.CreateIndex( - name: "IX_Buildings_AddressId", - table: "Buildings", - column: "AddressId"); - - migrationBuilder.CreateIndex( - name: "IX_Buildings_AgencyId", - table: "Buildings", - column: "AgencyId"); - - migrationBuilder.CreateIndex( - name: "IX_Buildings_BuildingConstructionTypeId", - table: "Buildings", - column: "BuildingConstructionTypeId"); - - migrationBuilder.CreateIndex( - name: "IX_Buildings_BuildingOccupantTypeId", - table: "Buildings", - column: "BuildingOccupantTypeId"); - - migrationBuilder.CreateIndex( - name: "IX_Buildings_BuildingPredominateUseId", - table: "Buildings", - column: "BuildingPredominateUseId"); - - migrationBuilder.CreateIndex( - name: "IX_Buildings_ClassificationId", - table: "Buildings", - column: "ClassificationId"); - - migrationBuilder.CreateIndex( - name: "IX_Buildings_CreatedById", - table: "Buildings", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Buildings_ParcelId", - table: "Buildings", - column: "ParcelId"); - - migrationBuilder.CreateIndex( - name: "IX_Buildings_UpdatedById", - table: "Buildings", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Buildings_Latitude_Longitude_LocalId_IsSensitive_AgencyId_ClassificationId_ProjectNumber_BuildingConstructionTypeId_Building~", - table: "Buildings", - columns: new[] { "Latitude", "Longitude", "LocalId", "IsSensitive", "AgencyId", "ClassificationId", "ProjectNumber", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy" }); - - migrationBuilder.CreateIndex( - name: "IX_Cities_Code", - table: "Cities", - column: "Code", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Cities_CreatedById", - table: "Cities", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Cities_UpdatedById", - table: "Cities", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Cities_IsDisabled_Name_SortOrder", - table: "Cities", - columns: new[] { "IsDisabled", "Name", "SortOrder" }); - - migrationBuilder.CreateIndex( - name: "IX_Claims_CreatedById", - table: "Claims", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Claims_Name", - table: "Claims", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Claims_UpdatedById", - table: "Claims", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Claims_IsDisabled_Name", - table: "Claims", - columns: new[] { "IsDisabled", "Name" }); - - migrationBuilder.CreateIndex( - name: "IX_NotificationQueue_CreatedById", - table: "NotificationQueue", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_NotificationQueue_Key", - table: "NotificationQueue", - column: "Key", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_NotificationQueue_TemplateId", - table: "NotificationQueue", - column: "TemplateId"); - - migrationBuilder.CreateIndex( - name: "IX_NotificationQueue_ToAgencyId", - table: "NotificationQueue", - column: "ToAgencyId"); - - migrationBuilder.CreateIndex( - name: "IX_NotificationQueue_UpdatedById", - table: "NotificationQueue", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_NotificationQueue_ProjectId_TemplateId_ToAgencyId", - table: "NotificationQueue", - columns: new[] { "ProjectId", "TemplateId", "ToAgencyId" }); - - migrationBuilder.CreateIndex( - name: "IX_NotificationQueue_Status_SendOn_Subject", - table: "NotificationQueue", - columns: new[] { "Status", "SendOn", "Subject" }); - - migrationBuilder.CreateIndex( - name: "IX_NotificationTemplates_CreatedById", - table: "NotificationTemplates", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_NotificationTemplates_Name", - table: "NotificationTemplates", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_NotificationTemplates_UpdatedById", - table: "NotificationTemplates", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_NotificationTemplates_IsDisabled_Tag", - table: "NotificationTemplates", - columns: new[] { "IsDisabled", "Tag" }); - - migrationBuilder.CreateIndex( - name: "IX_ParcelEvaluations_CreatedById", - table: "ParcelEvaluations", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ParcelEvaluations_UpdatedById", - table: "ParcelEvaluations", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ParcelEvaluations_ParcelId_Date_Key_Value", - table: "ParcelEvaluations", - columns: new[] { "ParcelId", "Date", "Key", "Value" }); - - migrationBuilder.CreateIndex( - name: "IX_ParcelFiscals_CreatedById", - table: "ParcelFiscals", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ParcelFiscals_UpdatedById", - table: "ParcelFiscals", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ParcelFiscals_ParcelId_FiscalYear_Key_Value", - table: "ParcelFiscals", - columns: new[] { "ParcelId", "FiscalYear", "Key", "Value" }); - - migrationBuilder.CreateIndex( - name: "IX_Parcels_AddressId", - table: "Parcels", - column: "AddressId"); - - migrationBuilder.CreateIndex( - name: "IX_Parcels_AgencyId", - table: "Parcels", - column: "AgencyId"); - - migrationBuilder.CreateIndex( - name: "IX_Parcels_ClassificationId", - table: "Parcels", - column: "ClassificationId"); - - migrationBuilder.CreateIndex( - name: "IX_Parcels_CreatedById", - table: "Parcels", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Parcels_UpdatedById", - table: "Parcels", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Parcels_PID_PIN", - table: "Parcels", - columns: new[] { "PID", "PIN" }, - unique: true, - filter: "[PIN] IS NOT NULL"); - - migrationBuilder.CreateIndex( - name: "IX_Parcels_Latitude_Longitude_IsSensitive_AgencyId_ClassificationId_ProjectNumber_LandArea_Municipality_Zoning_ZoningPotential_~", - table: "Parcels", - columns: new[] { "Latitude", "Longitude", "IsSensitive", "AgencyId", "ClassificationId", "ProjectNumber", "LandArea", "Municipality", "Zoning", "ZoningPotential", "Description" }); - - migrationBuilder.CreateIndex( - name: "IX_ProjectAgencyResponses_AgencyId", - table: "ProjectAgencyResponses", - column: "AgencyId"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectAgencyResponses_CreatedById", - table: "ProjectAgencyResponses", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectAgencyResponses_NotificationId", - table: "ProjectAgencyResponses", - column: "NotificationId"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectAgencyResponses_UpdatedById", - table: "ProjectAgencyResponses", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectAgencyResponses_ProjectId_AgencyId_Response_ReceivedOn_Note", - table: "ProjectAgencyResponses", - columns: new[] { "ProjectId", "AgencyId", "Response", "ReceivedOn", "Note" }); - - migrationBuilder.CreateIndex( - name: "IX_ProjectNotes_CreatedById", - table: "ProjectNotes", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectNotes_UpdatedById", - table: "ProjectNotes", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectNotes_ProjectId_NoteType", - table: "ProjectNotes", - columns: new[] { "ProjectId", "NoteType" }); - - migrationBuilder.CreateIndex( - name: "IX_ProjectNumbers_CreatedById", - table: "ProjectNumbers", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectNumbers_UpdatedById", - table: "ProjectNumbers", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectProperties_BuildingId", - table: "ProjectProperties", - column: "BuildingId"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectProperties_CreatedById", - table: "ProjectProperties", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectProperties_ParcelId", - table: "ProjectProperties", - column: "ParcelId"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectProperties_UpdatedById", - table: "ProjectProperties", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectProperties_ProjectId_ParcelId_BuildingId", - table: "ProjectProperties", - columns: new[] { "ProjectId", "ParcelId", "BuildingId" }, - unique: true, - filter: "[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectRisks_Code", - table: "ProjectRisks", - column: "Code", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_ProjectRisks_CreatedById", - table: "ProjectRisks", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectRisks_UpdatedById", - table: "ProjectRisks", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectRisks_IsDisabled_Code_Name_SortOrder", - table: "ProjectRisks", - columns: new[] { "IsDisabled", "Code", "Name", "SortOrder" }); - - migrationBuilder.CreateIndex( - name: "IX_Projects_AgencyId", - table: "Projects", - column: "AgencyId"); - - migrationBuilder.CreateIndex( - name: "IX_Projects_AgencyId1", - table: "Projects", - column: "AgencyId1"); - - migrationBuilder.CreateIndex( - name: "IX_Projects_CreatedById", - table: "Projects", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Projects_ProjectNumber", - table: "Projects", - column: "ProjectNumber", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Projects_RiskId", - table: "Projects", - column: "RiskId"); - - migrationBuilder.CreateIndex( - name: "IX_Projects_StatusId", - table: "Projects", - column: "StatusId"); - - migrationBuilder.CreateIndex( - name: "IX_Projects_TierLevelId", - table: "Projects", - column: "TierLevelId"); - - migrationBuilder.CreateIndex( - name: "IX_Projects_UpdatedById", - table: "Projects", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Projects_WorkflowId", - table: "Projects", - column: "WorkflowId"); - - migrationBuilder.CreateIndex( - name: "IX_Projects_Name_StatusId_TierLevelId_AgencyId", - table: "Projects", - columns: new[] { "Name", "StatusId", "TierLevelId", "AgencyId" }); - - migrationBuilder.CreateIndex( - name: "IX_Projects_Assessed_NetBook_Estimated_ReportedFiscalYear_ActualFiscalYear_ExemptionRequested", - table: "Projects", - columns: new[] { "Assessed", "NetBook", "Estimated", "ReportedFiscalYear", "ActualFiscalYear", "ExemptionRequested" }); - - migrationBuilder.CreateIndex( - name: "IX_ProjectSnapshots_CreatedById", - table: "ProjectSnapshots", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectSnapshots_UpdatedById", - table: "ProjectSnapshots", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectSnapshots_ProjectId_CreatedOn", - table: "ProjectSnapshots", - columns: new[] { "ProjectId", "CreatedOn" }); - - migrationBuilder.CreateIndex( - name: "IX_ProjectStatus_Code", - table: "ProjectStatus", - column: "Code", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_ProjectStatus_CreatedById", - table: "ProjectStatus", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectStatus_UpdatedById", - table: "ProjectStatus", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectStatus_IsDisabled_Name_Code_SortOrder", - table: "ProjectStatus", - columns: new[] { "IsDisabled", "Name", "Code", "SortOrder" }); - - migrationBuilder.CreateIndex( - name: "IX_ProjectStatusNotifications_CreatedById", - table: "ProjectStatusNotifications", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectStatusNotifications_TemplateId", - table: "ProjectStatusNotifications", - column: "TemplateId"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectStatusNotifications_ToStatusId", - table: "ProjectStatusNotifications", - column: "ToStatusId"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectStatusNotifications_UpdatedById", - table: "ProjectStatusNotifications", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectStatusNotifications_FromStatusId_ToStatusId", - table: "ProjectStatusNotifications", - columns: new[] { "FromStatusId", "ToStatusId" }); - - migrationBuilder.CreateIndex( - name: "IX_ProjectStatusTransitions_CreatedById", - table: "ProjectStatusTransitions", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectStatusTransitions_UpdatedById", - table: "ProjectStatusTransitions", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectStatusTransitions_ToWorkflowId_ToStatusId", - table: "ProjectStatusTransitions", - columns: new[] { "ToWorkflowId", "ToStatusId" }); - - migrationBuilder.CreateIndex( - name: "IX_ProjectTasks_CreatedById", - table: "ProjectTasks", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectTasks_TaskId", - table: "ProjectTasks", - column: "TaskId"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectTasks_UpdatedById", - table: "ProjectTasks", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectTasks_ProjectId_TaskId_IsCompleted_CompletedOn", - table: "ProjectTasks", - columns: new[] { "ProjectId", "TaskId", "IsCompleted", "CompletedOn" }); - - migrationBuilder.CreateIndex( - name: "IX_PropertyClassifications_CreatedById", - table: "PropertyClassifications", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_PropertyClassifications_Name", - table: "PropertyClassifications", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_PropertyClassifications_UpdatedById", - table: "PropertyClassifications", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_PropertyClassifications_IsDisabled_Name", - table: "PropertyClassifications", - columns: new[] { "IsDisabled", "Name" }); - - migrationBuilder.CreateIndex( - name: "IX_PropertyTypes_CreatedById", - table: "PropertyTypes", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_PropertyTypes_Name", - table: "PropertyTypes", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_PropertyTypes_UpdatedById", - table: "PropertyTypes", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_PropertyTypes_IsDisabled_Name_SortOrder", - table: "PropertyTypes", - columns: new[] { "IsDisabled", "Name", "SortOrder" }); - - migrationBuilder.CreateIndex( - name: "IX_Provinces_CreatedById", - table: "Provinces", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Provinces_Name", - table: "Provinces", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Provinces_UpdatedById", - table: "Provinces", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_RoleClaims_ClaimId", - table: "RoleClaims", - column: "ClaimId"); - - migrationBuilder.CreateIndex( - name: "IX_RoleClaims_CreatedById", - table: "RoleClaims", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_RoleClaims_UpdatedById", - table: "RoleClaims", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Roles_CreatedById", - table: "Roles", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Roles_Name", - table: "Roles", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Roles_UpdatedById", - table: "Roles", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Roles_IsDisabled_Name", - table: "Roles", - columns: new[] { "IsDisabled", "Name" }); - - migrationBuilder.CreateIndex( - name: "IX_Tasks_CreatedById", - table: "Tasks", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Tasks_StatusId", - table: "Tasks", - column: "StatusId"); - - migrationBuilder.CreateIndex( - name: "IX_Tasks_UpdatedById", - table: "Tasks", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Tasks_IsDisabled_IsOptional_Name_SortOrder", - table: "Tasks", - columns: new[] { "IsDisabled", "IsOptional", "Name", "SortOrder" }); - - migrationBuilder.CreateIndex( - name: "IX_TierLevels_CreatedById", - table: "TierLevels", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_TierLevels_Name", - table: "TierLevels", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_TierLevels_UpdatedById", - table: "TierLevels", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_TierLevels_IsDisabled_Name_SortOrder", - table: "TierLevels", - columns: new[] { "IsDisabled", "Name", "SortOrder" }); - - migrationBuilder.CreateIndex( - name: "IX_UserAgencies_AgencyId", - table: "UserAgencies", - column: "AgencyId"); - - migrationBuilder.CreateIndex( - name: "IX_UserAgencies_CreatedById", - table: "UserAgencies", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_UserAgencies_UpdatedById", - table: "UserAgencies", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_UserRoles_CreatedById", - table: "UserRoles", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_UserRoles_RoleId", - table: "UserRoles", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "IX_UserRoles_UpdatedById", - table: "UserRoles", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Users_CreatedById", - table: "Users", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Users_Email", - table: "Users", - column: "Email", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Users_UpdatedById", - table: "Users", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Users_Username", - table: "Users", - column: "Username", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Users_IsDisabled_LastName_FirstName", - table: "Users", - columns: new[] { "IsDisabled", "LastName", "FirstName" }); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowProjectStatus_CreatedById", - table: "WorkflowProjectStatus", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowProjectStatus_ProjectStatusId", - table: "WorkflowProjectStatus", - column: "ProjectStatusId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowProjectStatus_StatusId", - table: "WorkflowProjectStatus", - column: "StatusId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowProjectStatus_UpdatedById", - table: "WorkflowProjectStatus", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowProjectStatus_WorkflowId1", - table: "WorkflowProjectStatus", - column: "WorkflowId1"); - - migrationBuilder.CreateIndex( - name: "IX_Workflows_Code", - table: "Workflows", - column: "Code", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Workflows_CreatedById", - table: "Workflows", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Workflows_Name", - table: "Workflows", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Workflows_UpdatedById", - table: "Workflows", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Workflows_IsDisabled_Name_SortOrder", - table: "Workflows", - columns: new[] { "IsDisabled", "Name", "SortOrder" }); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AccessRequestAgencies"); - - migrationBuilder.DropTable( - name: "AccessRequestRoles"); - - migrationBuilder.DropTable( - name: "BuildingEvaluations"); - - migrationBuilder.DropTable( - name: "BuildingFiscals"); - - migrationBuilder.DropTable( - name: "ParcelEvaluations"); - - migrationBuilder.DropTable( - name: "ParcelFiscals"); - - migrationBuilder.DropTable( - name: "ProjectAgencyResponses"); - - migrationBuilder.DropTable( - name: "ProjectNotes"); - - migrationBuilder.DropTable( - name: "ProjectNumbers"); - - migrationBuilder.DropTable( - name: "ProjectProperties"); - - migrationBuilder.DropTable( - name: "ProjectSnapshots"); - - migrationBuilder.DropTable( - name: "ProjectStatusNotifications"); - - migrationBuilder.DropTable( - name: "ProjectStatusTransitions"); - - migrationBuilder.DropTable( - name: "ProjectTasks"); - - migrationBuilder.DropTable( - name: "PropertyTypes"); - - migrationBuilder.DropTable( - name: "RoleClaims"); - - migrationBuilder.DropTable( - name: "UserAgencies"); - - migrationBuilder.DropTable( - name: "UserRoles"); - - migrationBuilder.DropTable( - name: "AccessRequests"); - - migrationBuilder.DropTable( - name: "NotificationQueue"); - - migrationBuilder.DropTable( - name: "Buildings"); - - migrationBuilder.DropTable( - name: "WorkflowProjectStatus"); - - migrationBuilder.DropTable( - name: "Tasks"); - - migrationBuilder.DropTable( - name: "Claims"); - - migrationBuilder.DropTable( - name: "Roles"); - - migrationBuilder.DropTable( - name: "Projects"); - - migrationBuilder.DropTable( - name: "NotificationTemplates"); - - migrationBuilder.DropTable( - name: "BuildingConstructionTypes"); - - migrationBuilder.DropTable( - name: "BuildingOccupantTypes"); - - migrationBuilder.DropTable( - name: "BuildingPredominateUses"); - - migrationBuilder.DropTable( - name: "Parcels"); - - migrationBuilder.DropTable( - name: "ProjectRisks"); - - migrationBuilder.DropTable( - name: "ProjectStatus"); - - migrationBuilder.DropTable( - name: "TierLevels"); - - migrationBuilder.DropTable( - name: "Workflows"); - - migrationBuilder.DropTable( - name: "Addresses"); - - migrationBuilder.DropTable( - name: "Agencies"); - - migrationBuilder.DropTable( - name: "PropertyClassifications"); - - migrationBuilder.DropTable( - name: "Cities"); - - migrationBuilder.DropTable( - name: "Provinces"); - - migrationBuilder.DropTable( - name: "Users"); - } - } -} diff --git a/backend/dal/Migrations/20200925194028_v01.00.01.Designer.cs b/backend/dal/Migrations/20200925194028_v01.00.01.Designer.cs deleted file mode 100644 index 6bd7de053b..0000000000 --- a/backend/dal/Migrations/20200925194028_v01.00.01.Designer.cs +++ /dev/null @@ -1,3364 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20200925194028_v01.00.01")] - partial class v010001 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.5") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("CityId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("CityId", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "CityId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "CityId", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LocalId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectNumber") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ParcelId", "ClassificationId", "AddressId", "ProjectNumber", "BuildingPredominateUseId", "BuildingConstructionTypeId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.HasIndex("Id", "Latitude", "Longitude", "IsSensitive", "AgencyId", "ParcelId", "ClassificationId", "AddressId", "ProjectNumber", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.City", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(4)") - .HasMaxLength(4); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("Cities"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Municipality") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("Name") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumber") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumber", "LandArea", "Municipality", "Zoning", "ZoningPotential"); - - b.HasIndex("Id", "Latitude", "Longitude", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumber", "LandArea", "Municipality", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("AgencyId1") - .HasColumnType("int"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Estimated") - .HasColumnType("MONEY"); - - b.Property("ExemptionRationale") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("ExemptionRequested") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("OffersNote") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PrivateNote") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("PublicNote") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("AgencyId1"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Estimated", "ReportedFiscalYear", "ActualFiscalYear", "ExemptionRequested"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Estimated") - .HasColumnType("MONEY"); - - b.Property("GainLoss") - .HasColumnType("MONEY"); - - b.Property("InterestComponent") - .HasColumnType("MONEY"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("NetProceeds") - .HasColumnType("MONEY"); - - b.Property("OcgFinancialStatement") - .HasColumnType("MONEY"); - - b.Property("ProgramCost") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SaleWithLeaseInPlace") - .HasColumnType("bit"); - - b.Property("SalesCost") - .HasColumnType("MONEY"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "CreatedOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("datetime2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("ProjectStatusId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId1") - .HasColumnType("int"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectStatusId"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId1"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.City", "City") - .WithMany() - .HasForeignKey("CityId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.City", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId"); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", null) - .WithMany("Projects") - .HasForeignKey("AgencyId1"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany() - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", null) - .WithMany("FromWorkflows") - .HasForeignKey("ProjectStatusId"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Workflow", null) - .WithMany("FromStatus") - .HasForeignKey("WorkflowId1"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20200925194028_v01.00.01.cs b/backend/dal/Migrations/20200925194028_v01.00.01.cs deleted file mode 100644 index 7bbc2d0d19..0000000000 --- a/backend/dal/Migrations/20200925194028_v01.00.01.cs +++ /dev/null @@ -1,308 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v010001 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - migrationBuilder.DropIndex( - name: "IX_Parcels_Latitude_Longitude_IsSensitive_AgencyId_ClassificationId_ProjectNumber_LandArea_Municipality_Zoning_ZoningPotential_~", - table: "Parcels"); - - migrationBuilder.DropIndex( - name: "IX_Cities_IsDisabled_Name_SortOrder", - table: "Cities"); - - migrationBuilder.DropIndex( - name: "IX_Buildings_Latitude_Longitude_LocalId_IsSensitive_AgencyId_ClassificationId_ProjectNumber_BuildingConstructionTypeId_Building~", - table: "Buildings"); - - migrationBuilder.DropIndex( - name: "IX_Addresses_CityId", - table: "Addresses"); - - migrationBuilder.DropIndex( - name: "IX_Addresses_Postal_Address1", - table: "Addresses"); - - migrationBuilder.AlterColumn( - name: "SalesCost", - table: "ProjectSnapshots", - type: "MONEY", - nullable: true, - oldClrType: typeof(decimal), - oldType: "MONEY"); - - migrationBuilder.AlterColumn( - name: "ProgramCost", - table: "ProjectSnapshots", - type: "MONEY", - nullable: true, - oldClrType: typeof(decimal), - oldType: "MONEY"); - - migrationBuilder.AlterColumn( - name: "NetProceeds", - table: "ProjectSnapshots", - type: "MONEY", - nullable: true, - oldClrType: typeof(decimal), - oldType: "MONEY"); - - migrationBuilder.AlterColumn( - name: "InterestComponent", - table: "ProjectSnapshots", - type: "MONEY", - nullable: true, - oldClrType: typeof(decimal), - oldType: "MONEY"); - - migrationBuilder.AlterColumn( - name: "GainLoss", - table: "ProjectSnapshots", - type: "MONEY", - nullable: true, - oldClrType: typeof(decimal), - oldType: "MONEY"); - - migrationBuilder.AlterColumn( - name: "SendEmail", - table: "Agencies", - nullable: false, - oldClrType: typeof(bool), - oldType: "bit", - oldDefaultValue: true); - - migrationBuilder.CreateIndex( - name: "IX_Parcels_Id_AgencyId_IsSensitive_AddressId", - table: "Parcels", - columns: new[] { "Id", "AgencyId", "IsSensitive", "AddressId" }); - - migrationBuilder.CreateIndex( - name: "IX_Parcels_Id_IsSensitive_AgencyId_ClassificationId_PID_PIN_AddressId_ProjectNumber_LandArea_Municipality_Zoning_ZoningPotential", - table: "Parcels", - columns: new[] { "Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumber", "LandArea", "Municipality", "Zoning", "ZoningPotential" }); - - migrationBuilder.CreateIndex( - name: "IX_Parcels_Id_Latitude_Longitude_IsSensitive_AgencyId_ClassificationId_PID_PIN_AddressId_ProjectNumber_LandArea_Municipality_Zo~", - table: "Parcels", - columns: new[] { "Id", "Latitude", "Longitude", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumber", "LandArea", "Municipality", "Zoning", "ZoningPotential" }); - - migrationBuilder.CreateIndex( - name: "IX_ParcelFiscals_ParcelId_Key", - table: "ParcelFiscals", - columns: new[] { "ParcelId", "Key" }); - - migrationBuilder.CreateIndex( - name: "IX_ParcelEvaluations_ParcelId_Key", - table: "ParcelEvaluations", - columns: new[] { "ParcelId", "Key" }); - - migrationBuilder.CreateIndex( - name: "IX_Cities_Id_IsDisabled_Name_SortOrder", - table: "Cities", - columns: new[] { "Id", "IsDisabled", "Name", "SortOrder" }); - - migrationBuilder.CreateIndex( - name: "IX_Buildings_Id_IsSensitive_AgencyId_ParcelId_ClassificationId_AddressId_ProjectNumber_BuildingPredominateUseId_BuildingConstru~", - table: "Buildings", - columns: new[] { "Id", "IsSensitive", "AgencyId", "ParcelId", "ClassificationId", "AddressId", "ProjectNumber", "BuildingPredominateUseId", "BuildingConstructionTypeId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy" }); - - migrationBuilder.CreateIndex( - name: "IX_Buildings_Id_Latitude_Longitude_IsSensitive_AgencyId_ParcelId_ClassificationId_AddressId_ProjectNumber_BuildingConstructionT~", - table: "Buildings", - columns: new[] { "Id", "Latitude", "Longitude", "IsSensitive", "AgencyId", "ParcelId", "ClassificationId", "AddressId", "ProjectNumber", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy" }); - - migrationBuilder.CreateIndex( - name: "IX_BuildingFiscals_BuildingId_Key", - table: "BuildingFiscals", - columns: new[] { "BuildingId", "Key" }); - - migrationBuilder.CreateIndex( - name: "IX_BuildingEvaluations_BuildingId_Key", - table: "BuildingEvaluations", - columns: new[] { "BuildingId", "Key" }); - - migrationBuilder.CreateIndex( - name: "IX_Addresses_CityId_ProvinceId", - table: "Addresses", - columns: new[] { "CityId", "ProvinceId" }) - .Annotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - migrationBuilder.CreateIndex( - name: "IX_Addresses_Id_Address1", - table: "Addresses", - columns: new[] { "Id", "Address1" }) - .Annotation("SqlServer:Include", new[] { "Address2" }); - - migrationBuilder.CreateIndex( - name: "IX_Addresses_Id_CityId", - table: "Addresses", - columns: new[] { "Id", "CityId" }) - .Annotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - migrationBuilder.CreateIndex( - name: "IX_Addresses_Id_Postal", - table: "Addresses", - columns: new[] { "Id", "Postal" }) - .Annotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - migrationBuilder.CreateIndex( - name: "IX_Addresses_Id_ProvinceId_CityId_Postal_Address1", - table: "Addresses", - columns: new[] { "Id", "ProvinceId", "CityId", "Postal", "Address1" }) - .Annotation("SqlServer:Include", new[] { "Address2" }); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - migrationBuilder.DropIndex( - name: "IX_Parcels_Id_AgencyId_IsSensitive_AddressId", - table: "Parcels"); - - migrationBuilder.DropIndex( - name: "IX_Parcels_Id_IsSensitive_AgencyId_ClassificationId_PID_PIN_AddressId_ProjectNumber_LandArea_Municipality_Zoning_ZoningPotential", - table: "Parcels"); - - migrationBuilder.DropIndex( - name: "IX_Parcels_Id_Latitude_Longitude_IsSensitive_AgencyId_ClassificationId_PID_PIN_AddressId_ProjectNumber_LandArea_Municipality_Zo~", - table: "Parcels"); - - migrationBuilder.DropIndex( - name: "IX_ParcelFiscals_ParcelId_Key", - table: "ParcelFiscals"); - - migrationBuilder.DropIndex( - name: "IX_ParcelEvaluations_ParcelId_Key", - table: "ParcelEvaluations"); - - migrationBuilder.DropIndex( - name: "IX_Cities_Id_IsDisabled_Name_SortOrder", - table: "Cities"); - - migrationBuilder.DropIndex( - name: "IX_Buildings_Id_IsSensitive_AgencyId_ParcelId_ClassificationId_AddressId_ProjectNumber_BuildingPredominateUseId_BuildingConstru~", - table: "Buildings"); - - migrationBuilder.DropIndex( - name: "IX_Buildings_Id_Latitude_Longitude_IsSensitive_AgencyId_ParcelId_ClassificationId_AddressId_ProjectNumber_BuildingConstructionT~", - table: "Buildings"); - - migrationBuilder.DropIndex( - name: "IX_BuildingFiscals_BuildingId_Key", - table: "BuildingFiscals"); - - migrationBuilder.DropIndex( - name: "IX_BuildingEvaluations_BuildingId_Key", - table: "BuildingEvaluations"); - - migrationBuilder.DropIndex( - name: "IX_Addresses_CityId_ProvinceId", - table: "Addresses"); - - migrationBuilder.DropIndex( - name: "IX_Addresses_Id_Address1", - table: "Addresses"); - - migrationBuilder.DropIndex( - name: "IX_Addresses_Id_CityId", - table: "Addresses"); - - migrationBuilder.DropIndex( - name: "IX_Addresses_Id_Postal", - table: "Addresses"); - - migrationBuilder.DropIndex( - name: "IX_Addresses_Id_ProvinceId_CityId_Postal_Address1", - table: "Addresses"); - - migrationBuilder.AlterColumn( - name: "SalesCost", - table: "ProjectSnapshots", - type: "MONEY", - nullable: false, - oldClrType: typeof(decimal), - oldType: "MONEY", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "ProgramCost", - table: "ProjectSnapshots", - type: "MONEY", - nullable: false, - oldClrType: typeof(decimal), - oldType: "MONEY", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "NetProceeds", - table: "ProjectSnapshots", - type: "MONEY", - nullable: false, - oldClrType: typeof(decimal), - oldType: "MONEY", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "InterestComponent", - table: "ProjectSnapshots", - type: "MONEY", - nullable: false, - oldClrType: typeof(decimal), - oldType: "MONEY", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "GainLoss", - table: "ProjectSnapshots", - type: "MONEY", - nullable: false, - oldClrType: typeof(decimal), - oldType: "MONEY", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "SendEmail", - table: "Agencies", - type: "bit", - nullable: false, - defaultValue: true, - oldClrType: typeof(bool)); - - migrationBuilder.CreateIndex( - name: "IX_Parcels_Latitude_Longitude_IsSensitive_AgencyId_ClassificationId_ProjectNumber_LandArea_Municipality_Zoning_ZoningPotential_~", - table: "Parcels", - columns: new[] { "Latitude", "Longitude", "IsSensitive", "AgencyId", "ClassificationId", "ProjectNumber", "LandArea", "Municipality", "Zoning", "ZoningPotential", "Description" }); - - migrationBuilder.CreateIndex( - name: "IX_Cities_IsDisabled_Name_SortOrder", - table: "Cities", - columns: new[] { "IsDisabled", "Name", "SortOrder" }); - - migrationBuilder.CreateIndex( - name: "IX_Buildings_Latitude_Longitude_LocalId_IsSensitive_AgencyId_ClassificationId_ProjectNumber_BuildingConstructionTypeId_Building~", - table: "Buildings", - columns: new[] { "Latitude", "Longitude", "LocalId", "IsSensitive", "AgencyId", "ClassificationId", "ProjectNumber", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy" }); - - migrationBuilder.CreateIndex( - name: "IX_Addresses_CityId", - table: "Addresses", - column: "CityId"); - - migrationBuilder.CreateIndex( - name: "IX_Addresses_Postal_Address1", - table: "Addresses", - columns: new[] { "Postal", "Address1" }); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20201022154928_v01.01.00.Designer.cs b/backend/dal/Migrations/20201022154928_v01.01.00.Designer.cs deleted file mode 100644 index 81bac33bd1..0000000000 --- a/backend/dal/Migrations/20201022154928_v01.01.00.Designer.cs +++ /dev/null @@ -1,3441 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20201022154928_v01.01.00")] - partial class v010100 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.5") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("CityId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("CityId", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "CityId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "CityId", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LocalId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectNumber") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ParcelId", "ClassificationId", "AddressId", "ProjectNumber", "BuildingPredominateUseId", "BuildingConstructionTypeId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.HasIndex("Id", "Latitude", "Longitude", "IsSensitive", "AgencyId", "ParcelId", "ClassificationId", "AddressId", "ProjectNumber", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.City", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(4)") - .HasMaxLength(4); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("Cities"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Municipality") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("Name") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumber") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumber", "LandArea", "Municipality", "Zoning", "ZoningPotential"); - - b.HasIndex("Id", "Latitude", "Longitude", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumber", "LandArea", "Municipality", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("AgencyId1") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("decimal(18,2)"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Estimated") - .HasColumnType("MONEY"); - - b.Property("ExemptionRationale") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("ExemptionRequested") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("OffersNote") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PrivateNote") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("PublicNote") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("AgencyId1"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Estimated", "ReportedFiscalYear", "ActualFiscalYear", "ExemptionRequested"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("BaselineIntegrity") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Estimated") - .HasColumnType("MONEY"); - - b.Property("GainLoss") - .HasColumnType("MONEY"); - - b.Property("InterestComponent") - .HasColumnType("MONEY"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("NetProceeds") - .HasColumnType("MONEY"); - - b.Property("OcgFinancialStatement") - .HasColumnType("MONEY"); - - b.Property("ProgramCost") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SaleWithLeaseInPlace") - .HasColumnType("bit"); - - b.Property("SalesCost") - .HasColumnType("MONEY"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("datetime2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("ProjectStatusId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId1") - .HasColumnType("int"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectStatusId"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId1"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.City", "City") - .WithMany() - .HasForeignKey("CityId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.City", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId"); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", null) - .WithMany("Projects") - .HasForeignKey("AgencyId1"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany() - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", null) - .WithMany("FromWorkflows") - .HasForeignKey("ProjectStatusId"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Workflow", null) - .WithMany("FromStatus") - .HasForeignKey("WorkflowId1"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20201022154928_v01.01.00.cs b/backend/dal/Migrations/20201022154928_v01.01.00.cs deleted file mode 100644 index 70fd75bacc..0000000000 --- a/backend/dal/Migrations/20201022154928_v01.01.00.cs +++ /dev/null @@ -1,142 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v010100 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - migrationBuilder.DropIndex( - name: "IX_ProjectSnapshots_ProjectId_CreatedOn", - table: "ProjectSnapshots"); - - migrationBuilder.AddColumn( - name: "Appraised", - table: "Projects", - type: "MONEY", - nullable: false, - defaultValue: 0m); - - migrationBuilder.AddColumn( - name: "AppraisedNote", - table: "Projects", - type: "NVARCHAR(MAX)", - nullable: true); - - migrationBuilder.AddColumn( - name: "Appraised", - table: "ProjectSnapshots", - type: "MONEY", - nullable: false, - defaultValue: 0m); - - migrationBuilder.AddColumn( - name: "BaselineIntegrity", - table: "ProjectSnapshots", - type: "MONEY", - nullable: true); - - migrationBuilder.AddColumn( - name: "SnapshotOn", - table: "ProjectSnapshots", - type: "DATETIME2", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.CreateTable( - name: "ProjectReports", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - IsFinal = table.Column(nullable: false), - Name = table.Column(maxLength: 250, nullable: true), - From = table.Column(type: "DATETIME2", nullable: true), - To = table.Column(type: "DATETIME2", nullable: false), - ReportTypeId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ProjectReports", x => x.Id); - table.ForeignKey( - name: "FK_ProjectReports_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ProjectReports_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateIndex( - name: "IX_ProjectSnapshots_ProjectId_SnapshotOn", - table: "ProjectSnapshots", - columns: new[] { "ProjectId", "SnapshotOn" }); - - migrationBuilder.CreateIndex( - name: "IX_ProjectReports_CreatedById", - table: "ProjectReports", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectReports_UpdatedById", - table: "ProjectReports", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectReports_Id_To_From_IsFinal", - table: "ProjectReports", - columns: new[] { "Id", "To", "From", "IsFinal" }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - migrationBuilder.DropTable( - name: "ProjectReports"); - - migrationBuilder.DropIndex( - name: "IX_ProjectSnapshots_ProjectId_SnapshotOn", - table: "ProjectSnapshots"); - - migrationBuilder.DropColumn( - name: "Appraised", - table: "ProjectSnapshots"); - - migrationBuilder.DropColumn( - name: "AppraisedNote", - table: "Projects"); - - migrationBuilder.DropColumn( - name: "BaselineIntegrity", - table: "ProjectSnapshots"); - - migrationBuilder.DropColumn( - name: "SnapshotOn", - table: "ProjectSnapshots"); - - migrationBuilder.DropColumn( - name: "Appraised", - table: "Projects"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectSnapshots_ProjectId_CreatedOn", - table: "ProjectSnapshots", - columns: new[] { "ProjectId", "CreatedOn" }); - } - } -} diff --git a/backend/dal/Migrations/20201102211604_v01.02.00.Designer.cs b/backend/dal/Migrations/20201102211604_v01.02.00.Designer.cs deleted file mode 100644 index 1d7e162801..0000000000 --- a/backend/dal/Migrations/20201102211604_v01.02.00.Designer.cs +++ /dev/null @@ -1,3487 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20201102211604_v01.02.00")] - partial class v010200 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumber") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumber", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumber", "BuildingPredominateUseId", "BuildingConstructionTypeId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumber") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumber", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("AgencyId1") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("AppraisedNote") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Estimated") - .HasColumnType("MONEY"); - - b.Property("ExemptionRationale") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("ExemptionRequested") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("OffersNote") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PrivateNote") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("PublicNote") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("AgencyId1"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Estimated", "ReportedFiscalYear", "ActualFiscalYear", "ExemptionRequested"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("BaselineIntegrity") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Estimated") - .HasColumnType("MONEY"); - - b.Property("GainLoss") - .HasColumnType("MONEY"); - - b.Property("InterestComponent") - .HasColumnType("MONEY"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("NetProceeds") - .HasColumnType("MONEY"); - - b.Property("OcgFinancialStatement") - .HasColumnType("MONEY"); - - b.Property("ProgramCost") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SaleWithLeaseInPlace") - .HasColumnType("bit"); - - b.Property("SalesCost") - .HasColumnType("MONEY"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("datetime2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("ProjectStatusId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId1") - .HasColumnType("int"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectStatusId"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId1"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId"); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", null) - .WithMany("Projects") - .HasForeignKey("AgencyId1"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany() - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", null) - .WithMany("FromWorkflows") - .HasForeignKey("ProjectStatusId"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Workflow", null) - .WithMany("FromStatus") - .HasForeignKey("WorkflowId1"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20201102211604_v01.02.00.cs b/backend/dal/Migrations/20201102211604_v01.02.00.cs deleted file mode 100644 index e0ade5238e..0000000000 --- a/backend/dal/Migrations/20201102211604_v01.02.00.cs +++ /dev/null @@ -1,526 +0,0 @@ -using System; -using Pims.Dal.Helpers.Migrations; -using Microsoft.EntityFrameworkCore.Migrations; -using NetTopologySuite.Geometries; - -namespace Pims.Dal.Migrations -{ - public partial class v010200 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - migrationBuilder.DropForeignKey( - name: "FK_Addresses_Cities_CityId", - table: "Addresses"); - - migrationBuilder.DropForeignKey( - name: "FK_Buildings_Parcels_ParcelId", - table: "Buildings"); - - migrationBuilder.DropTable( - name: "Cities"); - - migrationBuilder.DropIndex( - name: "IX_Parcels_Id_IsSensitive_AgencyId_ClassificationId_PID_PIN_AddressId_ProjectNumber_LandArea_Municipality_Zoning_ZoningPotential", - table: "Parcels"); - - migrationBuilder.DropIndex( - name: "IX_Parcels_Id_Latitude_Longitude_IsSensitive_AgencyId_ClassificationId_PID_PIN_AddressId_ProjectNumber_LandArea_Municipality_Zo~", - table: "Parcels"); - - migrationBuilder.DropIndex( - name: "IX_Buildings_ParcelId", - table: "Buildings"); - - migrationBuilder.DropIndex( - name: "IX_Buildings_Id_IsSensitive_AgencyId_ParcelId_ClassificationId_AddressId_ProjectNumber_BuildingPredominateUseId_BuildingConstru~", - table: "Buildings"); - - migrationBuilder.DropIndex( - name: "IX_Buildings_Id_Latitude_Longitude_IsSensitive_AgencyId_ParcelId_ClassificationId_AddressId_ProjectNumber_BuildingConstructionT~", - table: "Buildings"); - - migrationBuilder.DropIndex( - name: "IX_Addresses_CityId_ProvinceId", - table: "Addresses"); - - migrationBuilder.DropIndex( - name: "IX_Addresses_Id_CityId", - table: "Addresses"); - - migrationBuilder.DropIndex( - name: "IX_Addresses_Id_ProvinceId_CityId_Postal_Address1", - table: "Addresses"); - - migrationBuilder.DropColumn( - name: "Municipality", - table: "Parcels"); - - migrationBuilder.DropColumn( - name: "LocalId", - table: "Buildings"); - - migrationBuilder.DropColumn( - name: "ParcelId", - table: "Buildings"); - - migrationBuilder.DropColumn( - name: "CityId", - table: "Addresses"); - - migrationBuilder.AlterColumn( - name: "Name", - table: "Parcels", - maxLength: 250, - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(150)", - oldMaxLength: 150, - oldNullable: true); - - migrationBuilder.AddColumn( - name: "Boundary", - table: "Parcels", - type: "GEOGRAPHY", - nullable: true); - - migrationBuilder.AddColumn( - name: "Location", - table: "Parcels", - type: "GEOGRAPHY", - nullable: true); - - migrationBuilder.AlterColumn( - name: "Name", - table: "Buildings", - maxLength: 250, - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(150)", - oldMaxLength: 150, - oldNullable: true); - - migrationBuilder.AddColumn( - name: "Boundary", - table: "Buildings", - type: "GEOGRAPHY", - nullable: true); - - migrationBuilder.AddColumn( - name: "Location", - table: "Buildings", - type: "GEOGRAPHY", - nullable: true); - - ScriptDeploy(migrationBuilder, System.IO.Path.Combine(this.DefaultMigrationsPath, this.Version, System.IO.Path.Combine("Up", "Properties"))); - - migrationBuilder.DropColumn( - name: "Latitude", - table: "Parcels"); - - migrationBuilder.DropColumn( - name: "Longitude", - table: "Parcels"); - - migrationBuilder.DropColumn( - name: "Latitude", - table: "Buildings"); - - migrationBuilder.DropColumn( - name: "Longitude", - table: "Buildings"); - - migrationBuilder.AddColumn( - name: "AdministrativeArea", - table: "Addresses", - nullable: true); - - migrationBuilder.CreateTable( - name: "AdministrativeAreas", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Name = table.Column(maxLength: 150, nullable: false), - IsDisabled = table.Column(nullable: false, defaultValue: false), - SortOrder = table.Column(nullable: false, defaultValue: 0), - Abbreviation = table.Column(maxLength: 100, nullable: true), - BoundaryType = table.Column(maxLength: 50, nullable: true), - GroupName = table.Column(maxLength: 250, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AdministrativeAreas", x => x.Id); - table.ForeignKey( - name: "FK_AdministrativeAreas_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_AdministrativeAreas_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "ParcelBuildings", - columns: table => new - { - ParcelId = table.Column(nullable: false), - BuildingId = table.Column(nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ParcelBuildings", x => new { x.ParcelId, x.BuildingId }); - table.ForeignKey( - name: "FK_ParcelBuildings_Buildings_BuildingId", - column: x => x.BuildingId, - principalTable: "Buildings", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ParcelBuildings_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ParcelBuildings_Parcels_ParcelId", - column: x => x.ParcelId, - principalTable: "Parcels", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ParcelBuildings_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateIndex( - name: "IX_Parcels_Id_IsSensitive_AgencyId_ClassificationId_PID_PIN_AddressId_ProjectNumber_LandArea_Zoning_ZoningPotential", - table: "Parcels", - columns: new[] { "Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumber", "LandArea", "Zoning", "ZoningPotential" }); - - migrationBuilder.CreateIndex( - name: "IX_Buildings_Id_IsSensitive_AgencyId_ClassificationId_AddressId_ProjectNumber_BuildingConstructionTypeId_BuildingPredominateUse~", - table: "Buildings", - columns: new[] { "Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumber", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy" }); - - migrationBuilder.CreateIndex( - name: "IX_Buildings_Id_IsSensitive_AgencyId_ClassificationId_AddressId_ProjectNumber_BuildingPredominateUseId_BuildingConstructionType~", - table: "Buildings", - columns: new[] { "Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumber", "BuildingPredominateUseId", "BuildingConstructionTypeId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy" }); - - migrationBuilder.CreateIndex( - name: "IX_Addresses_AdministrativeArea_ProvinceId", - table: "Addresses", - columns: new[] { "AdministrativeArea", "ProvinceId" }) - .Annotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - migrationBuilder.CreateIndex( - name: "IX_Addresses_Id_AdministrativeArea", - table: "Addresses", - columns: new[] { "Id", "AdministrativeArea" }) - .Annotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - migrationBuilder.CreateIndex( - name: "IX_Addresses_Id_ProvinceId_AdministrativeArea_Postal_Address1", - table: "Addresses", - columns: new[] { "Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1" }) - .Annotation("SqlServer:Include", new[] { "Address2" }); - - migrationBuilder.CreateIndex( - name: "IX_AdministrativeAreas_CreatedById", - table: "AdministrativeAreas", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_AdministrativeAreas_UpdatedById", - table: "AdministrativeAreas", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_AdministrativeAreas_Id_IsDisabled_Name_SortOrder", - table: "AdministrativeAreas", - columns: new[] { "Id", "IsDisabled", "Name", "SortOrder" }); - - migrationBuilder.CreateIndex( - name: "IX_ParcelBuildings_BuildingId", - table: "ParcelBuildings", - column: "BuildingId"); - - migrationBuilder.CreateIndex( - name: "IX_ParcelBuildings_CreatedById", - table: "ParcelBuildings", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ParcelBuildings_UpdatedById", - table: "ParcelBuildings", - column: "UpdatedById"); - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - migrationBuilder.DropTable( - name: "AdministrativeAreas"); - - migrationBuilder.DropTable( - name: "ParcelBuildings"); - - migrationBuilder.DropIndex( - name: "IX_Parcels_Id_IsSensitive_AgencyId_ClassificationId_PID_PIN_AddressId_ProjectNumber_LandArea_Zoning_ZoningPotential", - table: "Parcels"); - - migrationBuilder.DropIndex( - name: "IX_Buildings_Id_IsSensitive_AgencyId_ClassificationId_AddressId_ProjectNumber_BuildingConstructionTypeId_BuildingPredominateUse~", - table: "Buildings"); - - migrationBuilder.DropIndex( - name: "IX_Buildings_Id_IsSensitive_AgencyId_ClassificationId_AddressId_ProjectNumber_BuildingPredominateUseId_BuildingConstructionType~", - table: "Buildings"); - - migrationBuilder.DropIndex( - name: "IX_Addresses_AdministrativeArea_ProvinceId", - table: "Addresses"); - - migrationBuilder.DropIndex( - name: "IX_Addresses_Id_AdministrativeArea", - table: "Addresses"); - - migrationBuilder.DropIndex( - name: "IX_Addresses_Id_ProvinceId_AdministrativeArea_Postal_Address1", - table: "Addresses"); - - migrationBuilder.DropColumn( - name: "Boundary", - table: "Parcels"); - - migrationBuilder.DropColumn( - name: "Boundary", - table: "Buildings"); - - migrationBuilder.DropColumn( - name: "AdministrativeArea", - table: "Addresses"); - - migrationBuilder.AlterColumn( - name: "Name", - table: "Parcels", - type: "nvarchar(150)", - maxLength: 150, - nullable: true, - oldClrType: typeof(string), - oldMaxLength: 250, - oldNullable: true); - - migrationBuilder.AddColumn( - name: "Latitude", - table: "Parcels", - type: "float", - nullable: true, - defaultValue: 0.0); - - migrationBuilder.AddColumn( - name: "Longitude", - table: "Parcels", - type: "float", - nullable: true, - defaultValue: 0.0); - - migrationBuilder.AddColumn( - name: "Municipality", - table: "Parcels", - type: "nvarchar(250)", - maxLength: 250, - nullable: true); - - migrationBuilder.AlterColumn( - name: "Name", - table: "Buildings", - type: "nvarchar(150)", - maxLength: 150, - nullable: true, - oldClrType: typeof(string), - oldMaxLength: 250, - oldNullable: true); - - migrationBuilder.AddColumn( - name: "Latitude", - table: "Buildings", - type: "float", - nullable: true, - defaultValue: 0.0); - - migrationBuilder.AddColumn( - name: "LocalId", - table: "Buildings", - type: "nvarchar(50)", - maxLength: 50, - nullable: true); - - migrationBuilder.AddColumn( - name: "Longitude", - table: "Buildings", - type: "float", - nullable: true, - defaultValue: 0.0); - - ScriptDeploy(migrationBuilder, System.IO.Path.Combine(this.DefaultMigrationsPath, this.Version, System.IO.Path.Combine("Down", "Properties"))); - - migrationBuilder.DropColumn( - name: "Location", - table: "Parcels"); - - migrationBuilder.DropColumn( - name: "Location", - table: "Buildings"); - - migrationBuilder.AddColumn( - name: "ParcelId", - table: "Buildings", - type: "int", - nullable: true, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "CityId", - table: "Addresses", - type: "int", - nullable: true, - defaultValue: 0); - - migrationBuilder.CreateTable( - name: "Cities", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Code = table.Column(type: "nvarchar(4)", maxLength: 4, nullable: false), - CreatedById = table.Column(type: "uniqueidentifier", nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - IsDisabled = table.Column(type: "bit", nullable: false, defaultValue: false), - Name = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), - RowVersion = table.Column(type: "rowversion", rowVersion: true, nullable: true), - SortOrder = table.Column(type: "int", nullable: false, defaultValue: 0), - UpdatedById = table.Column(type: "uniqueidentifier", nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Cities", x => x.Id); - table.ForeignKey( - name: "FK_Cities_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Cities_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateIndex( - name: "IX_Parcels_Id_IsSensitive_AgencyId_ClassificationId_PID_PIN_AddressId_ProjectNumber_LandArea_Municipality_Zoning_ZoningPotential", - table: "Parcels", - columns: new[] { "Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumber", "LandArea", "Municipality", "Zoning", "ZoningPotential" }); - - migrationBuilder.CreateIndex( - name: "IX_Parcels_Id_Latitude_Longitude_IsSensitive_AgencyId_ClassificationId_PID_PIN_AddressId_ProjectNumber_LandArea_Municipality_Zo~", - table: "Parcels", - columns: new[] { "Id", "Latitude", "Longitude", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumber", "LandArea", "Municipality", "Zoning", "ZoningPotential" }); - - migrationBuilder.CreateIndex( - name: "IX_Buildings_ParcelId", - table: "Buildings", - column: "ParcelId"); - - migrationBuilder.CreateIndex( - name: "IX_Buildings_Id_IsSensitive_AgencyId_ParcelId_ClassificationId_AddressId_ProjectNumber_BuildingPredominateUseId_BuildingConstru~", - table: "Buildings", - columns: new[] { "Id", "IsSensitive", "AgencyId", "ParcelId", "ClassificationId", "AddressId", "ProjectNumber", "BuildingPredominateUseId", "BuildingConstructionTypeId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy" }); - - migrationBuilder.CreateIndex( - name: "IX_Buildings_Id_Latitude_Longitude_IsSensitive_AgencyId_ParcelId_ClassificationId_AddressId_ProjectNumber_BuildingConstructionT~", - table: "Buildings", - columns: new[] { "Id", "Latitude", "Longitude", "IsSensitive", "AgencyId", "ParcelId", "ClassificationId", "AddressId", "ProjectNumber", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy" }); - - migrationBuilder.CreateIndex( - name: "IX_Addresses_CityId_ProvinceId", - table: "Addresses", - columns: new[] { "CityId", "ProvinceId" }) - .Annotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - migrationBuilder.CreateIndex( - name: "IX_Addresses_Id_CityId", - table: "Addresses", - columns: new[] { "Id", "CityId" }) - .Annotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - migrationBuilder.CreateIndex( - name: "IX_Addresses_Id_ProvinceId_CityId_Postal_Address1", - table: "Addresses", - columns: new[] { "Id", "ProvinceId", "CityId", "Postal", "Address1" }) - .Annotation("SqlServer:Include", new[] { "Address2" }); - - migrationBuilder.CreateIndex( - name: "IX_Cities_Code", - table: "Cities", - column: "Code", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Cities_CreatedById", - table: "Cities", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Cities_UpdatedById", - table: "Cities", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Cities_Id_IsDisabled_Name_SortOrder", - table: "Cities", - columns: new[] { "Id", "IsDisabled", "Name", "SortOrder" }); - - migrationBuilder.AddForeignKey( - name: "FK_Addresses_Cities_CityId", - table: "Addresses", - column: "CityId", - principalTable: "Cities", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_Buildings_Parcels_ParcelId", - table: "Buildings", - column: "ParcelId", - principalTable: "Parcels", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20201119051823_v01.03.00.Designer.cs b/backend/dal/Migrations/20201119051823_v01.03.00.Designer.cs deleted file mode 100644 index 6c83589e5b..0000000000 --- a/backend/dal/Migrations/20201119051823_v01.03.00.Designer.cs +++ /dev/null @@ -1,3430 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20201119051823_v01.03.00")] - partial class v010300 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumber") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumber", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumber") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumber", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("datetime2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("ProjectStatusId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId1") - .HasColumnType("int"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectStatusId"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId1"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId"); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", null) - .WithMany("FromWorkflows") - .HasForeignKey("ProjectStatusId"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Workflow", null) - .WithMany("FromStatus") - .HasForeignKey("WorkflowId1"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20201119051823_v01.03.00.cs b/backend/dal/Migrations/20201119051823_v01.03.00.cs deleted file mode 100644 index b4bf58c7ed..0000000000 --- a/backend/dal/Migrations/20201119051823_v01.03.00.cs +++ /dev/null @@ -1,298 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v010300 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - migrationBuilder.DropForeignKey( - name: "FK_Projects_Agencies_AgencyId1", - table: "Projects"); - - migrationBuilder.DropIndex( - name: "IX_Projects_AgencyId1", - table: "Projects"); - - migrationBuilder.DropIndex( - name: "IX_Projects_Assessed_NetBook_Estimated_ReportedFiscalYear_ActualFiscalYear_ExemptionRequested", - table: "Projects"); - - migrationBuilder.DropColumn( - name: "BaselineIntegrity", - table: "ProjectSnapshots"); - - migrationBuilder.DropColumn( - name: "GainLoss", - table: "ProjectSnapshots"); - - migrationBuilder.DropColumn( - name: "InterestComponent", - table: "ProjectSnapshots"); - - migrationBuilder.DropColumn( - name: "NetProceeds", - table: "ProjectSnapshots"); - - migrationBuilder.DropColumn( - name: "OcgFinancialStatement", - table: "ProjectSnapshots"); - - migrationBuilder.DropColumn( - name: "ProgramCost", - table: "ProjectSnapshots"); - - migrationBuilder.DropColumn( - name: "SaleWithLeaseInPlace", - table: "ProjectSnapshots"); - - migrationBuilder.DropColumn( - name: "SalesCost", - table: "ProjectSnapshots"); - - migrationBuilder.DropColumn( - name: "AgencyId1", - table: "Projects"); - - migrationBuilder.DropColumn( - name: "AppraisedNote", - table: "Projects"); - - migrationBuilder.DropColumn( - name: "ExemptionRationale", - table: "Projects"); - - migrationBuilder.DropColumn( - name: "ExemptionRequested", - table: "Projects"); - - migrationBuilder.DropColumn( - name: "Note", - table: "Projects"); - - migrationBuilder.DropColumn( - name: "OffersNote", - table: "Projects"); - - migrationBuilder.DropColumn( - name: "PrivateNote", - table: "Projects"); - - migrationBuilder.DropColumn( - name: "PublicNote", - table: "Projects"); - - migrationBuilder.RenameColumn( - name: "Estimated", - table: "ProjectSnapshots", - newName: "Market"); - - migrationBuilder.RenameColumn( - name: "Estimated", - table: "Projects", - newName: "Market"); - - migrationBuilder.AlterColumn( - name: "Appraised", - table: "ProjectSnapshots", - type: "MONEY", - nullable: true, - oldClrType: typeof(decimal), - oldType: "MONEY"); - - migrationBuilder.AddColumn( - name: "Metadata", - table: "ProjectSnapshots", - type: "NVARCHAR(MAX)", - nullable: true); - - migrationBuilder.AlterColumn( - name: "Appraised", - table: "Projects", - type: "MONEY", - nullable: true, - oldClrType: typeof(decimal), - oldType: "MONEY"); - - migrationBuilder.AddColumn( - name: "ProjectType", - table: "Projects", - nullable: false, - defaultValue: 0); - - migrationBuilder.CreateIndex( - name: "IX_Projects_Assessed_NetBook_Market_ReportedFiscalYear_ActualFiscalYear", - table: "Projects", - columns: new[] { "Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear" }); - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - migrationBuilder.DropIndex( - name: "IX_Projects_Assessed_NetBook_Market_ReportedFiscalYear_ActualFiscalYear", - table: "Projects"); - - migrationBuilder.DropColumn( - name: "Metadata", - table: "ProjectSnapshots"); - - migrationBuilder.DropColumn( - name: "ProjectType", - table: "Projects"); - - migrationBuilder.RenameColumn( - name: "Market", - table: "ProjectSnapshots", - newName: "Estimated"); - - migrationBuilder.RenameColumn( - name: "Market", - table: "Projects", - newName: "Estimated"); - - migrationBuilder.AlterColumn( - name: "Appraised", - table: "ProjectSnapshots", - type: "MONEY", - nullable: false, - oldClrType: typeof(decimal), - oldType: "MONEY", - oldNullable: true); - - migrationBuilder.AddColumn( - name: "BaselineIntegrity", - table: "ProjectSnapshots", - type: "MONEY", - nullable: true); - - migrationBuilder.AddColumn( - name: "GainLoss", - table: "ProjectSnapshots", - type: "MONEY", - nullable: true); - - migrationBuilder.AddColumn( - name: "InterestComponent", - table: "ProjectSnapshots", - type: "MONEY", - nullable: true); - - migrationBuilder.AddColumn( - name: "NetProceeds", - table: "ProjectSnapshots", - type: "MONEY", - nullable: true); - - migrationBuilder.AddColumn( - name: "OcgFinancialStatement", - table: "ProjectSnapshots", - type: "MONEY", - nullable: true); - - migrationBuilder.AddColumn( - name: "ProgramCost", - table: "ProjectSnapshots", - type: "MONEY", - nullable: true); - - migrationBuilder.AddColumn( - name: "SaleWithLeaseInPlace", - table: "ProjectSnapshots", - type: "bit", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "SalesCost", - table: "ProjectSnapshots", - type: "MONEY", - nullable: true); - - migrationBuilder.AlterColumn( - name: "Appraised", - table: "Projects", - type: "MONEY", - nullable: false, - oldClrType: typeof(decimal), - oldType: "MONEY", - oldNullable: true); - - migrationBuilder.AddColumn( - name: "AgencyId1", - table: "Projects", - type: "int", - nullable: true); - - migrationBuilder.AddColumn( - name: "AppraisedNote", - table: "Projects", - type: "NVARCHAR(MAX)", - nullable: true); - - migrationBuilder.AddColumn( - name: "ExemptionRationale", - table: "Projects", - type: "nvarchar(2000)", - maxLength: 2000, - nullable: true); - - migrationBuilder.AddColumn( - name: "ExemptionRequested", - table: "Projects", - type: "bit", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "Note", - table: "Projects", - type: "nvarchar(2000)", - maxLength: 2000, - nullable: true); - - migrationBuilder.AddColumn( - name: "OffersNote", - table: "Projects", - type: "nvarchar(2000)", - maxLength: 2000, - nullable: true); - - migrationBuilder.AddColumn( - name: "PrivateNote", - table: "Projects", - type: "nvarchar(2000)", - maxLength: 2000, - nullable: true); - - migrationBuilder.AddColumn( - name: "PublicNote", - table: "Projects", - type: "nvarchar(2000)", - maxLength: 2000, - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_Projects_AgencyId1", - table: "Projects", - column: "AgencyId1"); - - migrationBuilder.CreateIndex( - name: "IX_Projects_Assessed_NetBook_Estimated_ReportedFiscalYear_ActualFiscalYear_ExemptionRequested", - table: "Projects", - columns: new[] { "Assessed", "NetBook", "Estimated", "ReportedFiscalYear", "ActualFiscalYear", "ExemptionRequested" }); - - migrationBuilder.AddForeignKey( - name: "FK_Projects_Agencies_AgencyId1", - table: "Projects", - column: "AgencyId1", - principalTable: "Agencies", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20201126214802_v01.04.00.Designer.cs b/backend/dal/Migrations/20201126214802_v01.04.00.Designer.cs deleted file mode 100644 index 7d0b9152bd..0000000000 --- a/backend/dal/Migrations/20201126214802_v01.04.00.Designer.cs +++ /dev/null @@ -1,3412 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20201126214802_v01.04.00")] - partial class v010400 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumber") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumber", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumber") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumber", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("datetime2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId"); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} \ No newline at end of file diff --git a/backend/dal/Migrations/20201126214802_v01.04.00.cs b/backend/dal/Migrations/20201126214802_v01.04.00.cs deleted file mode 100644 index 52d3efd94f..0000000000 --- a/backend/dal/Migrations/20201126214802_v01.04.00.cs +++ /dev/null @@ -1,94 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v010400 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - migrationBuilder.DropForeignKey( - name: "FK_WorkflowProjectStatus_ProjectStatus_ProjectStatusId", - table: "WorkflowProjectStatus"); - - migrationBuilder.DropForeignKey( - name: "FK_WorkflowProjectStatus_Workflows_WorkflowId1", - table: "WorkflowProjectStatus"); - - migrationBuilder.DropIndex( - name: "IX_WorkflowProjectStatus_ProjectStatusId", - table: "WorkflowProjectStatus"); - - migrationBuilder.DropIndex( - name: "IX_WorkflowProjectStatus_WorkflowId1", - table: "WorkflowProjectStatus"); - - migrationBuilder.DropColumn( - name: "ProjectStatusId", - table: "WorkflowProjectStatus"); - - migrationBuilder.DropColumn( - name: "WorkflowId1", - table: "WorkflowProjectStatus"); - - migrationBuilder.RenameColumn( - name: "ReportTypeId", - table: "ProjectReports", - newName: "ReportType"); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - migrationBuilder.AddColumn( - name: "ProjectStatusId", - table: "WorkflowProjectStatus", - type: "int", - nullable: true); - - migrationBuilder.AddColumn( - name: "WorkflowId1", - table: "WorkflowProjectStatus", - type: "int", - nullable: true); - - migrationBuilder.RenameColumn( - name: "ReportType", - table: "ProjectReports", - newName: "ReportTypeId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowProjectStatus_ProjectStatusId", - table: "WorkflowProjectStatus", - column: "ProjectStatusId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkflowProjectStatus_WorkflowId1", - table: "WorkflowProjectStatus", - column: "WorkflowId1"); - - migrationBuilder.AddForeignKey( - name: "FK_WorkflowProjectStatus_ProjectStatus_ProjectStatusId", - table: "WorkflowProjectStatus", - column: "ProjectStatusId", - principalTable: "ProjectStatus", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_WorkflowProjectStatus_Workflows_WorkflowId1", - table: "WorkflowProjectStatus", - column: "WorkflowId1", - principalTable: "Workflows", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - PostDown(migrationBuilder); - } - } -} \ No newline at end of file diff --git a/backend/dal/Migrations/20201210213149_v01.05.00.Designer.cs b/backend/dal/Migrations/20201210213149_v01.05.00.Designer.cs deleted file mode 100644 index d367f54f53..0000000000 --- a/backend/dal/Migrations/20201210213149_v01.05.00.Designer.cs +++ /dev/null @@ -1,3412 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20201210213149_v01.05.00")] - partial class v010500 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumber") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumber", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumber") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumber", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("datetime2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId"); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20201210213149_v01.05.00.cs b/backend/dal/Migrations/20201210213149_v01.05.00.cs deleted file mode 100644 index 7224968b58..0000000000 --- a/backend/dal/Migrations/20201210213149_v01.05.00.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v010500 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20210107210217_v01.05.05.Designer.cs b/backend/dal/Migrations/20210107210217_v01.05.05.Designer.cs deleted file mode 100644 index 9377f525b8..0000000000 --- a/backend/dal/Migrations/20210107210217_v01.05.05.Designer.cs +++ /dev/null @@ -1,3412 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20210107210217_v01.05.05")] - partial class v010505 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumber") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumber", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumber") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumber", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("datetime2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId"); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20210107210217_v01.05.05.cs b/backend/dal/Migrations/20210107210217_v01.05.05.cs deleted file mode 100644 index b669e4004b..0000000000 --- a/backend/dal/Migrations/20210107210217_v01.05.05.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v010505 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20210114181825_v01.06.00.Designer.cs b/backend/dal/Migrations/20210114181825_v01.06.00.Designer.cs deleted file mode 100644 index 599a1be123..0000000000 --- a/backend/dal/Migrations/20210114181825_v01.06.00.Designer.cs +++ /dev/null @@ -1,3435 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20210114181825_v01.06.00")] - partial class v010600 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("datetime2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId"); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20210114181825_v01.06.00.cs b/backend/dal/Migrations/20210114181825_v01.06.00.cs deleted file mode 100644 index 961fe99583..0000000000 --- a/backend/dal/Migrations/20210114181825_v01.06.00.cs +++ /dev/null @@ -1,291 +0,0 @@ -using System; -using Pims.Dal.Helpers.Migrations; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v010600 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - migrationBuilder.AddColumn( - name: "EncumbranceReason", - table: "Parcels", - maxLength: 500, - nullable: true); - - migrationBuilder.AddColumn( - name: "EffectiveDate", - table: "ParcelFiscals", - type: "DATE", - nullable: true); - - migrationBuilder.AddColumn( - name: "BuildingTenancyUpdatedOn", - table: "Buildings", - type: "DATETIME2", - nullable: true); - - migrationBuilder.AddColumn( - name: "EncumbranceReason", - table: "Buildings", - maxLength: 500, - nullable: true); - - migrationBuilder.AddColumn( - name: "LeasedLandMetadata", - table: "Buildings", - type: "NVARCHAR(MAX)", - nullable: true); - - migrationBuilder.AddColumn( - name: "TotalArea", - table: "Buildings", - nullable: false, - defaultValue: 0f); - - migrationBuilder.AddColumn( - name: "EffectiveDate", - table: "BuildingFiscals", - type: "DATE", - nullable: true); - - migrationBuilder.DropIndex( - name: "IX_Parcels_Id_IsSensitive_AgencyId_ClassificationId_PID_PIN_AddressId_ProjectNumber_LandArea_Zoning_ZoningPotential", - table: "Parcels"); - - migrationBuilder.DropIndex( - name: "IX_Buildings_Id_IsSensitive_AgencyId_ClassificationId_AddressId_ProjectNumber_BuildingConstructionTypeId_BuildingPredominateUse~", - table: "Buildings"); - - migrationBuilder.DropIndex( - name: "IX_Buildings_Id_IsSensitive_AgencyId_ClassificationId_AddressId_ProjectNumber_BuildingPredominateUseId_BuildingConstructionType~", - table: "Buildings"); - - migrationBuilder.DropColumn( - name: "ProjectNumber", - table: "Parcels"); - - migrationBuilder.DropColumn( - name: "ProjectNumber", - table: "Buildings"); - - migrationBuilder.AddColumn( - name: "ProjectNumbers", - table: "Parcels", - maxLength: 2000, - nullable: true); - - migrationBuilder.AddColumn( - name: "ProjectNumbers", - table: "Buildings", - maxLength: 2000, - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_Parcels_Id_IsSensitive_AgencyId_ClassificationId_PID_PIN_AddressId_LandArea_Zoning_ZoningPotential", - table: "Parcels", - columns: new[] { "Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "LandArea", "Zoning", "ZoningPotential" }); - - migrationBuilder.CreateIndex( - name: "IX_Buildings_Id_IsSensitive_AgencyId_ClassificationId_AddressId_ProjectNumber_BuildingConstructionTypeId_BuildingPredominateUse~", - table: "Buildings", - columns: new[] { "Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy" }); - - migrationBuilder.CreateIndex( - name: "IX_Buildings_Id_IsSensitive_AgencyId_ClassificationId_AddressId_ProjectNumber_BuildingPredominateUseId_BuildingConstructionType~", - table: "Buildings", - columns: new[] { "Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingPredominateUseId", "BuildingConstructionTypeId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy" }); - - migrationBuilder.AlterColumn( - name: "NetBook", - table: "ProjectSnapshots", - type: "MONEY", - nullable: true, - oldClrType: typeof(decimal), - oldType: "MONEY"); - - migrationBuilder.AlterColumn( - name: "Market", - table: "ProjectSnapshots", - type: "MONEY", - nullable: true, - oldClrType: typeof(decimal), - oldType: "MONEY"); - - migrationBuilder.AlterColumn( - name: "Assessed", - table: "ProjectSnapshots", - type: "MONEY", - nullable: true, - oldClrType: typeof(decimal), - oldType: "MONEY"); - - migrationBuilder.AlterColumn( - name: "NetBook", - table: "Projects", - type: "MONEY", - nullable: true, - oldClrType: typeof(decimal), - oldType: "MONEY"); - - migrationBuilder.AlterColumn( - name: "Market", - table: "Projects", - type: "MONEY", - nullable: true, - oldClrType: typeof(decimal), - oldType: "MONEY"); - - migrationBuilder.AlterColumn( - name: "Assessed", - table: "Projects", - type: "MONEY", - nullable: true, - oldClrType: typeof(decimal), - oldType: "MONEY"); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - migrationBuilder.DropIndex( - name: "IX_Parcels_Id_IsSensitive_AgencyId_ClassificationId_PID_PIN_AddressId_LandArea_Zoning_ZoningPotential", - table: "Parcels"); - - migrationBuilder.DropIndex( - name: "IX_Buildings_Id_IsSensitive_AgencyId_ClassificationId_AddressId_ProjectNumber_BuildingConstructionTypeId_BuildingPredominateUse~", - table: "Buildings"); - - migrationBuilder.DropIndex( - name: "IX_Buildings_Id_IsSensitive_AgencyId_ClassificationId_AddressId_ProjectNumber_BuildingPredominateUseId_BuildingConstructionType~", - table: "Buildings"); - - migrationBuilder.DropColumn( - name: "ProjectNumbers", - table: "Parcels"); - - migrationBuilder.DropColumn( - name: "ProjectNumbers", - table: "Buildings"); - - migrationBuilder.AddColumn( - name: "ProjectNumber", - table: "Parcels", - type: "nvarchar(50)", - maxLength: 50, - nullable: true); - - migrationBuilder.AddColumn( - name: "ProjectNumber", - table: "Buildings", - type: "nvarchar(50)", - maxLength: 50, - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_Parcels_Id_IsSensitive_AgencyId_ClassificationId_PID_PIN_AddressId_ProjectNumber_LandArea_Zoning_ZoningPotential", - table: "Parcels", - columns: new[] { "Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumber", "LandArea", "Zoning", "ZoningPotential" }); - - migrationBuilder.CreateIndex( - name: "IX_Buildings_Id_IsSensitive_AgencyId_ClassificationId_AddressId_ProjectNumber_BuildingConstructionTypeId_BuildingPredominateUse~", - table: "Buildings", - columns: new[] { "Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumber", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy" }); - - migrationBuilder.CreateIndex( - name: "IX_Buildings_Id_IsSensitive_AgencyId_ClassificationId_AddressId_ProjectNumber_BuildingPredominateUseId_BuildingConstructionType~", - table: "Buildings", - columns: new[] { "Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumber", "BuildingPredominateUseId", "BuildingConstructionTypeId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy" }); - - migrationBuilder.DropColumn( - name: "EncumbranceReason", - table: "Parcels"); - - migrationBuilder.DropColumn( - name: "EffectiveDate", - table: "ParcelFiscals"); - - migrationBuilder.DropColumn( - name: "BuildingTenancyUpdatedOn", - table: "Buildings"); - - migrationBuilder.DropColumn( - name: "EncumbranceReason", - table: "Buildings"); - - migrationBuilder.DropColumn( - name: "LeasedLandMetadata", - table: "Buildings"); - - migrationBuilder.DropColumn( - name: "TotalArea", - table: "Buildings"); - - migrationBuilder.DropColumn( - name: "EffectiveDate", - table: "BuildingFiscals"); - - migrationBuilder.AlterColumn( - name: "NetBook", - table: "ProjectSnapshots", - type: "MONEY", - nullable: false, - oldClrType: typeof(decimal), - oldType: "MONEY", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Market", - table: "ProjectSnapshots", - type: "MONEY", - nullable: false, - oldClrType: typeof(decimal), - oldType: "MONEY", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Assessed", - table: "ProjectSnapshots", - type: "MONEY", - nullable: false, - oldClrType: typeof(decimal), - oldType: "MONEY", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "NetBook", - table: "Projects", - type: "MONEY", - nullable: false, - oldClrType: typeof(decimal), - oldType: "MONEY", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Market", - table: "Projects", - type: "MONEY", - nullable: false, - oldClrType: typeof(decimal), - oldType: "MONEY", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Assessed", - table: "Projects", - type: "MONEY", - nullable: false, - oldClrType: typeof(decimal), - oldType: "MONEY", - oldNullable: true); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20210128205552_v01.07.00.Designer.cs b/backend/dal/Migrations/20210128205552_v01.07.00.Designer.cs deleted file mode 100644 index 2bedb587be..0000000000 --- a/backend/dal/Migrations/20210128205552_v01.07.00.Designer.cs +++ /dev/null @@ -1,3519 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20210128205552_v01.07.00")] - partial class v010700 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("datetime2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId"); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20210128205552_v01.07.00.cs b/backend/dal/Migrations/20210128205552_v01.07.00.cs deleted file mode 100644 index 3655ff7cd1..0000000000 --- a/backend/dal/Migrations/20210128205552_v01.07.00.cs +++ /dev/null @@ -1,138 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; -using System; - -namespace Pims.Dal.Migrations -{ - public partial class v010700 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - migrationBuilder.AddColumn( - name: "PropertyTypeId", - table: "Parcels", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "PropertyTypeId", - table: "Buildings", - nullable: false, - defaultValue: 1); - - migrationBuilder.CreateTable( - name: "ParcelParcels", - columns: table => new - { - ParcelId = table.Column(nullable: false), - SubdivisionId = table.Column(nullable: false), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ParcelParcels", x => new { x.ParcelId, x.SubdivisionId }); - table.ForeignKey( - name: "FK_ParcelParcels_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ParcelParcels_Parcels_ParcelId", - column: x => x.ParcelId, - principalTable: "Parcels", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ParcelParcels_Parcels_SubdivisionId", - column: x => x.SubdivisionId, - principalTable: "Parcels", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ParcelParcels_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateIndex( - name: "IX_Parcels_PropertyTypeId", - table: "Parcels", - column: "PropertyTypeId"); - - migrationBuilder.CreateIndex( - name: "IX_Buildings_PropertyTypeId", - table: "Buildings", - column: "PropertyTypeId"); - - migrationBuilder.CreateIndex( - name: "IX_ParcelParcels_CreatedById", - table: "ParcelParcels", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ParcelParcels_SubdivisionId", - table: "ParcelParcels", - column: "SubdivisionId"); - - migrationBuilder.CreateIndex( - name: "IX_ParcelParcels_UpdatedById", - table: "ParcelParcels", - column: "UpdatedById"); - - migrationBuilder.AddForeignKey( - name: "FK_Buildings_PropertyTypes_PropertyTypeId", - table: "Buildings", - column: "PropertyTypeId", - principalTable: "PropertyTypes", - principalColumn: "Id"); - - migrationBuilder.AddForeignKey( - name: "FK_Parcels_PropertyTypes_PropertyTypeId", - table: "Parcels", - column: "PropertyTypeId", - principalTable: "PropertyTypes", - principalColumn: "Id"); - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - migrationBuilder.DropForeignKey( - name: "FK_Buildings_PropertyTypes_PropertyTypeId", - table: "Buildings"); - - migrationBuilder.DropForeignKey( - name: "FK_Parcels_PropertyTypes_PropertyTypeId", - table: "Parcels"); - - migrationBuilder.DropTable( - name: "ParcelParcels"); - - migrationBuilder.DropIndex( - name: "IX_Parcels_PropertyTypeId", - table: "Parcels"); - - migrationBuilder.DropIndex( - name: "IX_Buildings_PropertyTypeId", - table: "Buildings"); - - migrationBuilder.DropColumn( - name: "PropertyTypeId", - table: "Parcels"); - - migrationBuilder.DropColumn( - name: "PropertyTypeId", - table: "Buildings"); - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20210217204245_v01.08.00.Designer.cs b/backend/dal/Migrations/20210217204245_v01.08.00.Designer.cs deleted file mode 100644 index ca8e538706..0000000000 --- a/backend/dal/Migrations/20210217204245_v01.08.00.Designer.cs +++ /dev/null @@ -1,3532 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20210217204245_v01.08.00")] - partial class v010800 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20210217204245_v01.08.00.cs b/backend/dal/Migrations/20210217204245_v01.08.00.cs deleted file mode 100644 index a13460c51b..0000000000 --- a/backend/dal/Migrations/20210217204245_v01.08.00.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v010800 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - migrationBuilder.AlterColumn( - name: "LastLogin", - table: "Users", - type: "DATETIME2", - nullable: true, - oldClrType: typeof(DateTime), - oldType: "datetime2", - oldNullable: true); - - migrationBuilder.AddColumn( - name: "ApprovedById", - table: "Users", - nullable: true); - - migrationBuilder.AddColumn( - name: "ApprovedOn", - table: "Users", - type: "DATETIME2", - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_Users_ApprovedById", - table: "Users", - column: "ApprovedById"); - - migrationBuilder.AddForeignKey( - name: "FK_Users_Users_ApprovedById", - table: "Users", - column: "ApprovedById", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - migrationBuilder.DropForeignKey( - name: "FK_Users_Users_ApprovedById", - table: "Users"); - - migrationBuilder.DropIndex( - name: "IX_Users_ApprovedById", - table: "Users"); - - migrationBuilder.DropColumn( - name: "ApprovedById", - table: "Users"); - - migrationBuilder.DropColumn( - name: "ApprovedOn", - table: "Users"); - - migrationBuilder.AlterColumn( - name: "LastLogin", - table: "Users", - type: "datetime2", - nullable: true, - oldClrType: typeof(DateTime), - oldType: "DATETIME2", - oldNullable: true); - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20210303154503_v01.08.01.Designer.cs b/backend/dal/Migrations/20210303154503_v01.08.01.Designer.cs deleted file mode 100644 index 5ed86096ca..0000000000 --- a/backend/dal/Migrations/20210303154503_v01.08.01.Designer.cs +++ /dev/null @@ -1,3532 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20210303154503_v01.08.01")] - partial class v010801 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20210303154503_v01.08.01.cs b/backend/dal/Migrations/20210303154503_v01.08.01.cs deleted file mode 100644 index 6e5f0b17c5..0000000000 --- a/backend/dal/Migrations/20210303154503_v01.08.01.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v010801 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20210308210949_v01.09.00.Designer.cs b/backend/dal/Migrations/20210308210949_v01.09.00.Designer.cs deleted file mode 100644 index f0edcb9b64..0000000000 --- a/backend/dal/Migrations/20210308210949_v01.09.00.Designer.cs +++ /dev/null @@ -1,3532 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20210308210949_v01.09.00")] - partial class v010900 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20210308210949_v01.09.00.cs b/backend/dal/Migrations/20210308210949_v01.09.00.cs deleted file mode 100644 index 47e5db4237..0000000000 --- a/backend/dal/Migrations/20210308210949_v01.09.00.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v010900 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20210319220555_v01.09.01.Designer.cs b/backend/dal/Migrations/20210319220555_v01.09.01.Designer.cs deleted file mode 100644 index 7342674a93..0000000000 --- a/backend/dal/Migrations/20210319220555_v01.09.01.Designer.cs +++ /dev/null @@ -1,3532 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20210319220555_v01.09.01")] - partial class v010901 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20210319220555_v01.09.01.cs b/backend/dal/Migrations/20210319220555_v01.09.01.cs deleted file mode 100644 index 292df16d79..0000000000 --- a/backend/dal/Migrations/20210319220555_v01.09.01.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v010901 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20210323132211_v01.09.02.Designer.cs b/backend/dal/Migrations/20210323132211_v01.09.02.Designer.cs deleted file mode 100644 index ded5f0f504..0000000000 --- a/backend/dal/Migrations/20210323132211_v01.09.02.Designer.cs +++ /dev/null @@ -1,3532 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20210323132211_v01.09.02")] - partial class v010902 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20210323132211_v01.09.02.cs b/backend/dal/Migrations/20210323132211_v01.09.02.cs deleted file mode 100644 index f46762b80e..0000000000 --- a/backend/dal/Migrations/20210323132211_v01.09.02.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v010902 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20210422222731_v01.10.01.Designer.cs b/backend/dal/Migrations/20210422222731_v01.10.01.Designer.cs deleted file mode 100644 index 3c5c792700..0000000000 --- a/backend/dal/Migrations/20210422222731_v01.10.01.Designer.cs +++ /dev/null @@ -1,3532 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20210422222731_v01.10.01")] - partial class v011001 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20210422222731_v01.10.01.cs b/backend/dal/Migrations/20210422222731_v01.10.01.cs deleted file mode 100644 index 143612a71b..0000000000 --- a/backend/dal/Migrations/20210422222731_v01.10.01.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v011001 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20210505204819_v01.10.02.Designer.cs b/backend/dal/Migrations/20210505204819_v01.10.02.Designer.cs deleted file mode 100644 index 4a5f165673..0000000000 --- a/backend/dal/Migrations/20210505204819_v01.10.02.Designer.cs +++ /dev/null @@ -1,3532 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20210505204819_v01.10.02")] - partial class v011002 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20210505204819_v01.10.02.cs b/backend/dal/Migrations/20210505204819_v01.10.02.cs deleted file mode 100644 index 6540385ccf..0000000000 --- a/backend/dal/Migrations/20210505204819_v01.10.02.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v011002 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20210531140549_v01.10.04.Designer.cs b/backend/dal/Migrations/20210531140549_v01.10.04.Designer.cs deleted file mode 100644 index c6a79cc15f..0000000000 --- a/backend/dal/Migrations/20210531140549_v01.10.04.Designer.cs +++ /dev/null @@ -1,3532 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20210531140549_v01.10.04")] - partial class v011004 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20210531140549_v01.10.04.cs b/backend/dal/Migrations/20210531140549_v01.10.04.cs deleted file mode 100644 index f7f35afcd1..0000000000 --- a/backend/dal/Migrations/20210531140549_v01.10.04.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v011004 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20210610153039_v01.10.05.Designer.cs b/backend/dal/Migrations/20210610153039_v01.10.05.Designer.cs deleted file mode 100644 index c9e0c2b1a0..0000000000 --- a/backend/dal/Migrations/20210610153039_v01.10.05.Designer.cs +++ /dev/null @@ -1,3532 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20210610153039_v01.10.05")] - partial class v011005 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20210610153039_v01.10.05.cs b/backend/dal/Migrations/20210610153039_v01.10.05.cs deleted file mode 100644 index 1bf4b3ec60..0000000000 --- a/backend/dal/Migrations/20210610153039_v01.10.05.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v011005 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20210616142943_v01.10.06.Designer.cs b/backend/dal/Migrations/20210616142943_v01.10.06.Designer.cs deleted file mode 100644 index 2344547712..0000000000 --- a/backend/dal/Migrations/20210616142943_v01.10.06.Designer.cs +++ /dev/null @@ -1,3532 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20210616142943_v01.10.06")] - partial class v011006 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20210616142943_v01.10.06.cs b/backend/dal/Migrations/20210616142943_v01.10.06.cs deleted file mode 100644 index 8e6e295851..0000000000 --- a/backend/dal/Migrations/20210616142943_v01.10.06.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v011006 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20210705144630_v01.11.00.Designer.cs b/backend/dal/Migrations/20210705144630_v01.11.00.Designer.cs deleted file mode 100644 index c7ba77ba74..0000000000 --- a/backend/dal/Migrations/20210705144630_v01.11.00.Designer.cs +++ /dev/null @@ -1,3532 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20210705144630_v01.11.00")] - partial class v011100 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20210705144630_v01.11.00.cs b/backend/dal/Migrations/20210705144630_v01.11.00.cs deleted file mode 100644 index 8ceaadcde6..0000000000 --- a/backend/dal/Migrations/20210705144630_v01.11.00.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v011100 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20210709230420_v01.11.01.Designer.cs b/backend/dal/Migrations/20210709230420_v01.11.01.Designer.cs deleted file mode 100644 index fd8c445e6f..0000000000 --- a/backend/dal/Migrations/20210709230420_v01.11.01.Designer.cs +++ /dev/null @@ -1,3532 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20210709230420_v01.11.01")] - partial class v011101 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20210709230420_v01.11.01.cs b/backend/dal/Migrations/20210709230420_v01.11.01.cs deleted file mode 100644 index 18e62450f0..0000000000 --- a/backend/dal/Migrations/20210709230420_v01.11.01.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v011101 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20210712190221_v01.11.02.Designer.cs b/backend/dal/Migrations/20210712190221_v01.11.02.Designer.cs deleted file mode 100644 index 17176a1dd5..0000000000 --- a/backend/dal/Migrations/20210712190221_v01.11.02.Designer.cs +++ /dev/null @@ -1,3532 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20210712190221_v01.11.02")] - partial class v011102 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20210712190221_v01.11.02.cs b/backend/dal/Migrations/20210712190221_v01.11.02.cs deleted file mode 100644 index a6878ddba7..0000000000 --- a/backend/dal/Migrations/20210712190221_v01.11.02.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v011102 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20210712220515_v01.11.03.Designer.cs b/backend/dal/Migrations/20210712220515_v01.11.03.Designer.cs deleted file mode 100644 index 86a8b773a0..0000000000 --- a/backend/dal/Migrations/20210712220515_v01.11.03.Designer.cs +++ /dev/null @@ -1,3532 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20210712220515_v01.11.03")] - partial class v011103 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20210712220515_v01.11.03.cs b/backend/dal/Migrations/20210712220515_v01.11.03.cs deleted file mode 100644 index 0e1b81b02a..0000000000 --- a/backend/dal/Migrations/20210712220515_v01.11.03.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v011103 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20210809174827_v01.12.00.Designer.cs b/backend/dal/Migrations/20210809174827_v01.12.00.Designer.cs deleted file mode 100644 index a5b47be05c..0000000000 --- a/backend/dal/Migrations/20210809174827_v01.12.00.Designer.cs +++ /dev/null @@ -1,3532 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20210809174827_v01.12.00")] - partial class v011200 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20210809174827_v01.12.00.cs b/backend/dal/Migrations/20210809174827_v01.12.00.cs deleted file mode 100644 index 6e7dec4d1e..0000000000 --- a/backend/dal/Migrations/20210809174827_v01.12.00.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v011200 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20210903194147_v01.12.01.Designer.cs b/backend/dal/Migrations/20210903194147_v01.12.01.Designer.cs deleted file mode 100644 index 5718cfade2..0000000000 --- a/backend/dal/Migrations/20210903194147_v01.12.01.Designer.cs +++ /dev/null @@ -1,3539 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20210903194147_v01.12.01")] - partial class v011201 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("KeycloakUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.HasIndex("KeycloakUserId", "Username", "Email") - .IsUnique() - .HasFilter("[KeycloakUserId] IS NOT NULL"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20210903194147_v01.12.01.cs b/backend/dal/Migrations/20210903194147_v01.12.01.cs deleted file mode 100644 index bc354d0c57..0000000000 --- a/backend/dal/Migrations/20210903194147_v01.12.01.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using Pims.Dal.Helpers.Migrations; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v011201 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - migrationBuilder.AddColumn( - name: "KeycloakUserId", - table: "Users", - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_Users_KeycloakUserId_Username_Email", - table: "Users", - columns: new[] { "KeycloakUserId", "Username", "Email" }, - unique: true, - filter: "[KeycloakUserId] IS NOT NULL"); - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - migrationBuilder.DropIndex( - name: "IX_Users_KeycloakUserId_Username_Email", - table: "Users"); - - migrationBuilder.DropColumn( - name: "KeycloakUserId", - table: "Users"); - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20210920230505_v01.12.02.Designer.cs b/backend/dal/Migrations/20210920230505_v01.12.02.Designer.cs deleted file mode 100644 index af4f8eead0..0000000000 --- a/backend/dal/Migrations/20210920230505_v01.12.02.Designer.cs +++ /dev/null @@ -1,3542 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20210920230505_v01.12.02")] - partial class v011202 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("KeycloakUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.HasIndex("KeycloakUserId", "Username", "Email") - .IsUnique() - .HasFilter("[KeycloakUserId] IS NOT NULL"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20210920230505_v01.12.02.cs b/backend/dal/Migrations/20210920230505_v01.12.02.cs deleted file mode 100644 index 36681f7322..0000000000 --- a/backend/dal/Migrations/20210920230505_v01.12.02.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v011202 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - migrationBuilder.CreateIndex( - name: "IX_AdministrativeAreas_Name", - table: "AdministrativeAreas", - column: "Name", - unique: true); - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - migrationBuilder.DropIndex( - name: "IX_AdministrativeAreas_Name", - table: "AdministrativeAreas"); - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20210923231113_v01.13.00.Designer.cs b/backend/dal/Migrations/20210923231113_v01.13.00.Designer.cs deleted file mode 100644 index 88f69dfecb..0000000000 --- a/backend/dal/Migrations/20210923231113_v01.13.00.Designer.cs +++ /dev/null @@ -1,3621 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20210923231113_v01.13.00")] - partial class v011300 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectId"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.ToTable("ProjectStatusHistory"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("KeycloakUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.HasIndex("KeycloakUserId", "Username", "Email") - .IsUnique() - .HasFilter("[KeycloakUserId] IS NOT NULL"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("StatusHistory") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany() - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20210923231113_v01.13.00.cs b/backend/dal/Migrations/20210923231113_v01.13.00.cs deleted file mode 100644 index 574f723732..0000000000 --- a/backend/dal/Migrations/20210923231113_v01.13.00.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System; -using Pims.Dal.Helpers.Migrations; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v011300 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - migrationBuilder.CreateTable( - name: "ProjectStatusHistory", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CreatedById = table.Column(nullable: true), - CreatedOn = table.Column(type: "DATETIME2", nullable: false, defaultValueSql: "GETUTCDATE()"), - UpdatedById = table.Column(nullable: true), - UpdatedOn = table.Column(type: "DATETIME2", nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - ProjectId = table.Column(nullable: false), - WorkflowId = table.Column(nullable: false), - StatusId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ProjectStatusHistory", x => x.Id); - table.ForeignKey( - name: "FK_ProjectStatusHistory_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ProjectStatusHistory_Projects_ProjectId", - column: x => x.ProjectId, - principalTable: "Projects", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_ProjectStatusHistory_ProjectStatus_StatusId", - column: x => x.StatusId, - principalTable: "ProjectStatus", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ProjectStatusHistory_Users_UpdatedById", - column: x => x.UpdatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ProjectStatusHistory_Workflows_WorkflowId", - column: x => x.WorkflowId, - principalTable: "Workflows", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateIndex( - name: "IX_ProjectStatusHistory_CreatedById", - table: "ProjectStatusHistory", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectStatusHistory_ProjectId", - table: "ProjectStatusHistory", - column: "ProjectId"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectStatusHistory_StatusId", - table: "ProjectStatusHistory", - column: "StatusId"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectStatusHistory_UpdatedById", - table: "ProjectStatusHistory", - column: "UpdatedById"); - - migrationBuilder.CreateIndex( - name: "IX_ProjectStatusHistory_WorkflowId", - table: "ProjectStatusHistory", - column: "WorkflowId"); - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - migrationBuilder.DropTable( - name: "ProjectStatusHistory"); - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20210929203118_v01.13.01.Designer.cs b/backend/dal/Migrations/20210929203118_v01.13.01.Designer.cs deleted file mode 100644 index d8aab57b35..0000000000 --- a/backend/dal/Migrations/20210929203118_v01.13.01.Designer.cs +++ /dev/null @@ -1,3621 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20210929203118_v01.13.01")] - partial class v011301 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectId"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.ToTable("ProjectStatusHistory"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("KeycloakUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.HasIndex("KeycloakUserId", "Username", "Email") - .IsUnique() - .HasFilter("[KeycloakUserId] IS NOT NULL"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("StatusHistory") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany() - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20210929203118_v01.13.01.cs b/backend/dal/Migrations/20210929203118_v01.13.01.cs deleted file mode 100644 index c591396399..0000000000 --- a/backend/dal/Migrations/20210929203118_v01.13.01.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v011301 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20211005225722_v01.14.00.Designer.cs b/backend/dal/Migrations/20211005225722_v01.14.00.Designer.cs deleted file mode 100644 index b78c5472de..0000000000 --- a/backend/dal/Migrations/20211005225722_v01.14.00.Designer.cs +++ /dev/null @@ -1,3621 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20211005225722_v01.14.00")] - partial class v011400 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Address2") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("ProvinceId") - .IsRequired() - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("BoundaryType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(6)") - .HasMaxLength(6); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("OccupantName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Bcc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Cc") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Encoding") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Priority") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Tag") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("To") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("EncumbranceReason") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Manager") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(10)") - .HasMaxLength(10); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("GroupName") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("Route") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectId"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.ToTable("ProjectStatusHistory"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasColumnType("nvarchar(2)") - .HasMaxLength(2); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("KeycloakUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("MiddleName") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Note") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Position") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasColumnType("nvarchar(25)") - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.HasIndex("KeycloakUserId", "Username", "Email") - .IsUnique() - .HasFilter("[KeycloakUserId] IS NOT NULL"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasColumnType("nvarchar(20)") - .HasMaxLength(20); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(500)") - .HasMaxLength(500); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("StatusHistory") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany() - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20211005225722_v01.14.00.cs b/backend/dal/Migrations/20211005225722_v01.14.00.cs deleted file mode 100644 index eb52e05b03..0000000000 --- a/backend/dal/Migrations/20211005225722_v01.14.00.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v011400 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20211103230229_v01.14.01.Designer.cs b/backend/dal/Migrations/20211103230229_v01.14.01.Designer.cs deleted file mode 100644 index cad24cf245..0000000000 --- a/backend/dal/Migrations/20211103230229_v01.14.01.Designer.cs +++ /dev/null @@ -1,4208 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20211103230229_v01.14.01")] - partial class v011401 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.6") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Address2") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("ProvinceId") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("BoundaryType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("OccupantName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ZoningPotential") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Manager") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("GroupName") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Route") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectId"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.ToTable("ProjectStatusHistory"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("KeycloakUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("MiddleName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Position") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.HasIndex("KeycloakUserId", "Username", "Email") - .IsUnique() - .HasFilter("[KeycloakUserId] IS NOT NULL"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Views.Property", b => - { - b.Property("Address") - .HasColumnType("nvarchar(max)"); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(max)"); - - b.Property("Agency") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("AssessedBuilding") - .HasColumnType("MONEY"); - - b.Property("AssessedBuildingDate") - .HasColumnType("datetime2"); - - b.Property("AssessedLand") - .HasColumnType("MONEY"); - - b.Property("AssessedLandDate") - .HasColumnType("datetime2"); - - b.Property("Boundary") - .HasColumnType("geography"); - - b.Property("BuildingConstructionType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUse") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .HasColumnType("nvarchar(max)"); - - b.Property("Classification") - .HasColumnType("nvarchar(max)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("Id") - .HasColumnType("int"); - - b.Property("IsSensitive") - .HasColumnType("bit"); - - b.Property("IsVisibleToOtherAgencies") - .HasColumnType("bit"); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(max)"); - - b.Property("LeaseExpiry") - .HasColumnType("datetime2"); - - b.Property("Location") - .HasColumnType("geography"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("MarketFiscalYear") - .HasColumnType("int"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("NetBookFiscalYear") - .HasColumnType("int"); - - b.Property("OccupantName") - .HasColumnType("nvarchar(max)"); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Postal") - .HasColumnType("nvarchar(max)"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(max)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("Province") - .HasColumnType("nvarchar(max)"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .HasColumnType("varbinary(max)"); - - b.Property("SubAgency") - .HasColumnType("nvarchar(max)"); - - b.Property("SubAgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("TransferLeaseOnSale") - .HasColumnType("bit"); - - b.Property("Zoning") - .HasColumnType("nvarchar(max)"); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(max)"); - - b.ToView("View_Properties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Province"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parent"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("BuildingConstructionType"); - - b.Navigation("BuildingOccupantType"); - - b.Navigation("BuildingPredominateUse"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Template"); - - b.Navigation("ToAgency"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Subdivision"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Risk"); - - b.Navigation("Status"); - - b.Navigation("TierLevel"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Notification"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("StatusHistory") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany() - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("FromStatus"); - - b.Navigation("Template"); - - b.Navigation("ToStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("FromWorkflowStatus"); - - b.Navigation("ToWorkflowStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Task"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Claim"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("ApprovedBy"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Navigation("Buildings"); - - b.Navigation("Children"); - - b.Navigation("Notifications"); - - b.Navigation("Parcels"); - - b.Navigation("ProjectResponses"); - - b.Navigation("Projects"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Navigation("Responses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Navigation("Notifications"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Navigation("Buildings"); - - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - - b.Navigation("Subdivisions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Navigation("Notes"); - - b.Navigation("Notifications"); - - b.Navigation("Properties"); - - b.Navigation("Responses"); - - b.Navigation("Snapshots"); - - b.Navigation("StatusHistory"); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Navigation("Projects"); - - b.Navigation("Tasks"); - - b.Navigation("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Navigation("Claims"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Navigation("Projects"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Navigation("FromStatus"); - - b.Navigation("ToStatus"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20211103230229_v01.14.01.cs b/backend/dal/Migrations/20211103230229_v01.14.01.cs deleted file mode 100644 index e0e4bb6d67..0000000000 --- a/backend/dal/Migrations/20211103230229_v01.14.01.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v011401 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20220209183559_v01.15.00.Designer.cs b/backend/dal/Migrations/20220209183559_v01.15.00.Designer.cs deleted file mode 100644 index 6c55edccd4..0000000000 --- a/backend/dal/Migrations/20220209183559_v01.15.00.Designer.cs +++ /dev/null @@ -1,4208 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20220209183559_v01.15.00")] - partial class v011500 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.6") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Address2") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("ProvinceId") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("BoundaryType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("OccupantName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ZoningPotential") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Manager") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("GroupName") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Route") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectId"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.ToTable("ProjectStatusHistory"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("KeycloakUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("MiddleName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Position") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.HasIndex("KeycloakUserId", "Username", "Email") - .IsUnique() - .HasFilter("[KeycloakUserId] IS NOT NULL"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Views.Property", b => - { - b.Property("Address") - .HasColumnType("nvarchar(max)"); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(max)"); - - b.Property("Agency") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("AssessedBuilding") - .HasColumnType("MONEY"); - - b.Property("AssessedBuildingDate") - .HasColumnType("datetime2"); - - b.Property("AssessedLand") - .HasColumnType("MONEY"); - - b.Property("AssessedLandDate") - .HasColumnType("datetime2"); - - b.Property("Boundary") - .HasColumnType("geography"); - - b.Property("BuildingConstructionType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUse") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .HasColumnType("nvarchar(max)"); - - b.Property("Classification") - .HasColumnType("nvarchar(max)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("Id") - .HasColumnType("int"); - - b.Property("IsSensitive") - .HasColumnType("bit"); - - b.Property("IsVisibleToOtherAgencies") - .HasColumnType("bit"); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(max)"); - - b.Property("LeaseExpiry") - .HasColumnType("datetime2"); - - b.Property("Location") - .HasColumnType("geography"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("MarketFiscalYear") - .HasColumnType("int"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("NetBookFiscalYear") - .HasColumnType("int"); - - b.Property("OccupantName") - .HasColumnType("nvarchar(max)"); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Postal") - .HasColumnType("nvarchar(max)"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(max)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("Province") - .HasColumnType("nvarchar(max)"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .HasColumnType("varbinary(max)"); - - b.Property("SubAgency") - .HasColumnType("nvarchar(max)"); - - b.Property("SubAgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("TransferLeaseOnSale") - .HasColumnType("bit"); - - b.Property("Zoning") - .HasColumnType("nvarchar(max)"); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(max)"); - - b.ToView("View_Properties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Province"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parent"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("BuildingConstructionType"); - - b.Navigation("BuildingOccupantType"); - - b.Navigation("BuildingPredominateUse"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Template"); - - b.Navigation("ToAgency"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Subdivision"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Risk"); - - b.Navigation("Status"); - - b.Navigation("TierLevel"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Notification"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("StatusHistory") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany() - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("FromStatus"); - - b.Navigation("Template"); - - b.Navigation("ToStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("FromWorkflowStatus"); - - b.Navigation("ToWorkflowStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Task"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Claim"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("ApprovedBy"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Navigation("Buildings"); - - b.Navigation("Children"); - - b.Navigation("Notifications"); - - b.Navigation("Parcels"); - - b.Navigation("ProjectResponses"); - - b.Navigation("Projects"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Navigation("Responses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Navigation("Notifications"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Navigation("Buildings"); - - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - - b.Navigation("Subdivisions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Navigation("Notes"); - - b.Navigation("Notifications"); - - b.Navigation("Properties"); - - b.Navigation("Responses"); - - b.Navigation("Snapshots"); - - b.Navigation("StatusHistory"); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Navigation("Projects"); - - b.Navigation("Tasks"); - - b.Navigation("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Navigation("Claims"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Navigation("Projects"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Navigation("FromStatus"); - - b.Navigation("ToStatus"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20220209183559_v01.15.00.cs b/backend/dal/Migrations/20220209183559_v01.15.00.cs deleted file mode 100644 index 372762cf40..0000000000 --- a/backend/dal/Migrations/20220209183559_v01.15.00.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v011500 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20220308190231_v01.16.00.Designer.cs b/backend/dal/Migrations/20220308190231_v01.16.00.Designer.cs deleted file mode 100644 index 6a799a5558..0000000000 --- a/backend/dal/Migrations/20220308190231_v01.16.00.Designer.cs +++ /dev/null @@ -1,4211 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20220308190231_v01.16.00")] - partial class v011600 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.6") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Address2") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("ProvinceId") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("BoundaryType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("OccupantName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ZoningPotential") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Manager") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("GroupName") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Route") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectId"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.ToTable("ProjectStatusHistory"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("KeycloakUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("MiddleName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Position") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.HasIndex("KeycloakUserId", "Username", "Email") - .IsUnique() - .HasFilter("[KeycloakUserId] IS NOT NULL"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Views.Property", b => - { - b.Property("Address") - .HasColumnType("nvarchar(max)"); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(max)"); - - b.Property("Agency") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("AssessedBuilding") - .HasColumnType("MONEY"); - - b.Property("AssessedBuildingDate") - .HasColumnType("datetime2"); - - b.Property("AssessedLand") - .HasColumnType("MONEY"); - - b.Property("AssessedLandDate") - .HasColumnType("datetime2"); - - b.Property("Boundary") - .HasColumnType("geography"); - - b.Property("BuildingConstructionType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUse") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .HasColumnType("nvarchar(max)"); - - b.Property("Classification") - .HasColumnType("nvarchar(max)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("Id") - .HasColumnType("int"); - - b.Property("IsSensitive") - .HasColumnType("bit"); - - b.Property("IsVisibleToOtherAgencies") - .HasColumnType("bit"); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(max)"); - - b.Property("LeaseExpiry") - .HasColumnType("datetime2"); - - b.Property("Location") - .HasColumnType("geography"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("MarketFiscalYear") - .HasColumnType("int"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("NetBookFiscalYear") - .HasColumnType("int"); - - b.Property("OccupantName") - .HasColumnType("nvarchar(max)"); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Postal") - .HasColumnType("nvarchar(max)"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(max)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("Province") - .HasColumnType("nvarchar(max)"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .HasColumnType("varbinary(max)"); - - b.Property("SubAgency") - .HasColumnType("nvarchar(max)"); - - b.Property("SubAgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("TransferLeaseOnSale") - .HasColumnType("bit"); - - b.Property("UpdatedOn") - .HasColumnType("datetime2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(max)"); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(max)"); - - b.ToView("View_Properties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Province"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parent"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("BuildingConstructionType"); - - b.Navigation("BuildingOccupantType"); - - b.Navigation("BuildingPredominateUse"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Template"); - - b.Navigation("ToAgency"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Subdivision"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Risk"); - - b.Navigation("Status"); - - b.Navigation("TierLevel"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Notification"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("StatusHistory") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany() - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("FromStatus"); - - b.Navigation("Template"); - - b.Navigation("ToStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("FromWorkflowStatus"); - - b.Navigation("ToWorkflowStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Task"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Claim"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("ApprovedBy"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Navigation("Buildings"); - - b.Navigation("Children"); - - b.Navigation("Notifications"); - - b.Navigation("Parcels"); - - b.Navigation("ProjectResponses"); - - b.Navigation("Projects"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Navigation("Responses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Navigation("Notifications"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Navigation("Buildings"); - - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - - b.Navigation("Subdivisions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Navigation("Notes"); - - b.Navigation("Notifications"); - - b.Navigation("Properties"); - - b.Navigation("Responses"); - - b.Navigation("Snapshots"); - - b.Navigation("StatusHistory"); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Navigation("Projects"); - - b.Navigation("Tasks"); - - b.Navigation("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Navigation("Claims"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Navigation("Projects"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Navigation("FromStatus"); - - b.Navigation("ToStatus"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20220308190231_v01.16.00.cs b/backend/dal/Migrations/20220308190231_v01.16.00.cs deleted file mode 100644 index 90a822666f..0000000000 --- a/backend/dal/Migrations/20220308190231_v01.16.00.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v011600 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20220316211239_v01.17.00.Designer.cs b/backend/dal/Migrations/20220316211239_v01.17.00.Designer.cs deleted file mode 100644 index c42de5ec9a..0000000000 --- a/backend/dal/Migrations/20220316211239_v01.17.00.Designer.cs +++ /dev/null @@ -1,4214 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20220316211239_v01.17.00")] - partial class v011700 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.6") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Address2") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("ProvinceId") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("BoundaryType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("OccupantName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ZoningPotential") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Manager") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("GroupName") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Route") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectId"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.ToTable("ProjectStatusHistory"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("KeycloakUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("MiddleName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Position") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.HasIndex("KeycloakUserId", "Username", "Email") - .IsUnique() - .HasFilter("[KeycloakUserId] IS NOT NULL"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Views.Property", b => - { - b.Property("Address") - .HasColumnType("nvarchar(max)"); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(max)"); - - b.Property("Agency") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("AssessedBuilding") - .HasColumnType("MONEY"); - - b.Property("AssessedBuildingDate") - .HasColumnType("datetime2"); - - b.Property("AssessedLand") - .HasColumnType("MONEY"); - - b.Property("AssessedLandDate") - .HasColumnType("datetime2"); - - b.Property("Boundary") - .HasColumnType("geography"); - - b.Property("BuildingConstructionType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUse") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .HasColumnType("nvarchar(max)"); - - b.Property("Classification") - .HasColumnType("nvarchar(max)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("DisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("Id") - .HasColumnType("int"); - - b.Property("IsSensitive") - .HasColumnType("bit"); - - b.Property("IsVisibleToOtherAgencies") - .HasColumnType("bit"); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(max)"); - - b.Property("LeaseExpiry") - .HasColumnType("datetime2"); - - b.Property("Location") - .HasColumnType("geography"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("MarketFiscalYear") - .HasColumnType("int"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("NetBookFiscalYear") - .HasColumnType("int"); - - b.Property("OccupantName") - .HasColumnType("nvarchar(max)"); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Postal") - .HasColumnType("nvarchar(max)"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(max)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("Province") - .HasColumnType("nvarchar(max)"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .HasColumnType("varbinary(max)"); - - b.Property("SubAgency") - .HasColumnType("nvarchar(max)"); - - b.Property("SubAgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("TransferLeaseOnSale") - .HasColumnType("bit"); - - b.Property("UpdatedOn") - .HasColumnType("datetime2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(max)"); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(max)"); - - b.ToView("View_Properties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Province"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parent"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("BuildingConstructionType"); - - b.Navigation("BuildingOccupantType"); - - b.Navigation("BuildingPredominateUse"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Template"); - - b.Navigation("ToAgency"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Subdivision"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Risk"); - - b.Navigation("Status"); - - b.Navigation("TierLevel"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Notification"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("StatusHistory") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany() - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("FromStatus"); - - b.Navigation("Template"); - - b.Navigation("ToStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("FromWorkflowStatus"); - - b.Navigation("ToWorkflowStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Task"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Claim"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("ApprovedBy"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Navigation("Buildings"); - - b.Navigation("Children"); - - b.Navigation("Notifications"); - - b.Navigation("Parcels"); - - b.Navigation("ProjectResponses"); - - b.Navigation("Projects"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Navigation("Responses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Navigation("Notifications"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Navigation("Buildings"); - - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - - b.Navigation("Subdivisions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Navigation("Notes"); - - b.Navigation("Notifications"); - - b.Navigation("Properties"); - - b.Navigation("Responses"); - - b.Navigation("Snapshots"); - - b.Navigation("StatusHistory"); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Navigation("Projects"); - - b.Navigation("Tasks"); - - b.Navigation("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Navigation("Claims"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Navigation("Projects"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Navigation("FromStatus"); - - b.Navigation("ToStatus"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20220316211239_v01.17.00.cs b/backend/dal/Migrations/20220316211239_v01.17.00.cs deleted file mode 100644 index 2a790ba79b..0000000000 --- a/backend/dal/Migrations/20220316211239_v01.17.00.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v011700 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20220404232725_v01.18.00.Designer.cs b/backend/dal/Migrations/20220404232725_v01.18.00.Designer.cs deleted file mode 100644 index a166ef0535..0000000000 --- a/backend/dal/Migrations/20220404232725_v01.18.00.Designer.cs +++ /dev/null @@ -1,4214 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20220404232725_v01.18.00")] - partial class v011800 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.6") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Address2") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("ProvinceId") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("BoundaryType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("OccupantName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ZoningPotential") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Manager") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("GroupName") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Route") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectId"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.ToTable("ProjectStatusHistory"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("KeycloakUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("MiddleName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Position") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.HasIndex("KeycloakUserId", "Username", "Email") - .IsUnique() - .HasFilter("[KeycloakUserId] IS NOT NULL"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Views.Property", b => - { - b.Property("Address") - .HasColumnType("nvarchar(max)"); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(max)"); - - b.Property("Agency") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("AssessedBuilding") - .HasColumnType("MONEY"); - - b.Property("AssessedBuildingDate") - .HasColumnType("datetime2"); - - b.Property("AssessedLand") - .HasColumnType("MONEY"); - - b.Property("AssessedLandDate") - .HasColumnType("datetime2"); - - b.Property("Boundary") - .HasColumnType("geography"); - - b.Property("BuildingConstructionType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUse") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .HasColumnType("nvarchar(max)"); - - b.Property("Classification") - .HasColumnType("nvarchar(max)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("DisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("Id") - .HasColumnType("int"); - - b.Property("IsSensitive") - .HasColumnType("bit"); - - b.Property("IsVisibleToOtherAgencies") - .HasColumnType("bit"); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(max)"); - - b.Property("LeaseExpiry") - .HasColumnType("datetime2"); - - b.Property("Location") - .HasColumnType("geography"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("MarketFiscalYear") - .HasColumnType("int"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("NetBookFiscalYear") - .HasColumnType("int"); - - b.Property("OccupantName") - .HasColumnType("nvarchar(max)"); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Postal") - .HasColumnType("nvarchar(max)"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(max)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("Province") - .HasColumnType("nvarchar(max)"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .HasColumnType("varbinary(max)"); - - b.Property("SubAgency") - .HasColumnType("nvarchar(max)"); - - b.Property("SubAgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("TransferLeaseOnSale") - .HasColumnType("bit"); - - b.Property("UpdatedOn") - .HasColumnType("datetime2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(max)"); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(max)"); - - b.ToView("View_Properties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Province"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parent"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("BuildingConstructionType"); - - b.Navigation("BuildingOccupantType"); - - b.Navigation("BuildingPredominateUse"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Template"); - - b.Navigation("ToAgency"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Subdivision"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Risk"); - - b.Navigation("Status"); - - b.Navigation("TierLevel"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Notification"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("StatusHistory") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany() - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("FromStatus"); - - b.Navigation("Template"); - - b.Navigation("ToStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("FromWorkflowStatus"); - - b.Navigation("ToWorkflowStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Task"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Claim"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("ApprovedBy"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Navigation("Buildings"); - - b.Navigation("Children"); - - b.Navigation("Notifications"); - - b.Navigation("Parcels"); - - b.Navigation("ProjectResponses"); - - b.Navigation("Projects"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Navigation("Responses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Navigation("Notifications"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Navigation("Buildings"); - - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - - b.Navigation("Subdivisions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Navigation("Notes"); - - b.Navigation("Notifications"); - - b.Navigation("Properties"); - - b.Navigation("Responses"); - - b.Navigation("Snapshots"); - - b.Navigation("StatusHistory"); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Navigation("Projects"); - - b.Navigation("Tasks"); - - b.Navigation("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Navigation("Claims"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Navigation("Projects"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Navigation("FromStatus"); - - b.Navigation("ToStatus"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20220404232725_v01.18.00.cs b/backend/dal/Migrations/20220404232725_v01.18.00.cs deleted file mode 100644 index a69507595a..0000000000 --- a/backend/dal/Migrations/20220404232725_v01.18.00.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v011800 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20220420193357_v01.18.01.Designer.cs b/backend/dal/Migrations/20220420193357_v01.18.01.Designer.cs deleted file mode 100644 index 27c5b1de5c..0000000000 --- a/backend/dal/Migrations/20220420193357_v01.18.01.Designer.cs +++ /dev/null @@ -1,4214 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20220420193357_v01.18.01")] - partial class v011801 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.6") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Address2") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("ProvinceId") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("BoundaryType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("OccupantName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ZoningPotential") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Manager") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("GroupName") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Route") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectId"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.ToTable("ProjectStatusHistory"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("KeycloakUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("MiddleName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Position") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.HasIndex("KeycloakUserId", "Username", "Email") - .IsUnique() - .HasFilter("[KeycloakUserId] IS NOT NULL"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Views.Property", b => - { - b.Property("Address") - .HasColumnType("nvarchar(max)"); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(max)"); - - b.Property("Agency") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("AssessedBuilding") - .HasColumnType("MONEY"); - - b.Property("AssessedBuildingDate") - .HasColumnType("datetime2"); - - b.Property("AssessedLand") - .HasColumnType("MONEY"); - - b.Property("AssessedLandDate") - .HasColumnType("datetime2"); - - b.Property("Boundary") - .HasColumnType("geography"); - - b.Property("BuildingConstructionType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUse") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .HasColumnType("nvarchar(max)"); - - b.Property("Classification") - .HasColumnType("nvarchar(max)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("DisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("Id") - .HasColumnType("int"); - - b.Property("IsSensitive") - .HasColumnType("bit"); - - b.Property("IsVisibleToOtherAgencies") - .HasColumnType("bit"); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(max)"); - - b.Property("LeaseExpiry") - .HasColumnType("datetime2"); - - b.Property("Location") - .HasColumnType("geography"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("MarketFiscalYear") - .HasColumnType("int"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("NetBookFiscalYear") - .HasColumnType("int"); - - b.Property("OccupantName") - .HasColumnType("nvarchar(max)"); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Postal") - .HasColumnType("nvarchar(max)"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(max)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("Province") - .HasColumnType("nvarchar(max)"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .HasColumnType("varbinary(max)"); - - b.Property("SubAgency") - .HasColumnType("nvarchar(max)"); - - b.Property("SubAgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("TransferLeaseOnSale") - .HasColumnType("bit"); - - b.Property("UpdatedOn") - .HasColumnType("datetime2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(max)"); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(max)"); - - b.ToView("View_Properties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Province"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parent"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("BuildingConstructionType"); - - b.Navigation("BuildingOccupantType"); - - b.Navigation("BuildingPredominateUse"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Template"); - - b.Navigation("ToAgency"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Subdivision"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Risk"); - - b.Navigation("Status"); - - b.Navigation("TierLevel"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Notification"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("StatusHistory") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany() - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("FromStatus"); - - b.Navigation("Template"); - - b.Navigation("ToStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("FromWorkflowStatus"); - - b.Navigation("ToWorkflowStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Task"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Claim"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("ApprovedBy"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Navigation("Buildings"); - - b.Navigation("Children"); - - b.Navigation("Notifications"); - - b.Navigation("Parcels"); - - b.Navigation("ProjectResponses"); - - b.Navigation("Projects"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Navigation("Responses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Navigation("Notifications"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Navigation("Buildings"); - - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - - b.Navigation("Subdivisions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Navigation("Notes"); - - b.Navigation("Notifications"); - - b.Navigation("Properties"); - - b.Navigation("Responses"); - - b.Navigation("Snapshots"); - - b.Navigation("StatusHistory"); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Navigation("Projects"); - - b.Navigation("Tasks"); - - b.Navigation("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Navigation("Claims"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Navigation("Projects"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Navigation("FromStatus"); - - b.Navigation("ToStatus"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20220420193357_v01.18.01.cs b/backend/dal/Migrations/20220420193357_v01.18.01.cs deleted file mode 100644 index c9d36be61a..0000000000 --- a/backend/dal/Migrations/20220420193357_v01.18.01.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v011801 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20220425181658_v01.18.02.Designer.cs b/backend/dal/Migrations/20220425181658_v01.18.02.Designer.cs deleted file mode 100644 index 5ccb02f974..0000000000 --- a/backend/dal/Migrations/20220425181658_v01.18.02.Designer.cs +++ /dev/null @@ -1,4214 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20220425181658_v01.18.02")] - partial class v011802 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.6") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Address2") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("ProvinceId") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("BoundaryType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("OccupantName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ZoningPotential") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Manager") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("GroupName") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Route") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectId"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.ToTable("ProjectStatusHistory"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("KeycloakUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("MiddleName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Position") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.HasIndex("KeycloakUserId", "Username", "Email") - .IsUnique() - .HasFilter("[KeycloakUserId] IS NOT NULL"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Views.Property", b => - { - b.Property("Address") - .HasColumnType("nvarchar(max)"); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(max)"); - - b.Property("Agency") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("AssessedBuilding") - .HasColumnType("MONEY"); - - b.Property("AssessedBuildingDate") - .HasColumnType("datetime2"); - - b.Property("AssessedLand") - .HasColumnType("MONEY"); - - b.Property("AssessedLandDate") - .HasColumnType("datetime2"); - - b.Property("Boundary") - .HasColumnType("geography"); - - b.Property("BuildingConstructionType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUse") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .HasColumnType("nvarchar(max)"); - - b.Property("Classification") - .HasColumnType("nvarchar(max)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("DisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("Id") - .HasColumnType("int"); - - b.Property("IsSensitive") - .HasColumnType("bit"); - - b.Property("IsVisibleToOtherAgencies") - .HasColumnType("bit"); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(max)"); - - b.Property("LeaseExpiry") - .HasColumnType("datetime2"); - - b.Property("Location") - .HasColumnType("geography"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("MarketFiscalYear") - .HasColumnType("int"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("NetBookFiscalYear") - .HasColumnType("int"); - - b.Property("OccupantName") - .HasColumnType("nvarchar(max)"); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Postal") - .HasColumnType("nvarchar(max)"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(max)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("Province") - .HasColumnType("nvarchar(max)"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .HasColumnType("varbinary(max)"); - - b.Property("SubAgency") - .HasColumnType("nvarchar(max)"); - - b.Property("SubAgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("TransferLeaseOnSale") - .HasColumnType("bit"); - - b.Property("UpdatedOn") - .HasColumnType("datetime2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(max)"); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(max)"); - - b.ToView("View_Properties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Province"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parent"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("BuildingConstructionType"); - - b.Navigation("BuildingOccupantType"); - - b.Navigation("BuildingPredominateUse"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Template"); - - b.Navigation("ToAgency"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Subdivision"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Risk"); - - b.Navigation("Status"); - - b.Navigation("TierLevel"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Notification"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("StatusHistory") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany() - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("FromStatus"); - - b.Navigation("Template"); - - b.Navigation("ToStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("FromWorkflowStatus"); - - b.Navigation("ToWorkflowStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Task"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Claim"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("ApprovedBy"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Navigation("Buildings"); - - b.Navigation("Children"); - - b.Navigation("Notifications"); - - b.Navigation("Parcels"); - - b.Navigation("ProjectResponses"); - - b.Navigation("Projects"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Navigation("Responses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Navigation("Notifications"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Navigation("Buildings"); - - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - - b.Navigation("Subdivisions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Navigation("Notes"); - - b.Navigation("Notifications"); - - b.Navigation("Properties"); - - b.Navigation("Responses"); - - b.Navigation("Snapshots"); - - b.Navigation("StatusHistory"); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Navigation("Projects"); - - b.Navigation("Tasks"); - - b.Navigation("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Navigation("Claims"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Navigation("Projects"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Navigation("FromStatus"); - - b.Navigation("ToStatus"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20220425181658_v01.18.02.cs b/backend/dal/Migrations/20220425181658_v01.18.02.cs deleted file mode 100644 index 582dd6fd00..0000000000 --- a/backend/dal/Migrations/20220425181658_v01.18.02.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v011802 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20220624191347_v01.18.03.Designer.cs b/backend/dal/Migrations/20220624191347_v01.18.03.Designer.cs deleted file mode 100644 index 42d203707c..0000000000 --- a/backend/dal/Migrations/20220624191347_v01.18.03.Designer.cs +++ /dev/null @@ -1,4218 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20220624191347_v01.18.03")] - partial class v011803 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.6") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Address2") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("ProvinceId") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("BoundaryType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CCEmail") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("OccupantName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ZoningPotential") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Manager") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("GroupName") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Route") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectId"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.ToTable("ProjectStatusHistory"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("KeycloakUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("MiddleName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Position") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.HasIndex("KeycloakUserId", "Username", "Email") - .IsUnique() - .HasFilter("[KeycloakUserId] IS NOT NULL"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Views.Property", b => - { - b.Property("Address") - .HasColumnType("nvarchar(max)"); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(max)"); - - b.Property("Agency") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("AssessedBuilding") - .HasColumnType("MONEY"); - - b.Property("AssessedBuildingDate") - .HasColumnType("datetime2"); - - b.Property("AssessedLand") - .HasColumnType("MONEY"); - - b.Property("AssessedLandDate") - .HasColumnType("datetime2"); - - b.Property("Boundary") - .HasColumnType("geography"); - - b.Property("BuildingConstructionType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUse") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .HasColumnType("nvarchar(max)"); - - b.Property("Classification") - .HasColumnType("nvarchar(max)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("DisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("Id") - .HasColumnType("int"); - - b.Property("IsSensitive") - .HasColumnType("bit"); - - b.Property("IsVisibleToOtherAgencies") - .HasColumnType("bit"); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(max)"); - - b.Property("LeaseExpiry") - .HasColumnType("datetime2"); - - b.Property("Location") - .HasColumnType("geography"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("MarketFiscalYear") - .HasColumnType("int"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("NetBookFiscalYear") - .HasColumnType("int"); - - b.Property("OccupantName") - .HasColumnType("nvarchar(max)"); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Postal") - .HasColumnType("nvarchar(max)"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(max)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("Province") - .HasColumnType("nvarchar(max)"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .HasColumnType("varbinary(max)"); - - b.Property("SubAgency") - .HasColumnType("nvarchar(max)"); - - b.Property("SubAgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("TransferLeaseOnSale") - .HasColumnType("bit"); - - b.Property("UpdatedOn") - .HasColumnType("datetime2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(max)"); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(max)"); - - b.ToView("View_Properties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Province"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parent"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("BuildingConstructionType"); - - b.Navigation("BuildingOccupantType"); - - b.Navigation("BuildingPredominateUse"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Template"); - - b.Navigation("ToAgency"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Subdivision"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Risk"); - - b.Navigation("Status"); - - b.Navigation("TierLevel"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Notification"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("StatusHistory") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany() - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("FromStatus"); - - b.Navigation("Template"); - - b.Navigation("ToStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("FromWorkflowStatus"); - - b.Navigation("ToWorkflowStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Task"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Claim"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("ApprovedBy"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Navigation("Buildings"); - - b.Navigation("Children"); - - b.Navigation("Notifications"); - - b.Navigation("Parcels"); - - b.Navigation("ProjectResponses"); - - b.Navigation("Projects"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Navigation("Responses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Navigation("Notifications"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Navigation("Buildings"); - - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - - b.Navigation("Subdivisions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Navigation("Notes"); - - b.Navigation("Notifications"); - - b.Navigation("Properties"); - - b.Navigation("Responses"); - - b.Navigation("Snapshots"); - - b.Navigation("StatusHistory"); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Navigation("Projects"); - - b.Navigation("Tasks"); - - b.Navigation("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Navigation("Claims"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Navigation("Projects"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Navigation("FromStatus"); - - b.Navigation("ToStatus"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20220624191347_v01.18.03.cs b/backend/dal/Migrations/20220624191347_v01.18.03.cs deleted file mode 100644 index 00c0b7b36c..0000000000 --- a/backend/dal/Migrations/20220624191347_v01.18.03.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v011803 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - migrationBuilder.AddColumn( - name: "CCEmail", - table: "Agencies", - type: "nvarchar(250)", - maxLength: 250, - nullable: true); - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - migrationBuilder.DropColumn( - name: "CCEmail", - table: "Agencies"); - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20230103232746_v02.01.00.Designer.cs b/backend/dal/Migrations/20230103232746_v02.01.00.Designer.cs deleted file mode 100644 index b0321fd052..0000000000 --- a/backend/dal/Migrations/20230103232746_v02.01.00.Designer.cs +++ /dev/null @@ -1,4218 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20230103232746_v02.01.00")] - partial class v020100 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.6") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Address2") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("ProvinceId") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("BoundaryType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CCEmail") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("OccupantName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ZoningPotential") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Manager") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("GroupName") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Route") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectId"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.ToTable("ProjectStatusHistory"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("KeycloakUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("MiddleName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Position") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.HasIndex("KeycloakUserId", "Username", "Email") - .IsUnique() - .HasFilter("[KeycloakUserId] IS NOT NULL"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Views.Property", b => - { - b.Property("Address") - .HasColumnType("nvarchar(max)"); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(max)"); - - b.Property("Agency") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("AssessedBuilding") - .HasColumnType("MONEY"); - - b.Property("AssessedBuildingDate") - .HasColumnType("datetime2"); - - b.Property("AssessedLand") - .HasColumnType("MONEY"); - - b.Property("AssessedLandDate") - .HasColumnType("datetime2"); - - b.Property("Boundary") - .HasColumnType("geography"); - - b.Property("BuildingConstructionType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUse") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .HasColumnType("nvarchar(max)"); - - b.Property("Classification") - .HasColumnType("nvarchar(max)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("DisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("Id") - .HasColumnType("int"); - - b.Property("IsSensitive") - .HasColumnType("bit"); - - b.Property("IsVisibleToOtherAgencies") - .HasColumnType("bit"); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(max)"); - - b.Property("LeaseExpiry") - .HasColumnType("datetime2"); - - b.Property("Location") - .HasColumnType("geography"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("MarketFiscalYear") - .HasColumnType("int"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("NetBookFiscalYear") - .HasColumnType("int"); - - b.Property("OccupantName") - .HasColumnType("nvarchar(max)"); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Postal") - .HasColumnType("nvarchar(max)"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(max)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("Province") - .HasColumnType("nvarchar(max)"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .HasColumnType("varbinary(max)"); - - b.Property("SubAgency") - .HasColumnType("nvarchar(max)"); - - b.Property("SubAgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("TransferLeaseOnSale") - .HasColumnType("bit"); - - b.Property("UpdatedOn") - .HasColumnType("datetime2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(max)"); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(max)"); - - b.ToView("View_Properties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Province"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parent"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("BuildingConstructionType"); - - b.Navigation("BuildingOccupantType"); - - b.Navigation("BuildingPredominateUse"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Template"); - - b.Navigation("ToAgency"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Subdivision"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Risk"); - - b.Navigation("Status"); - - b.Navigation("TierLevel"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Notification"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("StatusHistory") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany() - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("FromStatus"); - - b.Navigation("Template"); - - b.Navigation("ToStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("FromWorkflowStatus"); - - b.Navigation("ToWorkflowStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Task"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Claim"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("ApprovedBy"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Navigation("Buildings"); - - b.Navigation("Children"); - - b.Navigation("Notifications"); - - b.Navigation("Parcels"); - - b.Navigation("ProjectResponses"); - - b.Navigation("Projects"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Navigation("Responses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Navigation("Notifications"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Navigation("Buildings"); - - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - - b.Navigation("Subdivisions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Navigation("Notes"); - - b.Navigation("Notifications"); - - b.Navigation("Properties"); - - b.Navigation("Responses"); - - b.Navigation("Snapshots"); - - b.Navigation("StatusHistory"); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Navigation("Projects"); - - b.Navigation("Tasks"); - - b.Navigation("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Navigation("Claims"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Navigation("Projects"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Navigation("FromStatus"); - - b.Navigation("ToStatus"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20230103232746_v02.01.00.cs b/backend/dal/Migrations/20230103232746_v02.01.00.cs deleted file mode 100644 index 3cb29d3e93..0000000000 --- a/backend/dal/Migrations/20230103232746_v02.01.00.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v020100 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20230309230913_v02.03.09.Designer.cs b/backend/dal/Migrations/20230309230913_v02.03.09.Designer.cs deleted file mode 100644 index a18eb025a9..0000000000 --- a/backend/dal/Migrations/20230309230913_v02.03.09.Designer.cs +++ /dev/null @@ -1,4218 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20230309230913_v02.03.09")] - partial class v020309 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.6") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Address2") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("ProvinceId") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("BoundaryType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CCEmail") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("OccupantName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ZoningPotential") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Manager") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("GroupName") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Route") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectId"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.ToTable("ProjectStatusHistory"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("KeycloakUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("MiddleName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Position") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.HasIndex("KeycloakUserId", "Username", "Email") - .IsUnique() - .HasFilter("[KeycloakUserId] IS NOT NULL"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Views.Property", b => - { - b.Property("Address") - .HasColumnType("nvarchar(max)"); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(max)"); - - b.Property("Agency") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("AssessedBuilding") - .HasColumnType("MONEY"); - - b.Property("AssessedBuildingDate") - .HasColumnType("datetime2"); - - b.Property("AssessedLand") - .HasColumnType("MONEY"); - - b.Property("AssessedLandDate") - .HasColumnType("datetime2"); - - b.Property("Boundary") - .HasColumnType("geography"); - - b.Property("BuildingConstructionType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUse") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .HasColumnType("nvarchar(max)"); - - b.Property("Classification") - .HasColumnType("nvarchar(max)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("DisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("Id") - .HasColumnType("int"); - - b.Property("IsSensitive") - .HasColumnType("bit"); - - b.Property("IsVisibleToOtherAgencies") - .HasColumnType("bit"); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(max)"); - - b.Property("LeaseExpiry") - .HasColumnType("datetime2"); - - b.Property("Location") - .HasColumnType("geography"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("MarketFiscalYear") - .HasColumnType("int"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("NetBookFiscalYear") - .HasColumnType("int"); - - b.Property("OccupantName") - .HasColumnType("nvarchar(max)"); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Postal") - .HasColumnType("nvarchar(max)"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(max)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("Province") - .HasColumnType("nvarchar(max)"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .HasColumnType("varbinary(max)"); - - b.Property("SubAgency") - .HasColumnType("nvarchar(max)"); - - b.Property("SubAgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("TransferLeaseOnSale") - .HasColumnType("bit"); - - b.Property("UpdatedOn") - .HasColumnType("datetime2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(max)"); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(max)"); - - b.ToView("View_Properties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Province"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parent"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("BuildingConstructionType"); - - b.Navigation("BuildingOccupantType"); - - b.Navigation("BuildingPredominateUse"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Template"); - - b.Navigation("ToAgency"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Subdivision"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Risk"); - - b.Navigation("Status"); - - b.Navigation("TierLevel"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Notification"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("StatusHistory") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany() - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("FromStatus"); - - b.Navigation("Template"); - - b.Navigation("ToStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("FromWorkflowStatus"); - - b.Navigation("ToWorkflowStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Task"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Claim"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("ApprovedBy"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Navigation("Buildings"); - - b.Navigation("Children"); - - b.Navigation("Notifications"); - - b.Navigation("Parcels"); - - b.Navigation("ProjectResponses"); - - b.Navigation("Projects"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Navigation("Responses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Navigation("Notifications"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Navigation("Buildings"); - - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - - b.Navigation("Subdivisions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Navigation("Notes"); - - b.Navigation("Notifications"); - - b.Navigation("Properties"); - - b.Navigation("Responses"); - - b.Navigation("Snapshots"); - - b.Navigation("StatusHistory"); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Navigation("Projects"); - - b.Navigation("Tasks"); - - b.Navigation("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Navigation("Claims"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Navigation("Projects"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Navigation("FromStatus"); - - b.Navigation("ToStatus"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20230309230913_v02.03.09.cs b/backend/dal/Migrations/20230309230913_v02.03.09.cs deleted file mode 100644 index f94a2fda09..0000000000 --- a/backend/dal/Migrations/20230309230913_v02.03.09.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -namespace Pims.Dal.Migrations -{ - public partial class v020309 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20231003220606_v02.06.14.Designer.cs b/backend/dal/Migrations/20231003220606_v02.06.14.Designer.cs deleted file mode 100644 index 3678073781..0000000000 --- a/backend/dal/Migrations/20231003220606_v02.06.14.Designer.cs +++ /dev/null @@ -1,4247 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -#nullable disable - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20231003220606_v02.06.14")] - partial class v020614 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.22") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Address1") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Address2") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("ProvinceId") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId"); - - SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("AdministrativeArea", "ProvinceId"), new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1"); - - SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("Id", "Address1"), new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea"); - - SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("Id", "AdministrativeArea"), new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal"); - - SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("Id", "Postal"), new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1"); - - SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1"), new[] { "Address2" }); - - b.ToTable("Addresses", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Abbreviation") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("BoundaryType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AddressTo") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CCEmail") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("OccupantName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Audience") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ZoningPotential") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Manager") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("GroupName") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Route") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectId"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.ToTable("ProjectStatusHistory", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("KeycloakUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("MiddleName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Position") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.HasIndex("KeycloakUserId", "Username", "Email") - .IsUnique() - .HasFilter("[KeycloakUserId] IS NOT NULL"); - - b.ToTable("Users", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Views.Property", b => - { - b.Property("Address") - .HasColumnType("nvarchar(max)"); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(max)"); - - b.Property("Agency") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("AssessedBuilding") - .HasColumnType("MONEY"); - - b.Property("AssessedBuildingDate") - .HasColumnType("datetime2"); - - b.Property("AssessedLand") - .HasColumnType("MONEY"); - - b.Property("AssessedLandDate") - .HasColumnType("datetime2"); - - b.Property("Boundary") - .HasColumnType("geography"); - - b.Property("BuildingConstructionType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUse") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .HasColumnType("nvarchar(max)"); - - b.Property("Classification") - .HasColumnType("nvarchar(max)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("DisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("Id") - .HasColumnType("int"); - - b.Property("IsSensitive") - .HasColumnType("bit"); - - b.Property("IsVisibleToOtherAgencies") - .HasColumnType("bit"); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(max)"); - - b.Property("LeaseExpiry") - .HasColumnType("datetime2"); - - b.Property("Location") - .HasColumnType("geography"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("MarketFiscalYear") - .HasColumnType("int"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("NetBookFiscalYear") - .HasColumnType("int"); - - b.Property("OccupantName") - .HasColumnType("nvarchar(max)"); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Postal") - .HasColumnType("nvarchar(max)"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(max)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("Province") - .HasColumnType("nvarchar(max)"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .HasColumnType("varbinary(max)"); - - b.Property("SubAgency") - .HasColumnType("nvarchar(max)"); - - b.Property("SubAgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("TransferLeaseOnSale") - .HasColumnType("bit"); - - b.Property("UpdatedOn") - .HasColumnType("datetime2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(max)"); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(max)"); - - b.ToView("View_Properties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Code") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Province"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parent"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("BuildingConstructionType"); - - b.Navigation("BuildingOccupantType"); - - b.Navigation("BuildingPredominateUse"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Template"); - - b.Navigation("ToAgency"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Subdivision"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Risk"); - - b.Navigation("Status"); - - b.Navigation("TierLevel"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Notification"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("StatusHistory") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany() - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("FromStatus"); - - b.Navigation("Template"); - - b.Navigation("ToStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("FromWorkflowStatus"); - - b.Navigation("ToWorkflowStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Task"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Claim"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("ApprovedBy"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Navigation("Buildings"); - - b.Navigation("Children"); - - b.Navigation("Notifications"); - - b.Navigation("Parcels"); - - b.Navigation("ProjectResponses"); - - b.Navigation("Projects"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Navigation("Responses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Navigation("Notifications"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Navigation("Buildings"); - - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - - b.Navigation("Subdivisions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Navigation("Notes"); - - b.Navigation("Notifications"); - - b.Navigation("Properties"); - - b.Navigation("Responses"); - - b.Navigation("Snapshots"); - - b.Navigation("StatusHistory"); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Navigation("Projects"); - - b.Navigation("Tasks"); - - b.Navigation("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Navigation("Claims"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Navigation("Projects"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Navigation("FromStatus"); - - b.Navigation("ToStatus"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20231003220606_v02.06.14.cs b/backend/dal/Migrations/20231003220606_v02.06.14.cs deleted file mode 100644 index f98f948841..0000000000 --- a/backend/dal/Migrations/20231003220606_v02.06.14.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -#nullable disable - -namespace Pims.Dal.Migrations -{ - public partial class v020614 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20231129194537_v02.07.00.Designer.cs b/backend/dal/Migrations/20231129194537_v02.07.00.Designer.cs deleted file mode 100644 index c6d8b06c58..0000000000 --- a/backend/dal/Migrations/20231129194537_v02.07.00.Designer.cs +++ /dev/null @@ -1,4247 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -#nullable disable - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20231129194537_v02.07.00")] - partial class v020700 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.22") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Address1") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Address2") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("ProvinceId") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId"); - - SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("AdministrativeArea", "ProvinceId"), new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1"); - - SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("Id", "Address1"), new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea"); - - SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("Id", "AdministrativeArea"), new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal"); - - SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("Id", "Postal"), new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1"); - - SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1"), new[] { "Address2" }); - - b.ToTable("Addresses", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Abbreviation") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("BoundaryType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AddressTo") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CCEmail") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("OccupantName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Audience") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ZoningPotential") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Manager") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("GroupName") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Route") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectId"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.ToTable("ProjectStatusHistory", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("KeycloakUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("MiddleName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Position") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.HasIndex("KeycloakUserId", "Username", "Email") - .IsUnique() - .HasFilter("[KeycloakUserId] IS NOT NULL"); - - b.ToTable("Users", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Views.Property", b => - { - b.Property("Address") - .HasColumnType("nvarchar(max)"); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(max)"); - - b.Property("Agency") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("AssessedBuilding") - .HasColumnType("MONEY"); - - b.Property("AssessedBuildingDate") - .HasColumnType("datetime2"); - - b.Property("AssessedLand") - .HasColumnType("MONEY"); - - b.Property("AssessedLandDate") - .HasColumnType("datetime2"); - - b.Property("Boundary") - .HasColumnType("geography"); - - b.Property("BuildingConstructionType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUse") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .HasColumnType("nvarchar(max)"); - - b.Property("Classification") - .HasColumnType("nvarchar(max)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("DisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("Id") - .HasColumnType("int"); - - b.Property("IsSensitive") - .HasColumnType("bit"); - - b.Property("IsVisibleToOtherAgencies") - .HasColumnType("bit"); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(max)"); - - b.Property("LeaseExpiry") - .HasColumnType("datetime2"); - - b.Property("Location") - .HasColumnType("geography"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("MarketFiscalYear") - .HasColumnType("int"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("NetBookFiscalYear") - .HasColumnType("int"); - - b.Property("OccupantName") - .HasColumnType("nvarchar(max)"); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Postal") - .HasColumnType("nvarchar(max)"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(max)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("Province") - .HasColumnType("nvarchar(max)"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .HasColumnType("varbinary(max)"); - - b.Property("SubAgency") - .HasColumnType("nvarchar(max)"); - - b.Property("SubAgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("TransferLeaseOnSale") - .HasColumnType("bit"); - - b.Property("UpdatedOn") - .HasColumnType("datetime2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(max)"); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(max)"); - - b.ToView("View_Properties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Code") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Province"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parent"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("BuildingConstructionType"); - - b.Navigation("BuildingOccupantType"); - - b.Navigation("BuildingPredominateUse"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Template"); - - b.Navigation("ToAgency"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Subdivision"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Risk"); - - b.Navigation("Status"); - - b.Navigation("TierLevel"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Notification"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("StatusHistory") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany() - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("FromStatus"); - - b.Navigation("Template"); - - b.Navigation("ToStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("FromWorkflowStatus"); - - b.Navigation("ToWorkflowStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Task"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Claim"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("ApprovedBy"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Navigation("Buildings"); - - b.Navigation("Children"); - - b.Navigation("Notifications"); - - b.Navigation("Parcels"); - - b.Navigation("ProjectResponses"); - - b.Navigation("Projects"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Navigation("Responses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Navigation("Notifications"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Navigation("Buildings"); - - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - - b.Navigation("Subdivisions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Navigation("Notes"); - - b.Navigation("Notifications"); - - b.Navigation("Properties"); - - b.Navigation("Responses"); - - b.Navigation("Snapshots"); - - b.Navigation("StatusHistory"); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Navigation("Projects"); - - b.Navigation("Tasks"); - - b.Navigation("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Navigation("Claims"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Navigation("Projects"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Navigation("FromStatus"); - - b.Navigation("ToStatus"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20231129194537_v02.07.00.cs b/backend/dal/Migrations/20231129194537_v02.07.00.cs deleted file mode 100644 index bf8992e700..0000000000 --- a/backend/dal/Migrations/20231129194537_v02.07.00.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -#nullable disable - -namespace Pims.Dal.Migrations -{ - public partial class v020700 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PostDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/20231207161338_v02.07.01.Designer.cs b/backend/dal/Migrations/20231207161338_v02.07.01.Designer.cs deleted file mode 100644 index a37b25fc07..0000000000 --- a/backend/dal/Migrations/20231207161338_v02.07.01.Designer.cs +++ /dev/null @@ -1,4247 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -#nullable disable - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - [Migration("20231207161338_v02.07.01")] - partial class v020701 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.22") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Address1") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Address2") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("ProvinceId") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId"); - - SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("AdministrativeArea", "ProvinceId"), new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1"); - - SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("Id", "Address1"), new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea"); - - SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("Id", "AdministrativeArea"), new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal"); - - SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("Id", "Postal"), new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1"); - - SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1"), new[] { "Address2" }); - - b.ToTable("Addresses", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Abbreviation") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("BoundaryType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AddressTo") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CCEmail") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("OccupantName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Audience") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ZoningPotential") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Manager") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("GroupName") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Route") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectId"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.ToTable("ProjectStatusHistory", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("KeycloakUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("MiddleName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Position") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.HasIndex("KeycloakUserId", "Username", "Email") - .IsUnique() - .HasFilter("[KeycloakUserId] IS NOT NULL"); - - b.ToTable("Users", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Views.Property", b => - { - b.Property("Address") - .HasColumnType("nvarchar(max)"); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(max)"); - - b.Property("Agency") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("AssessedBuilding") - .HasColumnType("MONEY"); - - b.Property("AssessedBuildingDate") - .HasColumnType("datetime2"); - - b.Property("AssessedLand") - .HasColumnType("MONEY"); - - b.Property("AssessedLandDate") - .HasColumnType("datetime2"); - - b.Property("Boundary") - .HasColumnType("geography"); - - b.Property("BuildingConstructionType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUse") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .HasColumnType("nvarchar(max)"); - - b.Property("Classification") - .HasColumnType("nvarchar(max)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("DisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("Id") - .HasColumnType("int"); - - b.Property("IsSensitive") - .HasColumnType("bit"); - - b.Property("IsVisibleToOtherAgencies") - .HasColumnType("bit"); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(max)"); - - b.Property("LeaseExpiry") - .HasColumnType("datetime2"); - - b.Property("Location") - .HasColumnType("geography"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("MarketFiscalYear") - .HasColumnType("int"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("NetBookFiscalYear") - .HasColumnType("int"); - - b.Property("OccupantName") - .HasColumnType("nvarchar(max)"); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Postal") - .HasColumnType("nvarchar(max)"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(max)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("Province") - .HasColumnType("nvarchar(max)"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .HasColumnType("varbinary(max)"); - - b.Property("SubAgency") - .HasColumnType("nvarchar(max)"); - - b.Property("SubAgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("TransferLeaseOnSale") - .HasColumnType("bit"); - - b.Property("UpdatedOn") - .HasColumnType("datetime2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(max)"); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(max)"); - - b.ToView("View_Properties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Code") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus", (string)null); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Province"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parent"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("BuildingConstructionType"); - - b.Navigation("BuildingOccupantType"); - - b.Navigation("BuildingPredominateUse"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Template"); - - b.Navigation("ToAgency"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Subdivision"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Risk"); - - b.Navigation("Status"); - - b.Navigation("TierLevel"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Notification"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("StatusHistory") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany() - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("FromStatus"); - - b.Navigation("Template"); - - b.Navigation("ToStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("FromWorkflowStatus"); - - b.Navigation("ToWorkflowStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Task"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Claim"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("ApprovedBy"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Navigation("Buildings"); - - b.Navigation("Children"); - - b.Navigation("Notifications"); - - b.Navigation("Parcels"); - - b.Navigation("ProjectResponses"); - - b.Navigation("Projects"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Navigation("Responses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Navigation("Notifications"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Navigation("Buildings"); - - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - - b.Navigation("Subdivisions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Navigation("Notes"); - - b.Navigation("Notifications"); - - b.Navigation("Properties"); - - b.Navigation("Responses"); - - b.Navigation("Snapshots"); - - b.Navigation("StatusHistory"); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Navigation("Projects"); - - b.Navigation("Tasks"); - - b.Navigation("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Navigation("Claims"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Navigation("Projects"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Navigation("FromStatus"); - - b.Navigation("ToStatus"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/20231207161338_v02.07.01.cs b/backend/dal/Migrations/20231207161338_v02.07.01.cs deleted file mode 100644 index 839d0faa53..0000000000 --- a/backend/dal/Migrations/20231207161338_v02.07.01.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Pims.Dal.Helpers.Migrations; - -#nullable disable - -namespace Pims.Dal.Migrations -{ - public partial class v020701 : SeedMigration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - PreUp(migrationBuilder); - - PostUp(migrationBuilder); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - PreDown(migrationBuilder); - - PreDown(migrationBuilder); - } - } -} diff --git a/backend/dal/Migrations/Initial/Up/PostUp/01-Agencies.sql b/backend/dal/Migrations/Initial/Up/PostUp/01-Agencies.sql deleted file mode 100644 index c957729d64..0000000000 --- a/backend/dal/Migrations/Initial/Up/PostUp/01-Agencies.sql +++ /dev/null @@ -1,556 +0,0 @@ -PRINT 'Adding Agencies' - -SET IDENTITY_INSERT dbo.[Agencies] ON - --- Parent Agencies. -INSERT INTO dbo.[Agencies] ( - [Id] - , [Code] - , [Name] - , [IsDisabled] - , [SendEmail] - , [Email] - , [AddressTo] -) VALUES ( - 1 - , 'AEST' - , 'Ministry of Advanced Education, Skills & Training' - , 0 - , 1 - , 'kevin.brewster@gov.bc.ca' - , 'ADM and EFO Finance, Technology and Management Services' -), ( - 2 - , 'CITZ' - , 'Ministry of Citizens Services' - , 0 - , 1 - , 'dean.skinner@gov.bc.ca' - , 'ADM and EFO CSD' -), ( - 4 - , 'EDUC' - , 'Ministry of Education' - , 0 - , 1 - , 'reg.bawa@gov.bc.ca' - , 'ADM Resource Management Division' -), ( - 5 - , 'FIN' - , 'Ministry of Finance' - , 0 - , 1 - , 'teri.spaven@gov.bc.ca' - , 'ADM & EFO Corporate Services Division' -), ( - 6 - , 'FLNR' - , 'Ministry of Forests, Lands, Natural Resources' - , 0 - , 1 - , 'trish.dohan@gov.bc.ca' - , 'ADM CSNR and EFO for FLNR' -), ( - 7 - , 'HLTH' - , 'Ministry of Health' - , 0 - , 1 - , 'philip.twyford@gov.bc.ca' - , 'ADM & EFO Finance and Corporate Services' -), ( - 8 - , 'MAH' - , 'Ministry of Municipal Affairs & Housing' - , 0 - , 1 - , 'david.curtis@gov.bc.ca' - , 'ADM & EFO Management Services Division' -), ( - 9 - , 'TRAN' - , 'Ministry of Transportation and Infrastructure' - , 0 - , 1 - , 'nancy.bain@gov.bc.ca' - , 'ADM & EFO Finance & Management Services Department' -), ( - 10 - , 'EMPR' - , 'Energy, Mines & Petroleum Resources' - , 0 - , 1 - , 'wes.boyd@gov.bc.ca' - , 'ADM CSNR and EFO to MIRR, AGRI EMPR ENV' -), ( - 11 - , 'MAG' - , 'Ministry of Attorney General' - , 0 - , 1 - , 'tracy.campbell@gov.bc.ca' - , 'ADM & EFO CMSB AG and PSSG' -), ( - 12 - , 'JEDC' - , 'Jobs, Economic Development & Competitiveness' - , 0 - , 1 - , 'joanna.white@gov.bc.ca' - , 'A/ADM & EFO Management Services Division' -), ( - 13 - , 'MTAC' - , 'Ministry of Tourism, Arts and Culture' - , 0 - , 1 - , 'salman.azam@gov.bc.ca' - , 'ADM & EFO Management Services Division' -), ( - 14 - , 'SDPR' - , 'Ministry of of Social Development and Poverty Reduction' - , 0 - , 1 - , 'jonathan.dube@gov.bc.ca' - , 'ADM & EFO CSD' -), ( - 15 - , 'MMHA' - , 'Ministry of Mental Health and Addictions' - , 0 - , 1 - , 'dara.landry@gov.bc.ca' - , 'Executive Lead Corporate Services' -), ( - 16 - , 'MCFD' - , 'Ministry of Children and Family Development' - , 0 - , 1 - , 'rob.byers@gov.bc.ca' - , 'AMD & EFO' -), ( - 17 - , 'BCPSA' - , 'Public Service Agency' - , 0 - , 1 - , 'bruce.richmond@gov.bc.ca' - , 'ADM Corporate Services' -) - --- Child Agencies for HLTH. -INSERT INTO dbo.[Agencies] ( - [Id] - , [ParentId] - , [Code] - , [Name] - , [IsDisabled] - , [SendEmail] -) VALUES ( - 20 - , 7 - , 'FHA' - , 'Fraser Health Authority' - , 0 - , 0 -), ( - 21 - , 7 - , 'IHA' - , 'Interior Health Authority' - , 0 - , 0 -), ( - 22 - , 7 - , 'NHA' - , 'Northern Health Authority' - , 0 - , 0 -), ( - 23 - , 7 - , 'PHSA' - , 'Provincial Health Services Authority' - , 0 - , 0 -), ( - 24 - , 7 - , 'VCHA' - , 'Vancouver Coastal Health Authority' - , 0 - , 0 -), ( - 25 - , 7 - , 'VIHA' - , 'Vancouver Island Health Authority' - , 0 - , 0 -) - --- Child Agencies for EMPR. -INSERT INTO dbo.[Agencies] ( - [Id] - , [ParentId] - , [Code] - , [Name] - , [IsDisabled] - , [SendEmail] -) VALUES ( - 30 - , 10 - , 'BCH' - , 'BC Hydro' - , 0 - , 0 -) - --- Child Agencies for MAH. -INSERT INTO dbo.[Agencies] ( - [Id] - , [ParentId] - , [Code] - , [Name] - , [IsDisabled] - , [SendEmail] -) VALUES ( - 40 - , 8 - , 'BCH' - , 'BC Housing' - , 0 - , 0 -), ( - 41 - , 8 - , 'BCA' - , 'BC Assessment' - , 0 - , 0 -), ( - 42 -- Added after release. - , 8 - , 'PRHC' - , 'Provincial Rental Housing Corporation' - , 0 - , 0 -) - --- Child Agencies for MAG. -INSERT INTO dbo.[Agencies] ( - [Id] - , [ParentId] - , [Code] - , [Name] - , [IsDisabled] - , [SendEmail] -) VALUES ( - 50 - , 11 - , 'ICBC' - , 'Insurance Coporation of BC' - , 0 - , 0 -),( - 51 -- Added after release. - , 11 - , 'LDB' - , 'BC Liquor Distribution Branch' - , 0 - , 0 -) - --- Child Agencies for JEDC. ---INSERT INTO dbo.[Agencies] ( --- [Id] --- , [ParentId] --- , [Code] --- , [Name] --- , [IsDisabled] --- , [SendEmail] ---) VALUES ( --- 50 --- , 12 --- , 'BCPC' --- , 'BC Pavillion Corporation' --- , 0 --- , 0 ---) - --- Child Agencies for EDUC. -INSERT INTO dbo.[Agencies] ( - [Id] - , [ParentId] - , [Code] - , [Name] - , [IsDisabled] - , [SendEmail] -) VALUES ( - 70 - , 4 - , 'CMB' - , 'Capital Management Branch' - , 0 - , 0 -) - --- Child Agencies for AEST. -INSERT INTO dbo.[Agencies] ( - [Id] - , [ParentId] - , [Code] - , [Name] - , [IsDisabled] - , [SendEmail] -) VALUES ( - 80 - , 1 - , 'BCIT' - , 'British Colubmia Institute of Technology' - , 0 - , 0 -), ( - 81 - , 1 - , 'CAMC' - , 'Camosun College' - , 0 - , 0 -), ( - 82 - , 1 - , 'CAPU' - , 'Capilano University' - , 0 - , 0 -), ( - 83 - , 1 - , 'CNC' - , 'College of New Caledonia' - , 0 - , 0 -), ( - 84 - , 1 - , 'CROCK' - , 'College of the Rockies' - , 0 - , 0 -), ( - 85 - , 1 - , 'DC' - , 'Douglas College' - , 0 - , 0 -), ( - 86 - , 1 - , 'ECUAD' - , 'Emily Carr University of Art and Design' - , 0 - , 0 -), ( - 87 - , 1 - , 'JIBC' - , 'Justice Institute of BC' - , 0 - , 0 -), ( - 88 - , 1 - , 'KP' - , 'Kwantlen Polytechnic' - , 0 - , 0 -), ( - 89 - , 1 - , 'LC' - , 'Langara College' - , 0 - , 0 -), ( - 90 - , 1 - , 'NVIT' - , 'Nichola Valley Institute of Technology' - , 0 - , 0 -), ( - 91 - , 1 - , 'NLC' - , 'Northern Lights College' - , 0 - , 0 -), ( - 92 - , 1 - , 'CMC' - , 'Coast Mountain College' - , 0 - , 0 -), ( - 93 - , 1 - , 'OC' - , 'Okanagan College' - , 0 - , 0 -), ( - 94 - , 1 - , 'SC' - , 'Selkirk College' - , 0 - , 0 -), ( - 95 - , 1 - , 'SFU' - , 'Simon Fraser University' - , 0 - , 0 -), ( - 96 - , 1 - , 'TRU' - , 'Thompson Rivers University' - , 0 - , 0 -), ( - 97 - , 1 - , 'UBC' - , 'University of BC' - , 0 - , 0 -), ( - 98 - , 1 - , 'UFV' - , 'University of the Fraser Valley' - , 0 - , 0 -), ( - 99 - , 1 - , 'UNBC' - , 'University of Northern BC' - , 0 - , 0 -), ( - 100 - , 1 - , 'UVIC' - , 'University of Victoria' - , 0 - , 0 -), ( - 101 - , 1 - , 'VCC' - , 'Vancouver Community College' - , 0 - , 0 -), ( - 102 - , 1 - , 'VIU' - , 'Vancouver Island University' - , 0 - , 0 -) - --- Child Agencies for CITZ. -INSERT INTO dbo.[Agencies] ( - [Id] - , [ParentId] - , [Code] - , [Name] - , [IsDisabled] - , [SendEmail] -) VALUES ( - 110 - , 2 - , 'RPD' - , 'Real Property Division' - , 0 - , 0 -) - --- Child Agencies for FLNR. -INSERT INTO dbo.[Agencies] ( - [Id] - , [ParentId] - , [Code] - , [Name] - , [IsDisabled] - , [SendEmail] -) VALUES ( - 120 - , 6 - , 'CLO' - , 'Crown Land Opportunities' - , 0 - , 0 -) - --- Child Agencies for TRAN. -INSERT INTO dbo.[Agencies] ( - [Id] - , [ParentId] - , [Code] - , [Name] - , [IsDisabled] - , [SendEmail] -) VALUES ( - 130 - , 9 - , 'PLMB' - , 'Properties and Land Management Branch' - , 0 - , 0 -),( - 131 - , 9 - , 'BCT' - , 'BC Transit' - , 0 - , 0 -),( - 132 -- Added after release. - , 9 - , 'BCTFA' - , 'BC Transportation Financing Authority' - , 0 - , 0 -) - --- Child Agencies for MTAC. -INSERT INTO dbo.[Agencies] ( - [Id] - , [ParentId] - , [Code] - , [Name] - , [IsDisabled] - , [SendEmail] -) VALUES ( - 140 - , 13 - , 'PAVCO' - , 'BC Pavillion Corporation' - , 0 - , 0 -) - -SET IDENTITY_INSERT dbo.[Agencies] OFF - diff --git a/backend/dal/Migrations/Initial/Up/PostUp/01-BuildingConstructionTypes.sql b/backend/dal/Migrations/Initial/Up/PostUp/01-BuildingConstructionTypes.sql deleted file mode 100644 index 0e31c45866..0000000000 --- a/backend/dal/Migrations/Initial/Up/PostUp/01-BuildingConstructionTypes.sql +++ /dev/null @@ -1,27 +0,0 @@ -PRINT 'Adding BuildingConstructionTypes' - -INSERT INTO dbo.[BuildingConstructionTypes] ( - [Id] - , [Name] - , [IsDisabled] -) VALUES ( - 0 - , 'Concrete' - , 0 -), ( - 1 - , 'Masonry' - , 0 -), ( - 2 - , 'Mixed' - , 0 -), ( - 3 - , 'Steel' - , 0 -), ( - 4 - , 'Wood' - , 0 -) diff --git a/backend/dal/Migrations/Initial/Up/PostUp/01-BuildingOccupantTypes.sql b/backend/dal/Migrations/Initial/Up/PostUp/01-BuildingOccupantTypes.sql deleted file mode 100644 index b4c34313b8..0000000000 --- a/backend/dal/Migrations/Initial/Up/PostUp/01-BuildingOccupantTypes.sql +++ /dev/null @@ -1,19 +0,0 @@ -PRINT 'Adding BuildingOccupantTypes' - -INSERT INTO dbo.[BuildingOccupantTypes] ( - [Id] - , [Name] - , [IsDisabled] -) VALUES ( - 0 - , 'Leased' - , 0 -), ( - 1 - , 'Occupied By Owning Ministry' - , 0 -), ( - 2 - , 'Unoccupied' - , 0 -) diff --git a/backend/dal/Migrations/Initial/Up/PostUp/01-BuildingPredominantUses.sql b/backend/dal/Migrations/Initial/Up/PostUp/01-BuildingPredominantUses.sql deleted file mode 100644 index 96832b7060..0000000000 --- a/backend/dal/Migrations/Initial/Up/PostUp/01-BuildingPredominantUses.sql +++ /dev/null @@ -1,75 +0,0 @@ -PRINT 'Adding BuildingPredominateUses' - -INSERT INTO dbo.[BuildingPredominateUses] ( - [Id] - , [Name] - , [IsDisabled] -) VALUES ( - 0 - , 'Religious' - , 0 -), ( - 1 - , 'Research & Development Facility' - , 0 -), ( - 2 - , 'Residential Detached' - , 0 -), ( - 3 - , 'Residential Multi' - , 0 -), ( - 4 - , 'Retail' - , 0 -), ( - 5 - , 'Senior Housing (Assisted Living / Skilled Nursing)' - , 0 -), ( - 6 - , 'Shelters / Orphanages / Children’s Homes / Halfway Homes' - , 0 -), ( - 7 - , 'Social Assistance Housing' - , 0 -), ( - 8 - , 'Storage' - , 0 -), ( - 9 - , 'Storage Vehicle' - , 0 -), ( - 10 - , 'Trailer Office' - , 0 -), ( - 11 - , 'Trailer Other' - , 0 -), ( - 12 - , 'Training Center' - , 0 -), ( - 13 - , 'Transportation (Airport / Rail / Bus station)' - , 0 -), ( - 14 - , 'University / Collect' - , 0 -), ( - 15 - , 'Warehouse' - , 0 -), ( - 16 - , 'Weigh Station' - , 0 -) diff --git a/backend/dal/Migrations/Initial/Up/PostUp/01-Cities.sql b/backend/dal/Migrations/Initial/Up/PostUp/01-Cities.sql deleted file mode 100644 index 0a15f2c52e..0000000000 --- a/backend/dal/Migrations/Initial/Up/PostUp/01-Cities.sql +++ /dev/null @@ -1,324 +0,0 @@ -PRINT 'Adding Cities' - -SET IDENTITY_INSERT dbo.[Cities] ON - -INSERT INTO dbo.[Cities] ( - [Id] - , [Name] - , [Code] - , [IsDisabled] -) VALUES (1, 'No City Yet', '1', 0), -(2, '100 Mile House', '2', 0), -(3, '150 Mile House', '3', 0), -(4, 'Abbotsford', '4', 0), -(5, 'Agassiz', '5', 0), -(6, 'Ahousaht', '6', 0), -(7, 'Albert Canyon', '7', 0), -(8, 'Aldergrove', '8', 0), -(9, 'Alert Bay', '9', 0), -(10, 'Alexis Creek', '10', 0), -(11, 'Aleza Lake', '11', 0), -(12, 'Allison Pass', '12', 0), -(13, 'Anahim Lake', '13', 0), -(14, 'Armstrong', '14', 0), -(15, 'Ashcroft', '15', 0), -(16, 'Athalmere', '16', 0), -(17, 'Atlin', '17', 0), -(18, 'Avola', '18', 0), -(19, 'Baldonnel', '19', 0), -(20, 'Balfour', '20', 0), -(21, 'Bamfield', '21', 0), -(22, 'Barnston Island', '22', 0), -(23, 'Barriere', '23', 0), -(24, 'Bear Lake', '24', 0), -(25, 'Beaverdell', '25', 0), -(26, 'Bella Bella', '26', 0), -(27, 'Bella Coola', '27', 0), -(28, 'Big Bar Creek', '28', 0), -(29, 'Birch Island', '29', 0), -(30, 'Blue River', '30', 0), -(31, 'Bob Quinn Lake', '31', 0), -(32, 'Boston Bar', '32', 0), -(33, 'Boswell', '33', 0), -(34, 'Bowen Island', '34', 0), -(35, 'Bradner', '35', 0), -(36, 'Bridge Lake', '36', 0), -(37, 'Buick Creek', '37', 0), -(38, 'Burnaby', '38', 0), -(39, 'Burns Lake', '39', 0), -(40, 'Cache', '40', 0), -(41, 'Cache Creek', '41', 0), -(42, 'Campbell River', '42', 0), -(43, 'Cassiar', '43', 0), -(44, 'Cassidy', '44', 0), -(45, 'Castlegar', '45', 0), -(46, 'Cecil Lake', '46', 0), -(47, 'Central Saanich', '47', 0), -(48, 'Charlie Lake', '48', 0), -(49, 'Chase', '49', 0), -(50, 'Chemainus', '50', 0), -(51, 'Cherryville', '51', 0), -(52, 'Chetwynd', '52', 0), -(53, 'Chief Lake', '53', 0), -(54, 'Chilliwack', '54', 0), -(55, 'Clayhurst', '55', 0), -(56, 'Clearbrook', '56', 0), -(57, 'Clearwater', '57', 0), -(58, 'Clinton', '58', 0), -(59, 'Cloverdale', '59', 0), -(60, 'Coalmont', '60', 0), -(61, 'Cobble Hill', '61', 0), -(62, 'Coldwater Lakes', '62', 0), -(63, 'Colwood', '63', 0), -(64, 'Comox', '64', 0), -(65, 'Coquitlam', '65', 0), -(66, 'Cortes Island', '66', 0), -(67, 'Courtenay', '67', 0), -(68, 'Cowichan Bay', '68', 0), -(69, 'Cowichan Lake', '69', 0), -(70, 'Cranbrook', '70', 0), -(71, 'Crawford Bay', '71', 0), -(72, 'Creston', '72', 0), -(73, 'Cultus Lake', '73', 0), -(74, 'Cumberland', '74', 0), -(75, 'Dawson Creek', '75', 0), -(76, 'Dease Lake', '76', 0), -(77, 'Decker Lake', '77', 0), -(78, 'Delta', '78', 0), -(79, 'Denman Island', '79', 0), -(80, 'District Of Lake Country', '80', 0), -(81, 'Duncan', '81', 0), -(82, 'Edgewood', '82', 0), -(83, 'Elkford', '83', 0), -(84, 'Elko', '84', 0), -(85, 'Enderby', '85', 0), -(86, 'Errington', '86', 0), -(87, 'Esquimalt', '87', 0), -(88, 'Fairharbour', '88', 0), -(89, 'Falkland', '89', 0), -(90, 'Fauquier', '90', 0), -(91, 'Fernie', '91', 0), -(92, 'Field', '92', 0), -(93, 'Fort Fraser', '93', 0), -(94, 'Fort Nelson', '94', 0), -(95, 'Fort St. James', '95', 0), -(96, 'Fort St. John', '96', 0), -(97, 'Fort Ware', '97', 0), -(98, 'Francois Lake', '98', 0), -(99, 'Fraser Lake', '99', 0), -(100, 'Fruitvale', '100', 0), -(101, 'Gabriola Island', '101', 0), -(102, 'Galiano Island', '102', 0), -(103, 'Ganges', '103', 0), -(104, 'Garibaldi Highlands', '104', 0), -(105, 'Gibsons', '105', 0), -(106, 'Gillies Bay', '106', 0), -(107, 'Gold River', '107', 0), -(108, 'Goldbridge', '108', 0), -(109, 'Golden', '109', 0), -(110, 'Good Hope', '110', 0), -(111, 'Grand Forks', '111', 0), -(112, 'Granisle', '112', 0), -(113, 'Grassy Plains', '113', 0), -(114, 'Greenwood', '114', 0), -(115, 'Hagensborg', '115', 0), -(116, 'Hansard Creek', '116', 0), -(117, 'Harrison Hot Springs', '117', 0), -(118, 'Hartley Bay', '118', 0), -(119, 'Hazelton', '119', 0), -(120, 'Hixon', '120', 0), -(121, 'Holberg', '121', 0), -(122, 'Honeymoon Creek', '122', 0), -(123, 'Hope', '123', 0), -(124, 'Hornby Island', '124', 0), -(125, 'Horsefly', '125', 0), -(126, 'Houston', '126', 0), -(127, 'Hudson''s Hope', '127', 0), -(128, 'Hutda Lake', '128', 0), -(129, 'Invermere', '129', 0), -(130, 'Jade City', '130', 0), -(131, 'Jaffray', '131', 0), -(132, 'Jordan River', '132', 0), -(133, 'Juliet Pit', '133', 0), -(134, 'Kaleden', '134', 0), -(135, 'Kamloops', '135', 0), -(136, 'Kaslo', '136', 0), -(137, 'Kelowna', '137', 0), -(138, 'Keremeos', '138', 0), -(139, 'Kimberley', '139', 0), -(140, 'Kincolith', '140', 0), -(141, 'Kiskatinaw', '141', 0), -(142, 'Kitimat', '142', 0), -(143, 'Kitkatla', '143', 0), -(144, 'Kitwanga', '144', 0), -(145, 'Klemtu', '145', 0), -(146, 'Kyuquot', '146', 0), -(147, 'Ladner', '147', 0), -(148, 'Ladysmith', '148', 0), -(149, 'Langford', '149', 0), -(150, 'Langley', '150', 0), -(151, 'Lantzville', '151', 0), -(152, 'Lardeau', '152', 0), -(153, 'Lasqueti Island', '153', 0), -(154, 'Likely', '154', 0), -(155, 'Lillooet', '155', 0), -(156, 'Lions Bay', '156', 0), -(157, 'Little Fort', '157', 0), -(158, 'Logan Lake', '158', 0), -(159, 'Loon Creek', '159', 0), -(160, 'Lower Nicola Boston Bar', '160', 0), -(161, 'Lumby', '161', 0), -(162, 'Lytton', '162', 0), -(163, 'Mackenzie', '163', 0), -(164, 'Madeira Park', '164', 0), -(165, 'Mansons Landing', '165', 0), -(166, 'Maple Ridge', '166', 0), -(167, 'Marysville', '167', 0), -(168, 'Masset', '168', 0), -(169, 'Matsqui', '169', 0), -(170, 'Mayne Island', '170', 0), -(171, 'Mcbride', '171', 0), -(172, 'Mcleese Lake', '172', 0), -(173, 'Mclure', '173', 0), -(174, 'Meadow Creek', '174', 0), -(175, 'Merritt', '175', 0), -(176, 'Metchosin', '176', 0), -(177, 'Meziadin Lake', '177', 0), -(178, 'Midway', '178', 0), -(179, 'Mill Bay', '179', 0), -(180, 'Mission', '180', 0), -(181, 'Montney', '181', 0), -(182, 'Montrose', '182', 0), -(183, 'Mount Lemoray', '183', 0), -(184, 'Nakusp', '184', 0), -(185, 'Nanaimo', '185', 0), -(186, 'Nanoose Bay', '186', 0), -(187, 'Nazko', '187', 0), -(188, 'Nelson', '188', 0), -(189, 'New Aiyansh', '189', 0), -(190, 'New Denver', '190', 0), -(191, 'New Hazelton', '191', 0), -(192, 'New Westminster', '192', 0), -(193, 'North Delta', '193', 0), -(194, 'North Pender Island', '194', 0), -(195, 'North Saanich', '195', 0), -(196, 'North Vancouver', '196', 0), -(197, 'Oak Bay', '197', 0), -(198, 'Okanagan Falls', '198', 0), -(199, 'Oliver', '199', 0), -(200, 'Osoyoos', '200', 0), -(201, 'Oyama', '201', 0), -(202, 'Parksville', '202', 0), -(203, 'Peachland', '203', 0), -(204, 'Pemberton', '204', 0), -(205, 'Pender Island', '205', 0), -(206, 'Penticton', '206', 0), -(207, 'Pink Mountain', '207', 0), -(208, 'Pitt Meadows', '208', 0), -(209, 'Port Simpson', '209', 0), -(210, 'Port Alberni', '210', 0), -(211, 'Port Alice', '211', 0), -(212, 'Port Clements', '212', 0), -(213, 'Port Coquitlam', '213', 0), -(214, 'Port Hardy', '214', 0), -(215, 'Port Mcneill', '215', 0), -(216, 'Port Moody', '216', 0), -(217, 'Port Renfrew', '217', 0), -(218, 'Pouce Coupe', '218', 0), -(219, 'Powell River', '219', 0), -(220, 'Prince George', '220', 0), -(221, 'Prince Rupert', '221', 0), -(222, 'Princeton', '222', 0), -(223, 'Progress', '223', 0), -(224, 'Purden Lake', '224', 0), -(225, 'Quadra Island', '225', 0), -(226, 'Qualicum Bay', '226', 0), -(227, 'Qualicum Beach', '227', 0), -(228, 'Queen Charlotte', '228', 0), -(229, 'Quesnel', '229', 0), -(230, 'Rayleigh Corr Inst', '230', 0), -(231, 'Revelstoke', '231', 0), -(232, 'Richmond', '232', 0), -(233, 'Riondel', '233', 0), -(234, 'Riske Creek', '234', 0), -(235, 'Roberts Creek', '235', 0), -(236, 'Rock Creek', '236', 0), -(237, 'Rolla', '237', 0), -(238, 'Rose Prairie', '238', 0), -(239, 'Rosedale', '239', 0), -(240, 'Rossland', '240', 0), -(241, 'Rutland', '241', 0), -(242, 'Saanich', '242', 0), -(243, 'Saanichton', '243', 0), -(244, 'Salmo', '244', 0), -(245, 'Salmon Arm', '245', 0), -(246, 'Salmon Arm Tsey Key', '246', 0), -(247, 'Salmo Creston Summit', '247', 0), -(248, 'Salmon Arm Tsey Key', '248', 0), -(249, 'Saltspring Island', '249', 0), -(250, 'Salvus', '250', 0), -(251, 'Sandspit', '251', 0), -(252, 'Sardis', '252', 0), -(253, 'Saturna Island', '253', 0), -(254, 'Savona', '254', 0), -(255, 'Sayward', '255', 0), -(256, 'Scotch Creek', '256', 0), -(257, 'Sechelt', '257', 0), -(258, 'Seton Portage', '258', 0), -(259, 'Shawnigan Lake', '259', 0), -(260, 'Shelter Bay', '260', 0), -(261, 'Sicamous', '261', 0), -(262, 'Sidney', '262', 0), -(263, 'Silverton', '263', 0), -(264, 'Skidegate', '264', 0), -(265, 'Slim Creek', '265', 0), -(266, 'Smithers', '266', 0), -(267, 'Soda Creek', '267', 0), -(268, 'Sointula', '268', 0), -(269, 'Sooke', '269', 0), -(270, 'Southbank', '270', 0), -(271, 'Sparwood', '271', 0), -(272, 'Squamish', '272', 0), -(273, 'Stewart', '273', 0), -(274, 'Summerland', '274', 0), -(275, 'Surrey', '275', 0), -(276, 'Tachie', '276', 0), -(277, 'Tahsis', '277', 0), -(278, 'Takla', '278', 0), -(279, 'Tatla Lake', '279', 0), -(280, 'Tatogga Lake', '280', 0), -(281, 'Taylor', '281', 0), -(282, 'Telegraph Creek', '282', 0), -(283, 'Telkwa', '283', 0), -(284, 'Terrace', '284', 0), -(285, 'Tete Jaune', '285', 0), -(286, 'Texada Island', '286', 0), -(287, 'Thetis Island', '287', 0), -(288, 'Toad River', '288', 0), -(289, 'Tofino', '289', 0), -(290, 'Trail', '290', 0), -(291, 'Trout Lake', '291', 0), -(292, 'Tsay Keh Dene Old Goldstream Creek', '292', 0), -(293, 'Tumbler Ridge', '293', 0), -(294, 'Ucluelet', '294', 0), -(295, 'Usk', '295', 0), -(296, 'Valemount', '296', 0), -(297, 'Vancouver', '297', 0), -(298, 'Vanderhoof', '298', 0), -(299, 'Vernon', '299', 0), -(300, 'Victoria', '300', 0), -(301, 'View Royal', '301', 0), -(302, 'Waglisla', '302', 0), -(303, 'Wardner', '303', 0), -(304, 'Wells', '304', 0), -(305, 'West Kelowna', '305', 0), -(306, 'West Vancouver', '306', 0), -(307, 'Whistler', '307', 0), -(308, 'White Rock', '308', 0), -(309, 'Williams Lake', '309', 0), -(310, 'Winlaw', '310', 0), -(311, 'Woss', '311', 0), -(312, 'Yahk', '312', 0), -(313, 'Zeballos', '313', 0) - -SET IDENTITY_INSERT dbo.[Cities] OFF diff --git a/backend/dal/Migrations/Initial/Up/PostUp/01-Claims.sql b/backend/dal/Migrations/Initial/Up/PostUp/01-Claims.sql deleted file mode 100644 index 5f2f9d94de..0000000000 --- a/backend/dal/Migrations/Initial/Up/PostUp/01-Claims.sql +++ /dev/null @@ -1,96 +0,0 @@ -PRINT 'Adding Claims' -INSERT INTO - dbo.[Claims] ([Id], [Name], [Description], [IsDisabled]) -VALUES -( - 'fd86ddec-8f9d-4d7b-8c69-956062c5104f', - 'admin-users', - 'Ability to administrate users.', - 0 -), ( - '321e245b-ee7d-4d7c-83a8-56b5a9d33c2d', - 'admin-roles', - 'Ability to administrate roles.', - 0 -), ( - '71e74513-a036-4df3-b724-a8c349b7fc28', - 'admin-properties', - 'Ability to administrate properties.', - 0 -), ( - '9b556b3f-441f-4d11-9f6f-14d455df4e05', - 'admin-agencies', - 'Ability to administrate agencies.', - 0 -), ( - 'c46ccf94-4b3c-486f-b34c-9a707a54f357', - 'admin-projects', - 'Ability to administrate projects.', - 0 -), ( - '91fc8939-2dea-44a1-bd17-a1c8f0fe5dc1', - 'property-view', - 'Ability to view properties.', - 0 -), ( - '5fd96f19-abe1-47e7-8a54-0a707bc3e4a4', - 'property-add', - 'Ability to add properties.', - 0 -), ( - '223664c7-650c-40ac-8581-f40e10064537', - 'property-edit', - 'Ability to edit properties.', - 0 -), ( - '223664c7-650c-40ac-8581-f40e10164537', - 'property-delete', - 'Ability to delete properties.', - 0 -), ( - '41747042-ad4a-4511-858b-67ed70c8e7e9', - 'dispose-request', - 'Ability to request to dispose properties.', - 0 -), ( - 'd11ce982-f22b-4cd2-87d4-87b8f7f9a3c8', - 'dispose-approve', - 'Ability to approve disposal of a properties.', - 0 -), ( - '4dc0f39a-32f0-43a4-9d90-62fd94f20567', - 'sensitive-view', - 'Ability to view sensitive properties.', - 0 -), ( - '9e578c1f-1c60-4a5f-98b5-966b079a35e9', - 'project-view', - 'Ability to view projects.', - 0 -), ( - 'cbf68973-e239-41a9-be27-bf0ede3bf335', - 'project-add', - 'Ability to add projects.', - 0 -), ( - 'dbe02a47-34ec-48f9-9df5-3d959c46e174', - 'project-edit', - 'Ability to edit projects.', - 0 -), ( - 'd6e91b9c-9728-4e62-8d91-319af2701b9b', - 'project-delete', - 'Ability to delete projects.', - 0 -), ( - 'b9e1e966-d2aa-420f-83c4-617b984d1268', - 'system-administrator', - 'Ability to administrate system.', - 0 -), ( - '6efd16d4-41ca-4feb-86f5-7598691f7bc6', - 'agency-administrator', - 'Ability to administrate agencies.', - 0 -) - diff --git a/backend/dal/Migrations/Initial/Up/PostUp/01-NotificationTemplates.sql b/backend/dal/Migrations/Initial/Up/PostUp/01-NotificationTemplates.sql deleted file mode 100644 index 8052e99cf3..0000000000 --- a/backend/dal/Migrations/Initial/Up/PostUp/01-NotificationTemplates.sql +++ /dev/null @@ -1,1021 +0,0 @@ -PRINT 'Adding NotificationTemplates' - -SET IDENTITY_INSERT dbo.[NotificationTemplates] ON - -INSERT INTO dbo.[NotificationTemplates] ( - [Id] - , [Name] - , [Description] - , [IsDisabled] - , [To] - , [Cc] - , [Bcc] - , [Audience] - , [Encoding] - , [BodyType] - , [Priority] - , [Subject] - , [Body] - , [Tag] -) VALUES ( - 1 - , 'New Disposal Project Submitted' - , 'Inform SRES a new project has been submitted for assessment.' - , 0 - , 'RealPropertyDivision.Disposals@gov.bc.ca' - , '' - , '' - , 'Default' - , 'Utf8' - , 'Html' - , 'High' - , 'New Disposal Project Submitted - @Model.Project.ProjectNumber' - , ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is to advise that the following properties have been submitted to the Surplus Property Program to be reviewed as surplus by the current holder of the property and is requesting your review:

-

Property Inventory Management System - @Model.Project.ProjectNumber

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - var year = appraised != null ? appraised.Date.Year : assessed.Date.Year; - var value = appraised != null ? appraised.Value : assessed.Value; - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' - , 'SPP' -), ( - 2 - , 'Disposal Project Denied' - , 'Inform owning agency their disposal project was denied.' - , 0 - , '' - , '' - , '' - , 'OwningAgency' - , 'Utf8' - , 'Html' - , 'Normal' - , 'Disposal Project Denied - @Model.Project.ProjectNumber' - , '@Model.Environment.Title

Dear @Model.ToAgency.AddressTo,

Your project @Model.Project.ProjectNumber has been denied. Signin to PIMS to review the reason.

Sincerely Real Property Division

' - , 'SPP' -), ( - 3 - , 'Disposal Project Cancelled' - , 'Inform owning agency their disposal project was cancelled.' - , 0 - , '' - , '' - , '' - , 'OwningAgency' - , 'Utf8' - , 'Html' - , 'Normal' - , 'Disposal Project Cancelled - @Model.Project.ProjectNumber' - , '@Model.Environment.Title

Dear @Model.ToAgency.AddressTo,

Your project @Model.Project.ProjectNumber has been cancelled. Signin to PIMS to review the reason.

Sincerely Real Property Division

' - , 'SPP' -), ( - 4 - , 'Disposal Project Approved for ERP' - , 'Inform owning agency their project has been approved and properties will be added to ERP.' - , 0 - , '' - , '' - , '' - , 'OwningAgency' - , 'Utf8' - , 'Html' - , 'Normal' - , 'Disposal Project Approved for ERP - @Model.Project.ProjectNumber' - , '@Model.Environment.Title

Dear @Model.ToAgency.AddressTo,

Your project @Model.Project.ProjectNumber has been approved. Signin to PIMS to review the progress.

Sincerely Real Property Division

' - , 'ERP' -), ( - 5 - , 'New Properties on ERP' - , 'Inform agencies of new properties added to ERP.' - , 0 - , '' - , '' - , '' - , 'ParentAgencies' - , 'Utf8' - , 'Html' - , 'High' - , 'ACTION REQUIRED - Notification of Surplus Real Property' - , ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

Please forward this notification to any SUCH Sector Organization or BPS Entity that your ministry is responsible for to ensure any interest from Ministries or Agencies in the properties is identified.

-

Should there be no interest in the property detailed below from your Ministry or any SUCH Sector Organization or BPS Entity that your Ministry is responsible for, please respond to confirm.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with 90 days from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property. Reminder notifications will be sent at both 30 days and 60 days from this initial notification.

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' - , 'ERP' -), ( - 6 - , '30 day ERP notification - Owning Agency' - , 'ERP 30 expiration notification to inform owning agency of time remaining in ERP' - , 0 - , '' - , '' - , '' - , 'OwningAgency' - , 'Utf8' - , 'Html' - , 'Normal' - , 'Notification of Surplus Real Property - 30 Day Reminder Notification of Surplus Real Property' - , ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is a 30 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property have been identified as surplus is available for redeployment:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' - , 'ERP' -), ( - 7 - , '60 day ERP notification - Owning Agency' - , 'ERP 60 expiration notification to inform owning agency of time remaining in ERP' - , 0 - , '' - , '' - , '' - , 'OwningAgency' - , 'Utf8' - , 'Html' - , 'Normal' - , 'Notification of Surplus Real Property - 60 Day Reminder Notification of Surplus Real Property' - , ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is a 60 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property have been identified as surplus is available for redeployment:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' - , 'ERP' -), ( - 8 - , '90 day ERP notification - Owning Agency' - , 'ERP 90 expiration notification to inform owning agency ERP is complete.' - , 0 - , '' - , '' - , '' - , 'OwningAgency' - , 'Utf8' - , 'Html' - , 'Normal' - , 'Notification of Surplus Real Property - Completion of 90 Day Enhanced Referral Period for Notification of Surplus Real Property' - , ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is the 90 Day Completion Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property have been identified as surplus is available for redeployment:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' - , 'ERP' -), ( - 9 - , '30 day ERP notification - Parent Agencies' - , 'ERP 30 notification to inform agencies or properties available in ERP.' - , 0 - , '' - , '' - , '' - , 'ParentAgencies' - , 'Utf8' - , 'Html' - , 'High' - , 'ACTION REQUIRED - Notification of Surplus Real Property - 30 Day Reminder Notification of Surplus Real Property' - , ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is a 30 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

Please forward this notification to any SUCH Sector Organization or BPS Entity that your ministry is responsible for to ensure any interest from Ministries or Agencies in the properties is identified.

-

Should there be no interest in the property detailed below from your Ministry or any SUCH Sector Organization or BPS Entity that your Ministry is responsible for, please respond to confirm.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with 60 days from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property. An additional reminder notification will be sent 30 days before this internal listing expires.

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' - , 'ERP' -), ( - 10 - , '60 day ERP notification - Parent Agencies' - , 'ERP 60 notification to inform agencies or properties available in ERP.' - , 0 - , '' - , '' - , '' - , 'ParentAgencies' - , 'Utf8' - , 'Html' - , 'High' - , 'ACTION REQUIRED - Notification of Surplus Real Property - 60 Day Reminder Notification of Surplus Real Property' - , ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is a 60 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

Please forward this notification to any SUCH Sector Organization or BPS Entity that your ministry is responsible for to ensure any interest from Ministries or Agencies in the properties is identified.

-

Should there be no interest in the property detailed below from your Ministry or any SUCH Sector Organization or BPS Entity that your Ministry is responsible for, please respond to confirm.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with 30 days from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property.

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' - , 'ERP' -), ( - 11 - , '90 day ERP notification - Parent Agencies' - , 'ERP 90 expiration notification to inform agencies.' - , 0 - , '' - , '' - , '' - , 'ParentAgencies' - , 'Utf8' - , 'Html' - , 'High' - , 'ACTION REQUIRED - Notification of Surplus Real Property - Completion of 90 Day Enhanced Referral Period for Notification of Surplus Real Property' - , ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is to provide confirmation that the 90 Day Enhanced Referral Period as detailed in the initial Notification of Surplus Real Property below is now complete.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

Please forward this notification to any SUCH Sector Organization or BPS Entity that your ministry is responsible for to ensure any interest from Ministries or Agencies in the properties is identified.

-

Should there be no interest in the property detailed below from your Ministry or any SUCH Sector Organization or BPS Entity that your Ministry is responsible for, please respond to confirm.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

An Enhanced Referral Notification Letter will be sent to the owning Ministry / Agency at the end of the week advising of next steps in the process.

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' - , 'ERP' -), ( - 12 - , '30 day ERP notification - Purchasing Agencies' - , 'ERP 30 notification to inform purchasing agencies to submit business case.' - , 0 - , '' - , '' - , '' - , 'WatchingAgencies' - , 'Utf8' - , 'Html' - , 'Normal' - , 'ACTION REQUIRED - Notification of Surplus Real Property - 30 Day Reminder Notification of Surplus Real Property' - , ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is a 30 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with 60 days from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property.

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' - , 'ERP' -), ( - 13 - , '60 day ERP notification - Purchasing Agencies' - , 'ERP 60 notification to inform purchasing agencies to submit business case.' - , 0 - , '' - , '' - , '' - , 'WatchingAgencies' - , 'Utf8' - , 'Html' - , 'Normal' - , 'ACTION REQUIRED - Notification of Surplus Real Property - 60 Day Reminder Notification of Surplus Real Property' - , ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is a 60 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with 30 days from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property.

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' - , 'ERP' -), ( - 14 - , '90 day ERP notification - Purchasing Agencies' - , 'ERP 90 expiration notification to inform purchasing agencies to submit business case.' - , 0 - , '' - , '' - , '' - , 'WatchingAgencies' - , 'Utf8' - , 'Html' - , 'Normal' - , 'ACTION REQUIRED - Notification of Surplus Real Property - Completion of 90 Day Enhanced Referral Period for Notification of Surplus Real Property' - , ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is to provide confirmation that the 90 Day Enhanced Referral Period as detailed in the initial Notification of Surplus Real Property below is now complete.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with until the end of this week from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property.

-

An Enhanced Referral Notification Letter will be sent to the owning Ministry / Agency at the end of the week advising of next steps in the process.

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' - , 'ERP' -), ( - 15 - , 'Access Request' - , 'A new authenticated user has requested access.' - , 0 - , '' - , '' - , '' - , 'Default' - , 'Utf8' - , 'Html' - , 'High' - , 'PIMS - Access Request' - , ' -@Model.Environment.Title -

Dear Administrator,

@Model.AccessRequest.User.FirstName @Model.AccessRequest.User.LastName has submitted an access request to PIMS.

Signin and review their request.

' - , 'Access Request' -), ( - 16 - , 'Project Shared Note Changed' - , 'The shared note has been updated and the owning agency should be notified.' - , 0 - , '' - , '' - , '' - , 'Default' - , 'Utf8' - , 'Html' - , 'High' - , 'PIMS - Project Note Updated - @Model.Project.ProjectNumber' - , ' -@using System.Linq -@using Pims.Dal.Entities -@Model.Environment.Title -

Dear @Model.Project.Manager,

Your project @Model.Project.ProjectNumber has been updated with the following note;

@Model.Project.PublicNote

' - , 'SPP' -) - -SET IDENTITY_INSERT dbo.[NotificationTemplates] OFF - diff --git a/backend/dal/Migrations/Initial/Up/PostUp/01-ProjectNumbers.sql b/backend/dal/Migrations/Initial/Up/PostUp/01-ProjectNumbers.sql deleted file mode 100644 index fb6187f413..0000000000 --- a/backend/dal/Migrations/Initial/Up/PostUp/01-ProjectNumbers.sql +++ /dev/null @@ -1,3 +0,0 @@ -PRINT 'Set Identity Seed for ProjectNumbers' - -DBCC CHECKIDENT ([ProjectNumbers], RESEED, 10000) -- TODO: Provide configuration option diff --git a/backend/dal/Migrations/Initial/Up/PostUp/01-ProjectRisks.sql b/backend/dal/Migrations/Initial/Up/PostUp/01-ProjectRisks.sql deleted file mode 100644 index 6b58d8455e..0000000000 --- a/backend/dal/Migrations/Initial/Up/PostUp/01-ProjectRisks.sql +++ /dev/null @@ -1,43 +0,0 @@ -PRINT 'Adding ProjectRisks' - -SET IDENTITY_INSERT dbo.[ProjectRisks] ON - --- Parent Agencies. -INSERT INTO dbo.[ProjectRisks] ( - [Id] - , [Code] - , [Name] - , [Description] - , [IsDisabled] - , [SortOrder] -) VALUES ( - 1 - , 'COMP' - , 'Complete' - , '100% of the property value' - , 0 - , 1 -), ( - 2 - , 'GREEN' - , 'Green' - , '90% of the property value' - , 0 - , 2 -), ( - 3 - , 'YELLOW' - , 'Yellow' - , '50% of the property value' - , 0 - , 3 -), ( - 4 - , 'RED' - , 'Red' - , '0% of the property value' - , 0 - , 4 -) - -SET IDENTITY_INSERT dbo.[ProjectRisks] OFF diff --git a/backend/dal/Migrations/Initial/Up/PostUp/01-ProjectStatus.sql b/backend/dal/Migrations/Initial/Up/PostUp/01-ProjectStatus.sql deleted file mode 100644 index 5e561d6958..0000000000 --- a/backend/dal/Migrations/Initial/Up/PostUp/01-ProjectStatus.sql +++ /dev/null @@ -1,310 +0,0 @@ -PRINT 'Adding ProjectStatus' - -SET IDENTITY_INSERT dbo.[ProjectStatus] ON - -INSERT INTO dbo.[ProjectStatus] ( - [Id] - , [SortOrder] - , [Name] - , [GroupName] - , [Code] - , [IsTerminal] - , [IsDisabled] - , [Description] - , [Route] - , [IsMilestone] -) VALUES ( - 1 - , 0 - , 'Draft' - , 'Draft' - , 'DR' - , 0 - , 0 - , 'A new draft project that is not ready to submit to apply to be added to the Surplus Property Program.' - , '/projects/draft' - , 0 -), ( - 2 - , 1 - , 'Select Properties' - , 'Draft' - , 'DR-P' - , 0 - , 0 - , 'Add properties to the project.' - , '/projects/properties' - , 0 -), ( - 3 - , 2 - , 'Update Information' - , 'Draft' - , 'DR-I' - , 0 - , 0 - , 'Assign tier level, classification and update current financial information.' - , '/projects/information' - , 0 -), ( - 4 - , 3 - , 'Required Documentation' - , 'Draft' - , 'DR-D' - , 0 - , 0 - , 'Required documentation has been completed and sent (Surplus Declaration & Readiness Checklist, Triple Bottom Line).' - , '/projects/documentation' - , 0 -), ( - 5 - , 4 - , 'Approval' - , 'Draft' - , 'DR-A' - , 0 - , 0 - , 'The project is ready to be approved by owning agency.' - , '/projects/approval' - , 0 -), ( - 6 - , 5 - , 'Review' - , 'Draft' - , 'DR-RE' - , 0 - , 0 - , 'The project has been submitted for review to be added to the Surplus Property Program.' - , '/projects/review' - , 0 -), ( - 7 - , 6 - , 'Submitted' - , 'Submitted' - , 'AS-I' - , 0 - , 0 - , 'Submitted project property information review.' - , '/projects/assess/properties' - , 1 -), ( - 8 - , 6 - , 'Submitted Exemption' - , 'Submitted' - , 'AS-EXE' - , 0 - , 0 - , 'Project has been been submitted with a request for exemption.' - , '/projects/assess/properties' - , 1 -) - --- Assessment - -, ( - 10 - , 7 - , 'Document Review' - , 'Submitted' - , 'AS-D' - , 0 - , 0 - , 'Documentation reviewed (Surplus Declaration & Readiness Checklist, Triple Bottom Line).' - , '/projects/assess/documentation' - , 0 -), ( - 11 - , 8 - , 'Appraisal Review' - , 'Submitted' - , 'AS-AP' - , 0 - , 0 - , 'Appraisal review process.' - , '/projects/assess/appraisal' - , 0 -), ( - 12 - , 9 - , 'First Nation Consultation' - , 'Submitted' - , 'AS-FNC' - , 0 - , 0 - , 'First Nation Consultation process.' - , '/projects/assess/first/nation/consultation' - , 0 -), ( - 13 - , 10 - , 'Exemption Review' - , 'Submitted' - , 'AS-EXP' - , 0 - , 0 - , 'Process to approve ERP exemption.' - , 'projects/assess/exemption' - , 0 -), ( - 14 - , 11 - , 'Approved for ERP' - , 'Approved' - , 'AP-ERP' - , 0 - , 0 - , 'The project has been approved to be added to the Surplus Property Program - Enhanced Referral Program. This begins the 90 day internal marketing process.' - , '/projects/approved' - , 1 -), ( - 15 - , 11 - , 'Approved for Exemption' - , 'Approved' - , 'AP-EXE' - , 0 - , 0 - , 'Project has been approved for ERP exemption.' - , '/projects/approved' - , 1 -), ( - 16 - , 11 - , 'Denied' - , 'Closed' - , 'DE' - , 1 - , 0 - , 'The project has been denied to be added to the Surplus Property Program.' - , '/projects/denied' - , 1 -) - --- Exemption outcome --- ERP outcome - -, ( - 20 - , 21 - , 'Transferred within the GRE' - , 'Closed' - , 'T-GRE' - , 1 - , 0 - , 'The project has been transferred within the Greater Reporting Entity' - , '/projects/transferred' - , 1 -), ( - 21 - , 21 - , 'Approved for SPL' - , 'Approved' - , 'AP-SPL' - , 0 - , 0 - , 'The project has been approved to be added to the Surplus Property Program - Surplus Property List. This begins the external marketing process.' - , '/projects/approved' - , 1 -), ( - 22 - , 21 - , 'Not in SPL' - , 'Approved' - , 'AP-!SPL' - , 0 - , 0 - , 'The project has been approved to not be included in the Surplus Property Program - Surplus Property List. ' - , '/projects/approved' - , 1 -), ( - 23 - , 21 - , 'Cancelled' - , 'Closed' - , 'CA' - , 1 - , 0 - , 'The project has been cancelled from the Surplus Property Program.' - , '/projects/cancelled' - , 1 -) - --- ERP process - -, ( - 30 - , 1 - , 'In ERP' - , 'ERP' - , 'ERP-ON' - , 0 - , 0 - , 'The project has is in the Enhanced Referral Program.' - , '/projects/erp' - , 0 -), ( - 31 - , 2 - , 'On Hold' - , 'ERP' - , 'ERP-OH' - , 0 - , 0 - , 'The project has been put on hold due to potential sale to an interested party.' - , '/projects/onhold' - , 0 -), ( - 32 - , 21 - , 'Disposed' - , 'Complete' - , 'DIS' - , 1 - , 0 - , 'The project has been disposed externally.' - , '/projects/disposed' - , 1 -) - --- SPL process - -, ( - 40 - , 18 - , 'Pre-Marketing' - , 'Pre-Marketing' - , 'SPL-PM' - , 0 - , 0 - , 'The project is in the pre-marketing stage of the Surplus Property List.' - , '/projects/premarketing' - , 0 -), ( - 41 - , 19 - , 'On Market' - , 'Marketing' - , 'SPL-M' - , 0 - , 0 - , 'The project is in the marketing stage of the Surplus Property List.' - , '/projects/premarketing' - , 0 -), ( - 42 - , 20 - , 'Contract in Place' - , 'Contract in Place' - , 'SPL-CIP' - , 0 - , 0 - , 'The project has received an offer either conditional or unconditional.' - , '/projects/contractinplace' - , 0 -) - -SET IDENTITY_INSERT dbo.[ProjectStatus] OFF diff --git a/backend/dal/Migrations/Initial/Up/PostUp/01-PropertyClassifications.sql b/backend/dal/Migrations/Initial/Up/PostUp/01-PropertyClassifications.sql deleted file mode 100644 index 36d9bda879..0000000000 --- a/backend/dal/Migrations/Initial/Up/PostUp/01-PropertyClassifications.sql +++ /dev/null @@ -1,39 +0,0 @@ -PRINT 'Adding PropertyClassifications' - -INSERT INTO dbo.[PropertyClassifications] ( - [Id] - , [Name] - , [IsDisabled] - , [IsVisible] - , [SortOrder] -) VALUES ( - 0 - , 'Core Operational' - , 0 - , 1 - , 1 -), ( - 1 - , 'Core Strategic' - , 0 - , 1 - , 2 -), ( - 2 - , 'Surplus Active' - , 0 - , 1 - , 3 -), ( - 3 - , 'Surplus Encumbered' - , 0 - , 1 - , 4 -), ( - 4 - , 'Disposed' - , 0 - , 0 - , 5 -) diff --git a/backend/dal/Migrations/Initial/Up/PostUp/01-PropertyTypes.sql b/backend/dal/Migrations/Initial/Up/PostUp/01-PropertyTypes.sql deleted file mode 100644 index 238980c13c..0000000000 --- a/backend/dal/Migrations/Initial/Up/PostUp/01-PropertyTypes.sql +++ /dev/null @@ -1,15 +0,0 @@ -PRINT 'Adding PropertyTypes' - -INSERT INTO dbo.[PropertyTypes] ( - [Id] - , [Name] - , [IsDisabled] -) VALUES ( - 0 - , 'Land' - , 0 -), ( - 1 - , 'Building' - , 0 -) diff --git a/backend/dal/Migrations/Initial/Up/PostUp/01-Provinces.sql b/backend/dal/Migrations/Initial/Up/PostUp/01-Provinces.sql deleted file mode 100644 index e604775821..0000000000 --- a/backend/dal/Migrations/Initial/Up/PostUp/01-Provinces.sql +++ /dev/null @@ -1,12 +0,0 @@ -PRINT 'Adding Provinces' - -INSERT INTO dbo.[Provinces] ( - [Id] - , [Name] -) VALUES ( - 'ON' - , 'Ontario' -), ( - 'BC' - , 'British Columbia' -) diff --git a/backend/dal/Migrations/Initial/Up/PostUp/01-Roles.sql b/backend/dal/Migrations/Initial/Up/PostUp/01-Roles.sql deleted file mode 100644 index 29854a7ce9..0000000000 --- a/backend/dal/Migrations/Initial/Up/PostUp/01-Roles.sql +++ /dev/null @@ -1,75 +0,0 @@ -PRINT 'Adding Roles' -INSERT INTO - dbo.[Roles] ( - [Id], - [Name], - [Description], - [IsPublic], - [IsDisabled], - [SortOrder] - ) -VALUES - ( - 'bbf27108-a0dc-4782-8025-7af7af711335', - 'System Administrator', - 'System Administrator of the PIMS solution.', - 0, - 0, - 0 - ), - ( - '6ae8448d-5f0a-4607-803a-df0bc4efdc0f', - 'Agency Administrator', - 'Agency Administrator of the users agency.', - 0, - 0, - 0 - ), - ( - 'aad8c03d-892c-4cc3-b992-5b41c4f2392c', - 'Real Estate Manager', - 'Real Estate Manager can manage properties within their agencies.', - 1, - 0, - 0 - ), - ( - '7a7b2549-ae85-4ad6-a8d3-3a5f8d4f9ca5', - 'Real Estate Analyst', - 'Real Estate Analyst can manage properties within their agencies.', - 1, - 0, - 0 - ), - ( - 'fbe5fc86-f69e-4610-a746-0113d29e04cd', - 'Assistant Deputy Minister', - 'Assistant Deputy Minister can manage properties within their agencies.', - 1, - 0, - 0 - ), - ( - 'c9fb2167-d675-455f-96ff-fb0c416246aa', - 'Assistant Deputy Minister Assistant', - 'Assistant Deputy Minister Assistant can manage properties within their agencies.', - 1, - 0, - 0 - ), - ( - '6cdfeb00-6f67-4457-b46a-85bbbc97066c', - 'Executive Director', - 'Executive Director can manage properties within their agencies.', - 1, - 0, - 0 - ), - ( - '08c52eec-6917-4512-ac02-7d7ff89ed7a6', - 'SRES', - 'SRES group provides a way to add additional claims to users (i.e. property-delete).', - 0, - 0, - 0 - ) diff --git a/backend/dal/Migrations/Initial/Up/PostUp/01-Tasks.sql b/backend/dal/Migrations/Initial/Up/PostUp/01-Tasks.sql deleted file mode 100644 index 80c31fad6e..0000000000 --- a/backend/dal/Migrations/Initial/Up/PostUp/01-Tasks.sql +++ /dev/null @@ -1,151 +0,0 @@ -PRINT 'Adding Tasks' - -SET IDENTITY_INSERT dbo.[Tasks] ON - -INSERT INTO dbo.[Tasks] ( - [Id] - , [Name] - , [IsDisabled] - , [Description] - , [StatusId] - , [IsOptional] - , [SortOrder] -) VALUES ( - 1 - , 'Surplus Declaration & Readiness Checklist completed and sent' - , 0 - , 'Surplus Declaration & Readiness Checklist document emailed to SRES.' - , 4 - , 0 - , 1 -), ( - 2 - , 'Triple Bottom Line completed and sent' - , 0 - , 'Triple Bottom Line document emailed to SRES OR Project is in Tier 1.' - , 4 - , 0 - , 2 -), ( - 3 - , 'Review completed' - , 0 - , 'Project property information has been reviewed' - , 7 - , 0 - , 0 -), ( - 4 - , 'Review completed' - , 0 - , 'Project property information has been reviewed' - , 8 - , 0 - , 0 -), ( - 5 - , 'Documents received and review completed' - , 0 - , 'Documents have been received, reviewed and approved.' - , 10 - , 0 - , 0 -), ( - 6 - , 'Appraisal ordered' - , 0 - , 'An appraisal has been ordered.' - , 11 - , 1 - , 1 -), ( - 7 - , 'Appraisal received' - , 0 - , 'An appraisal has been received.' - , 11 - , 1 - , 2 -), ( - 8 - , 'Appraisal completed' - , 0 - , 'An appraisal has been reviewed and completed.' - , 11 - , 1 - , 3 -), ( - 9 - , 'Preparation and due diligence' - , 0 - , 'First Nations consultation preparation and due diligence.' - , 12 - , 1 - , 1 -), ( - 10 - , 'Consultation underway' - , 0 - , 'First Nations consultation is underway.' - , 12 - , 1 - , 2 -), ( - 11 - , 'Consultation complete' - , 0 - , 'First Nations consultation is complete.' - , 12 - , 1 - , 3 -), ( - 12 - , 'Notification to confirm exemption request sent to agency ADM' - , 0 - , 'ADM has been notified of request for exemption' - , 13 - , 0 - , 1 -), ( - 13 - , 'Confirmation has been received from agency ADM' - , 0 - , 'ADM has confirmed request for exemption' - , 13 - , 0 - , 2 -), ( - 14 - , 'Appraisal ordered' - , 0 - , 'An appraisal has been ordered.' - , 32 --Disposed - , 0 - , 1 -), ( - 15 - , 'Appraisal received' - , 0 - , 'An appraisal has been received.' - , 32 --Disposed - , 0 - , 2 -), ( - 16 - , 'Appraisal completed' - , 0 - , 'An appraisal has been reviewed and completed.' - , 32 --Disposed - , 0 - , 3 -), ( - 17 - , 'Bid Rigging, Collusion and Bias' - , 0 - , 'I confirm I have reviewed the offer and to the best of my knowledge confirm there is no identifiable opportunity for bid rigging, collusion and bias' - , 42 --Contract in Place - , 0 - , 4 -) - -SET IDENTITY_INSERT dbo.[Tasks] OFF diff --git a/backend/dal/Migrations/Initial/Up/PostUp/01-TierLevels.sql b/backend/dal/Migrations/Initial/Up/PostUp/01-TierLevels.sql deleted file mode 100644 index 710b1c0aa6..0000000000 --- a/backend/dal/Migrations/Initial/Up/PostUp/01-TierLevels.sql +++ /dev/null @@ -1,38 +0,0 @@ -PRINT 'Adding TierLevels' - -SET IDENTITY_INSERT dbo.[TierLevels] ON - -INSERT INTO dbo.[TierLevels] ( - [Id] - , [Name] - , [IsDisabled] - , [Description] - , [SortOrder] -) VALUES ( - 1 - , 'Tier 1' - , 0 - , 'Properties with a net value of less than $1M.' - , 1 -), ( - 2 - , 'Tier 2' - , 0 - , 'Properties with a net value of $1M or more and less than $10M' - , 2 -), ( - 3 - , 'Tier 3' - , 0 - , 'Properties from a single parcels with a net value of $10M or more' - , 3 -) -, ( - 4 - , 'Tier 4' - , 0 - , 'Properties from multiple parcels with a cumulative net value of $10M or more' - , 4 -) - -SET IDENTITY_INSERT dbo.[TierLevels] OFF diff --git a/backend/dal/Migrations/Initial/Up/PostUp/01-Users.sql b/backend/dal/Migrations/Initial/Up/PostUp/01-Users.sql deleted file mode 100644 index 5663d541dc..0000000000 --- a/backend/dal/Migrations/Initial/Up/PostUp/01-Users.sql +++ /dev/null @@ -1,21 +0,0 @@ -PRINT 'Adding Users' - -INSERT INTO dbo.[Users] ( - [Id] - , [Username] - , [DisplayName] - , [FirstName] - , [LastName] - , [Email] - , [IsDisabled] - , [IsSystem] -) VALUES ( - '00000000-0000-0000-0000-000000000000' - , 'system' - , 'system' - , 'system' - , 'system' - , 'pims@Pims.gov.bc.ca' - , 1 - , 1 -) diff --git a/backend/dal/Migrations/Initial/Up/PostUp/01-ViewProperties.sql b/backend/dal/Migrations/Initial/Up/PostUp/01-ViewProperties.sql deleted file mode 100644 index fe297019fc..0000000000 --- a/backend/dal/Migrations/Initial/Up/PostUp/01-ViewProperties.sql +++ /dev/null @@ -1,223 +0,0 @@ -PRINT 'Creating View_Properties' -GO --- This script provides a way to union both parcels and buildings into a single result of properties. -CREATE VIEW dbo.[View_Properties] AS -SELECT - p.[Id] - , [PropertyTypeId] = 0 - , p.[ClassificationId] - , [Classification] = c.[Name] - , p.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , p.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [City] = ac.[Name] - , [Province] = ap.[Name] - , adr.[Postal] - , p.[ProjectNumber] - , p.[Name] - , p.[Description] - , p.[Latitude] - , p.[Longitude] - , p.[IsSensitive] - , p.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , p.[PID] - , p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Municipality] = p.[Municipality] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [LocalId] = null - , [ParcelId] = null - , [BuildingConstructionTypeId] = 0 - , BuildingConstructionType = null - , [BuildingFloorCount] = 0 - , [BuildingPredominateUseId] = 0 - , BuildingPredominateUse = null - , [BuildingOccupantTypeId] = 0 - , BuildingOccupantType = null - , [BuildingTenancy] = null - , [RentableArea] = 0 - , [LeaseExpiry] = null - , [OccupantName] = null - , [TransferLeaseOnSale] = CAST(0 AS BIT) - - , [Assessed] = ISNULL(eas.[Value], 0) - , [AssessedDate] = eas.[Date] - , [Appraised] = ISNULL(eap.[Value], 0) - , [AppraisedDate] = eap.[Date] - , [Estimated] = ISNULL(fe.[Value], 0) - , [EstimatedFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] -FROM dbo.[Parcels] p -JOIN dbo.[PropertyClassifications] c ON p.[ClassificationId] = c.[Id] -JOIN dbo.[Agencies] a ON p.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON p.[AddressId] = adr.[Id] -JOIN dbo.[Cities] ac ON adr.[CityId] = ac.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- [Assessed] - ORDER BY [Date] DESC -) AS eas -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 1 -- Appraised - ORDER BY [Date] DESC -) AS eap -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 1 -- Estimated - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn -UNION -SELECT - b.[Id] - , [PropertyTypeId] = 1 - , b.[ClassificationId] - , [Classification] = c.[Name] - , b.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , b.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [City] = ac.[Name] - , [Province] = ap.[Name] - , adr.[Postal] - , b.[ProjectNumber] - , b.[Name] - , b.[Description] - , b.[Latitude] - , b.[Longitude] - , b.[IsSensitive] - , b.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , [PID] = p.[PID] - , [PIN] = p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Municipality] = p.[Municipality] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [LocalId] = b.[LocalId] - , [ParcelId] = b.[ParcelId] - , [BuildingConstructionTypeId] = b.[BuildingConstructionTypeId] - , BuildingConstructionType = bct.[Name] - , [BuildingFloorCount] = b.[BuildingFloorCount] - , [BuildingPredominateUseId] = b.[BuildingPredominateUseId] - , BuildingPredominateUse = bpu.[Name] - , [BuildingOccupantTypeId] = b.[BuildingOccupantTypeId] - , BuildingOccupantType = bot.[Name] - , [BuildingTenancy] = b.[BuildingTenancy] - , [RentableArea] = b.[RentableArea] - , [LeaseExpiry] = b.[LeaseExpiry] - , [OccupantName] = b.[OccupantName] - , [TransferLeaseOnSale] = b.[TransferLeaseOnSale] - - , [Assessed] = ISNULL(eas.[Value], 0) - , [AssessedDate] = eas.[Date] - , [Appraised] = ISNULL(eap.[Value], 0) - , [AppraisedDate] = eap.[Date] - , [Estimated] = ISNULL(fe.[Value], 0) - , [EstimatedFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] -FROM dbo.[Buildings] b -JOIN dbo.[Parcels] p ON b.[ParcelId] = p.[Id] -JOIN dbo.[PropertyClassifications] c ON b.[ClassificationId] = c.[Id] -JOIN dbo.[Agencies] a ON b.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON b.[AddressId] = adr.[Id] -JOIN dbo.[Cities] ac ON adr.[CityId] = ac.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -JOIN dbo.[BuildingConstructionTypes] bct ON b.[BuildingConstructionTypeId] = bct.[Id] -JOIN dbo.[BuildingOccupantTypes] bot ON b.[BuildingOccupantTypeId] = bot.[Id] -JOIN dbo.[BuildingPredominateUses] bpu ON b.[BuildingPredominateUseId] = bpu.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[BuildingEvaluations] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- [Assessed] - ORDER BY [Date] DESC -) AS eas -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[BuildingEvaluations] - WHERE [BuildingId] = b.[Id] - AND [Key] = 1 -- Appraised - ORDER BY [Date] DESC -) AS eap -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 1 -- Estimated - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn diff --git a/backend/dal/Migrations/Initial/Up/PostUp/01-Workflow.sql b/backend/dal/Migrations/Initial/Up/PostUp/01-Workflow.sql deleted file mode 100644 index f286936c0f..0000000000 --- a/backend/dal/Migrations/Initial/Up/PostUp/01-Workflow.sql +++ /dev/null @@ -1,56 +0,0 @@ -PRINT 'Adding Workflows' - -SET IDENTITY_INSERT dbo.[Workflows] ON - -INSERT INTO dbo.[Workflows] ( - [Id] - , [Name] - , [Code] - , [IsDisabled] - , [Description] - , [SortOrder] -) VALUES ( - 1 - , 'Submit Surplus Property Process Project' - , 'SUBMIT-DISPOSAL' - , 0 - , 'Create a new Surplus Property Process Project to add properties to the Enhanced Referral Program or the Surplus Property List.' - , 0 -), ( - 2 - , 'Assess Surplus Property Process Project Request' - , 'ASSESS-DISPOSAL' - , 0 - , 'Assess a submitted Surplus Property Process Project to determine whether it will be approved or denied.' - , 1 -), ( - 3 - , 'Assess Enhanced Referral Process Exemption' - , 'ASSESS-EXEMPTION' - , 0 - , 'Assess a requested ERP exemption.' - , 2 -), ( - 4 - , 'Assess Enhanced Referral Process Exemption Project Request' - , 'ASSESS-EX-DISPOSAL' - , 0 - , 'Assess a submitted Surplus Property Process Project to determine whether it will be approved or denied.' - , 3 -), ( - 5 - , 'Enhanced Referral Program' - , 'ERP' - , 0 - , 'Internal marketing for 90 days.' - , 4 -), ( - 6 - , 'Surplus Property List' - , 'SPL' - , 0 - , 'External marketing.' - , 5 -) - -SET IDENTITY_INSERT dbo.[Workflows] OFF diff --git a/backend/dal/Migrations/Initial/Up/PostUp/01-WorkflowProjectStatus.sql b/backend/dal/Migrations/Initial/Up/PostUp/01-WorkflowProjectStatus.sql deleted file mode 100644 index 788551db85..0000000000 --- a/backend/dal/Migrations/Initial/Up/PostUp/01-WorkflowProjectStatus.sql +++ /dev/null @@ -1,203 +0,0 @@ -PRINT 'Adding WorkflowProjectStatus' - -INSERT INTO dbo.[WorkflowProjectStatus] ( - [WorkflowId] - , [StatusId] - , [IsOptional] - , [SortOrder] -) VALUES ( - 1 -- SUBMIT-DISPOSAL - , 1 -- Draft, - , 0 - , 0 -), ( - 1 -- SUBMIT-DISPOSAL - , 2 -- Select Properties - , 0 - , 1 -), ( - 1 -- SUBMIT-DISPOSAL - , 3 -- Update Information - , 0 - , 2 -), ( - 1 -- SUBMIT-DISPOSAL - , 4 -- Required Documentation - , 0 - , 3 -), ( - 1 -- SUBMIT-DISPOSAL - , 5 -- Approval - , 0 - , 4 -), ( - 1 -- SUBMIT-DISPOSAL - , 6 -- Review - , 0 - , 5 -) - --- Disposal Assessment - -, ( - 2 -- ASSESS-DISPOSAL - , 7 -- Submitted - , 0 - , 0 -), ( - 2 -- ASSESS-DISPOSAL - , 10 -- Document Review - , 0 - , 1 -), ( - 2 -- ASSESS-DISPOSAL - , 11 -- Appraisal Review - , 0 - , 2 -), ( - 2 -- ASSESS-DISPOSAL - , 12 -- First Nation Consultation - , 0 - , 3 -), ( - 2 -- ASSESS-DISPOSAL - , 16 -- Denied - , 1 - , 4 -) - --- Exemption Assessment - -, ( - 3 -- ASSESS-EXEMPTION - , 8 -- Submitted Exemption - , 0 - , 0 -), ( - 3 -- ASSESS-EXEMPTION - , 10 -- Document Review - , 0 - , 1 -), ( - 3 -- ASSESS-EXEMPTION - , 11 -- Appraisal Review - , 0 - , 2 -), ( - 3 -- ASSESS-EXEMPTION - , 12 -- First Nation Consultation - , 0 - , 3 -), ( - 3 -- ASSESS-EXEMPTION - , 13 -- Exemption Review - , 0 - , 4 -), ( - 3 -- ASSESS-EXEMPTION - , 16 -- Denied - , 1 - , 5 -) - --- Exemption Disposal Assessment - -, ( - 4 -- ASSESS-EX-DISPOSAL - , 15 -- Approved for Exemption - , 0 - , 1 -), ( - 4 -- ASSESS-EX-DISPOSAL - , 20 -- Transferred within GRE - , 1 - , 2 -), ( - 4 -- ASSESS-EX-DISPOSAL - , 22 -- Not in SPL - , 1 - , 2 -), ( - 4 -- ASSESS-EX-DISPOSAL - , 23 -- Cancelled - , 1 - , 2 -), ( - 4 -- ASSESS-EX-DISPOSAL - , 32 -- Disposed - , 1 - , 3 -) - --- ERP - -, ( - 5 -- ERP - , 14 -- Approved for ERP - , 0 - , 1 -), ( - 5 -- ERP - , 30 -- In ERP - , 0 - , 2 -), ( - 5 -- ERP - , 31 -- On Hold - , 0 - , 3 -), ( - 5 -- ERP - , 20 -- Transferred within GRE - , 1 - , 4 -), ( - 5 -- ERP - , 22 -- Not in SPL - , 1 - , 4 -), ( - 5 -- ERP - , 32 -- Disposed - , 1 - , 5 -), ( - 5 -- ERP - , 23 -- Cancelled - , 1 - , 4 -) - --- SPL - -, ( - 6 -- SPL - , 21 -- Approved for SPL - , 0 - , 1 -), ( - 6 -- SPL - , 40 -- Pre-Marketing - , 0 - , 2 -), ( - 6 -- SPL - , 41 -- Marketing - , 0 - , 3 -), ( - 6 -- SPL - , 42 -- Contract in Place - , 0 - , 4 -), ( - 6 -- SPL - , 32 -- Disposed - , 1 - , 5 -), ( - 6 -- SPL - , 23 -- Cancelled - , 1 - , 5 -) diff --git a/backend/dal/Migrations/Initial/Up/PostUp/02-ProjectStatusNotifications.sql b/backend/dal/Migrations/Initial/Up/PostUp/02-ProjectStatusNotifications.sql deleted file mode 100644 index e364fa0ab1..0000000000 --- a/backend/dal/Migrations/Initial/Up/PostUp/02-ProjectStatusNotifications.sql +++ /dev/null @@ -1,118 +0,0 @@ -PRINT 'Adding ProjectStatusNotifications' - -INSERT INTO dbo.[ProjectStatusNotifications] - ( - [TemplateId] - , [FromStatusId] - , [ToStatusId] - , [Priority] - , [Delay] - , [DelayDays] - ) -VALUES -( - 1 -- New Disposal Project Submitted - , 6 - , 7 - , 2 - , 0 - , 0 -), ( - 1 -- New Disposal Project Submitted with Exemption - , 6 - , 8 - , 2 - , 0 - , 0 -), ( - 2 -- Disposal Project Denied - , NULL - , 16 - , 1 - , 0 - , 0 -), ( - 3 -- Disposal Project Cancelled - , NULL - , 23 - , 1 - , 0 - , 0 -), ( - 4 -- Disposal Project Approved for ERP - , NULL - , 14 - , 1 - , 0 - , 0 -), ( - 5 -- New Properties on ERP - , NULL - , 14 - , 2 - , 0 - , 0 -), ( - 6 -- 30 day ERP notification - Owning Agency - , NULL - , 14 - , 1 - , 3 - , 30 -), ( - 7 -- 60 day ERP notification - Owning Agency - , NULL - , 14 - , 1 - , 3 - , 60 -), ( - 8 -- 90 day ERP notification - Owning Agency - , NULL - , 14 - , 1 - , 3 - , 90 -), ( - 9 -- 30 day ERP notification - Parent Agencies - , NULL - , 14 - , 2 - , 3 - , 30 -), ( - 10 -- 60 day ERP notification - Parent Agencies - , NULL - , 14 - , 2 - , 3 - , 60 -), ( - 11 -- 90 day ERP notification - Parent Agencies - , NULL - , 14 - , 2 - , 3 - , 90 -), ( - 12 -- 30 day ERP notification - Watching Agencies - , NULL - , 14 - , 2 - , 3 - , 30 -), ( - 13 -- 60 day ERP notification - Watching Agencies - , NULL - , 14 - , 2 - , 3 - , 60 -), ( - 14 -- 90 day ERP notification - Watching Agencies - , NULL - , 14 - , 2 - , 3 - , 90 -) diff --git a/backend/dal/Migrations/Initial/Up/PostUp/02-ProjectStatusTransitions.sql b/backend/dal/Migrations/Initial/Up/PostUp/02-ProjectStatusTransitions.sql deleted file mode 100644 index 47f06d610b..0000000000 --- a/backend/dal/Migrations/Initial/Up/PostUp/02-ProjectStatusTransitions.sql +++ /dev/null @@ -1,414 +0,0 @@ -PRINT 'Adding ProjectStatusTransitions' - -INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [Action] - , [ToWorkflowId] - , [ToStatusId] - , [ValidateTasks] -) VALUES ( - 1 -- SUBMIT-DISPOSAL - , 1 -- Draft - , 'Select Properties' - , 1 -- SUBMIT-DISPOSAL - , 2 -- Select Properties - , 1 -), ( - 1 -- SUBMIT-DISPOSAL - , 2 -- Select Properties - , 'Update Information' - , 1 -- SUBMIT-DISPOSAL - , 3 -- Update Information - , 1 -), ( - 1 -- SUBMIT-DISPOSAL - , 3 -- Update Information - , 'Provide Documentation' - , 1 -- SUBMIT-DISPOSAL - , 4 -- Required Documentation - , 1 -), ( - 1 -- SUBMIT-DISPOSAL - , 4 -- Required Documentation - , 'Gain Approval' - , 1 -- SUBMIT-DISPOSAL - , 5 -- Approval - , 1 -), ( - 1 -- SUBMIT-DISPOSAL - , 5 -- Approval - , 'Review' - , 1 -- SUBMIT-DISPOSAL - , 6 -- Review - , 1 -), ( - 1 -- SUBMIT-DISPOSAL - , 6 -- Review - , 'Submit' - , 2 -- ASSESS-DISPOSAL - , 7 -- Submitted - , 1 -),( - 1 -- SUBMIT-DISPOSAL - , 6 -- Review - , 'Submit with Exemption' - , 3 -- ASSESS-EXEMPTION - , 8 -- Submitted with Exemption - , 1 -) - --- Disposal Assessment - -, ( - 2 -- ASSESS-DISPOSAL - , 7 -- Submitted - , 'Review Documentation' - , 2 -- ASSESS-DISPOSAL - , 10 -- Document Review - , 1 -), ( - 2 -- ASSESS-DISPOSAL - , 7 -- Submitted - , 'Review Appraisal' - , 2 -- ASSESS-DISPOSAL - , 11 -- Appraisal Review - , 1 -), ( - 2 -- ASSESS-DISPOSAL - , 7 -- Submitted - , 'Begin First Nation Consultation' - , 2 -- ASSESS-DISPOSAL - , 12 -- First Nation Consultation - , 1 -), ( - 2 -- ASSESS-DISPOSAL - , 7 -- Submitted - , 'Approve for ERP' - , 5 -- ERP - , 14 -- Approved for ERP - , 1 -), ( - 2 -- ASSESS-DISPOSAL - , 7 -- Submitted - , 'Deny' - , 2 -- ASSESS-DISPOSAL - , 16 -- Denied - , 0 -), ( - 2 -- ASSESS-DISPOSAL - , 10 -- Document Review - , 'Review Appraisal' - , 2 -- ASSESS-DISPOSAL - , 11 -- Appraisal Review - , 1 -), ( - 2 -- ASSESS-DISPOSAL - , 11 -- Appraisal Review - , 'Begin First Nation Consultation' - , 2 -- ASSESS-DISPOSAL - , 12 -- First Nation Consultation - , 1 -), ( - 2 -- ASSESS-DISPOSAL - , 12 -- First Nation Consultation - , 'Approve for ERP' - , 5 -- ERP - , 14 -- Approved for ERP - , 1 -), ( - 2 -- ASSESS-DISPOSAL - , 12 -- First Nation Consultation - , 'Deny' - , 2 -- ASSESS-DISPOSAL - , 16 -- Denied - , 0 -) - ----- Exemption Assessment - -, ( - 3 -- ASSESS-EXEMPTION - , 8 -- Submitted with Exemption - , 'Review Documentation' - , 3 -- ASSESS-EXEMPTION - , 10 -- Document Review - , 1 -), ( - 3 -- ASSESS-EXEMPTION - , 8 -- Submitted with Exemption - , 'Review Appraisal' - , 3 -- ASSESS-EXEMPTION - , 11 -- Appraisal Review - , 1 -), ( - 3 -- ASSESS-EXEMPTION - , 8 -- Submitted with Exemption - , 'Begin First Nation Consultation' - , 3 -- ASSESS-EXEMPTION - , 12 -- First Nation Consultation - , 1 -), ( - 3 -- ASSESS-EXEMPTION - , 8 -- Submitted with Exemption - , 'Review Exemption' - , 3 -- ASSESS-EXEMPTION - , 13 -- Examption Review - , 1 -), ( - 3 -- ASSESS-EXEMPTION - , 8 -- Submitted with Exemption - , 'Approve Exemption' - , 4 -- ASSESS-EX-DISPOSAL - , 15 -- Approved for Exemption - , 1 -), ( - 3 -- ASSESS-EXEMPTION - , 8 -- Submitted with Exemption - , 'Deny Exemption' - , 3 -- ASSESS-EXEMPTION - , 16 -- Denied - , 0 -) - -, ( - 3 -- ASSESS-EXEMPTION - , 10 -- Document Review - , 'Review Appraisal' - , 3 -- ASSESS-EXEMPTION - , 11 -- Appraisal Review - , 1 -), ( - 3 -- ASSESS-EXEMPTION - , 11 -- Appraisal Review - , 'Begin First Nation Consulation' - , 3 -- ASSESS-EXEMPTION - , 12 -- First Nation Consultation - , 1 -), ( - 3 -- ASSESS-EXEMPTION - , 12 -- First Nation Consultation - , 'Review Exemption' - , 3 -- ASSESS-EXEMPTION - , 13 -- Exemption Review - , 1 -), ( - 3 -- ASSESS-EXEMPTION - , 13 -- Exemption Review - , 'Approve Exemption' - , 4 -- ASSESS-EX-DISPOSAL - , 15 -- Approved for Exemption - , 1 -), ( - 3 -- ASSESS-EXEMPTION - , 13 -- Exemption Review - , 'Deny Exemption' - , 3 -- ASSESS-EXEMPTION - , 16 -- Denied - , 0 -) - ----- Disposal Exemption Assessment ----- When an exemption is approved the request still needs to be reviewed and assessed. - -, ( - 4 -- ASSESS-EX-DISPOSAL - , 15 -- Approved for Exemption - , 'Transfer within GRE' - , 4 -- ASSESS-EX-DISPOSAL - , 20 -- Transferred within GRE - , 1 -), ( - 4 -- ASSESS-EX-DISPOSAL - , 15 -- Approved for Exemption - , 'Approve for SPL' - , 6 -- SPL - , 21 -- Approved for SPL - , 1 -), ( - 4 -- ASSESS-EX-DISPOSAL - , 15 -- Approved for Exemption - , 'Approve to not include in SPL' - , 4 -- ASSESS-EX-DISPOSAL - , 22 -- Not in SPL - , 1 -),( - 4 -- ASSESS-EX-DISPOSAL - , 15 -- Approved for Exemption - , 'Cancel Project' - , 4 -- ASSESS-EX-DISPOSAL - , 23 -- Cancelled - , 0 -), ( - 4 -- ASSESS-EX-DISPOSAL - , 22 -- Not in SPL - , 'Dispose Externally' - , 4 -- ASSESS-EX-DISPOSAL - , 32 -- Disposed - , 0 -), ( - 4 -- ASSESS-EX-DISPOSAL - , 15 -- Approved for Exemption - , 'Approve for Enhanced Referral Process' - , 5 -- ERP - , 14 -- Approved ERP - , 1 - ) - ----- ERP -, ( - 5 -- ERP - , 14 -- Approved for ERP - , 'Begin ERP' - , 5 -- ERP - , 30 -- In ERP - , 1 -) - -, ( - 5 -- ERP - , 30 -- In ERP - , 'Place on Hold' - , 5 -- ERP - , 31 -- On Hold - , 1 -), ( - 5 -- ERP - , 30 -- In ERP - , 'Transfer within GRE' - , 5 -- ERP - , 20 -- Transferred within GRE - , 1 -), ( - 5 -- ERP - , 30 -- In ERP - , 'Approve for SPL' - , 6 -- SPL - , 21 -- Approved for SPL - , 1 -), ( - 5 -- ERP - , 30 -- In ERP - , 'Approve to not include in SPL' - , 5 -- ERP - , 22 -- Not in SPL - , 1 -), ( - 5 -- ERP - , 30 -- In ERP - , 'Cancel Project' - , 5 -- ERP - , 23 -- Cancelled - , 0 -), ( - 5 -- ERP - , 30 -- In ERP - , 'Dispose Externally' - , 5 -- ERP - , 32 -- Disposed - , 1 -) - -, ( - 5 -- ERP - , 31 -- On Hold - , 'Begin ERP' - , 5 -- ERP - , 30 -- In ERP - , 1 -), ( - 5 -- ERP - , 31 -- On Hold - , 'Transfer within GRE' - , 5 -- ERP - , 20 -- Transferred within GRE - , 1 -), ( - 5 -- ERP - , 31 -- On Hold - , 'Approve for SPL' - , 6 -- SPL - , 21 -- Approved for SPL - , 1 -), ( - 5 -- ERP - , 31 -- On Hold - , 'Approve to not include in SPL' - , 5 -- ERP - , 22 -- Not in SPL - , 1 -), ( - 5 -- ERP - , 31 -- On Hold - , 'Cancel Project' - , 5 -- ERP - , 23 -- Cancelled - , 0 -), ( - 5 -- ERP - , 31 -- On Hold - , 'Dispose Externally' - , 5 -- ERP - , 32 -- Disposed - , 1 -) - --- SPL - -, ( - 6 -- SPL - , 21 -- Approved for SPL - , 'Begin Pre-Marketing' - , 6 -- SPL - , 40 -- Pre-Marketing - , 1 -), ( - 6 -- SPL - , 40 -- Pre-Marketing - , 'Begin Marketing' - , 6 -- SPL - , 41 -- Marketing - , 1 -), ( - 6 -- SPL - , 40 -- Pre-Marketing - , 'Cancel Project' - , 6 -- SPL - , 23 -- Cancelled - , 0 -), ( - 6 -- SPL - , 41 -- Marketing - , 'Contract in Place' - , 6 -- SPL - , 42 -- Contract in Place - , 1 -), ( - 6 -- SPL - , 41 -- Marketing - , 'Cancel Project' - , 6 -- SPL - , 23 -- Cancelled - , 0 -), ( - 6 -- SPL - , 42 -- Contract in Place - , 'Dispose Externally' - , 6 -- SPL - , 32 -- Disposed - , 1 -), ( - 6 -- SPL - , 42 -- Contract in Place - , 'Restart Pre-Marketing' - , 6 -- SPL - , 40 -- Pre-Marketing - , 0 -), ( - 6 -- SPL - , 42 -- Contract in Place - , 'Cancel Project' - , 6 -- SPL - , 23 -- Cancelled - , 0 -) diff --git a/backend/dal/Migrations/Initial/Up/PostUp/02-RoleClaims.sql b/backend/dal/Migrations/Initial/Up/PostUp/02-RoleClaims.sql deleted file mode 100644 index 3721d6bfc3..0000000000 --- a/backend/dal/Migrations/Initial/Up/PostUp/02-RoleClaims.sql +++ /dev/null @@ -1,267 +0,0 @@ -PRINT 'Adding RoleClaims' - -INSERT INTO dbo.[RoleClaims] - ( - [RoleId] - , [ClaimId] - ) -VALUES - -- system-administrator -( - 'bbf27108-a0dc-4782-8025-7af7af711335' - , '91fc8939-2dea-44a1-bd17-a1c8f0fe5dc1' -- property-view -), -( - 'bbf27108-a0dc-4782-8025-7af7af711335' - , '5fd96f19-abe1-47e7-8a54-0a707bc3e4a4' -- property-add -), -( - 'bbf27108-a0dc-4782-8025-7af7af711335' - , '223664c7-650c-40ac-8581-f40e10064537' -- property-edit -), -( - 'bbf27108-a0dc-4782-8025-7af7af711335' - , '223664c7-650c-40ac-8581-f40e10164537' -- property-delete -), -( - 'bbf27108-a0dc-4782-8025-7af7af711335' - , '4dc0f39a-32f0-43a4-9d90-62fd94f20567' -- sensitive-view -), -( - 'bbf27108-a0dc-4782-8025-7af7af711335' - , 'fd86ddec-8f9d-4d7b-8c69-956062c5104f' -- admin-users -), -( - 'bbf27108-a0dc-4782-8025-7af7af711335' - , '321e245b-ee7d-4d7c-83a8-56b5a9d33c2d' -- admin-roles -), -( - 'bbf27108-a0dc-4782-8025-7af7af711335' - , '71e74513-a036-4df3-b724-a8c349b7fc28' -- admin-properties -), -( - 'bbf27108-a0dc-4782-8025-7af7af711335' - , '9b556b3f-441f-4d11-9f6f-14d455df4e05' -- admin-agencies -), -( - 'bbf27108-a0dc-4782-8025-7af7af711335' - , 'c46ccf94-4b3c-486f-b34c-9a707a54f357' -- admin-projects -), -( - 'bbf27108-a0dc-4782-8025-7af7af711335' - , '9e578c1f-1c60-4a5f-98b5-966b079a35e9' -- project-view -), -( - 'bbf27108-a0dc-4782-8025-7af7af711335' - , 'cbf68973-e239-41a9-be27-bf0ede3bf335' -- project-add -), -( - 'bbf27108-a0dc-4782-8025-7af7af711335' - , 'dbe02a47-34ec-48f9-9df5-3d959c46e174' -- project-edit -), -( - 'bbf27108-a0dc-4782-8025-7af7af711335' - , 'd6e91b9c-9728-4e62-8d91-319af2701b9b' -- project-delete -), -( - 'bbf27108-a0dc-4782-8025-7af7af711335' - , 'b9e1e966-d2aa-420f-83c4-617b984d1268' -- system-administrator -), -( - 'bbf27108-a0dc-4782-8025-7af7af711335' - , '6efd16d4-41ca-4feb-86f5-7598691f7bc6' -- agency-administrator -), - -- agency-administrator -( - '6ae8448d-5f0a-4607-803a-df0bc4efdc0f' - , '91fc8939-2dea-44a1-bd17-a1c8f0fe5dc1' -- property-view -), -( - '6ae8448d-5f0a-4607-803a-df0bc4efdc0f' - , '5fd96f19-abe1-47e7-8a54-0a707bc3e4a4' -- property-add -), -( - '6ae8448d-5f0a-4607-803a-df0bc4efdc0f' - , '223664c7-650c-40ac-8581-f40e10064537' -- property-edit -), -( - '6ae8448d-5f0a-4607-803a-df0bc4efdc0f' - , '4dc0f39a-32f0-43a4-9d90-62fd94f20567' -- sensitive-view -), -( - '6ae8448d-5f0a-4607-803a-df0bc4efdc0f' - , 'fd86ddec-8f9d-4d7b-8c69-956062c5104f' -- admin-users -), -( - '6ae8448d-5f0a-4607-803a-df0bc4efdc0f' - , '9e578c1f-1c60-4a5f-98b5-966b079a35e9' -- project-view -), -( - '6ae8448d-5f0a-4607-803a-df0bc4efdc0f' - , 'cbf68973-e239-41a9-be27-bf0ede3bf335' -- project-add -), -( - '6ae8448d-5f0a-4607-803a-df0bc4efdc0f' - , 'dbe02a47-34ec-48f9-9df5-3d959c46e174' -- project-edit -), -( - '6ae8448d-5f0a-4607-803a-df0bc4efdc0f' - , 'd6e91b9c-9728-4e62-8d91-319af2701b9b' -- project-delete -), -( - '6ae8448d-5f0a-4607-803a-df0bc4efdc0f' - , '6efd16d4-41ca-4feb-86f5-7598691f7bc6' -- agency-administrator -), - -- real-estate-manager -( - 'aad8c03d-892c-4cc3-b992-5b41c4f2392c' - , '91fc8939-2dea-44a1-bd17-a1c8f0fe5dc1' -- property-view -), -( - 'aad8c03d-892c-4cc3-b992-5b41c4f2392c' - , '5fd96f19-abe1-47e7-8a54-0a707bc3e4a4' -- property-add -), -( - 'aad8c03d-892c-4cc3-b992-5b41c4f2392c' - , '223664c7-650c-40ac-8581-f40e10064537' -- property-edit -), -( - 'aad8c03d-892c-4cc3-b992-5b41c4f2392c' - , '41747042-ad4a-4511-858b-67ed70c8e7e9' -- dispose-request -), -( - 'aad8c03d-892c-4cc3-b992-5b41c4f2392c' - , '4dc0f39a-32f0-43a4-9d90-62fd94f20567' -- sensitive-view -), -( - 'aad8c03d-892c-4cc3-b992-5b41c4f2392c' - , '9e578c1f-1c60-4a5f-98b5-966b079a35e9' -- project-view -), -( - 'aad8c03d-892c-4cc3-b992-5b41c4f2392c' - , 'cbf68973-e239-41a9-be27-bf0ede3bf335' -- project-add -), -( - 'aad8c03d-892c-4cc3-b992-5b41c4f2392c' - , 'dbe02a47-34ec-48f9-9df5-3d959c46e174' -- project-edit -), -( - 'aad8c03d-892c-4cc3-b992-5b41c4f2392c' - , 'd6e91b9c-9728-4e62-8d91-319af2701b9b' -- project-delete -), - -- real-estate-assistant -( - '7a7b2549-ae85-4ad6-a8d3-3a5f8d4f9ca5' - , '91fc8939-2dea-44a1-bd17-a1c8f0fe5dc1' -- property-view -), -( - '7a7b2549-ae85-4ad6-a8d3-3a5f8d4f9ca5' - , '5fd96f19-abe1-47e7-8a54-0a707bc3e4a4' -- property-add -), -( - '7a7b2549-ae85-4ad6-a8d3-3a5f8d4f9ca5' - , '223664c7-650c-40ac-8581-f40e10064537' -- property-edit -), -( - '7a7b2549-ae85-4ad6-a8d3-3a5f8d4f9ca5' - , '4dc0f39a-32f0-43a4-9d90-62fd94f20567' -- sensitive-view -), -( - '7a7b2549-ae85-4ad6-a8d3-3a5f8d4f9ca5' - , '9e578c1f-1c60-4a5f-98b5-966b079a35e9' -- project-view -), -( - '7a7b2549-ae85-4ad6-a8d3-3a5f8d4f9ca5' - , 'cbf68973-e239-41a9-be27-bf0ede3bf335' -- project-add -), -( - '7a7b2549-ae85-4ad6-a8d3-3a5f8d4f9ca5' - , 'dbe02a47-34ec-48f9-9df5-3d959c46e174' -- project-edit -), - -- assistant-deputy-minister -( - 'fbe5fc86-f69e-4610-a746-0113d29e04cd' - , '91fc8939-2dea-44a1-bd17-a1c8f0fe5dc1' -- property-view -), -( - 'fbe5fc86-f69e-4610-a746-0113d29e04cd' - , '5fd96f19-abe1-47e7-8a54-0a707bc3e4a4' -- property-add -), -( - 'fbe5fc86-f69e-4610-a746-0113d29e04cd' - , '223664c7-650c-40ac-8581-f40e10064537' -- property-edit -), -( - 'fbe5fc86-f69e-4610-a746-0113d29e04cd' - , '4dc0f39a-32f0-43a4-9d90-62fd94f20567' -- sensitive-view -), -( - 'fbe5fc86-f69e-4610-a746-0113d29e04cd' - , '9e578c1f-1c60-4a5f-98b5-966b079a35e9' -- project-view -), -( - 'fbe5fc86-f69e-4610-a746-0113d29e04cd' - , 'cbf68973-e239-41a9-be27-bf0ede3bf335' -- project-add -), -( - 'fbe5fc86-f69e-4610-a746-0113d29e04cd' - , 'dbe02a47-34ec-48f9-9df5-3d959c46e174' -- project-edit -), -( - 'fbe5fc86-f69e-4610-a746-0113d29e04cd' - , 'd6e91b9c-9728-4e62-8d91-319af2701b9b' -- project-delete -), - -- executive-director -( - '6cdfeb00-6f67-4457-b46a-85bbbc97066c' - , '91fc8939-2dea-44a1-bd17-a1c8f0fe5dc1' -- property-view -), -( - '6cdfeb00-6f67-4457-b46a-85bbbc97066c' - , '5fd96f19-abe1-47e7-8a54-0a707bc3e4a4' -- property-add -), -( - '6cdfeb00-6f67-4457-b46a-85bbbc97066c' - , '223664c7-650c-40ac-8581-f40e10064537' -- property-edit -), -( - '6cdfeb00-6f67-4457-b46a-85bbbc97066c' - , '4dc0f39a-32f0-43a4-9d90-62fd94f20567' -- sensitive-view -), -( - '6cdfeb00-6f67-4457-b46a-85bbbc97066c' - , '9e578c1f-1c60-4a5f-98b5-966b079a35e9' -- project-view -), -( - '6cdfeb00-6f67-4457-b46a-85bbbc97066c' - , 'cbf68973-e239-41a9-be27-bf0ede3bf335' -- project-add -), -( - '6cdfeb00-6f67-4457-b46a-85bbbc97066c' - , 'dbe02a47-34ec-48f9-9df5-3d959c46e174' -- project-edit -), -( - '6cdfeb00-6f67-4457-b46a-85bbbc97066c' - , 'd6e91b9c-9728-4e62-8d91-319af2701b9b' -- project-delete -), - -- SRES -( - '08c52eec-6917-4512-ac02-7d7ff89ed7a6' - , '71e74513-a036-4df3-b724-a8c349b7fc28' -- admin-properties -), -( - '08c52eec-6917-4512-ac02-7d7ff89ed7a6' - , '223664c7-650c-40ac-8581-f40e10164537' -- property-delete -), -( - '08c52eec-6917-4512-ac02-7d7ff89ed7a6' - , 'd6e91b9c-9728-4e62-8d91-319af2701b9b' -- project-delete -), -( - '08c52eec-6917-4512-ac02-7d7ff89ed7a6' - , 'c46ccf94-4b3c-486f-b34c-9a707a54f357' -- admin-projects -), -( - '08c52eec-6917-4512-ac02-7d7ff89ed7a6' - , 'd11ce982-f22b-4cd2-87d4-87b8f7f9a3c8' -- dispose-approve -) diff --git a/backend/dal/Migrations/PimsContextModelSnapshot.cs b/backend/dal/Migrations/PimsContextModelSnapshot.cs deleted file mode 100644 index 9f4514f0ff..0000000000 --- a/backend/dal/Migrations/PimsContextModelSnapshot.cs +++ /dev/null @@ -1,4216 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Pims.Dal; - -namespace Pims.Dal.Migrations -{ - [DbContext(typeof(PimsContext))] - partial class PimsContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.6") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Status"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("UserId"); - - b.ToTable("AccessRequests"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.Property("AccessRequestId") - .HasColumnType("int"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("AccessRequestId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("AccessRequestRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Address1") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Address2") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Postal") - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("ProvinceId") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProvinceId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("AdministrativeArea", "ProvinceId") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.HasIndex("Id", "AdministrativeArea") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "Postal") - .HasAnnotation("SqlServer:Include", new[] { "Address1", "Address2" }); - - b.HasIndex("Id", "ProvinceId", "AdministrativeArea", "Postal", "Address1") - .HasAnnotation("SqlServer:Include", new[] { "Address2" }); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Abbreviation") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("BoundaryType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("GroupName") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsDisabled", "Name", "SortOrder"); - - b.ToTable("AdministrativeAreas"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressTo") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CCEmail") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(6) - .HasColumnType("nvarchar(6)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendEmail") - .HasColumnType("bit"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParentId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Code", "ParentId") - .IsUnique() - .HasFilter("[ParentId] IS NOT NULL"); - - b.HasIndex("IsDisabled", "Code", "Name", "ParentId", "SortOrder"); - - b.ToTable("Agencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("BuildingTenancyUpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LeaseExpiry") - .HasColumnType("DATETIME2"); - - b.Property("LeasedLandMetadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("OccupantName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TotalArea") - .HasColumnType("real"); - - b.Property("TransferLeaseOnSale") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("BuildingConstructionTypeId"); - - b.HasIndex("BuildingOccupantTypeId"); - - b.HasIndex("BuildingPredominateUseId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "AddressId", "ProjectNumbers", "BuildingConstructionTypeId", "BuildingPredominateUseId", "BuildingOccupantTypeId", "BuildingFloorCount", "BuildingTenancy"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingConstructionTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "Date", "Key", "Value"); - - b.ToTable("BuildingEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("BuildingId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("BuildingId", "Key"); - - b.HasIndex("BuildingId", "FiscalYear", "Key", "Value"); - - b.ToTable("BuildingFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingOccupantTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("BuildingPredominateUses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("KeycloakRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Claims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ChesMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChesTransactionId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Key") - .HasColumnType("uniqueidentifier"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SendOn") - .HasColumnType("DATETIME2"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ToAgencyId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Key") - .IsUnique(); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToAgencyId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TemplateId", "ToAgencyId"); - - b.HasIndex("Status", "SendOn", "Subject"); - - b.ToTable("NotificationQueue"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Audience") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Bcc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Body") - .HasColumnType("nvarchar(max)"); - - b.Property("BodyType") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Cc") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Encoding") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Tag") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("To") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Tag"); - - b.ToTable("NotificationTemplates"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Boundary") - .HasColumnType("GEOGRAPHY"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("EncumbranceReason") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsSensitive") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleToOtherAgencies") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Location") - .IsRequired() - .HasColumnType("GEOGRAPHY"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("NotOwned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ProjectNumbers") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Zoning") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ZoningPotential") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("PropertyTypeId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("PID", "PIN") - .IsUnique() - .HasFilter("[PIN] IS NOT NULL"); - - b.HasIndex("Id", "AgencyId", "IsSensitive", "AddressId"); - - b.HasIndex("Id", "IsSensitive", "AgencyId", "ClassificationId", "PID", "PIN", "AddressId", "ProjectNumbers", "LandArea", "Zoning", "ZoningPotential"); - - b.ToTable("Parcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "BuildingId"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelBuildings"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("DATE"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Firm") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "Date", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "Date", "Key", "Value"); - - b.ToTable("ParcelEvaluations"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("FiscalYear") - .HasColumnType("int"); - - b.Property("Key") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("EffectiveDate") - .HasColumnType("DATE"); - - b.Property("Note") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Value") - .HasColumnType("MONEY"); - - b.HasKey("ParcelId", "FiscalYear", "Key"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ParcelId", "Key"); - - b.HasIndex("ParcelId", "FiscalYear", "Key", "Value"); - - b.ToTable("ParcelFiscals"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("SubdivisionId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ParcelId", "SubdivisionId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("SubdivisionId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ParcelParcels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ActualFiscalYear") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CancelledOn") - .HasColumnType("DATETIME2"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DeniedOn") - .HasColumnType("DATETIME2"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Manager") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectNumber") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.Property("ProjectType") - .HasColumnType("int"); - - b.Property("ReportedFiscalYear") - .HasColumnType("int"); - - b.Property("RiskId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("SubmittedOn") - .HasColumnType("DATETIME2"); - - b.Property("TierLevelId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectNumber") - .IsUnique(); - - b.HasIndex("RiskId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TierLevelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.HasIndex("Name", "StatusId", "TierLevelId", "AgencyId"); - - b.HasIndex("Assessed", "NetBook", "Market", "ReportedFiscalYear", "ActualFiscalYear"); - - b.ToTable("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("NotificationId") - .HasColumnType("int"); - - b.Property("OfferAmount") - .HasColumnType("MONEY"); - - b.Property("ReceivedOn") - .HasColumnType("DATETIME2"); - - b.Property("Response") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("NotificationId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "AgencyId", "Response", "ReceivedOn", "Note"); - - b.ToTable("ProjectAgencyResponses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Note") - .IsRequired() - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "NoteType"); - - b.ToTable("ProjectNotes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("ProjectNumbers"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("PropertyType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ParcelId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "ParcelId", "BuildingId") - .IsUnique() - .HasFilter("[ParcelId] IS NOT NULL AND [BuildingId] IS NOT NULL"); - - b.ToTable("ProjectProperties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("From") - .HasColumnType("DATETIME2"); - - b.Property("IsFinal") - .HasColumnType("bit"); - - b.Property("Name") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ReportType") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("To") - .IsRequired() - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Id", "To", "From", "IsFinal"); - - b.ToTable("ProjectReports"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Code", "Name", "SortOrder"); - - b.ToTable("ProjectRisks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Appraised") - .HasColumnType("MONEY"); - - b.Property("Assessed") - .HasColumnType("MONEY"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("Metadata") - .HasColumnType("NVARCHAR(MAX)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SnapshotOn") - .HasColumnType("DATETIME2"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "SnapshotOn"); - - b.ToTable("ProjectSnapshots"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("GroupName") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsMilestone") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsTerminal") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Route") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "Code", "SortOrder"); - - b.ToTable("ProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("WorkflowId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("ProjectId"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("WorkflowId"); - - b.ToTable("ProjectStatusHistory"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Delay") - .HasColumnType("int"); - - b.Property("DelayDays") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("TemplateId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TemplateId"); - - b.HasIndex("ToStatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("FromStatusId", "ToStatusId"); - - b.ToTable("ProjectStatusNotifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.Property("FromWorkflowId") - .HasColumnType("int"); - - b.Property("FromStatusId") - .HasColumnType("int"); - - b.Property("ToWorkflowId") - .HasColumnType("int"); - - b.Property("ToStatusId") - .HasColumnType("int"); - - b.Property("Action") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("ValidateTasks") - .HasColumnType("bit"); - - b.HasKey("FromWorkflowId", "FromStatusId", "ToWorkflowId", "ToStatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ToWorkflowId", "ToStatusId"); - - b.ToTable("ProjectStatusTransitions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TaskId") - .HasColumnType("int"); - - b.Property("CompletedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsCompleted") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("ProjectId", "TaskId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("TaskId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("ProjectId", "TaskId", "IsCompleted", "CompletedOn"); - - b.ToTable("ProjectTasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("PropertyClassifications"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("PropertyTypes"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.Property("Id") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.ToTable("Provinces"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnType("bit"); - - b.Property("KeycloakGroupId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name"); - - b.ToTable("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("RoleId", "ClaimId"); - - b.HasIndex("ClaimId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("RoleClaims"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "IsOptional", "Name", "SortOrder"); - - b.ToTable("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("TierLevels"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedById") - .HasColumnType("uniqueidentifier"); - - b.Property("ApprovedOn") - .HasColumnType("DATETIME2"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("EmailVerified") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsSystem") - .HasColumnType("bit"); - - b.Property("KeycloakUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LastLogin") - .HasColumnType("DATETIME2"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("MiddleName") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Note") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Position") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.Property("Username") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.HasKey("Id"); - - b.HasIndex("ApprovedById"); - - b.HasIndex("CreatedById"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("Username") - .IsUnique(); - - b.HasIndex("IsDisabled", "LastName", "FirstName"); - - b.HasIndex("KeycloakUserId", "Username", "Email") - .IsUnique() - .HasFilter("[KeycloakUserId] IS NOT NULL"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "AgencyId"); - - b.HasIndex("AgencyId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserAgencies"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("RoleId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Views.Property", b => - { - b.Property("Address") - .HasColumnType("nvarchar(max)"); - - b.Property("AddressId") - .HasColumnType("int"); - - b.Property("AdministrativeArea") - .HasColumnType("nvarchar(max)"); - - b.Property("Agency") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("AgencyId") - .HasColumnType("int"); - - b.Property("AssessedBuilding") - .HasColumnType("MONEY"); - - b.Property("AssessedBuildingDate") - .HasColumnType("datetime2"); - - b.Property("AssessedLand") - .HasColumnType("MONEY"); - - b.Property("AssessedLandDate") - .HasColumnType("datetime2"); - - b.Property("Boundary") - .HasColumnType("geography"); - - b.Property("BuildingConstructionType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingConstructionTypeId") - .HasColumnType("int"); - - b.Property("BuildingFloorCount") - .HasColumnType("int"); - - b.Property("BuildingOccupantType") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingOccupantTypeId") - .HasColumnType("int"); - - b.Property("BuildingPredominateUse") - .HasColumnType("nvarchar(max)"); - - b.Property("BuildingPredominateUseId") - .HasColumnType("int"); - - b.Property("BuildingTenancy") - .HasColumnType("nvarchar(max)"); - - b.Property("Classification") - .HasColumnType("nvarchar(max)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("DisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("Id") - .HasColumnType("int"); - - b.Property("IsSensitive") - .HasColumnType("bit"); - - b.Property("IsVisibleToOtherAgencies") - .HasColumnType("bit"); - - b.Property("LandArea") - .HasColumnType("real"); - - b.Property("LandLegalDescription") - .HasColumnType("nvarchar(max)"); - - b.Property("LeaseExpiry") - .HasColumnType("datetime2"); - - b.Property("Location") - .HasColumnType("geography"); - - b.Property("Market") - .HasColumnType("MONEY"); - - b.Property("MarketFiscalYear") - .HasColumnType("int"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("NetBook") - .HasColumnType("MONEY"); - - b.Property("NetBookFiscalYear") - .HasColumnType("int"); - - b.Property("OccupantName") - .HasColumnType("nvarchar(max)"); - - b.Property("PID") - .HasColumnType("int"); - - b.Property("PIN") - .HasColumnType("int"); - - b.Property("ParcelId") - .HasColumnType("int"); - - b.Property("Postal") - .HasColumnType("nvarchar(max)"); - - b.Property("ProjectNumbers") - .HasColumnType("nvarchar(max)"); - - b.Property("PropertyTypeId") - .HasColumnType("int"); - - b.Property("Province") - .HasColumnType("nvarchar(max)"); - - b.Property("RentableArea") - .HasColumnType("real"); - - b.Property("RowVersion") - .HasColumnType("varbinary(max)"); - - b.Property("SubAgency") - .HasColumnType("nvarchar(max)"); - - b.Property("SubAgencyCode") - .HasColumnType("nvarchar(max)"); - - b.Property("TransferLeaseOnSale") - .HasColumnType("bit"); - - b.Property("UpdatedOn") - .HasColumnType("datetime2"); - - b.Property("Zoning") - .HasColumnType("nvarchar(max)"); - - b.Property("ZoningPotential") - .HasColumnType("nvarchar(max)"); - - b.ToView("View_Properties"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Code") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsDisabled") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("Name") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("Id"); - - b.HasIndex("Code") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("UpdatedById"); - - b.HasIndex("IsDisabled", "Name", "SortOrder"); - - b.ToTable("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Property("WorkflowId") - .HasColumnType("int"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("CreatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedOn") - .ValueGeneratedOnAdd() - .HasColumnType("DATETIME2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("IsOptional") - .HasColumnType("bit"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("rowversion"); - - b.Property("SortOrder") - .HasColumnType("int"); - - b.Property("UpdatedById") - .HasColumnType("uniqueidentifier"); - - b.Property("UpdatedOn") - .HasColumnType("DATETIME2"); - - b.HasKey("WorkflowId", "StatusId"); - - b.HasIndex("CreatedById"); - - b.HasIndex("StatusId"); - - b.HasIndex("UpdatedById"); - - b.ToTable("WorkflowProjectStatus"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestAgency", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Agencies") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany() - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequestRole", b => - { - b.HasOne("Pims.Dal.Entities.AccessRequest", "AccessRequest") - .WithMany("Roles") - .HasForeignKey("AccessRequestId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("AccessRequest"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Address", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Province", "Province") - .WithMany() - .HasForeignKey("ProvinceId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Province"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AdministrativeArea", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Agency", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parent"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Buildings") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.BuildingConstructionType", "BuildingConstructionType") - .WithMany() - .HasForeignKey("BuildingConstructionTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingOccupantType", "BuildingOccupantType") - .WithMany() - .HasForeignKey("BuildingOccupantTypeId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.BuildingPredominateUse", "BuildingPredominateUse") - .WithMany() - .HasForeignKey("BuildingPredominateUseId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Building", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("BuildingConstructionType"); - - b.Navigation("BuildingOccupantType"); - - b.Navigation("BuildingPredominateUse"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingConstructionType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Evaluations") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingFiscal", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Fiscals") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingOccupantType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.BuildingPredominateUse", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notifications") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Notifications") - .HasForeignKey("TemplateId"); - - b.HasOne("Pims.Dal.Entities.Agency", "ToAgency") - .WithMany("Notifications") - .HasForeignKey("ToAgencyId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Template"); - - b.Navigation("ToAgency"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.HasOne("Pims.Dal.Entities.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Parcels") - .HasForeignKey("AgencyId"); - - b.HasOne("Pims.Dal.Entities.PropertyClassification", "Classification") - .WithMany() - .HasForeignKey("ClassificationId") - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.PropertyType", "PropertyType") - .WithOne() - .HasForeignKey("Pims.Dal.Entities.Parcel", "PropertyTypeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Address"); - - b.Navigation("Agency"); - - b.Navigation("Classification"); - - b.Navigation("CreatedBy"); - - b.Navigation("PropertyType"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelBuilding", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Parcels") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Buildings") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelEvaluation", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Evaluations") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelFiscal", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Fiscals") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ParcelParcel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Subdivisions") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Parcel", "Subdivision") - .WithMany("Parcels") - .HasForeignKey("SubdivisionId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Subdivision"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Projects") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectRisk", "Risk") - .WithMany("Projects") - .HasForeignKey("RiskId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Projects") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.TierLevel", "TierLevel") - .WithMany("Projects") - .HasForeignKey("TierLevelId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Projects") - .HasForeignKey("WorkflowId"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Risk"); - - b.Navigation("Status"); - - b.Navigation("TierLevel"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectAgencyResponse", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("ProjectResponses") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.NotificationQueue", "Notification") - .WithMany("Responses") - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Responses") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("Notification"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNote", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Notes") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectNumber", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectProperty", b => - { - b.HasOne("Pims.Dal.Entities.Building", "Building") - .WithMany("Projects") - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Parcel", "Parcel") - .WithMany("Projects") - .HasForeignKey("ParcelId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Properties") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Building"); - - b.Navigation("CreatedBy"); - - b.Navigation("Parcel"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectReport", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectSnapshot", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Snapshots") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusHistory", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("StatusHistory") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany() - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusNotification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "FromStatus") - .WithMany() - .HasForeignKey("FromStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.NotificationTemplate", "Template") - .WithMany("Status") - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "ToStatus") - .WithMany() - .HasForeignKey("ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("FromStatus"); - - b.Navigation("Template"); - - b.Navigation("ToStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatusTransition", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "FromWorkflowStatus") - .WithMany("ToStatus") - .HasForeignKey("FromWorkflowId", "FromStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.WorkflowProjectStatus", "ToWorkflowStatus") - .WithMany("FromStatus") - .HasForeignKey("ToWorkflowId", "ToStatusId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("FromWorkflowStatus"); - - b.Navigation("ToWorkflowStatus"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectTask", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Project", "Project") - .WithMany("Tasks") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.Task", "Task") - .WithMany() - .HasForeignKey("TaskId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Project"); - - b.Navigation("Task"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyClassification", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.PropertyType", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Province", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.RoleClaim", b => - { - b.HasOne("Pims.Dal.Entities.Claim", "Claim") - .WithMany("Roles") - .HasForeignKey("ClaimId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Claim"); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Task", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Tasks") - .HasForeignKey("StatusId"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.HasOne("Pims.Dal.Entities.User", "ApprovedBy") - .WithMany() - .HasForeignKey("ApprovedById"); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("ApprovedBy"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserAgency", b => - { - b.HasOne("Pims.Dal.Entities.Agency", "Agency") - .WithMany("Users") - .HasForeignKey("AgencyId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Agencies") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("Agency"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.UserRole", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.Role", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.User", "User") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientCascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Role"); - - b.Navigation("UpdatedBy"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("CreatedBy"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.HasOne("Pims.Dal.Entities.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("Pims.Dal.Entities.ProjectStatus", "Status") - .WithMany("Workflows") - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Pims.Dal.Entities.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.HasOne("Pims.Dal.Entities.Workflow", "Workflow") - .WithMany("Status") - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CreatedBy"); - - b.Navigation("Status"); - - b.Navigation("UpdatedBy"); - - b.Navigation("Workflow"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.AccessRequest", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Agency", b => - { - b.Navigation("Buildings"); - - b.Navigation("Children"); - - b.Navigation("Notifications"); - - b.Navigation("Parcels"); - - b.Navigation("ProjectResponses"); - - b.Navigation("Projects"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Building", b => - { - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Claim", b => - { - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationQueue", b => - { - b.Navigation("Responses"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.NotificationTemplate", b => - { - b.Navigation("Notifications"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Parcel", b => - { - b.Navigation("Buildings"); - - b.Navigation("Evaluations"); - - b.Navigation("Fiscals"); - - b.Navigation("Parcels"); - - b.Navigation("Projects"); - - b.Navigation("Subdivisions"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Project", b => - { - b.Navigation("Notes"); - - b.Navigation("Notifications"); - - b.Navigation("Properties"); - - b.Navigation("Responses"); - - b.Navigation("Snapshots"); - - b.Navigation("StatusHistory"); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectRisk", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.ProjectStatus", b => - { - b.Navigation("Projects"); - - b.Navigation("Tasks"); - - b.Navigation("Workflows"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Role", b => - { - b.Navigation("Claims"); - - b.Navigation("Users"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.TierLevel", b => - { - b.Navigation("Projects"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.User", b => - { - b.Navigation("Agencies"); - - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.Workflow", b => - { - b.Navigation("Projects"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("Pims.Dal.Entities.WorkflowProjectStatus", b => - { - b.Navigation("FromStatus"); - - b.Navigation("ToStatus"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/dal/Migrations/v01.00.01/Down/PostDown/DisableRoles.sql b/backend/dal/Migrations/v01.00.01/Down/PostDown/DisableRoles.sql deleted file mode 100644 index dd37d236e6..0000000000 --- a/backend/dal/Migrations/v01.00.01/Down/PostDown/DisableRoles.sql +++ /dev/null @@ -1 +0,0 @@ -UPDATE dbo.Roles SET IsDisabled = 0 WHERE Name in ('Assistant Deputy Minister', 'Assistant Deputy Minister Assistant', 'Executive Director') \ No newline at end of file diff --git a/backend/dal/Migrations/v01.00.01/Up/PostUp/DisableRoles.sql b/backend/dal/Migrations/v01.00.01/Up/PostUp/DisableRoles.sql deleted file mode 100644 index 228aa4e884..0000000000 --- a/backend/dal/Migrations/v01.00.01/Up/PostUp/DisableRoles.sql +++ /dev/null @@ -1 +0,0 @@ -UPDATE dbo.Roles SET IsDisabled = 1 WHERE Name in ('Assistant Deputy Minister', 'Assistant Deputy Minister Assistant', 'Executive Director') \ No newline at end of file diff --git a/backend/dal/Migrations/v01.01.00/Down/PreDown/RemoveRolesAndClaims.sql b/backend/dal/Migrations/v01.01.00/Down/PreDown/RemoveRolesAndClaims.sql deleted file mode 100644 index f548361c72..0000000000 --- a/backend/dal/Migrations/v01.01.00/Down/PreDown/RemoveRolesAndClaims.sql +++ /dev/null @@ -1,4 +0,0 @@ -DELETE FROM dbo.[RoleClaims] where RoleId = 'd416f362-1e6f-4e24-a561-c6bb45a35194'; -DELETE FROM dbo.[UserRoles] where RoleId = 'd416f362-1e6f-4e24-a561-c6bb45a35194'; -DELETE FROM dbo.[Roles] where Id = 'd416f362-1e6f-4e24-a561-c6bb45a35194'; -DELETE FROM dbo.[Claims] where Id in ('0fbd370d-6cde-41e7-9039-f05ae60d75da', 'e13d1c7d-f350-4aee-808e-c9603c29479b'); \ No newline at end of file diff --git a/backend/dal/Migrations/v01.01.00/Up/PreUp/AddRolesAndClaims.sql b/backend/dal/Migrations/v01.01.00/Up/PreUp/AddRolesAndClaims.sql deleted file mode 100644 index 8de50e0582..0000000000 --- a/backend/dal/Migrations/v01.01.00/Up/PreUp/AddRolesAndClaims.sql +++ /dev/null @@ -1,47 +0,0 @@ -INSERT INTO - dbo.[Claims] ([Id], [Name], [Description], [IsDisabled]) -VALUES -( - '0fbd370d-6cde-41e7-9039-f05ae60d75da', - 'reports-spl', - 'Ability to administrate spl reports.', - 0 -), ( - 'e13d1c7d-f350-4aee-808e-c9603c29479b', - 'reports-view', - 'Ability to view exported reports.', - 0 -); - -INSERT INTO - dbo.[Roles] ( - [Id], - [Name], - [Description], - [IsPublic], - [IsDisabled], - [SortOrder] - ) -VALUES - ( - 'd416f362-1e6f-4e24-a561-c6bb45a35194', - 'SRES Financial Manager', - 'SRES Financial Manager has claims specific to administering and viewing reports of financial data.', - 0, - 0, - 0 - ); - -INSERT INTO dbo.[RoleClaims] - ( - [RoleId] - , [ClaimId] - ) -VALUES -( - 'd416f362-1e6f-4e24-a561-c6bb45a35194' - , '0fbd370d-6cde-41e7-9039-f05ae60d75da' -- reports-spl -), ( - 'd416f362-1e6f-4e24-a561-c6bb45a35194' - , 'e13d1c7d-f350-4aee-808e-c9603c29479b' -- reports-view -); diff --git a/backend/dal/Migrations/v01.01.00/Up/PreUp/v01.01.02.sql b/backend/dal/Migrations/v01.01.00/Up/PreUp/v01.01.02.sql deleted file mode 100644 index 29f7de5c9a..0000000000 --- a/backend/dal/Migrations/v01.01.00/Up/PreUp/v01.01.02.sql +++ /dev/null @@ -1,96 +0,0 @@ - DECLARE @correctAgencyId varchar(30); - DECLARE @incorrectAgencyId varchar(30); - select @correctAgencyId = Id from Agencies where Code = 'BCT' - select @incorrectAgencyId = Id from Agencies where Code = 'BT' - - update Parcels set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId - update Buildings set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId - update NotificationQueue set ToAgencyId = @correctAgencyId where ToAgencyId = @incorrectAgencyId - update Projects set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId - update UserAgencies set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId and UserId not in (select UserId from UserAgencies where AgencyId = @correctAgencyId) - update ProjectAgencyResponses set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId and ProjectId not in (select ProjectId from ProjectAgencyResponses where AgencyId = @correctAgencyId) - update AccessRequestAgencies set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId and AccessRequestId not in (select AccessRequestId from AccessRequestAgencies where AgencyId = @correctAgencyId) - delete from UserAgencies where AgencyId = @incorrectAgencyId - delete from ProjectAgencyResponses where AgencyId = @incorrectAgencyId - delete from AccessRequestAgencies where AgencyId = @incorrectAgencyId - delete from Agencies where id = @incorrectAgencyId - - - select @correctAgencyId = Id from Agencies where Code = 'ICBC' - select @incorrectAgencyId = Id from Agencies where Code = 'ICOB' - - update Parcels set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId - update Buildings set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId - update NotificationQueue set ToAgencyId = @correctAgencyId where ToAgencyId = @incorrectAgencyId - update Projects set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId - update UserAgencies set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId and UserId not in (select UserId from UserAgencies where AgencyId = @correctAgencyId) - update ProjectAgencyResponses set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId and ProjectId not in (select ProjectId from ProjectAgencyResponses where AgencyId = @correctAgencyId) - update AccessRequestAgencies set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId and AccessRequestId not in (select AccessRequestId from AccessRequestAgencies where AgencyId = @correctAgencyId) - delete from UserAgencies where AgencyId = @incorrectAgencyId - delete from ProjectAgencyResponses where AgencyId = @incorrectAgencyId - delete from AccessRequestAgencies where AgencyId = @incorrectAgencyId - delete from Agencies where id = @incorrectAgencyId - - - select @correctAgencyId = Id from Agencies where Code = 'CMB' - select @incorrectAgencyId = Id from Agencies where Code = 'CPB' - - update Parcels set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId - update Buildings set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId - update NotificationQueue set ToAgencyId = @correctAgencyId where ToAgencyId = @incorrectAgencyId - update Projects set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId - update UserAgencies set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId and UserId not in (select UserId from UserAgencies where AgencyId = @correctAgencyId) - update ProjectAgencyResponses set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId and ProjectId not in (select ProjectId from ProjectAgencyResponses where AgencyId = @correctAgencyId) - update AccessRequestAgencies set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId and AccessRequestId not in (select AccessRequestId from AccessRequestAgencies where AgencyId = @correctAgencyId) - delete from UserAgencies where AgencyId = @incorrectAgencyId - delete from ProjectAgencyResponses where AgencyId = @incorrectAgencyId - delete from AccessRequestAgencies where AgencyId = @incorrectAgencyId - delete from Agencies where id = @incorrectAgencyId - - - select @correctAgencyId = Id from Agencies where Code = 'ECUAD' - select @incorrectAgencyId = Id from Agencies where Code = 'ECUOA&' - - update Parcels set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId - update Buildings set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId - update NotificationQueue set ToAgencyId = @correctAgencyId where ToAgencyId = @incorrectAgencyId - update Projects set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId - update UserAgencies set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId and UserId not in (select UserId from UserAgencies where AgencyId = @correctAgencyId) - update ProjectAgencyResponses set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId and ProjectId not in (select ProjectId from ProjectAgencyResponses where AgencyId = @correctAgencyId) - update AccessRequestAgencies set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId and AccessRequestId not in (select AccessRequestId from AccessRequestAgencies where AgencyId = @correctAgencyId) - delete from UserAgencies where AgencyId = @incorrectAgencyId - delete from ProjectAgencyResponses where AgencyId = @incorrectAgencyId - delete from AccessRequestAgencies where AgencyId = @incorrectAgencyId - delete from Agencies where id = @incorrectAgencyId - - - select @correctAgencyId = Id from Agencies where Code = 'PLMB' - select @incorrectAgencyId = Id from Agencies where Code = 'P&LMB' - - update Parcels set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId - update Buildings set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId - update NotificationQueue set ToAgencyId = @correctAgencyId where ToAgencyId = @incorrectAgencyId - update Projects set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId - update UserAgencies set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId and UserId not in (select UserId from UserAgencies where AgencyId = @correctAgencyId) - update ProjectAgencyResponses set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId and ProjectId not in (select ProjectId from ProjectAgencyResponses where AgencyId = @correctAgencyId) - update AccessRequestAgencies set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId and AccessRequestId not in (select AccessRequestId from AccessRequestAgencies where AgencyId = @correctAgencyId) - delete from UserAgencies where AgencyId = @incorrectAgencyId - delete from ProjectAgencyResponses where AgencyId = @incorrectAgencyId - delete from AccessRequestAgencies where AgencyId = @incorrectAgencyId - delete from Agencies where id = @incorrectAgencyId - - - select @correctAgencyId = Id from Agencies where Code = 'KP' - select @incorrectAgencyId = Id from Agencies where Code = 'KPU' - - update Parcels set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId - update Buildings set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId - update NotificationQueue set ToAgencyId = @correctAgencyId where ToAgencyId = @incorrectAgencyId - update Projects set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId - update UserAgencies set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId and UserId not in (select UserId from UserAgencies where AgencyId = @correctAgencyId) - update ProjectAgencyResponses set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId and ProjectId not in (select ProjectId from ProjectAgencyResponses where AgencyId = @correctAgencyId) - update AccessRequestAgencies set AgencyId = @correctAgencyId where AgencyId = @incorrectAgencyId and AccessRequestId not in (select AccessRequestId from AccessRequestAgencies where AgencyId = @correctAgencyId) - delete from UserAgencies where AgencyId = @incorrectAgencyId - delete from ProjectAgencyResponses where AgencyId = @incorrectAgencyId - delete from AccessRequestAgencies where AgencyId = @incorrectAgencyId - delete from Agencies where id = @incorrectAgencyId \ No newline at end of file diff --git a/backend/dal/Migrations/v01.02.00/Down/PostDown/01-Buildings.sql b/backend/dal/Migrations/v01.02.00/Down/PostDown/01-Buildings.sql deleted file mode 100644 index 21c337aca9..0000000000 --- a/backend/dal/Migrations/v01.02.00/Down/PostDown/01-Buildings.sql +++ /dev/null @@ -1,13 +0,0 @@ -PRINT 'Update Buildings' - --- Update the building to be located on one parcel. --- Regrettably we can only handle a one-to-many relationship in this version, so we choose order to get the oldest titled parcel. -UPDATE b SET - b.[ParcelId] = ( - SELECT TOP 1 [ParcelId] - FROM #ParcelBuildings - WHERE [BuildingId] = b.[Id] - ORDER BY [PID] DESC, [PIN]) -FROM dbo.[Buildings] b - -DROP TABLE #ParcelBuildings diff --git a/backend/dal/Migrations/v01.02.00/Down/PostDown/01-Cities.sql b/backend/dal/Migrations/v01.02.00/Down/PostDown/01-Cities.sql deleted file mode 100644 index 9d57a2854b..0000000000 --- a/backend/dal/Migrations/v01.02.00/Down/PostDown/01-Cities.sql +++ /dev/null @@ -1,22 +0,0 @@ -PRINT 'Update Cities' - --- populate the cities. - -SET IDENTITY_INSERT dbo.[Cities] ON - -INSERT INTO dbo.[Cities] ( - [Id] - , [Name] - , [Code] - , [IsDisabled] -) -SELECT - [Id] - , [Name] - , [Code] - , 0 -FROM #AdministrativeAreas - -DROP TABLE #AdministrativeAreas - -SET IDENTITY_INSERT dbo.[Cities] OFF diff --git a/backend/dal/Migrations/v01.02.00/Down/PostDown/01-ViewProperties.sql b/backend/dal/Migrations/v01.02.00/Down/PostDown/01-ViewProperties.sql deleted file mode 100644 index 56d49829c2..0000000000 --- a/backend/dal/Migrations/v01.02.00/Down/PostDown/01-ViewProperties.sql +++ /dev/null @@ -1,223 +0,0 @@ -PRINT 'Creating View_Properties' -GO --- This script provides a way to union both parcels and buildings into a single result of properties. -CREATE OR ALTER VIEW dbo.[View_Properties] AS -SELECT - p.[Id] - , [PropertyTypeId] = 0 - , p.[ClassificationId] - , [Classification] = c.[Name] - , p.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , p.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [City] = ac.[Name] - , [Province] = ap.[Name] - , adr.[Postal] - , p.[ProjectNumber] - , p.[Name] - , p.[Description] - , p.[Latitude] - , p.[Longitude] - , p.[IsSensitive] - , p.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , p.[PID] - , p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Municipality] = p.[Municipality] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [LocalId] = null - , [ParcelId] = null - , [BuildingConstructionTypeId] = 0 - , BuildingConstructionType = null - , [BuildingFloorCount] = 0 - , [BuildingPredominateUseId] = 0 - , BuildingPredominateUse = null - , [BuildingOccupantTypeId] = 0 - , BuildingOccupantType = null - , [BuildingTenancy] = null - , [RentableArea] = 0 - , [LeaseExpiry] = null - , [OccupantName] = null - , [TransferLeaseOnSale] = CAST(0 AS BIT) - - , [Assessed] = ISNULL(eas.[Value], 0) - , [AssessedDate] = eas.[Date] - , [Appraised] = ISNULL(eap.[Value], 0) - , [AppraisedDate] = eap.[Date] - , [Estimated] = ISNULL(fe.[Value], 0) - , [EstimatedFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] -FROM dbo.[Parcels] p -JOIN dbo.[PropertyClassifications] c ON p.[ClassificationId] = c.[Id] -JOIN dbo.[Agencies] a ON p.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON p.[AddressId] = adr.[Id] -JOIN dbo.[Cities] ac ON adr.[CityId] = ac.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- [Assessed] - ORDER BY [Date] DESC -) AS eas -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 1 -- Appraised - ORDER BY [Date] DESC -) AS eap -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 1 -- Estimated - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn -UNION -SELECT - b.[Id] - , [PropertyTypeId] = 1 - , b.[ClassificationId] - , [Classification] = c.[Name] - , b.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , b.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [City] = ac.[Name] - , [Province] = ap.[Name] - , adr.[Postal] - , b.[ProjectNumber] - , b.[Name] - , b.[Description] - , b.[Latitude] - , b.[Longitude] - , b.[IsSensitive] - , b.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , [PID] = p.[PID] - , [PIN] = p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Municipality] = p.[Municipality] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [LocalId] = b.[LocalId] - , [ParcelId] = b.[ParcelId] - , [BuildingConstructionTypeId] = b.[BuildingConstructionTypeId] - , BuildingConstructionType = bct.[Name] - , [BuildingFloorCount] = b.[BuildingFloorCount] - , [BuildingPredominateUseId] = b.[BuildingPredominateUseId] - , BuildingPredominateUse = bpu.[Name] - , [BuildingOccupantTypeId] = b.[BuildingOccupantTypeId] - , BuildingOccupantType = bot.[Name] - , [BuildingTenancy] = b.[BuildingTenancy] - , [RentableArea] = b.[RentableArea] - , [LeaseExpiry] = b.[LeaseExpiry] - , [OccupantName] = b.[OccupantName] - , [TransferLeaseOnSale] = b.[TransferLeaseOnSale] - - , [Assessed] = ISNULL(eas.[Value], 0) - , [AssessedDate] = eas.[Date] - , [Appraised] = ISNULL(eap.[Value], 0) - , [AppraisedDate] = eap.[Date] - , [Estimated] = ISNULL(fe.[Value], 0) - , [EstimatedFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] -FROM dbo.[Buildings] b -JOIN dbo.[Parcels] p ON b.[ParcelId] = p.[Id] -JOIN dbo.[PropertyClassifications] c ON b.[ClassificationId] = c.[Id] -JOIN dbo.[Agencies] a ON b.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON b.[AddressId] = adr.[Id] -JOIN dbo.[Cities] ac ON adr.[CityId] = ac.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -JOIN dbo.[BuildingConstructionTypes] bct ON b.[BuildingConstructionTypeId] = bct.[Id] -JOIN dbo.[BuildingOccupantTypes] bot ON b.[BuildingOccupantTypeId] = bot.[Id] -JOIN dbo.[BuildingPredominateUses] bpu ON b.[BuildingPredominateUseId] = bpu.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[BuildingEvaluations] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- [Assessed] - ORDER BY [Date] DESC -) AS eas -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[BuildingEvaluations] - WHERE [BuildingId] = b.[Id] - AND [Key] = 1 -- Appraised - ORDER BY [Date] DESC -) AS eap -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 1 -- Estimated - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn diff --git a/backend/dal/Migrations/v01.02.00/Down/PostDown/02-Addresses.sql b/backend/dal/Migrations/v01.02.00/Down/PostDown/02-Addresses.sql deleted file mode 100644 index c0066b31e5..0000000000 --- a/backend/dal/Migrations/v01.02.00/Down/PostDown/02-Addresses.sql +++ /dev/null @@ -1,10 +0,0 @@ -PRINT 'Update Addresses' - --- Copy the city name into the address. -UPDATE a SET - a.[CityId] = ac.[CityId] -FROM dbo.[Addresses] a -INNER JOIN #AddressCities ac ON a.[Id] = ac.[Id] -WHERE a.[Id] = ac.[Id] - -DROP TABLE #AddressCities diff --git a/backend/dal/Migrations/v01.02.00/Down/PreDown/01-AdministrativeAreas.sql b/backend/dal/Migrations/v01.02.00/Down/PreDown/01-AdministrativeAreas.sql deleted file mode 100644 index c91e2dc56d..0000000000 --- a/backend/dal/Migrations/v01.02.00/Down/PreDown/01-AdministrativeAreas.sql +++ /dev/null @@ -1,30 +0,0 @@ -PRINT 'Backup AdministrativeAreas' - --- Create temporary table to store the administrative area values -SELECT aa.[Id] AS [Id] - , aa.[Abbreviation] AS [Code] - , aa.[Name] AS [Name] -INTO #AdministrativeAreas -FROM dbo.[AdministrativeAreas] aa - -SET IDENTITY_INSERT #AdministrativeAreas ON - --- Add additional records for any unique administrative areas stored in an address -INSERT INTO #AdministrativeAreas ( - [Id] - , [Name] -) -SELECT - (SELECT MAX([Id]) + 1 FROM #AdministrativeAreas) - , aa.[AdministrativeArea] -FROM ( - SELECT - DISTINCT a.[AdministrativeArea] - FROM dbo.[Addresses] a - WHERE a.[AdministrativeArea] NOT IN ( - SELECT [Name] - FROM #AdministrativeAreas - ) - ) aa - -SET IDENTITY_INSERT #AdministrativeAreas OFF diff --git a/backend/dal/Migrations/v01.02.00/Down/PreDown/01-Buildings.sql b/backend/dal/Migrations/v01.02.00/Down/PreDown/01-Buildings.sql deleted file mode 100644 index 2b644e542c..0000000000 --- a/backend/dal/Migrations/v01.02.00/Down/PreDown/01-Buildings.sql +++ /dev/null @@ -1,6 +0,0 @@ -PRINT 'Update Buildings' - --- Reduce the length of the building name. -UPDATE b SET - b.[Name] = LEFT(b.[Name], 150) -FROM dbo.[Buildings] b diff --git a/backend/dal/Migrations/v01.02.00/Down/PreDown/01-ParcelBuildings.sql b/backend/dal/Migrations/v01.02.00/Down/PreDown/01-ParcelBuildings.sql deleted file mode 100644 index 840f796cd9..0000000000 --- a/backend/dal/Migrations/v01.02.00/Down/PreDown/01-ParcelBuildings.sql +++ /dev/null @@ -1,13 +0,0 @@ -PRINT 'Backup ParcelBuildings' - --- Create temporary table to store the relationship between parcel and buildings. --- In this version a building can only be located on a single parcel. -SELECT DISTINCT - b.[Id] AS [BuildingId] - , pb.[ParcelId] - , p.[PID] - , p.[PIN] -INTO #ParcelBuildings -FROM dbo.[Buildings] b -INNER JOIN dbo.[ParcelBuildings] pb on b.[Id] = pb.[BuildingId] -INNER JOIN dbo.[Parcels] p on pb.[ParcelId] = p.[Id] diff --git a/backend/dal/Migrations/v01.02.00/Down/PreDown/01-Parcels.sql b/backend/dal/Migrations/v01.02.00/Down/PreDown/01-Parcels.sql deleted file mode 100644 index d6b25929a1..0000000000 --- a/backend/dal/Migrations/v01.02.00/Down/PreDown/01-Parcels.sql +++ /dev/null @@ -1,6 +0,0 @@ -PRINT 'Update Parcels' - --- Reduce the length of the parcel name. -UPDATE p SET - p.[Name] = LEFT(p.[Name], 150) -FROM dbo.[Parcels] p diff --git a/backend/dal/Migrations/v01.02.00/Down/PreDown/02-Addresses.sql b/backend/dal/Migrations/v01.02.00/Down/PreDown/02-Addresses.sql deleted file mode 100644 index 1e3f90fc7e..0000000000 --- a/backend/dal/Migrations/v01.02.00/Down/PreDown/02-Addresses.sql +++ /dev/null @@ -1,9 +0,0 @@ -PRINT 'Backup Addresses' - --- Create temporary table to store the City values -SELECT a.[Id] - , aa.[Id] AS [CityId] - , a.[AdministrativeArea] AS [City] -INTO #AddressCities -FROM dbo.[Addresses] a -INNER JOIN #AdministrativeAreas aa ON a.[AdministrativeArea] = aa.[Name] diff --git a/backend/dal/Migrations/v01.02.00/Down/PreDown/03-SpatialIndex.sql b/backend/dal/Migrations/v01.02.00/Down/PreDown/03-SpatialIndex.sql deleted file mode 100644 index b62a5a6776..0000000000 --- a/backend/dal/Migrations/v01.02.00/Down/PreDown/03-SpatialIndex.sql +++ /dev/null @@ -1,4 +0,0 @@ -PRINT 'Create Spatial Indexes' - -DROP INDEX IF EXISTS IX_Parcels_SpatialLocation ON dbo.[Parcels] -DROP INDEX IF EXISTS IX_Buildings_SpatialLocation ON dbo.[Buildings] diff --git a/backend/dal/Migrations/v01.02.00/Down/Properties/01-Buildings-Location.sql b/backend/dal/Migrations/v01.02.00/Down/Properties/01-Buildings-Location.sql deleted file mode 100644 index 40f46004a1..0000000000 --- a/backend/dal/Migrations/v01.02.00/Down/Properties/01-Buildings-Location.sql +++ /dev/null @@ -1,16 +0,0 @@ -PRINT 'Update Buildings Locations' - --- Extract longitude and latitude from the location. -UPDATE b SET - b.[Longitude] = b.[Location].Long - , b.[Latitude] = b.[Location].Lat -FROM dbo.[Buildings] b - --- Make Location required. -ALTER TABLE dbo.[Buildings] -ALTER COLUMN - [Latitude] FLOAT NOT NULL - -ALTER TABLE dbo.[Buildings] -ALTER COLUMN - [Longitude] FLOAT NOT NULL diff --git a/backend/dal/Migrations/v01.02.00/Down/Properties/01-Parcels-Location.sql b/backend/dal/Migrations/v01.02.00/Down/Properties/01-Parcels-Location.sql deleted file mode 100644 index 9ede88a921..0000000000 --- a/backend/dal/Migrations/v01.02.00/Down/Properties/01-Parcels-Location.sql +++ /dev/null @@ -1,16 +0,0 @@ -PRINT 'Update Parcel Locations' - --- Extract longitude and latitude from the location. -UPDATE p SET - p.[Longitude] = p.[Location].Long - , p.[Latitude] = p.[Location].Lat -FROM dbo.[Parcels] p - --- Make Location required. -ALTER TABLE dbo.[Parcels] -ALTER COLUMN - [Latitude] FLOAT NOT NULL - -ALTER TABLE dbo.[Parcels] -ALTER COLUMN - [Longitude] FLOAT NOT NULL diff --git a/backend/dal/Migrations/v01.02.00/Up/PostUp/01-Addresses.sql b/backend/dal/Migrations/v01.02.00/Up/PostUp/01-Addresses.sql deleted file mode 100644 index f2ca4debbb..0000000000 --- a/backend/dal/Migrations/v01.02.00/Up/PostUp/01-Addresses.sql +++ /dev/null @@ -1,9 +0,0 @@ -PRINT 'Update Addresses' - --- Copy the city name into the AdministrativeArea. -UPDATE a SET - a.[AdministrativeArea] = c.[Name] -FROM dbo.[Addresses] a -INNER JOIN #AddressCities c ON a.[Id] = c.[Id] - -DROP TABLE #AddressCities diff --git a/backend/dal/Migrations/v01.02.00/Up/PostUp/01-AdministrativeAreas.sql b/backend/dal/Migrations/v01.02.00/Up/PostUp/01-AdministrativeAreas.sql deleted file mode 100644 index 64d0a8e4a6..0000000000 --- a/backend/dal/Migrations/v01.02.00/Up/PostUp/01-AdministrativeAreas.sql +++ /dev/null @@ -1,25 +0,0 @@ -PRINT 'Update AdministrativeAreas' - --- Copy the city name into the AdministrativeArea. -INSERT INTO dbo.[AdministrativeAreas] ( - [Name] - , [Abbreviation] -) -SELECT - [Name] - , [Code] -FROM #Cities - -DROP TABLE #Cities - --- Copy the municipality name into the AdministrativeArea. -INSERT INTO dbo.[AdministrativeAreas] ( - [Name] - , [Abbreviation] -) -SELECT - [Name] - , [Name] -FROM #Municipalities - -DROP TABLE #Municipalities diff --git a/backend/dal/Migrations/v01.02.00/Up/PostUp/01-ParcelBuildings.sql b/backend/dal/Migrations/v01.02.00/Up/PostUp/01-ParcelBuildings.sql deleted file mode 100644 index eba33afe70..0000000000 --- a/backend/dal/Migrations/v01.02.00/Up/PostUp/01-ParcelBuildings.sql +++ /dev/null @@ -1,11 +0,0 @@ -PRINT 'Add ParcelBuildings' - --- Add a record in the many-to-many table to link parcels with buildings. -INSERT INTO dbo.[ParcelBuildings] ( - [ParcelId] - , [BuildingId] -) -SELECT - [ParcelId] - , [Id] -FROM #Buildings diff --git a/backend/dal/Migrations/v01.02.00/Up/PostUp/01-ViewProperties.sql b/backend/dal/Migrations/v01.02.00/Up/PostUp/01-ViewProperties.sql deleted file mode 100644 index a25191b006..0000000000 --- a/backend/dal/Migrations/v01.02.00/Up/PostUp/01-ViewProperties.sql +++ /dev/null @@ -1,219 +0,0 @@ -PRINT 'Updating View_Properties' -GO --- This script provides a way to union both parcels and buildings into a single result of properties. --- Updating view to support many-to-many parcels and buildings.TEMPORARY -CREATE OR ALTER VIEW dbo.[View_Properties] AS -SELECT - p.[Id] - , [PropertyTypeId] = 0 - , p.[ClassificationId] - , [Classification] = c.[Name] - , p.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , p.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [AdministrativeArea] = adr.[AdministrativeArea] - , [Province] = ap.[Name] - , adr.[Postal] - , p.[ProjectNumber] - , p.[Name] - , p.[Description] - , p.[Location] - , p.[Boundary] - , p.[IsSensitive] - , p.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , p.[PID] - , p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [ParcelId] = p.[Id] - , [BuildingConstructionTypeId] = 0 - , [BuildingConstructionType] = null - , [BuildingFloorCount] = 0 - , [BuildingPredominateUseId] = 0 - , [BuildingPredominateUse] = null - , [BuildingOccupantTypeId] = 0 - , [BuildingOccupantType] = null - , [BuildingTenancy] = null - , [RentableArea] = 0 - , [LeaseExpiry] = null - , [OccupantName] = null - , [TransferLeaseOnSale] = CAST(0 AS BIT) - - , [Assessed] = ISNULL(eas.[Value], 0) - , [AssessedDate] = eas.[Date] - , [Appraised] = ISNULL(eap.[Value], 0) - , [AppraisedDate] = eap.[Date] - , [Estimated] = ISNULL(fe.[Value], 0) - , [EstimatedFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] -FROM dbo.[Parcels] p -JOIN dbo.[PropertyClassifications] c ON p.[ClassificationId] = c.[Id] -JOIN dbo.[Agencies] a ON p.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON p.[AddressId] = adr.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- [Assessed] - ORDER BY [Date] DESC -) AS eas -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 1 -- Appraised - ORDER BY [Date] DESC -) AS eap -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 1 -- Estimated - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn -UNION ALL -SELECT - b.[Id] - , [PropertyTypeId] = 1 - , b.[ClassificationId] - , [Classification] = c.[Name] - , b.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , b.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [AdministrativeArea] = adr.[AdministrativeArea] - , [Province] = ap.[Name] - , adr.[Postal] - , b.[ProjectNumber] - , b.[Name] - , b.[Description] - , b.[Location] - , b.[Boundary] - , b.[IsSensitive] - , b.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , [PID] = p.[PID] - , [PIN] = p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [ParcelId] = p.[Id] - , [BuildingConstructionTypeId] = b.[BuildingConstructionTypeId] - , [BuildingConstructionType] = bct.[Name] - , [BuildingFloorCount] = b.[BuildingFloorCount] - , [BuildingPredominateUseId] = b.[BuildingPredominateUseId] - , [BuildingPredominateUse] = bpu.[Name] - , [BuildingOccupantTypeId] = b.[BuildingOccupantTypeId] - , [BuildingOccupantType] = bot.[Name] - , [BuildingTenancy] = b.[BuildingTenancy] - , [RentableArea] = b.[RentableArea] - , [LeaseExpiry] = b.[LeaseExpiry] - , [OccupantName] = b.[OccupantName] - , [TransferLeaseOnSale] = b.[TransferLeaseOnSale] - - , [Assessed] = ISNULL(eas.[Value], 0) - , [AssessedDate] = eas.[Date] - , [Appraised] = ISNULL(eap.[Value], 0) - , [AppraisedDate] = eap.[Date] - , [Estimated] = ISNULL(fe.[Value], 0) - , [EstimatedFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] -FROM dbo.[Buildings] b -LEFT JOIN dbo.[ParcelBuildings] pb ON b.[Id] = pb.[BuildingId] -LEFT JOIN dbo.[Parcels] p ON pb.[ParcelId] = p.[Id] -JOIN dbo.[PropertyClassifications] c ON b.[ClassificationId] = c.[Id] -JOIN dbo.[Agencies] a ON b.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON b.[AddressId] = adr.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -JOIN dbo.[BuildingConstructionTypes] bct ON b.[BuildingConstructionTypeId] = bct.[Id] -JOIN dbo.[BuildingOccupantTypes] bot ON b.[BuildingOccupantTypeId] = bot.[Id] -JOIN dbo.[BuildingPredominateUses] bpu ON b.[BuildingPredominateUseId] = bpu.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[BuildingEvaluations] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- [Assessed] - ORDER BY [Date] DESC -) AS eas -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[BuildingEvaluations] - WHERE [BuildingId] = b.[Id] - AND [Key] = 1 -- Appraised - ORDER BY [Date] DESC -) AS eap -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 1 -- Estimated - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn diff --git a/backend/dal/Migrations/v01.02.00/Up/PostUp/02-AdministrativeAreas.sql b/backend/dal/Migrations/v01.02.00/Up/PostUp/02-AdministrativeAreas.sql deleted file mode 100644 index aad7f7eadc..0000000000 --- a/backend/dal/Migrations/v01.02.00/Up/PostUp/02-AdministrativeAreas.sql +++ /dev/null @@ -1,666 +0,0 @@ -PRINT 'Adding municipalities' - -MERGE INTO dbo.[AdministrativeAreas] Target -USING ( VALUES -( - 'Village of Anmore', - 'Anmore', - 'Metro Vancouver Regional District' -), ( - 'Village of Belcarra', - 'Belcarra', - 'Metro Vancouver Regional District' -), ( - 'Bowen Island Municipality', - 'Bowen Island', - 'Metro Vancouver Regional District' -), ( - 'City of Burnaby', - 'Burnaby', - 'Metro Vancouver Regional District' -), ( - 'City of Coquitlam', - 'Coquitlam', - 'Metro Vancouver Regional District' -), ( - 'City of Delta', - 'Delta', - 'Metro Vancouver Regional District' -), ( - 'City of Langley', - 'Langley - City', - 'Metro Vancouver Regional District' -), ( - 'City of Maple Ridge', - 'Maple Ridge', - 'Metro Vancouver Regional District' -), ( - 'City of New Westminster', - 'New Westminster', - 'Metro Vancouver Regional District' -), ( - 'City of North Vancouver', - 'North Vancouver - City', - 'Metro Vancouver Regional District' -), ( - 'City of Pitt Meadows', - 'Pitt Meadows', - 'Metro Vancouver Regional District' -), ( - 'City of White Rock', - 'White Rock', - 'Metro Vancouver Regional District' -), ( - 'Village of Lions Bay', - 'Lions Bay', - 'Metro Vancouver Regional District' -), ( - 'The Corporation of the Township of Langley', - 'Langley - District', - 'Metro Vancouver Regional District' -), ( - 'The Corporation of the District of North Vancouver', - 'North Vancouver - District', - 'Metro Vancouver Regional District' -), ( - 'Village of Keremeos', - 'Keremeos', - 'Regional District of Okanagan-Similkameen' -), ( - 'Town of Osoyoos', - 'Osoyoos', - 'Regional District of Okanagan-Similkameen' -), ( - 'The Corporation of the City of Penticton', - 'Penticton', - 'Regional District of Okanagan-Similkameen' -), ( - 'Town of Princeton', - 'Princeton', - 'Regional District of Okanagan-Similkameen' -), ( - 'Town of Oliver', - 'Oliver', - 'Regional District of Okanagan-Similkameen' -), ( - 'The Corporation of the District of Summerland', - 'Summerland', - 'Regional District of Okanagan-Similkameen' -), ( - 'District of Lillooet', - 'Lillooet', - 'Squamish-Lillooet Regional District' -), ( - 'District of Squamish', - 'Squamish', - 'Squamish-Lillooet Regional District' -), ( - 'Resort Municipality of Whistler', - 'Whistler', - 'Squamish-Lillooet Regional District' -), ( - 'Village of Pemberton', - 'Pemberton', - 'Squamish-Lillooet Regional District' -), ( - 'The Corporation of the Village of Ashcroft', - 'Ashcroft', - 'Thompson-Nicola Regional District' -), ( - 'Village of Chase', - 'Chase', - 'Thompson-Nicola Regional District' -), ( - 'Village of Clinton', - 'Clinton', - 'Thompson-Nicola Regional District' -), ( - 'City of Kamloops', - 'Kamloops', - 'Thompson-Nicola Regional District' -), ( - 'District of Logan Lake', - 'Logan Lake', - 'Thompson-Nicola Regional District' -), ( - 'District of Barriere', - 'Barriere', - 'Thompson-Nicola Regional District' -), ( - 'Village of Cache Creek', - 'Cache Creek', - 'Thompson-Nicola Regional District' -), ( - 'District of Clearwater', - 'Clearwater', - 'Thompson-Nicola Regional District' -), ( - 'Village of Lytton', - 'Lytton', - 'Thompson-Nicola Regional District' -), ( - 'City of Merritt', - 'Merritt', - 'Thompson-Nicola Regional District' -), ( - 'City of Port Coquitlam', - 'Port Coquitlam', - 'Metro Vancouver Regional District' -), ( - 'City of Port Moody', - 'Port Moody', - 'Metro Vancouver Regional District' -), ( - 'City of Richmond', - 'Richmond', - 'Metro Vancouver Regional District' -), ( - 'City of Surrey', - 'Surrey', - 'Metro Vancouver Regional District' -), ( - 'City of Vancouver', - 'Vancouver', - 'Metro Vancouver Regional District' -), ( - 'District Municipality of West Vancouver', - 'West Vancouver', - 'Metro Vancouver Regional District' -), ( - 'The Corporation of the Village of Burns Lake', - 'Burns Lake', - 'Regional District of Bulkley-Nechako' -), ( - 'District of Fort St James', - 'Fort St James', - 'Regional District of Bulkley-Nechako' -), ( - 'Village of Fraser Lake', - 'Fraser Lake', - 'Regional District of Bulkley-Nechako' -), ( - 'Village of Granisle', - 'Granisle', - 'Regional District of Bulkley-Nechako' -), ( - 'District of Houston', - 'Houston', - 'Regional District of Bulkley-Nechako' -), ( - 'Town of Smithers', - 'Smithers', - 'Regional District of Bulkley-Nechako' -), ( - 'The Corporation of the Village of Telkwa', - 'Telkwa', - 'Regional District of Bulkley-Nechako' -), ( - 'District of Vanderhoof', - 'Vanderhoof', - 'Regional District of Bulkley-Nechako' -), ( - 'District of 100 Mile House', - '100 Mile House', - 'Cariboo Regional District' -), ( - 'City of Quesnel', - 'Quesnel', - 'Cariboo Regional District' -), ( - 'District of Wells', - 'Wells', - 'Cariboo Regional District' -), ( - 'City of Williams Lake', - 'Williams Lake', - 'Cariboo Regional District' -), ( - 'District of Mackenzie', - 'Mackenzie', - 'Regional District of Fraser-Fort George' -), ( - 'The Corporation of the Village of McBride', - 'McBride', - 'Regional District of Fraser-Fort George' -), ( - 'City of Prince George', - 'Prince George', - 'Regional District of Fraser-Fort George' -), ( - 'Village of Valemount', - 'Valemont', - 'Regional District of Fraser-Fort George' -), ( - 'District of Kitimat', - 'Kitimat', - 'Regional District of Kitimat-Stikine' -), ( - 'The Corporation of the Village of Hazelton', - 'Hazelton', - 'Regional District of Kitimat-Stikine' -), ( - 'District of New Hazelton', - 'New Hazelton', - 'Regional District of Kitimat-Stikine' -), ( - 'District of Stewart', - 'Stewart', - 'Regional District of Kitimat-Stikine' -), ( - 'City of Terrace', - 'Terrace', - 'Regional District of Kitimat-Stikine' -), ( - 'Northern Rockies Regional Municipality', - 'NRRM', - 'Province of British Columbia' -), ( - 'District of Tumbler Ridge', - 'Tumbler Ridge', - 'Peace River Regional District' -), ( - 'District of Chetwynd', - 'Chetwynd', - 'Peace River Regional District' -), ( - 'The Corporation of the City of Dawson Creek', - 'Dawson Creek', - 'Peace River Regional District' -), ( - 'City of Fort St John', - 'Fort St John', - 'Peace River Regional District' -), ( - 'District of Hudsons Hope', - 'Hudson''s Hope', - 'Peace River Regional District' -), ( - 'The Corporation of the Village of Pouce Coupe', - 'Pouce Coupe', - 'Peace River Regional District' -), ( - 'District of Taylor', - 'Taylor', - 'Peace River Regional District' -), ( - 'Village of Queen Charlotte', - 'Queen Charlotte', - 'North Coast Regional District' -), ( - 'Village of Masset', - 'Masset', - 'North Coast Regional District' -), ( - 'Village of Port Clements', - 'Port Clements', - 'North Coast Regional District' -), ( - 'District of Port Edward', - 'Port Edward', - 'North Coast Regional District' -), ( - 'City of Prince Rupert', - 'Prince Rupert', - 'North Coast Regional District' -), ( - 'City of Kelowna', - 'Kelowna', - 'Regional District of Central Okanagan' -), ( - 'District of Lake Country', - 'Lake Country', - 'Regional District of Central Okanagan' -), ( - 'The Corporation of the District of Peachland', - 'Peachland', - 'Regional District of Central Okanagan' -), ( - 'City of West Kelowna', - 'West Kelowna', - 'Regional District of Central Okanagan' -), ( - 'City of Abbotsford', - 'Abbotsford', - 'Fraser Valley Regional District' -), ( - 'City of Chilliwack', - 'Chilliwack', - 'Fraser Valley Regional District' -), ( - 'Village of Harrison Hot Springs', - 'Harrison Hot Springs', - 'Fraser Valley Regional District' -), ( - 'District of Hope', - 'Hope', - 'Fraser Valley Regional District' -), ( - 'District of Kent', - 'Kent', - 'Fraser Valley Regional District' -), ( - 'District of Mission', - 'Mission', - 'Fraser Valley Regional District' -), ( - 'Village of Montrose', - 'Montrose', - 'Regional District of Kootenay Boundary' -), ( - 'City of Rossland', - 'Rossland', - 'Regional District of Kootenay Boundary' -), ( - 'City of Trail', - 'Trail', - 'Regional District of Kootenay Boundary' -), ( - 'Village of Warfield', - 'Warfield', - 'Regional District of Kootenay Boundary' -), ( - 'The Corporation of the Village of Fruitvale', - 'Fruitvale', - 'Regional District of Kootenay Boundary' -), ( - 'City of Armstrong', - 'Armstrong', - 'Regional District of North Okanagan' -), ( - 'The Corporation of the District of Coldstream', - 'Coldstream', - 'Regional District of North Okanagan' -), ( - 'The Corporation of the City of Enderby', - 'Enderby', - 'Regional District of North Okanagan' -), ( - 'The Corporation of the Village of Lumby', - 'Lumby', - 'Regional District of North Okanagan' -), ( - 'The Corporation of the Township of Spallumcheen', - 'Spallumcheen', - 'Regional District of North Okanagan' -), ( - 'The Corporation of the City of Vernon', - 'Vernon', - 'Regional District of North Okanagan' -), ( - 'City of Port Alberni', - 'Port Alberni', - 'Regional District of Alberni-Clayoquot' -), ( - 'Sun Peaks Mountain Resort Municipality', - 'Sun Peaks', - 'Thompson-Nicola Regional District' -), ( - 'The Corporation of the City of Nelson', - 'Nelson', - 'Regional District of Central Kootenay' -), ( - 'Village of Slocan', - 'Slocan', - 'Regional District of Central Kootenay' -), ( - 'The Corporation of the Village of Salmo', - 'Salmo', - 'Regional District of Central Kootenay' -), ( - 'The Corporation of the Village of Silverton', - 'Silverton', - 'Regional District of Central Kootenay' -), ( - 'Town of Creston', - 'Creston', - 'Regional District of Central Kootenay' -), ( - 'Village of Kaslo', - 'Kaslo', - 'Regional District of Central Kootenay' -), ( - 'Village of New Denver', - 'New Denver', - 'Regional District of Central Kootenay' -), ( - 'Village of Nakusp', - 'Nakusp', - 'Regional District of Central Kootenay' -), ( - 'City of Castlegar', - 'Castlegar', - 'Regional District of Central Kootenay' -), ( - 'Town of Golden', - 'Golden', - 'Columbia-Shuswap Regional District' -), ( - 'City of Revelstoke', - 'Revelstoke', - 'Columbia-Shuswap Regional District' -), ( - 'City of Salmon Arm', - 'Salmon Arm', - 'Columbia-Shuswap Regional District' -), ( - 'The Corporation of the District of Sicamous', - 'Sicamous', - 'Columbia-Shuswap Regional District' -), ( - 'Village of Canal Flats', - 'Canal Flats', - 'Regional District of East Kootenay' -), ( - 'The Corporation of the City of Cranbrook', - 'Cranbrook', - 'Regional District of East Kootenay' -), ( - 'District of Elkford', - 'Elkford', - 'Regional District of East Kootenay' -), ( - 'The Corporation of the City of Fernie', - 'Fernie', - 'Regional District of East Kootenay' -), ( - 'District of Invermere', - 'Invermere', - 'Regional District of East Kootenay' -), ( - 'Jumbo Glacier Mountain Resort Municipality', - 'Jumbo Glacier', - 'Regional District of East Kootenay' -), ( - 'City of Kimberley', - 'Kimberley', - 'Regional District of East Kootenay' -), ( - 'Village of Radium Hot Springs', - 'Radium Hot Springs', - 'Regional District of East Kootenay' -), ( - 'District of Sparwood', - 'Sparwood', - 'Regional District of East Kootenay' -), ( - 'City of Grand Forks', - 'Grand Forks', - 'Regional District of Kootenay Boundary' -), ( - 'City of Greenwood', - 'Greenwood', - 'Regional District of Kootenay Boundary' -), ( - 'Village of Midway', - 'Midway', - 'Regional District of Kootenay Boundary' -), ( - 'Corporation of the Village of Tofino', - 'Tofino', - 'Regional District of Alberni-Clayoquot' -), ( - 'District of Ucluelet', - 'Ucluelet', - 'Regional District of Alberni-Clayoquot' -), ( - 'The Corporation of the District of Central Saanich', - 'Central Saanich', - 'Capital Regional District' -), ( - 'City of Colwood', - 'Colwood', - 'Capital Regional District' -), ( - 'The Corporation of the Township of Esquimalt', - 'Esquimalt', - 'Capital Regional District' -), ( - 'District of Highlands', - 'Highlands', - 'Capital Regional District' -), ( - 'City of Langford', - 'Langford', - 'Capital Regional District' -), ( - 'District of Metchosin', - 'Metchosin', - 'Capital Regional District' -), ( - 'District of North Saanich', - 'North Saanich', - 'Capital Regional District' -), ( - 'The Corporation of the District of Oak Bay', - 'Oak Bay', - 'Capital Regional District' -), ( - 'The Corporation of the District of Saanich', - 'Saanich', - 'Capital Regional District' -), ( - 'Town of Sidney', - 'Sidney', - 'Capital Regional District' -), ( - 'District of Sooke', - 'Sooke', - 'Capital Regional District' -), ( - 'The Corporation of the City of Victoria', - 'Victoria', - 'Capital Regional District' -), ( - 'Town of View Royal', - 'View Royal', - 'Capital Regional District' -), ( - 'Village of Cumberland', - 'Cumberland', - 'Comox Valley Regional District' -), ( - 'Town of Comox', - 'Comox', - 'Comox Valley Regional District' -), ( - 'The Corporation of the City of Courtenay', - 'Courtenay', - 'Comox Valley Regional District' -), ( - 'The Corporation of the City of Duncan', - 'Duncan', - 'Cowichan Valley Regional District' -), ( - 'Town of Ladysmith', - 'Ladysmith', - 'Cowichan Valley Regional District' -), ( - 'Town of Lake Cowichan', - 'Lake Cowichan', - 'Cowichan Valley Regional District' -), ( - 'The Corporation of the District of North Cowichan', - 'North Cowichan', - 'Cowichan Valley Regional District' -), ( - 'The Corporation of the Village of Alert Bay', - 'Alert Bay', - 'Regional District of Mount Waddington' -), ( - 'Village of Port Alice', - 'Port Alice', - 'Regional District of Mount Waddington' -), ( - 'District of Port Hardy', - 'Port Hardy', - 'Regional District of Mount Waddington' -), ( - 'Town of Port McNeill', - 'Port McNeill', - 'Regional District of Mount Waddington' -), ( - 'City of Parksville', - 'Parksville', - 'Regional District of Nanaimo' -), ( - 'District of Lantzville', - 'Lantzville', - 'Regional District of Nanaimo' -), ( - 'City of Nanaimo', - 'Nanaimo', - 'Regional District of Nanaimo' -), ( - 'Town of Qualicum Beach', - 'Qualicum Beach', - 'Regional District of Nanaimo' -), ( - 'City of Powell River', - 'Powell River', - 'qathet Regional District' -), ( - 'Town of Gibsons', - 'Gibsons', - 'Sunshine Coast Regional District' -), ( - 'District of Sechelt', - 'Sechelt', - 'Sunshine Coast Regional District' -), ( - 'City of Campbell River', - 'Campbell River', - 'Strathcona Regional District' -), ( - 'Village of Gold River', - 'Gold River', - 'Strathcona Regional District' -), ( - 'Village of Sayward', - 'Sayward', - 'Strathcona Regional District' -), ( - 'Village of Tahsis', - 'Tahsis', - 'Strathcona Regional District' -), -( - 'Lower Nicola', - 'Nicola', - 'Lower County' -), -( - 'Tsawwassen', - 'Tsawwassen', - 'City of Delta' -), -( - 'The Corporation of the Village of Zeballos', - 'Zeballos', - 'Strathcona Regional District' -)) AS MSrc (Name, Abbreviation, GroupName) -ON Target.Name = MSrc.NAME -WHEN MATCHED THEN -UPDATE -SET Target.Abbreviation = MSrc.Abbreviation, Target.GroupName = MSrc.GroupName -WHEN NOT MATCHED THEN -INSERT (Name, Abbreviation, GroupName) VALUES (MSrc.Name, MSrc.Abbreviation, MSrc.GroupName); diff --git a/backend/dal/Migrations/v01.02.00/Up/PostUp/02-Buildings.sql b/backend/dal/Migrations/v01.02.00/Up/PostUp/02-Buildings.sql deleted file mode 100644 index 7212eec9fe..0000000000 --- a/backend/dal/Migrations/v01.02.00/Up/PostUp/02-Buildings.sql +++ /dev/null @@ -1,20 +0,0 @@ -PRINT 'Update Buildings - Copy LocalId into Name' - --- Copy the LocalId into the Name --- If Name has a value and it is different than append it. -UPDATE b SET - b.[Name] = lid.[LocalId] + ' ' + lid.[Name] -FROM dbo.[Buildings] b -INNER JOIN #Buildings lid ON b.[Id] = lid.[Id] -WHERE lid.[Name] != lid.[LocalId] - AND (lid.[Name] IS NOT NULL OR lid.[Name] != '') - --- Replace Name with LocalId if it is null or empty. -UPDATE b SET - b.[Name] = lid.[LocalId] -FROM dbo.[Buildings] b -INNER JOIN #Buildings lid ON b.[Id] = lid.[Id] -WHERE lid.[Name] IS NULL - OR lid.[Name] = '' - -DROP TABLE #Buildings diff --git a/backend/dal/Migrations/v01.02.00/Up/PostUp/03-SpatialIndex.sql b/backend/dal/Migrations/v01.02.00/Up/PostUp/03-SpatialIndex.sql deleted file mode 100644 index c22b304373..0000000000 --- a/backend/dal/Migrations/v01.02.00/Up/PostUp/03-SpatialIndex.sql +++ /dev/null @@ -1,4 +0,0 @@ -PRINT 'Create Spatial Indexes' - -CREATE SPATIAL INDEX IX_Parcels_SpatialLocation ON Parcels(Location) using geography_auto_grid -CREATE SPATIAL INDEX IX_Buildings_SpatialLocation ON Buildings(Location) using geography_auto_grid diff --git a/backend/dal/Migrations/v01.02.00/Up/PreUp/01-Addresses.sql b/backend/dal/Migrations/v01.02.00/Up/PreUp/01-Addresses.sql deleted file mode 100644 index f42ee56e56..0000000000 --- a/backend/dal/Migrations/v01.02.00/Up/PreUp/01-Addresses.sql +++ /dev/null @@ -1,8 +0,0 @@ -PRINT 'Backup Addresses' - --- Create temporary table to store the City values -SELECT a.[Id] - , c.[Name] -INTO #AddressCities -FROM dbo.[Addresses] a -INNER JOIN dbo.[Cities] c ON a.[CityId] = c.[Id] diff --git a/backend/dal/Migrations/v01.02.00/Up/PreUp/01-Buildings.sql b/backend/dal/Migrations/v01.02.00/Up/PreUp/01-Buildings.sql deleted file mode 100644 index 4bff4b93f8..0000000000 --- a/backend/dal/Migrations/v01.02.00/Up/PreUp/01-Buildings.sql +++ /dev/null @@ -1,9 +0,0 @@ -PRINT 'Backup Buildings' - --- Store building values for importing into new migration. -SELECT [Id] - , [Name] - , [LocalId] - , [ParcelId] -INTO #Buildings -FROM dbo.[Buildings] diff --git a/backend/dal/Migrations/v01.02.00/Up/PreUp/01-Cities.sql b/backend/dal/Migrations/v01.02.00/Up/PreUp/01-Cities.sql deleted file mode 100644 index 55496355e6..0000000000 --- a/backend/dal/Migrations/v01.02.00/Up/PreUp/01-Cities.sql +++ /dev/null @@ -1,8 +0,0 @@ -PRINT 'Backup Cities' - --- Create temporary table to store the City values. --- Remove Windows newline characters. -SELECT c.[Code] - , REPLACE(REPLACE(c.[Name], CHAR(194), ''), CHAR(160), ' ') AS [Name] -INTO #Cities -FROM dbo.[Cities] c diff --git a/backend/dal/Migrations/v01.02.00/Up/PreUp/01-Municipalities.sql b/backend/dal/Migrations/v01.02.00/Up/PreUp/01-Municipalities.sql deleted file mode 100644 index f85a7b6f8d..0000000000 --- a/backend/dal/Migrations/v01.02.00/Up/PreUp/01-Municipalities.sql +++ /dev/null @@ -1,8 +0,0 @@ -PRINT 'Backup Municipalities' - --- Create temporary table to store the Municipality values -SELECT DISTINCT - p.[Municipality] AS [Name] -INTO #Municipalities -FROM dbo.[Parcels] p -WHERE p.[Municipality] NOT IN (SELECT [Name] FROM #Cities) diff --git a/backend/dal/Migrations/v01.02.00/Up/Properties/01-Buildings-Location.sql b/backend/dal/Migrations/v01.02.00/Up/Properties/01-Buildings-Location.sql deleted file mode 100644 index 976414c700..0000000000 --- a/backend/dal/Migrations/v01.02.00/Up/Properties/01-Buildings-Location.sql +++ /dev/null @@ -1,11 +0,0 @@ -PRINT 'Update Buildings Locations' - --- Update the location. -UPDATE b SET - b.[Location] = GEOGRAPHY::STPointFromText('POINT(' + CAST(b.Longitude AS NVARCHAR) + ' ' + CAST(b.Latitude AS NVARCHAR) + ')', 4326) -FROM dbo.[Buildings] b - --- Make Location required. -ALTER TABLE dbo.[Buildings] -ALTER COLUMN - [Location] GEOGRAPHY NOT NULL diff --git a/backend/dal/Migrations/v01.02.00/Up/Properties/01-Parcels-Location.sql b/backend/dal/Migrations/v01.02.00/Up/Properties/01-Parcels-Location.sql deleted file mode 100644 index 29b7fbf633..0000000000 --- a/backend/dal/Migrations/v01.02.00/Up/Properties/01-Parcels-Location.sql +++ /dev/null @@ -1,11 +0,0 @@ -PRINT 'Update Parcels Locations' - --- Update the location. -UPDATE p SET - p.[Location] = GEOGRAPHY::STPointFromText('POINT(' + CAST(p.Longitude AS NVARCHAR) + ' ' + CAST(p.Latitude AS NVARCHAR) + ')', 4326) -FROM dbo.[Parcels] p - --- Make Location required. -ALTER TABLE dbo.[Parcels] -ALTER COLUMN - [Location] GEOGRAPHY NOT NULL diff --git a/backend/dal/Migrations/v01.03.00/Down/PostDown/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.03.00/Down/PostDown/01-NotificationTemplates.sql deleted file mode 100644 index e7666f9b60..0000000000 --- a/backend/dal/Migrations/v01.03.00/Down/PostDown/01-NotificationTemplates.sql +++ /dev/null @@ -1,10 +0,0 @@ -PRINT 'Updating NotificationTemplates' - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@Model.Environment.Title -

Dear @Model.Project.Manager,

Your project @Model.Project.ProjectNumber has been updated with the following note;

@Model.Project.PublicNote

' -WHERE [Id] = 16 - diff --git a/backend/dal/Migrations/v01.03.00/Down/PostDown/01-ProjectNotes.sql b/backend/dal/Migrations/v01.03.00/Down/PostDown/01-ProjectNotes.sql deleted file mode 100644 index ee44c85721..0000000000 --- a/backend/dal/Migrations/v01.03.00/Down/PostDown/01-ProjectNotes.sql +++ /dev/null @@ -1,54 +0,0 @@ -PRINT 'Update ProjectNotes' - -DECLARE @GeneralNote INT = 0; -DECLARE @PublicNote INT = 1; -DECLARE @PrivateNote INT = 2; -DECLARE @ExemptionNote INT = 3; -DECLARE @AgencyInterestNote INT = 4; -DECLARE @FinancialNote INT = 5; -DECLARE @PreMarketingNote INT = 6; -DECLARE @MarketingNote INT = 7; -DECLARE @ContractInPlaceNote INT = 8; -DECLARE @ReportingNote INT = 9; -DECLARE @LoanTermsNote INT = 10; -DECLARE @AdjustmentNote INT = 11; -DECLARE @SplCostNote INT = 12; -DECLARE @SplGainNote INT = 13; -DECLARE @SalesHistoryNote INT = 14; -DECLARE @CloseOutNote INT = 15; -DECLARE @CommentsNote INT = 16; -DECLARE @AppraisalNote INT = 17; -DECLARE @OfferNote INT = 18; - --- Update the project notes. -UPDATE p SET - p.[Note] = p.[Note] -FROM dbo.[Projects] p -INNER JOIN #ProjectNotes n ON n.[ProjectId] = p.[Id] AND n.[NoteType] = @GeneralNote - -UPDATE p SET - p.[PublicNote] = p.[Note] -FROM dbo.[Projects] p -INNER JOIN #ProjectNotes n ON n.[ProjectId] = p.[Id] AND n.[NoteType] = @PublicNote - -UPDATE p SET - p.[PrivateNote] = p.[Note] -FROM dbo.[Projects] p -INNER JOIN #ProjectNotes n ON n.[ProjectId] = p.[Id] AND n.[NoteType] = @PrivateNote - -UPDATE p SET - p.[AppraisedNote] = p.[Note] -FROM dbo.[Projects] p -INNER JOIN #ProjectNotes n ON n.[ProjectId] = p.[Id] AND n.[NoteType] = @AppraisalNote - -UPDATE p SET - p.[OffersNote] = p.[Note] -FROM dbo.[Projects] p -INNER JOIN #ProjectNotes n ON n.[ProjectId] = p.[Id] AND n.[NoteType] = @OfferNote - -UPDATE p SET - p.[ExemptionRationale] = p.[Note] -FROM dbo.[Projects] p -INNER JOIN #ProjectNotes n ON n.[ProjectId] = p.[Id] AND n.[NoteType] = @ExemptionNote - -DROP TABLE #ProjectNotes diff --git a/backend/dal/Migrations/v01.03.00/Down/PostDown/01-ProjectSnapshots.sql b/backend/dal/Migrations/v01.03.00/Down/PostDown/01-ProjectSnapshots.sql deleted file mode 100644 index ffff8fdf82..0000000000 --- a/backend/dal/Migrations/v01.03.00/Down/PostDown/01-ProjectSnapshots.sql +++ /dev/null @@ -1,15 +0,0 @@ -PRINT 'Update ProjectSnapshots' - --- Update the project snapshot metadata. -UPDATE p SET - p.[SalesCost] = b.[SalesCost] - , p.[NetProceeds] = b.[NetProceeds] - , p.[ProgramCost] = b.[ProgramCost] - , p.[GainLoss] = b.[GainLoss] - , p.[OcgFinancialStatement] = b.[OcgFinancialStatement] - , p.[InterestComponent] = b.[InterestComponent] - , p.[SaleWithLeaseInPlace] = ISNULL(b.[SaleWithLeaseInPlace], 0) -FROM dbo.[ProjectSnapshots] p -INNER JOIN #ProjectSnapshots b ON b.[Id] = p.[Id] - -DROP TABLE #ProjectSnapshots diff --git a/backend/dal/Migrations/v01.03.00/Down/PostDown/01-Projects.sql b/backend/dal/Migrations/v01.03.00/Down/PostDown/01-Projects.sql deleted file mode 100644 index d1925f796b..0000000000 --- a/backend/dal/Migrations/v01.03.00/Down/PostDown/01-Projects.sql +++ /dev/null @@ -1,10 +0,0 @@ -PRINT 'Update Projects' - --- Update the project metadata. -UPDATE p SET - p.[ExemptionRequested] = ISNULL(b.[ExemptionRequested], 0) -FROM dbo.[Projects] p -INNER JOIN #Projects b ON b.[Id] = p.[Id] - -DROP TABLE #Projects - diff --git a/backend/dal/Migrations/v01.03.00/Down/PostDown/01-ViewProperties.sql b/backend/dal/Migrations/v01.03.00/Down/PostDown/01-ViewProperties.sql deleted file mode 100644 index a25191b006..0000000000 --- a/backend/dal/Migrations/v01.03.00/Down/PostDown/01-ViewProperties.sql +++ /dev/null @@ -1,219 +0,0 @@ -PRINT 'Updating View_Properties' -GO --- This script provides a way to union both parcels and buildings into a single result of properties. --- Updating view to support many-to-many parcels and buildings.TEMPORARY -CREATE OR ALTER VIEW dbo.[View_Properties] AS -SELECT - p.[Id] - , [PropertyTypeId] = 0 - , p.[ClassificationId] - , [Classification] = c.[Name] - , p.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , p.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [AdministrativeArea] = adr.[AdministrativeArea] - , [Province] = ap.[Name] - , adr.[Postal] - , p.[ProjectNumber] - , p.[Name] - , p.[Description] - , p.[Location] - , p.[Boundary] - , p.[IsSensitive] - , p.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , p.[PID] - , p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [ParcelId] = p.[Id] - , [BuildingConstructionTypeId] = 0 - , [BuildingConstructionType] = null - , [BuildingFloorCount] = 0 - , [BuildingPredominateUseId] = 0 - , [BuildingPredominateUse] = null - , [BuildingOccupantTypeId] = 0 - , [BuildingOccupantType] = null - , [BuildingTenancy] = null - , [RentableArea] = 0 - , [LeaseExpiry] = null - , [OccupantName] = null - , [TransferLeaseOnSale] = CAST(0 AS BIT) - - , [Assessed] = ISNULL(eas.[Value], 0) - , [AssessedDate] = eas.[Date] - , [Appraised] = ISNULL(eap.[Value], 0) - , [AppraisedDate] = eap.[Date] - , [Estimated] = ISNULL(fe.[Value], 0) - , [EstimatedFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] -FROM dbo.[Parcels] p -JOIN dbo.[PropertyClassifications] c ON p.[ClassificationId] = c.[Id] -JOIN dbo.[Agencies] a ON p.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON p.[AddressId] = adr.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- [Assessed] - ORDER BY [Date] DESC -) AS eas -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 1 -- Appraised - ORDER BY [Date] DESC -) AS eap -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 1 -- Estimated - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn -UNION ALL -SELECT - b.[Id] - , [PropertyTypeId] = 1 - , b.[ClassificationId] - , [Classification] = c.[Name] - , b.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , b.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [AdministrativeArea] = adr.[AdministrativeArea] - , [Province] = ap.[Name] - , adr.[Postal] - , b.[ProjectNumber] - , b.[Name] - , b.[Description] - , b.[Location] - , b.[Boundary] - , b.[IsSensitive] - , b.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , [PID] = p.[PID] - , [PIN] = p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [ParcelId] = p.[Id] - , [BuildingConstructionTypeId] = b.[BuildingConstructionTypeId] - , [BuildingConstructionType] = bct.[Name] - , [BuildingFloorCount] = b.[BuildingFloorCount] - , [BuildingPredominateUseId] = b.[BuildingPredominateUseId] - , [BuildingPredominateUse] = bpu.[Name] - , [BuildingOccupantTypeId] = b.[BuildingOccupantTypeId] - , [BuildingOccupantType] = bot.[Name] - , [BuildingTenancy] = b.[BuildingTenancy] - , [RentableArea] = b.[RentableArea] - , [LeaseExpiry] = b.[LeaseExpiry] - , [OccupantName] = b.[OccupantName] - , [TransferLeaseOnSale] = b.[TransferLeaseOnSale] - - , [Assessed] = ISNULL(eas.[Value], 0) - , [AssessedDate] = eas.[Date] - , [Appraised] = ISNULL(eap.[Value], 0) - , [AppraisedDate] = eap.[Date] - , [Estimated] = ISNULL(fe.[Value], 0) - , [EstimatedFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] -FROM dbo.[Buildings] b -LEFT JOIN dbo.[ParcelBuildings] pb ON b.[Id] = pb.[BuildingId] -LEFT JOIN dbo.[Parcels] p ON pb.[ParcelId] = p.[Id] -JOIN dbo.[PropertyClassifications] c ON b.[ClassificationId] = c.[Id] -JOIN dbo.[Agencies] a ON b.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON b.[AddressId] = adr.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -JOIN dbo.[BuildingConstructionTypes] bct ON b.[BuildingConstructionTypeId] = bct.[Id] -JOIN dbo.[BuildingOccupantTypes] bot ON b.[BuildingOccupantTypeId] = bot.[Id] -JOIN dbo.[BuildingPredominateUses] bpu ON b.[BuildingPredominateUseId] = bpu.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[BuildingEvaluations] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- [Assessed] - ORDER BY [Date] DESC -) AS eas -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[BuildingEvaluations] - WHERE [BuildingId] = b.[Id] - AND [Key] = 1 -- Appraised - ORDER BY [Date] DESC -) AS eap -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 1 -- Estimated - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn diff --git a/backend/dal/Migrations/v01.03.00/Down/PreDown/01-ProjectNotes.sql b/backend/dal/Migrations/v01.03.00/Down/PreDown/01-ProjectNotes.sql deleted file mode 100644 index 68b62c3fa5..0000000000 --- a/backend/dal/Migrations/v01.03.00/Down/PreDown/01-ProjectNotes.sql +++ /dev/null @@ -1,29 +0,0 @@ -PRINT 'Backup Project Notes' - -DECLARE @GeneralNote INT = 0; -DECLARE @PublicNote INT = 1; -DECLARE @PrivateNote INT = 2; -DECLARE @ExemptionNote INT = 3; -DECLARE @AgencyInterestNote INT = 4; -DECLARE @FinancialNote INT = 5; -DECLARE @PreMarketingNote INT = 6; -DECLARE @MarketingNote INT = 7; -DECLARE @ContractInPlaceNote INT = 8; -DECLARE @ReportingNote INT = 9; -DECLARE @LoanTermsNote INT = 10; -DECLARE @AdjustmentNote INT = 11; -DECLARE @SplCostNote INT = 12; -DECLARE @SplGainNote INT = 13; -DECLARE @SalesHistoryNote INT = 14; -DECLARE @CloseOutNote INT = 15; -DECLARE @CommentsNote INT = 16; -DECLARE @AppraisalNote INT = 17; -DECLARE @OfferNote INT = 18; - --- Create temporary table to store the note values -SELECT n.[ProjectId] - , n.[NoteType] - , n.[Note] -INTO #ProjectNotes -FROM dbo.[ProjectNotes] n -WHERE n.[NoteType] IN (@GeneralNote, @PublicNote, @PrivateNote, @AppraisalNote, @OfferNote, @ExemptionNote) diff --git a/backend/dal/Migrations/v01.03.00/Down/PreDown/01-ProjectSnapshots.sql b/backend/dal/Migrations/v01.03.00/Down/PreDown/01-ProjectSnapshots.sql deleted file mode 100644 index 14cedf5f5a..0000000000 --- a/backend/dal/Migrations/v01.03.00/Down/PreDown/01-ProjectSnapshots.sql +++ /dev/null @@ -1,14 +0,0 @@ -PRINT 'Backup Project Snapshots' - --- Create temporary table to store the snapshot values -SELECT - p.[Id] - , (SELECT [SalesCost] FROM OPENJSON(p.[Metadata]) WITH ([SalesCost] MONEY '$.SalesCost')) AS [SalesCost] - , (SELECT [NetProceeds] FROM OPENJSON(p.[Metadata]) WITH ([NetProceeds] MONEY '$.NetProceeds')) AS [NetProceeds] - , (SELECT [ProgramCost] FROM OPENJSON(p.[Metadata]) WITH ([ProgramCost] MONEY '$.ProgramCost')) AS [ProgramCost] - , (SELECT [GainLoss] FROM OPENJSON(p.[Metadata]) WITH ([GainLoss] MONEY '$.GainLoss')) AS [GainLoss] - , (SELECT [OcgFinancialStatement] FROM OPENJSON(p.[Metadata]) WITH ([OcgFinancialStatement] MONEY '$.OcgFinancialStatement')) AS [OcgFinancialStatement] - , (SELECT [InterestComponent] FROM OPENJSON(p.[Metadata]) WITH ([InterestComponent] MONEY '$.InterestComponent')) AS [InterestComponent] - , (SELECT ISNULL([SaleWithLeaseInPlace], 0) FROM OPENJSON(p.[Metadata]) WITH ([SaleWithLeaseInPlace] BIT '$.SaleWithLeaseInPlace')) AS [SaleWithLeaseInPlace] -INTO #ProjectSnapshots -FROM dbo.[ProjectSnapshots] p diff --git a/backend/dal/Migrations/v01.03.00/Down/PreDown/01-Projects.sql b/backend/dal/Migrations/v01.03.00/Down/PreDown/01-Projects.sql deleted file mode 100644 index 88ffafb62d..0000000000 --- a/backend/dal/Migrations/v01.03.00/Down/PreDown/01-Projects.sql +++ /dev/null @@ -1,52 +0,0 @@ -PRINT 'Backup Projects' - --- Create temporary table to store the project values -SELECT - p.[Id] - , (SELECT [ExemptionRequested] FROM OPENJSON(p.[Metadata]) WITH ([ExemptionRequested] NVARCHAR(MAX) '$.ExemptionRequested')) AS [ExemptionRequested] - , (SELECT [AssessedOn] FROM OPENJSON(p.[Metadata]) WITH ([AssessedOn] NVARCHAR(20) '$.AssessedOn')) AS [AssessedOn] - , (SELECT [InitialNotificationSentOn] FROM OPENJSON(p.[Metadata]) WITH ([InitialNotificationSentOn] NVARCHAR(20) '$.InitialNotificationSentOn')) AS [InitialNotificationSentOn] - , (SELECT [ThirtyDayNotificationSentOn] FROM OPENJSON(p.[Metadata]) WITH ([ThirtyDayNotificationSentOn] NVARCHAR(20) '$.ThirtyDayNotificationSentOn')) AS [ThirtyDayNotificationSentOn] - , (SELECT [SixtyDayNotificationSentOn] FROM OPENJSON(p.[Metadata]) WITH ([SixtyDayNotificationSentOn] NVARCHAR(20) '$.SixtyDayNotificationSentOn')) AS [SixtyDayNotificationSentOn] - , (SELECT [NinetyDayNotificationSentOn] FROM OPENJSON(p.[Metadata]) WITH ([NinetyDayNotificationSentOn] NVARCHAR(20) '$.NinetyDayNotificationSentOn')) AS [NinetyDayNotificationSentOn] - , (SELECT [OnHoldNotificationSentOn] FROM OPENJSON(p.[Metadata]) WITH ([OnHoldNotificationSentOn] NVARCHAR(20) '$.OnHoldNotificationSentOn')) AS [OnHoldNotificationSentOn] - , (SELECT [TransferredWithinGreOn] FROM OPENJSON(p.[Metadata]) WITH ([TransferredWithinGreOn] NVARCHAR(20) '$.TransferredWithinGreOn')) AS [TransferredWithinGreOn] - , (SELECT [ClearanceNotificationSentOn] FROM OPENJSON(p.[Metadata]) WITH ([ClearanceNotificationSentOn] NVARCHAR(20) '$.ClearanceNotificationSentOn')) AS [ClearanceNotificationSentOn] - , (SELECT [MarketedOn] FROM OPENJSON(p.[Metadata]) WITH ([MarketedOn] NVARCHAR(20) '$.MarketedOn')) AS [MarketedOn] - , (SELECT [Purchaser] FROM OPENJSON(p.[Metadata]) WITH ([Purchaser] NVARCHAR(MAX) '$.Purchaser')) AS [Purchaser] - , (SELECT [IsContractConditional] FROM OPENJSON(p.[Metadata]) WITH ([IsContractConditional] BIT '$.IsContractConditional')) AS [IsContractConditional] - , (SELECT [OfferAcceptedOn] FROM OPENJSON(p.[Metadata]) WITH ([OfferAcceptedOn] NVARCHAR(20) '$.OfferAcceptedOn')) AS [OfferAcceptedOn] - , (SELECT [AdjustedOn] FROM OPENJSON(p.[Metadata]) WITH ([AdjustedOn] NVARCHAR(20) '$.AdjustedOn')) AS [AdjustedOn] - , (SELECT [DisposedOn] FROM OPENJSON(p.[Metadata]) WITH ([DisposedOn] NVARCHAR(20) '$.DisposedOn')) AS [DisposedOn] - - , (SELECT [AppraisedBy] FROM OPENJSON(p.[Metadata]) WITH ([AppraisedBy] NVARCHAR(MAX) '$.AppraisedBy')) AS [AppraisedBy] - , (SELECT [AppraisedOn] FROM OPENJSON(p.[Metadata]) WITH ([AppraisedOn] NVARCHAR(20) '$.AppraisedOn')) AS [AppraisedOn] - , (SELECT [SalesCost] FROM OPENJSON(p.[Metadata]) WITH ([SalesCost] MONEY '$.SalesCost')) AS [SalesCost] - , (SELECT [NetProceeds] FROM OPENJSON(p.[Metadata]) WITH ([NetProceeds] MONEY '$.NetProceeds')) AS [NetProceeds] - , (SELECT [ProgramCost] FROM OPENJSON(p.[Metadata]) WITH ([ProgramCost] MONEY '$.ProgramCost')) AS [ProgramCost] - , (SELECT [GainLoss] FROM OPENJSON(p.[Metadata]) WITH ([GainLoss] MONEY '$.GainLoss')) AS [GainLoss] - , (SELECT [SppCapitalization] FROM OPENJSON(p.[Metadata]) WITH ([SppCapitalization] MONEY '$.SppCapitalization')) AS [SppCapitalization] - , (SELECT [GainBeforeSpp] FROM OPENJSON(p.[Metadata]) WITH ([GainBeforeSpp] MONEY '$.GainBeforeSpp')) AS [GainBeforeSpp] - , (SELECT [GainAfterSpp] FROM OPENJSON(p.[Metadata]) WITH ([GainAfterSpp] MONEY '$.GainAfterSpp')) AS [GainAfterSpp] - , (SELECT [OcgFinancialStatement] FROM OPENJSON(p.[Metadata]) WITH ([OcgFinancialStatement] MONEY '$.OcgFinancialStatement')) AS [OcgFinancialStatement] - , (SELECT [InterestComponent] FROM OPENJSON(p.[Metadata]) WITH ([InterestComponent] MONEY '$.InterestComponent')) AS [InterestComponent] - , (SELECT [OfferAmount] FROM OPENJSON(p.[Metadata]) WITH ([OfferAmount] MONEY '$.OfferAmount')) AS [OfferAmount] - , (SELECT [SaleWithLeaseInPlace] FROM OPENJSON(p.[Metadata]) WITH ([SaleWithLeaseInPlace] BIT '$.SaleWithLeaseInPlace')) AS [SaleWithLeaseInPlace] - - , (SELECT [Realtor] FROM OPENJSON(p.[Metadata]) WITH ([Realtor] NVARCHAR(MAX) '$.Realtor')) AS [Realtor] - , (SELECT [RealtorRate] FROM OPENJSON(p.[Metadata]) WITH ([RealtorRate] NVARCHAR(MAX) '$.RealtorRate')) AS [RealtorRate] - , (SELECT [RealtorCommission] FROM OPENJSON(p.[Metadata]) WITH ([RealtorCommission] MONEY '$.RealtorCommission')) AS [RealtorCommission] - - , (SELECT [Remediation] FROM OPENJSON(p.[Metadata]) WITH ([Remediation] NVARCHAR(MAX) '$.Remediation')) AS [Remediation] - , (SELECT [PlannedFutureUse] FROM OPENJSON(p.[Metadata]) WITH ([PlannedFutureUse] NVARCHAR(MAX) '$.PlannedFutureUse')) AS [PlannedFutureUse] - - , (SELECT [PriorYearAdjustment] FROM OPENJSON(p.[Metadata]) WITH ([PriorYearAdjustment] BIT '$.PriorYearAdjustment')) AS [PriorYearAdjustment] - , (SELECT [PriorYearAdjustmentOn] FROM OPENJSON(p.[Metadata]) WITH ([PriorYearAdjustmentOn] NVARCHAR(20) '$.PriorYearAdjustmentOn')) AS [PriorYearAdjustmentOn] - , (SELECT [PriorYearAdjustmentAmount] FROM OPENJSON(p.[Metadata]) WITH ([PriorYearAdjustmentAmount] NVARCHAR(MAX) '$.PriorYearAdjustmentAmount')) AS [PriorYearAdjustmentAmount] - - , (SELECT [PreliminaryFormSignedOn] FROM OPENJSON(p.[Metadata]) WITH ([PreliminaryFormSignedOn] NVARCHAR(20) '$.PreliminaryFormSignedOn')) AS [PreliminaryFormSignedOn] - , (SELECT [PreliminaryFormSignedBy] FROM OPENJSON(p.[Metadata]) WITH ([PreliminaryFormSignedBy] NVARCHAR(MAX) '$.PreliminaryFormSignedBy')) AS [PreliminaryFormSignedBy] - , (SELECT [FinalFormSignedOn] FROM OPENJSON(p.[Metadata]) WITH ([FinalFormSignedOn] NVARCHAR(20) '$.FinalFormSignedOn')) AS [FinalFormSignedOn] - , (SELECT [FinalFormSignedBy] FROM OPENJSON(p.[Metadata]) WITH ([FinalFormSignedBy] NVARCHAR(MAX) '$.FinalFormSignedBy')) AS [FinalFormSignedBy] -INTO #Projects -FROM dbo.[Projects] p diff --git a/backend/dal/Migrations/v01.03.00/Up/PostUp/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.03.00/Up/PostUp/01-NotificationTemplates.sql deleted file mode 100644 index 8107b2b699..0000000000 --- a/backend/dal/Migrations/v01.03.00/Up/PostUp/01-NotificationTemplates.sql +++ /dev/null @@ -1,9 +0,0 @@ -PRINT 'Updating NotificationTemplates' - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@Model.Environment.Title -

Dear @Model.Project.Manager,

Your project @Model.Project.ProjectNumber has been updated with the following note;

@Model.Project.Notes.FirstOrDefault(n => n.NoteType == NoteTypes.Public)?.Note

' -WHERE [Id] = 16 diff --git a/backend/dal/Migrations/v01.03.00/Up/PostUp/01-ProjectNotes.sql b/backend/dal/Migrations/v01.03.00/Up/PostUp/01-ProjectNotes.sql deleted file mode 100644 index 236b7a1fec..0000000000 --- a/backend/dal/Migrations/v01.03.00/Up/PostUp/01-ProjectNotes.sql +++ /dev/null @@ -1,90 +0,0 @@ -PRINT 'Update ProjectNotes' - -DECLARE @GeneralNote INT = 0; -DECLARE @PublicNote INT = 1; -DECLARE @PrivateNote INT = 2; -DECLARE @ExemptionNote INT = 3; -DECLARE @AgencyInterestNote INT = 4; -DECLARE @FinancialNote INT = 5; -DECLARE @PreMarketingNote INT = 6; -DECLARE @MarketingNote INT = 7; -DECLARE @ContractInPlaceNote INT = 8; -DECLARE @ReportingNote INT = 9; -DECLARE @LoanTermsNote INT = 10; -DECLARE @AdjustmentNote INT = 11; -DECLARE @SplCostNote INT = 12; -DECLARE @SplGainNote INT = 13; -DECLARE @SalesHistoryNote INT = 14; -DECLARE @CloseOutNote INT = 15; -DECLARE @CommentsNote INT = 16; -DECLARE @AppraisalNote INT = 17; -DECLARE @OfferNote INT = 18; - --- Add the project notes. -INSERT INTO dbo.[ProjectNotes] ( - [ProjectId] - , [NoteType] - , [Note] -) -SELECT - [Id] - , @GeneralNote - , ISNULL([General], '') -FROM #ProjectNotes - -INSERT INTO dbo.[ProjectNotes] ( - [ProjectId] - , [NoteType] - , [Note] -) -SELECT - [Id] - , @PublicNote - , ISNULL([Public], '') -FROM #ProjectNotes - -INSERT INTO dbo.[ProjectNotes] ( - [ProjectId] - , [NoteType] - , [Note] -) -SELECT - [Id] - , @PrivateNote - , ISNULL([Private], '') -FROM #ProjectNotes - -INSERT INTO dbo.[ProjectNotes] ( - [ProjectId] - , [NoteType] - , [Note] -) -SELECT - [Id] - , @AppraisalNote - , ISNULL([Appraisal], '') -FROM #ProjectNotes - -INSERT INTO dbo.[ProjectNotes] ( - [ProjectId] - , [NoteType] - , [Note] -) -SELECT - [Id] - , @OfferNote - , ISNULL([Offer], '') -FROM #ProjectNotes - -INSERT INTO dbo.[ProjectNotes] ( - [ProjectId] - , [NoteType] - , [Note] -) -SELECT - [Id] - , @ExemptionNote - , ISNULL([Exemption], '') -FROM #ProjectNotes - -DROP TABLE #ProjectNotes diff --git a/backend/dal/Migrations/v01.03.00/Up/PostUp/01-ProjectSnapshots.sql b/backend/dal/Migrations/v01.03.00/Up/PostUp/01-ProjectSnapshots.sql deleted file mode 100644 index 047e96e3aa..0000000000 --- a/backend/dal/Migrations/v01.03.00/Up/PostUp/01-ProjectSnapshots.sql +++ /dev/null @@ -1,9 +0,0 @@ -PRINT 'Update ProjectSnapshots' - --- Update the project snapshot metadata. -UPDATE p SET - p.[Metadata] = b.[Metadata] -FROM dbo.[ProjectSnapshots] p -INNER JOIN #ProjectSnapshots b ON b.[Id] = p.[Id] - -DROP TABLE #ProjectSnapshots diff --git a/backend/dal/Migrations/v01.03.00/Up/PostUp/01-Projects.sql b/backend/dal/Migrations/v01.03.00/Up/PostUp/01-Projects.sql deleted file mode 100644 index b948b66e30..0000000000 --- a/backend/dal/Migrations/v01.03.00/Up/PostUp/01-Projects.sql +++ /dev/null @@ -1,9 +0,0 @@ -PRINT 'Update Projects' - --- Update the project metadata. -UPDATE p SET - p.[Metadata] = b.[Metadata] -FROM dbo.[Projects] p -INNER JOIN #Projects b ON b.[Id] = p.[Id] - -DROP TABLE #Projects diff --git a/backend/dal/Migrations/v01.03.00/Up/PreUp/01-Agencies.sql b/backend/dal/Migrations/v01.03.00/Up/PreUp/01-Agencies.sql deleted file mode 100644 index afa15a12f9..0000000000 --- a/backend/dal/Migrations/v01.03.00/Up/PreUp/01-Agencies.sql +++ /dev/null @@ -1,277 +0,0 @@ -PRINT 'Adding Agencies' - -SET IDENTITY_INSERT dbo.[Agencies] ON - -MERGE INTO dbo.[Agencies] dest -USING ( - -- Child Agencies for MAH. - VALUES ( - 42 - , 8 - , 'PRHC' - , 'Provincial Rental Housing Corporation' - , 0 - , 0 - ) - - -- Child Agencies for MAG. - , ( - 51 - , 11 - , 'LDB' - , 'BC Liquor Distribution Branch' - , 0 - , 0 - ) - - -- Child Agencies for EDUC. - , ( - 150 - , 4 - , 'SD 06' - , 'School District 06' - , 0 - , 0 - ), ( - 151 - , 4 - , 'SD 19' - , 'School District 19' - , 0 - , 0 - ), ( - 152 - , 4 - , 'SD 20' - , 'School District 20' - , 0 - , 0 - ), ( - 153 - , 4 - , 'SD 22' - , 'School District 22' - , 0 - , 0 - ), ( - 154 - , 4 - , 'SD 23' - , 'School District 23' - , 0 - , 0 - ), ( - 155 - , 4 - , 'SD 28' - , 'School District 28' - , 0 - , 0 - ), ( - 156 - , 4 - , 'SD 33' - , 'School District 33' - , 0 - , 0 - ), ( - 157 - , 4 - , 'SD 35' - , 'School District 35' - , 0 - , 0 - ), ( - 158 - , 4 - , 'SD 36' - , 'School District 36' - , 0 - , 0 - ), ( - 159 - , 4 - , 'SD 37' - , 'School District 37' - , 0 - , 0 - ), ( - 160 - , 4 - , 'SD 38' - , 'School District 38' - , 0 - , 0 - ), ( - 161 - , 4 - , 'SD 40' - , 'School District 40' - , 0 - , 0 - ), ( - 162 - , 4 - , 'SD 41' - , 'School District 41' - , 0 - , 0 - ), ( - 163 - , 4 - , 'SD 42' - , 'School District 42' - , 0 - , 0 - ), ( - 164 - , 4 - , 'SD 43' - , 'School District 43' - , 0 - , 0 - ), ( - 165 - , 4 - , 'SD 44' - , 'School District 44' - , 0 - , 0 - ), ( - 166 - , 4 - , 'SD 47' - , 'School District 47' - , 0 - , 0 - ), ( - 167 - , 4 - , 'SD 62' - , 'School District 62' - , 0 - , 0 - ), ( - 168 - , 4 - , 'SD 63' - , 'School District 63' - , 0 - , 0 - ), ( - 169 - , 4 - , 'SD 68' - , 'School District 68' - , 0 - , 0 - ), ( - 170 - , 4 - , 'SD 70' - , 'School District 70' - , 0 - , 0 - ), ( - 171 - , 4 - , 'SD 71' - , 'School District 71' - , 0 - , 0 - ), ( - 172 - , 4 - , 'SD 72' - , 'School District 72' - , 0 - , 0 - ), ( - 173 - , 4 - , 'SD 73' - , 'School District 73' - , 0 - , 0 - ), ( - 174 - , 4 - , 'SD 75' - , 'School District 75' - , 0 - , 0 - ), ( - 175 - , 4 - , 'SD 78' - , 'School District 78' - , 0 - , 0 - ), ( - 176 - , 4 - , 'SD 79' - , 'School District 79' - , 0 - , 0 - ), ( - 177 - , 4 - , 'SD 83' - , 'School District 83' - , 0 - , 0 - ), ( - 178 - , 4 - , 'SD 91' - , 'School District 91' - , 0 - , 0 - ) - - -- Child Agencies for TRAN. - , ( - 132 - , 9 - , 'BCTFA' - , 'BC Transportation Financing Authority' - , 0 - , 0 - ) -) AS src ( - [Id] - , [ParentId] - , [Code] - , [Name] - , [IsDisabled] - , [SendEmail] -) -ON dest.[Id] = src.[Id] -WHEN MATCHED THEN - UPDATE - SET - dest.[ParentId] = src.[ParentId] - , dest.[Code] = src.[Code] - , dest.[Name] = src.[Name] - , dest.[IsDisabled] = src.[IsDisabled] - , dest.[SendEmail] = src.[SendEmail] -WHEN NOT MATCHED THEN - INSERT ( - [Id] - , [ParentId] - , [Code] - , [Name] - , [IsDisabled] - , [SendEmail] - ) VALUES ( - src.[id] - , src.[ParentId] - , src.[Code] - , src.[Name] - , src.[IsDisabled] - , src.[SendEmail] - ); - -SET IDENTITY_INSERT dbo.[Agencies] OFF - diff --git a/backend/dal/Migrations/v01.03.00/Up/PreUp/01-ProjectNotes.sql b/backend/dal/Migrations/v01.03.00/Up/PreUp/01-ProjectNotes.sql deleted file mode 100644 index 08456a5dd3..0000000000 --- a/backend/dal/Migrations/v01.03.00/Up/PreUp/01-ProjectNotes.sql +++ /dev/null @@ -1,12 +0,0 @@ -PRINT 'Backup Project Notes' - --- Create temporary table to store the note values -SELECT p.[Id] - , p.[Note] AS [General] - , p.[PublicNote] AS [Public] - , p.[PrivateNote] AS [Private] - , p.[AppraisedNote] AS [Appraisal] - , p.[OffersNote] AS [Offer] - , p.[ExemptionRationale] AS [Exemption] -INTO #ProjectNotes -FROM dbo.[Projects] p diff --git a/backend/dal/Migrations/v01.03.00/Up/PreUp/01-ProjectSnapshots.sql b/backend/dal/Migrations/v01.03.00/Up/PreUp/01-ProjectSnapshots.sql deleted file mode 100644 index 70d59d786e..0000000000 --- a/backend/dal/Migrations/v01.03.00/Up/PreUp/01-ProjectSnapshots.sql +++ /dev/null @@ -1,14 +0,0 @@ -PRINT 'Backup Project Snapshots' - --- Create temporary table to store the snapshot values -SELECT - p.[Id] - , '{ "SalesCost":' + CAST(p.[SalesCost] AS NVARCHAR) + ' - , "NetProceeds":' + CAST(p.[NetProceeds] AS NVARCHAR) + ' - , "ProgramCost":' + CAST(p.[ProgramCost] AS NVARCHAR) + ' - , "GainLoss":' + CAST(p.[GainLoss] AS NVARCHAR) + ' - , "OcgFinancialStatement":' + CAST(p.[OcgFinancialStatement] AS NVARCHAR) + ' - , "InterestComponent":' + CAST(p.[InterestComponent] AS NVARCHAR) + ' - , "SaleWithLeaseInPlace":' + (CASE WHEN p.[SaleWithLeaseInPlace] = 1 THEN 'true' ELSE 'false' END) + ' }' AS [Metadata] -INTO #ProjectSnapshots -FROM dbo.[ProjectSnapshots] p diff --git a/backend/dal/Migrations/v01.03.00/Up/PreUp/01-Projects.sql b/backend/dal/Migrations/v01.03.00/Up/PreUp/01-Projects.sql deleted file mode 100644 index bd8773a60e..0000000000 --- a/backend/dal/Migrations/v01.03.00/Up/PreUp/01-Projects.sql +++ /dev/null @@ -1,54 +0,0 @@ -PRINT 'Backup Projects' - --- Create temporary table to store the project values -SELECT - p.[Id] - , CASE WHEN p.[Metadata] IS NULL THEN '{}' ELSE '{ ' + - '"ExemptionRequested": ' + (CASE WHEN p.[ExemptionRequested] = 1 THEN 'true' ELSE 'false' END) + ', ' + - - '"AssessedOn": "' + (SELECT [AssessedOn] FROM OPENJSON(p.[Metadata]) WITH ( [AssessedOn] NVARCHAR(20) '$.AssessedOn')) + '", ' + - '"InitialNotificationSentOn": "' + (SELECT [InitialNotificationSentOn] FROM OPENJSON(p.[Metadata]) WITH ( [InitialNotificationSentOn] NVARCHAR(20) '$.InitialNotificationSentOn')) + '", ' + - '"ThirtyDayNotificationSentOn": "' + (SELECT [ThirtyDayNotificationSentOn] FROM OPENJSON(p.[Metadata]) WITH ( [ThirtyDayNotificationSentOn] NVARCHAR(20) '$.ThirtyDayNotificationSentOn')) + '", ' + - '"SixtyDayNotificationSentOn": "' + (SELECT [SixtyDayNotificationSentOn] FROM OPENJSON(p.[Metadata]) WITH ( [SixtyDayNotificationSentOn] NVARCHAR(20) '$.SixtyDayNotificationSentOn')) + '", ' + - '"NinetyDayNotificationSentOn": "' + (SELECT [NinetyDayNotificationSentOn] FROM OPENJSON(p.[Metadata]) WITH ( [NinetyDayNotificationSentOn] NVARCHAR(20) '$.NinetyDayNotificationSentOn')) + '", ' + - '"OnHoldNotificationSentOn": "' + (SELECT [OnHoldNotificationSentOn] FROM OPENJSON(p.[Metadata]) WITH ( [OnHoldNotificationSentOn] NVARCHAR(20) '$.OnHoldNotificationSentOn')) + '", ' + - '"TransferredWithinGreOn": "' + (SELECT [TransferredWithinGreOn] FROM OPENJSON(p.[Metadata]) WITH ( [TransferredWithinGreOn] NVARCHAR(20) '$.TransferredWithinGreOn')) + '", ' + - '"ClearanceNotificationSentOn": "' + (SELECT [ClearanceNotificationSentOn] FROM OPENJSON(p.[Metadata]) WITH ( [ClearanceNotificationSentOn] NVARCHAR(20) '$.ClearanceNotificationSentOn'))+ '", ' + - '"MarketedOn": "' + (SELECT [MarketedOn] FROM OPENJSON(p.[Metadata]) WITH ( [MarketedOn] NVARCHAR(20) '$.MarketedOn')) + '", ' + - '"Purchaser": "' + (SELECT [Purchaser] FROM OPENJSON(p.[Metadata]) WITH ( [Purchaser] NVARCHAR(MAX) '$.Purchaser')) + '", ' + - '"IsContractConditional": ' + (CASE WHEN (SELECT [IsContractConditional] FROM OPENJSON(p.[Metadata]) WITH ( [IsContractConditional] BIT '$.IsContractConditional')) = 1 THEN 'true' ELSE 'false' END) + ', ' + - '"OfferAcceptedOn": "' + (SELECT [OfferAcceptedOn] FROM OPENJSON(p.[Metadata]) WITH ( [OfferAcceptedOn] NVARCHAR(20) '$.OfferAcceptedOn')) + '", ' + - '"AdjustedOn": "' + (SELECT [AdjustedOn] FROM OPENJSON(p.[Metadata]) WITH ( [AdjustedOn] NVARCHAR(20) '$.AdjustedOn')) + '", ' + - '"DisposedOn": "' + (SELECT [DisposedOn] FROM OPENJSON(p.[Metadata]) WITH ( [DisposedOn] NVARCHAR(20) '$.DisposedOn')) + '", ' + - - '"AppraisedBy": "' + (SELECT [AppraisedBy] FROM OPENJSON(p.[Metadata]) WITH ( [AppraisedBy] NVARCHAR(MAX) '$.AppraisedBy')) + '", ' + - '"AppraisedOn": "' + (SELECT [AppraisedOn] FROM OPENJSON(p.[Metadata]) WITH ( [AppraisedOn] NVARCHAR(20) '$.AppraisedOn')) + '", ' + - '"SalesCost": ' + CAST((SELECT [SalesCost] FROM OPENJSON(p.[Metadata]) WITH ( [SalesCost] MONEY '$.SalesCost')) AS NVARCHAR) + ', ' + - '"NetProceeds": ' + CAST((SELECT [NetProceeds] FROM OPENJSON(p.[Metadata]) WITH ( [NetProceeds] MONEY '$.NetProceeds')) AS NVARCHAR) + ', ' + - '"ProgramCost": ' + CAST((SELECT [ProgramCost] FROM OPENJSON(p.[Metadata]) WITH ( [ProgramCost] MONEY '$.ProgramCost')) AS NVARCHAR) + ', ' + - '"GainLoss": ' + CAST((SELECT [GainLoss] FROM OPENJSON(p.[Metadata]) WITH ( [GainLoss] MONEY '$.GainLoss')) AS NVARCHAR) + ', ' + - '"SppCapitalization": ' + CAST((SELECT [SppCapitalization] FROM OPENJSON(p.[Metadata]) WITH ( [SppCapitalization] MONEY '$.SppCapitalization')) AS NVARCHAR) + ', ' + - '"GainBeforeSpp": ' + CAST((SELECT [GainBeforeSpp] FROM OPENJSON(p.[Metadata]) WITH ( [GainBeforeSpp] MONEY '$.GainBeforeSpp')) AS NVARCHAR) + ', ' + - '"GainAfterSpp": ' + CAST((SELECT [GainAfterSpp] FROM OPENJSON(p.[Metadata]) WITH ( [GainAfterSpp] MONEY '$.GainAfterSpp')) AS NVARCHAR) + ', ' + - '"OcgFinancialStatement": ' + CAST((SELECT [OcgFinancialStatement] FROM OPENJSON(p.[Metadata]) WITH ( [OcgFinancialStatement] MONEY '$.OcgFinancialStatement')) AS NVARCHAR) + ', ' + - '"InterestComponent": ' + CAST((SELECT [InterestComponent] FROM OPENJSON(p.[Metadata]) WITH ( [InterestComponent] MONEY '$.InterestComponent')) AS NVARCHAR) + ', ' + - '"OfferAmount": ' + CAST((SELECT [OfferAmount] FROM OPENJSON(p.[Metadata]) WITH ( [OfferAmount] MONEY '$.OfferAmount')) AS NVARCHAR) + ', ' + - '"SaleWithLeaseInPlace": ' + (CASE WHEN (SELECT [SaleWithLeaseInPlace] FROM OPENJSON(p.[Metadata]) WITH ( [SaleWithLeaseInPlace] BIT '$.SaleWithLeaseInPlace')) = 1 THEN 'true' ELSE 'false' END) + ', ' + - - '"Realtor": "' + (SELECT [Realtor] FROM OPENJSON(p.[Metadata]) WITH ( [Realtor] NVARCHAR(MAX) '$.Realtor')) + '", ' + - '"RealtorRate": "' + (SELECT [RealtorRate] FROM OPENJSON(p.[Metadata]) WITH ( [RealtorRate] NVARCHAR(MAX) '$.RealtorRate')) + '", ' + - '"RealtorCommission": ' + CAST((SELECT [RealtorCommission] FROM OPENJSON(p.[Metadata]) WITH ( [RealtorCommission] MONEY '$.RealtorCommission')) AS NVARCHAR) + ', ' + - - '"Remediation": "' + (SELECT [Remediation] FROM OPENJSON(p.[Metadata]) WITH ( [Remediation] NVARCHAR(MAX) '$.Remediation')) + '", ' + - '"PlannedFutureUse": "' + (SELECT [PlannedFutureUse] FROM OPENJSON(p.[Metadata]) WITH ( [PlannedFutureUse] NVARCHAR(MAX) '$.PlannedFutureUse')) + '", ' + - - '"PriorYearAdjustment": ' + (CASE WHEN (SELECT [PriorYearAdjustment] FROM OPENJSON(p.[Metadata]) WITH ( [PriorYearAdjustment] BIT '$.PriorYearAdjustment')) = 1 THEN 'true' ELSE 'false' END) + ', ' + - '"PriorYearAdjustmentOn": "' + (SELECT [PriorYearAdjustmentOn] FROM OPENJSON(p.[Metadata]) WITH ( [PriorYearAdjustmentOn] NVARCHAR(20) '$.PriorYearAdjustmentOn')) + '", ' + - '"PriorYearAdjustmentAmount": ' + CAST((SELECT [PriorYearAdjustmentAmount] FROM OPENJSON(p.[Metadata]) WITH ( [PriorYearAdjustmentAmount] MONEY '$.PriorYearAdjustmentAmount')) AS NVARCHAR) + ', ' + - - '"PreliminaryFormSignedOn": "' + (SELECT [PreliminaryFormSignedOn] FROM OPENJSON(p.[Metadata]) WITH ( [PreliminaryFormSignedOn] NVARCHAR(20) '$.PreliminaryFormSignedOn')) + '", ' + - '"PreliminaryFormSignedBy": "' + (SELECT [PreliminaryFormSignedBy] FROM OPENJSON(p.[Metadata]) WITH ( [PreliminaryFormSignedBy] NVARCHAR(MAX) '$.PreliminaryFormSignedBy')) + '", ' + - '"FinalFormSignedOn": "' + (SELECT [FinalFormSignedOn] FROM OPENJSON(p.[Metadata]) WITH ( [FinalFormSignedOn] NVARCHAR(20) '$.FinalFormSignedOn')) + '", ' + - '"FinalFormSignedBy": "' + (SELECT [FinalFormSignedBy] FROM OPENJSON(p.[Metadata]) WITH ( [FinalFormSignedBy] NVARCHAR(MAX) '$.FinalFormSignedBy')) + '" }' END AS [Metadata] -INTO #Projects -FROM dbo.[Projects] p diff --git a/backend/dal/Migrations/v01.04.00/Down/PostDown/01-ProjectStatusTransitions.sql b/backend/dal/Migrations/v01.04.00/Down/PostDown/01-ProjectStatusTransitions.sql deleted file mode 100644 index 7d869613ca..0000000000 --- a/backend/dal/Migrations/v01.04.00/Down/PostDown/01-ProjectStatusTransitions.sql +++ /dev/null @@ -1,82 +0,0 @@ -PRINT 'Removing ProjectStatusTransitions' - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 6 -- SPL - AND [FromStatusId] = 40 -- Pre-Marketing - AND [ToWorkflowId] = 6 -- SPL - AND [ToStatusId] = 42 -- Contract in Place - Conditional - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 6 -- SPL - AND [FromStatusId] = 40 -- Pre-Marketing - AND [ToWorkflowId] = 6 -- SPL - AND [ToStatusId] = 43 -- Contract in Place - Unconditional - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 6 -- SPL - AND [FromStatusId] = 42 -- Contract in Place - Conditional - AND [ToWorkflowId] = 6 -- SPL - AND [ToStatusId] = 41 -- Marketing - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 6 -- SPL - AND [FromStatusId] = 42 -- Contract in Place - Conditional - AND [ToWorkflowId] = 6 -- SPL - AND [ToStatusId] = 43 -- Contract in Place - Unconditional - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 6 -- SPL - AND [FromStatusId] = 41 -- Marketing - AND [ToWorkflowId] = 6 -- SPL - AND [ToStatusId] = 43 -- Contract in Place - Unconditional - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 6 -- SPL - AND [FromStatusId] = 43 -- Contract in Place - Unconditional - AND [ToWorkflowId] = 6 -- SPL - AND [ToStatusId] = 32 -- Disposed - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 6 -- SPL - AND [FromStatusId] = 43 -- Contract in Place - Unconditional - AND [ToWorkflowId] = 6 -- SPL - AND [ToStatusId] = 41 -- Marketing - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 6 -- SPL - AND [FromStatusId] = 43 -- Contract in Place - Unconditional - AND [ToWorkflowId] = 6 -- SPL - AND [ToStatusId] = 40 -- Pre-Marketing - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 6 -- SPL - AND [FromStatusId] = 43 -- Contract in Place - Unconditional - AND [ToWorkflowId] = 6 -- SPL - AND [ToStatusId] = 23 -- Cancelled - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 6 -- SPL - AND [FromStatusId] = 40 -- Pre-Marketing - AND [ToWorkflowId] = 5 -- ERP - AND [ToStatusId] = 22 -- Not in SPL - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 5 -- ERP - AND [FromStatusId] = 22 -- Not in SPL - AND [ToWorkflowId] = 6 -- SPL - AND [ToStatusId] = 21 -- Approved for SPL - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 5 -- ERP - AND [FromStatusId] = 14 -- Approved for ERP - AND [ToWorkflowId] = 6 -- SPL - AND [ToStatusId] = 21 -- Approved for SPL - -UPDATE dbo.[ProjectStatusTransitions] -SET - [Action] = 'Contract in Place' -WHERE - [FromWorkflowId] = 6 - AND [FromStatusId] = 41 - AND [ToWorkflowId] = 6 - AND [ToStatusId] = 42 diff --git a/backend/dal/Migrations/v01.04.00/Down/PostDown/01-WorkflowProjectStatus.sql b/backend/dal/Migrations/v01.04.00/Down/PostDown/01-WorkflowProjectStatus.sql deleted file mode 100644 index 1101de28ff..0000000000 --- a/backend/dal/Migrations/v01.04.00/Down/PostDown/01-WorkflowProjectStatus.sql +++ /dev/null @@ -1,5 +0,0 @@ -PRINT 'Removing WorkflowProjectStatus' - -DELETE FROM dbo.[WorkflowProjectStatus] -WHERE [WorkflowId] = 6 - AND [StatusId] = 43 -- Contract in Place - Unconditional diff --git a/backend/dal/Migrations/v01.04.00/Down/PostDown/03-ProjectStatus.sql b/backend/dal/Migrations/v01.04.00/Down/PostDown/03-ProjectStatus.sql deleted file mode 100644 index ce2183bdbc..0000000000 --- a/backend/dal/Migrations/v01.04.00/Down/PostDown/03-ProjectStatus.sql +++ /dev/null @@ -1,16 +0,0 @@ -PRINT 'Removing ProjectStatus' - -UPDATE dbo.[ProjectStatus] -SET - [Name] = 'Contract in Place' - , [Code] = 'SPL-CIP' - , [Description] = 'The project has received a conditional or unconditional offer.' -WHERE [Id] = 42 - --- Move projects back to the original Contract in Place -UPDATE dbo.[Projects] -SET [StatusId] = 42 -WHERE [StatusId] = 43 - -DELETE FROM dbo.[ProjectStatus] -WHERE [Id] = 43 diff --git a/backend/dal/Migrations/v01.04.00/Up/PostUp/01-ProjectStatus.sql b/backend/dal/Migrations/v01.04.00/Up/PostUp/01-ProjectStatus.sql deleted file mode 100644 index 115671d116..0000000000 --- a/backend/dal/Migrations/v01.04.00/Up/PostUp/01-ProjectStatus.sql +++ /dev/null @@ -1,38 +0,0 @@ -PRINT 'Adding ProjectStatus' - -SET IDENTITY_INSERT dbo.[ProjectStatus] ON - -INSERT INTO dbo.[ProjectStatus] ( - [Id] - , [SortOrder] - , [Name] - , [GroupName] - , [Code] - , [IsTerminal] - , [IsDisabled] - , [Description] - , [Route] - , [IsMilestone] -) VALUES --- SPL process -( - 43 - , 20 - , 'Contract in Place - Unconditional' - , 'Contract in Place' - , 'SPL-CIP-U' - , 0 - , 0 - , 'The project has received an unconditional offer.' - , '/projects/contractinplace' - , 0 -) - -SET IDENTITY_INSERT dbo.[ProjectStatus] OFF - -UPDATE dbo.[ProjectStatus] -SET - [Name] = 'Contract in Place - Conditional' - , [Code] = 'SPL-CIP-C' - , [Description] = 'The project has received a conditional offer.' -WHERE [Id] = 42 diff --git a/backend/dal/Migrations/v01.04.00/Up/PostUp/01-Tasks.sql b/backend/dal/Migrations/v01.04.00/Up/PostUp/01-Tasks.sql deleted file mode 100644 index f324a18118..0000000000 --- a/backend/dal/Migrations/v01.04.00/Up/PostUp/01-Tasks.sql +++ /dev/null @@ -1,6 +0,0 @@ -PRINT 'Delete Tasks' - --- Delete 'Appraisal completed' --- Delete 'Bid Rigging, Collusion and Bias' -DELETE FROM dbo.[Tasks] -WHERE [Id] IN (8, 16, 17) diff --git a/backend/dal/Migrations/v01.04.00/Up/PostUp/01-WorkflowProjectStatus.sql b/backend/dal/Migrations/v01.04.00/Up/PostUp/01-WorkflowProjectStatus.sql deleted file mode 100644 index a744120cfc..0000000000 --- a/backend/dal/Migrations/v01.04.00/Up/PostUp/01-WorkflowProjectStatus.sql +++ /dev/null @@ -1,26 +0,0 @@ -PRINT 'Adding WorkflowProjectStatus' - -INSERT INTO dbo.[WorkflowProjectStatus] ( - [WorkflowId] - , [StatusId] - , [IsOptional] - , [SortOrder] -) VALUES ( - 6 -- SPL - , 43 -- Contract in Place - Unconditional - , 0 - , 5 -) - --- Reorder the subsequent project status. -UPDATE dbo.[WorkflowProjectStatus] -SET - [SortOrder] = 6 -WHERE [WorkflowId] = 6 - AND [StatusId] = 32 -- Disposed - -UPDATE dbo.[WorkflowProjectStatus] -SET - [SortOrder] = 7 -WHERE [WorkflowId] = 6 - AND [StatusId] = 23 -- Cancelled diff --git a/backend/dal/Migrations/v01.04.00/Up/PostUp/02-ProjectStatusTransitions.sql b/backend/dal/Migrations/v01.04.00/Up/PostUp/02-ProjectStatusTransitions.sql deleted file mode 100644 index d7a8a88350..0000000000 --- a/backend/dal/Migrations/v01.04.00/Up/PostUp/02-ProjectStatusTransitions.sql +++ /dev/null @@ -1,120 +0,0 @@ -PRINT 'Adding ProjectStatusTransitions' - -INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [Action] - , [ToWorkflowId] - , [ToStatusId] - , [ValidateTasks] -) VALUES - --- Allow progression from Pre-Marketing to Contract in Place -( - 6 -- SPL - , 40 -- Pre-Marketing - , 'Contract in Place - Conditional' - , 6 -- SPL - , 42 -- Contract in Place - Conditional - , 0 -), ( - 6 -- SPL - , 40 -- Pre-Marketing - , 'Contract in Place - Unconditional' - , 6 -- SPL - , 43 -- Contract in Place - Unconditional - , 0 -) - --- Update Contract in Place - Conditional -, ( - 6 -- SPL - , 42 -- Contract in Place - Conditional - , 'Restart Marketing' - , 6 -- SPL - , 41 -- Marketing - , 0 -), ( - 6 -- SPL - , 42 -- Contract in Place - Conditional - , 'Contract in Place - Unconditional' - , 6 -- SPL - , 43 -- Contract in Place - Unconditional - , 1 -) - --- Add new Contract in Place - Unconditional status -, ( - 6 -- SPL - , 41 -- Marketing - , 'Contract in Place - Unconditional' - , 6 -- SPL - , 43 -- Contract in Place - Unconditional - , 1 -), ( - 6 -- SPL - , 43 -- Contract in Place - Unconditional - , 'Dispose Externally' - , 6 -- SPL - , 32 -- Disposed - , 1 -), ( - 6 -- SPL - , 43 -- Contract in Place - Unconditional - , 'Restart Marketing' - , 6 -- SPL - , 41 -- Marketing - , 0 -), ( - 6 -- SPL - , 43 -- Contract in Place - Unconditional - , 'Restart Pre-Marketing' - , 6 -- SPL - , 40 -- Pre-Marketing - , 0 -), ( - 6 -- SPL - , 43 -- Contract in Place - Unconditional - , 'Cancel Project' - , 6 -- SPL - , 23 -- Cancelled - , 0 -) - --- Provide way to remove from SPL. -, ( - 6 -- SPL - , 40 -- Pre-Marketing - , 'Switch to not included in SPL' - , 5 -- ERP - , 22 -- Not in SPL - , 0 -) - --- Provide way to return to SPL -, ( - 5 -- ERP - , 22 -- Not in SPL - , 'Switch to not included in SPL' - , 6 -- SPL - , 21 -- Approved for SPL - , 0 -) - -, ( - 5 -- ERP - , 14 -- Approved for ERP - , 'Approved for SPL' - , 6 -- SPL - , 21 -- Approved for SPL - , 1 -) - -UPDATE dbo.[ProjectStatusTransitions] -SET - [Action] = 'Contract in Place - Conditional' -WHERE - [FromWorkflowId] = 6 - AND [FromStatusId] = 41 - AND [ToWorkflowId] = 6 - AND [ToStatusId] = 42 diff --git a/backend/dal/Migrations/v01.05.00/Down/PostDown/01-ProjectRisks.sql b/backend/dal/Migrations/v01.05.00/Down/PostDown/01-ProjectRisks.sql deleted file mode 100644 index 687c45db37..0000000000 --- a/backend/dal/Migrations/v01.05.00/Down/PostDown/01-ProjectRisks.sql +++ /dev/null @@ -1,63 +0,0 @@ -PRINT 'Update ProjectRisks' - --- Replace Completed with Green -UPDATE dbo.[ProjectRisks] -SET - [Code] = 'COMP' - , [Name] = 'Complete' - , [Description] = '100% of the property value' -WHERE [Id] = 1 - --- Replace Completed with Green -UPDATE dbo.[ProjectRisks] -SET - [Code] = 'GREEN' - , [Name] = 'Green' - , [Description] = '90% of the property value' -WHERE [Id] = 2 - --- Replace Green with Yellow -UPDATE dbo.[ProjectRisks] -SET - [Code] = 'YELLOW' - , [Name] = 'Yellow' - , [Description] = '50% of the property value' -WHERE [Id] = 3 - -SET IDENTITY_INSERT dbo.[ProjectRisks] ON - -INSERT INTO dbo.[ProjectRisks] ( - [Id] - , [Code] - , [Name] - , [Description] - , [IsDisabled] - , [SortOrder] -) VALUES ( - 4 - , 'RED' - , 'Red' - , '0% of the property value' - , 0 - , 4 -) - -SET IDENTITY_INSERT dbo.[ProjectRisks] OFF - --- Remove Completed, and shift the primary keys down. - --- Move Green -UPDATE dbo.[Projects] -SET [RiskId] = 2 -WHERE [RiskId] = 1 - --- Move Yellow -UPDATE dbo.[Projects] -SET [RiskId] = 3 -WHERE [RiskId] = 2 - --- Move Red -UPDATE dbo.[Projects] -SET [RiskId] = 4 -WHERE [RiskId] = 3 - diff --git a/backend/dal/Migrations/v01.05.00/Down/PostDown/01-ProjectStatusTransitions.sql b/backend/dal/Migrations/v01.05.00/Down/PostDown/01-ProjectStatusTransitions.sql deleted file mode 100644 index eb2142d3ec..0000000000 --- a/backend/dal/Migrations/v01.05.00/Down/PostDown/01-ProjectStatusTransitions.sql +++ /dev/null @@ -1,19 +0,0 @@ -PRINT 'Removing ProjectStatusTransitions' - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 5 -- ERP - AND [FromStatusId] = 14 -- Approved for ERP - AND [ToWorkflowId] = 5 -- ERP - AND [ToStatusId] = 23 -- Cancelled - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 5 -- ERP - AND [FromStatusId] = 22 -- Not in SPL - AND [ToWorkflowId] = 5 -- ERP - AND [ToStatusId] = 23 -- Cancelled - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 6 -- SPL - AND [FromStatusId] = 21 -- Approved for SPL - AND [ToWorkflowId] = 6 -- SPL - AND [ToStatusId] = 23 -- Cancelled diff --git a/backend/dal/Migrations/v01.05.00/Up/PostUp/01-ProjectRisks.sql b/backend/dal/Migrations/v01.05.00/Up/PostUp/01-ProjectRisks.sql deleted file mode 100644 index 03e44246cd..0000000000 --- a/backend/dal/Migrations/v01.05.00/Up/PostUp/01-ProjectRisks.sql +++ /dev/null @@ -1,46 +0,0 @@ -PRINT 'Update ProjectRisks' - --- Remove Completed, and shift the primary keys down. - --- Green will become Completed -UPDATE dbo.[Projects] -SET [RiskId] = 1 -WHERE [RiskId] = 2 - --- Yellow will become Green -UPDATE dbo.[Projects] -SET [RiskId] = 2 -WHERE [RiskId] = 3 - --- Red will become Yellow -UPDATE dbo.[Projects] -SET [RiskId] = 3 -WHERE [RiskId] = 4 - --- Remove Red -DELETE FROM dbo.[ProjectRisks] -WHERE [Id] = 4 - --- Replace Yellow with Red -UPDATE dbo.[ProjectRisks] -SET - [Code] = 'RED' - , [Name] = 'Red' - , [Description] = '0% of the property value' -WHERE [Id] = 3 - --- Replace Green with Yellow -UPDATE dbo.[ProjectRisks] -SET - [Code] = 'YELLOW' - , [Name] = 'Yellow' - , [Description] = '50% of the property value' -WHERE [Id] = 2 - --- Replace Completed with Green -UPDATE dbo.[ProjectRisks] -SET - [Code] = 'GREEN' - , [Name] = 'Green' - , [Description] = '90-100% of the property value' -WHERE [Id] = 1 diff --git a/backend/dal/Migrations/v01.05.00/Up/PostUp/01-ProjectStatusTransitions.sql b/backend/dal/Migrations/v01.05.00/Up/PostUp/01-ProjectStatusTransitions.sql deleted file mode 100644 index 3b89c8c8a7..0000000000 --- a/backend/dal/Migrations/v01.05.00/Up/PostUp/01-ProjectStatusTransitions.sql +++ /dev/null @@ -1,39 +0,0 @@ -PRINT 'Adding ProjectStatusTransitions' - -INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [Action] - , [ToWorkflowId] - , [ToStatusId] - , [ValidateTasks] -) VALUES --- Allow progression from Approved for ERP to Cancelled -( - 5 -- ERP - , 14 -- Approved for ERP - , 'Cancel Project' - , 5 -- ERP - , 23 -- Cancelled - , 0 -) - --- Allow progression from Not in SPL to Cancelled -, ( - 5 -- ERP - , 22 -- Not in SPL - , 'Cancel Project' - , 5 -- ERP - , 23 -- Cancelled - , 0 -) - --- Allow progression from Approved for SPL to Cancelled -, ( - 6 -- SPL - , 21 -- Approved for SPL - , 'Cancel Project' - , 6 -- SPL - , 23 -- Cancelled - , 0 -) diff --git a/backend/dal/Migrations/v01.05.00/Up/PostUp/01-Tasks.sql b/backend/dal/Migrations/v01.05.00/Up/PostUp/01-Tasks.sql deleted file mode 100644 index f534eaf9a8..0000000000 --- a/backend/dal/Migrations/v01.05.00/Up/PostUp/01-Tasks.sql +++ /dev/null @@ -1,6 +0,0 @@ -PRINT 'Update Tasks' - -UPDATE dbo.[Tasks] -SET - [Description] = 'ADM has approved the request for exemption' -WHERE [Id] = 13 diff --git a/backend/dal/Migrations/v01.05.00/Up/PostUp/02-Agencies.sql b/backend/dal/Migrations/v01.05.00/Up/PostUp/02-Agencies.sql deleted file mode 100644 index 5ca7d34243..0000000000 --- a/backend/dal/Migrations/v01.05.00/Up/PostUp/02-Agencies.sql +++ /dev/null @@ -1,42 +0,0 @@ -PRINT 'Update Agencies' - --- Merge LNG, Crown Land Opportunities - -DECLARE @rID INT; -SET @rID = (SELECT TOP 1 Id FROM dbo.[Agencies] WHERE [Code] = 'LCLOAR'); -DECLARE @aID INT; -SET @aID = (SELECT TOP 1 Id FROM dbo.[Agencies] WHERE [Code] = 'CLO'); - -IF (@rID > 0) -BEGIN - -- Transfer any users to the correct agency. - -- Regrettably their Keycloak account will need to be updated manually. - UPDATE dbo.[UserAgencies] - SET [AgencyId] = @aID - WHERE [AgencyId] = @rID; - - UPDATE dbo.[AccessRequestAgencies] - SET [AgencyId] = @aID - WHERE [AgencyId] = @rID; - - -- Transfer all properties. - UPDATE dbo.[Parcels] - SET [AgencyId] = @aID - WHERE [AgencyId] = @rID; - - UPDATE dbo.[Buildings] - SET [AgencyId] = @aID - WHERE [AgencyId] = @rID; - - UPDATE dbo.[Projects] - SET [AgencyId] = @aID - WHERE [AgencyId] = @rID; - - UPDATE dbo.[ProjectAgencyResponses] - SET [AgencyId] = @aID - WHERE [AgencyId] = @rID; - - -- Delete the invalid agency - DELETE FROM dbo.[Agencies] - WHERE [Id] = @rID; -END diff --git a/backend/dal/Migrations/v01.05.05/Up/PostUp/01-BuildingConstructionTypes.sql b/backend/dal/Migrations/v01.05.05/Up/PostUp/01-BuildingConstructionTypes.sql deleted file mode 100644 index 903ade973f..0000000000 --- a/backend/dal/Migrations/v01.05.05/Up/PostUp/01-BuildingConstructionTypes.sql +++ /dev/null @@ -1,15 +0,0 @@ -PRINT 'Update Building Construction Types' - --- Switch to proper Id -UPDATE dbo.[Buildings] -SET [BuildingConstructionTypeId] = 1 -WHERE [BuildingConstructionTypeId] = 5 - --- Delete the duplicate -DELETE FROM dbo.[BuildingConstructionTypes] - WHERE [Id] = 5; - --- Update to correct spelling -UPDATE dbo.[BuildingConstructionTypes] -SET [Name] = 'Masonry' -WHERE [Id] = 1 diff --git a/backend/dal/Migrations/v01.05.05/Up/PostUp/01-BuildingPredominantUses.sql b/backend/dal/Migrations/v01.05.05/Up/PostUp/01-BuildingPredominantUses.sql deleted file mode 100644 index f64a32f5f5..0000000000 --- a/backend/dal/Migrations/v01.05.05/Up/PostUp/01-BuildingPredominantUses.sql +++ /dev/null @@ -1,10 +0,0 @@ -PRINT 'Update Building Predominate Uses' - --- Change properties associated with Zebra Feeding Station to default 1.# -UPDATE dbo.[Buildings] -SET [BuildingPredominateUseId] = 1 -WHERE [BuildingPredominateUseId] = 17 - ---Remove Zebra Feeding Station -DELETE FROM dbo.[BuildingPredominateUses] - WHERE [Id] = 17; diff --git a/backend/dal/Migrations/v01.05.05/Up/PostUp/02-BuildingPredominateUses.sql b/backend/dal/Migrations/v01.05.05/Up/PostUp/02-BuildingPredominateUses.sql deleted file mode 100644 index 102525b5f8..0000000000 --- a/backend/dal/Migrations/v01.05.05/Up/PostUp/02-BuildingPredominateUses.sql +++ /dev/null @@ -1,16 +0,0 @@ -PRINT 'Add Marina to Building Predominate Uses' - ---Check in case of rollback/rollforward -IF NOT EXISTS (SELECT * FROM dbo.[BuildingPredominateUses] WHERE [Name] = 'Marina') ---Add Marina - BEGIN - INSERT INTO dbo.[BuildingPredominateUses] ( - [Id] - , [Name] - , [IsDisabled] - ) VALUES ( - 17 - , 'Marina' - , 0 - ) - END diff --git a/backend/dal/Migrations/v01.06.00/Down/PostDown/01-Buildings.sql b/backend/dal/Migrations/v01.06.00/Down/PostDown/01-Buildings.sql deleted file mode 100644 index 203d9d4216..0000000000 --- a/backend/dal/Migrations/v01.06.00/Down/PostDown/01-Buildings.sql +++ /dev/null @@ -1,9 +0,0 @@ -PRINT 'Update Buildings' - --- Update the buildings project number. -UPDATE p SET - p.[ProjectNumber] = json_value(b.[ProjectNumbers], '$[0]') -FROM dbo.[Buildings] p -INNER JOIN #Buildings b ON b.[Id] = p.[Id] - -DROP TABLE #Buildings diff --git a/backend/dal/Migrations/v01.06.00/Down/PostDown/01-Parcels.sql b/backend/dal/Migrations/v01.06.00/Down/PostDown/01-Parcels.sql deleted file mode 100644 index c2c8df90d7..0000000000 --- a/backend/dal/Migrations/v01.06.00/Down/PostDown/01-Parcels.sql +++ /dev/null @@ -1,9 +0,0 @@ -PRINT 'Update Parcels' - --- Update the parcels project number. -UPDATE p SET - p.[ProjectNumber] = json_value(b.[ProjectNumbers], '$[0]') -FROM dbo.[Parcels] p -INNER JOIN #Parcels b ON b.[Id] = p.[Id] - -DROP TABLE #Parcels diff --git a/backend/dal/Migrations/v01.06.00/Down/PostDown/01-ViewProperties.sql b/backend/dal/Migrations/v01.06.00/Down/PostDown/01-ViewProperties.sql deleted file mode 100644 index 8821aaff6c..0000000000 --- a/backend/dal/Migrations/v01.06.00/Down/PostDown/01-ViewProperties.sql +++ /dev/null @@ -1,219 +0,0 @@ -PRINT 'Updating View_Properties' -GO --- This script provides a way to union both parcels and buildings into a single result of properties. --- Updating view to support many-to-many parcels and buildings.TEMPORARY -CREATE OR ALTER VIEW dbo.[View_Properties] AS -SELECT - p.[Id] - , [PropertyTypeId] = 0 - , p.[ClassificationId] - , [Classification] = c.[Name] - , p.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , p.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [AdministrativeArea] = adr.[AdministrativeArea] - , [Province] = ap.[Name] - , adr.[Postal] - , p.[ProjectNumber] - , p.[Name] - , p.[Description] - , p.[Location] - , p.[Boundary] - , p.[IsSensitive] - , p.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , p.[PID] - , p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [ParcelId] = p.[Id] - , [BuildingConstructionTypeId] = 0 - , [BuildingConstructionType] = null - , [BuildingFloorCount] = 0 - , [BuildingPredominateUseId] = 0 - , [BuildingPredominateUse] = null - , [BuildingOccupantTypeId] = 0 - , [BuildingOccupantType] = null - , [BuildingTenancy] = null - , [RentableArea] = 0 - , [LeaseExpiry] = null - , [OccupantName] = null - , [TransferLeaseOnSale] = CAST(0 AS BIT) - - , [Assessed] = ISNULL(eas.[Value], 0) - , [AssessedDate] = eas.[Date] - , [Appraised] = ISNULL(eap.[Value], 0) - , [AppraisedDate] = eap.[Date] - , [Market] = ISNULL(fe.[Value], 0) - , [MarketFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] -FROM dbo.[Parcels] p -JOIN dbo.[PropertyClassifications] c ON p.[ClassificationId] = c.[Id] -JOIN dbo.[Agencies] a ON p.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON p.[AddressId] = adr.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- [Assessed] - ORDER BY [Date] DESC -) AS eas -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 1 -- Appraised - ORDER BY [Date] DESC -) AS eap -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 1 -- Market - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn -UNION ALL -SELECT - b.[Id] - , [PropertyTypeId] = 1 - , b.[ClassificationId] - , [Classification] = c.[Name] - , b.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , b.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [AdministrativeArea] = adr.[AdministrativeArea] - , [Province] = ap.[Name] - , adr.[Postal] - , b.[ProjectNumber] - , b.[Name] - , b.[Description] - , b.[Location] - , b.[Boundary] - , b.[IsSensitive] - , b.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , [PID] = p.[PID] - , [PIN] = p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [ParcelId] = p.[Id] - , [BuildingConstructionTypeId] = b.[BuildingConstructionTypeId] - , [BuildingConstructionType] = bct.[Name] - , [BuildingFloorCount] = b.[BuildingFloorCount] - , [BuildingPredominateUseId] = b.[BuildingPredominateUseId] - , [BuildingPredominateUse] = bpu.[Name] - , [BuildingOccupantTypeId] = b.[BuildingOccupantTypeId] - , [BuildingOccupantType] = bot.[Name] - , [BuildingTenancy] = b.[BuildingTenancy] - , [RentableArea] = b.[RentableArea] - , [LeaseExpiry] = b.[LeaseExpiry] - , [OccupantName] = b.[OccupantName] - , [TransferLeaseOnSale] = b.[TransferLeaseOnSale] - - , [Assessed] = ISNULL(eas.[Value], 0) - , [AssessedDate] = eas.[Date] - , [Appraised] = ISNULL(eap.[Value], 0) - , [AppraisedDate] = eap.[Date] - , [Market] = ISNULL(fe.[Value], 0) - , [MarketFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] -FROM dbo.[Buildings] b -LEFT JOIN dbo.[ParcelBuildings] pb ON b.[Id] = pb.[BuildingId] -LEFT JOIN dbo.[Parcels] p ON pb.[ParcelId] = p.[Id] -JOIN dbo.[PropertyClassifications] c ON b.[ClassificationId] = c.[Id] -JOIN dbo.[Agencies] a ON b.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON b.[AddressId] = adr.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -JOIN dbo.[BuildingConstructionTypes] bct ON b.[BuildingConstructionTypeId] = bct.[Id] -JOIN dbo.[BuildingOccupantTypes] bot ON b.[BuildingOccupantTypeId] = bot.[Id] -JOIN dbo.[BuildingPredominateUses] bpu ON b.[BuildingPredominateUseId] = bpu.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[BuildingEvaluations] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- [Assessed] - ORDER BY [Date] DESC -) AS eas -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[BuildingEvaluations] - WHERE [BuildingId] = b.[Id] - AND [Key] = 1 -- Appraised - ORDER BY [Date] DESC -) AS eap -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 1 -- Market - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn diff --git a/backend/dal/Migrations/v01.06.00/Down/PreDown/01-Buildings.sql b/backend/dal/Migrations/v01.06.00/Down/PreDown/01-Buildings.sql deleted file mode 100644 index 6e9bf07de3..0000000000 --- a/backend/dal/Migrations/v01.06.00/Down/PreDown/01-Buildings.sql +++ /dev/null @@ -1,9 +0,0 @@ -PRINT 'Backup Buildings' - --- Create temporary table to store the building values -SELECT - b.[Id] - , b.[ProjectNumbers] -INTO #Buildings -FROM dbo.[Buildings] b -WHERE b.[ProjectNumbers] IS NOT NULL \ No newline at end of file diff --git a/backend/dal/Migrations/v01.06.00/Down/PreDown/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.06.00/Down/PreDown/01-NotificationTemplates.sql deleted file mode 100644 index 74ad98ab04..0000000000 --- a/backend/dal/Migrations/v01.06.00/Down/PreDown/01-NotificationTemplates.sql +++ /dev/null @@ -1,728 +0,0 @@ -UPDATE dbo.[NotificationTemplates] -SET [Body] = '@Model.Environment.Title

Dear @Model.ToAgency.AddressTo,

Your project @Model.Project.ProjectNumber has been approved. Signin to PIMS to review the progress.

Sincerely Real Property Division

' -WHERE [Id] = 4 - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

Please forward this notification to any SUCH Sector Organization or BPS Entity that your ministry is responsible for to ensure any interest from Ministries or Agencies in the properties is identified.

-

Should there be no interest in the property detailed below from your Ministry or any SUCH Sector Organization or BPS Entity that your Ministry is responsible for, please respond to confirm.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with 90 days from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property. Reminder notifications will be sent at both 30 days and 60 days from this initial notification.

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 5; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is a 30 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property have been identified as surplus is available for redeployment:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 6; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is a 60 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property have been identified as surplus is available for redeployment:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 7; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is the 90 Day Completion Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property have been identified as surplus is available for redeployment:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 8; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is a 30 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

Please forward this notification to any SUCH Sector Organization or BPS Entity that your ministry is responsible for to ensure any interest from Ministries or Agencies in the properties is identified.

-

Should there be no interest in the property detailed below from your Ministry or any SUCH Sector Organization or BPS Entity that your Ministry is responsible for, please respond to confirm.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with 60 days from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property. An additional reminder notification will be sent 30 days before this internal listing expires.

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 9; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is a 60 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

Please forward this notification to any SUCH Sector Organization or BPS Entity that your ministry is responsible for to ensure any interest from Ministries or Agencies in the properties is identified.

-

Should there be no interest in the property detailed below from your Ministry or any SUCH Sector Organization or BPS Entity that your Ministry is responsible for, please respond to confirm.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with 30 days from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property.

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 10; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is to provide confirmation that the 90 Day Enhanced Referral Period as detailed in the initial Notification of Surplus Real Property below is now complete.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

Please forward this notification to any SUCH Sector Organization or BPS Entity that your ministry is responsible for to ensure any interest from Ministries or Agencies in the properties is identified.

-

Should there be no interest in the property detailed below from your Ministry or any SUCH Sector Organization or BPS Entity that your Ministry is responsible for, please respond to confirm.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

An Enhanced Referral Notification Letter will be sent to the owning Ministry / Agency at the end of the week advising of next steps in the process.

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 11; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is a 30 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with 60 days from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property.

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 12; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is a 60 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with 30 days from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property.

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 13; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is to provide confirmation that the 90 Day Enhanced Referral Period as detailed in the initial Notification of Surplus Real Property below is now complete.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with until the end of this week from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property.

-

An Enhanced Referral Notification Letter will be sent to the owning Ministry / Agency at the end of the week advising of next steps in the process.

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 14; \ No newline at end of file diff --git a/backend/dal/Migrations/v01.06.00/Down/PreDown/01-Parcels.sql b/backend/dal/Migrations/v01.06.00/Down/PreDown/01-Parcels.sql deleted file mode 100644 index 0d5f5954cb..0000000000 --- a/backend/dal/Migrations/v01.06.00/Down/PreDown/01-Parcels.sql +++ /dev/null @@ -1,9 +0,0 @@ -PRINT 'Backup Parcels' - --- Create temporary table to store the parcel values -SELECT - p.[Id] - , p.[ProjectNumbers] -INTO #Parcels -FROM dbo.[Parcels] p -WHERE p.[ProjectNumbers] IS NOT NULL diff --git a/backend/dal/Migrations/v01.06.00/Down/PreDown/01-Projects.sql b/backend/dal/Migrations/v01.06.00/Down/PreDown/01-Projects.sql deleted file mode 100644 index d4fd01cdad..0000000000 --- a/backend/dal/Migrations/v01.06.00/Down/PreDown/01-Projects.sql +++ /dev/null @@ -1,3 +0,0 @@ -UPDATE dbo.[Projects] set [Assessed] = 0 WHERE [Assessed] IS NULL -UPDATE dbo.[Projects] set [Market] = 0 WHERE [Market] IS NULL -UPDATE dbo.[Projects] set [Netbook] = 0 WHERE [Netbook] IS NULL \ No newline at end of file diff --git a/backend/dal/Migrations/v01.06.00/Down/PreDown/01-RemoveRolesAndClaims.sql b/backend/dal/Migrations/v01.06.00/Down/PreDown/01-RemoveRolesAndClaims.sql deleted file mode 100644 index 1fad18be8d..0000000000 --- a/backend/dal/Migrations/v01.06.00/Down/PreDown/01-RemoveRolesAndClaims.sql +++ /dev/null @@ -1,5 +0,0 @@ -DELETE FROM dbo.[UserRoles] where [RoleId] = '5c6cea5b-9b7c-47e8-852c-693e90ed815e'; -DELETE FROM dbo.[RoleClaims] where [RoleId] = '5c6cea5b-9b7c-47e8-852c-693e90ed815e'; -DELETE FROM dbo.[RoleClaims] where [ClaimId] = '81ded21c-ed32-4694-8f33-79ef17833f2b'; -DELETE FROM dbo.[Roles] where [Id] = '5c6cea5b-9b7c-47e8-852c-693e90ed815e'; -DELETE FROM dbo.[Claims] where [Id] = '81ded21c-ed32-4694-8f33-79ef17833f2b'; diff --git a/backend/dal/Migrations/v01.06.00/Up/PostUp/01-AddRoleAndClaims.sql b/backend/dal/Migrations/v01.06.00/Up/PostUp/01-AddRoleAndClaims.sql deleted file mode 100644 index d194769063..0000000000 --- a/backend/dal/Migrations/v01.06.00/Up/PostUp/01-AddRoleAndClaims.sql +++ /dev/null @@ -1,59 +0,0 @@ -PRINT 'Adding Role' - ---Adding new role for the SRES Financial Reporter -INSERT INTO - dbo.[Roles] ( - [Id], - [Name], - [Description], - [IsPublic], - [IsDisabled], - [SortOrder], - [KeycloakGroupId] - ) -VALUES - ( - '5c6cea5b-9b7c-47e8-852c-693e90ed815e', - 'SRES Financial Reporter', - 'The SRES Financial Reporter can view, create, and delete non-final SPL reports.', - 0, - 0, - 0, - '5c6cea5b-9b7c-47e8-852c-693e90ed815e' - ); - -PRINT 'Adding Claim' - ---Adding new claim for the SRES Financial Manager -INSERT INTO - dbo.[Claims] ([Id], [Name], [Description], [IsDisabled], [KeycloakRoleId]) -VALUES -( - '81ded21c-ed32-4694-8f33-79ef17833f2b', - 'reports-spl-admin', - 'Ability to view, create, and delete Final reports.', - 0, - '81ded21c-ed32-4694-8f33-79ef17833f2b' -); - -PRINT 'Adding RoleClaims' - ---Adding mapping for the new reports-spl-admin claim to the SRES Financial Manager -INSERT INTO dbo.[RoleClaims] - ( - [RoleId] - , [ClaimId] - ) -VALUES -( - 'd416f362-1e6f-4e24-a561-c6bb45a35194' -- SRES Financial Manager - , '81ded21c-ed32-4694-8f33-79ef17833f2b' -- reports-spl-admin -), -( - '5c6cea5b-9b7c-47e8-852c-693e90ed815e' -- SRES Financial Reporter - , '0fbd370d-6cde-41e7-9039-f05ae60d75da' -- reports-spl -), -( - '5c6cea5b-9b7c-47e8-852c-693e90ed815e' -- SRES Financial Reporter - , 'e13d1c7d-f350-4aee-808e-c9603c29479b' -- reports-view -); diff --git a/backend/dal/Migrations/v01.06.00/Up/PostUp/01-Buildings.sql b/backend/dal/Migrations/v01.06.00/Up/PostUp/01-Buildings.sql deleted file mode 100644 index 0f374b2566..0000000000 --- a/backend/dal/Migrations/v01.06.00/Up/PostUp/01-Buildings.sql +++ /dev/null @@ -1,9 +0,0 @@ -PRINT 'Update Buildings' - --- Update the buildings project number. -UPDATE p SET - p.[ProjectNumbers] = '["' + b.[ProjectNumber] +'"]' -FROM dbo.[Buildings] p -INNER JOIN #Buildings b ON b.[Id] = p.[Id] - -DROP TABLE #Buildings diff --git a/backend/dal/Migrations/v01.06.00/Up/PostUp/01-Parcels.sql b/backend/dal/Migrations/v01.06.00/Up/PostUp/01-Parcels.sql deleted file mode 100644 index e200819a26..0000000000 --- a/backend/dal/Migrations/v01.06.00/Up/PostUp/01-Parcels.sql +++ /dev/null @@ -1,9 +0,0 @@ -PRINT 'Update Parcels' - --- Update the parcel project number. -UPDATE p SET - p.[ProjectNumbers] = '["' + b.[ProjectNumber] +'"]' -FROM dbo.[Parcels] p -INNER JOIN #Parcels b ON b.[Id] = p.[Id] - -DROP TABLE #Parcels diff --git a/backend/dal/Migrations/v01.06.00/Up/PostUp/01-ViewProperties.sql b/backend/dal/Migrations/v01.06.00/Up/PostUp/01-ViewProperties.sql deleted file mode 100644 index 4a0022ea1d..0000000000 --- a/backend/dal/Migrations/v01.06.00/Up/PostUp/01-ViewProperties.sql +++ /dev/null @@ -1,212 +0,0 @@ -PRINT 'Updating View_Properties - Updating Assessment' -GO --- This script provides a way to union both parcels and buildings into a single result of properties. --- Updating view to support many-to-many parcels and buildings.TEMPORARY -CREATE OR ALTER VIEW dbo.[View_Properties] AS -SELECT - p.[Id] - , p.[RowVersion] - , [PropertyTypeId] = 0 - , p.[ClassificationId] - , [Classification] = c.[Name] - , p.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , p.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [AdministrativeArea] = adr.[AdministrativeArea] - , [Province] = ap.[Name] - , adr.[Postal] - , p.[ProjectNumbers] - , p.[Name] - , p.[Description] - , p.[Location] - , p.[Boundary] - , p.[IsSensitive] - , p.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , p.[PID] - , p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [ParcelId] = p.[Id] - , [BuildingConstructionTypeId] = 0 - , [BuildingConstructionType] = null - , [BuildingFloorCount] = 0 - , [BuildingPredominateUseId] = 0 - , [BuildingPredominateUse] = null - , [BuildingOccupantTypeId] = 0 - , [BuildingOccupantType] = null - , [BuildingTenancy] = null - , [RentableArea] = 0 - , [LeaseExpiry] = null - , [OccupantName] = null - , [TransferLeaseOnSale] = CAST(0 AS BIT) - - , [AssessedLand] = eas.[Value] - , [AssessedLandDate] = eas.[Date] - , [AssessedBuilding] = eim.[Value] - , [AssessedBuildingDate] = eim.[Date] - , [Market] = ISNULL(fe.[Value], 0) - , [MarketFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] -FROM dbo.[Parcels] p -JOIN dbo.[PropertyClassifications] c ON p.[ClassificationId] = c.[Id] -JOIN dbo.[Agencies] a ON p.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON p.[AddressId] = adr.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- Assessed Land - ORDER BY [Date] DESC -) AS eas -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 2 -- Assessed Building - ORDER BY [Date] DESC -) AS eim -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 1 -- Market - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn -UNION ALL -SELECT - b.[Id] - , b.[RowVersion] - , [PropertyTypeId] = 1 - , b.[ClassificationId] - , [Classification] = c.[Name] - , b.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , b.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [AdministrativeArea] = adr.[AdministrativeArea] - , [Province] = ap.[Name] - , adr.[Postal] - , b.[ProjectNumbers] - , b.[Name] - , b.[Description] - , b.[Location] - , b.[Boundary] - , b.[IsSensitive] - , b.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , [PID] = p.[PID] - , [PIN] = p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [ParcelId] = p.[Id] - , [BuildingConstructionTypeId] = b.[BuildingConstructionTypeId] - , [BuildingConstructionType] = bct.[Name] - , [BuildingFloorCount] = b.[BuildingFloorCount] - , [BuildingPredominateUseId] = b.[BuildingPredominateUseId] - , [BuildingPredominateUse] = bpu.[Name] - , [BuildingOccupantTypeId] = b.[BuildingOccupantTypeId] - , [BuildingOccupantType] = bot.[Name] - , [BuildingTenancy] = b.[BuildingTenancy] - , [RentableArea] = b.[RentableArea] - , [LeaseExpiry] = b.[LeaseExpiry] - , [OccupantName] = b.[OccupantName] - , [TransferLeaseOnSale] = b.[TransferLeaseOnSale] - - , [AssessedLand] = null - , [AssessedLandDate] = null - , [AssessedBuilding] = eim.[Value] - , [AssessedBuildingDate] = eim.[Date] - , [Market] = ISNULL(fe.[Value], 0) - , [MarketFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] -FROM dbo.[Buildings] b -LEFT JOIN dbo.[ParcelBuildings] pb ON b.[Id] = pb.[BuildingId] -LEFT JOIN dbo.[Parcels] p ON pb.[ParcelId] = p.[Id] -JOIN dbo.[PropertyClassifications] c ON b.[ClassificationId] = c.[Id] -JOIN dbo.[Agencies] a ON b.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON b.[AddressId] = adr.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -JOIN dbo.[BuildingConstructionTypes] bct ON b.[BuildingConstructionTypeId] = bct.[Id] -JOIN dbo.[BuildingOccupantTypes] bot ON b.[BuildingOccupantTypeId] = bot.[Id] -JOIN dbo.[BuildingPredominateUses] bpu ON b.[BuildingPredominateUseId] = bpu.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[BuildingEvaluations] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- Assessed - ORDER BY [Date] DESC -) AS eim -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 1 -- Market - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn diff --git a/backend/dal/Migrations/v01.06.00/Up/PreUp/01-BuildingPredominateUses.sql b/backend/dal/Migrations/v01.06.00/Up/PreUp/01-BuildingPredominateUses.sql deleted file mode 100644 index 200d785010..0000000000 --- a/backend/dal/Migrations/v01.06.00/Up/PreUp/01-BuildingPredominateUses.sql +++ /dev/null @@ -1,20 +0,0 @@ -DECLARE @correctPredominateUseId int; -DECLARE @incorrectPredominateUseId int; - -select @correctPredominateUseId = Id from BuildingPredominateUses where Name = 'Senior Housing (Assisted Living / Skilled Nursing)'; -select @incorrectPredominateUseId = Id from BuildingPredominateUses where Name = 'Senior Housing (Assisted Living/Skilled Nursing)'; -update buildings set BuildingPredominateUseId = @correctPredominateUseId where BuildingPredominateUseId = @incorrectPredominateUseId; - -select @correctPredominateUseId = Id from BuildingPredominateUses where Name = 'Transportation (Airport / Rail / Bus station)'; -select @incorrectPredominateUseId = Id from BuildingPredominateUses where Name = 'Transportation (Airport/Rail/Bus station)'; -update buildings set BuildingPredominateUseId = @correctPredominateUseId where BuildingPredominateUseId = @incorrectPredominateUseId; - -select @correctPredominateUseId = Id from BuildingPredominateUses where Name = 'University/College'; -select @incorrectPredominateUseId = Id from BuildingPredominateUses where Name = 'University / Collect'; -update buildings set BuildingPredominateUseId = @correctPredominateUseId where BuildingPredominateUseId = @incorrectPredominateUseId; - -update buildings set Name = 'University / College' where Name = 'University/College'; -update buildings set Name = 'Jail / Prison' where Name = 'Jail/Prison'; -update buildings set Name = 'Community / Recreation Centre' where Name = 'Community/Recreation Centre'; - -delete from BuildingPredominateUses where id = @incorrectPredominateUseId; \ No newline at end of file diff --git a/backend/dal/Migrations/v01.06.00/Up/PreUp/01-Buildings.sql b/backend/dal/Migrations/v01.06.00/Up/PreUp/01-Buildings.sql deleted file mode 100644 index 07afdca646..0000000000 --- a/backend/dal/Migrations/v01.06.00/Up/PreUp/01-Buildings.sql +++ /dev/null @@ -1,9 +0,0 @@ -PRINT 'Backup Buildings' - --- Create temporary table to store the building values -SELECT - b.[Id] - , b.[ProjectNumber] -INTO #Buildings -FROM dbo.[Buildings] b -WHERE b.[ProjectNumber] IS NOT NULL \ No newline at end of file diff --git a/backend/dal/Migrations/v01.06.00/Up/PreUp/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.06.00/Up/PreUp/01-NotificationTemplates.sql deleted file mode 100644 index b0fffa6246..0000000000 --- a/backend/dal/Migrations/v01.06.00/Up/PreUp/01-NotificationTemplates.sql +++ /dev/null @@ -1,742 +0,0 @@ -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities - -@Model.Environment.Title

Dear @Model.ToAgency.AddressTo,

Your project @Model.Project.ProjectNumber has been approved. Signin to PIMS to review the progress.

@Model.Project.Notes.FirstOrDefault(n => n.NoteType == NoteTypes.ErpNotification)?.Note

Sincerely Real Property Division

' -WHERE [Id] = 4 - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

Please forward this notification to any SUCH Sector Organization or BPS Entity that your ministry is responsible for to ensure any interest from Ministries or Agencies in the properties is identified.

-

Should there be no interest in the property detailed below from your Ministry or any SUCH Sector Organization or BPS Entity that your Ministry is responsible for, please respond to confirm.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } - else - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with 90 days from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property. Reminder notifications will be sent at both 30 days and 60 days from this initial notification.

-

@Model.Project.Notes.FirstOrDefault(n => n.NoteType == NoteTypes.ErpNotification)?.Note

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 5; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is a 30 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property have been identified as surplus is available for redeployment:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } - else - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } -
  2. - } -
-

-

@Model.Project.Notes.FirstOrDefault(n => n.NoteType == NoteTypes.ErpNotification)?.Note

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 6; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is a 60 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property have been identified as surplus is available for redeployment:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } - else - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } -
  2. - } -
-

-

@Model.Project.Notes.FirstOrDefault(n => n.NoteType == NoteTypes.ErpNotification)?.Note

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 7; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is the 90 Day Completion Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property have been identified as surplus is available for redeployment:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } - else - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } -
  2. - } -
-

-

@Model.Project.Notes.FirstOrDefault(n => n.NoteType == NoteTypes.ErpNotification)?.Note

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 8; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is a 30 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

Please forward this notification to any SUCH Sector Organization or BPS Entity that your ministry is responsible for to ensure any interest from Ministries or Agencies in the properties is identified.

-

Should there be no interest in the property detailed below from your Ministry or any SUCH Sector Organization or BPS Entity that your Ministry is responsible for, please respond to confirm.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } - else - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with 60 days from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property. An additional reminder notification will be sent 30 days before this internal listing expires.

-

@Model.Project.Notes.FirstOrDefault(n => n.NoteType == NoteTypes.ErpNotification)?.Note

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 9; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is a 60 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

Please forward this notification to any SUCH Sector Organization or BPS Entity that your ministry is responsible for to ensure any interest from Ministries or Agencies in the properties is identified.

-

Should there be no interest in the property detailed below from your Ministry or any SUCH Sector Organization or BPS Entity that your Ministry is responsible for, please respond to confirm.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } - else - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with 30 days from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property.

-

@Model.Project.Notes.FirstOrDefault(n => n.NoteType == NoteTypes.ErpNotification)?.Note

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 10; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is to provide confirmation that the 90 Day Enhanced Referral Period as detailed in the initial Notification of Surplus Real Property below is now complete.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

Please forward this notification to any SUCH Sector Organization or BPS Entity that your ministry is responsible for to ensure any interest from Ministries or Agencies in the properties is identified.

-

Should there be no interest in the property detailed below from your Ministry or any SUCH Sector Organization or BPS Entity that your Ministry is responsible for, please respond to confirm.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } - else - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } -
  2. - } -
-

-

An Enhanced Referral Notification Letter will be sent to the owning Ministry / Agency at the end of the week advising of next steps in the process.

-

@Model.Project.Notes.FirstOrDefault(n => n.NoteType == NoteTypes.ErpNotification)?.Note

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 11; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is a 30 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } - else - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with 60 days from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property.

-

@Model.Project.Notes.FirstOrDefault(n => n.NoteType == NoteTypes.ErpNotification)?.Note

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 12; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is a 60 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } - else - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with 30 days from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property.

-

@Model.Project.Notes.FirstOrDefault(n => n.NoteType == NoteTypes.ErpNotification)?.Note

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 13; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is to provide confirmation that the 90 Day Enhanced Referral Period as detailed in the initial Notification of Surplus Real Property below is now complete.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } - else - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with until the end of this week from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property.

-

An Enhanced Referral Notification Letter will be sent to the owning Ministry / Agency at the end of the week advising of next steps in the process.

-

@Model.Project.Notes.FirstOrDefault(n => n.NoteType == NoteTypes.ErpNotification)?.Note

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 14; \ No newline at end of file diff --git a/backend/dal/Migrations/v01.06.00/Up/PreUp/01-Parcels.sql b/backend/dal/Migrations/v01.06.00/Up/PreUp/01-Parcels.sql deleted file mode 100644 index 10cdbbc6d8..0000000000 --- a/backend/dal/Migrations/v01.06.00/Up/PreUp/01-Parcels.sql +++ /dev/null @@ -1,9 +0,0 @@ -PRINT 'Backup Parcels' - --- Create temporary table to store the parcel values -SELECT - p.[Id] - , p.[ProjectNumber] -INTO #Parcels -FROM dbo.[Parcels] p -WHERE p.[ProjectNumber] IS NOT NULL diff --git a/backend/dal/Migrations/v01.07.00/Down/PostDown/01-ProjectStatusTransitions.sql b/backend/dal/Migrations/v01.07.00/Down/PostDown/01-ProjectStatusTransitions.sql deleted file mode 100644 index 056b549725..0000000000 --- a/backend/dal/Migrations/v01.07.00/Down/PostDown/01-ProjectStatusTransitions.sql +++ /dev/null @@ -1,6 +0,0 @@ -PRINT 'Delete ProjectStatusTransitions - SPL to Transfer within GRE' - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 6 - AND [ToWorkflowId] = 6 - AND [ToStatusId] = 20 diff --git a/backend/dal/Migrations/v01.07.00/Down/PostDown/02-WorkflowProjectStatus.sql b/backend/dal/Migrations/v01.07.00/Down/PostDown/02-WorkflowProjectStatus.sql deleted file mode 100644 index 3d70e1434e..0000000000 --- a/backend/dal/Migrations/v01.07.00/Down/PostDown/02-WorkflowProjectStatus.sql +++ /dev/null @@ -1,5 +0,0 @@ -PRINT 'Delete WorkflowProjectStatus - SPL Transfer within GRE' - -DELETE FROM dbo.[WorkflowProjectStatus] -WHERE [WorkflowId] = 6 -- SPL - AND [StatusId] = 20 -- Transferred within GRE diff --git a/backend/dal/Migrations/v01.07.00/Down/PreDown/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.07.00/Down/PreDown/01-NotificationTemplates.sql deleted file mode 100644 index c450607b7e..0000000000 --- a/backend/dal/Migrations/v01.07.00/Down/PreDown/01-NotificationTemplates.sql +++ /dev/null @@ -1,5 +0,0 @@ --- Remove SRES from BCCs -UPDATE dbo.[NotificationTemplates] -SET [Bcc] = '' -WHERE [Bcc] = 'RealPropertyDivision.Disposals@gov.bc.ca' - diff --git a/backend/dal/Migrations/v01.07.00/Down/PreDown/01-RemoveNewClassifications.sql b/backend/dal/Migrations/v01.07.00/Down/PreDown/01-RemoveNewClassifications.sql deleted file mode 100644 index 33d2634b35..0000000000 --- a/backend/dal/Migrations/v01.07.00/Down/PreDown/01-RemoveNewClassifications.sql +++ /dev/null @@ -1,10 +0,0 @@ --- Migration any properties to Disposed Classifications -UPDATE dbo.[Parcels] -SET [ClassificationId] = 4 -WHERE [ClassificationId] IN (5, 6) - -UPDATE dbo.[Buildings] -SET [ClassificationId] = 4 -WHERE [ClassificationId] IN (5, 6) - -DELETE FROM dbo.[PropertyClassifications] where Id in (5, 6); diff --git a/backend/dal/Migrations/v01.07.00/Down/PreDown/01-ViewProperties.sql b/backend/dal/Migrations/v01.07.00/Down/PreDown/01-ViewProperties.sql deleted file mode 100644 index 4a0022ea1d..0000000000 --- a/backend/dal/Migrations/v01.07.00/Down/PreDown/01-ViewProperties.sql +++ /dev/null @@ -1,212 +0,0 @@ -PRINT 'Updating View_Properties - Updating Assessment' -GO --- This script provides a way to union both parcels and buildings into a single result of properties. --- Updating view to support many-to-many parcels and buildings.TEMPORARY -CREATE OR ALTER VIEW dbo.[View_Properties] AS -SELECT - p.[Id] - , p.[RowVersion] - , [PropertyTypeId] = 0 - , p.[ClassificationId] - , [Classification] = c.[Name] - , p.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , p.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [AdministrativeArea] = adr.[AdministrativeArea] - , [Province] = ap.[Name] - , adr.[Postal] - , p.[ProjectNumbers] - , p.[Name] - , p.[Description] - , p.[Location] - , p.[Boundary] - , p.[IsSensitive] - , p.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , p.[PID] - , p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [ParcelId] = p.[Id] - , [BuildingConstructionTypeId] = 0 - , [BuildingConstructionType] = null - , [BuildingFloorCount] = 0 - , [BuildingPredominateUseId] = 0 - , [BuildingPredominateUse] = null - , [BuildingOccupantTypeId] = 0 - , [BuildingOccupantType] = null - , [BuildingTenancy] = null - , [RentableArea] = 0 - , [LeaseExpiry] = null - , [OccupantName] = null - , [TransferLeaseOnSale] = CAST(0 AS BIT) - - , [AssessedLand] = eas.[Value] - , [AssessedLandDate] = eas.[Date] - , [AssessedBuilding] = eim.[Value] - , [AssessedBuildingDate] = eim.[Date] - , [Market] = ISNULL(fe.[Value], 0) - , [MarketFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] -FROM dbo.[Parcels] p -JOIN dbo.[PropertyClassifications] c ON p.[ClassificationId] = c.[Id] -JOIN dbo.[Agencies] a ON p.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON p.[AddressId] = adr.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- Assessed Land - ORDER BY [Date] DESC -) AS eas -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 2 -- Assessed Building - ORDER BY [Date] DESC -) AS eim -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 1 -- Market - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn -UNION ALL -SELECT - b.[Id] - , b.[RowVersion] - , [PropertyTypeId] = 1 - , b.[ClassificationId] - , [Classification] = c.[Name] - , b.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , b.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [AdministrativeArea] = adr.[AdministrativeArea] - , [Province] = ap.[Name] - , adr.[Postal] - , b.[ProjectNumbers] - , b.[Name] - , b.[Description] - , b.[Location] - , b.[Boundary] - , b.[IsSensitive] - , b.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , [PID] = p.[PID] - , [PIN] = p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [ParcelId] = p.[Id] - , [BuildingConstructionTypeId] = b.[BuildingConstructionTypeId] - , [BuildingConstructionType] = bct.[Name] - , [BuildingFloorCount] = b.[BuildingFloorCount] - , [BuildingPredominateUseId] = b.[BuildingPredominateUseId] - , [BuildingPredominateUse] = bpu.[Name] - , [BuildingOccupantTypeId] = b.[BuildingOccupantTypeId] - , [BuildingOccupantType] = bot.[Name] - , [BuildingTenancy] = b.[BuildingTenancy] - , [RentableArea] = b.[RentableArea] - , [LeaseExpiry] = b.[LeaseExpiry] - , [OccupantName] = b.[OccupantName] - , [TransferLeaseOnSale] = b.[TransferLeaseOnSale] - - , [AssessedLand] = null - , [AssessedLandDate] = null - , [AssessedBuilding] = eim.[Value] - , [AssessedBuildingDate] = eim.[Date] - , [Market] = ISNULL(fe.[Value], 0) - , [MarketFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] -FROM dbo.[Buildings] b -LEFT JOIN dbo.[ParcelBuildings] pb ON b.[Id] = pb.[BuildingId] -LEFT JOIN dbo.[Parcels] p ON pb.[ParcelId] = p.[Id] -JOIN dbo.[PropertyClassifications] c ON b.[ClassificationId] = c.[Id] -JOIN dbo.[Agencies] a ON b.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON b.[AddressId] = adr.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -JOIN dbo.[BuildingConstructionTypes] bct ON b.[BuildingConstructionTypeId] = bct.[Id] -JOIN dbo.[BuildingOccupantTypes] bot ON b.[BuildingOccupantTypeId] = bot.[Id] -JOIN dbo.[BuildingPredominateUses] bpu ON b.[BuildingPredominateUseId] = bpu.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[BuildingEvaluations] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- Assessed - ORDER BY [Date] DESC -) AS eim -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 1 -- Market - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn diff --git a/backend/dal/Migrations/v01.07.00/Up/PostUp/01-Adminstrative_Areas_And_Addresses.sql b/backend/dal/Migrations/v01.07.00/Up/PostUp/01-Adminstrative_Areas_And_Addresses.sql deleted file mode 100644 index 29a3619e7a..0000000000 --- a/backend/dal/Migrations/v01.07.00/Up/PostUp/01-Adminstrative_Areas_And_Addresses.sql +++ /dev/null @@ -1,146 +0,0 @@ --- Update addresses table first to correct locations which contain District of, City of, or The Corporation of the District of -PRINT 'Updating Addresses table' - -UPDATE dbo.[Addresses] -SET AdministrativeArea = REPLACE(AdministrativeArea, 'District of ', '') -where AdministrativeArea like 'District of %'; - -UPDATE dbo.[Addresses] -SET AdministrativeArea = REPLACE(AdministrativeArea, 'City of ', '') -where AdministrativeArea like 'City of %'; - -UPDATE dbo.[Addresses] -SET AdministrativeArea = REPLACE(AdministrativeArea, 'Town of ', '') -where AdministrativeArea like 'Town of %'; - -UPDATE dbo.[Addresses] -SET AdministrativeArea = REPLACE(AdministrativeArea, 'Village of ', '') -where AdministrativeArea like 'Village of %'; - -UPDATE dbo.[Addresses] -SET AdministrativeArea = REPLACE(AdministrativeArea, 'The Corporation of the District of ', '') -where AdministrativeArea like 'The Corporation of the District of %'; - --- Do the "one off" updates to simplify the name where there is only once instance of each -UPDATE [dbo].[Addresses] -SET AdministrativeArea = 'Spallumcheen' -WHERE AdministrativeArea = 'The Corporation of the Township of Spallumcheen'; - -PRINT 'Updating AdministrativeAreas table' - --- Then update AdministrativeAreas table to fix the spelling of the Abbreviation field in order to get correct join on the Name field when doing a batch update later on -UPDATE [dbo].[AdministrativeAreas] -SET Abbreviation = 'Valemount' -WHERE Name = 'Village of Valemount' AND Abbreviation = 'Valemont'; - -UPDATE [dbo].[AdministrativeAreas] -SET Abbreviation = 'Fort St. John' -WHERE Name = 'City of Fort St John' AND Abbreviation = 'Fort St John'; - -UPDATE [dbo].[AdministrativeAreas] -SET Abbreviation = 'Fort St. James' -WHERE Name = 'District of Fort St James' AND Abbreviation = 'Fort St James'; - -UPDATE [dbo].[AdministrativeAreas] -SET Abbreviation = 'North Vancouver' -WHERE Name = 'City of North Vancouver' AND Abbreviation = 'North Vancouver - City'; - -UPDATE [dbo].[AdministrativeAreas] -SET Abbreviation = 'Langley' -WHERE Name = 'City of Langley' AND Abbreviation = 'Langley - City'; - --- Do the "one off" updates to simplify the name where there is only once instance of each -UPDATE [dbo].[AdministrativeAreas] -SET Name = 'Spallumcheen' -WHERE Name = 'The Corporation of the Township of Spallumcheen'; - -UPDATE [dbo].[AdministrativeAreas] -SET Name = 'Lake Country' -WHERE Name = 'District Of Lake Country'; - -UPDATE [dbo].[AdministrativeAreas] -SET Name = 'Port Edward' -WHERE Name = 'District of Port Edward'; - -UPDATE [dbo].[AdministrativeAreas] -SET Name = 'Highlands' -WHERE Name = 'District of Highlands'; - -UPDATE [dbo].[AdministrativeAreas] -SET Name = 'Belcarra' -WHERE Name = 'Village of Belcarra'; - -UPDATE [dbo].[AdministrativeAreas] -SET Name = 'Slocan' -WHERE Name = 'Village of Slocan'; - -UPDATE [dbo].[AdministrativeAreas] -SET Name = 'Anmore' -WHERE Name = 'Village of Anmore'; - -UPDATE [dbo].[AdministrativeAreas] -SET Name = 'Warfield' -WHERE Name = 'Village of Warfield'; - -UPDATE [dbo].[AdministrativeAreas] -SET Name = 'Canal Flats' -WHERE Name = 'Village of Canal Flats'; - -UPDATE [dbo].[AdministrativeAreas] -SET Name = 'Radium Hot Springs' -WHERE Name = 'Village of Radium Hot Springs'; - -UPDATE [dbo].[AdministrativeAreas] -SET Name = 'North Cowichan' -WHERE Name = 'The Corporation of the District of North Cowichan'; - -UPDATE [dbo].[AdministrativeAreas] -SET Name = 'Coldstream' -WHERE Name = 'The Corporation of the District of Coldstream'; - -UPDATE [dbo].[AdministrativeAreas] -SET Name = 'Lake Cowichan' -WHERE Name = 'Town of Lake Cowichan'; - -UPDATE [dbo].[AdministrativeAreas] -SET Name = 'Kent' -WHERE Name = 'District of Kent'; - --- copy the GroupName from the AdministrativeArea that has a Name = Abbreviation -UPDATE t1 -SET t1.GroupName = t2.GroupName -FROM AdministrativeAreas t1 -JOIN (SELECT * from AdministrativeAreas - WHERE isnumeric(Abbreviation) = 0 - AND Abbreviation <> Name - AND Abbreviation in ( - SELECT b.Abbreviation - FROM dbo.AdministrativeAreas a - INNER JOIN AdministrativeAreas b - ON a.Name = B.Abbreviation - ) - ) t2 -ON t1.Name = t2.Abbreviation; - - -PRINT 'Deleting from AdministrativeAreas table' --- Then delete the "duplicate" locations which are not handled by the "bulk" delete operation -DELETE FROM dbo.[AdministrativeAreas] -WHERE Name IN ('Bowen Island Municipality', 'Resort Municipality of Whistler', 'District Municipality of West Vancouver', 'The Corporation of the Village of Hazelton', 'Salmo Creston Summit', 'Lower Nicola Boston Bar'); - -DELETE FROM dbo.[AdministrativeAreas] -WHERE Name LIKE ('District of %'); - -DELETE FROM dbo.[AdministrativeAreas] -WHERE Name LIKE '%Corporation%'; - -DELETE FROM dbo.[AdministrativeAreas] -WHERE Name LIKE ('City of %'); - -DELETE FROM dbo.[AdministrativeAreas] -WHERE Name LIKE ('Village of %'); - -DELETE FROM dbo.[AdministrativeAreas] -WHERE Name LIKE ('Town of %'); - - \ No newline at end of file diff --git a/backend/dal/Migrations/v01.07.00/Up/PostUp/01-Agencies.sql b/backend/dal/Migrations/v01.07.00/Up/PostUp/01-Agencies.sql deleted file mode 100644 index acfe432711..0000000000 --- a/backend/dal/Migrations/v01.07.00/Up/PostUp/01-Agencies.sql +++ /dev/null @@ -1,534 +0,0 @@ -PRINT 'Adding/Updating School District Agencies' - -DECLARE @ParentId INT = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'EDUC') - -MERGE INTO dbo.[Agencies] [Target] -USING ( VALUES -( - 'School District 1 Fernie' - , 'SD 01' - , 'Changed to 5 Southeast Kootenay' - , 1 -),( - 'School District 2 Cranbrook' - , 'SD 02' - , 'Changed to 5 Southeast Kootenay' - , 1 -),( - 'School District 3 Kimberley' - , 'SD 03' - , 'Changed to 6 Rocky Mountain' - , 1 -),( - 'School District 4 Windermere' - , 'SD 04' - , 'Changed to 6 Rocky Mountain' - , 1 -),( - 'School District 5 Southeast Kootenay' - , 'SD 05' - , '' - , 0 -),( - 'School District 6 Rocky Mountain' - , 'SD 06' - , '' - , 0 -),( - 'School District 7 Nelson' - , 'SD 07' - , 'Changed to 8 Kootenay Lake' - , 1 -),( - 'School District 8 Kootenay Lake' - , 'SD 08' - , '' - , 0 -),( - 'School District 9 Castlegar' - , 'SD 09' - , 'Changed to 20 Kootenay-Columbia' - , 1 -),( - 'School District 10 Arrow Lakes' - , 'SD 10' - , '' - , 0 -),( - 'School District 11 Trail' - , 'SD 11' - , 'Changed to 20 Kootenay-Columbia' - , 1 -),( - 'School District 12 Grand Forks' - , 'SD 12' - , 'Changed to 51 Boundary' - , 1 -),( - 'School District 13 Kettle Valley' - , 'SD 13' - , 'Changed to 51 Boundary' - , 1 -),( - 'School District 14 Southern Okanagan' - , 'SD 14' - , 'Changed to 53 Okanagan Similkameen' - , 1 -),( - 'School District 15 Penticton' - , 'SD 15' - , 'Changed to 67 Okanagan Skaha' - , 1 -),( - 'School District 16 Keremeos' - , 'SD 16' - , 'Changed to 53 Okanagan Similkameen' - , 1 -),( - 'School District 17 Princeton' - , 'SD 17' - , 'Changed to 58 Nicola-Similkameen' - , 1 -),( - 'School District 18 Golden' - , 'SD 18' - , 'Changed to 6 Rocky Mountain' - , 1 -),( - 'School District 19 Revelstoke' - , 'SD 19' - , '' - , 0 -),( - 'School District 20 Kootenay-Columbia' - , 'SD 20' - , '' - , 0 -),( - 'School District 21 Armstrong-Spallumcheen' - , 'SD 21' - , 'Changed to 83 North Okanagan-Shuswap' - , 1 -),( - 'School District 22 Vernon' - , 'SD 22' - , '' - , 0 -),( - 'School District 23 Central Okanagan' - , 'SD 23' - , '' - , 0 -),( - 'School District 24 Kamloops' - , 'SD 24' - , 'Changed to 73 Kamloops/Thompson' - , 1 -),( - 'School District 25' - , 'SD 25' - , '' - , 0 -),( - 'School District 26 North Thompson' - , 'SD 26' - , 'Changed to 73 Kamloops/Thompson' - , 1 -),( - 'School District 27 Cariboo-Chilcotin' - , 'SD 27' - , '' - , 0 -),( - 'School District 28 Quesnel' - , 'SD 28' - , '' - , 0 -),( - 'School District 29 Lillooet' - , 'SD 29' - , 'Changed to 74 Gold Trail' - , 1 -),( - 'School District 30 South Cariboo' - , 'SD 30' - , 'Changed to 74 Gold Trail' - , 1 -),( - 'School District 31 Merritt' - , 'SD 31' - , 'Changed to 58 Nicola-Similkameen' - , 1 -),( - 'School District 32 Hope' - , 'SD 32' - , 'Changed to 78 Fraser-Cascade' - , 1 -),( - 'School District 33 Chilliwack' - , 'SD 33' - , '' - , 0 -),( - 'School District 34 Abbotsford' - , 'SD 34' - , '' - , 0 -),( - 'School District 35 Langley' - , 'SD 35' - , '' - , 0 -),( - 'School District 36 Surrey' - , 'SD 36' - , '' - , 0 -),( - 'School District 37 Delta' - , 'SD 37' - , '' - , 0 -),( - 'School District 38 Richmond' - , 'SD 38' - , '' - , 0 -),( - 'School District 39 Vancouver' - , 'SD 39' - , '' - , 0 -),( - 'School District 40 New Westminster' - , 'SD 40' - , '' - , 0 -),( - 'School District 41 Burnaby' - , 'SD 41' - , '' - , 0 -),( - 'School District 42 Maple Ridge-Pitt Meadows' - , 'SD 42' - , '' - , 0 -),( - 'School District 43 Coquitlam' - , 'SD 43' - , '' - , 0 -),( - 'School District 44 North Vancouver' - , 'SD 44' - , '' - , 0 -),( - 'School District 45 West Vancouver' - , 'SD 45' - , '' - , 0 -),( - 'School District 46 Sunshine Coast' - , 'SD 46' - , '' - , 0 -),( - 'School District 47 Powell River' - , 'SD 47' - , '' - , 0 -),( - 'School District 48 Sea to Sky' - , 'SD 48' - , '' - , 0 -),( - 'School District 49 Central Coast' - , 'SD 49' - , '' - , 0 -),( - 'School District 50 Haida Gwaii' - , 'SD 50' - , '' - , 0 -),( - 'School District 51 Boundary' - , 'SD 51' - , '' - , 0 -),( - 'School District 52 Prince Rupert' - , 'SD 52' - , '' - , 0 -),( - 'School District 53 Okanagan Similkameen' - , 'SD 53' - , '' - , 0 -),( - 'School District 54 Bulkley Valley' - , 'SD 54' - , '' - , 0 -),( - 'School District 55 Burns Lake' - , 'SD 55' - , 'Changed to 91 Nechako Lakes' - , 1 -),( - 'School District 56 Nechako' - , 'SD 56' - , 'Changed to 91 Nechako Lakes' - , 1 -),( - 'School District 57 Prince George' - , 'SD 57' - , '' - , 0 -),( - 'School District 58 Nicola-Similkameen' - , 'SD 58' - , '' - , 0 -),( - 'School District 59 Peace River South' - , 'SD 59' - , '' - , 0 -),( - 'School District 60 Peace River North' - , 'SD 60' - , '' - , 0 -),( - 'School District 61 Greater Victoria' - , 'SD 61' - , '' - , 0 -),( - 'School District 62 Sooke' - , 'SD 62' - , '' - , 0 -),( - 'School District 63 Saanich' - , 'SD 63' - , '' - , 0 -),( - 'School District 64 Gulf Islands' - , 'SD 64' - , '' - , 0 -),( - 'School District 65 Cowichan' - , 'SD 65' - , 'Changed to 79 Cowichan Valley' - , 1 -),( - 'School District 66 Lake Cowichan' - , 'SD 66' - , 'Changed to 79 Cowichan Valley' - , 1 -),( - 'School District 67 Okanagan Skaha' - , 'SD 67' - , '' - , 0 -),( - 'School District 68 Nanaimo-Ladysmith' - , 'SD 68' - , '' - , 0 -),( - 'School District 69 Qualicum' - , 'SD 69' - , '' - , 0 -),( - 'School District 70 Alberni' - , 'SD 70' - , '' - , 0 -),( - 'School District 71 Comox Valley' - , 'SD 71' - , '' - , 0 -),( - 'School District 72 Campbell River' - , 'SD 72' - , '' - , 0 -),( - 'School District 73 Kamloops/Thompson' - , 'SD 73' - , '' - , 0 -),( - 'School District 74 Gold Trail' - , 'SD 74' - , '' - , 0 -),( - 'School District 75 Mission' - , 'SD 75' - , '' - , 0 -),( - 'School District 76 Agassiz-Harrison' - , 'SD 76' - , 'Changed to 78 Fraser-Cascade' - , 1 -),( - 'School District 77 Summerland' - , 'SD 77' - , 'Changed to 67 Okanagan Skaha' - , 1 -),( - 'School District 78 Fraser-Cascade' - , 'SD 78' - , '' - , 0 -),( - 'School District 79 Cowichan Valley' - , 'SD 79' - , '' - , 0 -),( - 'School District 80 Kitimat' - , 'SD 80' - , 'Changed to 82 Coast Mountains' - , 1 -),( - 'School District 81 Fort Nelson' - , 'SD 81' - , '' - , 0 -),( - 'School District 82 Coast Mountains' - , 'SD 82' - , '' - , 0 -),( - 'School District 83 North Okanagan-Shuswap' - , 'SD 83' - , '' - , 0 -),( - 'School District 84 Vancouver Island West' - , 'SD 84' - , '' - , 0 -),( - 'School District 85 Vancouver Island North' - , 'SD 85' - , '' - , 0 -),( - 'School District 86 Creston-Kaslo' - , 'SD 86' - , 'Changed to 8 Kootenay Lake' - , 1 -),( - 'School District 87 Stikine' - , 'SD 87' - , '' - , 0 -),( - 'School District 88 Terrace' - , 'SD 88' - , 'Changed to 82 Coast Mountains' - , 1 -),( - 'School District 89 Shuswap' - , 'SD 89' - , 'Changed to 83 North Okanagan-Shuswap' - , 1 -),( - 'School District 90' - , 'SD 90' - , '' - , 0 -),( - 'School District 91 Nechako Lakes' - , 'SD 91' - , '' - , 0 -),( - 'School District 92 Nisga''a' - , 'SD 92' - , '' - , 0 -),( - 'School District 93 Conseil scolaire francophone' - , 'SD 93' - , '' - , 0 -),( - 'School District 94' - , 'SD 94' - , '' - , 0 -),( - 'School District 95' - , 'SD 95' - , '' - , 0 -),( - 'School District 96' - , 'SD 96' - , '' - , 0 -),( - 'School District 97' - , 'SD 97' - , '' - , 0 -),( - 'School District 98' - , 'SD 98' - , '' - , 0 -),( - 'School District 99' - , 'SD 99' - , '' - , 0 -),( - 'School District 100' - , 'SD 100' - , '' - , 0 -)) AS [Source] ( - [Name] - , [Code] - , [Description] - , [IsDisabled] -) ON [Target].[Code] = [Source].[Code] -WHEN MATCHED THEN - UPDATE - SET [Target].[Name] = [Source].[Name] - , [Target].[Description] = [Source].[Description] - , [Target].[ParentId] = @ParentId - , [Target].[IsDisabled] = [Source].[IsDisabled] -WHEN NOT MATCHED THEN - INSERT ( - [Name] - , [Code] - , [Description] - , [ParentId] - , [SendEmail] - , [IsDisabled] - ) VALUES ( - [Source].[Name] - , [Source].[Code] - , [Source].[Description] - , @ParentId - , 0 - , [Source].[IsDisabled] - ); diff --git a/backend/dal/Migrations/v01.07.00/Up/PostUp/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.07.00/Up/PostUp/01-NotificationTemplates.sql deleted file mode 100644 index 5ceca9353d..0000000000 --- a/backend/dal/Migrations/v01.07.00/Up/PostUp/01-NotificationTemplates.sql +++ /dev/null @@ -1,6 +0,0 @@ -PRINT 'Update e-mail notification templates' - --- Add SRES to BCC except for new disposal submitted as they are already included -UPDATE dbo.[NotificationTemplates] -SET [Bcc] = 'RealPropertyDivision.Disposals@gov.bc.ca' -WHERE [Id] <> 1 diff --git a/backend/dal/Migrations/v01.07.00/Up/PostUp/01-PropertyClassificationTypes.sql b/backend/dal/Migrations/v01.07.00/Up/PostUp/01-PropertyClassificationTypes.sql deleted file mode 100644 index a53aa0915a..0000000000 --- a/backend/dal/Migrations/v01.07.00/Up/PostUp/01-PropertyClassificationTypes.sql +++ /dev/null @@ -1,21 +0,0 @@ -PRINT 'Adding Subdivided/Demolished classifications' - -INSERT INTO dbo.[PropertyClassifications] ( - [Id] - , [Name] - , [IsDisabled] - , [IsVisible] - , [SortOrder] -) VALUES ( - 5 - , 'Demolished' - , 0 - , 1 - , 6 -), ( - 6 - , 'Subdivided' - , 0 - , 1 - , 7 -) diff --git a/backend/dal/Migrations/v01.07.00/Up/PostUp/01-PropertyTypes.sql b/backend/dal/Migrations/v01.07.00/Up/PostUp/01-PropertyTypes.sql deleted file mode 100644 index 7442a19b97..0000000000 --- a/backend/dal/Migrations/v01.07.00/Up/PostUp/01-PropertyTypes.sql +++ /dev/null @@ -1,14 +0,0 @@ -PRINT 'Updating PropertyTypes' - --- Ensure the insert succeeds. -DELETE FROM dbo.[PropertyTypes] where Id = 2; - -INSERT INTO dbo.[PropertyTypes] ( - [Id] - , [Name] - , [IsDisabled] -) VALUES ( - 2 - , 'Subdivision' - , 0 -) diff --git a/backend/dal/Migrations/v01.07.00/Up/PostUp/01-ViewProperties.sql b/backend/dal/Migrations/v01.07.00/Up/PostUp/01-ViewProperties.sql deleted file mode 100644 index 9c5988cfca..0000000000 --- a/backend/dal/Migrations/v01.07.00/Up/PostUp/01-ViewProperties.sql +++ /dev/null @@ -1,213 +0,0 @@ -PRINT 'Updating View_Properties - Updating Assessment' -GO --- This script provides a way to union both parcels and buildings into a single result of properties. --- Updating view to support many-to-many parcels and buildings.TEMPORARY -CREATE OR ALTER VIEW dbo.[View_Properties] AS -SELECT - p.[Id] - , p.[RowVersion] - , p.[PropertyTypeId] - , p.[ClassificationId] - , [Classification] = c.[Name] - , p.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , p.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [AdministrativeArea] = adr.[AdministrativeArea] - , [Province] = ap.[Name] - , adr.[Postal] - , p.[ProjectNumbers] - , p.[Name] - , p.[Description] - , p.[Location] - , p.[Boundary] - , p.[IsSensitive] - , p.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , p.[PID] - , p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [ParcelId] = p.[Id] - , [BuildingConstructionTypeId] = 0 - , [BuildingConstructionType] = null - , [BuildingFloorCount] = 0 - , [BuildingPredominateUseId] = 0 - , [BuildingPredominateUse] = null - , [BuildingOccupantTypeId] = 0 - , [BuildingOccupantType] = null - , [BuildingTenancy] = null - , [RentableArea] = 0 - , [LeaseExpiry] = null - , [OccupantName] = null - , [TransferLeaseOnSale] = CAST(0 AS BIT) - - , [AssessedLand] = eas.[Value] - , [AssessedLandDate] = eas.[Date] - , [AssessedBuilding] = eim.[Value] - , [AssessedBuildingDate] = eim.[Date] - , [Market] = ISNULL(fe.[Value], 0) - , [MarketFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] -FROM dbo.[Parcels] p -LEFT JOIN (SELECT DISTINCT SubdivisionId FROM dbo.[ParcelParcels]) sp ON p.[Id] = sp.[SubdivisionId] -JOIN dbo.[PropertyClassifications] c ON p.[ClassificationId] = c.[Id] -JOIN dbo.[Agencies] a ON p.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON p.[AddressId] = adr.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- Assessed Land - ORDER BY [Date] DESC -) AS eas -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 2 -- Assessed Building - ORDER BY [Date] DESC -) AS eim -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 1 -- Market - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn -UNION ALL -SELECT - b.[Id] - , b.[RowVersion] - , b.[PropertyTypeId] - , b.[ClassificationId] - , [Classification] = c.[Name] - , b.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , b.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [AdministrativeArea] = adr.[AdministrativeArea] - , [Province] = ap.[Name] - , adr.[Postal] - , b.[ProjectNumbers] - , b.[Name] - , b.[Description] - , b.[Location] - , b.[Boundary] - , b.[IsSensitive] - , b.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , [PID] = p.[PID] - , [PIN] = p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [ParcelId] = p.[Id] - , [BuildingConstructionTypeId] = b.[BuildingConstructionTypeId] - , [BuildingConstructionType] = bct.[Name] - , [BuildingFloorCount] = b.[BuildingFloorCount] - , [BuildingPredominateUseId] = b.[BuildingPredominateUseId] - , [BuildingPredominateUse] = bpu.[Name] - , [BuildingOccupantTypeId] = b.[BuildingOccupantTypeId] - , [BuildingOccupantType] = bot.[Name] - , [BuildingTenancy] = b.[BuildingTenancy] - , [RentableArea] = b.[RentableArea] - , [LeaseExpiry] = b.[LeaseExpiry] - , [OccupantName] = b.[OccupantName] - , [TransferLeaseOnSale] = b.[TransferLeaseOnSale] - - , [AssessedLand] = null - , [AssessedLandDate] = null - , [AssessedBuilding] = eim.[Value] - , [AssessedBuildingDate] = eim.[Date] - , [Market] = ISNULL(fe.[Value], 0) - , [MarketFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] -FROM dbo.[Buildings] b -LEFT JOIN dbo.[ParcelBuildings] pb ON b.[Id] = pb.[BuildingId] -LEFT JOIN dbo.[Parcels] p ON pb.[ParcelId] = p.[Id] -JOIN dbo.[PropertyClassifications] c ON b.[ClassificationId] = c.[Id] -JOIN dbo.[Agencies] a ON b.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON b.[AddressId] = adr.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -JOIN dbo.[BuildingConstructionTypes] bct ON b.[BuildingConstructionTypeId] = bct.[Id] -JOIN dbo.[BuildingOccupantTypes] bot ON b.[BuildingOccupantTypeId] = bot.[Id] -JOIN dbo.[BuildingPredominateUses] bpu ON b.[BuildingPredominateUseId] = bpu.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[BuildingEvaluations] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- Assessed - ORDER BY [Date] DESC -) AS eim -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 1 -- Market - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn diff --git a/backend/dal/Migrations/v01.07.00/Up/PostUp/01-WorkflowProjectStatus.sql b/backend/dal/Migrations/v01.07.00/Up/PostUp/01-WorkflowProjectStatus.sql deleted file mode 100644 index 2f7040078e..0000000000 --- a/backend/dal/Migrations/v01.07.00/Up/PostUp/01-WorkflowProjectStatus.sql +++ /dev/null @@ -1,13 +0,0 @@ -PRINT 'Adding WorkflowProjectStatus - SPL Transfer within GRE' - -INSERT INTO dbo.[WorkflowProjectStatus] ( - [WorkflowId] - , [StatusId] - , [IsOptional] - , [SortOrder] -) VALUES ( - 6 -- SPL - , 20 -- Transferred within GRE - , 1 - , 5 -) diff --git a/backend/dal/Migrations/v01.07.00/Up/PostUp/02-ProjectStatusTransitions.sql b/backend/dal/Migrations/v01.07.00/Up/PostUp/02-ProjectStatusTransitions.sql deleted file mode 100644 index ac095bf81c..0000000000 --- a/backend/dal/Migrations/v01.07.00/Up/PostUp/02-ProjectStatusTransitions.sql +++ /dev/null @@ -1,48 +0,0 @@ -PRINT 'Adding ProjectStatusTransitions - SPL to Transfer within GRE' - -INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [Action] - , [ToWorkflowId] - , [ToStatusId] - , [ValidateTasks] -) VALUES - --- Allow progression from all SPL status to Transfer within GRE -( - 6 -- SPL - , 21 -- Approved for SPL - , 'Transfer within GRE' - , 6 -- SPL - , 20 -- Transferred within GRE - , 0 -), ( - 6 -- SPL - , 40 -- Pre-Marketing - , 'Transfer within GRE' - , 6 -- SPL - , 20 -- Transferred within GRE - , 0 -), ( - 6 -- SPL - , 41 -- Marketing - , 'Transfer within GRE' - , 6 -- SPL - , 20 -- Transferred within GRE - , 1 -), ( - 6 -- SPL - , 42 -- Contract in Place - Conditional - , 'Transfer within GRE' - , 6 -- SPL - , 20 -- Transferred within GRE - , 0 -), ( - 6 -- SPL - , 43 -- Contract in Place - Unconditional - , 'Transfer within GRE' - , 6 -- SPL - , 20 -- Transferred within GRE - , 1 -) diff --git a/backend/dal/Migrations/v01.07.00/Up/PreUp/01-Buildings.sql b/backend/dal/Migrations/v01.07.00/Up/PreUp/01-Buildings.sql deleted file mode 100644 index 7c8642d9a6..0000000000 --- a/backend/dal/Migrations/v01.07.00/Up/PreUp/01-Buildings.sql +++ /dev/null @@ -1,423 +0,0 @@ -PRINT 'Transfer Capital Planning Branch Buildings to School Districts' - -DECLARE @CPBId INT = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'CPB') - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 05') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Southeast Kootenay', 'Cranbrook', 'Fernie', 'Elkford', 'Sparwood', 'Hosmer', 'Corbin', 'Fort Steele', 'Elko', 'Jaffray', 'Rooseville', 'Newgate', 'Flathead', 'Grasmere', 'Baker', 'Wardner', 'Bull River', 'Moyie', 'Wycliffe') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 06') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Rocky Mountain', 'Invermere', 'Kimberley', 'Radium Hit Springs', 'Golden', 'Field', 'Marysville') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 08') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Kootenay Lake', 'Creston', 'Salmo', 'Nelson', 'Kaslo', 'Slocan', 'Kootenay', 'Duncan Lake', 'Winlaw', 'Taghum', 'Queens Bay', 'Procter', 'Hot Springs', 'Riondel Ainsworth', 'Argenta', 'Gerrard', 'Howser', 'Kitchener', 'Yahk', 'Erickson', 'Kingsgate', 'Rykerts', 'Nelway') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 10') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Arrow Lakes', 'Edgewood', 'Burton', 'Shoreholme', 'Silverton', 'New Denver', 'Nakusp', 'Fauquier') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 19') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Revelstoke', 'Beaton', 'Mica Creek') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 20') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Castlegar', 'Rossland', 'Trail', 'Montrose', 'Warfield', 'Fruitvale', 'Renata', 'Robson', 'Glade') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 22') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Vernon', 'Lumby', 'Coldstream', 'Mabel Lake', 'Cherryville', 'Oyama') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 23') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Central Okanagan', 'Kelowna', 'Peachland', 'Lake Country', 'Westbank', 'West Kelowna') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 27') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('150 Mile House', 'Riske Creek', 'Bridge Lake', 'Mcleese Lake', 'Likely', 'Ulkatcho', 'Anahim Lake', 'Towdystan', 'Kleena Kleene', 'Tatla Lake', 'Redstone', 'Alexis Creek', 'Williams Lake', '100 Mile House', 'Horsefly', 'Quesnel Lake', 'Canim Lake', 'Mahood Lake') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 28') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Quesnel', 'Nazko', 'Wells') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 33') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Chilliwack', 'Rosedale', 'Cultus Lake', 'Sardis') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 34') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Abbotsford') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 35') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Langley', 'Langley City', 'Aldergrove') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 36') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Surrey', 'White Rock') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 37') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Delta', 'Tsawwassen') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 38') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Richmond') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 39') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Vancouver') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 40') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('New Westminster', 'Garibaldi Highlands') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 41') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Burnaby') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 42') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Maple Ridge', 'Pitt Meadows', 'Alvin') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 43') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Coquitlam', 'Port Coquitlam', 'Anmore', 'Belcarra', 'Port Moody') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 44') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('North Vancouver', 'Vancouver City') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 45') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('West Vancouver', 'Lions Bay', 'Bowen Island') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 46') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Sunshine Coast', 'Sechelt', 'Gibsons', 'Egmont', 'Madeira Park', 'Selma Park', 'Roberts Creek', 'Lasqueti Island', 'Texada Island') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 47') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Powell River', 'Lang Bay', 'Saltery Bay', 'Lund', 'Blubber Bay', 'Gillies Bay', 'Cortes Island') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 48') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Sea to Sky', 'Pemberton', 'Whistler', 'Birken', 'Mount Currie', 'Garibaldi', 'Brackendale', 'Squamish', 'Britannia Beach') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 49') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Central Coast', 'Bella Bella', 'Ocean Falls', 'Bella Coola', 'Hagensborg', 'Namu', 'Rivers Inlet', 'Dawsons Landing', 'Goose Bay') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 50') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Haida Gwaii', 'Masset', 'Skidegate', 'Sandspit', 'Queen Charlotte', 'Tamu', 'Queen Charlotte City', 'Juskatla', 'Skidegate Landing', 'Tlell', 'Port Clements') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 51') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Boundary', 'Beaverdell', 'Rock Creek', 'Westbridge', 'Bridesville', 'Kettle Valley', 'Greenwood', 'Midway', 'Grand Forks', 'Christina Lake') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 52') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Prince Rupert', 'Georgetown Mills', 'Port Edward', 'Metlakatla', 'Kitkatla', 'Port Essington', 'Hartley Bay') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 53') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Okanagan Similkameen', 'Hedley', 'Keremeos', 'Oliver', 'Osoyoos', 'Cawston') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 54') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Houston', 'Smithers', 'Telkwa', 'Glentanna') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 57') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Hixon', 'Mackenzie', 'McLeod Lake', 'Summit Lake', 'Reid Lake', 'Prince George', 'Beaverley', 'Baldy Hughes', 'Willow River', 'Longworth', 'Penny', 'Dome Creek', 'McBride', 'Dunster', 'Valemount', 'Albreda', 'Cedarside', 'Tete Jaune Cache') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 58') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Nicola-Similkameen', 'Princeton', 'Merritt', 'Quilchena', 'Aspen Grove', 'Bankeir', 'Coalmont', 'Manning Park', 'Lower Nicola') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 59') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Peace River South', 'Chetwynd', 'Dawson Creek', 'Pine Valley', 'Tumbler Ridge', 'Kelly Lake', 'Tomslake', 'Pouce Coupe', 'Doe River', 'Rolla', 'Arras', 'East Pine', 'Lone Prairie', 'Moberly Lake') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 60') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Peace River North', 'Fort St. John', 'Taylor', 'Clayhurst', 'Goodlow', 'Doig River', 'Rose Prairie', 'Buick', 'Wonowon', 'Trutch', 'Pink Mountain', 'Upper Halfway', 'Hudson''s Hope', 'Ware', 'Ingenika Mine') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 61') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Greater Victoria', 'Victoria', 'Saanich', 'View Royal', 'Oak Bay', 'Esquimalt') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 62') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Sooke', 'Metchosin', 'Colwood', 'Langford', 'Highlands', 'Jordan River', 'Port Renfrew') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 63') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Sidney', 'North Saanich', 'Central Saanich', 'Saanichton') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 64') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Gulf Islands', 'Saltspring Island', 'Prevost Island', 'Galiano Island', 'Mayne Island', 'Pender Islands', 'Pender Island', 'Saturna Island', 'Ganges', 'Kincolith') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 67') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Okanagan Skaha', 'Summerland', 'Penticton', 'Naramata', 'Kaleden', 'Okanagan Falls') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 68') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Nanaimo-Ladysmith', 'Nanaimo', 'Ladysmith', 'Cedar', 'Wellington', 'Lantzville', 'Gabriola Island', 'Cassidy') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 69') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Qualicum', 'Qualicum Beach', 'French Creek', 'Parksville', 'Nanoose Bay', 'Errington', 'Qualicum Bay') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 70') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Pacific Rim', 'Ahousaht', 'Hesquiat', 'Hot Springs Cove', 'Clayoquot', 'Tofino', 'Port Albion', 'Ucluelet', 'Sproat Lake', 'Port Alberni', 'Nahmint', 'Bamfield') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 71') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Comox Valley', 'Comox', 'Black Creek', 'Grantham', 'Courtenay', 'Cumberland', 'Fanny Bay', 'Hornby Island', 'Denman Island') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 72') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Campbell River', 'Sayward', 'Quathiaski Cove', 'Read Island', 'Quadra Island') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 73') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Kamloops-Thompson', 'Thompson', 'Blue River', 'Stillwater', 'Avola', 'Vavenby', 'Clearwater', 'Little Fort', 'Darfield', 'Barriere', 'McLure', 'Adams Lake', 'Chase', 'Pritchard', 'Monte Lake', 'Kamloops', 'Savona', 'Lac Le Jeune', 'Logan Lake') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 74') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Gold Trail', 'Bib Bar Creek', 'Clinton', 'Pavilion', 'Ogden', 'Shalalth', 'Lillooet', 'Cahce Creek', 'Ashcroft', 'Boston Flats', 'Spences Bridge', 'Lytton', 'Agate', 'Kanaka Bar', 'Goldbridge') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 75') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Mission', 'Deroche', 'Lake Errock') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 78') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Fraser-Cascade', 'Cache Creek', 'Kent', 'Agassiz', 'Harrison Hot Springs', 'Skookumchuck', 'Boston Bar', 'Yale', 'Hope') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 79') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Cowichan Valley', 'Gordon River', 'Lake Cowichan', 'Cowichan Lake', 'Youbou', 'Cowichan Bay', 'Chemainus', 'Mill Bay', 'Duncan', 'North Cowichan', 'Thetis Island', 'Shawnigan Lake', 'Cobble Hill') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 81') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Fort Nelson', 'Toad River', 'Liard River', 'Muncho Lake', 'Snake River', 'Prophet River', 'Fontas') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 82') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Coast Mountains', 'Terrace', 'Stikine', 'Stewart', 'Alice Arm', 'Cranberry Junction', 'Gitanyow', 'Kispiox', 'Hazelton', 'New Hazelton', 'Rosswood', 'Lakelse Lake', 'Kitimat', 'Nechako', 'Kitamaat Village', 'Kildala Arm', 'Kemano', 'Kemano Beach', 'Butedale', 'Klemtu') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 83') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('North Okanagan-Shuswap', 'Albas', 'St. Ives', 'Saint Ives', 'Sicamous', 'Tappen', 'Canoe', 'Grindrod', 'Enderby', 'Salmon Arm', 'Spallumcheen', 'Armstrong', 'Falkland', 'Scotch Creek') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 84') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Vancouver Island West', 'Gold River', 'Tahsis', 'Zeballos', 'Kyuquot', 'Esperanza') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 85') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Vancouver Island North', 'Holberg', 'Quatsino', 'Coal Harbour', 'Port Hardy', 'Sointula', 'Alert Bay', 'Port McNeill', 'Port Alice', 'Telegraph Cove', 'Nimpkish', 'Woss', 'Kingcome Inlet', 'Minstrel Island', 'Sullivan Bay') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 87') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Stikine', 'Dease Lake', 'Atlin', 'Cassiar', 'Tulsequash', 'Telegraph Creek', 'Boulder City', 'Lower Post', 'Kinaskan Lake', 'Cry Lake') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 91') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Francois Lake', 'Nechako Lakes', 'Bear Lake', 'Tchentlo Lakes', 'Takla Lake', 'Fort Babine', 'Smithers Landing', 'Granisle', 'Topley Landing', 'Babine Lake', 'Topley', 'Chuchi Lake', 'Trembleur Lake', 'Grand Rapids', 'Tachie', 'Pinchi', 'Fort St. James', 'Dog Creek', 'Donald Landing', 'Decker Lake', 'Bulkley Lake', 'Burns Lake', 'Fraser Lake', 'Fort Fraser', 'Vanderhoof', 'Fancois Lake', 'Grassy Plains', 'Tahtsa Lake', 'Whitesail Reach', 'Ootsa Lake', 'Whitesail Lake', 'Eutsuk Lake', 'Cheslatta Lake', 'Newstubb Lake', 'Natalkuz Lake') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 92') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Nisga''a', 'Kitwanga', 'Nass Camp', 'New Aiyansh', 'Laxgalts''ap') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 93') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Conseil scolaire francophone') - AND p.[AgencyId] = @CPBId diff --git a/backend/dal/Migrations/v01.07.00/Up/PreUp/01-Parcels.sql b/backend/dal/Migrations/v01.07.00/Up/PreUp/01-Parcels.sql deleted file mode 100644 index 9af6240003..0000000000 --- a/backend/dal/Migrations/v01.07.00/Up/PreUp/01-Parcels.sql +++ /dev/null @@ -1,423 +0,0 @@ -PRINT 'Transfer Capital Planning Branch Parcels to School Districts' - -DECLARE @CPBId INT = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'CPB') - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 05') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Southeast Kootenay', 'Cranbrook', 'Fernie', 'Elkford', 'Sparwood', 'Hosmer', 'Corbin', 'Fort Steele', 'Elko', 'Jaffray', 'Rooseville', 'Newgate', 'Flathead', 'Grasmere', 'Baker', 'Wardner', 'Bull River', 'Moyie', 'Wycliffe') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 06') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Rocky Mountain', 'Invermere', 'Kimberley', 'Radium Hit Springs', 'Golden', 'Field', 'Marysville') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 08') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Kootenay Lake', 'Creston', 'Salmo', 'Nelson', 'Kaslo', 'Slocan', 'Kootenay', 'Duncan Lake', 'Winlaw', 'Taghum', 'Queens Bay', 'Procter', 'Hot Springs', 'Riondel Ainsworth', 'Argenta', 'Gerrard', 'Howser', 'Kitchener', 'Yahk', 'Erickson', 'Kingsgate', 'Rykerts', 'Nelway') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 10') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Arrow Lakes', 'Edgewood', 'Burton', 'Shoreholme', 'Silverton', 'New Denver', 'Nakusp', 'Fauquier') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 19') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Revelstoke', 'Beaton', 'Mica Creek') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 20') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Castlegar', 'Rossland', 'Trail', 'Montrose', 'Warfield', 'Fruitvale', 'Renata', 'Robson', 'Glade') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 22') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Vernon', 'Lumby', 'Coldstream', 'Mabel Lake', 'Cherryville', 'Oyama') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 23') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Central Okanagan', 'Kelowna', 'Peachland', 'Lake Country', 'Westbank', 'West Kelowna') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 27') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('150 Mile House', 'Riske Creek', 'Bridge Lake', 'Mcleese Lake', 'Likely', 'Ulkatcho', 'Anahim Lake', 'Towdystan', 'Kleena Kleene', 'Tatla Lake', 'Redstone', 'Alexis Creek', 'Williams Lake', '100 Mile House', 'Horsefly', 'Quesnel Lake', 'Canim Lake', 'Mahood Lake') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 28') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Quesnel', 'Nazko', 'Wells') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 33') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Chilliwack', 'Rosedale', 'Cultus Lake', 'Sardis') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 34') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Abbotsford') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 35') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Langley', 'Langley City', 'Aldergrove') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 36') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Surrey', 'White Rock') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 37') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Delta', 'Tsawwassen') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 38') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Richmond') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 39') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Vancouver') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 40') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('New Westminster', 'Garibaldi Highlands') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 41') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Burnaby') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 42') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Maple Ridge', 'Pitt Meadows', 'Alvin') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 43') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Coquitlam', 'Port Coquitlam', 'Anmore', 'Belcarra', 'Port Moody') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 44') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('North Vancouver', 'Vancouver City') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 45') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('West Vancouver', 'Lions Bay', 'Bowen Island') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 46') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Sunshine Coast', 'Sechelt', 'Gibsons', 'Egmont', 'Madeira Park', 'Selma Park', 'Roberts Creek', 'Lasqueti Island', 'Texada Island') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 47') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Powell River', 'Lang Bay', 'Saltery Bay', 'Lund', 'Blubber Bay', 'Gillies Bay', 'Cortes Island') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 48') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Sea to Sky', 'Pemberton', 'Whistler', 'Birken', 'Mount Currie', 'Garibaldi', 'Brackendale', 'Squamish', 'Britannia Beach') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 49') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Central Coast', 'Bella Bella', 'Ocean Falls', 'Bella Coola', 'Hagensborg', 'Namu', 'Rivers Inlet', 'Dawsons Landing', 'Goose Bay') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 50') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Haida Gwaii', 'Masset', 'Skidegate', 'Sandspit', 'Queen Charlotte', 'Tamu', 'Queen Charlotte City', 'Juskatla', 'Skidegate Landing', 'Tlell', 'Port Clements') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 51') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Boundary', 'Beaverdell', 'Rock Creek', 'Westbridge', 'Bridesville', 'Kettle Valley', 'Greenwood', 'Midway', 'Grand Forks', 'Christina Lake') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 52') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Prince Rupert', 'Georgetown Mills', 'Port Edward', 'Metlakatla', 'Kitkatla', 'Port Essington', 'Hartley Bay') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 53') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Okanagan Similkameen', 'Hedley', 'Keremeos', 'Oliver', 'Osoyoos', 'Cawston') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 54') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Houston', 'Smithers', 'Telkwa', 'Glentanna') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 57') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Hixon', 'Mackenzie', 'McLeod Lake', 'Summit Lake', 'Reid Lake', 'Prince George', 'Beaverley', 'Baldy Hughes', 'Willow River', 'Longworth', 'Penny', 'Dome Creek', 'McBride', 'Dunster', 'Valemount', 'Albreda', 'Cedarside', 'Tete Jaune Cache') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 58') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Nicola-Similkameen', 'Princeton', 'Merritt', 'Quilchena', 'Aspen Grove', 'Bankeir', 'Coalmont', 'Manning Park', 'Lower Nicola') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 59') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Peace River South', 'Chetwynd', 'Dawson Creek', 'Pine Valley', 'Tumbler Ridge', 'Kelly Lake', 'Tomslake', 'Pouce Coupe', 'Doe River', 'Rolla', 'Arras', 'East Pine', 'Lone Prairie', 'Moberly Lake') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 60') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Peace River North', 'Fort St. John', 'Taylor', 'Clayhurst', 'Goodlow', 'Doig River', 'Rose Prairie', 'Buick', 'Wonowon', 'Trutch', 'Pink Mountain', 'Upper Halfway', 'Hudson''s Hope', 'Ware', 'Ingenika Mine') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 61') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Greater Victoria', 'Victoria', 'Saanich', 'View Royal', 'Oak Bay', 'Esquimalt') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 62') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Sooke', 'Metchosin', 'Colwood', 'Langford', 'Highlands', 'Jordan River', 'Port Renfrew') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 63') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Sidney', 'North Saanich', 'Central Saanich', 'Saanichton') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 64') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Gulf Islands', 'Saltspring Island', 'Prevost Island', 'Galiano Island', 'Mayne Island', 'Pender Islands', 'Pender Island', 'Saturna Island', 'Ganges', 'Kincolith') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 67') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Okanagan Skaha', 'Summerland', 'Penticton', 'Naramata', 'Kaleden', 'Okanagan Falls') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 68') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Nanaimo-Ladysmith', 'Nanaimo', 'Ladysmith', 'Cedar', 'Wellington', 'Lantzville', 'Gabriola Island', 'Cassidy') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 69') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Qualicum', 'Qualicum Beach', 'French Creek', 'Parksville', 'Nanoose Bay', 'Errington', 'Qualicum Bay') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 70') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Pacific Rim', 'Ahousaht', 'Hesquiat', 'Hot Springs Cove', 'Clayoquot', 'Tofino', 'Port Albion', 'Ucluelet', 'Sproat Lake', 'Port Alberni', 'Nahmint', 'Bamfield') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 71') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Comox Valley', 'Comox', 'Black Creek', 'Grantham', 'Courtenay', 'Cumberland', 'Fanny Bay', 'Hornby Island', 'Denman Island') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 72') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Campbell River', 'Sayward', 'Quathiaski Cove', 'Read Island', 'Quadra Island') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 73') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Kamloops-Thompson', 'Thompson', 'Blue River', 'Stillwater', 'Avola', 'Vavenby', 'Clearwater', 'Little Fort', 'Darfield', 'Barriere', 'McLure', 'Adams Lake', 'Chase', 'Pritchard', 'Monte Lake', 'Kamloops', 'Savona', 'Lac Le Jeune', 'Logan Lake') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 74') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Gold Trail', 'Bib Bar Creek', 'Clinton', 'Pavilion', 'Ogden', 'Shalalth', 'Lillooet', 'Cahce Creek', 'Ashcroft', 'Boston Flats', 'Spences Bridge', 'Lytton', 'Agate', 'Kanaka Bar', 'Goldbridge') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 75') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Mission', 'Deroche', 'Lake Errock') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 78') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Fraser-Cascade', 'Cache Creek', 'Kent', 'Agassiz', 'Harrison Hot Springs', 'Skookumchuck', 'Boston Bar', 'Yale', 'Hope') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 79') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Cowichan Valley', 'Gordon River', 'Lake Cowichan', 'Cowichan Lake', 'Youbou', 'Cowichan Bay', 'Chemainus', 'Mill Bay', 'Duncan', 'North Cowichan', 'Thetis Island', 'Shawnigan Lake', 'Cobble Hill') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 81') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Fort Nelson', 'Toad River', 'Liard River', 'Muncho Lake', 'Snake River', 'Prophet River', 'Fontas') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 82') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Coast Mountains', 'Terrace', 'Stikine', 'Stewart', 'Alice Arm', 'Cranberry Junction', 'Gitanyow', 'Kispiox', 'Hazelton', 'New Hazelton', 'Rosswood', 'Lakelse Lake', 'Kitimat', 'Nechako', 'Kitamaat Village', 'Kildala Arm', 'Kemano', 'Kemano Beach', 'Butedale', 'Klemtu') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 83') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('North Okanagan-Shuswap', 'Albas', 'St. Ives', 'Saint Ives', 'Sicamous', 'Tappen', 'Canoe', 'Grindrod', 'Enderby', 'Salmon Arm', 'Spallumcheen', 'Armstrong', 'Falkland', 'Scotch Creek') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 84') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Vancouver Island West', 'Gold River', 'Tahsis', 'Zeballos', 'Kyuquot', 'Esperanza') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 85') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Vancouver Island North', 'Holberg', 'Quatsino', 'Coal Harbour', 'Port Hardy', 'Sointula', 'Alert Bay', 'Port McNeill', 'Port Alice', 'Telegraph Cove', 'Nimpkish', 'Woss', 'Kingcome Inlet', 'Minstrel Island', 'Sullivan Bay') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 87') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Stikine', 'Dease Lake', 'Atlin', 'Cassiar', 'Tulsequash', 'Telegraph Creek', 'Boulder City', 'Lower Post', 'Kinaskan Lake', 'Cry Lake') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 91') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Francois Lake', 'Nechako Lakes', 'Bear Lake', 'Tchentlo Lakes', 'Takla Lake', 'Fort Babine', 'Smithers Landing', 'Granisle', 'Topley Landing', 'Babine Lake', 'Topley', 'Chuchi Lake', 'Trembleur Lake', 'Grand Rapids', 'Tachie', 'Pinchi', 'Fort St. James', 'Dog Creek', 'Donald Landing', 'Decker Lake', 'Bulkley Lake', 'Burns Lake', 'Fraser Lake', 'Fort Fraser', 'Vanderhoof', 'Fancois Lake', 'Grassy Plains', 'Tahtsa Lake', 'Whitesail Reach', 'Ootsa Lake', 'Whitesail Lake', 'Eutsuk Lake', 'Cheslatta Lake', 'Newstubb Lake', 'Natalkuz Lake') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 92') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Nisga''a', 'Kitwanga', 'Nass Camp', 'New Aiyansh', 'Laxgalts''ap') - AND p.[AgencyId] = @CPBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 93') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Conseil scolaire francophone') - AND p.[AgencyId] = @CPBId diff --git a/backend/dal/Migrations/v01.08.00/Down/PostDown/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.08.00/Down/PostDown/01-NotificationTemplates.sql deleted file mode 100644 index ac1f4e3eae..0000000000 --- a/backend/dal/Migrations/v01.08.00/Down/PostDown/01-NotificationTemplates.sql +++ /dev/null @@ -1,74 +0,0 @@ -PRINT 'Removing Notification Template...' - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is to advise that the following properties have been submitted to the Surplus Property Program to be reviewed as surplus by the current holder of the property and is requesting your review:

-

Property Inventory Management System - @Model.Project.ProjectNumber

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - var year = appraised != null ? appraised.Date.Year : assessed.Date.Year; - var value = appraised != null ? appraised.Value : assessed.Value; - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 1; - - diff --git a/backend/dal/Migrations/v01.08.00/Down/PostDown/01-ProjectStatusTransitions.sql b/backend/dal/Migrations/v01.08.00/Down/PostDown/01-ProjectStatusTransitions.sql deleted file mode 100644 index 8b8d903bee..0000000000 --- a/backend/dal/Migrations/v01.08.00/Down/PostDown/01-ProjectStatusTransitions.sql +++ /dev/null @@ -1,19 +0,0 @@ -PRINT 'Removing ProjectStatusTransitions' - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 5 -- ERP - AND [FromStatusId] = 22 -- Not in SPL - AND [ToWorkflowId] = 5 -- ERP - AND [ToStatusId] = 32 -- Disposed - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 5 -- ERP - AND [FromStatusId] = 22 -- Not in SPL - AND [ToWorkflowId] = 5 -- ERP - AND [ToStatusId] = 20 -- Transferred within GRE - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 4 -- 'ASSESS-EX-DISPOSAL' - AND [FromStatusId] = 22 -- Not in SPL - AND [ToWorkflowId] = 5 -- ERP - AND [ToStatusId] = 20 -- Transferred within GRE diff --git a/backend/dal/Migrations/v01.08.00/Down/PostDown/01-ViewProperties.sql b/backend/dal/Migrations/v01.08.00/Down/PostDown/01-ViewProperties.sql deleted file mode 100644 index 4dde493570..0000000000 --- a/backend/dal/Migrations/v01.08.00/Down/PostDown/01-ViewProperties.sql +++ /dev/null @@ -1,213 +0,0 @@ -PRINT 'Updating View_Properties' -GO --- This script provides a way to union both parcels and buildings into a single result of properties. --- Updating view to support many-to-many parcels and buildings.TEMPORARY -CREATE OR ALTER VIEW dbo.[View_Properties] AS -SELECT - p.[Id] - , p.[RowVersion] - , p.[PropertyTypeId] - , p.[ClassificationId] - , [Classification] = c.[Name] - , p.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , p.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [AdministrativeArea] = adr.[AdministrativeArea] - , [Province] = ap.[Name] - , adr.[Postal] - , p.[ProjectNumbers] - , p.[Name] - , p.[Description] - , p.[Location] - , p.[Boundary] - , p.[IsSensitive] - , p.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , p.[PID] - , p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [ParcelId] = p.[Id] - , [BuildingConstructionTypeId] = 0 - , [BuildingConstructionType] = null - , [BuildingFloorCount] = 0 - , [BuildingPredominateUseId] = 0 - , [BuildingPredominateUse] = null - , [BuildingOccupantTypeId] = 0 - , [BuildingOccupantType] = null - , [BuildingTenancy] = null - , [RentableArea] = 0 - , [LeaseExpiry] = null - , [OccupantName] = null - , [TransferLeaseOnSale] = CAST(0 AS BIT) - - , [AssessedLand] = eas.[Value] - , [AssessedLandDate] = eas.[Date] - , [AssessedBuilding] = eim.[Value] - , [AssessedBuildingDate] = eim.[Date] - , [Market] = ISNULL(fe.[Value], 0) - , [MarketFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] -FROM dbo.[Parcels] p -LEFT JOIN (SELECT DISTINCT SubdivisionId FROM dbo.[ParcelParcels]) sp ON p.[Id] = sp.[SubdivisionId] -JOIN dbo.[PropertyClassifications] c ON p.[ClassificationId] = c.[Id] -JOIN dbo.[Agencies] a ON p.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON p.[AddressId] = adr.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- Assessed Land - ORDER BY [Date] DESC -) AS eas -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 2 -- Assessed Building - ORDER BY [Date] DESC -) AS eim -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 1 -- Market - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn -UNION ALL -SELECT - b.[Id] - , b.[RowVersion] - , b.[PropertyTypeId] - , b.[ClassificationId] - , [Classification] = c.[Name] - , b.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , b.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [AdministrativeArea] = adr.[AdministrativeArea] - , [Province] = ap.[Name] - , adr.[Postal] - , b.[ProjectNumbers] - , b.[Name] - , b.[Description] - , b.[Location] - , b.[Boundary] - , b.[IsSensitive] - , b.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , [PID] = p.[PID] - , [PIN] = p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [ParcelId] = p.[Id] - , [BuildingConstructionTypeId] = b.[BuildingConstructionTypeId] - , [BuildingConstructionType] = bct.[Name] - , [BuildingFloorCount] = b.[BuildingFloorCount] - , [BuildingPredominateUseId] = b.[BuildingPredominateUseId] - , [BuildingPredominateUse] = bpu.[Name] - , [BuildingOccupantTypeId] = b.[BuildingOccupantTypeId] - , [BuildingOccupantType] = bot.[Name] - , [BuildingTenancy] = b.[BuildingTenancy] - , [RentableArea] = b.[RentableArea] - , [LeaseExpiry] = b.[LeaseExpiry] - , [OccupantName] = b.[OccupantName] - , [TransferLeaseOnSale] = b.[TransferLeaseOnSale] - - , [AssessedLand] = null - , [AssessedLandDate] = null - , [AssessedBuilding] = eim.[Value] - , [AssessedBuildingDate] = eim.[Date] - , [Market] = ISNULL(fe.[Value], 0) - , [MarketFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] -FROM dbo.[Buildings] b -LEFT JOIN dbo.[ParcelBuildings] pb ON b.[Id] = pb.[BuildingId] -LEFT JOIN dbo.[Parcels] p ON pb.[ParcelId] = p.[Id] -JOIN dbo.[PropertyClassifications] c ON b.[ClassificationId] = c.[Id] -JOIN dbo.[Agencies] a ON b.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON b.[AddressId] = adr.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -JOIN dbo.[BuildingConstructionTypes] bct ON b.[BuildingConstructionTypeId] = bct.[Id] -JOIN dbo.[BuildingOccupantTypes] bot ON b.[BuildingOccupantTypeId] = bot.[Id] -JOIN dbo.[BuildingPredominateUses] bpu ON b.[BuildingPredominateUseId] = bpu.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[BuildingEvaluations] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- Assessed - ORDER BY [Date] DESC -) AS eim -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 1 -- Market - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn diff --git a/backend/dal/Migrations/v01.08.00/Up/Postup/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.08.00/Up/Postup/01-NotificationTemplates.sql deleted file mode 100644 index 5e743679b3..0000000000 --- a/backend/dal/Migrations/v01.08.00/Up/Postup/01-NotificationTemplates.sql +++ /dev/null @@ -1,76 +0,0 @@ -PRINT 'Updating Notification Templates...' - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@{ - var projectLink = $"{Model.Environment.Uri}projects?projectNumber={Model.Project.ProjectNumber}"; -} - -@Model.Environment.Title -

Good afternoon,

-

This email is to advise that the following properties have been submitted to the Surplus Property Program to be reviewed as surplus by the current holder of the property and is requesting your review:

-

Property Inventory Management System - @Model.Project.ProjectNumber

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - var year = appraised != null ? appraised.Date.Year : assessed.Date.Year; - var value = appraised != null ? appraised.Value : assessed.Value; - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 1; diff --git a/backend/dal/Migrations/v01.08.00/Up/Postup/01-ProjectStatus.sql b/backend/dal/Migrations/v01.08.00/Up/Postup/01-ProjectStatus.sql deleted file mode 100644 index ba61a9d1d8..0000000000 --- a/backend/dal/Migrations/v01.08.00/Up/Postup/01-ProjectStatus.sql +++ /dev/null @@ -1,5 +0,0 @@ -PRINT 'Update ProjectStatus' - -UPDATE dbo.[ProjectStatus] -SET [Description] = 'The project has been transferred within the Greater Reporting Entity' -WHERE [Id] = 20 diff --git a/backend/dal/Migrations/v01.08.00/Up/Postup/01-ProjectStatusTransitions.sql b/backend/dal/Migrations/v01.08.00/Up/Postup/01-ProjectStatusTransitions.sql deleted file mode 100644 index 8e2d508fff..0000000000 --- a/backend/dal/Migrations/v01.08.00/Up/Postup/01-ProjectStatusTransitions.sql +++ /dev/null @@ -1,38 +0,0 @@ -PRINT 'Adding ProjectStatusTransitions' - -INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [Action] - , [ToWorkflowId] - , [ToStatusId] - , [ValidateTasks] -) VALUES --- Allow progression from Not in SPL to Disposed -( - 5 -- ERP - , 22 -- Not in SPL - , 'Dispose Project' - , 5 -- ERP - , 32 -- Disposed - , 0 -), --- Allow progression from Not in SPL to Transfer within GRE -( - 5 -- ERP - , 22 -- Not in SPL - , 'Transfer within GRE' - , 5 -- ERP - , 20 -- Transferred within GRE - , 0 -), --- Allow progression from Not in SPL to Transfer within GRE -( - 4 -- 'ASSESS-EX-DISPOSAL' - , 22 -- Not in SPL - , 'Transfer within GRE' - , 5 -- ERP - , 20 -- Transferred within GRE - , 0 -) - diff --git a/backend/dal/Migrations/v01.08.00/Up/Postup/01-Tasks.sql b/backend/dal/Migrations/v01.08.00/Up/Postup/01-Tasks.sql deleted file mode 100644 index 3914987e5b..0000000000 --- a/backend/dal/Migrations/v01.08.00/Up/Postup/01-Tasks.sql +++ /dev/null @@ -1,6 +0,0 @@ -PRINT 'Update Tasks' - -UPDATE dbo.[Tasks] -SET - [Description] = 'Triple Bottom Line document emailed to SRES; or Project is in Tier 1.' -WHERE [Id] = 2 diff --git a/backend/dal/Migrations/v01.08.00/Up/Postup/01-ViewProperties.sql b/backend/dal/Migrations/v01.08.00/Up/Postup/01-ViewProperties.sql deleted file mode 100644 index 8ec4c035df..0000000000 --- a/backend/dal/Migrations/v01.08.00/Up/Postup/01-ViewProperties.sql +++ /dev/null @@ -1,213 +0,0 @@ -PRINT 'Updating View_Properties - Show all properties' -GO --- This script provides a way to union both parcels and buildings into a single result of properties. --- Updating view to support many-to-many parcels and buildings.TEMPORARY -CREATE OR ALTER VIEW dbo.[View_Properties] AS -SELECT - p.[Id] - , p.[RowVersion] - , p.[PropertyTypeId] - , p.[ClassificationId] - , [Classification] = c.[Name] - , p.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , p.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [AdministrativeArea] = adr.[AdministrativeArea] - , [Province] = ap.[Name] - , adr.[Postal] - , p.[ProjectNumbers] - , p.[Name] - , p.[Description] - , p.[Location] - , p.[Boundary] - , p.[IsSensitive] - , p.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , p.[PID] - , p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [ParcelId] = p.[Id] - , [BuildingConstructionTypeId] = 0 - , [BuildingConstructionType] = null - , [BuildingFloorCount] = 0 - , [BuildingPredominateUseId] = 0 - , [BuildingPredominateUse] = null - , [BuildingOccupantTypeId] = 0 - , [BuildingOccupantType] = null - , [BuildingTenancy] = null - , [RentableArea] = 0 - , [LeaseExpiry] = null - , [OccupantName] = null - , [TransferLeaseOnSale] = CAST(0 AS BIT) - - , [AssessedLand] = eas.[Value] - , [AssessedLandDate] = eas.[Date] - , [AssessedBuilding] = eim.[Value] - , [AssessedBuildingDate] = eim.[Date] - , [Market] = ISNULL(fe.[Value], 0) - , [MarketFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] -FROM dbo.[Parcels] p -LEFT JOIN (SELECT DISTINCT SubdivisionId FROM dbo.[ParcelParcels]) sp ON p.[Id] = sp.[SubdivisionId] -JOIN dbo.[PropertyClassifications] c ON p.[ClassificationId] = c.[Id] -LEFT JOIN dbo.[Agencies] a ON p.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON p.[AddressId] = adr.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- Assessed Land - ORDER BY [Date] DESC -) AS eas -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 2 -- Assessed Building - ORDER BY [Date] DESC -) AS eim -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 1 -- Market - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn -UNION ALL -SELECT - b.[Id] - , b.[RowVersion] - , b.[PropertyTypeId] - , b.[ClassificationId] - , [Classification] = c.[Name] - , b.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , b.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [AdministrativeArea] = adr.[AdministrativeArea] - , [Province] = ap.[Name] - , adr.[Postal] - , b.[ProjectNumbers] - , b.[Name] - , b.[Description] - , b.[Location] - , b.[Boundary] - , b.[IsSensitive] - , b.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , [PID] = p.[PID] - , [PIN] = p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [ParcelId] = p.[Id] - , [BuildingConstructionTypeId] = b.[BuildingConstructionTypeId] - , [BuildingConstructionType] = bct.[Name] - , [BuildingFloorCount] = b.[BuildingFloorCount] - , [BuildingPredominateUseId] = b.[BuildingPredominateUseId] - , [BuildingPredominateUse] = bpu.[Name] - , [BuildingOccupantTypeId] = b.[BuildingOccupantTypeId] - , [BuildingOccupantType] = bot.[Name] - , [BuildingTenancy] = b.[BuildingTenancy] - , [RentableArea] = b.[RentableArea] - , [LeaseExpiry] = b.[LeaseExpiry] - , [OccupantName] = b.[OccupantName] - , [TransferLeaseOnSale] = b.[TransferLeaseOnSale] - - , [AssessedLand] = null - , [AssessedLandDate] = null - , [AssessedBuilding] = eim.[Value] - , [AssessedBuildingDate] = eim.[Date] - , [Market] = ISNULL(fe.[Value], 0) - , [MarketFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] -FROM dbo.[Buildings] b -LEFT JOIN dbo.[ParcelBuildings] pb ON b.[Id] = pb.[BuildingId] -LEFT JOIN dbo.[Parcels] p ON pb.[ParcelId] = p.[Id] -JOIN dbo.[PropertyClassifications] c ON b.[ClassificationId] = c.[Id] -LEFT JOIN dbo.[Agencies] a ON b.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON b.[AddressId] = adr.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -JOIN dbo.[BuildingConstructionTypes] bct ON b.[BuildingConstructionTypeId] = bct.[Id] -JOIN dbo.[BuildingOccupantTypes] bot ON b.[BuildingOccupantTypeId] = bot.[Id] -JOIN dbo.[BuildingPredominateUses] bpu ON b.[BuildingPredominateUseId] = bpu.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[BuildingEvaluations] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- Assessed - ORDER BY [Date] DESC -) AS eim -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 1 -- Market - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn diff --git a/backend/dal/Migrations/v01.08.00/Up/PreUp/01-Buildings.sql b/backend/dal/Migrations/v01.08.00/Up/PreUp/01-Buildings.sql deleted file mode 100644 index e7fa149711..0000000000 --- a/backend/dal/Migrations/v01.08.00/Up/PreUp/01-Buildings.sql +++ /dev/null @@ -1,423 +0,0 @@ -PRINT 'Transfer Capital Management Branch Buildings to School Districts' - -DECLARE @CMBId INT = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'CMB') - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 05') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Southeast Kootenay', 'Cranbrook', 'Fernie', 'Elkford', 'Sparwood', 'Hosmer', 'Corbin', 'Fort Steele', 'Elko', 'Jaffray', 'Rooseville', 'Newgate', 'Flathead', 'Grasmere', 'Baker', 'Wardner', 'Bull River', 'Moyie', 'Wycliffe') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 06') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Rocky Mountain', 'Invermere', 'Kimberley', 'Radium Hit Springs', 'Golden', 'Field', 'Marysville') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 08') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Kootenay Lake', 'Creston', 'Salmo', 'Nelson', 'Kaslo', 'Slocan', 'Kootenay', 'Duncan Lake', 'Winlaw', 'Taghum', 'Queens Bay', 'Procter', 'Hot Springs', 'Riondel Ainsworth', 'Argenta', 'Gerrard', 'Howser', 'Kitchener', 'Yahk', 'Erickson', 'Kingsgate', 'Rykerts', 'Nelway') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 10') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Arrow Lakes', 'Edgewood', 'Burton', 'Shoreholme', 'Silverton', 'New Denver', 'Nakusp', 'Fauquier') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 19') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Revelstoke', 'Beaton', 'Mica Creek') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 20') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Castlegar', 'Rossland', 'Trail', 'Montrose', 'Warfield', 'Fruitvale', 'Renata', 'Robson', 'Glade') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 22') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Vernon', 'Lumby', 'Coldstream', 'Mabel Lake', 'Cherryville', 'Oyama') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 23') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Central Okanagan', 'Kelowna', 'Peachland', 'Lake Country', 'Westbank', 'West Kelowna') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 27') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('150 Mile House', 'Riske Creek', 'Bridge Lake', 'Mcleese Lake', 'Likely', 'Ulkatcho', 'Anahim Lake', 'Towdystan', 'Kleena Kleene', 'Tatla Lake', 'Redstone', 'Alexis Creek', 'Williams Lake', '100 Mile House', 'Horsefly', 'Quesnel Lake', 'Canim Lake', 'Mahood Lake') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 28') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Quesnel', 'Nazko', 'Wells') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 33') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Chilliwack', 'Rosedale', 'Cultus Lake', 'Sardis') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 34') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Abbotsford') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 35') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Langley', 'Langley City', 'Aldergrove') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 36') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Surrey', 'White Rock') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 37') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Delta', 'Tsawwassen') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 38') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Richmond') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 39') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Vancouver') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 40') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('New Westminster', 'Garibaldi Highlands') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 41') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Burnaby') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 42') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Maple Ridge', 'Pitt Meadows', 'Alvin') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 43') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Coquitlam', 'Port Coquitlam', 'Anmore', 'Belcarra', 'Port Moody') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 44') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('North Vancouver', 'Vancouver City') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 45') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('West Vancouver', 'Lions Bay', 'Bowen Island') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 46') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Sunshine Coast', 'Sechelt', 'Gibsons', 'Egmont', 'Madeira Park', 'Selma Park', 'Roberts Creek', 'Lasqueti Island', 'Texada Island') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 47') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Powell River', 'Lang Bay', 'Saltery Bay', 'Lund', 'Blubber Bay', 'Gillies Bay', 'Cortes Island') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 48') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Sea to Sky', 'Pemberton', 'Whistler', 'Birken', 'Mount Currie', 'Garibaldi', 'Brackendale', 'Squamish', 'Britannia Beach') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 49') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Central Coast', 'Bella Bella', 'Ocean Falls', 'Bella Coola', 'Hagensborg', 'Namu', 'Rivers Inlet', 'Dawsons Landing', 'Goose Bay') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 50') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Haida Gwaii', 'Masset', 'Skidegate', 'Sandspit', 'Queen Charlotte', 'Tamu', 'Queen Charlotte City', 'Juskatla', 'Skidegate Landing', 'Tlell', 'Port Clements') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 51') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Boundary', 'Beaverdell', 'Rock Creek', 'Westbridge', 'Bridesville', 'Kettle Valley', 'Greenwood', 'Midway', 'Grand Forks', 'Christina Lake') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 52') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Prince Rupert', 'Georgetown Mills', 'Port Edward', 'Metlakatla', 'Kitkatla', 'Port Essington', 'Hartley Bay') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 53') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Okanagan Similkameen', 'Hedley', 'Keremeos', 'Oliver', 'Osoyoos', 'Cawston') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 54') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Houston', 'Smithers', 'Telkwa', 'Glentanna') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 57') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Hixon', 'Mackenzie', 'McLeod Lake', 'Summit Lake', 'Reid Lake', 'Prince George', 'Beaverley', 'Baldy Hughes', 'Willow River', 'Longworth', 'Penny', 'Dome Creek', 'McBride', 'Dunster', 'Valemount', 'Albreda', 'Cedarside', 'Tete Jaune Cache') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 58') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Nicola-Similkameen', 'Princeton', 'Merritt', 'Quilchena', 'Aspen Grove', 'Bankeir', 'Coalmont', 'Manning Park', 'Lower Nicola') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 59') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Peace River South', 'Chetwynd', 'Dawson Creek', 'Pine Valley', 'Tumbler Ridge', 'Kelly Lake', 'Tomslake', 'Pouce Coupe', 'Doe River', 'Rolla', 'Arras', 'East Pine', 'Lone Prairie', 'Moberly Lake') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 60') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Peace River North', 'Fort St. John', 'Taylor', 'Clayhurst', 'Goodlow', 'Doig River', 'Rose Prairie', 'Buick', 'Wonowon', 'Trutch', 'Pink Mountain', 'Upper Halfway', 'Hudson''s Hope', 'Ware', 'Ingenika Mine') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 61') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Greater Victoria', 'Victoria', 'Saanich', 'View Royal', 'Oak Bay', 'Esquimalt') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 62') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Sooke', 'Metchosin', 'Colwood', 'Langford', 'Highlands', 'Jordan River', 'Port Renfrew') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 63') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Sidney', 'North Saanich', 'Central Saanich', 'Saanichton') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 64') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Gulf Islands', 'Saltspring Island', 'Prevost Island', 'Galiano Island', 'Mayne Island', 'Pender Islands', 'Pender Island', 'Saturna Island', 'Ganges', 'Kincolith') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 67') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Okanagan Skaha', 'Summerland', 'Penticton', 'Naramata', 'Kaleden', 'Okanagan Falls') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 68') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Nanaimo-Ladysmith', 'Nanaimo', 'Ladysmith', 'Cedar', 'Wellington', 'Lantzville', 'Gabriola Island', 'Cassidy') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 69') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Qualicum', 'Qualicum Beach', 'French Creek', 'Parksville', 'Nanoose Bay', 'Errington', 'Qualicum Bay') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 70') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Pacific Rim', 'Ahousaht', 'Hesquiat', 'Hot Springs Cove', 'Clayoquot', 'Tofino', 'Port Albion', 'Ucluelet', 'Sproat Lake', 'Port Alberni', 'Nahmint', 'Bamfield') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 71') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Comox Valley', 'Comox', 'Black Creek', 'Grantham', 'Courtenay', 'Cumberland', 'Fanny Bay', 'Hornby Island', 'Denman Island') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 72') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Campbell River', 'Sayward', 'Quathiaski Cove', 'Read Island', 'Quadra Island') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 73') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Kamloops-Thompson', 'Thompson', 'Blue River', 'Stillwater', 'Avola', 'Vavenby', 'Clearwater', 'Little Fort', 'Darfield', 'Barriere', 'McLure', 'Adams Lake', 'Chase', 'Pritchard', 'Monte Lake', 'Kamloops', 'Savona', 'Lac Le Jeune', 'Logan Lake') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 74') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Gold Trail', 'Bib Bar Creek', 'Clinton', 'Pavilion', 'Ogden', 'Shalalth', 'Lillooet', 'Cahce Creek', 'Ashcroft', 'Boston Flats', 'Spences Bridge', 'Lytton', 'Agate', 'Kanaka Bar', 'Goldbridge') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 75') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Mission', 'Deroche', 'Lake Errock') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 78') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Fraser-Cascade', 'Cache Creek', 'Kent', 'Agassiz', 'Harrison Hot Springs', 'Skookumchuck', 'Boston Bar', 'Yale', 'Hope') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 79') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Cowichan Valley', 'Gordon River', 'Lake Cowichan', 'Cowichan Lake', 'Youbou', 'Cowichan Bay', 'Chemainus', 'Mill Bay', 'Duncan', 'North Cowichan', 'Thetis Island', 'Shawnigan Lake', 'Cobble Hill') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 81') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Fort Nelson', 'Toad River', 'Liard River', 'Muncho Lake', 'Snake River', 'Prophet River', 'Fontas') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 82') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Coast Mountains', 'Terrace', 'Stikine', 'Stewart', 'Alice Arm', 'Cranberry Junction', 'Gitanyow', 'Kispiox', 'Hazelton', 'New Hazelton', 'Rosswood', 'Lakelse Lake', 'Kitimat', 'Nechako', 'Kitamaat Village', 'Kildala Arm', 'Kemano', 'Kemano Beach', 'Butedale', 'Klemtu') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 83') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('North Okanagan-Shuswap', 'Albas', 'St. Ives', 'Saint Ives', 'Sicamous', 'Tappen', 'Canoe', 'Grindrod', 'Enderby', 'Salmon Arm', 'Spallumcheen', 'Armstrong', 'Falkland', 'Scotch Creek') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 84') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Vancouver Island West', 'Gold River', 'Tahsis', 'Zeballos', 'Kyuquot', 'Esperanza') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 85') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Vancouver Island North', 'Holberg', 'Quatsino', 'Coal Harbour', 'Port Hardy', 'Sointula', 'Alert Bay', 'Port McNeill', 'Port Alice', 'Telegraph Cove', 'Nimpkish', 'Woss', 'Kingcome Inlet', 'Minstrel Island', 'Sullivan Bay') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 87') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Stikine', 'Dease Lake', 'Atlin', 'Cassiar', 'Tulsequash', 'Telegraph Creek', 'Boulder City', 'Lower Post', 'Kinaskan Lake', 'Cry Lake') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 91') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Francois Lake', 'Nechako Lakes', 'Bear Lake', 'Tchentlo Lakes', 'Takla Lake', 'Fort Babine', 'Smithers Landing', 'Granisle', 'Topley Landing', 'Babine Lake', 'Topley', 'Chuchi Lake', 'Trembleur Lake', 'Grand Rapids', 'Tachie', 'Pinchi', 'Fort St. James', 'Dog Creek', 'Donald Landing', 'Decker Lake', 'Bulkley Lake', 'Burns Lake', 'Fraser Lake', 'Fort Fraser', 'Vanderhoof', 'Fancois Lake', 'Grassy Plains', 'Tahtsa Lake', 'Whitesail Reach', 'Ootsa Lake', 'Whitesail Lake', 'Eutsuk Lake', 'Cheslatta Lake', 'Newstubb Lake', 'Natalkuz Lake') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 92') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Nisga''a', 'Kitwanga', 'Nass Camp', 'New Aiyansh', 'Laxgalts''ap') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 93') -FROM dbo.[Buildings] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Conseil scolaire francophone') - AND p.[AgencyId] = @CMBId diff --git a/backend/dal/Migrations/v01.08.00/Up/PreUp/01-Parcels.sql b/backend/dal/Migrations/v01.08.00/Up/PreUp/01-Parcels.sql deleted file mode 100644 index 6856d9dbe3..0000000000 --- a/backend/dal/Migrations/v01.08.00/Up/PreUp/01-Parcels.sql +++ /dev/null @@ -1,423 +0,0 @@ -PRINT 'Transfer Capital Management Branch Parcels to School Districts' - -DECLARE @CMBId INT = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'CMB') - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 05') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Southeast Kootenay', 'Cranbrook', 'Fernie', 'Elkford', 'Sparwood', 'Hosmer', 'Corbin', 'Fort Steele', 'Elko', 'Jaffray', 'Rooseville', 'Newgate', 'Flathead', 'Grasmere', 'Baker', 'Wardner', 'Bull River', 'Moyie', 'Wycliffe') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 06') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Rocky Mountain', 'Invermere', 'Kimberley', 'Radium Hit Springs', 'Golden', 'Field', 'Marysville') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 08') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Kootenay Lake', 'Creston', 'Salmo', 'Nelson', 'Kaslo', 'Slocan', 'Kootenay', 'Duncan Lake', 'Winlaw', 'Taghum', 'Queens Bay', 'Procter', 'Hot Springs', 'Riondel Ainsworth', 'Argenta', 'Gerrard', 'Howser', 'Kitchener', 'Yahk', 'Erickson', 'Kingsgate', 'Rykerts', 'Nelway') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 10') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Arrow Lakes', 'Edgewood', 'Burton', 'Shoreholme', 'Silverton', 'New Denver', 'Nakusp', 'Fauquier') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 19') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Revelstoke', 'Beaton', 'Mica Creek') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 20') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Castlegar', 'Rossland', 'Trail', 'Montrose', 'Warfield', 'Fruitvale', 'Renata', 'Robson', 'Glade') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 22') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Vernon', 'Lumby', 'Coldstream', 'Mabel Lake', 'Cherryville', 'Oyama') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 23') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Central Okanagan', 'Kelowna', 'Peachland', 'Lake Country', 'Westbank', 'West Kelowna') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 27') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('150 Mile House', 'Riske Creek', 'Bridge Lake', 'Mcleese Lake', 'Likely', 'Ulkatcho', 'Anahim Lake', 'Towdystan', 'Kleena Kleene', 'Tatla Lake', 'Redstone', 'Alexis Creek', 'Williams Lake', '100 Mile House', 'Horsefly', 'Quesnel Lake', 'Canim Lake', 'Mahood Lake') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 28') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Quesnel', 'Nazko', 'Wells') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 33') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Chilliwack', 'Rosedale', 'Cultus Lake', 'Sardis') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 34') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Abbotsford') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 35') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Langley', 'Langley City', 'Aldergrove') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 36') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Surrey', 'White Rock') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 37') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Delta', 'Tsawwassen') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 38') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Richmond') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 39') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Vancouver') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 40') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('New Westminster', 'Garibaldi Highlands') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 41') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Burnaby') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 42') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Maple Ridge', 'Pitt Meadows', 'Alvin') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 43') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Coquitlam', 'Port Coquitlam', 'Anmore', 'Belcarra', 'Port Moody') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 44') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('North Vancouver', 'Vancouver City') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 45') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('West Vancouver', 'Lions Bay', 'Bowen Island') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 46') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Sunshine Coast', 'Sechelt', 'Gibsons', 'Egmont', 'Madeira Park', 'Selma Park', 'Roberts Creek', 'Lasqueti Island', 'Texada Island') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 47') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Powell River', 'Lang Bay', 'Saltery Bay', 'Lund', 'Blubber Bay', 'Gillies Bay', 'Cortes Island') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 48') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Sea to Sky', 'Pemberton', 'Whistler', 'Birken', 'Mount Currie', 'Garibaldi', 'Brackendale', 'Squamish', 'Britannia Beach') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 49') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Central Coast', 'Bella Bella', 'Ocean Falls', 'Bella Coola', 'Hagensborg', 'Namu', 'Rivers Inlet', 'Dawsons Landing', 'Goose Bay') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 50') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Haida Gwaii', 'Masset', 'Skidegate', 'Sandspit', 'Queen Charlotte', 'Tamu', 'Queen Charlotte City', 'Juskatla', 'Skidegate Landing', 'Tlell', 'Port Clements') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 51') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Boundary', 'Beaverdell', 'Rock Creek', 'Westbridge', 'Bridesville', 'Kettle Valley', 'Greenwood', 'Midway', 'Grand Forks', 'Christina Lake') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 52') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Prince Rupert', 'Georgetown Mills', 'Port Edward', 'Metlakatla', 'Kitkatla', 'Port Essington', 'Hartley Bay') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 53') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Okanagan Similkameen', 'Hedley', 'Keremeos', 'Oliver', 'Osoyoos', 'Cawston') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 54') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Houston', 'Smithers', 'Telkwa', 'Glentanna') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 57') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Hixon', 'Mackenzie', 'McLeod Lake', 'Summit Lake', 'Reid Lake', 'Prince George', 'Beaverley', 'Baldy Hughes', 'Willow River', 'Longworth', 'Penny', 'Dome Creek', 'McBride', 'Dunster', 'Valemount', 'Albreda', 'Cedarside', 'Tete Jaune Cache') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 58') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Nicola-Similkameen', 'Princeton', 'Merritt', 'Quilchena', 'Aspen Grove', 'Bankeir', 'Coalmont', 'Manning Park', 'Lower Nicola') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 59') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Peace River South', 'Chetwynd', 'Dawson Creek', 'Pine Valley', 'Tumbler Ridge', 'Kelly Lake', 'Tomslake', 'Pouce Coupe', 'Doe River', 'Rolla', 'Arras', 'East Pine', 'Lone Prairie', 'Moberly Lake') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 60') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Peace River North', 'Fort St. John', 'Taylor', 'Clayhurst', 'Goodlow', 'Doig River', 'Rose Prairie', 'Buick', 'Wonowon', 'Trutch', 'Pink Mountain', 'Upper Halfway', 'Hudson''s Hope', 'Ware', 'Ingenika Mine') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 61') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Greater Victoria', 'Victoria', 'Saanich', 'View Royal', 'Oak Bay', 'Esquimalt') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 62') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Sooke', 'Metchosin', 'Colwood', 'Langford', 'Highlands', 'Jordan River', 'Port Renfrew') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 63') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Sidney', 'North Saanich', 'Central Saanich', 'Saanichton') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 64') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Gulf Islands', 'Saltspring Island', 'Prevost Island', 'Galiano Island', 'Mayne Island', 'Pender Islands', 'Pender Island', 'Saturna Island', 'Ganges', 'Kincolith') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 67') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Okanagan Skaha', 'Summerland', 'Penticton', 'Naramata', 'Kaleden', 'Okanagan Falls') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 68') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Nanaimo-Ladysmith', 'Nanaimo', 'Ladysmith', 'Cedar', 'Wellington', 'Lantzville', 'Gabriola Island', 'Cassidy') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 69') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Qualicum', 'Qualicum Beach', 'French Creek', 'Parksville', 'Nanoose Bay', 'Errington', 'Qualicum Bay') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 70') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Pacific Rim', 'Ahousaht', 'Hesquiat', 'Hot Springs Cove', 'Clayoquot', 'Tofino', 'Port Albion', 'Ucluelet', 'Sproat Lake', 'Port Alberni', 'Nahmint', 'Bamfield') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 71') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Comox Valley', 'Comox', 'Black Creek', 'Grantham', 'Courtenay', 'Cumberland', 'Fanny Bay', 'Hornby Island', 'Denman Island') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 72') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Campbell River', 'Sayward', 'Quathiaski Cove', 'Read Island', 'Quadra Island') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 73') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Kamloops-Thompson', 'Thompson', 'Blue River', 'Stillwater', 'Avola', 'Vavenby', 'Clearwater', 'Little Fort', 'Darfield', 'Barriere', 'McLure', 'Adams Lake', 'Chase', 'Pritchard', 'Monte Lake', 'Kamloops', 'Savona', 'Lac Le Jeune', 'Logan Lake') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 74') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Gold Trail', 'Bib Bar Creek', 'Clinton', 'Pavilion', 'Ogden', 'Shalalth', 'Lillooet', 'Cahce Creek', 'Ashcroft', 'Boston Flats', 'Spences Bridge', 'Lytton', 'Agate', 'Kanaka Bar', 'Goldbridge') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 75') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Mission', 'Deroche', 'Lake Errock') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 78') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Fraser-Cascade', 'Cache Creek', 'Kent', 'Agassiz', 'Harrison Hot Springs', 'Skookumchuck', 'Boston Bar', 'Yale', 'Hope') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 79') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Cowichan Valley', 'Gordon River', 'Lake Cowichan', 'Cowichan Lake', 'Youbou', 'Cowichan Bay', 'Chemainus', 'Mill Bay', 'Duncan', 'North Cowichan', 'Thetis Island', 'Shawnigan Lake', 'Cobble Hill') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 81') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Fort Nelson', 'Toad River', 'Liard River', 'Muncho Lake', 'Snake River', 'Prophet River', 'Fontas') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 82') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Coast Mountains', 'Terrace', 'Stikine', 'Stewart', 'Alice Arm', 'Cranberry Junction', 'Gitanyow', 'Kispiox', 'Hazelton', 'New Hazelton', 'Rosswood', 'Lakelse Lake', 'Kitimat', 'Nechako', 'Kitamaat Village', 'Kildala Arm', 'Kemano', 'Kemano Beach', 'Butedale', 'Klemtu') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 83') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('North Okanagan-Shuswap', 'Albas', 'St. Ives', 'Saint Ives', 'Sicamous', 'Tappen', 'Canoe', 'Grindrod', 'Enderby', 'Salmon Arm', 'Spallumcheen', 'Armstrong', 'Falkland', 'Scotch Creek') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 84') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Vancouver Island West', 'Gold River', 'Tahsis', 'Zeballos', 'Kyuquot', 'Esperanza') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 85') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Vancouver Island North', 'Holberg', 'Quatsino', 'Coal Harbour', 'Port Hardy', 'Sointula', 'Alert Bay', 'Port McNeill', 'Port Alice', 'Telegraph Cove', 'Nimpkish', 'Woss', 'Kingcome Inlet', 'Minstrel Island', 'Sullivan Bay') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 87') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Stikine', 'Dease Lake', 'Atlin', 'Cassiar', 'Tulsequash', 'Telegraph Creek', 'Boulder City', 'Lower Post', 'Kinaskan Lake', 'Cry Lake') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 91') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Francois Lake', 'Nechako Lakes', 'Bear Lake', 'Tchentlo Lakes', 'Takla Lake', 'Fort Babine', 'Smithers Landing', 'Granisle', 'Topley Landing', 'Babine Lake', 'Topley', 'Chuchi Lake', 'Trembleur Lake', 'Grand Rapids', 'Tachie', 'Pinchi', 'Fort St. James', 'Dog Creek', 'Donald Landing', 'Decker Lake', 'Bulkley Lake', 'Burns Lake', 'Fraser Lake', 'Fort Fraser', 'Vanderhoof', 'Fancois Lake', 'Grassy Plains', 'Tahtsa Lake', 'Whitesail Reach', 'Ootsa Lake', 'Whitesail Lake', 'Eutsuk Lake', 'Cheslatta Lake', 'Newstubb Lake', 'Natalkuz Lake') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 92') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Nisga''a', 'Kitwanga', 'Nass Camp', 'New Aiyansh', 'Laxgalts''ap') - AND p.[AgencyId] = @CMBId - -UPDATE p - SET p.[AgencyId] = (SELECT [Id] FROM dbo.[Agencies] WHERE [Code] = 'SD 93') -FROM dbo.[Parcels] p -JOIN dbo.[Addresses] a ON p.AddressId = a.Id -WHERE a.[AdministrativeArea] IN ('Conseil scolaire francophone') - AND p.[AgencyId] = @CMBId diff --git a/backend/dal/Migrations/v01.08.00/Up/PreUp/02-Buildings.sql b/backend/dal/Migrations/v01.08.00/Up/PreUp/02-Buildings.sql deleted file mode 100644 index f4d591aaba..0000000000 --- a/backend/dal/Migrations/v01.08.00/Up/PreUp/02-Buildings.sql +++ /dev/null @@ -1,23 +0,0 @@ -PRINT 'Update Buildings LeasedLandeMetadata' - --- Generate LeasedLandMetadata for buildings with land. -UPDATE b -SET b.[LeasedLandMetadata] = ( - SELECT - _pb.[ParcelId] - , 0 as Type - FROM dbo.[ParcelBuildings] _pb - WHERE b.[Id] = _pb.[BuildingId] - FOR JSON AUTO -) -FROM dbo.[Buildings] b -INNER JOIN dbo.[ParcelBuildings] pb ON b.[Id] = pb.[BuildingId] -WHERE b.[LeasedLandMetadata] IS NULL - --- Generate LeasedLandMetadata for buildings without land -UPDATE b -SET b.[LeasedLandMetadata] = '[]' -FROM dbo.[Buildings] b -LEFT JOIN dbo.[ParcelBuildings] pb ON b.[Id] = pb.[BuildingId] -WHERE b.[LeasedLandMetadata] IS NULL - AND pb.[ParcelId] IS NULL diff --git a/backend/dal/Migrations/v01.08.01/Down/PostDown/01-ProjectStatusTransitions.sql b/backend/dal/Migrations/v01.08.01/Down/PostDown/01-ProjectStatusTransitions.sql deleted file mode 100644 index 3932c37632..0000000000 --- a/backend/dal/Migrations/v01.08.01/Down/PostDown/01-ProjectStatusTransitions.sql +++ /dev/null @@ -1,25 +0,0 @@ -PRINT 'Removing ProjectStatusTransitions' - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 4 -- ASSESS-EX-DISPOSAL - AND [FromStatusId] = 22 -- Not in SPL - AND [ToWorkflowId] = 4 -- ASSESS-EX-DISPOSAL - AND [ToStatusId] = 23 -- Cancelled - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 4 -- ASSESS-EX-DISPOSAL - AND [FromStatusId] = 22 -- Not in SPL - AND [ToWorkflowId] = 4 -- ASSESS-EX-DISPOSAL - AND [ToStatusId] = 20 -- Transferred within GRE - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 4 -- 'ASSESS-EX-DISPOSAL' - AND [FromStatusId] = 22 -- Not in SPL - AND [ToWorkflowId] = 6 -- SPL - AND [ToStatusId] = 21 -- Approved for SPL - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 4 -- 'ASSESS-EX-DISPOSAL' - AND [FromStatusId] = 22 -- Not in SPL - AND [ToWorkflowId] = 5 -- ERP - AND [ToStatusId] = 14 -- Approved for ERP diff --git a/backend/dal/Migrations/v01.08.01/Up/Postup/01-AdministrativeAreas.sql b/backend/dal/Migrations/v01.08.01/Up/Postup/01-AdministrativeAreas.sql deleted file mode 100644 index 8e578e09ef..0000000000 --- a/backend/dal/Migrations/v01.08.01/Up/Postup/01-AdministrativeAreas.sql +++ /dev/null @@ -1,9 +0,0 @@ -PRINT 'Update Saltspring Island to Salt Spring Island' - -UPDATE dbo.[AdministrativeAreas] -SET [Name] = 'Salt Spring Island' -WHERE [Name] = 'Saltspring Island' - -UPDATE dbo.[Addresses] -SET [AdministrativeArea] = 'Salt Spring Island' -WHERE [AdministrativeArea] = 'Saltspring Island' diff --git a/backend/dal/Migrations/v01.08.01/Up/Postup/01-Buildings.sql b/backend/dal/Migrations/v01.08.01/Up/Postup/01-Buildings.sql deleted file mode 100644 index a11f306832..0000000000 --- a/backend/dal/Migrations/v01.08.01/Up/Postup/01-Buildings.sql +++ /dev/null @@ -1,41 +0,0 @@ -PRINT 'Delete UBC Buildings' - -DECLARE @UBCId INT = ( - SELECT [Id] - FROM dbo.[Agencies] - WHERE [Code] = 'UBC' - ) - -IF (@UBCId IS NOT NULL) -BEGIN - DELETE FROM dbo.[ProjectProperties] - WHERE [BuildingId] IN ( - SELECT [Id] - FROM dbo.[Buildings] - WHERE [AgencyId] = @UBCId - ) - - DELETE FROM dbo.[BuildingEvaluations] - WHERE [BuildingId] IN ( - SELECT [Id] - FROM dbo.[Buildings] - WHERE [AgencyId] = @UBCId - ) - - DELETE FROM dbo.[BuildingFiscals] - WHERE [BuildingId] IN ( - SELECT [Id] - FROM dbo.[Buildings] - WHERE [AgencyId] = @UBCId - ) - - DELETE FROM dbo.[ParcelBuildings] - WHERE [BuildingId] IN ( - SELECT [Id] - FROM dbo.[Buildings] - WHERE [AgencyId] = @UBCId - ) - - DELETE FROM dbo.[Buildings] - WHERE [AgencyId] = @UBCId -END diff --git a/backend/dal/Migrations/v01.08.01/Up/Postup/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.08.01/Up/Postup/01-NotificationTemplates.sql deleted file mode 100644 index 6521fea013..0000000000 --- a/backend/dal/Migrations/v01.08.01/Up/Postup/01-NotificationTemplates.sql +++ /dev/null @@ -1,15 +0,0 @@ -PRINT 'Update NotificationTemplates' - --- Add a default if the address to is null. -UPDATE dbo.[NotificationTemplates] -SET [Body] = REPLACE([Body], '

Good afternoon,

', '

@(Model.ToAgency.AddressTo ?? "Good morning / Good afternoon"),

') -WHERE [Id] != 1 - --- Add a default if the address to is null. -UPDATE dbo.[NotificationTemplates] -SET [Body] = REPLACE([Body], '

Dear @Model.ToAgency.AddressTo,

', '

@(Model.ToAgency.AddressTo ?? "Good morning / Good afternoon"),

') - --- Default all emails addressed to. -UPDATE dbo.[Agencies] -SET [AddressTo] = 'Good morning / Good afternoon' - diff --git a/backend/dal/Migrations/v01.08.01/Up/Postup/01-Parcels.sql b/backend/dal/Migrations/v01.08.01/Up/Postup/01-Parcels.sql deleted file mode 100644 index 6a27897102..0000000000 --- a/backend/dal/Migrations/v01.08.01/Up/Postup/01-Parcels.sql +++ /dev/null @@ -1,41 +0,0 @@ -PRINT 'Delete UBC Parcels' - -DECLARE @UBCId INT = ( - SELECT [Id] - FROM dbo.[Agencies] - WHERE [Code] = 'UBC' - ) - -IF (@UBCId IS NOT NULL) -BEGIN - DELETE FROM dbo.[ProjectProperties] - WHERE [ParcelId] IN ( - SELECT [Id] - FROM dbo.[Parcels] - WHERE [AgencyId] = @UBCId - ) - - DELETE FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] IN ( - SELECT [Id] - FROM dbo.[Parcels] - WHERE [AgencyId] = @UBCId - ) - - DELETE FROM dbo.[ParcelFiscals] - WHERE [ParcelId] IN ( - SELECT [Id] - FROM dbo.[Parcels] - WHERE [AgencyId] = @UBCId - ) - - DELETE FROM dbo.[ParcelBuildings] - WHERE [ParcelId] IN ( - SELECT [Id] - FROM dbo.[Parcels] - WHERE [AgencyId] = @UBCId - ) - - DELETE FROM dbo.[Parcels] - WHERE [AgencyId] = @UBCId -END diff --git a/backend/dal/Migrations/v01.08.01/Up/Postup/01-ProjectStatusTransitions.sql b/backend/dal/Migrations/v01.08.01/Up/Postup/01-ProjectStatusTransitions.sql deleted file mode 100644 index 419c13b84b..0000000000 --- a/backend/dal/Migrations/v01.08.01/Up/Postup/01-ProjectStatusTransitions.sql +++ /dev/null @@ -1,47 +0,0 @@ -PRINT 'Adding ProjectStatusTransitions' - -INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [Action] - , [ToWorkflowId] - , [ToStatusId] - , [ValidateTasks] -) VALUES --- Allow progression from Not in SPL to Cancelled -( - 4 -- ASSESS-EX-DISPOSAL - , 22 -- Not in SPL - , 'Cancel Project' - , 4 -- ASSESS-EX-DISPOSAL - , 23 -- Cancelled - , 0 -), --- Allow progression from Not in SPL to Transfer within GRE -( - 4 -- ASSESS-EX-DISPOSAL - , 22 -- Not in SPL - , 'Transfer within GRE' - , 4 -- ASSESS-EX-DISPOSAL - , 20 -- Transferred within GRE - , 0 -), --- Allow progression from Not in SPL to Approved for SPL -( - 4 -- 'ASSESS-EX-DISPOSAL' - , 22 -- Not in SPL - , 'Proceed to SPL' - , 6 -- SPL - , 21 -- Approved for SPL - , 0 -), --- Allow progression from Not in SPL to Approved for ERP -( - 4 -- 'ASSESS-EX-DISPOSAL' - , 22 -- Not in SPL - , 'Proceed to ERP' - , 5 -- ERP - , 14 -- Approved for ERP - , 0 -) - diff --git a/backend/dal/Migrations/v01.09.00/Down/PostDown/01-ProjectStatusTransitions.sql b/backend/dal/Migrations/v01.09.00/Down/PostDown/01-ProjectStatusTransitions.sql deleted file mode 100644 index f2c5ec4f45..0000000000 --- a/backend/dal/Migrations/v01.09.00/Down/PostDown/01-ProjectStatusTransitions.sql +++ /dev/null @@ -1,7 +0,0 @@ -PRINT 'Removing ProjectStatusTransitions' - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 5 -- ERP - AND [FromStatusId] = 14 -- Approved for ERP - AND [ToWorkflowId] = 5 -- ERP - AND [ToStatusId] = 22 -- Not in SPL diff --git a/backend/dal/Migrations/v01.09.00/Down/PostDown/02-RoleClaims.sql b/backend/dal/Migrations/v01.09.00/Down/PostDown/02-RoleClaims.sql deleted file mode 100644 index d37f2e4f0e..0000000000 --- a/backend/dal/Migrations/v01.09.00/Down/PostDown/02-RoleClaims.sql +++ /dev/null @@ -1,18 +0,0 @@ -PRINT 'Add RoleClaims - Property-Delete' - -INSERT INTO dbo.[RoleClaims] - ( - [RoleId] - , [ClaimId] - ) -VALUES - -- real-estate-manager -( - 'aad8c03d-892c-4cc3-b992-5b41c4f2392c' - , '223664c7-650c-40ac-8581-f40e10164537' -- property-delete -), - -- real-estate-assistant -( - '7a7b2549-ae85-4ad6-a8d3-3a5f8d4f9ca5' - , '223664c7-650c-40ac-8581-f40e10164537' -- property-delete -) diff --git a/backend/dal/Migrations/v01.09.00/Up/PostUp/01-Agencies.sql b/backend/dal/Migrations/v01.09.00/Up/PostUp/01-Agencies.sql deleted file mode 100644 index b211e74930..0000000000 --- a/backend/dal/Migrations/v01.09.00/Up/PostUp/01-Agencies.sql +++ /dev/null @@ -1,255 +0,0 @@ -PRINT 'Update Agencies - Ministries' - -MERGE INTO dbo.[Agencies] [Target] -USING ( VALUES -( - 'Advanced Education & Skills Training' - , 'AEST' - , 'AEST' - , '' - , null -- parent Id - , 'kevin.brewster@gov.bc.ca' - , 'Kevin' - , 0 -- disabled - , 1 -- send email -), ( - 'Agriculture, Food and Fisheries' - , 'AGRI' - , 'AGRI' - , '' - , null -- parent Id - , 'wes.boyd@gov.bc.ca' - , 'Wes' - , 0 -- disabled - , 1 -- send email -), ( - 'Attorney General' - , 'AG' - , 'AG' - , '' - , null -- parent Id - , 'tracy.campbell@gov.bc.ca' - , 'Tracy' - , 0 -- disabled - , 1 -- send email -), ( - 'Children & Family Development' - , 'MCF' - , 'MCF' - , '' - , null -- parent Id - , 'rob.byers@gov.bc.ca' - , 'Rob' - , 0 -- disabled - , 1 -- send email -), ( - 'Citizens'' Services' - , 'CITZ' - , 'CITZ' - , '' - , null -- parent Id - , 'dean.skinner@gov.bc.ca' - , 'Dean' - , 0 -- disabled - , 1 -- send email -), ( - 'Education' - , 'EDUC' - , 'EDUC' - , '' - , null -- parent Id - , 'reg.bawa@gov.bc.ca' - , 'Reg' - , 0 -- disabled - , 1 -- send email -), ( - 'Energy, Mines and Low Carbon Innovation' - , 'EMLCI' - , 'EMPR' - , '' - , null -- parent Id - , 'wes.boyd@gov.bc.ca' - , 'Wes' - , 0 -- disabled - , 1 -- send email -), ( - 'Environment & Climate Change Strategy' - , 'ENV' - , 'ENV' - , '' - , null -- parent Id - , 'wes.boyd@gov.bc.ca' - , 'Wes' - , 0 -- disabled - , 1 -- send email -), ( - 'Finance' - , 'FIN' - , 'FIN' - , '' - , null -- parent Id - , 'teri.spaven@gov.bc.ca' - , 'Teri' - , 0 -- disabled - , 1 -- send email -), ( - 'Forests, Lands, Natural Resource Operations & Rural Development' - , 'FLNRD' - , 'FLNRD' - , '' - , null -- parent Id - , 'trish.dohan@gov.bc.ca' - , 'Trish' - , 0 -- disabled - , 1 -- send email -), ( - 'Health' - , 'HLTH' - , 'HLTH' - , '' - , null -- parent Id - , 'philip.twyford@gov.bc.ca' - , 'Philip' - , 0 -- disabled - , 1 -- send email -), ( - 'Indigenous Relations & Reconciliation' - , 'IRR' - , 'IRR' - , '' - , null -- parent Id - , 'wes.boyd@gov.bc.ca' - , 'Wes' - , 0 -- disabled - , 1 -- send email -), ( - 'Jobs, Economic Recovery and Innovation' - , 'JERI' - , 'JERI' - , '' - , null -- parent Id - , 'joanna.white@gov.bc.ca' - , 'Joanna' - , 0 -- disabled - , 1 -- send email -), ( - 'Labour' - , 'LBR' - , 'LBR' - , '' - , null -- parent Id - , 'joanna.white@gov.bc.ca' - , 'Joanna' - , 0 -- disabled - , 1 -- send email -), ( - 'Mental Health & Addictions' - , 'MMHA' - , 'MMHA' - , '' - , null -- parent Id - , 'dara.landry@gov.bc.ca' - , 'Dara' - , 0 -- disabled - , 1 -- send email -), ( - 'Municipal Affairs' - , 'MUNI' - , 'MUNI' - , '' - , null -- parent Id - , 'david.curtis@gov.bc.ca' - , 'David' - , 0 -- disabled - , 1 -- send email -), ( - 'Public Safety & Solicitor General & Emergency B.C.' - , 'PSSGEB' - , 'PSSG' - , '' - , null -- parent Id - , 'tracy.campbell@gov.bc.ca' - , 'Tracy' - , 0 -- disabled - , 1 -- send email -), ( - 'Social Development & Poverty Reduction' - , 'SDPR' - , 'SDPR' - , '' - , null -- parent Id - , 'jonathan.dube@gov.bc.ca' - , 'Jonathan' - , 0 -- disabled - , 1 -- send email -), ( - 'Tourism, Arts, Culture and Sport' - , 'TACS' - , 'TACS' - , '' - , null -- parent Id - , 'joanna.white@gov.bc.ca' - , 'Joanna' - , 0 -- disabled - , 1 -- send email -), ( - 'Transportation & Infrastructure' - , 'TRAN' - , 'TRAN' - , '' - , null -- parent Id - , 'nancy.bain@gov.bc.ca' - , 'Nancy' - , 0 -- disabled - , 1 -- send email -), ( - 'BC Public Service Agency' - , 'BCPSA' - , 'BCPSA' - , '' - , null -- parent Id - , 'bruce.richmond@gov.bc.ca' - , 'Bruce' - , 0 -- disabled - , 1 -- send email -)) AS [Source] ( - [Name] - , [OriginalCode] - , [Code] - , [Description] - , [ParentId] - , [Email] - , [AddressTo] - , [IsDisabled] - , [SendEmail] -) ON [Target].[Code] = [Source].[OriginalCode] -WHEN MATCHED THEN - UPDATE - SET [Target].[Name] = [Source].[Name] - , [Target].[Code] = [Source].[Code] - , [Target].[Description] = [Source].[Description] - , [Target].[ParentId] = [Source].[ParentId] - , [Target].[Email] = [Source].[Email] - , [Target].[AddressTo] = [Source].[AddressTo] - , [Target].[SendEmail] = [Source].[SendEmail] - , [Target].[IsDisabled] = [Source].[IsDisabled] -WHEN NOT MATCHED THEN - INSERT ( - [Name] - , [Code] - , [Description] - , [ParentId] - , [Email] - , [AddressTo] - , [SendEmail] - , [IsDisabled] - ) VALUES ( - [Source].[Name] - , [Source].[Code] - , [Source].[Description] - , [Source].[ParentId] - , [Source].[Email] - , [Source].[AddressTo] - , [Source].[SendEmail] - , [Source].[IsDisabled] - ); diff --git a/backend/dal/Migrations/v01.09.00/Up/PostUp/01-BuildingPredominateUses.sql b/backend/dal/Migrations/v01.09.00/Up/PostUp/01-BuildingPredominateUses.sql deleted file mode 100644 index b5d038ca05..0000000000 --- a/backend/dal/Migrations/v01.09.00/Up/PostUp/01-BuildingPredominateUses.sql +++ /dev/null @@ -1,41 +0,0 @@ -PRINT 'Update Building Predominate Uses' - --- Update buildings using wrong predominate use before deleting -UPDATE dbo.[Buildings] -SET [BuildingPredominateUseId] = (SELECT [Id] FROM dbo.[BuildingPredominateUses] WHERE Name = 'Senior Housing (Assisted Living / Skilled Nursing)') -WHERE [BuildingPredominateUseId] = (SELECT [Id] FROM dbo.[BuildingPredominateUses] WHERE Name = 'Senior Housing (Assisted Living/Skilled Nursing)'); - -UPDATE dbo.[Buildings] -SET [BuildingPredominateUseId] = (SELECT [Id] FROM dbo.[BuildingPredominateUses] WHERE Name = 'Training Centre') -WHERE [BuildingPredominateUseId] = (SELECT [Id] FROM dbo.[BuildingPredominateUses] where Name = 'Training Center'); - -UPDATE dbo.[Buildings] -SET [BuildingPredominateUseId] = (SELECT [Id] FROM dbo.[BuildingPredominateUses] WHERE Name = 'Transportation (Airport / Rail / Bus station)') -WHERE [BuildingPredominateUseId] = (SELECT [Id] FROM dbo.[BuildingPredominateUses] WHERE Name = 'Transportation (Airport/Rail/Bus station)'); - --- Update formatting (non-duplicates) -UPDATE dbo.[BuildingPredominateUses] -SET [Name] = 'University / College' -WHERE [Name] = 'University/College' - -UPDATE dbo.[BuildingPredominateUses] -SET [Name] = 'Jail / Prison' -WHERE [Name] = 'Jail/Prison' - -UPDATE dbo.[BuildingPredominateUses] -SET [Name] = 'Community / Recreation Centre' -WHERE [Name] = 'Community/Recreation Centre' - -UPDATE dbo.[BuildingPredominateUses] -SET [Name] = 'Dormitory / Residence Halls' -WHERE [Name] = 'Dormitory/Residence Halls' - --- Delete duplicates after correcting -DELETE FROM dbo.[BuildingPredominateUses] -WHERE [Name] = 'Senior Housing (Assisted Living/Skilled Nursing)' - -DELETE FROM dbo.[BuildingPredominateUses] -WHERE [Name] = 'Training Center' - -DELETE FROM dbo.[BuildingPredominateUses] -WHERE [Name] = 'Transportation (Airport/Rail/Bus station)' diff --git a/backend/dal/Migrations/v01.09.00/Up/PostUp/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.09.00/Up/PostUp/01-NotificationTemplates.sql deleted file mode 100644 index b03947389f..0000000000 --- a/backend/dal/Migrations/v01.09.00/Up/PostUp/01-NotificationTemplates.sql +++ /dev/null @@ -1,10 +0,0 @@ -PRINT 'Update NotificationTemplates' - -UPDATE dbo.[NotificationTemplates] -SET [Body] = REPLACE([Body], '

Dear @Model.Project.Manager,

', '

Dear @(Model.Project.Manager ?? "Property Manager"),

') -WHERE [Id] = 16 - - -UPDATE dbo.[NotificationTemplates] -SET [Body] = REPLACE([Body], '

Good afternoon,

', '

Good morning / Good afternoon,

') -WHERE [Id] = 1 diff --git a/backend/dal/Migrations/v01.09.00/Up/PostUp/01-ProjectStatusTransitions.sql b/backend/dal/Migrations/v01.09.00/Up/PostUp/01-ProjectStatusTransitions.sql deleted file mode 100644 index afd6b4a5d3..0000000000 --- a/backend/dal/Migrations/v01.09.00/Up/PostUp/01-ProjectStatusTransitions.sql +++ /dev/null @@ -1,20 +0,0 @@ -PRINT 'Adding ProjectStatusTransitions' - -INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [Action] - , [ToWorkflowId] - , [ToStatusId] - , [ValidateTasks] -) VALUES --- Allow progression from Approved for ERP to Not in SPL -( - 5 -- ERP - , 14 -- Approved for ERP - , 'Proceed to Not in SPL' - , 5 -- ERP - , 22 -- Not in SPL - , 0 -) - diff --git a/backend/dal/Migrations/v01.09.00/Up/PostUp/02-RoleClaims.sql b/backend/dal/Migrations/v01.09.00/Up/PostUp/02-RoleClaims.sql deleted file mode 100644 index 9cf6c427c5..0000000000 --- a/backend/dal/Migrations/v01.09.00/Up/PostUp/02-RoleClaims.sql +++ /dev/null @@ -1,9 +0,0 @@ -PRINT 'Remove RoleClaims - Property-Delete' - -DELETE FROM dbo.[RoleClaims] -WHERE [RoleId] = 'aad8c03d-892c-4cc3-b992-5b41c4f2392c' -- real-estate-manager - AND [ClaimId] = '223664c7-650c-40ac-8581-f40e10164537' -- property-delete - -DELETE FROM dbo.[RoleClaims] -WHERE [RoleId] = '7a7b2549-ae85-4ad6-a8d3-3a5f8d4f9ca5' -- real-estate-assistant - AND [ClaimId] = '223664c7-650c-40ac-8581-f40e10164537' -- property-delete diff --git a/backend/dal/Migrations/v01.09.01/Up/PreUp/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.09.01/Up/PreUp/01-NotificationTemplates.sql deleted file mode 100644 index 8da02167fb..0000000000 --- a/backend/dal/Migrations/v01.09.01/Up/PreUp/01-NotificationTemplates.sql +++ /dev/null @@ -1,70 +0,0 @@ -PRINT 'Updating NotificationTemplates' - -UPDATE dbo.[NotificationTemplates] -SET [Body] = ' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

Good afternoon,

-

This email is to advise that the following properties have been submitted to the Surplus Property Program to be reviewed as surplus by the current holder of the property and is requesting your review:

-

Property Inventory Management System - @Model.Project.ProjectNumber

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Parcel.Address?.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency?.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } - else - { - var appraised = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Appraised); - var assessed = property.Building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - - - Site Address: @property.Building.Address
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse?.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency?.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) (@appraised.Date.Year BC Assessment) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) (@assessed.Date.Year) - } -
    - } -
  2. - } -
-

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 1; \ No newline at end of file diff --git a/backend/dal/Migrations/v01.09.02/Up/PostUp/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.09.02/Up/PostUp/01-NotificationTemplates.sql deleted file mode 100644 index 66614bb04a..0000000000 --- a/backend/dal/Migrations/v01.09.02/Up/PostUp/01-NotificationTemplates.sql +++ /dev/null @@ -1,4 +0,0 @@ -PRINT 'Updating NotificationTemplates - Remove CC' - -UPDATE dbo.[NotificationTemplates] -SET [Cc] = '' diff --git a/backend/dal/Migrations/v01.10.01/Up/PostUp/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.10.01/Up/PostUp/01-NotificationTemplates.sql deleted file mode 100644 index 966aa96501..0000000000 --- a/backend/dal/Migrations/v01.10.01/Up/PostUp/01-NotificationTemplates.sql +++ /dev/null @@ -1,6 +0,0 @@ -PRINT 'Updating NotificationTemplates' - --- Replace the code which is causing a syntax related error during compilation of the template -UPDATE dbo.[NotificationTemplates] -SET [Body] = REPLACE([Body], '(Model.ToAgency.AddressTo ?? "Good morning / @(Model.ToAgency.AddressTo ?? "Good morning / Good afternoon")")', '(Model.ToAgency.AddressTo ?? "Good morning / Good afternoon")') -WHERE Body LIKE '%@(Model.ToAgency.AddressTo ?? "Good morning / @(Model.ToAgency.AddressTo ?? "Good morning / Good afternoon")")%' \ No newline at end of file diff --git a/backend/dal/Migrations/v01.10.02/Up/PostUp/01-ProjectStatusNotifications.sql b/backend/dal/Migrations/v01.10.02/Up/PostUp/01-ProjectStatusNotifications.sql deleted file mode 100644 index 9184031226..0000000000 --- a/backend/dal/Migrations/v01.10.02/Up/PostUp/01-ProjectStatusNotifications.sql +++ /dev/null @@ -1,81 +0,0 @@ -PRINT 'Adding ProjectStatusNotifications' - -IF NOT EXISTS ( - SELECT 1 - FROM dbo.[ProjectStatusNotifications] - WHERE [TemplateId] = 12 - AND [FromStatusId] IS NULL - AND [ToStatusId] = 30 -) -BEGIN - INSERT INTO dbo.[ProjectStatusNotifications] ( - [TemplateId] - , [FromStatusId] - , [ToStatusId] - , [Priority] - , [Delay] - , [DelayDays] - ) - VALUES ( - 12 -- 30 day ERP notification - Watching Agencies - , NULL - , 30 -- In ERP - , 2 - , 3 - , 30 - ) -END - - -IF NOT EXISTS ( - SELECT 1 - FROM dbo.[ProjectStatusNotifications] - WHERE [TemplateId] = 13 - AND [FromStatusId] IS NULL - AND [ToStatusId] = 30 -) -BEGIN -INSERT dbo.[ProjectStatusNotifications] ( - [TemplateId] - , [FromStatusId] - , [ToStatusId] - , [Priority] - , [Delay] - , [DelayDays] -) -VALUES ( - 13 -- 60 day ERP notification - Watching Agencies - , NULL - , 30 -- In ERP - , 2 - , 3 - , 60 -) -END - - -IF NOT EXISTS ( - SELECT 1 - FROM dbo.[ProjectStatusNotifications] - WHERE [TemplateId] = 14 - AND [FromStatusId] IS NULL - AND [ToStatusId] = 30 -) -BEGIN -INSERT dbo.[ProjectStatusNotifications] ( - [TemplateId] - , [FromStatusId] - , [ToStatusId] - , [Priority] - , [Delay] - , [DelayDays] -) -VALUES ( - 14 -- 90 day ERP notification - Watching Agencies - , NULL - , 30 -- In ERP - , 2 - , 3 - , 90 -) -END diff --git a/backend/dal/Migrations/v01.10.04/Up/PostUp/01-Agencies.sql b/backend/dal/Migrations/v01.10.04/Up/PostUp/01-Agencies.sql deleted file mode 100644 index f35b8affed..0000000000 --- a/backend/dal/Migrations/v01.10.04/Up/PostUp/01-Agencies.sql +++ /dev/null @@ -1,88 +0,0 @@ -PRINT 'Updating TRAN Agencies' - ----------------------------------------------------------------- --- Summary --- 1) Change ownership of properties from "TRAN", "PLMB", "TIC" to "BCTFA" --- 2) Change ownership of projects from "TRAN", "PLMB", "TIC" to "BCTFA" --- 3) Move all TRAN users to the "TRAN" ministry instead of sub-agency --- 4) Delete sub-agencies "PLMB" and "TIC" --- --- Note that users will need to be updated manually after this --- migration so that they reference the correct agencies (see below). ----------------------------------------------------------------- - --- These are the ministry and agencies from Ministry of Transportation & Infrastructure -DECLARE @TRAN INT = (SELECT TOP 1 [Id] FROM dbo.[Agencies] WHERE [Code] = 'TRAN') -DECLARE @BCTFA INT = (SELECT TOP 1 [Id] FROM dbo.[Agencies] WHERE [Code] = 'BCTFA') -DECLARE @BCT INT = (SELECT TOP 1 [Id] FROM dbo.[Agencies] WHERE [Code] = 'BCT') - --- The following agencies need to be removed -DECLARE @PLMB INT = (SELECT TOP 1 [Id] FROM dbo.[Agencies] WHERE [Code] = 'PLMB') -DECLARE @TIC INT = (SELECT TOP 1 [Id] FROM dbo.[Agencies] WHERE [Code] = 'TIC') - --- Move users from sub-agencies to the ministry --- This will also require Keycloak user agencies claim to be manually updated --- Get the new agencies claim value with this query: --- (SELECT STRING_AGG([Id], ',') FROM dbo.[Agencies] WHERE [Code] IN ('TRAN', 'BCTFA', 'BCT')) --- This returns currently in production the following value '9,131,132' --- Now get the users that will need to be updated with the above value with this query: --- (SELECT ua.[UserId], u.[Username], u.[Email] FROM dbo.[UserAgencies] ua JOIN dbo.[Users] u ON ua.[UserId] = u.[Id] WHERE ua.[AgencyId] IN (@BCTFA, @BCT, @PLMB, @TIC)) --- This returns currently in production the following users 'cedison@idir, dluison@idir, rstoyko@bceid, kevhouse@idir' --- To update keycloak you will need to manually update each user's "agencies" claim. --- You can do this either by editing the user within PIMS User Management, or the Keycloak Realm GUI. - --- Temporarily save all TRAN users -SELECT DISTINCT [UserId] -INTO #TRANUsers -FROM dbo.[UserAgencies] -WHERE [AgencyId] IN (@TRAN, @BCTFA, @PLMB, @TIC, @BCT) - --- Remove TRAN users agencies -DELETE FROM dbo.[UserAgencies] -WHERE [UserId] IN (SELECT [UserId] FROM #TRANUsers) - --- Re-add all TRAN users -INSERT INTO dbo.[UserAgencies] ( - [UserId] - , [AgencyId] -) -SELECT [UserId], @TRAN -FROM #TRANUsers - --- Remove temp table. -DROP TABLE #TRANUsers - --- Move properties to BCTFA -UPDATE dbo.[Parcels] -SET [AgencyId] = @BCTFA -WHERE [AgencyId] IN (@TRAN, @PLMB, @TIC) - --- Move properties to BCTFA -UPDATE dbo.[Buildings] -SET [AgencyId] = @BCTFA -WHERE [AgencyId] IN (@TRAN, @PLMB, @TIC) - --- Move projects to BCTFA -UPDATE dbo.[Projects] -SET [AgencyId] = @BCTFA -WHERE [AgencyId] IN (@TRAN, @PLMB, @TIC) - --- Update any access request to use the ministry instead of the agency --- Since PIMS currently only supports a single agency to be selected when submitting access requests, this should be fine. -UPDATE dbo.[AccessRequestAgencies] -SET [AgencyId] = @TRAN -WHERE [AgencyId] IN (@BCTFA, @PLMB, @TIC) - --- There are no relevant agency responses in production, but in any of the test dbs they need to be cleared -DELETE FROM dbo.[ProjectAgencyResponses] -WHERE [AgencyId] IN (@PLMB, @TIC) - --- Transfer any notifications to the ministry --- There are no relevant notifications in the queue in production, but in any of the test dbs they need to be cleared -UPDATE dbo.[NotificationQueue] -SET [ToAgencyId] = @TRAN -WHERE [ToAgencyId] IN (@BCTFA, @PLMB, @TIC) - --- Delete the invalid agencies -DELETE FROM dbo.[Agencies] -WHERE [Id] IN (@PLMB, @TIC) diff --git a/backend/dal/Migrations/v01.10.05/Up/PostUp/01-Properties.sql b/backend/dal/Migrations/v01.10.05/Up/PostUp/01-Properties.sql deleted file mode 100644 index 15a80900bc..0000000000 --- a/backend/dal/Migrations/v01.10.05/Up/PostUp/01-Properties.sql +++ /dev/null @@ -1,30 +0,0 @@ -PRINT 'Updating Disposed Property Agencies' - ----------------------------------------------------------------- --- Summary --- Previously disposed property would set the AgencyId=null. --- Going forward they will retain their original agency. --- Reset disposed properties to their project agency. --- Note it is possible that the property could have originally --- been owned by a sub-agency of the project. ----------------------------------------------------------------- - --- Update the parcel to the project agency --- where it was disposed and is currently null. -UPDATE p -SET p.AgencyId = pr.AgencyId -FROM dbo.Parcels p -JOIN dbo.ProjectProperties pp ON p.Id = pp.ParcelId -JOIN dbo.Projects pr ON pp.ProjectId = pr.Id -WHERE p.ClassificationId = 4 -- Disposed - AND p.AgencyId IS NULL - --- Update the building to the project agency --- where it was disposed and is currently null. -UPDATE b -SET b.AgencyId = pr.AgencyId -FROM dbo.Buildings b -JOIN dbo.ProjectProperties pp ON b.Id = pp.BuildingId -JOIN dbo.Projects pr ON pp.ProjectId = pr.Id -WHERE b.ClassificationId = 4 -- Disposed - AND b.AgencyId IS NULL diff --git a/backend/dal/Migrations/v01.10.06/Up/PostUp/01-ProjectStatusTransitions.sql b/backend/dal/Migrations/v01.10.06/Up/PostUp/01-ProjectStatusTransitions.sql deleted file mode 100644 index f6f200c5f0..0000000000 --- a/backend/dal/Migrations/v01.10.06/Up/PostUp/01-ProjectStatusTransitions.sql +++ /dev/null @@ -1,71 +0,0 @@ -PRINT 'Adding ProjectStatusTransitions' - -MERGE INTO dbo.[ProjectStatusTransitions] dest -USING ( VALUES - -- Allow progression from Approved for ERP to Cancelled - ( - 5 -- ERP - , 14 -- Approved for ERP - , 'Cancel Project' - , 5 -- ERP - , 23 -- Cancelled - , 0 - ) - - -- Allow progression from Not in SPL to Cancelled - , ( - 5 -- ERP - , 22 -- Not in SPL - , 'Cancel Project' - , 5 -- ERP - , 23 -- Cancelled - , 0 - ) - - -- Allow progression from Approved for SPL to Cancelled - , ( - 6 -- SPL - , 21 -- Approved for SPL - , 'Cancel Project' - , 6 -- SPL - , 23 -- Cancelled - , 0 - ) -) AS src ( - [FromWorkflowId] - , [FromStatusId] - , [Action] - , [ToWorkflowId] - , [ToStatusId] - , [ValidateTasks] -) -ON dest.[FromWorkflowId] = src.[FromWorkflowId] - AND dest.[FromStatusId] = src.[FromStatusId] - AND dest.[ToWorkflowId] = src.[ToWorkflowId] - AND dest.[ToStatusId] = src.[ToStatusId] -WHEN MATCHED THEN -UPDATE -SET - dest.[FromWorkflowId] = src.[FromWorkflowId] - , dest.[FromStatusId] = src.[FromStatusId] - , dest.[Action] = src.[Action] - , dest.[ToWorkflowId] = src.[ToWorkflowId] - , dest.[ToStatusId] = src.[ToStatusId] - , dest.[ValidateTasks] = src.[ValidateTasks] -WHEN NOT MATCHED THEN -INSERT ( - [FromWorkflowId] - , [FromStatusId] - , [Action] - , [ToWorkflowId] - , [ToStatusId] - , [ValidateTasks] -) VALUES ( - src.[FromWorkflowId] - , src.[FromStatusId] - , src.[Action] - , src.[ToWorkflowId] - , src.[ToStatusId] - , src.[ValidateTasks] -); - diff --git a/backend/dal/Migrations/v01.11.00/Down/PostDown/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.11.00/Down/PostDown/01-NotificationTemplates.sql deleted file mode 100644 index 1719d74619..0000000000 --- a/backend/dal/Migrations/v01.11.00/Down/PostDown/01-NotificationTemplates.sql +++ /dev/null @@ -1,5 +0,0 @@ -PRINT N'Update [NotificationTemplates]' - -UPDATE dbo.[NotificationTemplates] -SET [Audience] = 'OwningAgency' -WHERE [Id] IN (2, 3, 4) diff --git a/backend/dal/Migrations/v01.11.00/Up/PostUp/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.11.00/Up/PostUp/01-NotificationTemplates.sql deleted file mode 100644 index 8cee1d8cf1..0000000000 --- a/backend/dal/Migrations/v01.11.00/Up/PostUp/01-NotificationTemplates.sql +++ /dev/null @@ -1,42 +0,0 @@ -PRINT N'Update [NotificationTemplates]' - -UPDATE dbo.[NotificationTemplates] -SET [Audience] = N'ProjectOwner' -WHERE [Id] IN (2, 3, 4, 16) - -UPDATE dbo.[NotificationTemplates] -SET [Body] = N' - -@Model.Environment.Title - -

Good morning / Good afternoon,

-

Your project @Model.Project.ProjectNumber has been denied. Signin to PIMS to review the reason.

-

Sincerely Real Property Division

- -' -WHERE [Id] = 2 - -UPDATE dbo.[NotificationTemplates] -SET [Body] = N' -@Model.Environment.Title - -

Good morning / Good afternoon,

-

Your project @Model.Project.ProjectNumber has been cancelled. Signin to PIMS to review the reason.

-

Sincerely Real Property Division

- -' -WHERE [Id] = 3 - -UPDATE dbo.[NotificationTemplates] -SET [Body] = N' -@using System.Linq -@using Pims.Dal.Entities - -@Model.Environment.Title - -

Good morning / Good afternoon,

-

Your project @Model.Project.ProjectNumber has been approved. Signin to PIMS to review the progress.

-

@Model.Project.Notes.FirstOrDefault(n => n.NoteType == NoteTypes.ErpNotification)?.Note

Sincerely Real Property Division

- -' -WHERE [Id] = 4 diff --git a/backend/dal/Migrations/v01.11.01/Down/PostDown/01-ProjectStatusTransitions.sql b/backend/dal/Migrations/v01.11.01/Down/PostDown/01-ProjectStatusTransitions.sql deleted file mode 100644 index c9d3891544..0000000000 --- a/backend/dal/Migrations/v01.11.01/Down/PostDown/01-ProjectStatusTransitions.sql +++ /dev/null @@ -1,7 +0,0 @@ -PRINT 'Removing Not in SPL -> In ERP ProjectStatusTransitions' - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 5 -- ERP - AND [FromStatusId] = 22 -- Not in SPL - AND [ToWorkflowId] = 5 -- ERP - AND [ToStatusId] = 30 -- IN ERP diff --git a/backend/dal/Migrations/v01.11.01/Up/PostUp/01-ProjectStatusTransitions.sql b/backend/dal/Migrations/v01.11.01/Up/PostUp/01-ProjectStatusTransitions.sql deleted file mode 100644 index 7d1f20043a..0000000000 --- a/backend/dal/Migrations/v01.11.01/Up/PostUp/01-ProjectStatusTransitions.sql +++ /dev/null @@ -1,20 +0,0 @@ -PRINT 'Adding ProjectStatusTransitions - Not in SPL -> In ERP' - -INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [Action] - , [ToWorkflowId] - , [ToStatusId] - , [ValidateTasks] -) VALUES - --- Allow progression from Not in SPL -> In ERP -( - 5 -- ERP - , 22 -- Not in SPL - , 'In ERP' - , 5 -- ERP - , 30 -- In ERP - , 0 -) diff --git a/backend/dal/Migrations/v01.11.02/Up/PostUp/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.11.02/Up/PostUp/01-NotificationTemplates.sql deleted file mode 100644 index a291269e84..0000000000 --- a/backend/dal/Migrations/v01.11.02/Up/PostUp/01-NotificationTemplates.sql +++ /dev/null @@ -1,11 +0,0 @@ -PRINT 'Updating NotificationTemplates' - --- to fix the single case for template 1 -UPDATE dbo.[NotificationTemplates] -SET [Body] = REPLACE([Body], '@property.Parcel.Address?.ToString()', '@property.Parcel.Address.ToString()') -WHERE Body LIKE '%@property.Parcel.Address?.ToString()%' AND [Id] = 1; - --- to fix all the building address references -UPDATE dbo.[NotificationTemplates] -SET [Body] = REPLACE([Body], '@property.Building.Address
', '@property.Building.Address.ToString()
') -WHERE Body LIKE '%@property.Building.Address
%'; \ No newline at end of file diff --git a/backend/dal/Migrations/v01.11.03/Up/PostUp/01-AdministrativeAreas.sql b/backend/dal/Migrations/v01.11.03/Up/PostUp/01-AdministrativeAreas.sql deleted file mode 100644 index 0f785b5f2a..0000000000 --- a/backend/dal/Migrations/v01.11.03/Up/PostUp/01-AdministrativeAreas.sql +++ /dev/null @@ -1,32 +0,0 @@ -PRINT 'Adding [AdministrativeAreas]' - -MERGE INTO dbo.[AdministrativeAreas] dest -USING ( - VALUES ( - 'Valdes Island', - 'Valdes Isl', - 'Cowichan Valley Regional District' - ), ( - 'Stopper Islands', - 'Stopper Isl', - 'Alberni-Clayoquot Regional District' - ) -) AS src ( - [Name] - , [Abbreviation] - , [GroupName]) -ON dest.Name = src.[Name] -WHEN MATCHED THEN -UPDATE -SET dest.[Abbreviation] = src.[Abbreviation] - , dest.[GroupName] = src.[GroupName] -WHEN NOT MATCHED THEN -INSERT ( - [Name] - , [Abbreviation] - , [GroupName] -) VALUES ( - src.[Name] - , src.[Abbreviation] - , src.[GroupName] -); diff --git a/backend/dal/Migrations/v01.12.00/Up/PostUp/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.12.00/Up/PostUp/01-NotificationTemplates.sql deleted file mode 100644 index acd5f3dd56..0000000000 --- a/backend/dal/Migrations/v01.12.00/Up/PostUp/01-NotificationTemplates.sql +++ /dev/null @@ -1,5 +0,0 @@ -PRINT N'Update [NotificationTemplates]' - -UPDATE dbo.[NotificationTemplates] -SET [Audience] = N'ProjectOwner' -WHERE [Id] IN (6, 7, 8) diff --git a/backend/dal/Migrations/v01.12.01/Up/PostUp/01-Users.sql b/backend/dal/Migrations/v01.12.01/Up/PostUp/01-Users.sql deleted file mode 100644 index f076d8de4d..0000000000 --- a/backend/dal/Migrations/v01.12.01/Up/PostUp/01-Users.sql +++ /dev/null @@ -1,5 +0,0 @@ -PRINT N'Update [Users]' - --- Copy the current user Id into the KeycloakUserId. -UPDATE dbo.[Users] -SET [KeycloakUserId] = [Id] diff --git a/backend/dal/Migrations/v01.12.02/Up/PreUp/01-AdministrativeAreas.sql b/backend/dal/Migrations/v01.12.02/Up/PreUp/01-AdministrativeAreas.sql deleted file mode 100644 index da790f56b4..0000000000 --- a/backend/dal/Migrations/v01.12.02/Up/PreUp/01-AdministrativeAreas.sql +++ /dev/null @@ -1,9 +0,0 @@ -PRINT 'Removing duplicates' - -DELETE FROM dbo.[AdministrativeAreas] -WHERE [Id] NOT IN (SELECT MIN(Id) - FROM dbo.[AdministrativeAreas] - GROUP BY [Name] - HAVING MIN(Id) IS NOT NULL -) - diff --git a/backend/dal/Migrations/v01.13.01/Down/PreDown/RemoveNotificationTemplate.sql b/backend/dal/Migrations/v01.13.01/Down/PreDown/RemoveNotificationTemplate.sql deleted file mode 100644 index cf550c4ebd..0000000000 --- a/backend/dal/Migrations/v01.13.01/Down/PreDown/RemoveNotificationTemplate.sql +++ /dev/null @@ -1 +0,0 @@ -DELETE FROM dbo.[NotificationTemplates] where [Id] = 17; diff --git a/backend/dal/Migrations/v01.13.01/Up/PostUp/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.13.01/Up/PostUp/01-NotificationTemplates.sql deleted file mode 100644 index a44974d5bb..0000000000 --- a/backend/dal/Migrations/v01.13.01/Up/PostUp/01-NotificationTemplates.sql +++ /dev/null @@ -1,37 +0,0 @@ -PRINT 'Adding NotificationTemplates' - -SET IDENTITY_INSERT dbo.[NotificationTemplates] ON - -INSERT INTO dbo.[NotificationTemplates] ( - [Id] - , [Name] - , [Description] - , [IsDisabled] - , [To] - , [Cc] - , [Bcc] - , [Audience] - , [Encoding] - , [BodyType] - , [Priority] - , [Subject] - , [Body] - , [Tag] -) VALUES ( - 17 - , 'Access Request RPD Mailbox' - , 'A new authenticated user has requested access.' - , 0 - , 'CITZ_RPD_IMIT_HELP@gov.bc.ca' - , '' - , '' - , 'Default' - , 'Utf8' - , 'Html' - , 'High' - , 'PIMS - Access Request' - , ' -@Model.Environment.Title -

Dear Administrator,

@Model.AccessRequest.User.FirstName @Model.AccessRequest.User.LastName has submitted an access request to PIMS.

Signin and review their request.

' - , 'Access Request' -) \ No newline at end of file diff --git a/backend/dal/Migrations/v01.14.00/Down/PreDown/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.14.00/Down/PreDown/01-NotificationTemplates.sql deleted file mode 100644 index e77ff1641c..0000000000 --- a/backend/dal/Migrations/v01.14.00/Down/PreDown/01-NotificationTemplates.sql +++ /dev/null @@ -1,6 +0,0 @@ -PRINT 'Updating NotificationTemplates' - --- to remove the project numbers from ERP templates -UPDATE dbo.[NotificationTemplates] -SET [Body] = REPLACE([Body], '

@Model.Project.ProjectNumber :

', '') -WHERE Body LIKE '%

@Model.Project.ProjectNumber :

%' AND [Id] IN (5,6,7,8,9,10,11,12,13,14); diff --git a/backend/dal/Migrations/v01.14.00/Up/PostUp/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.14.00/Up/PostUp/01-NotificationTemplates.sql deleted file mode 100644 index 13cf7a4b1d..0000000000 --- a/backend/dal/Migrations/v01.14.00/Up/PostUp/01-NotificationTemplates.sql +++ /dev/null @@ -1,746 +0,0 @@ -PRINT 'Update NotificationTemplates - adding project numbers to the body of the ERP templates' - -UPDATE dbo.[NotificationTemplates] -SET [Body] = N' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

@(Model.ToAgency.AddressTo ?? "Good morning / Good afternoon"),

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

Please forward this notification to any SUCH Sector Organization or BPS Entity that your ministry is responsible for to ensure any interest from Ministries or Agencies in the properties is identified.

-

Should there be no interest in the property detailed below from your Ministry or any SUCH Sector Organization or BPS Entity that your Ministry is responsible for, please respond to confirm.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

@Model.Project.ProjectNumber :

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } - else - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Building.Address.ToString()
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with 90 days from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property. Reminder notifications will be sent at both 30 days and 60 days from this initial notification.

-

@Model.Project.Notes.FirstOrDefault(n => n.NoteType == NoteTypes.ErpNotification)?.Note

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 5; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = N' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

@(Model.ToAgency.AddressTo ?? "Good morning / Good afternoon"),

-

This email is a 30 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property have been identified as surplus is available for redeployment:

-

@Model.Project.ProjectNumber :

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } - else - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Building.Address.ToString()
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } -
  2. - } -
-

-

@Model.Project.Notes.FirstOrDefault(n => n.NoteType == NoteTypes.ErpNotification)?.Note

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 6; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = N' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

@(Model.ToAgency.AddressTo ?? "Good morning / Good afternoon"),

-

This email is a 60 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property have been identified as surplus is available for redeployment:

-

@Model.Project.ProjectNumber :

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } - else - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Building.Address.ToString()
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } -
  2. - } -
-

-

@Model.Project.Notes.FirstOrDefault(n => n.NoteType == NoteTypes.ErpNotification)?.Note

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 7; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = N' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

@(Model.ToAgency.AddressTo ?? "Good morning / Good afternoon"),

-

This email is the 90 Day Completion Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property have been identified as surplus is available for redeployment:

-

@Model.Project.ProjectNumber :

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } - else - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Building.Address.ToString()
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } -
  2. - } -
-

-

@Model.Project.Notes.FirstOrDefault(n => n.NoteType == NoteTypes.ErpNotification)?.Note

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 8; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = N' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

@(Model.ToAgency.AddressTo ?? "Good morning / Good afternoon"),

-

This email is a 30 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

Please forward this notification to any SUCH Sector Organization or BPS Entity that your ministry is responsible for to ensure any interest from Ministries or Agencies in the properties is identified.

-

Should there be no interest in the property detailed below from your Ministry or any SUCH Sector Organization or BPS Entity that your Ministry is responsible for, please respond to confirm.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

@Model.Project.ProjectNumber :

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } - else - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Building.Address.ToString()
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with 60 days from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property. An additional reminder notification will be sent 30 days before this internal listing expires.

-

@Model.Project.Notes.FirstOrDefault(n => n.NoteType == NoteTypes.ErpNotification)?.Note

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 9; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = N' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

@(Model.ToAgency.AddressTo ?? "Good morning / Good afternoon"),

-

This email is a 60 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

Please forward this notification to any SUCH Sector Organization or BPS Entity that your ministry is responsible for to ensure any interest from Ministries or Agencies in the properties is identified.

-

Should there be no interest in the property detailed below from your Ministry or any SUCH Sector Organization or BPS Entity that your Ministry is responsible for, please respond to confirm.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

@Model.Project.ProjectNumber :

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } - else - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Building.Address.ToString()
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with 30 days from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property.

-

@Model.Project.Notes.FirstOrDefault(n => n.NoteType == NoteTypes.ErpNotification)?.Note

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 10; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = N' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

@(Model.ToAgency.AddressTo ?? "Good morning / Good afternoon"),

-

This email is to provide confirmation that the 90 Day Enhanced Referral Period as detailed in the initial Notification of Surplus Real Property below is now complete.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

Please forward this notification to any SUCH Sector Organization or BPS Entity that your ministry is responsible for to ensure any interest from Ministries or Agencies in the properties is identified.

-

Should there be no interest in the property detailed below from your Ministry or any SUCH Sector Organization or BPS Entity that your Ministry is responsible for, please respond to confirm.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

@Model.Project.ProjectNumber :

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } - else - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Building.Address.ToString()
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } -
  2. - } -
-

-

An Enhanced Referral Notification Letter will be sent to the owning Ministry / Agency at the end of the week advising of next steps in the process.

-

@Model.Project.Notes.FirstOrDefault(n => n.NoteType == NoteTypes.ErpNotification)?.Note

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 11; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = N' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

@(Model.ToAgency.AddressTo ?? "Good morning / Good afternoon"),

-

This email is a 30 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

@Model.Project.ProjectNumber :

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } - else - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Building.Address.ToString()
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with 60 days from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property.

-

@Model.Project.Notes.FirstOrDefault(n => n.NoteType == NoteTypes.ErpNotification)?.Note

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 12; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = N' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

@(Model.ToAgency.AddressTo ?? "Good morning / Good afternoon"),

-

This email is a 60 Day Reminder Notification as detailed in the initial Notification of Surplus Real Property below.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

@Model.Project.ProjectNumber :

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } - else - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Building.Address.ToString()
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with 30 days from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property.

-

@Model.Project.Notes.FirstOrDefault(n => n.NoteType == NoteTypes.ErpNotification)?.Note

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 13; - -UPDATE dbo.[NotificationTemplates] -SET [Body] = N' -@using System.Linq -@using Pims.Dal.Entities -@using System.Globalization - -@Model.Environment.Title -

@(Model.ToAgency.AddressTo ?? "Good morning / Good afternoon"),

-

This email is to provide confirmation that the 90 Day Enhanced Referral Period as detailed in the initial Notification of Surplus Real Property below is now complete.

-

As detailed in the Surplus Properties Program Process Manual, the Strategic Real Estate Services Branch (SRES) has committed to proactively notifying all other Ministries, SUCH Sector Organization and Broader Public Sector (BPS) Entities of the availability of a new surplus property.

-

This email is to advise that the following property has been identified as surplus by the current holder of the property and is available for redeployment if there is a need by your Ministry, SUCH Sector Organization or BPS Entity:

-

@Model.Project.ProjectNumber :

-

-

    - @foreach (var property in Model.Project.Properties) - { -
  1. - @if (property.PropertyType == PropertyTypes.Land) - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Parcel.Address.ToString()
    - Site Description: @property.Parcel.Name
    - Site Size: @property.Parcel.LandArea ha
    - Zoned: @property.Parcel.Zoning
    - PID: @property.Parcel.ParcelIdentity
    - Legal: @property.Parcel.LandLegalDescription
    - Current Holder of the Property: @property.Parcel.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } - else - { - var appraised = @Model.Project.Appraised; - var assessed = @Model.Project.Assessed; - - - Site Address: @property.Building.Address.ToString()
    - Site Description: @property.Building.Name
    - Rentable Area: @property.Building.RentableArea sqft
    - Building Floors: @property.Building.BuildingFloorCount
    - Predominate Use: @property.Building.BuildingPredominateUse.Name
    - Tenancy: @property.Building.BuildingTenancy
    - Current Holder of the Property: @property.Building.Agency.Name
    - @if (appraised != null && appraised.Value > 0) - { - Appraised Value: @appraised.Value.ToString("C", new CultureInfo("en-US")) - } - else if (assessed != null && assessed.Value > 0) - { - Assessed Value: @assessed.Value.ToString("C", new CultureInfo("en-US")) - } -
    - } -
  2. - } -
-

-

Your Ministry, SUCH Sector Organization or BPS Entity is provided with until the end of this week from this notification to submit a Business Case to SRES expressing your interest in acquiring the surplus property.

-

An Enhanced Referral Notification Letter will be sent to the owning Ministry / Agency at the end of the week advising of next steps in the process.

-

@Model.Project.Notes.FirstOrDefault(n => n.NoteType == NoteTypes.ErpNotification)?.Note

-

If you have any questions regarding this matter, please contact Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348.

-

Thank you.

-

Strategic Real Estate Services, Real Property Division

' -WHERE [Id] = 14; \ No newline at end of file diff --git a/backend/dal/Migrations/v01.14.01/Down/PostDown/02-WorkflowProjectStatus.sql b/backend/dal/Migrations/v01.14.01/Down/PostDown/02-WorkflowProjectStatus.sql deleted file mode 100644 index 1ff5d70e7b..0000000000 --- a/backend/dal/Migrations/v01.14.01/Down/PostDown/02-WorkflowProjectStatus.sql +++ /dev/null @@ -1,5 +0,0 @@ -PRINT 'Delete WorkflowProjectStatus - SPL --> On Hold' - -DELETE FROM dbo.[WorkflowProjectStatus] -WHERE [WorkflowId] = 6 -- SPL - AND [StatusId] = 31 -- On Hold diff --git a/backend/dal/Migrations/v01.14.01/Up/PostUp/01-WorkflowProjectStatus.sql b/backend/dal/Migrations/v01.14.01/Up/PostUp/01-WorkflowProjectStatus.sql deleted file mode 100644 index 19a1c96938..0000000000 --- a/backend/dal/Migrations/v01.14.01/Up/PostUp/01-WorkflowProjectStatus.sql +++ /dev/null @@ -1,13 +0,0 @@ -PRINT 'Adding WorkflowProjectStatus - SPL -> On Hold' - -INSERT INTO dbo.[WorkflowProjectStatus] ( - [WorkflowId] - , [StatusId] - , [IsOptional] - , [SortOrder] -) VALUES ( - 6 -- SPL - , 31 -- On Hold - , 1 - , 5 -) diff --git a/backend/dal/Migrations/v01.15.00/Down/PostDown/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.15.00/Down/PostDown/01-NotificationTemplates.sql deleted file mode 100644 index 6601276217..0000000000 --- a/backend/dal/Migrations/v01.15.00/Down/PostDown/01-NotificationTemplates.sql +++ /dev/null @@ -1,6 +0,0 @@ -PRINT 'Updating NotificationTemplates' - --- Replace the instances thats shows sqM with sqft -UPDATE [pims].dbo.[NotificationTemplates] -SET [Body] = REPLACE([Body], 'sqM', 'sqft') -WHERE Body LIKE '%sqM%'; diff --git a/backend/dal/Migrations/v01.15.00/Up/PostUp/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.15.00/Up/PostUp/01-NotificationTemplates.sql deleted file mode 100644 index 4ee5815596..0000000000 --- a/backend/dal/Migrations/v01.15.00/Up/PostUp/01-NotificationTemplates.sql +++ /dev/null @@ -1,7 +0,0 @@ -PRINT 'Updating NotificationTemplates' - --- Replace the instances thats shows sqft with Sq. M -UPDATE [pims].dbo.[NotificationTemplates] -SET [Body] = REPLACE([Body], 'sqft', 'Sq. M') -WHERE Body LIKE '%sqft%'; - diff --git a/backend/dal/Migrations/v01.16.00/Down/PostDown/01-ViewProperties.sql b/backend/dal/Migrations/v01.16.00/Down/PostDown/01-ViewProperties.sql deleted file mode 100644 index 8ec4c035df..0000000000 --- a/backend/dal/Migrations/v01.16.00/Down/PostDown/01-ViewProperties.sql +++ /dev/null @@ -1,213 +0,0 @@ -PRINT 'Updating View_Properties - Show all properties' -GO --- This script provides a way to union both parcels and buildings into a single result of properties. --- Updating view to support many-to-many parcels and buildings.TEMPORARY -CREATE OR ALTER VIEW dbo.[View_Properties] AS -SELECT - p.[Id] - , p.[RowVersion] - , p.[PropertyTypeId] - , p.[ClassificationId] - , [Classification] = c.[Name] - , p.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , p.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [AdministrativeArea] = adr.[AdministrativeArea] - , [Province] = ap.[Name] - , adr.[Postal] - , p.[ProjectNumbers] - , p.[Name] - , p.[Description] - , p.[Location] - , p.[Boundary] - , p.[IsSensitive] - , p.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , p.[PID] - , p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [ParcelId] = p.[Id] - , [BuildingConstructionTypeId] = 0 - , [BuildingConstructionType] = null - , [BuildingFloorCount] = 0 - , [BuildingPredominateUseId] = 0 - , [BuildingPredominateUse] = null - , [BuildingOccupantTypeId] = 0 - , [BuildingOccupantType] = null - , [BuildingTenancy] = null - , [RentableArea] = 0 - , [LeaseExpiry] = null - , [OccupantName] = null - , [TransferLeaseOnSale] = CAST(0 AS BIT) - - , [AssessedLand] = eas.[Value] - , [AssessedLandDate] = eas.[Date] - , [AssessedBuilding] = eim.[Value] - , [AssessedBuildingDate] = eim.[Date] - , [Market] = ISNULL(fe.[Value], 0) - , [MarketFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] -FROM dbo.[Parcels] p -LEFT JOIN (SELECT DISTINCT SubdivisionId FROM dbo.[ParcelParcels]) sp ON p.[Id] = sp.[SubdivisionId] -JOIN dbo.[PropertyClassifications] c ON p.[ClassificationId] = c.[Id] -LEFT JOIN dbo.[Agencies] a ON p.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON p.[AddressId] = adr.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- Assessed Land - ORDER BY [Date] DESC -) AS eas -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 2 -- Assessed Building - ORDER BY [Date] DESC -) AS eim -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 1 -- Market - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn -UNION ALL -SELECT - b.[Id] - , b.[RowVersion] - , b.[PropertyTypeId] - , b.[ClassificationId] - , [Classification] = c.[Name] - , b.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , b.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [AdministrativeArea] = adr.[AdministrativeArea] - , [Province] = ap.[Name] - , adr.[Postal] - , b.[ProjectNumbers] - , b.[Name] - , b.[Description] - , b.[Location] - , b.[Boundary] - , b.[IsSensitive] - , b.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , [PID] = p.[PID] - , [PIN] = p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [ParcelId] = p.[Id] - , [BuildingConstructionTypeId] = b.[BuildingConstructionTypeId] - , [BuildingConstructionType] = bct.[Name] - , [BuildingFloorCount] = b.[BuildingFloorCount] - , [BuildingPredominateUseId] = b.[BuildingPredominateUseId] - , [BuildingPredominateUse] = bpu.[Name] - , [BuildingOccupantTypeId] = b.[BuildingOccupantTypeId] - , [BuildingOccupantType] = bot.[Name] - , [BuildingTenancy] = b.[BuildingTenancy] - , [RentableArea] = b.[RentableArea] - , [LeaseExpiry] = b.[LeaseExpiry] - , [OccupantName] = b.[OccupantName] - , [TransferLeaseOnSale] = b.[TransferLeaseOnSale] - - , [AssessedLand] = null - , [AssessedLandDate] = null - , [AssessedBuilding] = eim.[Value] - , [AssessedBuildingDate] = eim.[Date] - , [Market] = ISNULL(fe.[Value], 0) - , [MarketFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] -FROM dbo.[Buildings] b -LEFT JOIN dbo.[ParcelBuildings] pb ON b.[Id] = pb.[BuildingId] -LEFT JOIN dbo.[Parcels] p ON pb.[ParcelId] = p.[Id] -JOIN dbo.[PropertyClassifications] c ON b.[ClassificationId] = c.[Id] -LEFT JOIN dbo.[Agencies] a ON b.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON b.[AddressId] = adr.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -JOIN dbo.[BuildingConstructionTypes] bct ON b.[BuildingConstructionTypeId] = bct.[Id] -JOIN dbo.[BuildingOccupantTypes] bot ON b.[BuildingOccupantTypeId] = bot.[Id] -JOIN dbo.[BuildingPredominateUses] bpu ON b.[BuildingPredominateUseId] = bpu.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[BuildingEvaluations] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- Assessed - ORDER BY [Date] DESC -) AS eim -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 1 -- Market - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn diff --git a/backend/dal/Migrations/v01.16.00/Up/PostUp/01-ViewProperties.sql b/backend/dal/Migrations/v01.16.00/Up/PostUp/01-ViewProperties.sql deleted file mode 100644 index fdcb5b38f1..0000000000 --- a/backend/dal/Migrations/v01.16.00/Up/PostUp/01-ViewProperties.sql +++ /dev/null @@ -1,219 +0,0 @@ -PRINT 'Updating View_Properties - Show all properties' -GO --- This script provides a way to union both parcels and buildings into a single result of properties. --- Updating view to support many-to-many parcels and buildings.TEMPORARY -CREATE OR ALTER VIEW dbo.[View_Properties] AS -SELECT - p.[Id] - , p.[RowVersion] - , p.[PropertyTypeId] - , p.[ClassificationId] - , [Classification] = c.[Name] - , p.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , p.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [AdministrativeArea] = adr.[AdministrativeArea] - , [Province] = ap.[Name] - , adr.[Postal] - , p.[ProjectNumbers] - , p.[Name] - , p.[Description] - , p.[Location] - , p.[Boundary] - , p.[IsSensitive] - , p.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , p.[PID] - , p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [ParcelId] = p.[Id] - , [BuildingConstructionTypeId] = 0 - , [BuildingConstructionType] = null - , [BuildingFloorCount] = 0 - , [BuildingPredominateUseId] = 0 - , [BuildingPredominateUse] = null - , [BuildingOccupantTypeId] = 0 - , [BuildingOccupantType] = null - , [BuildingTenancy] = null - , [RentableArea] = 0 - , [LeaseExpiry] = null - , [OccupantName] = null - , [TransferLeaseOnSale] = CAST(0 AS BIT) - - , [AssessedLand] = eas.[Value] - , [AssessedLandDate] = eas.[Date] - , [AssessedBuilding] = eim.[Value] - , [AssessedBuildingDate] = eim.[Date] - , [Market] = ISNULL(fe.[Value], 0) - , [MarketFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] - , p.[UpdatedOn] - , u.DisplayName -FROM dbo.[Parcels] p -LEFT JOIN (SELECT DISTINCT SubdivisionId FROM dbo.[ParcelParcels]) sp ON p.[Id] = sp.[SubdivisionId] -JOIN dbo.[PropertyClassifications] c ON p.[ClassificationId] = c.[Id] -LEFT JOIN dbo.[Users] u ON p.UpdatedById = u.Id -LEFT JOIN dbo.[Agencies] a ON p.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON p.[AddressId] = adr.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- Assessed Land - ORDER BY [Date] DESC -) AS eas -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[ParcelEvaluations] - WHERE [ParcelId] = p.[Id] - AND [Key] = 2 -- Assessed Building - ORDER BY [Date] DESC -) AS eim -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 1 -- Market - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[ParcelFiscals] - WHERE [ParcelId] = p.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn -UNION ALL -SELECT - b.[Id] - , b.[RowVersion] - , b.[PropertyTypeId] - , b.[ClassificationId] - , [Classification] = c.[Name] - , b.[AgencyId] - , [Agency] = ISNULL(pa.[Name], a.[Name]) - , [AgencyCode] = ISNULL(pa.[Code], a.[Code]) - , [SubAgency] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Name] - ELSE NULL - END) - , [SubAgencyCode] = ( - SELECT CASE WHEN pa.[Id] IS NOT NULL - THEN a.[Code] - ELSE NULL - END) - , b.[AddressId] - , [Address] = TRIM(ISNULL(adr.[Address1], '') + ' ' + ISNULL(adr.[Address2], '')) - , [AdministrativeArea] = adr.[AdministrativeArea] - , [Province] = ap.[Name] - , adr.[Postal] - , b.[ProjectNumbers] - , b.[Name] - , b.[Description] - , b.[Location] - , b.[Boundary] - , b.[IsSensitive] - , b.[IsVisibleToOtherAgencies] - - -- Parcel Properties - , [PID] = p.[PID] - , [PIN] = p.[PIN] - , [LandArea] = p.[LandArea] - , [LandLegalDescription] = p.[LandLegalDescription] - , [Zoning] = p.[Zoning] - , [ZoningPotential] = p.[ZoningPotential] - - -- Building Properties - , [ParcelId] = p.[Id] - , [BuildingConstructionTypeId] = b.[BuildingConstructionTypeId] - , [BuildingConstructionType] = bct.[Name] - , [BuildingFloorCount] = b.[BuildingFloorCount] - , [BuildingPredominateUseId] = b.[BuildingPredominateUseId] - , [BuildingPredominateUse] = bpu.[Name] - , [BuildingOccupantTypeId] = b.[BuildingOccupantTypeId] - , [BuildingOccupantType] = bot.[Name] - , [BuildingTenancy] = b.[BuildingTenancy] - , [RentableArea] = b.[RentableArea] - , [LeaseExpiry] = b.[LeaseExpiry] - , [OccupantName] = b.[OccupantName] - , [TransferLeaseOnSale] = b.[TransferLeaseOnSale] - - , [AssessedLand] = null - , [AssessedLandDate] = null - , [AssessedBuilding] = eim.[Value] - , [AssessedBuildingDate] = eim.[Date] - , [Market] = ISNULL(fe.[Value], 0) - , [MarketFiscalYear] = fe.[FiscalYear] - , [NetBook] = ISNULL(fn.[Value], 0) - , [NetBookFiscalYear] = fn.[FiscalYear] - , b.[UpdatedOn] - , u.DisplayName -FROM dbo.[Buildings] b -LEFT JOIN dbo.[ParcelBuildings] pb ON b.[Id] = pb.[BuildingId] -LEFT JOIN dbo.[Parcels] p ON pb.[ParcelId] = p.[Id] -JOIN dbo.[PropertyClassifications] c ON b.[ClassificationId] = c.[Id] -LEFT JOIN dbo.[Users] u ON b.UpdatedById = u.Id -LEFT JOIN dbo.[Agencies] a ON b.[AgencyId] = a.[Id] -LEFT JOIN dbo.[Agencies] pa ON a.[ParentId] = pa.[Id] -JOIN dbo.[Addresses] adr ON b.[AddressId] = adr.[Id] -JOIN dbo.[Provinces] ap ON adr.[ProvinceId] = ap.[Id] -JOIN dbo.[BuildingConstructionTypes] bct ON b.[BuildingConstructionTypeId] = bct.[Id] -JOIN dbo.[BuildingOccupantTypes] bot ON b.[BuildingOccupantTypeId] = bot.[Id] -JOIN dbo.[BuildingPredominateUses] bpu ON b.[BuildingPredominateUseId] = bpu.[Id] -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [Date] - FROM dbo.[BuildingEvaluations] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- Assessed - ORDER BY [Date] DESC -) AS eim -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 1 -- Market - ORDER BY [FiscalYear] DESC -) AS fe -OUTER APPLY ( - SELECT TOP 1 - [Value] - , [FiscalYear] - FROM dbo.[BuildingFiscals] - WHERE [BuildingId] = b.[Id] - AND [Key] = 0 -- NetBook - ORDER BY [FiscalYear] DESC -) AS fn diff --git a/backend/dal/Migrations/v01.17.00/Down/PostDown/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.17.00/Down/PostDown/01-NotificationTemplates.sql deleted file mode 100644 index cda172b76c..0000000000 --- a/backend/dal/Migrations/v01.17.00/Down/PostDown/01-NotificationTemplates.sql +++ /dev/null @@ -1,6 +0,0 @@ -PRINT 'Updating NotificationTemplates' - --- Replace the instances thats shows Chris Seltenrich with Yvonne Deibert -UPDATE [pims].dbo.[NotificationTemplates] -SET [Body] = REPLACE([Body],'Chris Seltenrich A/Executive Director of the Strategic Real Estate Services Branch at 778-698-3195', 'Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348') -WHERE [Body] LIKE '%Chris Seltenrich A/Executive Director of the Strategic Real Estate Services Branch at 778-698-3195%'; diff --git a/backend/dal/Migrations/v01.17.00/Up/PostUp/01-NotificationTemplates.sql b/backend/dal/Migrations/v01.17.00/Up/PostUp/01-NotificationTemplates.sql deleted file mode 100644 index fc166d8885..0000000000 --- a/backend/dal/Migrations/v01.17.00/Up/PostUp/01-NotificationTemplates.sql +++ /dev/null @@ -1,8 +0,0 @@ -PRINT 'Updating NotificationTemplates' - --- Replace the instances thats shows Yvonne Deibert with Chris Seltenrich -UPDATE [pims].dbo.[NotificationTemplates] -SET [Body] = REPLACE([Body], 'Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348', 'Chris Seltenrich A/Executive Director of the Strategic Real Estate Services Branch at 778-698-3195') -WHERE [Body] LIKE '%Yvonne Deibert, Executive Director of the Strategic Real Estate Services Branch at 250-387-6348%'; - - diff --git a/backend/dal/Migrations/v01.18.00/Up/PostUp/01-BuildingEvaluations.sql b/backend/dal/Migrations/v01.18.00/Up/PostUp/01-BuildingEvaluations.sql deleted file mode 100644 index 737fbea0fa..0000000000 --- a/backend/dal/Migrations/v01.18.00/Up/PostUp/01-BuildingEvaluations.sql +++ /dev/null @@ -1,11 +0,0 @@ -PRINT 'Updating Building and Parcel Evaluations' - --- Update the records that were created or updated after April 1, 2022 which have a fiscal year/date in 2021 -UPDATE [pims].[dbo].[BuildingEvaluations] -SET Date = DATEADD(year, 1, Date) -WHERE (CreatedOn >= '2022-04-01' AND Date = '2021-01-01') OR (UpdatedOn >= '2022-04-01' AND Date = '2021-01-01'); - -UPDATE [pims].[dbo].[ParcelEvaluations] -SET Date = DATEADD(year, 1, Date) - WHERE ((CreatedOn >= '2022-04-01' AND Date = '2021-01-01') OR (UpdatedOn >= '2022-04-01' AND Date = '2021-01-01')) - AND (ParcelId NOT IN (9734, 6427)); \ No newline at end of file diff --git a/backend/dal/Migrations/v01.18.01/Up/PostUp/01-ProjectStatusTransitions.sql b/backend/dal/Migrations/v01.18.01/Up/PostUp/01-ProjectStatusTransitions.sql deleted file mode 100644 index a715d3c330..0000000000 --- a/backend/dal/Migrations/v01.18.01/Up/PostUp/01-ProjectStatusTransitions.sql +++ /dev/null @@ -1,308 +0,0 @@ -PRINT 'Adding ProjectStatusTransitions - ASSESS-EX-DISPOSAL AP_!SPL -> Disposed' - -IF NOT EXISTS ( - SELECT * - FROM dbo.[WorkflowProjectStatus] - WHERE [WorkflowId] = 4 - AND [StatusId] = 32 -) -BEGIN - INSERT INTO dbo.[WorkflowProjectStatus] ( - [WorkflowId] - , [StatusId] - , [IsOptional] - , [SortOrder] - ) VALUES ( - 4 -- ASSESS-EX-DISPOSAL - , 32 -- Disposed - , 1 - , 3 - ) -END - -IF NOT EXISTS ( - SELECT * - FROM dbo.[ProjectStatusTransitions] - WHERE [FromWorkflowId] = 4 - AND [FromStatusId] = 22 - AND [ToWorkflowId] = 4 - AND [ToStatusId] = 32 - ) -BEGIN - INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [ToWorkflowId] - , [ToStatusId] - , [Action] - , [ValidateTasks] - ) VALUES ( - 4 -- ASSESS-EX-DISPOSAL - , 22 -- AP_!SPL - , 4 -- ASSESS-EX-DISPOSAL - , 32 -- Disposed - , 'Dispose Project' - , 0 - ) -END - -PRINT 'Adding ProjectStatusTransitions - ASSESS-EX-DISPOSAL !SPL -> T-GRE' - -IF NOT EXISTS ( - SELECT * - FROM dbo.[WorkflowProjectStatus] - WHERE [WorkflowId] = 4 - AND [StatusId] = 20 -) -BEGIN - INSERT INTO dbo.[WorkflowProjectStatus] ( - [WorkflowId] - , [StatusId] - , [IsOptional] - , [SortOrder] - ) VALUES ( - 4 -- ASSESS-EX-DISPOSAL - , 20 -- T-GRE - , 1 - , 2 - ) -END - -IF NOT EXISTS ( - SELECT * - FROM dbo.[ProjectStatusTransitions] - WHERE [FromWorkflowId] = 4 - AND [FromStatusId] = 22 - AND [ToWorkflowId] = 4 - AND [ToStatusId] = 20 - ) -BEGIN - INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [ToWorkflowId] - , [ToStatusId] - , [Action] - , [ValidateTasks] - ) VALUES ( - 4 -- ASSESS-EX-DISPOSAL - , 22 -- AP_!SPL - , 4 -- ASSESS-EX-DISPOSAL - , 20 -- T-GRE - , 'Transfer within GRE' - , 0 - ) -END - - -PRINT 'Adding ProjectStatusTransitions - ERP/!SPL -> Disposed' - -IF NOT EXISTS ( - SELECT * - FROM dbo.[WorkflowProjectStatus] - WHERE [WorkflowId] = 5 - AND [StatusId] = 32 -) -BEGIN - INSERT INTO dbo.[WorkflowProjectStatus] ( - [WorkflowId] - , [StatusId] - , [IsOptional] - , [SortOrder] - ) VALUES ( - 5 -- ERP - , 32 -- Disposed - , 1 - , 6 - ) -END - -IF NOT EXISTS ( - SELECT * - FROM dbo.[ProjectStatusTransitions] - WHERE [FromWorkflowId] = 5 - AND [FromStatusId] = 22 - AND [ToWorkflowId] = 5 - AND [ToStatusId] = 32 - ) -BEGIN - INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [ToWorkflowId] - , [ToStatusId] - , [Action] - , [ValidateTasks] - ) VALUES ( - 5 -- ERP - , 22 -- AP_!SPL - , 5 -- ERP - , 32 -- Disposed - , 'Dispose Project' - , 0 - ) -END - -PRINT 'Adding ProjectStatusTransitions - ERP/!SPL -> T-GRE' - -IF NOT EXISTS ( - SELECT * - FROM dbo.[WorkflowProjectStatus] - WHERE [WorkflowId] = 5 - AND [StatusId] = 20 -) -BEGIN - INSERT INTO dbo.[WorkflowProjectStatus] ( - [WorkflowId] - , [StatusId] - , [IsOptional] - , [SortOrder] - ) VALUES ( - 5 -- ERP - , 20 -- T-GRE - , 1 - , 5 - ) -END - -IF NOT EXISTS ( - SELECT * - FROM dbo.[ProjectStatusTransitions] - WHERE [FromWorkflowId] = 5 - AND [FromStatusId] = 22 - AND [ToWorkflowId] = 5 - AND [ToStatusId] = 20 - ) -BEGIN - INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [ToWorkflowId] - , [ToStatusId] - , [Action] - , [ValidateTasks] - ) VALUES ( - 5 -- ERP - , 22 -- AP_!SPL - , 5 -- ERP - , 20 -- T-GRE - , 'Transfer within GRE' - , 0 - ) -END - -PRINT 'Adding ProjectStatusTransitions - SPL/!SPL -> Disposed' - -IF NOT EXISTS ( - SELECT * - FROM dbo.[WorkflowProjectStatus] - WHERE [WorkflowId] = 6 - AND [StatusId] = 22 -) -BEGIN - INSERT INTO dbo.[WorkflowProjectStatus] ( - [WorkflowId] - , [StatusId] - , [IsOptional] - , [SortOrder] - ) VALUES ( - 6 -- SPL - , 22 -- AP_!SPL - , 1 - , 6 - ) -END - -IF NOT EXISTS ( - SELECT * - FROM dbo.[WorkflowProjectStatus] - WHERE [WorkflowId] = 6 - AND [StatusId] = 32 -) -BEGIN - INSERT INTO dbo.[WorkflowProjectStatus] ( - [WorkflowId] - , [StatusId] - , [IsOptional] - , [SortOrder] - ) VALUES ( - 6 -- SPL - , 32 -- Disposed - , 1 - , 6 - ) -END - -IF NOT EXISTS ( - SELECT * - FROM dbo.[ProjectStatusTransitions] - WHERE [FromWorkflowId] = 6 - AND [FromStatusId] = 22 - AND [ToWorkflowId] = 6 - AND [ToStatusId] = 32 - ) -BEGIN - INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [ToWorkflowId] - , [ToStatusId] - , [Action] - , [ValidateTasks] - ) VALUES ( - 6 -- SPL - , 22 -- AP_!SPL - , 6 -- SPL - , 32 -- Disposed - , 'Dispose Project' - , 0 - ) -END - -PRINT 'Adding ProjectStatusTransitions - SPL/!SPL -> T-GRE' - -IF NOT EXISTS ( - SELECT * - FROM dbo.[WorkflowProjectStatus] - WHERE [WorkflowId] = 6 - AND [StatusId] = 20 -) -BEGIN - INSERT INTO dbo.[WorkflowProjectStatus] ( - [WorkflowId] - , [StatusId] - , [IsOptional] - , [SortOrder] - ) VALUES ( - 6 -- SPL - , 20 -- T-GRE - , 1 - , 5 - ) -END - -IF NOT EXISTS ( - SELECT * - FROM dbo.[ProjectStatusTransitions] - WHERE [FromWorkflowId] = 6 - AND [FromStatusId] = 22 - AND [ToWorkflowId] = 6 - AND [ToStatusId] = 20 - ) -BEGIN - INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [ToWorkflowId] - , [ToStatusId] - , [Action] - , [ValidateTasks] - ) VALUES ( - 6 -- SPL - , 22 -- AP_!SPL - , 6 -- SPL - , 20 -- T-GRE - , 'Transfer within GRE' - , 0 - ) -END diff --git a/backend/dal/Migrations/v01.18.02/Up/PostUp/01-ProjectStatusTransition.sql b/backend/dal/Migrations/v01.18.02/Up/PostUp/01-ProjectStatusTransition.sql deleted file mode 100644 index 5de4ea14aa..0000000000 --- a/backend/dal/Migrations/v01.18.02/Up/PostUp/01-ProjectStatusTransition.sql +++ /dev/null @@ -1,514 +0,0 @@ -PRINT 'Adding ProjectStatusTransitions - ASSESS-EX-DISPOSAL -> Disposed' - -IF NOT EXISTS ( - SELECT * - FROM dbo.[WorkflowProjectStatus] - WHERE [WorkflowId] = 4 - AND [StatusId] = 32 -) -BEGIN - INSERT INTO dbo.[WorkflowProjectStatus] ( - [WorkflowId] - , [StatusId] - , [IsOptional] - , [SortOrder] - ) VALUES ( - 4 -- ASSESS-EX-DISPOSAL - , 32 -- Disposed - , 1 - , 4 - ) -END - -IF NOT EXISTS ( - SELECT * - FROM dbo.[ProjectStatusTransitions] - WHERE [FromWorkflowId] = 4 - AND [FromStatusId] = 15 - AND [ToWorkflowId] = 4 - AND [ToStatusId] = 32 - ) -BEGIN - INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [ToWorkflowId] - , [ToStatusId] - , [Action] - , [ValidateTasks] - ) VALUES ( - 4 -- ASSESS-EX-DISPOSAL - , 15 -- AP-EXE - , 4 -- ASSESS-EX-DISPOSAL - , 32 -- Disposed - , 'Dispose Project' - , 0 - ) -END - -PRINT 'Adding ProjectStatusTransitions - ASSESS-EX-DISPOSAL AP-!SPL -> AP-ERP' - -IF NOT EXISTS ( - SELECT * - FROM dbo.[WorkflowProjectStatus] - WHERE [WorkflowId] = 4 - AND [StatusId] = 32 -) -BEGIN - INSERT INTO dbo.[WorkflowProjectStatus] ( - [WorkflowId] - , [StatusId] - , [IsOptional] - , [SortOrder] - ) VALUES ( - 4 -- ASSESS-EX-DISPOSAL - , 14 -- AP-ERP - , 1 - , 2 - ) -END - -IF NOT EXISTS ( - SELECT * - FROM dbo.[ProjectStatusTransitions] - WHERE [FromWorkflowId] = 4 - AND [FromStatusId] = 22 - AND [ToWorkflowId] = 5 - AND [ToStatusId] = 14 - ) -BEGIN - INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [ToWorkflowId] - , [ToStatusId] - , [Action] - , [ValidateTasks] - ) VALUES ( - 4 -- ASSESS-EX-DISPOSAL - , 22 -- AP-!SPL - , 5 -- ERP - , 14 -- AP-ERP - , 'Approve for Enhanced Referral Process' - , 0 - ) -END - -PRINT 'Adding ProjectStatusTransitions - ASSESS-EX-DISPOSAL AP-!SPL -> AP-SPL' - -IF NOT EXISTS ( - SELECT * - FROM dbo.[WorkflowProjectStatus] - WHERE [WorkflowId] = 4 - AND [StatusId] = 32 -) -BEGIN - INSERT INTO dbo.[WorkflowProjectStatus] ( - [WorkflowId] - , [StatusId] - , [IsOptional] - , [SortOrder] - ) VALUES ( - 4 -- ASSESS-EX-DISPOSAL - , 21 -- AP-SPL - , 1 - , 3 - ) -END - -IF NOT EXISTS ( - SELECT * - FROM dbo.[ProjectStatusTransitions] - WHERE [FromWorkflowId] = 4 - AND [FromStatusId] = 22 - AND [ToWorkflowId] = 6 - AND [ToStatusId] = 21 - ) -BEGIN - INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [ToWorkflowId] - , [ToStatusId] - , [Action] - , [ValidateTasks] - ) VALUES ( - 4 -- ASSESS-EX-DISPOSAL - , 22 -- AP-!SPL - , 6 -- SPL - , 21 -- AP-SPL - , 'Approve for SPL' - , 0 - ) -END - -PRINT 'Adding ProjectStatusTransitions - ASSESS-EX-DISPOSAL AP-!SPL -> Cancelled' - -IF NOT EXISTS ( - SELECT * - FROM dbo.[WorkflowProjectStatus] - WHERE [WorkflowId] = 4 - AND [StatusId] = 32 -) -BEGIN - INSERT INTO dbo.[WorkflowProjectStatus] ( - [WorkflowId] - , [StatusId] - , [IsOptional] - , [SortOrder] - ) VALUES ( - 4 -- ASSESS-EX-DISPOSAL - , 23 -- Cancelled - , 1 - , 3 - ) -END - -IF NOT EXISTS ( - SELECT * - FROM dbo.[ProjectStatusTransitions] - WHERE [FromWorkflowId] = 4 - AND [FromStatusId] = 22 - AND [ToWorkflowId] = 4 - AND [ToStatusId] = 23 - ) -BEGIN - INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [ToWorkflowId] - , [ToStatusId] - , [Action] - , [ValidateTasks] - ) VALUES ( - 4 -- ASSESS-EX-DISPOSAL - , 22 -- AP-!SPL - , 4 -- ASSESS-EX-DISPOSAL - , 23 -- Cancelled - , 'Cancel Project' - , 0 - ) -END - -PRINT 'Adding ProjectStatusTransitions - SPL Market -> Pre-Market' - -IF NOT EXISTS ( - SELECT * - FROM dbo.[WorkflowProjectStatus] - WHERE [WorkflowId] = 6 - AND [StatusId] = 40 -) -BEGIN - INSERT INTO dbo.[WorkflowProjectStatus] ( - [WorkflowId] - , [StatusId] - , [IsOptional] - , [SortOrder] - ) VALUES ( - 6 -- SPL - , 40 -- PSL-PM - , 1 - , 2 - ) -END - -IF NOT EXISTS ( - SELECT * - FROM dbo.[ProjectStatusTransitions] - WHERE [FromWorkflowId] = 6 - AND [FromStatusId] = 41 - AND [ToWorkflowId] = 6 - AND [ToStatusId] = 40 - ) -BEGIN - INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [ToWorkflowId] - , [ToStatusId] - , [Action] - , [ValidateTasks] - ) VALUES ( - 6 -- SPL - , 41 -- PSL-M - , 6 -- SPL - , 40 -- PSL-PM - , 'Return to Pre-Marketing' - , 0 - ) -END - -PRINT 'Adding ProjectStatusTransitions - SPL AP-SPL -> AP_!SPL' - -IF NOT EXISTS ( - SELECT * - FROM dbo.[WorkflowProjectStatus] - WHERE [WorkflowId] = 6 - AND [StatusId] = 22 -) -BEGIN - INSERT INTO dbo.[WorkflowProjectStatus] ( - [WorkflowId] - , [StatusId] - , [IsOptional] - , [SortOrder] - ) VALUES ( - 6 -- SPL - , 22 -- AP_!SPL - , 1 - , 6 - ) -END - -IF NOT EXISTS ( - SELECT * - FROM dbo.[ProjectStatusTransitions] - WHERE [FromWorkflowId] = 6 - AND [FromStatusId] = 21 - AND [ToWorkflowId] = 6 - AND [ToStatusId] = 22 - ) -BEGIN - INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [ToWorkflowId] - , [ToStatusId] - , [Action] - , [ValidateTasks] - ) VALUES ( - 6 -- SPL - , 21 -- AP-SPL - , 6 -- SPL - , 22 -- AP_!SPL - , 'Remove from SPL' - , 0 - ) -END - -PRINT 'Adding ProjectStatusTransitions - SPL SPL-PM -> AP_!SPL' - -IF NOT EXISTS ( - SELECT * - FROM dbo.[ProjectStatusTransitions] - WHERE [FromWorkflowId] = 6 - AND [FromStatusId] = 40 - AND [ToWorkflowId] = 6 - AND [ToStatusId] = 22 - ) -BEGIN - INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [ToWorkflowId] - , [ToStatusId] - , [Action] - , [ValidateTasks] - ) VALUES ( - 6 -- SPL - , 40 -- SPL-PM - , 6 -- SPL - , 22 -- AP_!SPL - , 'Remove from SPL' - , 0 - ) -END - -PRINT 'Adding ProjectStatusTransitions - SPL SPL-M -> AP_!SPL' - -IF NOT EXISTS ( - SELECT * - FROM dbo.[ProjectStatusTransitions] - WHERE [FromWorkflowId] = 6 - AND [FromStatusId] = 41 - AND [ToWorkflowId] = 5 - AND [ToStatusId] = 22 - ) -BEGIN - INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [ToWorkflowId] - , [ToStatusId] - , [Action] - , [ValidateTasks] - ) VALUES ( - 6 -- SPL - , 41 -- SPL-M - , 5 -- ERP - , 22 -- AP-!SPL - , 'Remove from SPL' - , 0 - ) -END - -PRINT 'Adding ProjectStatusTransitions - SPL AP-!SPL -> AP-SPL' - -IF NOT EXISTS ( - SELECT * - FROM dbo.[WorkflowProjectStatus] - WHERE [WorkflowId] = 6 - AND [StatusId] = 21 -) -BEGIN - INSERT INTO dbo.[WorkflowProjectStatus] ( - [WorkflowId] - , [StatusId] - , [IsOptional] - , [SortOrder] - ) VALUES ( - 6 -- SPL - , 21 -- AP-SPL - , 1 - , 6 - ) -END - -IF NOT EXISTS ( - SELECT * - FROM dbo.[ProjectStatusTransitions] - WHERE [FromWorkflowId] = 5 - AND [FromStatusId] = 22 - AND [ToWorkflowId] = 6 - AND [ToStatusId] = 21 - ) -BEGIN - INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [ToWorkflowId] - , [ToStatusId] - , [Action] - , [ValidateTasks] - ) VALUES ( - 5 -- ERP - , 22 -- AP-!SPL - , 6 -- SPL - , 21 -- AP-SPL - , 'Approved for SPL' - , 0 - ) -END - -PRINT 'Adding ProjectStatusTransitions - SPL AP-!SPL -> AP-ERP' - -IF NOT EXISTS ( - SELECT * - FROM dbo.[WorkflowProjectStatus] - WHERE [WorkflowId] = 6 - AND [StatusId] = 14 -) -BEGIN - INSERT INTO dbo.[WorkflowProjectStatus] ( - [WorkflowId] - , [StatusId] - , [IsOptional] - , [SortOrder] - ) VALUES ( - 6 -- SPL - , 14 -- AP-ERP - , 1 - , 6 - ) -END - -IF NOT EXISTS ( - SELECT * - FROM dbo.[ProjectStatusTransitions] - WHERE [FromWorkflowId] = 5 - AND [FromStatusId] = 22 - AND [ToWorkflowId] = 5 - AND [ToStatusId] = 14 - ) -BEGIN - INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [ToWorkflowId] - , [ToStatusId] - , [Action] - , [ValidateTasks] - ) VALUES ( - 5 -- ERP - , 22 -- AP-!SPL - , 5 -- ERP - , 14 -- AP-ERP - , 'Approved for ERP' - , 0 - ) -END - -PRINT 'Adding ProjectStatusTransitions - AP-SPL -> AP-!SPL' - -IF NOT EXISTS ( - SELECT * - FROM dbo.[ProjectStatusTransitions] - WHERE [FromWorkflowId] = 6 - AND [FromStatusId] = 21 - AND [ToWorkflowId] = 5 - AND [ToStatusId] = 22 - ) -BEGIN - INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [ToWorkflowId] - , [ToStatusId] - , [Action] - , [ValidateTasks] - ) VALUES ( - 6 -- SPL - , 21 -- AP-SPL - , 5 -- ERP - , 22 -- AP-!SPL - , 'Remove from SPL' - , 0 - ) -END - -PRINT 'Adding ProjectStatusTransitions - SPL-PM -> AP-!SPL' - -IF NOT EXISTS ( - SELECT * - FROM dbo.[ProjectStatusTransitions] - WHERE [FromWorkflowId] = 6 - AND [FromStatusId] = 40 - AND [ToWorkflowId] = 5 - AND [ToStatusId] = 22 - ) -BEGIN - INSERT INTO dbo.[ProjectStatusTransitions] ( - [FromWorkflowId] - , [FromStatusId] - , [ToWorkflowId] - , [ToStatusId] - , [Action] - , [ValidateTasks] - ) VALUES ( - 6 -- SPL - , 40 -- SPL-PM - , 5 -- ERP - , 22 -- AP-!SPL - , 'Remove from SPL' - , 0 - ) -END - -PRINT 'Transition any SPL AP-!SPL -> ERP AP-!SPL' - -UPDATE dbo.[Projects] -SET [WorkflowId] = 5 -- ERP -WHERE [WorkflowId] = 6 -- SPL - AND [StatusId] = 22 -- AP-!SPL - -PRINT 'Remove ProjectStatusTransitions - ANYTHING -> SPL AP-!SPL' - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [ToWorkflowId] = 6 -- SPL - AND [ToStatusId] = 22 -- AP-!SPL - -PRINT 'Remove ProjectStatusTransitions - SPL AP-!SPL -> ANYTHING' - -DELETE FROM dbo.[ProjectStatusTransitions] -WHERE [FromWorkflowId] = 6 -- SPL - AND [FromStatusId] = 22 -- AP-!SPL diff --git a/backend/dal/Migrations/v02.01.00/Up/PostUp/01-ProjectStatus.sql b/backend/dal/Migrations/v02.01.00/Up/PostUp/01-ProjectStatus.sql deleted file mode 100644 index edd004fe0c..0000000000 --- a/backend/dal/Migrations/v02.01.00/Up/PostUp/01-ProjectStatus.sql +++ /dev/null @@ -1,6 +0,0 @@ -PRINT 'Updating ProjectStatus' - -UPDATE [pims].[dbo].[ProjectStatus] -SET Description = REPLACE(Description, 'Surplus Property Program', 'Surplus Properties Program') -WHERE Description LIKE '%Surplus Property Program%' -AND IsMilestone = 1 \ No newline at end of file diff --git a/backend/dal/Migrations/v02.03.09/Up/PostUp/01-Roles.sql b/backend/dal/Migrations/v02.03.09/Up/PostUp/01-Roles.sql deleted file mode 100644 index badaa10f80..0000000000 --- a/backend/dal/Migrations/v02.03.09/Up/PostUp/01-Roles.sql +++ /dev/null @@ -1,19 +0,0 @@ -PRINT 'Adding Roles' -INSERT INTO - dbo.[Roles] ( - [Id], - [Name], - [Description], - [IsPublic], - [IsDisabled], - [SortOrder] - ) -VALUES - ( - '17bc599d-268f-41d1-b326-6fbbe1a41c9b', - 'View Only Properties', - 'Ability to View all agency properties.', - 0, - 0, - 0 - ) diff --git a/backend/dal/Migrations/v02.06.14/Up/PostUp/01-NotificationTemplates.sql b/backend/dal/Migrations/v02.06.14/Up/PostUp/01-NotificationTemplates.sql deleted file mode 100644 index b260cdd812..0000000000 --- a/backend/dal/Migrations/v02.06.14/Up/PostUp/01-NotificationTemplates.sql +++ /dev/null @@ -1,7 +0,0 @@ -PRINT 'Updating NotificationTemplates' - --- Replace the instances of old pdf link with the new one -UPDATE [pims].dbo.[NotificationTemplates] -SET [Body] = REPLACE([Body], 'https://intranet.gov.bc.ca/assets/intranet/mtics/real-property/sres/process_manual_for_the_surplus_properties_program_-_feb_2020_-_version_2.pdf', 'https://intranet.gov.bc.ca/assets/intranet/mtics/real-property/who-we-are/branch-sres/process_manual_for_the_surplus_properties_program_-_feb_2020_-_version_2.pdf') -WHERE Body LIKE '%https://intranet.gov.bc.ca/assets/intranet/mtics/real-property/sres/process_manual_for_the_surplus_properties_program_-_feb_2020_-_version_2.pdf%'; - diff --git a/backend/dal/Migrations/v02.07.00/Up/PostUp/01-AdministrativeAreas.sql b/backend/dal/Migrations/v02.07.00/Up/PostUp/01-AdministrativeAreas.sql deleted file mode 100644 index 53924000fe..0000000000 --- a/backend/dal/Migrations/v02.07.00/Up/PostUp/01-AdministrativeAreas.sql +++ /dev/null @@ -1,33 +0,0 @@ -PRINT 'Update AdministrativeAreas' - --- Insert the new regional districts into the AdministrativeAreas tsble. -INSERT INTO dbo.[AdministrativeAreas] ([Name], [Abbreviation]) -VALUES -('Regional District of Bulkley-Nechako', 'RDBN'), -('Cariboo Regional District', 'CRD'), -('Regional District of Fraser-Fort George', 'RDFFG'), -('Regional District of Kitimat-Stikine', 'RDKS'), -('Peace River Regional District', 'PRRD'), -('North Coast Regional District', 'NCRD'), -('Regional District of Central Okanagan', 'RDCO'), -('Fraser Valley Regional District', 'FVRD'), -('Metro Vancouver Regional District', 'MVRD'), -('Regional District of Okanagan-Similkameen', 'RDOS'), -('Squamish-Lillooet Regional District', 'SLRD'), -('Thompson-Nicola Regional District', 'TNRD'), -('Regional District of Central Kootenay', 'RDCK'), -('Columbia Shuswap Regional District', 'CSRD'), -('Regional District of East Kootenay', 'RDEK'), -('Regional District of Kootenay Boundary', 'RDKB'), -('Regional District of North Okanagan', 'RDNO'), -('Regional District of Alberni-Clayoquot', 'RDAC'), -('Capital Regional District', 'CAPRD'), -('Central Coast Regional District', 'CCRD'), -('Comox Valley Regional District', 'CMXRD'), -('Cowichan Valley Regional District', 'CVRD'), -('Regional District of Mount Waddington', 'RDMW'), -('Regional District of Nanaimo', 'RDN'), -('qathet Regional District', 'qRD'), -('Sunshine Coast Regional District', 'SCRD'), -('Strathcona Regional District', 'STRD'), -('Stikine Region (Unincorporated)', 'STIK'); \ No newline at end of file diff --git a/backend/dal/Migrations/v02.07.01/Up/PostUp/01-AdministrativeAreas.sql b/backend/dal/Migrations/v02.07.01/Up/PostUp/01-AdministrativeAreas.sql deleted file mode 100644 index 1863b2e405..0000000000 --- a/backend/dal/Migrations/v02.07.01/Up/PostUp/01-AdministrativeAreas.sql +++ /dev/null @@ -1,5 +0,0 @@ -PRINT 'Update Stikine Region' - -UPDATE AdministrativeAreas -SET Name = 'Stikine Region' -WHERE Name = 'Stikine Region (Unincorporated)'; diff --git a/backend/dal/Options/AccessRequestOptions.cs b/backend/dal/Options/AccessRequestOptions.cs deleted file mode 100644 index c91a7dbb33..0000000000 --- a/backend/dal/Options/AccessRequestOptions.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace Pims.Dal -{ - /// - /// AccessRequestOptions class, provides a way to configure PIMS environments. - /// - public class AccessRequestOptions - { - #region Properties - /// - /// get/set - The notification template name that will be used when sending an email to administrators. - /// - public string NotificationTemplate { get; set; } = "Access Request"; - - /// - /// get/set - The notification template name that will be used when sending an email to administrators. - /// - public string RPDNotificationTemplate { get; set; } = "Access Request RPD Mailbox"; - - /// - /// get/set - Email address to send access requests to in addition to system and agency administrators. - /// - public string SendTo { get; set; } - #endregion - } -} diff --git a/backend/dal/Options/EnvironmentOptions.cs b/backend/dal/Options/EnvironmentOptions.cs deleted file mode 100644 index 0dcada3a29..0000000000 --- a/backend/dal/Options/EnvironmentOptions.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; - -namespace Pims.Dal -{ - /// - /// EnvironmentOptions class, provides a way to configure PIMS environments. - /// - public class EnvironmentOptions - { - #region Properties - /// - /// get/set - The application URI. - /// - public Uri Uri { get; set; } - - /// - /// get/set - The environment name. - /// - public string Name { get; set; } - - /// - /// get/set - The application title. - /// - public string Title { get; set; } - #endregion - } -} diff --git a/backend/dal/Options/NotificationOptions.cs b/backend/dal/Options/NotificationOptions.cs deleted file mode 100644 index e8b680f071..0000000000 --- a/backend/dal/Options/NotificationOptions.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Pims.Dal -{ - /// - /// NotificationOptions class, provides a way to configure notification settings. - /// - public class NotificationOptions - { - #region Properties - /// - /// get/set - Whether to throw exceptions when they occur. - /// - public bool ThrowExceptions { get; set; } - #endregion - } -} diff --git a/backend/dal/Options/PimsOptions.cs b/backend/dal/Options/PimsOptions.cs deleted file mode 100644 index d0d69d8ece..0000000000 --- a/backend/dal/Options/PimsOptions.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.EntityFrameworkCore; - -namespace Pims.Dal -{ - /// - /// PimsOptions class, provides a way to configure the data access layer. - /// - public class PimsOptions : DbContextOptions - { - #region Properties - /// - /// get/set - Service account configuration details. - /// - public ServiceAccountOptions ServiceAccount { get; set; } = new ServiceAccountOptions(); - - /// - /// get/set - Global project configuration settings. - /// - public ProjectOptions Project { get; set; } = new ProjectOptions(); - - /// - /// get/set - Environmental configuration settings. - /// These are included in the notifications model. - /// - public EnvironmentOptions Environment { get; set; } = new EnvironmentOptions(); - - /// - /// get/set - Access request configuration settings. - /// - public AccessRequestOptions AccessRequest { get; set; } = new AccessRequestOptions(); - - /// - /// get/set - Notification configuration settings. - /// - public NotificationOptions Notifications { get; set; } = new NotificationOptions(); - #endregion - } -} diff --git a/backend/dal/Options/ProjectOptions.cs b/backend/dal/Options/ProjectOptions.cs deleted file mode 100644 index a59a9fe9de..0000000000 --- a/backend/dal/Options/ProjectOptions.cs +++ /dev/null @@ -1,30 +0,0 @@ -namespace Pims.Dal -{ - /// - /// ProjectOptions class, provides a way to configure projects. - /// - public class ProjectOptions - { - #region Properties - /// - /// get/set - The format for draft project numbers. - /// - public string DraftFormat { get; set; } = "DRAFT-{0:00000}"; - - /// - /// get/set - The format for submitted project numbers. - /// - public string NumberFormat { get; set; } = "SPP-{0:00000}"; - - /// - /// get/set - An array of workflow codes that represent the assessment stage. - /// - public string[] AssessmentWorkflows { get; set; } - - /// - /// get/set - An array of workflow codes that are used for drafting projects. - /// - public string[] DraftWorkflows { get; set; } - #endregion - } -} diff --git a/backend/dal/Options/ServiceAccountOptions.cs b/backend/dal/Options/ServiceAccountOptions.cs deleted file mode 100644 index e9bcc6cf3f..0000000000 --- a/backend/dal/Options/ServiceAccountOptions.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Pims.Dal -{ - public class ServiceAccountOptions - { - #region Properties - public string Username { get; set; } = "service-account"; - public string FirstName { get; set; } = "service"; - public string LastName { get; set; } = "account"; - public string Email { get; set; } - #endregion - } -} diff --git a/backend/dal/PIMSContext.cs b/backend/dal/PIMSContext.cs deleted file mode 100644 index ef9a3fdcaf..0000000000 --- a/backend/dal/PIMSContext.cs +++ /dev/null @@ -1,235 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Options; -using Pims.Core.Extensions; -using Pims.Dal.Configuration; -using Pims.Dal.Entities; -using Pims.Dal.Helpers.Migrations; -using System; -using System.Linq; -using System.Text.Json; - -namespace Pims.Dal -{ - /// - /// PimsContext class, provides a data context to manage the datasource for the PIMS application. - /// - public class PimsContext : DbContext - { - #region Variables - private readonly IHttpContextAccessor _httpContextAccessor; - private readonly JsonSerializerOptions _serializerOptions; - #endregion - - #region Properties - #region Tables - public DbSet AccessRequests { get; set; } - public DbSet UserAgencies { get; set; } - public DbSet Agencies { get; set; } - public DbSet Users { get; set; } - public DbSet Roles { get; set; } - public DbSet Claims { get; set; } - - #region Properties - public DbSet
Addresses { get; set; } - public DbSet Buildings { get; set; } - public DbSet BuildingEvaluations { get; set; } - public DbSet BuildingFiscals { get; set; } - public DbSet BuildingConstructionTypes { get; set; } - public DbSet BuildingPredominateUses { get; set; } - public DbSet BuildingOccupantTypes { get; set; } - public DbSet Parcels { get; set; } - public DbSet ParcelParcels { get; set; } - public DbSet ParcelEvaluations { get; set; } - public DbSet ParcelFiscals { get; set; } - public DbSet PropertyClassifications { get; set; } - public DbSet PropertyTypes { get; set; } - public DbSet Provinces { get; set; } - public DbSet AdministrativeAreas { get; set; } - public DbSet ParcelBuildings { get; set; } - #endregion - - #region Projects - public DbSet Projects { get; set; } - public DbSet ProjectNumbers { get; set; } - public DbSet ProjectSnapshots { get; set; } - public DbSet ProjectStatusHistory { get; set; } - - public DbSet ProjectReports { get; set; } - public DbSet ProjectStatus { get; set; } - public DbSet ProjectRisks { get; set; } - public DbSet ProjectProperties { get; set; } - public DbSet ProjectNotes { get; set; } - public DbSet ProjectTasks { get; set; } - public DbSet TierLevels { get; set; } - public DbSet Tasks { get; set; } - public DbSet Workflows { get; set; } - public DbSet WorkflowProjectStatus { get; set; } - public DbSet NotificationTemplates { get; set; } - public DbSet ProjectStatusNotifications { get; set; } - public DbSet ProjectStatusTransitions { get; set; } - public DbSet ProjectAgencyResponses { get; set; } - public DbSet NotificationQueue { get; set; } - #endregion - #endregion - - #region Views - public DbSet Properties { get; set; } - #endregion - #endregion - - #region Constructors - /// - /// Creates a new instance of a PimsContext class. - /// - /// - public PimsContext() - { - - } - - /// - /// Creates a new instance of a PimsContext class. - /// - /// - /// - /// - /// - public PimsContext(DbContextOptions options, IHttpContextAccessor httpContextAccessor = null, IOptions serializerOptions = null) : base(options) - { - _httpContextAccessor = httpContextAccessor; - _serializerOptions = serializerOptions.Value; - } - #endregion - - #region Methods - /// - /// Configures the DbContext with the specified options. - /// - /// - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - { - if (!optionsBuilder.IsConfigured) - { - optionsBuilder.EnableSensitiveDataLogging(); - } - - base.OnConfiguring(optionsBuilder); - } - - /// - /// Creates the datasource. - /// - /// - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.ApplyAllConfigurations(typeof(AddressConfiguration), this); - - // TODO: Find a way to move this somewhere else. - // modelBuilder.Properties () - // .Configure (m => - // { - // m.HasColumnType ("DATETIME2"); - // if (m.Name == nameof (BaseEntity.CreatedOn)) - // { - // m.DefaultValueSql = "GETUTCDATE()"; - // } - // }); - - // foreach (var property in modelBuilder.Model.GetEntityTypes () - // .SelectMany (m => m.GetProperties ()) - // .Where (p => p.ClrType == typeof (DateTime))) - // { - // if (property.ClrType == typeof (DateTime)) - // { - // property.Relational ().ColumnType = "DATETIME2"; - - // if (property.Name == nameof (BaseEntity.CreatedOn)) - // { - // property.Relational ().DefaultValueSql = "GETUTCDATE()"; - // } - // } - // } - - base.OnModelCreating(modelBuilder); - } - - /// - /// Save the entities with who created them or updated them. - /// - /// - public override int SaveChanges() - { - // get entries that are being Added or Updated - var modifiedEntries = ChangeTracker.Entries() - .Where(x => (x.State == EntityState.Added || x.State == EntityState.Modified)); - var username = _httpContextAccessor.HttpContext.User != null ?_httpContextAccessor.HttpContext.User.GetUsername() : "sresfm"; - - var userId = this.Users.Where(u => u.Username == username).Select(u => u.Id).FirstOrDefault(); // TODO: Should add the User.Id to a claim so that it can be easily returned. - foreach (var entry in modifiedEntries) - { - if (entry.Entity is BaseEntity entity) - { - if (entry.State == EntityState.Added) - { - entity.CreatedById = userId; - entity.CreatedOn = DateTime.UtcNow; - } - else if (entry.State != EntityState.Deleted) - { - entity.UpdatedById = userId; - entity.UpdatedOn = DateTime.UtcNow; - } - } - } - - return base.SaveChanges(); - } - - /// - /// Wrap the save changes in a transaction for rollback. - /// - /// - public int CommitTransaction() - { - var result = 0; - using (var transaction = this.Database.BeginTransaction()) - { - try - { - result = this.SaveChanges(); - transaction.Commit(); - } - catch (DbUpdateException) - { - transaction.Rollback(); - throw; - } - } - return result; - } - - /// - /// Deserialize the specified 'json' to the specified type of 'T'. - /// - /// - /// - /// - public T Deserialize(string json) - { - return JsonSerializer.Deserialize(json, _serializerOptions); - } - - /// - /// Serialize the specified 'item'. - /// - /// - /// - /// - public string Serialize(T item) - { - return JsonSerializer.Serialize(item, _serializerOptions); - } - #endregion - } -} diff --git a/backend/dal/PIMSContextFactory.cs b/backend/dal/PIMSContextFactory.cs deleted file mode 100644 index 5ade65866a..0000000000 --- a/backend/dal/PIMSContextFactory.cs +++ /dev/null @@ -1,102 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Design; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Logging; -using Pims.Core.Extensions; -using System; -using System.Data.SqlClient; -using System.Diagnostics.CodeAnalysis; -using System.IO; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Pims.Dal -{ - /// - /// PimsContextFactory class, provides a way to use the design time tools (i.e. dotnet ef database update). - /// - [ExcludeFromCodeCoverage] - public class PimsContextFactory : IDesignTimeDbContextFactory - { - #region Variables - private readonly ILogger _logger; - #endregion - - #region Constructors - /// - /// Creates a new instance of a PimsContextFactory class. - /// - public PimsContextFactory() - { - var loggerFactory = LoggerFactory.Create(builder => - { - builder - .AddFilter("Microsoft", LogLevel.Warning) - .AddFilter("System", LogLevel.Warning) - .AddFilter("Pims.Api", LogLevel.Debug) - .AddConsole(); - // .AddEventLog(); - }); - _logger = loggerFactory.CreateLogger(); - } - #endregion - - #region Methods - /// - /// Create the database context so that the design time tools can connect to it. - /// - /// - /// - public PimsContext CreateDbContext(string[] args) - { - DotNetEnv.Env.Load(); - string environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"; - - // As per Microsoft documentation, a typical sequence of configuration providers is: - // 1. appsettings.json - // 2. appsettings.{Environment}.json - // 3. Secret Manager (if in development) - // 4. Environment variables using the Environment Variables configuration provider. - // 5. Command - line arguments using the Command-line configuration provider. - // source: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-3.1#configuration-providers - var builder = new ConfigurationBuilder() - .SetBasePath(Directory.GetCurrentDirectory()) - .AddJsonFile("connectionstrings.json", optional: true, reloadOnChange: true) - .AddJsonFile($"connectionstrings.{environment}.json", optional: true, reloadOnChange: true); - - if (!environment.IsProduction()) - { - builder.AddUserSecrets(); - } - - builder.AddEnvironmentVariables(); - - _logger.LogInformation("Context Factory Started"); - - var config = builder.Build(); - - var cs = config.GetConnectionString("PIMS"); - var sqlBuilder = new SqlConnectionStringBuilder(cs) - { - Password = config["DB_PASSWORD"] - }; - - var optionsBuilder = new DbContextOptionsBuilder(); - optionsBuilder.UseSqlServer(sqlBuilder.ConnectionString, options => - { - options.CommandTimeout((int)TimeSpan.FromMinutes(10).TotalSeconds); - options.UseNetTopologySuite(); - }); - - var serializerOptions = new JsonSerializerOptions() - { - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, - PropertyNamingPolicy = JsonNamingPolicy.CamelCase, - WriteIndented = true - }; - var optionsSerializer = Microsoft.Extensions.Options.Options.Create(serializerOptions); - return new PimsContext(optionsBuilder.Options, null, optionsSerializer); - } - #endregion - } -} diff --git a/backend/dal/Pims.Dal.csproj b/backend/dal/Pims.Dal.csproj deleted file mode 100644 index 1263f6ee1d..0000000000 --- a/backend/dal/Pims.Dal.csproj +++ /dev/null @@ -1,70 +0,0 @@ - - - - net7.0 - 17033af2-41c5-4100-a42e-4d11424b0cbb - Library - 1.0.0.0 - 1.0.0.0 - 6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3 - - - - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - - - - - - - - - PreserveNewest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/dal/PimsService.cs b/backend/dal/PimsService.cs deleted file mode 100644 index 37ceda1770..0000000000 --- a/backend/dal/PimsService.cs +++ /dev/null @@ -1,118 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Pims.Dal.Services; -using System; -using System.Security.Claims; - -namespace Pims.Dal -{ - /// - /// PimsService class, provides a encapsulated way to references all the independent services. - /// - public class PimsService : IPimsService - { - #region Variables - private readonly IServiceProvider _serviceProvider; - #endregion - - #region Properties - /// - /// get - The user calling the service. - /// - public ClaimsPrincipal Principal { get; } - - /// - /// get - The property services. - /// - public IPropertyService Property { get { return _serviceProvider.GetService(); } } - - /// - /// get - The building services. - /// - public IBuildingService Building { get { return _serviceProvider.GetService(); } } - - /// - /// get - The project services. - /// - public IProjectService Project { get { return _serviceProvider.GetService(); } } - - /// - /// get - The project report services. - /// - public IProjectReportService ProjectReport { get { return _serviceProvider.GetService(); } } - - /// - /// get - The lookup services. - /// - public ILookupService Lookup { get { return _serviceProvider.GetService(); } } - - /// - /// get - The parcel services. - /// - public IParcelService Parcel { get { return _serviceProvider.GetService(); } } - - /// - /// get - The user services. - /// - public IUserService User { get { return _serviceProvider.GetService(); } } - - /// - /// get - The task services. - /// - public ITaskService Task { get { return _serviceProvider.GetService(); } } - - /// - /// get - The workflow services. - /// - public IWorkflowService Workflow { get { return _serviceProvider.GetService(); } } - - /// - /// get - The notification template services. - /// - public INotificationTemplateService NotificationTemplate { get { return _serviceProvider.GetService(); } } - - /// - /// get - The project notification services. - /// - public IProjectNotificationService ProjectNotification { get { return _serviceProvider.GetService(); } } - - /// - /// get - The project status services. - /// - public IProjectStatusService ProjectStatus { get { return _serviceProvider.GetService(); } } - - /// - /// get - The notification queue services. - /// - public INotificationQueueService NotificationQueue { get { return _serviceProvider.GetService(); } } - - #endregion - - #region Constructors - /// - /// Creates a new instance of a PimsService class, and initializes it with the specified arguments. - /// - /// - /// - public PimsService(ClaimsPrincipal user, IServiceProvider serviceProvider) - { - this.Principal = user; - _serviceProvider = serviceProvider; - } - - /// - /// Get the original value of the specified 'entity'. - /// - /// - /// - /// - /// - public T OriginalValue(object entity, string propertyName) - { - return this.Project.OriginalValue(entity, propertyName); - } - #endregion - - #region Methods - #endregion - } -} diff --git a/backend/dal/Properties/launchSettings.json b/backend/dal/Properties/launchSettings.json deleted file mode 100644 index 9f8718184d..0000000000 --- a/backend/dal/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:16002/", - "sslPort": 44303 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Pims.Dal": { - "commandName": "Project", - "launchBrowser": true, - "applicationUrl": "https://localhost:5001;http://localhost:5000", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} diff --git a/backend/dal/Security/Permissions.cs b/backend/dal/Security/Permissions.cs deleted file mode 100644 index d59cc1d6b2..0000000000 --- a/backend/dal/Security/Permissions.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Pims.Dal.Security -{ - /// - /// Permissions enum, provides a list of compile-time safe claim names. - /// These are fixed claims that will control all access within the application. - /// - /// Keycloak - /// Keycloak calls theses claims 'roles'. - /// Within Keycloak users will be assigned to 'groups', which will be composed of 'roles'. - /// - public enum Permissions - { - [Display(GroupName = "admin", Name = "system-administrator", Description = "Can administer application settings.")] - SystemAdmin = 1, - - [Display(GroupName = "admin", Name = "agency-administrator", Description = "Can administer agencies.")] - AgencyAdmin = 2, - - [Display(GroupName = "admin", Name = "admin-users", Description = "Can administer user accounts.")] - AdminUsers = 3, - - [Display(GroupName = "admin", Name = "admin-roles", Description = "Can administer application roles.")] - AdminRoles = 4, - - [Display(GroupName = "admin", Name = "admin-agencies", Description = "Can administer application roles.")] - AdminAgencies = 5, - - [Display(GroupName = "admin", Name = "admin-properties", Description = "Can administer properties.")] - AdminProperties = 6, - - [Display(GroupName = "admin", Name = "admin-projects", Description = "Can administer projects.")] - AdminProjects = 7, - - [Display(GroupName = "property", Name = "property-view", Description = "Can view properties from inventory.")] - PropertyView = 10, - - [Display(GroupName = "property", Name = "property-add", Description = "Can add new properties to inventory.")] - PropertyAdd = 11, - - [Display(GroupName = "property", Name = "property-edit", Description = "Can edit properties in inventory.")] - PropertyEdit = 12, - - [Display(GroupName = "property", Name = "property-delete", Description = "Can delete properties in inventory.")] - PropertyDelete = 13, - - [Display(GroupName = "property", Name = "sensitive-view", Description = "Can view sensitive properties in inventory.")] - SensitiveView = 14, - - [Display(GroupName = "dispose", Name = "dispose-request", Description = "Can request to dispose properties in inventory.")] - DisposeRequest = 20, - - [Display(GroupName = "dispose", Name = "dispose-approve", Description = "Can approve requests to dispose properties in inventory.")] - DisposeApprove = 21, - - [Display(GroupName = "project", Name = "project-view", Description = "Can view projects.")] - ProjectView = 30, - - [Display(GroupName = "project", Name = "project-add", Description = "Can add new projects.")] - ProjectAdd = 31, - - [Display(GroupName = "project", Name = "project-edit", Description = "Can edit projects.")] - ProjectEdit = 32, - - [Display(GroupName = "project", Name = "project-delete", Description = "Can delete projects.")] - ProjectDelete = 33, - - [Display(GroupName = "project", Name = "reports-view", Description = "Can view project reports.")] - ReportsView = 34, - - [Display(GroupName = "project", Name = "reports-spl", Description = "Can view, create and modify non-final SPL reports.")] - ReportsSpl = 35, - - [Display(GroupName = "project", Name = "reports-spl-admin", Description = "Can view, create, modify and delete all SPL reports.")] - ReportsSplAdmin = 36 - } -} diff --git a/backend/dal/Services/Admin/Concrete/AddressService.cs b/backend/dal/Services/Admin/Concrete/AddressService.cs deleted file mode 100644 index 48fc079be8..0000000000 --- a/backend/dal/Services/Admin/Concrete/AddressService.cs +++ /dev/null @@ -1,63 +0,0 @@ -using Microsoft.Extensions.Logging; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using System.Collections.Generic; -using System.Security.Claims; - -namespace Pims.Dal.Services.Admin -{ - /// - /// AddressService class, provides a service layer to administrate addresss within the datasource. - /// - public class AddressService : BaseService
, IAddressService - { - #region Variables - #endregion - - #region Constructors - /// - /// Creates a new instance of a AddressService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public AddressService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) { } - #endregion - - #region Methods - /// - /// Updates the specified address in the datasource. - /// - /// - /// - public override void Update(Address entity) - { - // TODO: Check for system-administrator role. - entity.ThrowIfNull(nameof(entity)); - - var address = this.Context.Addresses.Find(entity.Id); - if (address == null) throw new KeyNotFoundException(); - - this.Context.Entry(address).CurrentValues.SetValues(entity); - base.Update(address); - } - - /// - /// Remove the specified address from the datasource. - /// - /// - public override void Remove(Address entity) - { - // TODO: Check for system-administrator role. - entity.ThrowIfNull(nameof(entity)); - - var address = this.Context.Addresses.Find(entity.Id); - if (address == null) throw new KeyNotFoundException(); - - this.Context.Entry(address).CurrentValues.SetValues(entity); - base.Remove(address); - } - #endregion - } -} diff --git a/backend/dal/Services/Admin/Concrete/AdministrativeAreaService.cs b/backend/dal/Services/Admin/Concrete/AdministrativeAreaService.cs deleted file mode 100644 index d66ef5c259..0000000000 --- a/backend/dal/Services/Admin/Concrete/AdministrativeAreaService.cs +++ /dev/null @@ -1,157 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Entities.Models; -using Pims.Dal.Security; - -namespace Pims.Dal.Services.Admin -{ - /// - /// AdministrativeAreaService class, provides a service layer to administrate areas within the datasource. - /// - public class AdministrativeAreaService : BaseService, IAdministrativeAreaService - { - #region Variables - #endregion - - #region Constructors - /// - /// Creates a new instance of a AdministrativeAreaService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public AdministrativeAreaService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) { } - #endregion - - #region Methods - /// - /// Get the administrative area for the specified name. - /// - /// - /// - /// - /// - public AdministrativeArea Get(string name) - { - if (String.IsNullOrWhiteSpace(name)) throw new ArgumentNullException(nameof(name)); - - return this.Context.AdministrativeAreas - .AsNoTracking() - .FirstOrDefault(c => c.Name == name); - } - - /// - /// Get the administrative area for the specified id. - /// - /// - /// - public AdministrativeArea Get(int id) - { - return this.Context.AdministrativeAreas - .FirstOrDefault(c => c.Id == id); - } - - /// - /// Get a page of administrative areas from the datasource. - /// - /// - /// - /// - public Paged Get(int page, int quantity) - { - return Get(new AdministrativeAreaFilter(page, quantity)); - } - - /// - /// Get a page of administrative areas from the datasource with a filter when provided. - /// - /// - /// - public Paged Get(AdministrativeAreaFilter filter = null) - { - var query = this.Context.AdministrativeAreas.AsNoTracking(); - - if (filter != null) - { - if (filter.Page < 1) filter.Page = 1; - if (filter.Quantity < 1) filter.Quantity = 1; - if (filter.Quantity > 50) filter.Quantity = 50; - - if (!string.IsNullOrWhiteSpace(filter.Name)) - query = query.Where(a => EF.Functions.Like(a.Name, $"%{filter.Name}%")); - if (!string.IsNullOrWhiteSpace(filter.Abbreviation)) - query = query.Where(a => EF.Functions.Like(a.Abbreviation, $"%{filter.Abbreviation}%")); - if (!string.IsNullOrWhiteSpace(filter.BoundaryType)) - query = query.Where(a => EF.Functions.Like(a.BoundaryType, $"{filter.BoundaryType}")); - } - - var administrativeAreas = query.OrderBy(a => a.Name).Skip((filter.Page - 1) * filter.Quantity).Take(filter.Quantity); - return new Paged(administrativeAreas.ToArray(), filter.Page, filter.Quantity, - query.Count()); - } - - /// - /// Get all cities from the datasource. // TODO: This needs to be filtered by province at some point. - /// - /// - public IEnumerable GetAll() - { - return this.Context.AdministrativeAreas.OrderBy(c => c.SortOrder).ThenBy(c => c.Name).ToArray(); - } - - /// - /// Updates the specified city in the datasource. - /// - /// - /// - public override void Update(AdministrativeArea entity) - { - entity.ThrowIfNull(nameof(entity)); - - var city = this.Context.AdministrativeAreas.Find(entity.Id); - if (city == null) throw new KeyNotFoundException(); - - this.Context.Entry(city).CurrentValues.SetValues(entity); - base.Update(city); - } - - /// - /// Remove the specified city from the datasource. - /// - /// - public override void Remove(AdministrativeArea entity) - { - entity.ThrowIfNull(nameof(entity)); - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin); - - var city = this.Context.AdministrativeAreas.Find(entity.Id); - if (city == null) throw new KeyNotFoundException(); - - this.Context.Entry(city).CurrentValues.SetValues(entity); - base.Remove(city); - } - - /// - /// Add the specified administrative area to the datasource. - /// - /// - public override void Add(AdministrativeArea entity) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin); - entity.ThrowIfNull((nameof(entity))); - - base.Add(entity); - this.Context.Entry(entity).State = EntityState.Detached; - } - - #endregion - } -} diff --git a/backend/dal/Services/Admin/Concrete/AgencyService.cs b/backend/dal/Services/Admin/Concrete/AgencyService.cs deleted file mode 100644 index 34ea288a78..0000000000 --- a/backend/dal/Services/Admin/Concrete/AgencyService.cs +++ /dev/null @@ -1,258 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using Pims.Dal.Entities.Models; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System; - -namespace Pims.Dal.Services.Admin -{ - /// - /// AgencyService class, provides a service layer to administrate agencies within the datasource. - /// - public class AgencyService : BaseService, IAgencyService - { - #region Variables - #endregion - - #region Constructors - /// - /// Creates a new instance of a AgencyService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public AgencyService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) { } - #endregion - - #region Methods - - /// - /// Get a page of agencies from the datasource. - /// - /// - /// - /// - public Paged Get(int page, int quantity) - { - return Get(new AgencyFilter(page, quantity)); - } - - /// - /// Get a page of agencies from the datasource. - /// The filter will allow queries to search for the following property values; Name, Description, ParentId. - /// - /// - /// - public Paged Get(AgencyFilter filter = null) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin); - - var query = this.Context.Agencies.AsNoTracking(); - - if (filter != null) - { - if (filter.Page < 1) filter.Page = 1; - if (filter.Quantity < 1) filter.Quantity = 1; - if (filter.Quantity > 50) filter.Quantity = 50; - if (filter.Sort == null) filter.Sort = new string[] { }; - - if (!string.IsNullOrWhiteSpace(filter.Name)) - query = query.Where(a => EF.Functions.Like(a.Name, $"%{filter.Name}%")); - if (filter.IsDisabled != null) - query = query.Where(a => a.IsDisabled == filter.IsDisabled); - if (filter.Id > 0) - query = query.Where(a => a.Id == filter.Id); - - if (filter.Sort.Any()) - query = query.OrderByProperty(filter.Sort); - } - var agencies = query.Skip((filter.Page - 1) * filter.Quantity).Take(filter.Quantity); - return new Paged(agencies.ToArray(), filter.Page, filter.Quantity, query.Count()); - } - - - /// - /// Get a page of agencies from the datasource. - /// - /// - /// - /// - /// - public IEnumerable GetAll() - { - return this.Context.Agencies.AsNoTracking().OrderBy(p => p.Name).ToArray(); - } - - /// - /// Get the agency for the specified 'id'. - /// - /// - /// Agency does not exists for the specified 'id'. - /// - public Agency Get(int id) - { - return this.Context.Agencies.Find(id) ?? throw new KeyNotFoundException(); - } - - /// - /// Add a new agency to the datasource. - /// The returned agency will contain all users who are affected by the update. - /// You will need to update Keycloak with this list. - /// - /// - public override void Add(Agency agency) - { - agency.ThrowIfNull(nameof(agency)); - - // Enforce unique constraint on the Code. - var isUnique = !this.Context.Agencies.Any(a => a.Code == agency.Code && a.ParentId == agency.ParentId); - if (!isUnique) throw new InvalidOperationException($"Agency 'code:{agency.Code}' must be unique"); - - base.Add(agency); - this.Context.Entry(agency).State = EntityState.Detached; - - // If the agency has been added as a sub-agency, then all users who are associated with the parent agency need to be updated. - // Currently in PIMS we only link a user to a single agency (although the DB supports one-to-many). - // This means that a user linked to a parent-agency will only have a single agency in the DB. - // However throughout the solution we also give access to all sub-agencies. - // Keycloak keeps a list of all the agencies that the user is allowed access to (parent + sub-agencies). - // This means we need to return a list of users that need to be updated in Keycloak. - if (agency.ParentId.HasValue) - { - var users = this.Context.Users.AsNoTracking().Where(u => u.Agencies.Any(a => a.AgencyId == agency.ParentId)).ToArray(); - users.ForEach(u => agency.Users.Add(new UserAgency(u, agency))); - } - } - - /// - /// Updates the specified agency in the datasource. - /// The returned agency will contain all users who are affected by the update. - /// You will need to update Keycloak with this list. - /// - /// - /// agency does not exist in the datasource. - /// - public override void Update(Agency agency) - { - agency.ThrowIfNull(nameof(agency)); - - var original = this.Context.Agencies.Find(agency.Id) ?? throw new KeyNotFoundException(); - - if (original.Code != agency.Code) - { - // Enforce unique constraint on the Code. - var isUnique = !this.Context.Agencies.Any(a => a.Id != original.Id && a.Code == agency.Code && a.ParentId == agency.ParentId); - if (!isUnique) throw new InvalidOperationException($"Agency 'code:{agency.Code}' must be unique"); - } - - var updatedUsers = new List(); - - // If the agency has become a sub-agency, or a parent-agency then users will need to be updated. - // Currently in PIMS we only link a user to a single agency (although the DB supports one-to-many). - // This means that a user linked to a parent-agency will only have a single agency in the DB. - // However throughout the solution we also give access to all sub-agencies. - // Keycloak keeps a list of all the agencies that the user is allowed access to (parent + sub-agencies). - // This means we need to return a list of users that need to be updated in Keycloak. - if (original.ParentId.HasValue && !agency.ParentId.HasValue) - { - // This agency has become a parent agency, all users associated with it through a parent-agency need to be removed. - updatedUsers.AddRange(this.Context.Users.Where(u => u.Agencies.Any(a => a.AgencyId == original.ParentId))); - } - else if (!original.ParentId.HasValue && agency.ParentId.HasValue) - { - // This agency has become a sub-agency, all original users need their list of agencies reduced to only this agency. - updatedUsers.AddRange(this.Context.Users.Include(u => u.Agencies).Where(u => u.Agencies.Any(a => a.AgencyId == agency.ParentId))); - } - else if (original.ParentId != agency.ParentId) - { - // Remove the sub-agency from currently linked users and add it to the users who belong to the new parent agency. - updatedUsers.AddRange(this.Context.Users.Where(u => u.Agencies.Any(a => a.AgencyId == original.ParentId))); - updatedUsers.AddRange(this.Context.Users.Where(u => u.Agencies.Any(a => a.AgencyId == agency.ParentId))); - } - - if (original.IsDisabled != agency.IsDisabled) - { - if ((agency.ParentId.HasValue && agency.IsDisabled) - || (agency.ParentId.HasValue && !agency.IsDisabled)) - { - // Remove the sub-agency from users. - // Or add the sub-agency to users who are associated with the parent. - updatedUsers.AddRange(this.Context.Users.Where(u => u.Agencies.Any(a => a.AgencyId == agency.ParentId))); - } - else if (!agency.ParentId.HasValue && agency.IsDisabled) - { - // Remove the agency from the users. - // This will result in the user not belonging to an agency. - var users = this.Context.Users.Include(u => u.Agencies).Where(u => u.Agencies.Any(a => a.AgencyId == agency.Id)); - users.ForEach(u => u.Agencies.Clear()); - updatedUsers.AddRange(users); - this.Context.UpdateRange(users); - } - } - - this.Context.Entry(original).CurrentValues.SetValues(agency); - base.Update(original); - - // Mutate original entity. - this.Context.Entry(agency).CurrentValues.SetValues(original); - updatedUsers.Distinct().ForEach(u => - { - this.Context.Entry(u).State = EntityState.Detached; - agency.Users.Add(new UserAgency(u, agency)); - }); - } - - /// - /// Remove the specified agency from the datasource. - /// The returned agency will contain all users who are affected by the update. - /// You will need to update Keycloak with this list. - /// - /// Entity does not exist in the datasource. - /// - public override void Remove(Agency agency) - { - agency.ThrowIfNull(nameof(agency)); - - var original = this.Context.Agencies.Include(a => a.Users).FirstOrDefault(a => a.Id == agency.Id) ?? throw new KeyNotFoundException(); - var updateUsers = new List(); - - // Any user associated with this agency needs to be updated. - // Currently in PIMS we only link a user to a single agency (although the DB supports one-to-many). - // This means that a user linked to a parent-agency will only have a single agency in the DB. - // However throughout the solution we also give access to all sub-agencies. - // Keycloak keeps a list of all the agencies that the user is allowed access to (parent + sub-agencies). - // This means we need to return a list of users that need to be updated in Keycloak. - if (original.ParentId.HasValue) - { - var users = this.Context.Users.Include(u => u.Agencies).Where(u => u.Agencies.Any(a => a.AgencyId == agency.ParentId)); - updateUsers.AddRange(users); - } - else - { - var users = this.Context.Users.Include(u => u.Agencies).Where(u => u.Agencies.Any(a => a.AgencyId == agency.Id)); - users.ForEach(u => u.Agencies.Clear()); - this.Context.Users.UpdateRange(users); - updateUsers.AddRange(users); - } - - this.Context.Entry(original).CurrentValues.SetValues(agency); - base.Remove(original); - - // Mutate original entity. - this.Context.Entry(agency).CurrentValues.SetValues(original); - updateUsers.ForEach(u => - { - this.Context.Entry(u).State = EntityState.Detached; - agency.Users.Add(new UserAgency(u, agency)); - }); - } - #endregion - } -} diff --git a/backend/dal/Services/Admin/Concrete/BaseService`.cs b/backend/dal/Services/Admin/Concrete/BaseService`.cs deleted file mode 100644 index bda3e3baec..0000000000 --- a/backend/dal/Services/Admin/Concrete/BaseService`.cs +++ /dev/null @@ -1,124 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System.Security.Claims; - -namespace Pims.Dal.Services.Admin -{ - /// - /// BaseService abstract class, provides a generic service layer to perform CRUD operations on the datasource. - /// - /// - public abstract class BaseService : Services.BaseService, IBaseService where ET : BaseEntity - { - #region Constructors - /// - /// Creates a new instance of a BaseService class, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public BaseService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) { } - #endregion - - #region Methods - /// - /// Find the entity within the datasource with the specified key values. - /// - /// - /// - public virtual ET Find(params object[] keyValues) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - var result = this.Context.Set().Find(keyValues); - if (result != null) - { - this.Context.Entry(result).State = Microsoft.EntityFrameworkCore.EntityState.Detached; // Force detach so that outside the DAL the DB cannot be manipulated. - } - return result; - } - - /// - /// Add the specified entity to the datasource. - /// - /// - public virtual void Add(ET entity) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - this.AddOne(entity); - this.Context.CommitTransaction(); - } - - /// - /// Add the specified entity to the in-memory collection but do not commit to the datasource. - /// - /// - public virtual void AddOne(ET entity) - { - entity.ThrowIfNull(nameof(entity)); - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - this.Context.Entry(entity).State = EntityState.Added; - } - - /// - /// Update the specified entity in the datasource. - /// - /// - /// - public virtual void Update(ET entity) - { - entity.ThrowIfNull(nameof(entity)); - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - entity.ThrowIfRowVersionNull(nameof(entity)); - - this.UpdateOne(entity); - this.Context.CommitTransaction(); - } - - /// - /// Update the specified entity to the in-memory collection but do not commit to the datasource. - /// - /// - /// - public virtual void UpdateOne(ET entity) - { - entity.ThrowIfNull(nameof(entity)); - entity.ThrowIfRowVersionNull(nameof(entity)); - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - this.Context.Entry(entity).State = EntityState.Modified; - } - - /// - /// Remove the specified entity from the datasource. - /// - /// - public virtual void Remove(ET entity) - { - entity.ThrowIfNull(nameof(entity)); - entity.ThrowIfRowVersionNull(nameof(entity)); - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - this.RemoveOne(entity); - this.Context.CommitTransaction(); - } - - /// - /// Remove the specified entity from the in-memory collection but do not commit to the datasource. - /// - /// - public virtual void RemoveOne(ET entity) - { - entity.ThrowIfNull(nameof(entity)); - entity.ThrowIfRowVersionNull(nameof(entity)); - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - this.Context.Entry(entity).State = EntityState.Deleted; - } - #endregion - } -} diff --git a/backend/dal/Services/Admin/Concrete/BuildingConstructionTypeService.cs b/backend/dal/Services/Admin/Concrete/BuildingConstructionTypeService.cs deleted file mode 100644 index 41cdddd73d..0000000000 --- a/backend/dal/Services/Admin/Concrete/BuildingConstructionTypeService.cs +++ /dev/null @@ -1,75 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Services.Admin -{ - /// - /// BuildingConstructionTypeService class, provides a service layer to administrate building construction types within the datasource. - /// - public class BuildingConstructionTypeService : BaseService, IBuildingConstructionTypeService - { - #region Variables - #endregion - - #region Constructors - /// - /// Creates a new instance of a BuildingConstructionTypeService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public BuildingConstructionTypeService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) { } - #endregion - - #region Methods - /// - /// Get a page of building construction types from the datasource. - /// - /// - /// - /// - /// - public IEnumerable GetAll() - { - return this.Context.BuildingConstructionTypes.AsNoTracking().OrderBy(p => p.Name).ToArray(); - } - - /// - /// Updates the specified building construction type in the datasource. - /// - /// - /// - public override void Update(BuildingConstructionType entity) - { - entity.ThrowIfNull(nameof(entity)); - - var buildingConstructionType = this.Context.BuildingConstructionTypes.Find(entity.Id); - if (buildingConstructionType == null) throw new KeyNotFoundException(); - - this.Context.Entry(buildingConstructionType).CurrentValues.SetValues(entity); - base.Update(buildingConstructionType); - } - - /// - /// Remove the specified building construction type from the datasource. - /// - /// - public override void Remove(BuildingConstructionType entity) - { - entity.ThrowIfNull(nameof(entity)); - - var buildingConstructionType = this.Context.BuildingConstructionTypes.Find(entity.Id); - if (buildingConstructionType == null) throw new KeyNotFoundException(); - - this.Context.Entry(buildingConstructionType).CurrentValues.SetValues(entity); - base.Remove(buildingConstructionType); - } - #endregion - } -} diff --git a/backend/dal/Services/Admin/Concrete/BuildingPredominateUseService.cs b/backend/dal/Services/Admin/Concrete/BuildingPredominateUseService.cs deleted file mode 100644 index f17841fbb9..0000000000 --- a/backend/dal/Services/Admin/Concrete/BuildingPredominateUseService.cs +++ /dev/null @@ -1,75 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Services.Admin -{ - /// - /// BuildingPredominateUseService class, provides a service layer to administrate building predominate uses within the datasource. - /// - public class BuildingPredominateUseService : BaseService, IBuildingPredominateUseService - { - #region Variables - #endregion - - #region Constructors - /// - /// Creates a new instance of a BuildingPredominateUseService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public BuildingPredominateUseService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) { } - #endregion - - #region Methods - /// - /// Get a page of building predominate uses from the datasource. - /// - /// - /// - /// - /// - public IEnumerable GetAll() - { - return this.Context.BuildingPredominateUses.AsNoTracking().OrderBy(p => p.Name).ToArray(); - } - - /// - /// Updates the specified building predominate use in the datasource. - /// - /// - /// - public override void Update(BuildingPredominateUse entity) - { - entity.ThrowIfNull(nameof(entity)); - - var buildingPredominateUse = this.Context.BuildingPredominateUses.Find(entity.Id); - if (buildingPredominateUse == null) throw new KeyNotFoundException(); - - this.Context.Entry(buildingPredominateUse).CurrentValues.SetValues(entity); - base.Update(buildingPredominateUse); - } - - /// - /// Remove the specified building predominate use from the datasource. - /// - /// - public override void Remove(BuildingPredominateUse entity) - { - entity.ThrowIfNull(nameof(entity)); - - var buildingPredominateUse = this.Context.BuildingPredominateUses.Find(entity.Id); - if (buildingPredominateUse == null) throw new KeyNotFoundException(); - - this.Context.Entry(buildingPredominateUse).CurrentValues.SetValues(entity); - base.Remove(buildingPredominateUse); - } - #endregion - } -} diff --git a/backend/dal/Services/Admin/Concrete/BuildingService.cs b/backend/dal/Services/Admin/Concrete/BuildingService.cs deleted file mode 100644 index c6925acf6a..0000000000 --- a/backend/dal/Services/Admin/Concrete/BuildingService.cs +++ /dev/null @@ -1,416 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Services.Admin -{ - /// - /// BuildingService class, provides a service layer to administrate building objects within the datasource. - /// - public class BuildingService : BaseService, IBuildingService - { - #region Variables - private readonly PimsOptions _options; - #endregion - - #region Constructors - /// - /// Creates a new instance of a BuildingService class, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - /// - public BuildingService(IOptions options, PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) - { - _options = options.Value; - } - #endregion - - #region Methods - /// - /// Get a page of buildings. - /// - /// - /// - /// - /// - public Paged Get(int page, int quantity, string sort) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - var entities = this.Context.Buildings.AsNoTracking(); - - var pagedEntities = entities.Skip((page - 1) * quantity).Take(quantity); - return new Paged(pagedEntities, page, quantity, entities.Count()); - } - - /// - /// Get the building for the specified 'id'. - /// - /// - /// - public Building Get(int id) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - return this.Context.Buildings - .Include(p => p.BuildingConstructionType) - .Include(p => p.BuildingPredominateUse) - .Include(p => p.BuildingOccupantType) - .Include(p => p.Address).ThenInclude(a => a.Province) - .Include(p => p.Agency).ThenInclude(a => a.Parent) - .AsNoTracking().SingleOrDefault(u => u.Id == id) ?? throw new KeyNotFoundException(); - } - - /// - /// Get the building for the specified 'pid' and 'name'. - /// This searched for a name that begins the same. - /// - /// - /// - /// - public IEnumerable GetByPid(int pid, string name = null) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - return this.Context.Buildings - .Include(p => p.BuildingConstructionType) - .Include(p => p.BuildingPredominateUse) - .Include(p => p.BuildingOccupantType) - .Include(p => p.Address).ThenInclude(a => a.Province) - .Include(p => p.Agency).ThenInclude(a => a.Parent) - .Where(b => b.Parcels.Any(pb => pb.Parcel.PID == pid) && (name == null || EF.Functions.Like(b.Name, $"{name}%"))); - } - - /// - /// Get the building for the specified 'pid' and 'name'. - /// This searches for a name that matches exactly if provided. - /// If name is null, it only searches by pid. - /// If pid is null but name provided, it searches by name. - /// If both are null, all buildings with no associated parcel and no name would be returned. - /// - /// - /// - /// - public IEnumerable GetByPidNameWithoutTracking(int pid = 0, string name = null) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - if (pid == 0) - { - return this.Context.Buildings - .Include(p => p.BuildingConstructionType) - .Include(p => p.BuildingPredominateUse) - .Include(p => p.BuildingOccupantType) - .Include(p => p.Address).ThenInclude(a => a.Province) - .Include(p => p.Agency).ThenInclude(a => a.Parent) - .AsNoTracking().Where(b => b.Parcels.Count == 0 && (name == null || name == b.Name)); - } - - return this.Context.Buildings - .Include(p => p.BuildingConstructionType) - .Include(p => p.BuildingPredominateUse) - .Include(p => p.BuildingOccupantType) - .Include(p => p.Address).ThenInclude(a => a.Province) - .Include(p => p.Agency).ThenInclude(a => a.Parent) - .AsNoTracking().Where(b => b.Parcels.Any(pb => pb.Parcel.PID == pid) && (name == null || name == b.Name)); - } - - /// - /// Get the building for the specified 'pid' and 'name'. - /// This searches for a name that begins the same. - /// - /// - /// - /// - /// - public IEnumerable GetByPidWithoutTracking(int pid, string name = null) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - return this.Context.Buildings - .Include(p => p.BuildingConstructionType) - .Include(p => p.BuildingPredominateUse) - .Include(p => p.BuildingOccupantType) - .Include(p => p.Address).ThenInclude(a => a.Province) - .Include(p => p.Agency).ThenInclude(a => a.Parent) - .AsNoTracking().Where(b => b.Parcels.Any(pb => pb.Parcel.PID == pid) && (name == null || EF.Functions.Like(b.Name, $"{name}%"))); - } - - - /// - /// Get the building for the specified 'name' and 'address'. - /// This searched for a name and address that equals the passed in arguments - /// - /// - /// - /// - public IEnumerable GetByNameAddressWithoutTracking(string name, string address) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - return this.Context.Buildings - .Include(p => p.BuildingConstructionType) - .Include(p => p.BuildingPredominateUse) - .Include(p => p.BuildingOccupantType) - .Include(p => p.Parcels) - .Include(p => p.Address).ThenInclude(a => a.Province) - .Include(p => p.Agency).ThenInclude(a => a.Parent) - .AsNoTracking().Where(b => b.Address.Address1.Equals(address) && b.Name.Equals(name)); - } - - /// - /// Get the building for the specified 'name'. - /// - /// - /// - public IEnumerable GetByName(string name) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - return this.Context.Buildings - .Include(p => p.BuildingConstructionType) - .Include(p => p.BuildingPredominateUse) - .Include(p => p.BuildingOccupantType) - .Include(p => p.Address).ThenInclude(a => a.Province) - .Include(p => p.Agency).ThenInclude(a => a.Parent) - .Where(b => b.Name == name) ?? throw new KeyNotFoundException(); - } - - /// - /// Get the building for the specified 'name'. - /// - /// - /// - public IEnumerable GetByNameWithoutTracking(string name) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - return this.Context.Buildings - .Include(p => p.BuildingConstructionType) - .Include(p => p.BuildingPredominateUse) - .Include(p => p.BuildingOccupantType) - .Include(p => p.Address).ThenInclude(a => a.Province) - .Include(p => p.Agency).ThenInclude(a => a.Parent) - .AsNoTracking().Where(b => b.Name == name) ?? throw new KeyNotFoundException(); - } - - /// - /// Load the parcels for the specified building. - /// - /// - public void LoadParcelsFor(Building building) - { - var entry = this.Context.Entry(building); - - if (entry.State == EntityState.Detached) - { - entry.State = EntityState.Unchanged; - } - - entry.Collection(b => b.Parcels) - .Query() - .Include(pb => pb.Parcel) - .Load(); - } - - /// - /// Add the building to the datasource. - /// - /// - /// - public override void Add(Building building) - { - building.ThrowIfNull(nameof(building)); - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - if (building.Agency != null && !this.Context.Agencies.Local.Any(a => a.Id == building.AgencyId)) - this.Context.Entry(building.Agency).State = EntityState.Unchanged; - if (building.Classification != null && !this.Context.PropertyClassifications.Local.Any(c => c.Id == building.ClassificationId)) - this.Context.Entry(building.Classification).State = EntityState.Unchanged; - if (building.BuildingConstructionType != null && !this.Context.BuildingConstructionTypes.Local.Any(a => a.Id == building.BuildingConstructionTypeId)) - this.Context.Entry(building.BuildingConstructionType).State = EntityState.Unchanged; - if (building.BuildingPredominateUse != null && !this.Context.BuildingConstructionTypes.Local.Any(a => a.Id == building.BuildingPredominateUseId)) - this.Context.Entry(building.BuildingPredominateUse).State = EntityState.Unchanged; - if (building.BuildingOccupantType != null && !this.Context.BuildingOccupantTypes.Local.Any(a => a.Id == building.BuildingOccupantTypeId)) - this.Context.Entry(building.BuildingOccupantType).State = EntityState.Unchanged; - - building.PropertyTypeId = (int)PropertyTypes.Building; - building.Agency = this.Context.Agencies.Local.FirstOrDefault(a => a.Id == building.AgencyId); - building.Classification = this.Context.PropertyClassifications.Local.FirstOrDefault(a => a.Id == building.ClassificationId); - building.BuildingConstructionType = this.Context.BuildingConstructionTypes.Local.FirstOrDefault(a => a.Id == building.BuildingConstructionTypeId); - building.BuildingPredominateUse = this.Context.BuildingPredominateUses.Local.FirstOrDefault(a => a.Id == building.BuildingPredominateUseId); - building.BuildingOccupantType = this.Context.BuildingOccupantTypes.Local.FirstOrDefault(a => a.Id == building.BuildingOccupantTypeId); - - if (building.Address != null) - { - this.Context.Addresses.Add(building.Address); - } - - this.Context.BuildingEvaluations.AddRange(building.Evaluations); - this.Context.BuildingFiscals.AddRange(building.Fiscals); - - base.Add(building); - } - - /// - /// Add the collection of buildings to the datasource. - /// - /// - /// - public IEnumerable Add(IEnumerable entities) - { - entities.ThrowIfNull(nameof(entities)); - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - var buildings = entities.Where(e => e != null); - var username = this.User.GetUsername(); - var userId = this.Context.Users.Where(u => u.Username == username).Select(u => u.Id).FirstOrDefault(); - buildings.ForEach((building) => - { - building.PropertyTypeId = (int)PropertyTypes.Building; - if (building.Agency != null && !this.Context.Agencies.Local.Any(a => a.Id == building.BuildingOccupantTypeId)) - this.Context.Entry(building.Agency).State = EntityState.Unchanged; - if (building.Classification != null && !this.Context.PropertyClassifications.Local.Any(a => a.Id == building.ClassificationId)) - this.Context.Entry(building.Classification).State = EntityState.Unchanged; - if (building.BuildingConstructionType != null && !this.Context.BuildingConstructionTypes.Local.Any(a => a.Id == building.BuildingConstructionTypeId)) - this.Context.Entry(building.BuildingConstructionType).State = EntityState.Unchanged; - if (building.BuildingPredominateUse != null && !this.Context.BuildingPredominateUses.Local.Any(a => a.Id == building.BuildingPredominateUseId)) - this.Context.Entry(building.BuildingPredominateUse).State = EntityState.Unchanged; - if (building.BuildingOccupantType != null && !this.Context.BuildingOccupantTypes.Local.Any(a => a.Id == building.BuildingOccupantTypeId)) - this.Context.Entry(building.BuildingOccupantType).State = EntityState.Unchanged; - - building.Agency = this.Context.Agencies.Local.FirstOrDefault(a => a.Id == building.AgencyId); - building.Classification = this.Context.PropertyClassifications.Local.FirstOrDefault(a => a.Id == building.ClassificationId); - building.BuildingConstructionType = this.Context.BuildingConstructionTypes.Local.FirstOrDefault(a => a.Id == building.BuildingConstructionTypeId); - building.BuildingPredominateUse = this.Context.BuildingPredominateUses.Local.FirstOrDefault(a => a.Id == building.BuildingPredominateUseId); - building.BuildingOccupantType = this.Context.BuildingOccupantTypes.Local.FirstOrDefault(a => a.Id == building.BuildingOccupantTypeId); - - this.Context.Addresses.Add(building.Address); - this.Context.BuildingEvaluations.AddRange(building.Evaluations); - }); - - this.Context.Buildings.AddRange(buildings); - this.Context.CommitTransaction(); - return entities; - } - - /// - /// Update the specified building in the datasource. - /// - /// - /// - public override void Update(Building building) - { - building.ThrowIfNotAllowedToEdit(nameof(building), this.User, new[] { Permissions.SystemAdmin, Permissions.AgencyAdmin }); - - var originalBuilding = this.Context.Buildings - .Include(b => b.Address).ThenInclude(a => a.Province) - .Include(b => b.Classification) - .Include(b => b.Parcels).ThenInclude(pb => pb.Parcel).ThenInclude(b => b.Address).ThenInclude(a => a.Province) - .FirstOrDefault(b => b.Id == building.Id) ?? throw new KeyNotFoundException(); - this.ThrowIfNotAllowedToUpdate(originalBuilding, _options.Project); - - building.PropertyTypeId = originalBuilding.PropertyTypeId; - var entry = this.Context.Entry(originalBuilding); - this.Context.Entry(originalBuilding.Address).CurrentValues.SetValues(building.Address); - entry.CurrentValues.SetValues(building); - entry.Collection(p => p.Evaluations).Load(); - entry.Collection(p => p.Fiscals).Load(); - - // TODO: Update child properties appropriately. - building.Evaluations.ForEach(e => - { - // This will only add an evaluation if it isn't already being tracked. - if (!originalBuilding.Evaluations.Any(pe => pe.Key == e.Key && pe.Date == e.Date)) - { - e.Building = originalBuilding; - this.Context.BuildingEvaluations.Add(e); - } - }); - building.Fiscals.ForEach(f => - { - // This will only add an fiscal if it isn't already being tracked. - if (!originalBuilding.Fiscals.Any(pf => pf.Key == f.Key && pf.FiscalYear == f.FiscalYear)) - { - f.Building = originalBuilding; - this.Context.BuildingFiscals.Add(f); - } - }); - - base.Update(originalBuilding); - } - - /// - /// Update the specified building financials in the datasource. - /// - /// - public void UpdateFinancials(Building building) - { - building.ThrowIfNull(nameof(building)); - building.ThrowIfNotAllowedToEdit(nameof(building), this.User, new[] { Permissions.SystemAdmin, Permissions.AgencyAdmin }); - - var originalBuilding = this.Context.Buildings.Find(building.Id) ?? throw new KeyNotFoundException(); - - var entry = this.Context.Entry(originalBuilding); - entry.Collection(p => p.Evaluations).Load(); - entry.Collection(p => p.Fiscals).Load(); - - building.Evaluations.ForEach(e => - { - // This will only add an evaluation if it isn't already being tracked. - if (!originalBuilding.Evaluations.Any(pe => pe.Key == e.Key && pe.Date == e.Date)) - { - e.Building = originalBuilding; - this.Context.BuildingEvaluations.Add(e); - } - }); - building.Fiscals.ForEach(f => - { - // This will only add an fiscal if it isn't already being tracked. - if (!originalBuilding.Fiscals.Any(pf => pf.Key == f.Key && pf.FiscalYear == f.FiscalYear)) - { - f.Building = originalBuilding; - this.Context.BuildingFiscals.Add(f); - } - }); - - base.Update(originalBuilding); - } - - /// - /// Remove the specified building from the datasource. - /// - /// - public override void Remove(Building building) - { - building.ThrowIfNotAllowedToEdit(nameof(building), this.User, new[] { Permissions.SystemAdmin, Permissions.AgencyAdmin }); - - var originalBuilding = this.Context.Buildings.Find(building.Id) ?? throw new KeyNotFoundException(); - this.Context.Entry(originalBuilding).Collection(p => p.Parcels).Load(); - this.Context.Entry(originalBuilding).Collection(p => p.Evaluations).Load(); - this.Context.Entry(originalBuilding).Collection(p => p.Fiscals).Load(); - this.Context.Entry(originalBuilding).Collection(p => p.Projects).Load(); - - this.Context.Entry(originalBuilding).CurrentValues.SetValues(building); - originalBuilding.Parcels.Clear(); - originalBuilding.Evaluations.Clear(); - originalBuilding.Fiscals.Clear(); - originalBuilding.Projects.Clear(); - // this.Context.BuildingEvaluations.RemoveRange(originalBuilding.Evaluations); - // this.Context.BuildingFiscals.RemoveRange(originalBuilding.Fiscals); - base.Remove(originalBuilding); - } - #endregion - } -} diff --git a/backend/dal/Services/Admin/Concrete/ClaimService.cs b/backend/dal/Services/Admin/Concrete/ClaimService.cs deleted file mode 100644 index ceba533563..0000000000 --- a/backend/dal/Services/Admin/Concrete/ClaimService.cs +++ /dev/null @@ -1,134 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Pims.Dal.Services.Admin -{ - /// - /// ClaimService class, provides a service layer to administrate users within the datasource. - /// - public class ClaimService : BaseService, IClaimService - { - #region Variables - #endregion - - #region Constructors - /// - /// Creates a new instance of a ClaimService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public ClaimService(PimsContext dbContext, System.Security.Claims.ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) { } - #endregion - - #region Methods - /// - /// Get a page of users from the datasource. - /// - /// - /// - /// - /// - public Paged Get(int page, int quantity, string name = null) - { - this.User.ThrowIfNotAuthorized(Permissions.AdminRoles); - - var query = this.Context.Claims.AsNoTracking(); - - if (!String.IsNullOrWhiteSpace(name)) - query = query.Where(r => EF.Functions.Like(r.Name, $"%{name}%")); - - var claims = query.Skip((page - 1) * quantity).Take(quantity); - return new Paged(claims.ToArray(), page, quantity, query.Count()); - } - - /// - /// Get the user with the specified 'id'. - /// - /// - /// Entity does not exist in the datasource. - /// - public Claim Get(Guid id) - { - this.User.ThrowIfNotAuthorized(Permissions.AdminRoles); - - return this.Context.Claims.AsNoTracking().FirstOrDefault(u => u.Id == id) ?? throw new KeyNotFoundException(); - } - - /// - /// Get the claim with the specified name. - /// - /// - /// Entity does not exist in the datasource. - /// - public Claim GetByName(string name) - { - return this.Context.Claims.AsNoTracking().FirstOrDefault(r => r.Name == name) ?? throw new KeyNotFoundException(); - } - - /// - /// Updates the specified claim in the datasource. - /// - /// - /// Entity does not exist in the datasource. - /// - public override void Update(Claim entity) - { - entity.ThrowIfNull(nameof(entity)); - this.User.ThrowIfNotAuthorized(Permissions.AdminRoles); - - var claim = this.Context.Claims.Find(entity.Id) ?? throw new KeyNotFoundException(); - - this.Context.Entry(claim).CurrentValues.SetValues(entity); - base.Update(claim); - this.Context.Detach(claim); - } - - /// - /// Remove the specified claim from the datasource. - /// - /// - /// Entity does not exist in the datasource. - public override void Remove(Claim entity) - { - entity.ThrowIfNull(nameof(entity)); - this.User.ThrowIfNotAuthorized(Permissions.AdminRoles); - - var claim = this.Context.Claims.Find(entity.Id) ?? throw new KeyNotFoundException(); - - this.Context.Entry(claim).CurrentValues.SetValues(entity); - base.Remove(claim); - } - - /// - /// Remove the claims from the datasource, excluding those listed. - /// - /// - /// - public int RemoveAll(Guid[] exclude) - { - this.User.ThrowIfNotAuthorized(Permissions.AdminRoles); - var claims = this.Context.Claims - .Include(r => r.Roles) - .Where(r => !exclude.Contains(r.Id)); - claims.ForEach(r => - { - r.Roles.Clear(); - }); - - this.Context.Claims.RemoveRange(claims); - var result = this.Context.CommitTransaction(); - return result; - } - #endregion - } -} diff --git a/backend/dal/Services/Admin/Concrete/ParcelService.cs b/backend/dal/Services/Admin/Concrete/ParcelService.cs deleted file mode 100644 index 5cb961ee4d..0000000000 --- a/backend/dal/Services/Admin/Concrete/ParcelService.cs +++ /dev/null @@ -1,481 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Services.Admin -{ - /// - /// ParcelService class, provides a service layer to administrate parcel objects within the datasource. - /// - public class ParcelService : BaseService, IParcelService - { - #region Constructors - /// - /// Creates a new instance of a ParcelService class, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public ParcelService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) { } - #endregion - - #region Methods - /// - /// Get an array of parcels within the specified filter. - /// Will not return sensitive parcels unless the user has the `sensitive-view` claim and belongs to the owning agency. - /// - /// - /// - public Paged Get(ParcelFilter filter) - { - filter.ThrowIfNull(nameof(filter)); - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - if (filter.Page < 1) throw new ArgumentException("Argument must be greater than or equal to 1.", nameof(filter.Page)); - if (filter.Quantity < 1) throw new ArgumentException("Argument must be greater than or equal to 1.", nameof(filter.Quantity)); - - // Check if user has the ability to view sensitive properties. - var user = this.Context.Users - .Include(u => u.Agencies) - .ThenInclude(a => a.Agency) - .ThenInclude(a => a.Children) - .SingleOrDefault(u => u.Username == this.User.GetUsername()) ?? throw new KeyNotFoundException(); - var userAgencies = user.Agencies.Select(a => a.AgencyId).ToList(); - - var viewSensitive = this.User.HasPermission(Security.Permissions.SensitiveView); - - // Users may only view sensitive properties if they have the `sensitive-view` claim and belong to the owning agency. - var query = this.Context.Parcels.AsNoTracking(); - - if (filter.NELatitude.HasValue && filter.NELongitude.HasValue && filter.SWLatitude.HasValue && filter.SWLongitude.HasValue) - { - var poly = new NetTopologySuite.Geometries.Envelope(filter.NELongitude.Value, filter.SWLongitude.Value, filter.NELatitude.Value, filter.SWLatitude.Value).ToPolygon(); - query = query.Where(p => poly.Contains(p.Location)); - } - - if (filter.Agencies?.Any() == true) - { - var filterAgencies = filter.Agencies.Select(a => (int?)a); - query = query.Where(p => filterAgencies.Contains(p.AgencyId)); - } - if (filter.ClassificationId.HasValue) - query = query.Where(p => p.ClassificationId == filter.ClassificationId); - if (!String.IsNullOrWhiteSpace(filter.ProjectNumber)) - query = query.Where(p => p.ProjectNumbers.Contains(filter.ProjectNumber)); - if (!String.IsNullOrWhiteSpace(filter.Description)) - query = query.Where(p => EF.Functions.Like(p.Description, $"%{filter.Description}%")); - if (!String.IsNullOrWhiteSpace(filter.AdministrativeArea)) - query = query.Where(p => EF.Functions.Like(p.Address.AdministrativeArea, $"%{filter.AdministrativeArea}%")); - if (!String.IsNullOrWhiteSpace(filter.Zoning)) - query = query.Where(p => EF.Functions.Like(p.Zoning, $"%{filter.Zoning}%")); - if (!String.IsNullOrWhiteSpace(filter.ZoningPotential)) - query = query.Where(p => EF.Functions.Like(p.ZoningPotential, $"%{filter.ZoningPotential}%")); - - // TODO: Parse the address information by City, Postal, etc. - if (!String.IsNullOrWhiteSpace(filter.Address)) - query = query.Where(p => EF.Functions.Like(p.Address.Address1, $"%{filter.Address}%") || EF.Functions.Like(p.Address.AdministrativeArea, $"%{filter.Address}%")); - - if (filter.MinLandArea.HasValue) - query = query.Where(p => p.LandArea >= filter.MinLandArea); - if (filter.MaxLandArea.HasValue) - query = query.Where(p => p.LandArea <= filter.MaxLandArea); - - // TODO: Review performance of the evaluation query component. - if (filter.MinMarketValue.HasValue) - query = query.Where(p => - filter.MinMarketValue <= p.Fiscals - .FirstOrDefault(e => e.FiscalYear == this.Context.ParcelFiscals - .Where(pe => pe.ParcelId == p.Id && e.Key == FiscalKeys.Market) - .Max(pe => pe.FiscalYear)) - .Value); - if (filter.MaxMarketValue.HasValue) - query = query.Where(p => - filter.MaxMarketValue >= p.Fiscals - .FirstOrDefault(e => e.FiscalYear == this.Context.ParcelFiscals - .Where(pe => pe.ParcelId == p.Id && e.Key == FiscalKeys.Market) - .Max(pe => pe.FiscalYear)) - .Value); - - // TODO: Review performance of the evaluation query component. - if (filter.MinAssessedValue.HasValue) - query = query.Where(p => - filter.MinAssessedValue <= p.Evaluations - .FirstOrDefault(e => e.Date == this.Context.ParcelEvaluations - .Where(pe => pe.ParcelId == p.Id && e.Key == EvaluationKeys.Assessed) - .Max(pe => pe.Date)) - .Value); - if (filter.MaxAssessedValue.HasValue) - query = query.Where(p => - filter.MaxAssessedValue >= p.Evaluations - .FirstOrDefault(e => e.Date == this.Context.ParcelEvaluations - .Where(pe => pe.ParcelId == p.Id && e.Key == EvaluationKeys.Assessed) - .Max(pe => pe.Date)) - .Value); - - if (filter.Sort?.Any() == true) - query = query.OrderByProperty(filter.Sort); - - var pagedEntities = query.Skip((filter.Page - 1) * filter.Quantity).Take(filter.Quantity); - return new Paged(pagedEntities, filter.Page, filter.Quantity, query.Count()); - } - - /// - /// Get the parcel for the specified 'id'. - /// - /// - /// Entity does not exist in the datasource. - /// - public Parcel Get(int id) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - return this.Context.Parcels - .Include(p => p.Classification) - .Include(p => p.Address).ThenInclude(a => a.Province) - .Include(p => p.Agency).ThenInclude(a => a.Parent) - .Include(p => p.Evaluations) - .Include(p => p.Fiscals) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Address) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Address.Province) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.BuildingConstructionType) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.BuildingPredominateUse) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.BuildingOccupantType) - .AsNoTracking().SingleOrDefault(u => u.Id == id) ?? throw new KeyNotFoundException(); - } - - public bool IsPidAvailable(int PID) - { - return !Context.Parcels.Any(parcel => parcel.PID == PID); - } - - /// - /// Get the parcel for the specified 'pid'. - /// - /// - /// Entity does not exist in the datasource. - /// - public Parcel GetByPid(int pid) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - var parcels = this.Context.Parcels - .Include(p => p.Classification) - .Include(p => p.Address).ThenInclude(a => a.Province) - .Include(p => p.Agency) - .Include(p => p.Agency.Parent) - .Include(p => p.Evaluations) - .Include(p => p.Fiscals) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Address) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Address.Province) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.BuildingConstructionType) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.BuildingPredominateUse) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.BuildingOccupantType) - .Where(p => p.PID == pid); - - if (!parcels.Any()) throw new KeyNotFoundException(); - if (parcels.Count() == 1) return parcels.First(); - return parcels.SingleOrDefault(p => p.PIN == null) ?? throw new InvalidOperationException($"Parcel '{pid}' does not have a titled property, but has {parcels.Count()} untitled properties."); // If there isn't a primary titled property, throw an exception. - } - - /// - /// Get the parcel for the specified 'pid'. - /// - /// - /// Entity does not exist in the datasource. - /// - public Parcel GetByPidWithoutTracking(int pid) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - var parcels = this.Context.Parcels - .Include(p => p.Classification) - .Include(p => p.Address).ThenInclude(a => a.Province) - .Include(p => p.Agency) - .Include(p => p.Agency.Parent) - .Include(p => p.Evaluations) - .Include(p => p.Fiscals) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Address) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Address.Province) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.BuildingConstructionType) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.BuildingPredominateUse) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.BuildingOccupantType) - .AsNoTracking().Where(p => p.PID == pid); - - if (!parcels.Any()) throw new KeyNotFoundException(); - if (parcels.Count() == 1) return parcels.First(); - return parcels.SingleOrDefault(p => p.PIN == null) ?? throw new InvalidOperationException($"Parcel '{pid}' does not have a titled property, but has {parcels.Count()} untitled properties."); // If there isn't a primary titled property, throw an exception. - } - - /// - /// Add the specified parcel to the datasource. - /// - /// - /// - public override void Add(Parcel parcel) - { - parcel.ThrowIfNull(nameof(parcel)); - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - this.Context.Parcels.ThrowIfNotUnique(parcel); - - if (parcel.Agency != null && !this.Context.Agencies.Local.Any(a => a.Id == parcel.AgencyId)) - this.Context.Entry(parcel.Agency).State = EntityState.Unchanged; - if (parcel.Classification != null && !this.Context.PropertyClassifications.Local.Any(a => a.Id == parcel.ClassificationId)) - this.Context.Entry(parcel.Classification).State = EntityState.Unchanged; - - parcel.PropertyTypeId = (int)(parcel.Parcels.Count > 0 ? PropertyTypes.Subdivision : PropertyTypes.Land); - parcel.Agency = this.Context.Agencies.Local.FirstOrDefault(a => a.Id == parcel.AgencyId); - parcel.Classification = this.Context.PropertyClassifications.Local.FirstOrDefault(a => a.Id == parcel.ClassificationId); - - parcel.Buildings.ForEach(pb => - { - pb.Parcel = parcel; - var building = pb.Building; - this.Context.Buildings.Add(building); - if (building.Agency != null && !this.Context.Agencies.Local.Any(a => a.Id == building.AgencyId)) - this.Context.Entry(building.Agency).State = EntityState.Unchanged; - if (building.Classification != null && !this.Context.PropertyClassifications.Local.Any(a => a.Id == building.ClassificationId)) - this.Context.Entry(building.Classification).State = EntityState.Unchanged; - if (building.BuildingConstructionType != null && !this.Context.BuildingConstructionTypes.Local.Any(a => a.Id == building.BuildingConstructionTypeId)) - this.Context.Entry(building.BuildingConstructionType).State = EntityState.Unchanged; - if (building.BuildingPredominateUse != null && !this.Context.BuildingPredominateUses.Local.Any(a => a.Id == building.BuildingPredominateUseId)) - this.Context.Entry(building.BuildingPredominateUse).State = EntityState.Unchanged; - if (building.BuildingOccupantType != null && !this.Context.BuildingOccupantTypes.Local.Any(a => a.Id == building.BuildingOccupantTypeId)) - this.Context.Entry(building.BuildingOccupantType).State = EntityState.Unchanged; - - building.Agency = this.Context.Agencies.Local.FirstOrDefault(a => a.Id == building.AgencyId); - building.Classification = this.Context.PropertyClassifications.Local.FirstOrDefault(a => a.Id == building.ClassificationId); - building.BuildingConstructionType = this.Context.BuildingConstructionTypes.Local.FirstOrDefault(a => a.Id == building.BuildingConstructionTypeId); - building.BuildingPredominateUse = this.Context.BuildingPredominateUses.Local.FirstOrDefault(a => a.Id == building.BuildingPredominateUseId); - building.BuildingOccupantType = this.Context.BuildingOccupantTypes.Local.FirstOrDefault(a => a.Id == building.BuildingOccupantTypeId); - - this.Context.BuildingEvaluations.AddRange(building.Evaluations); - this.Context.BuildingFiscals.AddRange(building.Fiscals); - - if (building.Address != null) - { - this.Context.Addresses.Add(building.Address); - } - - }); - - this.Context.ParcelEvaluations.AddRange(parcel.Evaluations); - this.Context.ParcelFiscals.AddRange(parcel.Fiscals); - - if (parcel.Address != null) - { - this.Context.Addresses.Add(parcel.Address); - } - - base.Add(parcel); - } - - /// - /// Add the collection of parcels to the datasource. - /// - /// - /// - public IEnumerable Add(IEnumerable parcels) - { - parcels.ThrowIfNull(nameof(parcels)); - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - parcels.ForEach(parcel => - { - parcel.PropertyTypeId = (int)(parcel.Parcels.Count > 0 ? PropertyTypes.Subdivision : PropertyTypes.Land); - if (parcel == null) throw new ArgumentNullException(); - - if (parcel.AgencyId != 0 && !this.Context.Agencies.Local.Any(a => a.Id == parcel.AgencyId)) - this.Context.Entry(parcel.Agency).State = EntityState.Unchanged; - if (parcel.Classification != null && !this.Context.PropertyClassifications.Local.Any(a => a.Id == parcel.ClassificationId)) - this.Context.Entry(parcel.Classification).State = EntityState.Unchanged; - - parcel.Agency = this.Context.Agencies.Local.FirstOrDefault(a => a.Id == parcel.AgencyId); - parcel.Classification = this.Context.PropertyClassifications.Local.FirstOrDefault(a => a.Id == parcel.ClassificationId); - - parcel.Buildings.ForEach(pb => - { - pb.Parcel = parcel; - var building = pb.Building; - this.Context.Buildings.Add(building); - if (building.Agency != null && !this.Context.Agencies.Local.Any(a => a.Id == building.AgencyId)) - this.Context.Entry(building.Agency).State = EntityState.Unchanged; - if (building.Classification != null && !this.Context.PropertyClassifications.Local.Any(a => a.Id == building.ClassificationId)) - this.Context.Entry(building.Classification).State = EntityState.Unchanged; - if (building.BuildingConstructionType != null && !this.Context.BuildingConstructionTypes.Local.Any(a => a.Id == building.BuildingConstructionTypeId)) - this.Context.Entry(building.BuildingConstructionType).State = EntityState.Unchanged; - if (building.BuildingPredominateUse != null && !this.Context.BuildingPredominateUses.Local.Any(a => a.Id == building.BuildingPredominateUseId)) - this.Context.Entry(building.BuildingPredominateUse).State = EntityState.Unchanged; - if (building.BuildingOccupantType != null && !this.Context.BuildingOccupantTypes.Local.Any(a => a.Id == building.BuildingOccupantTypeId)) - this.Context.Entry(building.BuildingOccupantType).State = EntityState.Unchanged; - - building.Agency = this.Context.Agencies.Local.FirstOrDefault(a => a.Id == building.AgencyId); - building.Classification = this.Context.PropertyClassifications.Local.FirstOrDefault(a => a.Id == building.ClassificationId); - building.BuildingConstructionType = this.Context.BuildingConstructionTypes.Local.FirstOrDefault(a => a.Id == building.BuildingConstructionTypeId); - building.BuildingPredominateUse = this.Context.BuildingPredominateUses.Local.FirstOrDefault(a => a.Id == building.BuildingPredominateUseId); - building.BuildingOccupantType = this.Context.BuildingOccupantTypes.Local.FirstOrDefault(a => a.Id == building.BuildingOccupantTypeId); - - building.Evaluations.ForEach(e => - { - this.Context.BuildingEvaluations.Add(e); - }); - building.Fiscals.ForEach(f => - { - this.Context.BuildingFiscals.Add(f); - }); - - if (building.Address != null) - { - this.Context.Addresses.Add(building.Address); - } - }); - - parcel.Evaluations.ForEach(e => - { - this.Context.ParcelEvaluations.Add(e); - }); - parcel.Fiscals.ForEach(f => - { - this.Context.ParcelFiscals.Add(f); - }); - - if (parcel.Address != null) - { - this.Context.Addresses.Add(parcel.Address); - } - }); - - this.Context.Parcels.AddRange(parcels); - this.Context.CommitTransaction(); - return parcels; - } - - /// - /// Update the specified parcel in the datasource. - /// - /// - /// Entity does not exist in the datasource. - /// - public override void Update(Parcel parcel) - { - parcel.ThrowIfNull(nameof(parcel)); - parcel.ThrowIfNotAllowedToEdit(nameof(parcel), this.User, new[] { Permissions.SystemAdmin, Permissions.AgencyAdmin }); - - var originalParcel = this.Context.Parcels - .Include(p => p.Agency) - .Include(p => p.Address) - .Include(p => p.Evaluations) - .Include(p => p.Fiscals) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Evaluations) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Fiscals) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Address) - .Include(p => p.Parcels).ThenInclude(pp => pp.Parcel) - .Include(p => p.Subdivisions).ThenInclude(pp => pp.Subdivision) - .SingleOrDefault(p => p.Id == parcel.Id) ?? throw new KeyNotFoundException(); - - parcel.PropertyTypeId = originalParcel.PropertyTypeId; - this.Context.Entry(originalParcel.Address).CurrentValues.SetValues(parcel.Address); - - var entry = this.Context.Entry(originalParcel); - entry.CurrentValues.SetValues(parcel); - entry.Collection(p => p.Evaluations).Load(); - entry.Collection(p => p.Fiscals).Load(); - - this.Context.Parcels.ThrowIfNotUnique(parcel); - - // TODO: Update child properties appropriately. - foreach (var e in parcel.Evaluations) - { - // Only add an evaluation that does not exist. - if (!originalParcel.Evaluations.Any(pe => pe.Key == e.Key && pe.Date == e.Date)) - { - e.Parcel = originalParcel; - this.Context.ParcelEvaluations.Add(e); - } - } - - foreach (var f in parcel.Fiscals) - { - // Only add a fiscal that does not exist. - if (!originalParcel.Fiscals.Any(pf => pf.Key == f.Key && pf.FiscalYear == f.FiscalYear)) - { - f.Parcel = originalParcel; - this.Context.ParcelFiscals.Add(f); - } - } - - base.Update(originalParcel); - } - - /// - /// Update the specified parcel financials in the datasource. - /// - /// - public void UpdateFinancials(Parcel parcel) - { - parcel.ThrowIfNull(nameof(parcel)); - parcel.ThrowIfNotAllowedToEdit(nameof(parcel), this.User, new[] { Permissions.SystemAdmin, Permissions.AgencyAdmin }); - - var originalParcel = this.Context.Parcels.Find(parcel.Id) ?? throw new KeyNotFoundException(); - - var entry = this.Context.Entry(originalParcel); - entry.Collection(p => p.Evaluations).Load(); - entry.Collection(p => p.Fiscals).Load(); - - foreach (var e in parcel.Evaluations) - { - // Only add an evaluation that does not exist. - if (!originalParcel.Evaluations.Any(pe => pe.Key == e.Key && pe.Date == e.Date)) - { - e.Parcel = originalParcel; - this.Context.ParcelEvaluations.Add(e); - } - } - - foreach (var f in parcel.Fiscals) - { - // Only add a fiscal that does not exist. - if (!originalParcel.Fiscals.Any(pf => pf.Key == f.Key && pf.FiscalYear == f.FiscalYear)) - { - f.Parcel = originalParcel; - this.Context.ParcelFiscals.Add(f); - } - } - - base.Update(originalParcel); - } - - /// - /// Remove the specified parcel from the datasource. - /// - /// Entity does not exist in the datasource. - /// - public override void Remove(Parcel parcel) - { - parcel.ThrowIfNull(nameof(parcel)); - parcel.ThrowIfNotAllowedToEdit(nameof(parcel), this.User, new[] { Permissions.SystemAdmin, Permissions.AgencyAdmin }); - - var originalParcel = this.Context.Parcels.Find(parcel.Id) ?? throw new KeyNotFoundException(); - this.Context.Entry(originalParcel).Collection(p => p.Buildings).Load(); - this.Context.Entry(originalParcel).Collection(p => p.Evaluations).Load(); - this.Context.Entry(originalParcel).Collection(p => p.Fiscals).Load(); - this.Context.Entry(originalParcel).Collection(p => p.Projects).Load(); - - this.Context.Entry(originalParcel).CurrentValues.SetValues(parcel); - originalParcel.Buildings.Clear(); - originalParcel.Evaluations.Clear(); - originalParcel.Fiscals.Clear(); - originalParcel.Projects.Clear(); - base.Remove(originalParcel); - } - #endregion - } -} diff --git a/backend/dal/Services/Admin/Concrete/ProjectRiskService.cs b/backend/dal/Services/Admin/Concrete/ProjectRiskService.cs deleted file mode 100644 index 847f1056cf..0000000000 --- a/backend/dal/Services/Admin/Concrete/ProjectRiskService.cs +++ /dev/null @@ -1,86 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Services.Admin -{ - /// - /// ProjectRiskService class, provides a service layer to administrate risks within the datasource. - /// - public class ProjectRiskService : BaseService, IProjectRiskService - { - #region Variables - #endregion - - #region Constructors - /// - /// Creates a new instance of a ProjectRiskService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public ProjectRiskService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) { } - #endregion - - #region Methods - /// - /// Get a page of risks from the datasource. - /// - /// - /// - /// - /// - public IEnumerable GetAll() - { - return this.Context.ProjectRisks.AsNoTracking().OrderBy(p => p.Name).ToArray(); - } - - /// - /// Get the risk for the specified 'id'. - /// - /// - /// ProjectRisk does not exists for the specified 'id'. - /// - public ProjectRisk Get(int id) - { - return this.Context.ProjectRisks.Find(id) ?? throw new KeyNotFoundException(); - } - - /// - /// Updates the specified risk in the datasource. - /// - /// - /// Entity does not exist in the datasource. - /// - public override void Update(ProjectRisk entity) - { - entity.ThrowIfNull(nameof(entity)); - - var risk = this.Context.ProjectRisks.Find(entity.Id) ?? throw new KeyNotFoundException(); - - this.Context.Entry(risk).CurrentValues.SetValues(entity); - base.Update(risk); - } - - /// - /// Remove the specified risk from the datasource. - /// - /// Entity does not exist in the datasource. - /// - public override void Remove(ProjectRisk entity) - { - entity.ThrowIfNull(nameof(entity)); - - var risk = this.Context.ProjectRisks.Find(entity.Id) ?? throw new KeyNotFoundException(); - - this.Context.Entry(risk).CurrentValues.SetValues(entity); - base.Remove(risk); - } - #endregion - } -} diff --git a/backend/dal/Services/Admin/Concrete/ProjectService.cs b/backend/dal/Services/Admin/Concrete/ProjectService.cs deleted file mode 100644 index 4c5aec7408..0000000000 --- a/backend/dal/Services/Admin/Concrete/ProjectService.cs +++ /dev/null @@ -1,274 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Security.Claims; - -namespace Pims.Dal.Services.Admin -{ - /// - /// ProjectService class, provides a service layer to administrate project objects within the datasource. - /// - public class ProjectService : BaseService, IProjectService - { - #region Variables - private readonly PimsOptions _options; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ProjectService class, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - /// - public ProjectService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, IOptions options, ILogger logger) : base(dbContext, user, service, logger) - { - _options = options.Value; - } - #endregion - - #region Methods - /// - /// Get the project for the specified 'id'. - /// - /// - /// Entity does not exist in the datasource. - /// - public Project Get(int id) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - return this.Context.Projects - .Include(p => p.Status) - .Include(p => p.Agency) - .Include(p => p.Agency.Parent) - .Include(p => p.Responses) - .FirstOrDefault(u => u.Id == id) ?? throw new KeyNotFoundException(); - } - - /// - /// Get the project for the specified 'projectNumber'. - /// - /// - /// - /// - public Project Get(int id, params Expression>[] includes) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - var query = this.Context.Projects.AsNoTracking(); - - return includes.Aggregate(query, (current, include) => current.Include(include.Name)) - .FirstOrDefault(u => u.Id == id); - } - - /// - /// Get the project for the specified 'projectNumber'. - /// - /// - /// - public Project Get(string projectNumber) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - return this.Context.Projects - .Include(p => p.Status) - .Include(p => p.Agency) - .Include(p => p.Agency.Parent) - .Include(p => p.Responses) - .Include(p => p.Notes) - .Include(p => p.Tasks) - .FirstOrDefault(u => u.ProjectNumber == projectNumber); - } - - /// - /// Get the project for the specified 'projectNumber'. - /// - /// - /// - /// - public Project Get(string projectNumber, params Expression>[] includes) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - var query = this.Context.Projects.AsNoTracking(); - - return includes.Aggregate(query, (current, include) => current.Include(include.Name)) - .FirstOrDefault(u => u.ProjectNumber == projectNumber); - } - - /// - /// Return all the snaphots for the specified 'projectId'. - /// - /// - /// - public IEnumerable GetSnapshots(int projectId) - { - return this.Context.ProjectSnapshots - .Where(s => s.ProjectId == projectId) - .ToArray(); - } - - /// - /// Generate a new project number. - /// This does not apply the generated number to a project, this is up to you to do. - /// - /// - public string GenerateProjectNumber() - { - var projectNumber = this.Context.GenerateProjectNumber(_options.Project.NumberFormat); - return projectNumber; - } - - /// - /// Apply the specified 'projectNumber' to the specified 'project' and update all properties associated with it. - /// - /// - /// - /// - public void UpdateProjectNumber(Project project, string projectNumber) - { - this.Context.UpdateProjectNumber(project, projectNumber); - this.Context.SaveChanges(); - } - - /// - /// Add the specified project to the datasource. - /// - /// - /// - public override void Add(Project project) - { - project.ThrowIfNull(nameof(project)); - - project.Workflow = null; - project.Status = null; - project.Agency = null; - project.TierLevel = null; - project.Risk = null; - - project.Responses.ForEach(r => - { - r.Agency = null; - }); - - project.Tasks.ForEach(t => - { - t.Task = null; - }); - - base.Add(project); - } - - /// - /// Add the collection of projects to the datasource. - /// - /// - /// - public void Add(IEnumerable projects) - { - projects.ThrowIfNull(nameof(projects)); - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - if (projects.Any()) - { - projects.ForEach((project) => - { - if (project == null) return; - - if (String.IsNullOrWhiteSpace(project.ProjectNumber)) - { - project.ProjectNumber = $"TEMP-{DateTime.UtcNow.Ticks:00000}"; - } - - this.Context.Projects.Add(project); - }); - - this.Context.CommitTransaction(); - } - } - - /// - /// Update the specified project in the datasource. - /// - /// - /// Entity does not exist in the datasource. - /// - public override void Update(Project project) - { - project.ThrowIfNull(nameof(project)); - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - var originalProject = this.Context.Projects.Find(project.Id) ?? throw new KeyNotFoundException(); - - this.Context.Entry(originalProject).CurrentValues.SetValues(project); - - // TODO: Update child properties appropriately. - base.Update(originalProject); - } - - /// - /// Update the collection of projects in the datasource. - /// - /// - /// - public void Update(IEnumerable projects) - { - projects.ThrowIfNull(nameof(projects)); - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - if (projects.Any()) - { - projects.ForEach((project) => - { - if (project == null) throw new ArgumentNullException(); - - project.Workflow = project.Workflow != null ? this.Context.Workflows.Find(project.WorkflowId) : null; - project.Status = project.Status != null ? this.Context.ProjectStatus.Find(project.StatusId) : null; - project.Agency = project.Agency != null ? this.Context.Agencies.Find(project.AgencyId) : null; - project.TierLevel = project.TierLevel != null ? this.Context.TierLevels.Find(project.TierLevelId) : null; - project.Risk = project.Risk != null ? this.Context.ProjectRisks.Find(project.RiskId) : null; - - project.Responses.ForEach(r => - { - r.Agency = r.Agency != null ? this.Context.Agencies.Find(r.AgencyId) : null; - }); - - project.Tasks.ForEach(t => - { - t.Task = t.Task != null ? this.Context.Tasks.Find(t.TaskId) : null; - }); - - this.Context.Projects.Update(project); - }); - - this.Context.CommitTransaction(); - } - } - - /// - /// Remove the specified project from the datasource. - /// - /// Entity does not exist in the datasource. - /// - public override void Remove(Project project) - { - project.ThrowIfNull(nameof(project)); - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin, Permissions.AgencyAdmin); - - var originalProject = this.Context.Projects.Find(project.Id) ?? throw new KeyNotFoundException(); - - this.Context.Entry(originalProject).CurrentValues.SetValues(project); - base.Remove(originalProject); - } - #endregion - } -} diff --git a/backend/dal/Services/Admin/Concrete/ProjectStatusService.cs b/backend/dal/Services/Admin/Concrete/ProjectStatusService.cs deleted file mode 100644 index e80190b85f..0000000000 --- a/backend/dal/Services/Admin/Concrete/ProjectStatusService.cs +++ /dev/null @@ -1,86 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Services.Admin -{ - /// - /// ProjectStatusService class, provides a service layer to administrate project status within the datasource. - /// - public class ProjectStatusService : BaseService, IProjectStatusService - { - #region Variables - #endregion - - #region Constructors - /// - /// Creates a new instance of a ProjectStatusService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public ProjectStatusService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) { } - #endregion - - #region Methods - /// - /// Get a page of project status from the datasource. - /// - /// - /// - /// - /// - public IEnumerable GetAll() - { - return this.Context.ProjectStatus.AsNoTracking().OrderBy(p => p.Name).ToArray(); - } - - /// - /// Get the project status for the specified 'id'. - /// - /// - /// ProjectStatus does not exists for the specified 'id'. - /// - public ProjectStatus Get(int id) - { - return this.Context.ProjectStatus.Find(id) ?? throw new KeyNotFoundException("Project status does not exist."); - } - - /// - /// Updates the specified project status in the datasource. - /// - /// - /// Entity does not exist in the datasource. - /// - public override void Update(ProjectStatus entity) - { - entity.ThrowIfNull(nameof(entity)); - - var project = Get(entity.Id); - - this.Context.Entry(project).CurrentValues.SetValues(entity); - base.Update(project); - } - - /// - /// Remove the specified project status from the datasource. - /// - /// Entity does not exist in the datasource. - /// - public override void Remove(ProjectStatus entity) - { - entity.ThrowIfNull(nameof(entity)); - - var project = Get(entity.Id); - - this.Context.Entry(project).CurrentValues.SetValues(entity); - base.Remove(project); - } - #endregion - } -} diff --git a/backend/dal/Services/Admin/Concrete/PropertyClassificationService.cs b/backend/dal/Services/Admin/Concrete/PropertyClassificationService.cs deleted file mode 100644 index b7f56914cd..0000000000 --- a/backend/dal/Services/Admin/Concrete/PropertyClassificationService.cs +++ /dev/null @@ -1,75 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Services.Admin -{ - /// - /// PropertyClassificationService class, provides a service layer to administrate property classifications within the datasource. - /// - public class PropertyClassificationService : BaseService, IPropertyClassificationService - { - #region Variables - #endregion - - #region Constructors - /// - /// Creates a new instance of a PropertyClassificationService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public PropertyClassificationService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) { } - #endregion - - #region Methods - /// - /// Get a page of property classifications from the datasource. - /// - /// - /// - /// - /// - public IEnumerable GetAll() - { - return this.Context.PropertyClassifications.AsNoTracking().OrderBy(p => p.Name).ToArray(); - } - - /// - /// Updates the specified property classification in the datasource. - /// - /// - /// - public override void Update(PropertyClassification entity) - { - entity.ThrowIfNull(nameof(entity)); - - var propertyClassification = this.Context.PropertyClassifications.Find(entity.Id); - if (propertyClassification == null) throw new KeyNotFoundException(); - - this.Context.Entry(propertyClassification).CurrentValues.SetValues(entity); - base.Update(propertyClassification); - } - - /// - /// Remove the specified property classification from the datasource. - /// - /// - public override void Remove(PropertyClassification entity) - { - entity.ThrowIfNull(nameof(entity)); - - var propertyClassification = this.Context.PropertyClassifications.Find(entity.Id); - if (propertyClassification == null) throw new KeyNotFoundException(); - - this.Context.Entry(propertyClassification).CurrentValues.SetValues(entity); - base.Remove(propertyClassification); - } - #endregion - } -} diff --git a/backend/dal/Services/Admin/Concrete/PropertyTypeService.cs b/backend/dal/Services/Admin/Concrete/PropertyTypeService.cs deleted file mode 100644 index 5fbed4a66f..0000000000 --- a/backend/dal/Services/Admin/Concrete/PropertyTypeService.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Services.Admin -{ - /// - /// PropertyTypeService class, provides a service layer to administrate property types within the datasource. - /// - public class PropertyTypeService : BaseService, IPropertyTypeService - { - #region Variables - #endregion - - #region Constructors - /// - /// Creates a new instance of a PropertyTypeService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public PropertyTypeService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) { } - #endregion - - #region Methods - /// - /// Get a page of property types from the datasource. - /// - /// - /// - /// - /// - public IEnumerable GetAll() - { - var query = this.Context.PropertyTypes.AsNoTracking(); - return query.OrderBy(p => p.Name).ToArray(); - } - - /// - /// Updates the specified property type in the datasource. - /// - /// - /// - public override void Update(PropertyType entity) - { - entity.ThrowIfNull(nameof(entity)); - - var propertyType = this.Context.PropertyTypes.Find(entity.Id); - if (propertyType == null) throw new KeyNotFoundException(); - - this.Context.Entry(propertyType).CurrentValues.SetValues(entity); - base.Update(propertyType); - } - - /// - /// Remove the specified property type from the datasource. - /// - /// - public override void Remove(PropertyType entity) - { - entity.ThrowIfNull(nameof(entity)); - - var propertyType = this.Context.PropertyTypes.Find(entity.Id); - if (propertyType == null) throw new KeyNotFoundException(); - - this.Context.Entry(propertyType).CurrentValues.SetValues(entity); - base.Remove(propertyType); - } - #endregion - } -} diff --git a/backend/dal/Services/Admin/Concrete/ProvinceService.cs b/backend/dal/Services/Admin/Concrete/ProvinceService.cs deleted file mode 100644 index 28201e3eaf..0000000000 --- a/backend/dal/Services/Admin/Concrete/ProvinceService.cs +++ /dev/null @@ -1,85 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Services.Admin -{ - /// - /// ProvinceService class, provides a service layer to administrate provinces within the datasource. - /// - public class ProvinceService : BaseService, IProvinceService - { - #region Variables - #endregion - - #region Constructors - /// - /// Creates a new instance of a ProvinceService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public ProvinceService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) { } - #endregion - - #region Methods - /// - /// Get a page of provinces from the datasource. - /// - /// - /// - /// - /// - public IEnumerable Get() - { - var query = this.Context.Provinces.AsNoTracking(); - return query.OrderBy(p => p.Name).ToArray(); - } - - /// - /// Get all provinces from the datasource. - /// - /// - public IEnumerable GetAll() - { - return this.Context.Provinces.OrderBy(p => p.Name).ToArray(); - } - - /// - /// Updates the specified province in the datasource. - /// - /// - /// - public override void Update(Province entity) - { - entity.ThrowIfNull(nameof(entity)); - - var province = this.Context.Provinces.Find(entity.Id); - if (province == null) throw new KeyNotFoundException(); - - this.Context.Entry(province).CurrentValues.SetValues(entity); - base.Update(province); - } - - /// - /// Remove the specified province from the datasource. - /// - /// - public override void Remove(Province entity) - { - entity.ThrowIfNull(nameof(entity)); - - var province = this.Context.Provinces.Find(entity.Id); - if (province == null) throw new KeyNotFoundException(); - - this.Context.Entry(province).CurrentValues.SetValues(entity); - base.Remove(province); - } - #endregion - } -} diff --git a/backend/dal/Services/Admin/Concrete/RoleService.cs b/backend/dal/Services/Admin/Concrete/RoleService.cs deleted file mode 100644 index 12cf04c568..0000000000 --- a/backend/dal/Services/Admin/Concrete/RoleService.cs +++ /dev/null @@ -1,159 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Services.Admin -{ - /// - /// RoleService class, provides a service layer to administrate users within the datasource. - /// - public class RoleService : BaseService, IRoleService - { - #region Variables - #endregion - - #region Constructors - /// - /// Creates a new instance of a RoleService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public RoleService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) { } - #endregion - - #region Methods - /// - /// Get a page of users from the datasource. - /// - /// - /// - /// - /// - public Paged Get(int page, int quantity, string name = null) - { - this.User.ThrowIfNotAuthorized(Permissions.AdminRoles); - - var query = this.Context.Roles.AsNoTracking(); - - if (!String.IsNullOrWhiteSpace(name)) - query = query.Where(r => EF.Functions.Like(r.Name, $"%{name}%")); - - var roles = query.Skip((page - 1) * quantity).Take(quantity); - return new Paged(roles.ToArray(), page, quantity, query.Count()); - } - - /// - /// Get the user with the specified 'id'. - /// - /// - /// Entity does not exist in the datasource. - /// - public Role Get(Guid id) - { - this.User.ThrowIfNotAuthorized(Permissions.AdminRoles); - - return this.Context.Roles - .Include(r => r.Claims) - .ThenInclude(r => r.Claim) - .AsNoTracking() - .FirstOrDefault(u => u.Id == id) ?? throw new KeyNotFoundException(); - } - - /// - /// Get the role with the specified name. - /// - /// - /// Entity does not exist in the datasource. - /// - public Role GetByName(string name) - { - return this.Context.Roles - .Include(r => r.Claims) - .ThenInclude(r => r.Claim) - .AsNoTracking() - .FirstOrDefault(r => r.Name == name) ?? throw new KeyNotFoundException(); - } - - /// - /// Get the user with the specified keycloak group 'id'. - /// - /// - /// Entity does not exist in the datasource. - /// - public Role GetByKeycloakId(Guid id) - { - this.User.ThrowIfNotAuthorized(Permissions.AdminRoles); - - return this.Context.Roles - .Include(r => r.Claims) - .ThenInclude(r => r.Claim) - .AsNoTracking() - .FirstOrDefault(u => u.KeycloakGroupId == id) ?? throw new KeyNotFoundException(); - } - - /// - /// Updates the specified role in the datasource. - /// - /// - /// Entity does not exist in the datasource. - /// - public override void Update(Role entity) - { - entity.ThrowIfNull(nameof(entity)); - this.User.ThrowIfNotAuthorized(Permissions.AdminRoles); - - var role = this.Context.Roles.Find(entity.Id) ?? throw new KeyNotFoundException(); - - this.Context.Entry(role).CurrentValues.SetValues(entity); - base.Update(role); - this.Context.Detach(role); - } - - /// - /// Remove the specified role from the datasource. - /// - /// - /// Entity does not exist in the datasource. - public override void Remove(Role entity) - { - entity.ThrowIfNull(nameof(entity)); - this.User.ThrowIfNotAuthorized(Permissions.AdminRoles); - - var role = this.Context.Roles.Find(entity.Id) ?? throw new KeyNotFoundException(); - - this.Context.Entry(role).CurrentValues.SetValues(entity); - base.Remove(role); - } - - /// - /// Remove the roles from the datasource, excluding those listed. - /// - /// - /// - public int RemoveAll(Guid[] exclude) - { - this.User.ThrowIfNotAuthorized(Permissions.AdminRoles); - var roles = this.Context.Roles.Include(r => r.Claims).Include(r => r.Users).Where(r => !exclude.Contains(r.Id)); - roles.ForEach(r => - { - r.Claims.Clear(); - r.Users.Clear(); - }); - - this.Context.Roles.RemoveRange(roles); - var result = this.Context.CommitTransaction(); - return result; - } - #endregion - } -} diff --git a/backend/dal/Services/Admin/Concrete/TierLevelService.cs b/backend/dal/Services/Admin/Concrete/TierLevelService.cs deleted file mode 100644 index bc434d4bc6..0000000000 --- a/backend/dal/Services/Admin/Concrete/TierLevelService.cs +++ /dev/null @@ -1,86 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Services.Admin -{ - /// - /// TierLevelService class, provides a service layer to administrate tier levels within the datasource. - /// - public class TierLevelService : BaseService, ITierLevelService - { - #region Variables - #endregion - - #region Constructors - /// - /// Creates a new instance of a TierLevelService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public TierLevelService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) { } - #endregion - - #region Methods - /// - /// Get a page of tier levels from the datasource. - /// - /// - /// - /// - /// - public IEnumerable GetAll() - { - return this.Context.TierLevels.AsNoTracking().OrderBy(p => p.Name).ToArray(); - } - - /// - /// Get the tier level for the specified 'id'. - /// - /// - /// TierLevel does not exists for the specified 'id'. - /// - public TierLevel Get(int id) - { - return this.Context.TierLevels.Find(id) ?? throw new KeyNotFoundException(); - } - - /// - /// Updates the specified tier level in the datasource. - /// - /// - /// Entity does not exist in the datasource. - /// - public override void Update(TierLevel entity) - { - entity.ThrowIfNull(nameof(entity)); - - var tierLevel = this.Context.TierLevels.Find(entity.Id) ?? throw new KeyNotFoundException(); - - this.Context.Entry(tierLevel).CurrentValues.SetValues(entity); - base.Update(tierLevel); - } - - /// - /// Remove the specified tier level from the datasource. - /// - /// Entity does not exist in the datasource. - /// - public override void Remove(TierLevel entity) - { - entity.ThrowIfNull(nameof(entity)); - - var tierLevel = this.Context.TierLevels.Find(entity.Id) ?? throw new KeyNotFoundException(); - - this.Context.Entry(tierLevel).CurrentValues.SetValues(entity); - base.Remove(tierLevel); - } - #endregion - } -} diff --git a/backend/dal/Services/Admin/Concrete/UserService.cs b/backend/dal/Services/Admin/Concrete/UserService.cs deleted file mode 100644 index cd5fb14ab3..0000000000 --- a/backend/dal/Services/Admin/Concrete/UserService.cs +++ /dev/null @@ -1,696 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using Pims.Dal.Entities.Comparers; -using Pims.Dal.Entities.Models; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; -using Microsoft.Extensions.Configuration; -using System.Text.Json; -using System.Text.Json.Nodes; -using System.IdentityModel.Tokens.Jwt; - -namespace Pims.Dal.Services.Admin -{ - /// - /// UserService class, provides a service layer to administrate users within the datasource. - /// - public class UserService : BaseService, IUserService - { - private IConfiguration configuration; - #region Variables - private string access_token = ""; - - private readonly ILogger _logger; - #endregion - - #region Constructors - /// - /// Creates a new instance of a UserService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public UserService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger, IConfiguration configuration) : base(dbContext, user, service, logger) - { - this.configuration = configuration; - _logger = logger; - } - #endregion - - #region Methods - /// - /// Get the total number of user accounts. - /// - /// - public int Count() - { - return this.Context.Users.Count(); - } - - /// - /// Get a page of users from the datasource. - /// The filter will allow queries to search for anything that starts with the following properties; DisplayName, FirstName, LastName, Email, Agencies. - /// - /// - /// - /// - public Paged Get(int page, int quantity) - { - return Get(new UserFilter(page, quantity)); - } - - /// - /// Get a page of users from the datasource. - /// The filter will allow queries to search for the following property values; DisplayName, FirstName, LastName, Email, Agencies. - /// - /// - /// - public Paged Get(UserFilter filter = null) - { - this.User.ThrowIfNotAuthorized(Permissions.AdminUsers); - - var query = this.Context.Users - .Include(u => u.Agencies).ThenInclude(a => a.Agency) - .Include(u => u.Roles).ThenInclude(r => r.Role) - .Include(u => u.CreatedBy) - .Include(u => u.UpdatedBy) - .Include(u => u.ApprovedBy) - .AsNoTracking() - .Where(u => !u.IsSystem); - - IEnumerable userAgencies = this.Self.User.GetAgencies(this.User.GetUsername()); - if (userAgencies != null && User.HasPermission(Permissions.AgencyAdmin) && !User.HasPermission(Permissions.SystemAdmin)) - { - query = query.Where(user => user.Agencies.Any(a => userAgencies.Contains(a.AgencyId))); - } - - if (filter != null) - { - if (filter.Page < 1) filter.Page = 1; - if (filter.Quantity < 1) filter.Quantity = 1; - if (filter.Sort == null) filter.Sort = new string[] { }; - - if (!string.IsNullOrWhiteSpace(filter.Username)) - query = query.Where(u => EF.Functions.Like(u.Username, $"%{filter.Username}%")); - if (!string.IsNullOrWhiteSpace(filter.DisplayName)) - query = query.Where(u => EF.Functions.Like(u.DisplayName, $"%{filter.DisplayName}%")); - if (!string.IsNullOrWhiteSpace(filter.FirstName)) - query = query.Where(u => EF.Functions.Like(u.FirstName, $"%{filter.FirstName}%")); - if (!string.IsNullOrWhiteSpace(filter.LastName)) - query = query.Where(u => EF.Functions.Like(u.LastName, $"%{filter.LastName}%")); - if (!string.IsNullOrWhiteSpace(filter.Email)) - query = query.Where(u => EF.Functions.Like(u.Email, $"%{filter.Email}%")); - if (!string.IsNullOrWhiteSpace(filter.Position)) - query = query.Where(u => EF.Functions.Like(u.Position, $"%{filter.Position}%")); - if (filter.IsDisabled != null) - query = query.Where(u => u.IsDisabled == filter.IsDisabled); - if (!string.IsNullOrWhiteSpace(filter.Role)) - query = query.Where(u => u.Roles.Any(r => - EF.Functions.Like(r.Role.Name, $"%{filter.Role}"))); - if (!string.IsNullOrWhiteSpace(filter.Agency)) - query = query.Where(u => u.Agencies.Any(a => - EF.Functions.Like(a.Agency.Name, $"%{filter.Agency}") || EF.Functions.Like(a.Agency.Parent.Name, $"%{filter.Agency}"))); - - if (filter.Sort.Any()) - { - if (filter.Sort[0].StartsWith("Agency")) - { - var direction = filter.Sort[0].Split(" ")[1]; - query = direction == "asc" ? - query.OrderBy(u => u.Agencies.Any() ? u.Agencies.FirstOrDefault().Agency.Name : null) - : query.OrderByDescending(u => u.Agencies.Any() ? u.Agencies.FirstOrDefault().Agency.Name : null); - } - else - { - query = query.OrderByProperty(filter.Sort); - - } - - } - } - var users = query.Skip((filter.Page - 1) * filter.Quantity).Take(filter.Quantity); - return new Paged(users.ToArray(), filter.Page, filter.Quantity, query.Count()); - } - - /// - /// Get the user with the specified 'id'. - /// - /// - /// Entity does not exist in the datasource. - /// - public GoldUser Get(Guid id) - { - this.User.ThrowIfNotAuthorized(Permissions.AdminUsers); - - var user = this.Context.Users - .Include(u => u.Roles) - .ThenInclude(r => r.Role) - .Include(u => u.Agencies) - .ThenInclude(a => a.Agency) - .AsNoTracking() - .SingleOrDefault(u => u.Id == id); - - if (user == null) throw new KeyNotFoundException(); - GoldUser gUser = new GoldUser(user); - string identityProvider = gUser.Username.Split("@").Last(); - - if (identityProvider == "idir") - { - try - { - string preferred_username = GetUsersPreferredUsername(gUser.Email, identityProvider).Result; - gUser.GoldUserRoles = GetGoldUsersRolesAsync(preferred_username).Result; - } - catch - { - return gUser; - } - - - } - else if (identityProvider.Contains("bceid")) - { - try - { - string preferred_username = GetUsersPreferredUsername(gUser.KeycloakUserId ?? Guid.Empty, identityProvider).Result; - gUser.GoldUserRoles = GetGoldUsersRolesAsync(preferred_username).Result; - } - catch - { - return gUser; - } - - } - return gUser; - - } - - /// - /// Get the user with the specified 'id'. - /// - /// - /// Entity does not exist in the datasource. - /// - public GoldUser Get(string username) - { - this.User.ThrowIfNotAuthorized(Permissions.AdminUsers); - - var user = this.Context.Users - .Include(u => u.Roles) - .ThenInclude(r => r.Role) - .Include(u => u.Agencies) - .ThenInclude(a => a.Agency) - .AsNoTracking() - .SingleOrDefault(u => u.Username == username); - - if (user == null) throw new KeyNotFoundException(); - GoldUser gUser = new GoldUser(user); - string preferred_username = GetUsersPreferredUsername(gUser.KeycloakUserId ?? Guid.Empty, gUser.Username.Split("@").Last()).Result; - gUser.GoldUserRoles = GetGoldUsersRolesAsync(preferred_username).Result; - return gUser; - - } - - /// - /// Get the user with the specified 'keycloakUserId'. - /// - /// - /// Entity does not exist in the datasource. - /// - public User GetForKeycloakUserId(Guid keycloakUserId) - { - this.User.ThrowIfNotAuthorized(Permissions.AdminUsers); - - return this.Context.Users - .Include(u => u.Roles) - .ThenInclude(r => r.Role) - .Include(u => u.Agencies) - .ThenInclude(a => a.Agency) - .AsNoTracking() - .SingleOrDefault(u => u.KeycloakUserId == keycloakUserId) ?? throw new KeyNotFoundException(); - } - - /// - /// Add the specified user to the datasource. - /// - /// - /// - public override void Add(User user) - { - user.ThrowIfNull(nameof(user)); - - user.Roles.ForEach(r => this.Context.Entry(r).State = EntityState.Added); - user.Agencies.ForEach(a => this.Context.Entry(a).State = EntityState.Added); - - base.Add(user); - this.Context.Detach(user); - } - - /// - /// Updates the specified user in the datasource. - /// - /// - /// Entity does not exist in the datasource. - /// - public override void Update(User user) - { - user.ThrowIfNull(nameof(user)); - - var existingUser = this.Context.Users - .Include(u => u.Agencies) - .Include(u => u.Roles) - .AsNoTracking() - .FirstOrDefault(u => u.Id == user.Id) ?? throw new KeyNotFoundException(); - - this.Context.SetOriginalRowVersion(existingUser); - - //This is bad, but it's such an edge case where it would cause a big issue... - user.RowVersion = existingUser.RowVersion; - - if (!existingUser.Agencies.Any()) - { - var username = this.User.GetUsername(); - user.ApprovedById = this.Context.Users.Where(u => u.Username == username).Select(u => u.Id).FirstOrDefault(); - user.ApprovedOn = DateTime.UtcNow; - } - GoldUser gUser = this.Get(this.User.GetUsername()); - - var addRoles = user.Roles.Except(existingUser.Roles, new UserRoleRoleIdComparer()); //gUser.GoldUserRoles; //.Except(user.Roles, new UserRoleRoleIdComparer()); - addRoles.ForEach(r => this.Context.Entry(r).State = EntityState.Added); - var removeRoles = existingUser.Roles.Except(user.Roles, new UserRoleRoleIdComparer()); - removeRoles.ForEach(r => this.Context.Entry(r).State = EntityState.Deleted); - - var addAgencies = user.Agencies.Except(existingUser.Agencies, new UserAgencyAgencyIdComparer()); - addAgencies.ForEach(a => this.Context.Entry(a).State = EntityState.Added); - var removeAgencies = existingUser.Agencies.Except(user.Agencies, new UserAgencyAgencyIdComparer()); - removeAgencies.ForEach(a => this.Context.Entry(a).State = EntityState.Deleted); - - user.ApprovedById = existingUser.ApprovedById; - user.ApprovedOn = existingUser.ApprovedOn; - user.CreatedById = existingUser.CreatedById; - user.CreatedOn = existingUser.CreatedOn; - user.LastLogin = existingUser.LastLogin; - - base.Update(user); - this.Context.Detach(user); - } - - /// - /// Remove the specified user from the datasource. - /// - /// Entity does not exist in the datasource. - /// - public override void Remove(User user) - { - user.ThrowIfNull(nameof(user)); - - var existingUser = this.Context.Users - .Include(u => u.Agencies) - .Include(u => u.Roles) - .AsNoTracking() - .FirstOrDefault(u => u.Id == user.Id) ?? throw new KeyNotFoundException(); - - this.Context.SetOriginalRowVersion(existingUser); - - existingUser.Roles.Clear(); - existingUser.Agencies.Clear(); - - base.Remove(existingUser); - } - - /// - /// Get all of the given user's roles from keycloak - /// - /// - public async Task> GetGoldUsersRolesAsync(string preferred_username) - { - // TODO: Iterate on the following to make this D.R.Y. - HttpClient _httpClient = new HttpClient(); - string token = await GetToken(); - - // Keycloak Gold only wants the clientID as a number, which is always at the end of the id, after a "-" - string frontendId = this.configuration["Keycloak:FrontendClientId"].Split("-").Last(); - HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, this.configuration["Keycloak:BaseURL"] + $"integrations/{frontendId}/{getEnv()}/users/{preferred_username}/roles"); - _logger.LogDebug($"Test Logging the request to Keycloak '{request}'"); - - request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", token); - HttpResponseMessage response = await _httpClient.SendAsync(request); - if (!response.IsSuccessStatusCode) throw new Exception("Unable to fetch roles from Keycloak Gold"); - string payload = await response.Content.ReadAsStringAsync(); - JsonDocument json = JsonDocument.Parse(payload); - - _logger.LogDebug($"Test Logging the response from Keycloak '{json.RootElement.ToString()}'"); - IEnumerable roles = json.RootElement.GetProperty("data").EnumerateArray().Select(r => r.GetProperty("name").GetString()); - _logger.LogDebug($"Test Logging the Keycloak roles: '{string.Join(", ", roles)}'"); - - return roles; - } - - /// - /// Get the given user's preferred username, which is required for subsequent Keycloak Gold API calls - /// - /// - /// Rather @idir or @bceid - public async Task GetUsersPreferredUsername(Guid keycloakGuid, string identityProvider) - { - string idp = identityProvider == "idir" ? "idir" : "basic-business-bceid"; - string guid = keycloakGuid.ToString().Replace("-", ""); - _logger.LogDebug($"Test Logging the Keycloak guid '{guid}'"); - - // TODO: Iterate on the following to make this D.R.Y. - HttpClient _httpClient = new HttpClient(); - string token = await GetToken(); - - // Keycloak Gold only wants the clientID as a number, which is always at the end of the id, after a "-" - string frontendId = this.configuration["Keycloak:FrontendClientId"].Split("-").Last(); - HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, $"https://api.loginproxy.gov.bc.ca/api/v1/{getEnv()}/{idp}/users?guid={guid}"); - request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", token); - HttpResponseMessage response = await _httpClient.SendAsync(request); - if (!response.IsSuccessStatusCode) throw new Exception("Unable to get user's username from Keycloak Gold"); - string payload = await response.Content.ReadAsStringAsync(); - - JsonDocument json = JsonDocument.Parse(payload); - JsonElement dataElement = json.RootElement.GetProperty("data"); - - _logger.LogDebug($"Test Logging response object Keycloak '{dataElement}'"); - // handle the potential empty sequence: - if (dataElement.EnumerateArray().Any()) - { - string username = dataElement.EnumerateArray().First().GetProperty("username").GetString(); - _logger.LogDebug($"Test Logging Keycloak reponse for username '{username}'"); - return username; - } - else - { - // Handle the case where the "data" array is empty. - _logger.LogDebug($"Test Logging Keycloak reponse was an empty array '{dataElement}'"); - throw new Exception("No user data found in the response from Keycloak Gold"); - } - } - - /// - /// Get the given user's preferred username, which is required for subsequent Keycloak Gold API calls - /// - /// - /// Rather @idir or @bceid - public async Task GetUsersPreferredUsername(string email, string identityProvider) - { - string idp = identityProvider == "idir" ? "idir" : "basic-business-bceid"; - - // TODO: Iterate on the following to make this D.R.Y. - HttpClient _httpClient = new HttpClient(); - string token = await GetToken(); - - // Keycloak Gold only wants the clientID as a number, which is always at the end of the id, after a "-" - string frontendId = this.configuration["Keycloak:FrontendClientId"].Split("-").Last(); - HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, $"https://api.loginproxy.gov.bc.ca/api/v1/{getEnv()}/{idp}/users?email={email}"); - _logger.LogDebug($"Test Logging the request for username to Keycloak '{request}'"); - request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", token); - HttpResponseMessage response = await _httpClient.SendAsync(request); - if (!response.IsSuccessStatusCode) throw new Exception("Unable to get user's username from Keycloak Gold"); - string payload = await response.Content.ReadAsStringAsync(); - - JsonDocument json = JsonDocument.Parse(payload); - _logger.LogDebug($"Test Logging the response for username from Keycloak '{json.RootElement.ToString()}'"); - string username = json.RootElement.GetProperty("data").EnumerateArray().First().GetProperty("username").GetString(); - - return username; - } - - /// - /// Update user's roles in Keycloak, given an array of role names - /// - /// - /// - public async Task UpdateGoldRolesAsync(string preferred_username, IEnumerable roles) - { - // TODO: Iterate on the following to make this D.R.Y. - HttpClient _httpClient = new HttpClient(); - string token = await GetToken(); - - string frontendId = this.configuration["Keycloak:FrontendClientId"].Split("-").Last(); - - HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, this.configuration["Keycloak:BaseURL"] + $"integrations/{frontendId}/{getEnv()}/users/{preferred_username}/roles"); - request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", token); - var serializableRoles = roles.Select(role => new { name = role }); - string json = JsonSerializer.Serialize(serializableRoles); - request.Content = new StringContent(json, Encoding.UTF8, "application/json"); - HttpResponseMessage response = await _httpClient.SendAsync(request); - if (!response.IsSuccessStatusCode) throw new Exception("Unable to update roles in Keycloak Gold"); - - // JObject payload = JObject.Parse(await response.Content.ReadAsStringAsync()); - - return response.Content.ReadAsStringAsync().Result; - } - - /// - /// Get user roles from Keycloak - /// - public async Task> GetRolesAsync() - { - // TODO: Iterate on the following to make this D.R.Y. - HttpClient _httpClient = new HttpClient(); - string token = await GetToken(); - - string frontendId = this.configuration["Keycloak:FrontendClientId"].Split("-").Last(); - - HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, this.configuration["Keycloak:BaseURL"] + $"integrations/{frontendId}/{getEnv()}/roles"); - request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", token); - HttpResponseMessage response = await _httpClient.SendAsync(request); - if (!response.IsSuccessStatusCode) throw new Exception("Unable to get roles from Keycloak Gold"); - string payload = await response.Content.ReadAsStringAsync(); - - JsonDocument json = JsonDocument.Parse(payload); - IEnumerable roles = json.RootElement.GetProperty("data").EnumerateArray().Select(r => r.GetProperty("name").GetString()); - - return roles; - } - - /// - /// Add a role to the given user in Keycloak Gold - /// - /// - /// - public async Task AddRoleToUser(string preferred_username, string roleName) - { - // TODO: Iterate on the following to make this D.R.Y. - HttpClient _httpClient = new HttpClient(); - string token = await GetToken(); - - string frontendId = this.configuration["Keycloak:FrontendClientId"].Split("-").Last(); - - HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, this.configuration["Keycloak:BaseURL"] + $"integrations/{frontendId}/{getEnv()}/users/{preferred_username}/roles"); - request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", token); - var serializableRole = new object[] { new { name = roleName } }; - string json = JsonSerializer.Serialize(serializableRole); - request.Content = new StringContent(json, Encoding.UTF8, "application/json"); - HttpResponseMessage response = await _httpClient.SendAsync(request); - if (!response.IsSuccessStatusCode) throw new Exception("Unable to add role in Keycloak Gold"); - - // JObject payload = JObject.Parse(await response.Content.ReadAsStringAsync()); - - return response.Content.ReadAsStringAsync().Result; - } - - /// - /// Delete a role for the given user in Keycloak Gold - /// - /// - /// - public async Task DeleteRoleFromUser(string preferred_username, string roleName) - { - // TODO: Iterate on the following to make this D.R.Y. - HttpClient _httpClient = new HttpClient(); - string token = await GetToken(); - - string frontendId = this.configuration["Keycloak:FrontendClientId"].Split("-").Last(); - - HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Delete, this.configuration["Keycloak:BaseURL"] + $"integrations/{frontendId}/{getEnv()}/users/{preferred_username}/roles/{roleName}"); - request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", token); - HttpResponseMessage response = await _httpClient.SendAsync(request); - if (!response.IsSuccessStatusCode) throw new Exception("Unable to delete role from user in Keycloak Gold"); - - return response.Content.ReadAsStringAsync().Result; - } - - private string getEnv() - { - string envName = this.configuration["Pims:Environment:Name"]; - - if (envName == "Production") - { - return "prod"; - } - else if (envName == "Testing") - { - return "test"; - } - else - { - return "dev"; - } - - } - - - /// - /// Get an access token for the Keycloak Gold API - /// - public async Task GetToken() - { - if (isTokenValid(this.access_token)) return this.access_token; - - HttpClient _httpClient = new HttpClient(); - HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, "https://api.loginproxy.gov.bc.ca/api/v1/token"); - request.Content = new FormUrlEncodedContent(new Dictionary - { - {"client_id", this.configuration["Keycloak:ServiceAccount:Client"]}, - {"client_secret", this.configuration["Keycloak:ServiceAccount:Secret"]}, - {"grant_type", "client_credentials"} - }); - request.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/x-www-form-urlencoded"); - HttpResponseMessage response = await _httpClient.SendAsync(request); - if (!response.IsSuccessStatusCode) throw new Exception("Unable to get token from Keycloak Gold"); - JsonNode payload = JsonNode.Parse(await response.Content.ReadAsStringAsync()); - string token = payload["access_token"].ToString(); - this.access_token = token; - return token; - } - /// - /// Tests the validity of a JWT - /// - /// - private bool isTokenValid(string token) - { - try - { - var handler = new JwtSecurityTokenHandler(); - var decodedToken = handler.ReadJwtToken(this.access_token); - return decodedToken.ValidTo >= DateTime.UtcNow; - } - catch - { - return false; - } - } - - /// - /// Update the database using the passed AccessRequest - /// - /// - public AccessRequest UpdateAccessRequest(AccessRequest accessRequest) - { - var existingAccessRequest = GetAccessRequest(accessRequest.Id); - this.Context.SetOriginalRowVersion(existingAccessRequest); - - var isApproving = accessRequest.Status == AccessRequestStatus.Approved && existingAccessRequest.Status != AccessRequestStatus.Approved; - - existingAccessRequest.Note = accessRequest.Note; - existingAccessRequest.Status = accessRequest.Status; - existingAccessRequest.Roles.Clear(); - accessRequest.Roles.ForEach(r => existingAccessRequest.Roles.Add(new AccessRequestRole(existingAccessRequest.Id, r.RoleId))); - existingAccessRequest.Agencies.Clear(); - accessRequest.Agencies.ForEach(a => existingAccessRequest.Agencies.Add(new AccessRequestAgency(existingAccessRequest.Id, a.AgencyId))); - - if (isApproving) - { - var approvedUser = this.Context.Users.Find(existingAccessRequest.UserId); - string username = this.User.GetUsername(); - approvedUser.ApprovedById = this.Context.Users.Where(u => u.Username == username).Select(u => u.Id).FirstOrDefault(); - approvedUser.ApprovedOn = DateTime.UtcNow; - this.Context.Users.Update(approvedUser); - } - - Context.Entry(existingAccessRequest).State = EntityState.Modified; - this.Context.CommitTransaction(); - return accessRequest; - } - - /// - /// Get the access request with matching id - /// - /// - public AccessRequest GetAccessRequest(int id) - { - this.User.ThrowIfNotAuthorized(Permissions.AdminUsers); - - return this.Context.AccessRequests - .Include(p => p.Agencies) - .ThenInclude(p => p.Agency) - .Include(p => p.Roles) - .ThenInclude(p => p.Role) - .Include(p => p.User) - .AsNoTracking() - .Where(ar => ar.Id == id) - .FirstOrDefault() ?? throw new KeyNotFoundException(); - } - - /// - /// Get all the access requests that users have submitted to the system - /// - /// - /// - /// - /// - public Paged GetAccessRequests(int page = 1, int quantity = 10, string sort = null, - AccessRequestStatus status = AccessRequestStatus.OnHold) - { - var sortArray = !string.IsNullOrWhiteSpace(sort) ? new[] { sort } : new string[0]; - var filter = new AccessRequestFilter(page, quantity, sortArray, null, null, null, status); - return GetAccessRequests(filter); - } - - /// - /// Get all the access requests that users have match the specified filter - /// - /// - public Paged GetAccessRequests(AccessRequestFilter filter) - { - this.User.ThrowIfNotAuthorized(Permissions.AdminUsers); - - var query = this.Context.AccessRequests - .Include(p => p.Agencies) - .ThenInclude(p => p.Agency) - .Include(p => p.Roles) - .ThenInclude(p => p.Role) - .Include(p => p.User) - .AsNoTracking(); - - IEnumerable userAgencies = this.Self.User.GetAgencies(this.User.GetUsername()); - if (userAgencies != null && User.HasPermission(Permissions.AgencyAdmin) && !User.HasPermission(Permissions.SystemAdmin)) - { - query = query.Where(accessRequest => accessRequest.Agencies.Any(a => userAgencies.Contains(a.AgencyId))); - } - - query = query.Where(request => request.Status == filter.Status); - - if (!string.IsNullOrWhiteSpace(filter.Role)) - query = query.Where(ar => ar.Roles.Any(r => - EF.Functions.Like(r.Role.Name, $"%{filter.Role}%"))); - - if (!string.IsNullOrWhiteSpace(filter.Agency)) - query = query.Where(ar => ar.Agencies.Any(a => - EF.Functions.Like(a.Agency.Name, $"%{filter.Agency}%"))); - - if (!string.IsNullOrWhiteSpace(filter.SearchText)) - { - query = query.Where(ar => EF.Functions.Like(ar.User.Username, $"%{filter.SearchText}%")); - } - - var accessRequests = query.Skip((filter.Page - 1) * filter.Quantity).Take(filter.Quantity); - return new Paged(accessRequests, filter.Page, filter.Quantity, query.Count()); - } - - #endregion - } -} diff --git a/backend/dal/Services/Admin/Concrete/WorkflowService.cs b/backend/dal/Services/Admin/Concrete/WorkflowService.cs deleted file mode 100644 index c6efa2983e..0000000000 --- a/backend/dal/Services/Admin/Concrete/WorkflowService.cs +++ /dev/null @@ -1,103 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Services.Admin -{ - /// - /// WorkflowService class, provides a service layer to administrate workflows within the datasource. - /// - public class WorkflowService : BaseService, IWorkflowService - { - #region Variables - #endregion - - #region Constructors - /// - /// Creates a new instance of a WorkflowService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public WorkflowService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) { } - #endregion - - #region Methods - /// - /// Get a page of workflows from the datasource. - /// - /// - /// - /// - /// - public IEnumerable GetAll() - { - return this.Context.Workflows.AsNoTracking().OrderBy(p => p.Name).ToArray(); - } - - /// - /// Get the workflow for the specified 'id'. - /// - /// - /// Workflow does not exists for the specified 'id'. - /// - public Workflow Get(int id) - { - return this.Context.Workflows.Find(id) ?? throw new KeyNotFoundException(); - } - - /// - /// Get an array of workflows that are associated with the specified project 'code'. - /// - /// - /// - public IEnumerable GetForStatus(string code) - { - return ( - from s in this.Context.ProjectStatus - join ws in this.Context.WorkflowProjectStatus on s.Id equals ws.StatusId - join w in this.Context.Workflows.Include(w => w.Status).ThenInclude(s => s.Status) on ws.WorkflowId equals w.Id - where s.Code == code - select w - ) - .ToArray(); - } - - /// - /// Updates the specified workflow in the datasource. - /// - /// - /// Entity does not exist in the datasource. - /// - public override void Update(Workflow entity) - { - entity.ThrowIfNull(nameof(entity)); - - var workflow = this.Context.Workflows.Find(entity.Id) ?? throw new KeyNotFoundException(); - - this.Context.Entry(workflow).CurrentValues.SetValues(entity); - base.Update(workflow); - } - - /// - /// Remove the specified workflow from the datasource. - /// - /// Entity does not exist in the datasource. - /// - public override void Remove(Workflow entity) - { - entity.ThrowIfNull(nameof(entity)); - - var workflow = this.Context.Workflows.Find(entity.Id) ?? throw new KeyNotFoundException(); - - this.Context.Entry(workflow).CurrentValues.SetValues(entity); - base.Remove(workflow); - } - #endregion - } -} diff --git a/backend/dal/Services/Admin/IAddressService.cs b/backend/dal/Services/Admin/IAddressService.cs deleted file mode 100644 index 6419c91f9a..0000000000 --- a/backend/dal/Services/Admin/IAddressService.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Pims.Dal.Entities; - -namespace Pims.Dal.Services.Admin -{ - /// - /// IAddressService interface, provides a service layer to administer addresses within the datasource. - /// - public interface IAddressService : IBaseService
- { } -} diff --git a/backend/dal/Services/Admin/IAdministrativeAreaService.cs b/backend/dal/Services/Admin/IAdministrativeAreaService.cs deleted file mode 100644 index c4e14422c2..0000000000 --- a/backend/dal/Services/Admin/IAdministrativeAreaService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Pims.Dal.Entities; -using System.Collections.Generic; -using Pims.Dal.Entities.Models; - -namespace Pims.Dal.Services.Admin -{ - /// - /// IAdministrativeAreaService interface, provides a service layer to administer administrative areas (city, municipality, district, etc.) within the datasource. - /// - public interface IAdministrativeAreaService : IBaseService - { - AdministrativeArea Get(string name); - AdministrativeArea Get(int id); - Paged Get(AdministrativeAreaFilter filter); - Paged Get(int page, int quantity); - IEnumerable GetAll(); - } -} diff --git a/backend/dal/Services/Admin/IAgencyService.cs b/backend/dal/Services/Admin/IAgencyService.cs deleted file mode 100644 index 17ff3c35b1..0000000000 --- a/backend/dal/Services/Admin/IAgencyService.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using System.Collections.Generic; - -namespace Pims.Dal.Services.Admin -{ - /// - /// IAgencyService interface, provides a service layer to administer agencies within the datasource. - /// - public interface IAgencyService : IBaseService - { - IEnumerable GetAll(); - Agency Get(int id); - Paged Get(int page, int quantity); - Paged Get(AgencyFilter filter); - } -} diff --git a/backend/dal/Services/Admin/IBaseService`.cs b/backend/dal/Services/Admin/IBaseService`.cs deleted file mode 100644 index aac7d4d22a..0000000000 --- a/backend/dal/Services/Admin/IBaseService`.cs +++ /dev/null @@ -1,64 +0,0 @@ -using Pims.Dal.Entities; - -namespace Pims.Dal.Services.Admin -{ - /// - /// IBaseService interface, provides a service layer for basic CRUD actions with the datasource. - /// - /// - public interface IBaseService : IService - where ET : BaseEntity - { - #region Methods - /// - /// Find the entity with the specified key in the datasource. - /// - /// - /// - /// - ET Find(params object[] keyValues); - - /// - /// Add the specified entity to the datasource. - /// - /// - /// - void Add(ET entity); - - /// - /// Add the specified entity to the in-memory collection but do not commit to the datasource. - /// - /// - /// - void AddOne(ET entity); - - /// - /// Update the specified entity in the datasource. - /// - /// - /// - void Update(ET entity); - - /// - /// Update the specified entity to the in-memory collection but do not commit to the datasource. - /// - /// - /// - void UpdateOne(ET entity); - - /// - /// Remove the specified entity from the datasource. - /// - /// - /// - void Remove(ET entity); - - /// - /// Remove the specified entity from the in-memory collection but do not commit to the datasource. - /// - /// - /// - void RemoveOne(ET entity); - #endregion - } -} diff --git a/backend/dal/Services/Admin/IBuildingConstructionTypeService.cs b/backend/dal/Services/Admin/IBuildingConstructionTypeService.cs deleted file mode 100644 index 182911f760..0000000000 --- a/backend/dal/Services/Admin/IBuildingConstructionTypeService.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Pims.Dal.Entities; -using System.Collections.Generic; - -namespace Pims.Dal.Services.Admin -{ - /// - /// IBuildingConstructionTypeService interface, provides a service layer to administer building construction types within the datasource. - /// - public interface IBuildingConstructionTypeService : IBaseService - { - IEnumerable GetAll(); - } -} diff --git a/backend/dal/Services/Admin/IBuildingPredominateUseService.cs b/backend/dal/Services/Admin/IBuildingPredominateUseService.cs deleted file mode 100644 index 56fe30844d..0000000000 --- a/backend/dal/Services/Admin/IBuildingPredominateUseService.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Pims.Dal.Entities; -using System.Collections.Generic; - -namespace Pims.Dal.Services.Admin -{ - /// - /// IBuildingPredominateUseService interface, provides a service layer to administer building predominate uses types within the datasource. - /// - public interface IBuildingPredominateUseService : IBaseService - { - IEnumerable GetAll(); - } -} diff --git a/backend/dal/Services/Admin/IBuildingService.cs b/backend/dal/Services/Admin/IBuildingService.cs deleted file mode 100644 index bba79d66fe..0000000000 --- a/backend/dal/Services/Admin/IBuildingService.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using System.Collections.Generic; - -namespace Pims.Dal.Services.Admin -{ - /// - /// IBuildingService interface, provides a service layer to administer buildings within the datasource. - /// - public interface IBuildingService : IBaseService - { - Paged Get(int page, int quantity, string sort); - Building Get(int id); - IEnumerable GetByPid(int pid, string name = null); - IEnumerable GetByPidWithoutTracking(int pid, string name = null); - IEnumerable GetByName(string name); - IEnumerable GetByNameWithoutTracking(string name); - IEnumerable GetByPidNameWithoutTracking(int pid = 0, string name = null); - IEnumerable GetByNameAddressWithoutTracking(string name, string address); - - void LoadParcelsFor(Building building); - IEnumerable Add(IEnumerable buildings); - void UpdateFinancials(Building building); - } -} diff --git a/backend/dal/Services/Admin/IClaimService.cs b/backend/dal/Services/Admin/IClaimService.cs deleted file mode 100644 index f0cd4d0f47..0000000000 --- a/backend/dal/Services/Admin/IClaimService.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using System; - -namespace Pims.Dal.Services.Admin -{ - /// - /// IClaimService interface, provides a service layer to administer roles within the datasource. - /// - public interface IClaimService : IBaseService - { - Paged Get(int page, int quantity, string name = null); - Claim Get(Guid id); - Claim GetByName(string name); - int RemoveAll(Guid[] exclude); - } -} diff --git a/backend/dal/Services/Admin/IParcelService.cs b/backend/dal/Services/Admin/IParcelService.cs deleted file mode 100644 index 37d31913fc..0000000000 --- a/backend/dal/Services/Admin/IParcelService.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using System.Collections.Generic; - -namespace Pims.Dal.Services.Admin -{ - /// - /// IParcelService interface, provides a service layer to administer parcels within the datasource. - /// - public interface IParcelService : IBaseService - { - Paged Get(ParcelFilter filter); - Parcel Get(int id); - Parcel GetByPid(int pid); - Parcel GetByPidWithoutTracking(int pid); - bool IsPidAvailable(int pid); - IEnumerable Add(IEnumerable parcels); - void UpdateFinancials(Parcel parcel); - } -} diff --git a/backend/dal/Services/Admin/IPimsAdminService.cs b/backend/dal/Services/Admin/IPimsAdminService.cs deleted file mode 100644 index 3188229260..0000000000 --- a/backend/dal/Services/Admin/IPimsAdminService.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Security.Claims; - -namespace Pims.Dal.Services.Admin -{ - /// - /// IPimsAdminService interface, provides a way to interface with the backend datasource. - /// - public interface IPimsAdminService : IService - { - #region Properties - ClaimsPrincipal Principal { get; } - IUserService User { get; } - IClaimService Claim { get; } - IRoleService Role { get; } - IAgencyService Agency { get; } - IParcelService Parcel { get; } - IBuildingService Building { get; } - IAddressService Address { get; } - IProvinceService Province { get; } - IAdministrativeAreaService AdministrativeArea { get; } - IBuildingConstructionTypeService BuildingConstructionType { get; } - IBuildingPredominateUseService BuildingPredominateUse { get; } - IPropertyClassificationService PropertyClassification { get; } - IPropertyTypeService PropertyType { get; } - IProjectService Project { get; } - IProjectStatusService ProjectStatus { get; } - IProjectRiskService ProjectRisk { get; } - ITierLevelService TierLevel { get; } - IWorkflowService Workflow { get; } - #endregion - - #region Methods - int CommitTransaction(); - #endregion - } -} diff --git a/backend/dal/Services/Admin/IProjectRiskService.cs b/backend/dal/Services/Admin/IProjectRiskService.cs deleted file mode 100644 index f0532f5fc2..0000000000 --- a/backend/dal/Services/Admin/IProjectRiskService.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Pims.Dal.Entities; -using System.Collections.Generic; - -namespace Pims.Dal.Services.Admin -{ - /// - /// IProjectRiskService interface, provides a service layer to administer project risks within the datasource. - /// - public interface IProjectRiskService : IBaseService - { - IEnumerable GetAll(); - ProjectRisk Get(int id); - } -} diff --git a/backend/dal/Services/Admin/IProjectService.cs b/backend/dal/Services/Admin/IProjectService.cs deleted file mode 100644 index 9857a6efa8..0000000000 --- a/backend/dal/Services/Admin/IProjectService.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Pims.Dal.Entities; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; - -namespace Pims.Dal.Services.Admin -{ - /// - /// IProjectService interface, provides a service layer to administer projects within the datasource. - /// - public interface IProjectService : IBaseService - { - Project Get(int id); - Project Get(int id, params Expression>[] includes); - Project Get(string projectNumber); - Project Get(string projectNumber, params Expression>[] includes); - IEnumerable GetSnapshots(int projectId); - void Add(IEnumerable projects); - void Update(IEnumerable projects); - string GenerateProjectNumber(); - void UpdateProjectNumber(Project project, string projectNumber); - } -} diff --git a/backend/dal/Services/Admin/IProjectStatusService.cs b/backend/dal/Services/Admin/IProjectStatusService.cs deleted file mode 100644 index bdfb9f12f4..0000000000 --- a/backend/dal/Services/Admin/IProjectStatusService.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Pims.Dal.Entities; -using System.Collections.Generic; - -namespace Pims.Dal.Services.Admin -{ - /// - /// IProjectStatusService interface, provides a service layer to administer project status within the datasource. - /// - public interface IProjectStatusService : IBaseService - { - IEnumerable GetAll(); - ProjectStatus Get(int id); - } -} diff --git a/backend/dal/Services/Admin/IPropertyClassificationService.cs b/backend/dal/Services/Admin/IPropertyClassificationService.cs deleted file mode 100644 index 19949b1256..0000000000 --- a/backend/dal/Services/Admin/IPropertyClassificationService.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Pims.Dal.Entities; -using System.Collections.Generic; - -namespace Pims.Dal.Services.Admin -{ - /// - /// IPropertyClassificationService interface, provides a service layer to administer property classifications within the datasource. - /// - public interface IPropertyClassificationService : IBaseService - { - IEnumerable GetAll(); - } -} diff --git a/backend/dal/Services/Admin/IPropertyTypeService.cs b/backend/dal/Services/Admin/IPropertyTypeService.cs deleted file mode 100644 index a73023eed6..0000000000 --- a/backend/dal/Services/Admin/IPropertyTypeService.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Pims.Dal.Entities; -using System.Collections.Generic; - -namespace Pims.Dal.Services.Admin -{ - /// - /// IPropertyTypeService interface, provides a service layer to administer property types within the datasource. - /// - public interface IPropertyTypeService : IBaseService - { - IEnumerable GetAll(); - } -} diff --git a/backend/dal/Services/Admin/IProvinceService.cs b/backend/dal/Services/Admin/IProvinceService.cs deleted file mode 100644 index e4c8965765..0000000000 --- a/backend/dal/Services/Admin/IProvinceService.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Pims.Dal.Entities; -using System.Collections.Generic; - -namespace Pims.Dal.Services.Admin -{ - /// - /// IProvinceService interface, provides a service layer to administer provinces within the datasource. - /// - public interface IProvinceService : IBaseService - { - IEnumerable GetAll(); - } -} diff --git a/backend/dal/Services/Admin/IRoleService.cs b/backend/dal/Services/Admin/IRoleService.cs deleted file mode 100644 index 280e27586a..0000000000 --- a/backend/dal/Services/Admin/IRoleService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using System; - -namespace Pims.Dal.Services.Admin -{ - /// - /// IRoleService interface, provides a service layer to administer roles within the datasource. - /// - public interface IRoleService : IBaseService - { - Paged Get(int page, int quantity, string name = null); - Role Get(Guid id); - Role GetByName(string name); - Role GetByKeycloakId(Guid id); - int RemoveAll(Guid[] exclude); - } -} diff --git a/backend/dal/Services/Admin/ITierLevelService.cs b/backend/dal/Services/Admin/ITierLevelService.cs deleted file mode 100644 index ea8bc771b4..0000000000 --- a/backend/dal/Services/Admin/ITierLevelService.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Pims.Dal.Entities; -using System.Collections.Generic; - -namespace Pims.Dal.Services.Admin -{ - /// - /// ITierLevelService interface, provides a service layer to administer tier levels within the datasource. - /// - public interface ITierLevelService : IBaseService - { - IEnumerable GetAll(); - TierLevel Get(int id); - } -} diff --git a/backend/dal/Services/Admin/IUserService.cs b/backend/dal/Services/Admin/IUserService.cs deleted file mode 100644 index 29f7b00567..0000000000 --- a/backend/dal/Services/Admin/IUserService.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Pims.Dal.Services.Admin -{ - /// - /// IUserService interface, provides a service layer to administer users within the datasource. - /// - public interface IUserService : IBaseService - { - int Count(); - Paged Get(int page, int quantity); - Paged Get(UserFilter filter); - GoldUser Get(Guid id); - GoldUser Get(string username); - User GetForKeycloakUserId(Guid keycloakUserId); - Task> GetGoldUsersRolesAsync(string preferred_username); - Task> GetRolesAsync(); - Task GetUsersPreferredUsername(Guid keycloakGuid, string identityProvider); - Task GetUsersPreferredUsername(string email, string identityProvider); - Task UpdateGoldRolesAsync(string preferred_username, IEnumerable roles); - Task AddRoleToUser(string preferred_username, string roleName); - Task DeleteRoleFromUser(string preferred_username, string roleName); - - AccessRequest UpdateAccessRequest(AccessRequest accessRequest); - AccessRequest GetAccessRequest(int id); - Paged GetAccessRequests(int page = 1, int quantity = 10, string sort = null, AccessRequestStatus status = AccessRequestStatus.OnHold); - Paged GetAccessRequests(AccessRequestFilter filter); - } -} diff --git a/backend/dal/Services/Admin/IWorkflowService.cs b/backend/dal/Services/Admin/IWorkflowService.cs deleted file mode 100644 index d6f8b87ca7..0000000000 --- a/backend/dal/Services/Admin/IWorkflowService.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Pims.Dal.Entities; -using System.Collections.Generic; - -namespace Pims.Dal.Services.Admin -{ - /// - /// IWorkflowService interface, provides a service layer to administer workflows within the datasource. - /// - public interface IWorkflowService : IBaseService - { - IEnumerable GetAll(); - Workflow Get(int id); - IEnumerable GetForStatus(string code); - } -} diff --git a/backend/dal/Services/Admin/PimsAdminService.cs b/backend/dal/Services/Admin/PimsAdminService.cs deleted file mode 100644 index 3aef93a236..0000000000 --- a/backend/dal/Services/Admin/PimsAdminService.cs +++ /dev/null @@ -1,147 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using System; -using System.Security.Claims; - -namespace Pims.Dal.Services.Admin -{ - /// - /// PimsAdminService class, provides a encapsulated way to references all the independent services. - /// - public class PimsAdminService : IPimsAdminService - { - #region Variables - private readonly IServiceProvider _serviceProvider; - private readonly PimsContext _dbContext; - #endregion - - #region Properties - public ClaimsPrincipal Principal { get; } - /// - /// get - The user service. - /// - public IUserService User { get { return _serviceProvider.GetService(); } } - - /// - /// get - The role service. - /// - public IRoleService Role { get { return _serviceProvider.GetService(); } } - - /// - /// get - The claim service. - /// - public IClaimService Claim { get { return _serviceProvider.GetService(); } } - - /// - /// get - The agency service. - /// - public IAgencyService Agency { get { return _serviceProvider.GetService(); } } - - /// - /// get - The parcel service. - /// - public IParcelService Parcel { get { return _serviceProvider.GetService(); } } - - /// - /// get - The building service. - /// - public IBuildingService Building { get { return _serviceProvider.GetService(); } } - - /// - /// get - The address service. - /// - public IAddressService Address { get { return _serviceProvider.GetService(); } } - - /// - /// get - The province service. - /// - public IProvinceService Province { get { return _serviceProvider.GetService(); } } - - /// - /// get - The administrative area (city, municipality, district, etc.) service. - /// - public IAdministrativeAreaService AdministrativeArea { get { return _serviceProvider.GetService(); } } - - /// - /// get - The building construction type service. - /// - public IBuildingConstructionTypeService BuildingConstructionType { get { return _serviceProvider.GetService(); } } - - /// - /// get - The building predominate use service. - /// - public IBuildingPredominateUseService BuildingPredominateUse { get { return _serviceProvider.GetService(); } } - - /// - /// get - The property classification service. - /// - public IPropertyClassificationService PropertyClassification { get { return _serviceProvider.GetService(); } } - - /// - /// get - The property type service. - /// - public IPropertyTypeService PropertyType { get { return _serviceProvider.GetService(); } } - - /// - /// get - The project service. - /// - public IProjectService Project { get { return _serviceProvider.GetService(); } } - - /// - /// get - The project status service. - /// - public IProjectStatusService ProjectStatus { get { return _serviceProvider.GetService(); } } - - /// - /// get - The project risk service. - /// - public IProjectRiskService ProjectRisk { get { return _serviceProvider.GetService(); } } - - /// - /// get - The project tier level service. - /// - public ITierLevelService TierLevel { get { return _serviceProvider.GetService(); } } - - /// - /// get - The project workflow service. - /// - public IWorkflowService Workflow { get { return _serviceProvider.GetService(); } } - #endregion - - #region Constructors - /// - /// Creates a new instance of a PimsAdminService class, and initializes it with the specified arguments. - /// - /// - /// - public PimsAdminService(ClaimsPrincipal user, IServiceProvider serviceProvider) - { - this.Principal = user; - _serviceProvider = serviceProvider; - _dbContext = serviceProvider.GetService(); - } - #endregion - - #region Methods - /// - /// Wrap the SaveChanges in a transaction for rollback. - /// - /// - public int CommitTransaction() - { - return _dbContext.CommitTransaction(); - } - - /// - /// Get the original value of the specified 'entity'. - /// - /// - /// - /// - /// - public T OriginalValue(object entity, string propertyName) - { - return this.Address.OriginalValue(entity, propertyName); - } - #endregion - } -} diff --git a/backend/dal/Services/BaseService.cs b/backend/dal/Services/BaseService.cs deleted file mode 100644 index ba934f2e70..0000000000 --- a/backend/dal/Services/BaseService.cs +++ /dev/null @@ -1,89 +0,0 @@ -using Microsoft.Extensions.Logging; -using System; -using System.Security.Claims; - -namespace Pims.Dal.Services -{ - /// - /// BaseService abstract class, provides a generic service layer to perform CRUD operations on the datasource. - /// - public abstract class BaseService : IService - { - #region Variables - #endregion - - #region Properties - /// - /// get - The current user accessing the service. - /// - protected ClaimsPrincipal User { get; } - - /// - /// get - The datasource context object. - /// - protected PimsContext Context { get; } - - /// - /// get - The logger. - /// - protected ILogger Logger { get; } - - /// - /// get - References to wrapping service. - /// - protected IPimsService Self { get; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a BaseService class, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public BaseService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) - { - this.Context = dbContext; - this.User = user; - this.Logger = logger; - this.Self = service; - } - #endregion - - #region Methods - /// - /// Provides a way to fetch the context within the assembly. - /// - /// - internal PimsContext GetContext() - { - return this.Context; - } - - /// - /// Provides a way to fetch the user within the assembly. - /// - /// - internal ClaimsPrincipal GetUser() - { - return this.User; - } - - /// - /// Get the original value of the specified 'propertyName'. - /// - /// - /// - /// - /// - public T OriginalValue(object entity, string propertyName) - { - if (entity == null) throw new ArgumentNullException(nameof(entity)); - if (String.IsNullOrWhiteSpace(propertyName)) throw new ArgumentException("Argument is required and cannot be null, empty or whitespace."); - - return (T)this.Context.Entry(entity).OriginalValues[propertyName]; - } - #endregion - } -} diff --git a/backend/dal/Services/BaseService`.cs b/backend/dal/Services/BaseService`.cs deleted file mode 100644 index b52509a2d3..0000000000 --- a/backend/dal/Services/BaseService`.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Microsoft.Extensions.Logging; -using Pims.Dal.Entities; -using System.Security.Claims; - -namespace Pims.Dal.Services -{ - /// - /// BaseService abstract class, provides a generic service layer to perform CRUD operations on the datasource. - /// - /// - public abstract class BaseService : BaseService - where ET : BaseEntity - { - #region Variables - #endregion - - #region Properties - #endregion - - #region Constructors - /// - /// Creates a new instance of a BaseService class, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public BaseService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) - { } - #endregion - - #region Methods - #endregion - } -} diff --git a/backend/dal/Services/Concrete/BuildingService.cs b/backend/dal/Services/Concrete/BuildingService.cs deleted file mode 100644 index c97959fe32..0000000000 --- a/backend/dal/Services/Concrete/BuildingService.cs +++ /dev/null @@ -1,444 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using Pims.Dal.Exceptions; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Services -{ - /// - /// BuildingService class, provides a service layer to interact with buildings within the datasource. - /// - public class BuildingService : BaseService, IBuildingService - { - #region Variables - private readonly PimsOptions _options; - private readonly IPimsService _service; - #endregion - - #region Constructors - /// - /// Creates a new instance of a BuildingService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - /// - public BuildingService(IOptions options, PimsContext dbContext, IPimsService service, ClaimsPrincipal user, ILogger logger) : base(dbContext, user, service, logger) - { - _options = options.Value; - _service = service; - } - #endregion - - #region Methods - /// - /// Get a collection of buildings within the specified filter. - /// Will not return sensitive buildings unless the user has the `sensitive-view` claim and belongs to the owning agency. - /// - /// - /// - /// - /// - /// - public IEnumerable Get(double neLat, double neLong, double swLat, double swLong) - { - this.User.ThrowIfNotAuthorized(Permissions.PropertyView); - - // Check if user has the ability to view sensitive properties. - var user = this.Context.Users - .Include(u => u.Agencies) - .ThenInclude(a => a.Agency) - .ThenInclude(a => a.Children) - .SingleOrDefault(u => u.Username == this.User.GetUsername()) ?? throw new KeyNotFoundException(); - IEnumerable userAgencies = _service.User.GetAgencies(user.Id); - var viewSensitive = this.User.HasPermission(Permissions.SensitiveView); - var isAdmin = this.User.HasPermission(Permissions.AdminProperties); - - IQueryable query = null; - // Users may only view sensitive properties if they have the `sensitive-view` claim and belong to the owning agency. - query = this.Context.Buildings - .Include(b => b.Parcels).ThenInclude(pb => pb.Parcel) - .AsNoTracking() - .Where(b => - (isAdmin || b.IsVisibleToOtherAgencies || !b.IsSensitive || (viewSensitive && userAgencies.Contains((int)b.AgencyId)))); - - var pfactory = new NetTopologySuite.Geometries.GeometryFactory(); - var ring = new NetTopologySuite.Geometries.LinearRing( - new[] { - new NetTopologySuite.Geometries.Coordinate(neLong, neLat), - new NetTopologySuite.Geometries.Coordinate(swLong, neLat), - new NetTopologySuite.Geometries.Coordinate(swLong, swLat), - new NetTopologySuite.Geometries.Coordinate(neLong, swLat), - new NetTopologySuite.Geometries.Coordinate(neLong, neLat) - }); - var poly = pfactory.CreatePolygon(ring); - poly.SRID = 4326; - query = query.Where(p => poly.Contains(p.Location)); - - return query.ToArray(); - } - - /// - /// Get an array of buildings within the specified filter. - /// Will not return sensitive buildings unless the user has the `sensitive-view` claim and belongs to the owning agency. - /// - /// - /// - public IEnumerable Get(BuildingFilter filter) - { - this.User.ThrowIfNotAuthorized(Permissions.PropertyView); - var query = this.Context.GenerateQuery(this.User, filter); - return query.ToArray(); - } - - /// - /// Get an array of buildings within the specified filter. - /// Will not return sensitive buildings unless the user has the `sensitive-view` claim and belongs to the owning agency. - /// - /// - /// - public Paged GetPage(BuildingFilter filter) - { - this.User.ThrowIfNotAuthorized(Permissions.PropertyView); - var query = this.Context.GenerateQuery(this.User, filter); - var total = query.Count(); - var items = query.Skip((filter.Page - 1) * filter.Quantity).Take(filter.Quantity); - - return new Paged(items, filter.Page, filter.Quantity, total); - } - - /// - /// Get the building for the specified 'id'. - /// Will not return sensitive buildings unless the user has the `sensitive-view` claim and belongs to the owning agency. - /// - /// - /// Entity does not exist in the datasource. - /// - public Building Get(int id) - { - this.User.ThrowIfNotAuthorized(Permissions.PropertyView); - // Check if user has the ability to view sensitive properties. - var user = this.Context.Users - .Include(u => u.Agencies) - .ThenInclude(a => a.Agency) - .ThenInclude(a => a.Children) - .SingleOrDefault(u => u.Username == this.User.GetUsername()) ?? throw new KeyNotFoundException(); - - // Identify users agencies and child agencies - IEnumerable userAgencies = _service.User.GetAgencies(user.Id); - - var viewSensitive = this.User.HasPermission(Permissions.SensitiveView); - var isAdmin = this.User.HasPermission(Permissions.AdminProperties); - - var building = this.Context.Buildings - .Include(b => b.Parcels).ThenInclude(pb => pb.Parcel).ThenInclude(b => b.Evaluations) - .Include(b => b.Parcels).ThenInclude(pb => pb.Parcel).ThenInclude(b => b.Fiscals) - .Include(b => b.Parcels).ThenInclude(pb => pb.Parcel).ThenInclude(b => b.Address).ThenInclude(a => a.Province) - .Include(b => b.Parcels).ThenInclude(pb => pb.Parcel).ThenInclude(b => b.Classification) - .Include(b => b.Classification) - .Include(p => p.BuildingPredominateUse) - .Include(p => p.BuildingConstructionType) - .Include(p => p.BuildingOccupantType) - .Include(p => p.Address).ThenInclude(a => a.Province) - .Include(p => p.Agency).ThenInclude(a => a.Parent) - .Include(p => p.Evaluations) - .Include(p => p.Fiscals) - .Include(p => p.UpdatedBy) - .Include(p => p.CreatedBy) - .Include(p => p.Projects).ThenInclude(pp => pp.Project).ThenInclude(p => p.Workflow) - .Include(p => p.Projects).ThenInclude(pp => pp.Project).ThenInclude(p => p.Status) - .AsNoTracking() - .FirstOrDefault(b => b.Id == id - && (isAdmin - || b.IsVisibleToOtherAgencies - || ((!b.IsSensitive || viewSensitive) - && userAgencies.Contains((int)b.AgencyId)))) ?? throw new KeyNotFoundException(); - - return building; - } - - /// - /// Add the specified building to the datasource. - /// - /// - /// - public Building Add(Building building) - { - building.ThrowIfNull(nameof(building)); - this.User.ThrowIfNotAuthorized(Permissions.PropertyAdd); - - Agency agency = User.GetAgency(Context) ?? - throw new NotAuthorizedException("User must belong to an agency before adding buildings."); - - // A building should have a unique name within the parcel it is located on. - building.Parcels.ForEach(pb => this.Context.ThrowIfNotUnique(pb.Parcel, building)); - // If the user is not an admin, and their agency is not a parent override to their user agency - if (!this.User.HasPermission(Permissions.AdminProperties) && agency.ParentId != null) - { - building.AgencyId = agency.Id; - building.Agency = agency; - } - - building.PropertyTypeId = (int)PropertyTypes.Building; - building.Address.Province = this.Context.Provinces.Find(building.Address.ProvinceId); - building.Classification = this.Context.PropertyClassifications.Find(building.ClassificationId); - building.IsVisibleToOtherAgencies = false; - - building.Parcels.ForEach(bp => - { - bp.Building = building; - //The Parcel may already exist, if it does update the existing parcel. - if (bp.ParcelId > 0) - { - _service.Parcel.PendingUpdate(bp.Parcel); - bp.Parcel = null; - } - else - { - bp.Parcel.Address.Province = this.Context.Provinces.Find(building.Address.ProvinceId); - bp.Parcel.Classification = this.Context.PropertyClassifications.Find(building.ClassificationId); - bp.Parcel.Address.AdministrativeArea = building.Address.AdministrativeArea; - } - }); - - this.Context.Buildings.Add(building); - this.Context.CommitTransaction(); - return Get(building.Id); - } - - /// - /// Update the specified building in the datasource. - /// - /// - /// Entity does not exist in the datasource. - /// - public Building Update(Building building) - { - building.ThrowIfNotAllowedToEdit(nameof(building), this.User, new[] { Permissions.PropertyEdit, Permissions.AdminProperties }); - var isAdmin = this.User.HasPermission(Permissions.AdminProperties); - - var existingBuilding = this.Context.Buildings - .Include(b => b.Agency) - .Include(b => b.Address).ThenInclude(a => a.Province) - .Include(b => b.Evaluations) - .Include(b => b.Fiscals) - .Include(b => b.Parcels).ThenInclude(pb => pb.Parcel).ThenInclude(b => b.Buildings) - .Include(b => b.Parcels).ThenInclude(pb => pb.Parcel).ThenInclude(b => b.Evaluations) - .Include(b => b.Parcels).ThenInclude(pb => pb.Parcel).ThenInclude(b => b.Classification) - .Include(b => b.Parcels).ThenInclude(pb => pb.Parcel).ThenInclude(b => b.Fiscals) - .Include(b => b.Parcels).ThenInclude(pb => pb.Parcel).ThenInclude(b => b.Address).ThenInclude(a => a.Province) - .FirstOrDefault(b => b.Id == building.Id) ?? throw new KeyNotFoundException(); - - var user = this.Context.Users - .Include(u => u.Agencies) - .ThenInclude(a => a.Agency) - .ThenInclude(a => a.Children) - .SingleOrDefault(u => u.Username == this.User.GetUsername()) ?? throw new KeyNotFoundException(); - IEnumerable userAgencies = _service.User.GetAgencies(user.Id); - - if (!isAdmin && !userAgencies.Contains((int)existingBuilding.AgencyId)) throw new NotAuthorizedException("User may not edit buildings outside of their agency."); - - existingBuilding.ThrowIfPropertyInSppProject(this.User); - - // Do not allow switching agencies through this method. - if (existingBuilding.AgencyId != building.AgencyId && !isAdmin) throw new NotAuthorizedException("Building cannot be transferred to the specified agency."); - - // Do not allow making property visible through this service. - if (existingBuilding.IsVisibleToOtherAgencies != building.IsVisibleToOtherAgencies) throw new InvalidOperationException("Building cannot be made visible to other agencies through this service."); - - // Only administrators can dispose a property. - if (building.ClassificationId == (int)ClassificationTypes.Disposed && !isAdmin) throw new NotAuthorizedException("Building classification cannot be changed to disposed."); - - // Only administrators can set a building to demolished - if (building.ClassificationId == (int)ClassificationTypes.Demolished && !isAdmin) throw new NotAuthorizedException("Building classification cannot be changed to demolished."); - - // Only administrators can set property to subdivided - if (building.ClassificationId == (int)ClassificationTypes.Subdivided && !isAdmin) throw new NotAuthorizedException("Building classification cannot be changed to subdivided."); - - var allowEdit = isAdmin || userAgencies.Contains((int)existingBuilding.AgencyId); - // A building should have a unique name within the parcel it is located on. - existingBuilding.Parcels.ForEach(pb => this.Context.ThrowIfNotUnique(pb.Parcel, building)); - - foreach (var parcel in building.Parcels.Select(pb => pb.Parcel)) - { - // Check if the parcel already exists. - var existingAssociatedParcel = existingBuilding.Parcels.Where(pb => pb.Parcel.Id != 0) - .FirstOrDefault(pb => pb.ParcelId == parcel.Id)?.Parcel; - - // Reset all relationships that are not changed through this update. - parcel.Address.Province = this.Context.Provinces.FirstOrDefault(p => p.Id == parcel.Address.ProvinceId); - parcel.Classification = this.Context.PropertyClassifications.FirstOrDefault(b => b.Id == parcel.ClassificationId); - parcel.Agency = this.Context.Agencies.FirstOrDefault(a => a.Id == building.AgencyId); - - if (existingAssociatedParcel == null) - { - if (!allowEdit) throw new NotAuthorizedException("User may not add parcels to a property they don't own."); - var existingParcel = this.Context.Parcels - .Include(p => p.Buildings) - .FirstOrDefault(pb => pb.Id == parcel.Id); - if (existingParcel != null) - { - parcel.Buildings.Clear(); // Do not modify the list of buildings associated to parcels when performing building updates. - existingParcel.Buildings.ForEach(building => parcel.Buildings.Add(building)); - _service.Parcel.PendingUpdate(parcel); - } - - existingBuilding.Parcels.Add(new ParcelBuilding(existingParcel ?? parcel, building)); - } - else - { - parcel.Buildings.Clear(); // Do not modify the list of buildings associated to parcels when performing building updates. - existingAssociatedParcel.Buildings.ForEach(building => parcel.Buildings.Add(building)); - _service.Parcel.PendingUpdate(parcel); - } - } - - if (allowEdit) - { - building.PropertyTypeId = existingBuilding.PropertyTypeId; - this.Context.Entry(existingBuilding.Address).CurrentValues.SetValues(building.Address); - this.Context.Entry(existingBuilding).CurrentValues.SetValues(building); - this.Context.SetOriginalRowVersion(existingBuilding); - this.Context.UpdateBuildingFinancials(existingBuilding, building.Evaluations, building.Fiscals); - - // Go through the existing parcels and see if they have been deleted from the updated buildings. - foreach (var parcelBuilding in existingBuilding.Parcels) - { - var updateParcel = building.Parcels.FirstOrDefault(pb => pb.ParcelId == parcelBuilding.ParcelId); - if (updateParcel == null) - { - this.ThrowIfNotAllowedToUpdate(parcelBuilding.Building, _options.Project); - - building.Parcels.Remove(parcelBuilding); - this.Context.ParcelBuildings.Remove(parcelBuilding); - - continue; - } - - // The parcel may have evaluations or fiscals that need to be deleted. - foreach (var parcelEvaluation in parcelBuilding.Parcel.Evaluations) - { - // Delete the evaluations that have been removed. - if (!updateParcel.Parcel.Evaluations.Any(e => (e.ParcelId == parcelEvaluation.ParcelId && e.Date == parcelEvaluation.Date && e.Key == parcelEvaluation.Key))) - { - this.Context.ParcelEvaluations.Remove(parcelEvaluation); - } - } - foreach (var parcelFiscal in parcelBuilding.Parcel.Fiscals) - { - // Delete the fiscals that have been removed. - if (!updateParcel.Parcel.Fiscals.Any(e => (e.ParcelId == parcelFiscal.ParcelId && e.FiscalYear == parcelFiscal.FiscalYear && e.Key == parcelFiscal.Key))) - { - this.Context.ParcelFiscals.Remove(parcelFiscal); - } - } - } - - foreach (var buildingEvaluation in existingBuilding.Evaluations) - { - // Delete the evaluations from the parcel that have been removed. - if (!building.Evaluations.Any(e => (e.BuildingId == buildingEvaluation.BuildingId && e.Date == buildingEvaluation.Date && e.Key == buildingEvaluation.Key))) - { - this.Context.BuildingEvaluations.Remove(buildingEvaluation); - } - } - foreach (var buildingFiscals in existingBuilding.Fiscals) - { - // Delete the fiscals from the parcel that have been removed. - if (!building.Fiscals.Any(e => (e.BuildingId == buildingFiscals.BuildingId && e.FiscalYear == buildingFiscals.FiscalYear && e.Key == buildingFiscals.Key))) - { - this.Context.BuildingFiscals.Remove(buildingFiscals); - } - } - } - existingBuilding.LeasedLandMetadata = building.LeasedLandMetadata; - this.Context.Buildings.Update(existingBuilding); // TODO: Must detach entity before returning it. - this.Context.CommitTransaction(); - return Get(existingBuilding.Id); - } - - /// - /// Update the specified building financials in the datasource. - /// - /// - /// Entity does not exist in the datasource. - /// - public Building UpdateFinancials(Building building) - { - building.ThrowIfNotAllowedToEdit(nameof(building), this.User, - new[] { Permissions.PropertyEdit, Permissions.AdminProperties }); - var isAdmin = this.User.HasPermission(Permissions.AdminProperties); - - var existingBuilding = this.Context.Buildings - .Include(b => b.Evaluations) - .Include(b => b.Fiscals) - .FirstOrDefault(b => b.Id == building.Id) ?? throw new KeyNotFoundException(); - this.ThrowIfNotAllowedToUpdate(existingBuilding, _options.Project); - - var user = this.Context.Users - .Include(u => u.Agencies) - .ThenInclude(a => a.Agency) - .ThenInclude(a => a.Children) - .SingleOrDefault(u => u.Username == this.User.GetUsername()) ?? throw new KeyNotFoundException(); - IEnumerable userAgencies = _service.User.GetAgencies(user.Id); - - if (!isAdmin && !userAgencies.Contains((int)existingBuilding.AgencyId)) - throw new NotAuthorizedException("User may not edit buildings outside of their agency."); - - existingBuilding.ThrowIfPropertyInSppProject(this.User); - - var allowEdit = isAdmin || userAgencies.Contains((int)existingBuilding.AgencyId); - if (allowEdit) - { - this.Context.SetOriginalRowVersion(existingBuilding); - this.Context.UpdateBuildingFinancials(existingBuilding, building.Evaluations, building.Fiscals); - existingBuilding.ClassificationId = building.ClassificationId; - } - - this.Context.SaveChanges(); - this.Context.CommitTransaction(); - return Get(existingBuilding.Id); - } - - /// - /// Remove the specified building from the datasource. - /// - /// - /// Entity does not exist in the datasource. - /// - public void Remove(Building building) - { - building.ThrowIfNotAllowedToEdit(nameof(building), this.User, new[] { Permissions.PropertyDelete, Permissions.AdminProperties }); - var isAdmin = this.User.HasPermission(Permissions.AdminProperties); - - var existingBuilding = this.Context.Buildings.Include(b => b.Evaluations).Include(b => b.Fiscals).Include(b => b.Parcels).FirstOrDefault(b => b.Id == building.Id) ?? throw new KeyNotFoundException(); - - IEnumerable agency_ids = this.Self.User.GetAgencies(this.User.GetUsername()).Select(a => (int?)a); - - if (!isAdmin && !agency_ids.Contains(existingBuilding.AgencyId)) throw new NotAuthorizedException("User may not remove buildings outside of their agency."); - - existingBuilding.ThrowIfPropertyInSppProject(this.User); - - existingBuilding.RowVersion = building.RowVersion; - this.Context.SetOriginalRowVersion(existingBuilding); - - existingBuilding.Parcels.Clear(); - existingBuilding.Evaluations.Clear(); - existingBuilding.Fiscals.Clear(); - - this.Context.Buildings.Remove(existingBuilding); // TODO: Should track deletion of property through archiveing or logging. - this.Context.CommitTransaction(); - } - #endregion - } -} diff --git a/backend/dal/Services/Concrete/LookupService.cs b/backend/dal/Services/Concrete/LookupService.cs deleted file mode 100644 index 14c133490e..0000000000 --- a/backend/dal/Services/Concrete/LookupService.cs +++ /dev/null @@ -1,118 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Pims.Dal.Entities; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Services -{ - /// - /// LookupService interface, provides a way to fetch lookup lists from the datasource. - /// - public class LookupService : BaseService, ILookupService - { - #region Constructors - /// - /// Creates a new instance of a LookService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public LookupService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) { } - #endregion - - #region Methods - /// - /// Get all agencies sorted by SortOrder and Name - /// - public IEnumerable GetAgencies() - { - return this.Context.Agencies.AsNoTracking().OrderBy(a => a.SortOrder).ThenBy(a => a.Name).ToArray(); - } - - /// - /// Get all building construction types sorted by SortOrder and Name - /// - public IEnumerable GetBuildingConstructionTypes() - { - return this.Context.BuildingConstructionTypes.AsNoTracking().OrderBy(a => a.SortOrder).ThenBy(a => a.Name).ToArray(); - } - - /// - /// Get all predominate uses sorted by SortOrder and Name - /// - public IEnumerable GetBuildingPredominateUses() - { - return this.Context.BuildingPredominateUses.AsNoTracking().OrderBy(a => a.SortOrder).ThenBy(a => a.Name).ToArray(); - } - - /// - /// Get all occupant types sorted by SortOrder and Name - /// - public IEnumerable GetBuildingOccupantTypes() - { - return this.Context.BuildingOccupantTypes.AsNoTracking().OrderBy(a => a.SortOrder).ThenBy(a => a.Name).ToArray(); - } - - /// - /// Get all administrative areas (city, municipality, district, etc) sorted by SortOrder and Name - /// - public IEnumerable GetAdministrativeAreas() - { - return this.Context.AdministrativeAreas.AsNoTracking().OrderBy(a => a.SortOrder).ThenBy(a => a.Name).ToArray(); - } - - /// - /// Get all property classifications sorted by SortOrder and Name - /// - public IEnumerable GetPropertyClassifications() - { - return this.Context.PropertyClassifications.AsNoTracking().OrderBy(a => a.SortOrder).ThenBy(a => a.Name).ToArray(); - } - - /// - /// Get all property types sorted by SortOrder and Name - /// - public IEnumerable GetPropertyTypes() - { - return this.Context.PropertyTypes.AsNoTracking().OrderBy(a => a.SortOrder).ThenBy(a => a.Name).ToArray(); - } - - /// - /// Get all provinces sorted by Name - /// - public IEnumerable GetProvinces() - { - return this.Context.Provinces.AsNoTracking().OrderBy(a => a.Name).ToArray(); - } - - /// - /// Get all roles sorted by Name - /// - public IEnumerable GetRoles() - { - return this.Context.Roles.AsNoTracking().OrderBy(a => a.Name).ToArray(); - } - - /// - /// Get all the tier levels sorted by SortOrder and Name. - /// - /// - public IEnumerable GetTierLevels() - { - return this.Context.TierLevels.AsNoTracking().OrderBy(t => t.SortOrder).ThenBy(t => t.Name).ToArray(); - } - - /// - /// Get all the project risks sorted by SortOrder and Name. - /// - /// - public IEnumerable GetProjectRisks() - { - return this.Context.ProjectRisks.AsNoTracking().OrderBy(t => t.SortOrder).ThenBy(t => t.Name).ToArray(); - } - #endregion - } -} diff --git a/backend/dal/Services/Concrete/NotificationQueueService.cs b/backend/dal/Services/Concrete/NotificationQueueService.cs deleted file mode 100644 index ac08e6896d..0000000000 --- a/backend/dal/Services/Concrete/NotificationQueueService.cs +++ /dev/null @@ -1,485 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Services -{ - /// - /// NotificationQueueService class, provides a service layer to interact with notification templates within the datasource. - /// - public class NotificationQueueService : BaseService, INotificationQueueService - { - #region Variables - private readonly INotificationService _notifyService; - private readonly PimsOptions _options; - #endregion - - #region Constructors - /// - /// Creates a new instance of a NotificationQueueService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - /// - /// - public NotificationQueueService(PimsContext dbContext, ClaimsPrincipal user, IOptions options, IPimsService service, INotificationService notifyService, ILogger logger) : base(dbContext, user, service, logger) - { - _options = options.Value; - _notifyService = notifyService; - } - #endregion - - #region Methods - - /// - /// Get an array of notifications within the specified filter. - /// - /// - /// - public Paged GetPage(NotificationQueueFilter filter) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin); - - var query = this.Context.GenerateQuery(this.User, filter); - var total = query.Count(); - var items = query.Skip((filter.Page - 1) * filter.Quantity).Take(filter.Quantity); - - return new Paged(items, filter.Page, filter.Quantity, total); - } - - /// - /// Get the notification in the queue for the specified 'id'. - /// - /// - /// The notification does not exist in the queue for the specified 'id'. - /// - public NotificationQueue Get(int id) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin); - - return this.Context.NotificationQueue - .FirstOrDefault(t => t.Id == id) ?? throw new KeyNotFoundException(); - } - - /// - /// Add the specified 'notification' to the data source. - /// - /// - public void Add(NotificationQueue notification) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin); - - this.Context.NotificationQueue.Add(notification); - this.Context.CommitTransaction(); - } - - /// - /// Add the array of notifications to the data source. - /// - /// - public void Add(IEnumerable notifications) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin); - - this.Context.NotificationQueue.AddRange(notifications); - this.Context.CommitTransaction(); - } - - /// - /// Update the speicified 'notification' in the data source. - /// - /// - public void Update(NotificationQueue notification) - { - this.Context.Update(notification); - this.Context.CommitTransaction(); - } - - /// - /// Update the speicified 'notifications' in the data source. - /// - /// - public void Update(IEnumerable notifications) - { - this.Context.UpdateRange(notifications); - this.Context.CommitTransaction(); - } - - /// - /// Cancel the notification for the specified 'id'. - /// - /// - /// - public async System.Threading.Tasks.Task CancelNotificationAsync(int id) - { - var notification = Get(id); - await _notifyService.CancelAsync(notification); - Update(notification); - - return notification; - } - - #region Project Notifications - /// - /// Generate an array of notifications for the specified 'project', and for the specified 'fromStatusId' and 'toStatusId'. - /// This will generate all notifications that should be generated for the specified status transition, - /// along with any notifications that are only specifically for the 'toStatusId'. - /// - /// - /// - /// - /// Control whether transitions only require a `To Status`, not a `From Status`. - /// - public IEnumerable GenerateNotifications(Project project, int? fromStatusId, int? toStatusId, bool includeOnlyTo = true) - { - if (project == null) throw new ArgumentNullException(nameof(project)); - - var options = this.Context.ProjectStatusNotifications - .Include(n => n.Template) - .Where(n => !n.Template.IsDisabled - && (n.FromStatusId == fromStatusId || (includeOnlyTo && n.FromStatusId == null)) - && n.ToStatusId == toStatusId).ToArray(); - - var parcelIds = project.Properties.Where(p => p.PropertyType == PropertyTypes.Land).Select(p => p.ParcelId).ToArray(); - this.Context.Parcels - .Include(p => p.Agency) - .Include(p => p.Address) - .Include(p => p.Classification) - .Where(p => parcelIds.Contains(p.Id)).Load(); - - var buildingIds = project.Properties.Where(p => p.PropertyType == PropertyTypes.Building).Select(p => p.BuildingId).ToArray(); - this.Context.Buildings - .Include(p => p.Agency) - .Include(p => p.Address) - .Include(p => p.Classification) - .Include(p => p.BuildingConstructionType) - .Include(p => p.BuildingOccupantType) - .Include(p => p.BuildingPredominateUse) - .Where(p => buildingIds.Contains(p.Id)).Load(); - - var queue = new List(); - foreach (var o in options) - { - queue.AddRange(GenerateNotifications(project, o)); - } - return queue; - } - - /// - /// Generate an array of notifications for the specified 'project', and for the specified 'projectStatusNotificationId'. - /// - /// - /// - /// - public IEnumerable GenerateNotifications(Project project, int projectStatusNotificationId) - { - return GenerateNotifications(project, this.Self.ProjectNotification.Get(projectStatusNotificationId)); - } - - /// - /// Generate an array of notifications for the specified 'project', and for the specified 'options' that represent the status transitions. - /// If any notifications have a delay that expects a given date, use the specified 'sendOn' date. - /// Depending on the notification template audience a number of notifications will be generated. - /// - /// - /// - /// - /// - public IEnumerable GenerateNotifications(Project project, ProjectStatusNotification options, DateTime? sendOn = null) - { - if (project == null) throw new ArgumentNullException(nameof(project)); - if (options == null) throw new ArgumentNullException(nameof(options)); - if (options.Template == null) throw new ArgumentNullException(nameof(options), "Argument property 'Template' is cannot be null."); - - var env = new EnvironmentModel(_options.Environment.Uri, _options.Environment.Name, _options.Environment.Title); - var notifications = new List(); - if (options.Template.Audience == NotificationAudiences.ProjectOwner) - { - var toAddress = this.Context.Users.Where(u => u.Id == project.CreatedById).Select(u => u.Email).FirstOrDefault(); - // Generate a notification for the owner of the project, which is the user who created it. - notifications.Add(GenerateNotification(options, new ProjectNotificationModel(Guid.NewGuid(), env, project, project.Agency, toAddress), sendOn)); - } - else if (options.Template.Audience == NotificationAudiences.OwningAgency) - { - // Generate a notification for the owning agency of the project. - notifications.Add(GenerateNotification(options, new ProjectNotificationModel(Guid.NewGuid(), env, project, project.Agency), sendOn)); - } - else if (options.Template.Audience == NotificationAudiences.Agencies) - { - // Generate a notification for all enabled agencies that have not turned of emails, or indicated they are not interested in the project. - var agencies = (from a in this.Context.Agencies - join par in this.Context.ProjectAgencyResponses on new { AgencyId = a.Id, ProjectId = project.Id } equals new { par.AgencyId, par.ProjectId } into g - from n in g.DefaultIfEmpty() - where !a.IsDisabled && a.SendEmail && (n == null || (n.Response != NotificationResponses.Unsubscribe && n.Response != NotificationResponses.Watch)) - select a).ToArray(); - - foreach (var agency in agencies) - { - notifications.Add(GenerateNotification(options, new ProjectNotificationModel(Guid.NewGuid(), env, project, agency), sendOn)); - } - } - else if (options.Template.Audience == NotificationAudiences.ParentAgencies) - { - // Generate a notification for all enabled parent agencies that have not turned of emails, or asked to ignore the project. - var agencies = (from a in this.Context.Agencies - join par in this.Context.ProjectAgencyResponses on new { AgencyId = a.Id, ProjectId = project.Id } equals new { par.AgencyId, par.ProjectId } into g - from n in g.DefaultIfEmpty() - where a.ParentId == null - && !a.IsDisabled - && a.SendEmail - && (n == null || (n.Response != NotificationResponses.Unsubscribe && n.Response != NotificationResponses.Watch)) - select a).ToArray(); - - foreach (var agency in agencies) - { - notifications.Add(GenerateNotification(options, new ProjectNotificationModel(Guid.NewGuid(), env, project, agency), sendOn)); - } - } - else if (options.Template.Audience == NotificationAudiences.Default) - { - // Generate a notification for the default specified 'To' email addresses. - notifications.Add(GenerateNotification(options, new ProjectNotificationModel(Guid.NewGuid(), env, project), sendOn)); - } - else if (options.Template.Audience == NotificationAudiences.WatchingAgencies) - { - // Generate a notification for agencies that have expressed interest. - var agencies = (from a in this.Context.Agencies - join par in this.Context.ProjectAgencyResponses on new { AgencyId = a.Id, ProjectId = project.Id } equals new { par.AgencyId, par.ProjectId } into g - from n in g.DefaultIfEmpty() - where !a.IsDisabled - && a.SendEmail - && n != null - && n.Response == NotificationResponses.Watch - select a).ToArray(); - - foreach (var agency in agencies) - { - notifications.Add(GenerateNotification(options, new ProjectNotificationModel(Guid.NewGuid(), env, project, agency), sendOn)); - } - } - - return notifications.NotNull(); - } - - /// - /// Generate a notification for the specified 'project', 'options' and 'agency'. - /// - /// - /// - /// - /// When provided the notification will be sent on this date. - /// - public NotificationQueue GenerateNotification(Project project, ProjectStatusNotification options, Agency agency, DateTime? sendOn = null) - { - if (project == null) throw new ArgumentNullException(nameof(project)); - if (options == null) throw new ArgumentNullException(nameof(options)); - if (options.Template == null) throw new ArgumentNullException(nameof(options), "Argument property 'Template' is cannot be null."); - - var env = new EnvironmentModel(_options.Environment.Uri, _options.Environment.Name, _options.Environment.Title); - return GenerateNotification(options, new ProjectNotificationModel(Guid.NewGuid(), env, project, agency), sendOn); - } - - /// - /// Generate a notification for the specified 'project' and 'templateName'. - /// - /// - /// - /// - public NotificationQueue GenerateNotification(Project project, string templateName) - { - var template = this.Context.NotificationTemplates.FirstOrDefault(n => n.Name == templateName) ?? throw new InvalidOperationException($"Notification template '{templateName}' does not exist."); - return GenerateNotification(project, template); - } - - /// - /// Generate a notification for the specified 'project' and 'template'. - /// - /// - /// - /// - public NotificationQueue GenerateNotification(Project project, NotificationTemplate template) - { - if (project == null) throw new ArgumentNullException(nameof(project)); - if (template == null) throw new ArgumentNullException(nameof(template)); - - var env = new EnvironmentModel(_options.Environment.Uri, _options.Environment.Name, _options.Environment.Title); - var model = new ProjectNotificationModel(Guid.NewGuid(), env, project, project.Agency); - var email = (!String.IsNullOrWhiteSpace(project.Agency.Email) && template.Audience != NotificationAudiences.ProjectOwner) ? project.Agency.Email : - this.Context.Users.FirstOrDefault(u => u.Id == project.CreatedById)?.Email; - var cc = project.Agency.CCEmail; - - return GenerateNotification(email, cc, template, model); - } - #endregion - - /// - /// Send the notifications to CHES. - /// Update the queue with the latest information. - /// - /// - /// - /// - public async System.Threading.Tasks.Task SendNotificationsAsync(IEnumerable notifications, bool saveChanges = true) - { - if (notifications == null) throw new ArgumentNullException(nameof(notifications)); - - foreach (var notification in notifications) - { - if (this.Context.Entry(notification).State == EntityState.Detached) this.Context.NotificationQueue.Add(notification); - try - { - await _notifyService.SendAsync(notification); - } - catch (Exception ex) - { - this.Logger.LogError(ex, $"Failed to send notification '{notification.Id}'."); - if (_options.Notifications.ThrowExceptions) - throw; - } - } - - // Update the notification queue to include the CHES references. - if (notifications.Any() && saveChanges) this.Context.CommitTransaction(); - } - - /// - /// Generates the notification for the specified 'model' and 'template'. - /// - /// - /// - /// - /// - /// - /// - /// - public NotificationQueue GenerateNotification(string to, string cc, NotificationTemplate template, T model, DateTime? sendOn = null) - { - if (template == null) throw new ArgumentNullException(nameof(template)); - if (model == null) throw new ArgumentNullException(nameof(model)); - - var notification = new NotificationQueue(template, to, template.Subject, template.Body) - { - Key = Guid.NewGuid(), - Status = NotificationStatus.Pending, - SendOn = sendOn ?? DateTime.UtcNow, - To = String.Join(";", new[] { to, template.To }.Select(v => !String.IsNullOrWhiteSpace(v))), - Cc = String.Join(";", new[] { cc, template.Cc }.Select(v => !String.IsNullOrWhiteSpace(v))), - Bcc = template.Bcc - }; - - try - { - _notifyService.Generate(notification, model); - } - catch (Exception ex) - { - this.Logger.LogError(ex, $"Failed to generate notification for template '{template.Id}'."); - if (_options.Notifications.ThrowExceptions) - throw; - return null; - } - return notification; - } - - /// - /// Generates the access request notification for the specified 'model' and 'template'. - /// - /// - /// - /// - /// - /// - public NotificationQueue GenerateNotification(NotificationTemplate template, T model, DateTime? sendOn = null) - { - if (template == null) throw new ArgumentNullException(nameof(template)); - if (model == null) throw new ArgumentNullException(nameof(model)); - if (String.IsNullOrEmpty(template.To)) throw new ArgumentException("Template requires a 'to'.", nameof(template)); - - var notification = new NotificationQueue(template, template.To, template.Subject, template.Body) - { - Key = Guid.NewGuid(), - Status = NotificationStatus.Pending, - SendOn = sendOn ?? DateTime.UtcNow, - To = template.To, - Cc = template.Cc, - Bcc = template.Bcc - }; - - try - { - _notifyService.Generate(notification, model); - } - catch (Exception ex) - { - this.Logger.LogError(ex, $"Failed to generate notification for template '{template.Id}'."); - if (_options.Notifications.ThrowExceptions) - throw; - return null; - } - return notification; - } - #endregion - - #region Helpers - /// - /// Generate the notification for the specified `options` and `model`. - /// Build the template and merge the model into the Subject and Body properties of the notification. - /// Use the specified `sendOn` date if the notification template delay requires it. - /// - /// - /// - /// When provided the notification will be sent on this date. - /// - private NotificationQueue GenerateNotification(ProjectStatusNotification options, ProjectNotificationModel model, DateTime? sendOn = null) - { - if (model == null) throw new ArgumentNullException(nameof(model)); - if (options == null) throw new ArgumentNullException(nameof(options)); - if (options.Template == null) throw new ArgumentNullException(nameof(options), "Argument property 'Template' is cannot be null."); - - var now = DateTime.UtcNow; - sendOn ??= options.Delay switch - { - NotificationDelays.Days => now.AddDays(options.DelayDays), - NotificationDelays.EndOfDay => DateTime.Now.Date, - NotificationDelays.EndOfMonth => new DateTime(now.Year, now.Month, DateTime.DaysInMonth(now.Year, now.Month)).Date, - NotificationDelays.SetDate => sendOn, - _ => now - }; - var notification = new NotificationQueue(options.Template, model.Project, model.ToAgency, options.Template.Subject, options.Template.Body) - { - Key = model.NotificationKey, - Status = NotificationStatus.Pending, - Priority = options.Priority, - SendOn = sendOn.Value, - To = String.Join(";", new[] { model.To ?? model.ToAgency?.Email, options.Template.To }.NotNull()), - Cc = String.Join(";", new[] { model.ToAgency?.CCEmail, options.Template.Cc }.NotNull()), - Bcc = options.Template.Bcc - }; - - try - { - _notifyService.Generate(notification, model); - } - catch (Exception ex) - { - this.Logger.LogError(ex, $"Failed to generate notification for template '{options.TemplateId}'."); - if (_options.Notifications.ThrowExceptions) - throw; - return null; - } - return notification; - } - #endregion - } -} diff --git a/backend/dal/Services/Concrete/NotificationTemplateService.cs b/backend/dal/Services/Concrete/NotificationTemplateService.cs deleted file mode 100644 index a7d712de09..0000000000 --- a/backend/dal/Services/Concrete/NotificationTemplateService.cs +++ /dev/null @@ -1,203 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; - -namespace Pims.Dal.Services -{ - /// - /// NotificationTemplateService class, provides a service layer to interact with notification templates within the datasource. - /// - public class NotificationTemplateService : BaseService, INotificationTemplateService - { - #region Variables - private readonly INotificationService _notifyService; - #endregion - - #region Constructors - /// - /// Creates a new instance of a NotificationTemplateService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - /// - public NotificationTemplateService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, INotificationService notifyService, ILogger logger) : base(dbContext, user, service, logger) - { - _notifyService = notifyService; - } - #endregion - - #region Methods - /// - /// Get all of the notification templates. - /// - /// - public IEnumerable Get() - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin); - - return this.Context.NotificationTemplates - .AsNoTracking() - .Include(t => t.Status) - .OrderBy(t => t.Name) - .ToArray(); - } - - /// - /// Get the notification template for the specified 'id'. - /// - /// - /// The notification template does not exist for the specified 'id'. - /// - public NotificationTemplate Get(int id) - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin); - - return this.Context.NotificationTemplates - .Include(t => t.Status) - .ThenInclude(s => s.FromStatus) - .Include(t => t.Status) - .ThenInclude(s => s.ToStatus) - .FirstOrDefault(t => t.Id == id) ?? throw new KeyNotFoundException(); - } - - /// - /// Get the notification template for the specified 'name'. - /// - /// - /// The notification template does not exist for the specified 'id'. - /// - public NotificationTemplate Get(string name) - { - return this.Context.NotificationTemplates - .Include(t => t.Status) - .ThenInclude(s => s.FromStatus) - .Include(t => t.Status) - .ThenInclude(s => s.ToStatus) - .FirstOrDefault(t => t.Name == name) ?? throw new KeyNotFoundException(); - } - - /// - /// Add a new notification template to the datasource. - /// - /// - /// - public NotificationTemplate Add(NotificationTemplate template) - { - template.ThrowIfNull(nameof(template)); - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin); - - this.Context.NotificationTemplates.Add(template); - this.Context.CommitTransaction(); - - return template; - } - - /// - /// Update the specified notification 'template' in the datasource. - /// - /// - /// - public NotificationTemplate Update(NotificationTemplate template) - { - template.ThrowIfNotAllowedToEdit(nameof(template), this.User, new[] { Permissions.SystemAdmin }); - - var etemplate = this.Context.NotificationTemplates - .Include(t => t.Status) - .FirstOrDefault(t => t.Id == template.Id) ?? throw new KeyNotFoundException(); - - this.Context.Entry(etemplate).CurrentValues.SetValues(template); // TODO: Need to handle removing project status notifications. - this.Context.SetOriginalRowVersion(etemplate); - - this.Context.NotificationTemplates.Update(etemplate); - this.Context.CommitTransaction(); - - return etemplate; - } - - /// - /// Remove the specified notification 'template' from the datasource. - /// - /// - public void Remove(NotificationTemplate template) - { - template.ThrowIfNotAllowedToEdit(nameof(template), this.User, new[] { Permissions.SystemAdmin }); - - var etemplate = this.Context.NotificationTemplates - .Include(t => t.Status) - .FirstOrDefault(t => t.Id == template.Id) ?? throw new KeyNotFoundException(); - - etemplate.Status.Clear(); - - this.Context.NotificationTemplates.Remove(etemplate); - this.Context.CommitTransaction(); - } - - public async Task SendNotificationAsync(int templateId, string to) - { - return await SendNotificationAsync(templateId, to, null); - - } - - /// - /// Send an email notification for the specified notification template 'templateId' to the specified list of email addresses in 'to'. - /// - /// - /// - /// - public async Task SendNotificationAsync(int templateId, string to, T model) where T : class // TODO: Allow for a way to pass a model to this function. - { - return await SendNotificationAsync(templateId, to, null, null, model); - } - - /// - /// Send an email notification for the specified notification template 'templateId' to the specified list of email addresses in 'to'. - /// - /// - /// - /// - /// - /// - public async Task SendNotificationAsync(int templateId, string to, string cc, string bcc, T model) where T : class // TODO: Allow for a way to pass a model to this function. - { - this.User.ThrowIfNotAuthorized(Permissions.SystemAdmin); - - if (String.IsNullOrWhiteSpace(to)) throw new ArgumentException("Argument is required and cannot be null, empty or whitespace.", nameof(to)); - - var template = this.Context.NotificationTemplates.Find(templateId) ?? throw new KeyNotFoundException(); - var notification = new NotificationQueue(template, to, cc, bcc, template.Subject, template.Body); - - this.Context.NotificationQueue.Add(notification); - this.Context.CommitTransaction(); - - Exception error = null; - - try - { - _notifyService.Generate(notification, model); - await _notifyService.SendAsync(notification); - } - catch (Exception ex) - { - notification.Status = NotificationStatus.Failed; - error = ex; - } - - this.Context.CommitTransaction(); - - if (error != null) throw error; - - return notification; - } - #endregion - } -} diff --git a/backend/dal/Services/Concrete/ParcelService.cs b/backend/dal/Services/Concrete/ParcelService.cs deleted file mode 100644 index 81f63a2bc8..0000000000 --- a/backend/dal/Services/Concrete/ParcelService.cs +++ /dev/null @@ -1,598 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using Pims.Dal.Exceptions; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Services -{ - /// - /// ParcelService class, provides a service layer to interact with parcels within the datasource. - /// - public class ParcelService : BaseService, IParcelService - { - #region Variables - private readonly PimsOptions _options; - private readonly IPimsService _service; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ParcelService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - /// - public ParcelService(IOptions options, PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) - { - _options = options.Value; - _service = service; - } - #endregion - - #region Methods - /// - /// Get an array of parcels within the specified filter. - /// Will not return sensitive parcels unless the user has the `sensitive-view` claim and belongs to the owning agency. - /// - /// - /// - /// - /// - /// - public IEnumerable Get(double neLat, double neLong, double swLat, double swLong) - { - this.User.ThrowIfNotAuthorized(Permissions.PropertyView); - - // Check if user has the ability to view sensitive properties. - var user = this.Context.Users - .Include(u => u.Agencies) - .ThenInclude(a => a.Agency) - .ThenInclude(a => a.Children) - .SingleOrDefault(u => u.Username == this.User.GetUsername()) ?? throw new KeyNotFoundException(); - IEnumerable userAgencies = _service.User.GetAgencies(user.Id); - var viewSensitive = this.User.HasPermission(Security.Permissions.SensitiveView); - var isAdmin = this.User.HasPermission(Permissions.AdminProperties); - - // Users may only view sensitive properties if they have the `sensitive-view` claim and belong to the owning agency. - var query = this.Context.Parcels.AsNoTracking().Where(p => - (isAdmin - || p.IsVisibleToOtherAgencies - || ((!p.IsSensitive || viewSensitive) - && userAgencies.Contains((int)p.AgencyId)))); - - var pfactory = new NetTopologySuite.Geometries.GeometryFactory(); - var ring = new NetTopologySuite.Geometries.LinearRing( - new[] { - new NetTopologySuite.Geometries.Coordinate(neLong, neLat), - new NetTopologySuite.Geometries.Coordinate(swLong, neLat), - new NetTopologySuite.Geometries.Coordinate(swLong, swLat), - new NetTopologySuite.Geometries.Coordinate(neLong, swLat), - new NetTopologySuite.Geometries.Coordinate(neLong, neLat) - }); - var poly = pfactory.CreatePolygon(ring); - poly.SRID = 4326; - query = query.Where(p => poly.Contains(p.Location)); - - return query.ToArray(); - } - - /// - /// Get an array of parcels within the specified filter. - /// Will not return sensitive parcels unless the user has the `sensitive-view` claim and belongs to the owning agency. - /// - /// - /// - public IEnumerable Get(ParcelFilter filter) - { - this.User.ThrowIfNotAuthorized(Permissions.PropertyView); - var query = this.Context.GenerateQuery(this.User, filter); - - return query.ToArray(); - } - - /// - /// Get an array of parcels within the specified filter. - /// Will not return sensitive parcels unless the user has the `sensitive-view` claim and belongs to the owning agency. - /// - /// - /// - public Paged GetPage(ParcelFilter filter) - { - this.User.ThrowIfNotAuthorized(Permissions.PropertyView); - - var query = this.Context.GenerateQuery(this.User, filter); - var total = query.Count(); - var items = query.Skip((filter.Page - 1) * filter.Quantity).Take(filter.Quantity); - - return new Paged(items, filter.Page, filter.Quantity, total); - } - - /// - /// Get the parcel for the specified 'id'. - /// Will not return sensitive buildings unless the user has the `sensitive-view` claim and belongs to the owning agency. - /// - /// - /// Entity does not exist in the datasource. - /// - public Parcel Get(int id) - { - this.User.ThrowIfNotAuthorized(Permissions.PropertyView); - - // Check if user has the ability to view sensitive properties. - var user = this.Context.Users - .Include(u => u.Agencies) - .ThenInclude(a => a.Agency) - .ThenInclude(a => a.Children) - .SingleOrDefault(u => u.Username == this.User.GetUsername()) ?? throw new KeyNotFoundException(); - - // Identify users agencies and child agencies - IEnumerable userAgencies = _service.User.GetAgencies(user.Id); - - var viewSensitive = this.User.HasPermission(Permissions.SensitiveView); - var isAdmin = this.User.HasPermission(Permissions.AdminProperties); - - var ownsABuilding = this.Context.ParcelBuildings - .Any(pb => pb.ParcelId == id - && userAgencies.Contains((int)pb.Building.AgencyId)); - - var parcel = this.Context.Parcels - .AsNoTracking() - .Include(p => p.Classification) - .Include(p => p.Address) - .Include(p => p.Address.Province) - .Include(p => p.Agency) - .Include(p => p.Agency.Parent) - .Include(p => p.Evaluations) - .Include(p => p.Fiscals) - .Include(p => p.Buildings) - .Include(p => p.CreatedBy) - .Include(p => p.UpdatedBy) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Address) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Address.Province) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.BuildingConstructionType) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.BuildingPredominateUse) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.BuildingOccupantType) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Evaluations) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Fiscals) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Classification) - .Include(p => p.Parcels).ThenInclude(pp => pp.Parcel) - .Include(p => p.Subdivisions).ThenInclude(pp => pp.Subdivision) - .Include(p => p.Projects).ThenInclude(pp => pp.Project).ThenInclude(p => p.Workflow) - .Include(p => p.Projects).ThenInclude(pp => pp.Project).ThenInclude(p => p.Status) - .FirstOrDefault(p => p.Id == id - && (ownsABuilding || isAdmin || p.IsVisibleToOtherAgencies || !p.IsSensitive || (viewSensitive && userAgencies.Contains((int)p.AgencyId)))) ?? throw new KeyNotFoundException(); - - // Remove any sensitive buildings from the results if the user is not allowed to view them. - if (!viewSensitive) - { - parcel?.Buildings.RemoveAll(pb => pb.Building.IsSensitive); - } - - // Remove any properties not owned by user's agency. - if (!isAdmin) - { - parcel?.Buildings.RemoveAll(pb => !userAgencies.Contains((int)pb.Building.AgencyId)); - } - - return parcel; - } - - /// - /// Add the specified parcel to the datasource. - /// - /// - /// - public Parcel Add(Parcel parcel) - { - parcel.ThrowIfNull(nameof(parcel)); - parcel.PropertyTypeId = (int)(parcel.Parcels.Count > 0 ? PropertyTypes.Subdivision : PropertyTypes.Land); - if (parcel.PropertyTypeId == (int)PropertyTypes.Subdivision) - { - var parentPid = parcel.Parcels.FirstOrDefault()?.Parcel?.PID; - if (parentPid == null) throw new InvalidOperationException("Invalid parent parcel associated to subdivision, parent parcels must contain a valid PID"); - parcel.PID = parentPid.Value; - parcel.PIN = this.Context.GetUniquePidPin(parcel.PID); - } - this.User.ThrowIfNotAuthorized(new[] { Permissions.PropertyAdd, Permissions.AdminProperties }); - - var agency = this.User.GetAgency(this.Context) ?? - throw new NotAuthorizedException("User must belong to an agency before adding parcels."); - - if (parcel.Parcels.Count() > 0 && parcel.Subdivisions.Count() > 0) throw new InvalidOperationException("Parcel may only have associated parcels or subdivisions, not both."); - - this.Context.Parcels.ThrowIfNotUnique(parcel); - // If the user is not an admin, and their agency is not a parent override to their user agency - if (!this.User.HasPermission(Permissions.AdminProperties) && agency.ParentId != null) - { - parcel.AgencyId = agency.Id; - parcel.Agency = agency; - } - - parcel.Address.Province = this.Context.Provinces.Find(parcel.Address.ProvinceId); - parcel.Classification = this.Context.PropertyClassifications.Find(parcel.ClassificationId); - parcel.IsVisibleToOtherAgencies = false; - - parcel.Parcels.ForEach(pp => - { - pp.Subdivision = parcel; - pp.Parcel = this.Context.Parcels.Find(pp.ParcelId); - }); - parcel.Subdivisions.ForEach(pp => - { - pp.Parcel = parcel; - pp.Subdivision = this.Context.Parcels.Find(pp.ParcelId); - }); - - parcel.Buildings.Where(pb => pb.Building != null).ForEach(pb => - { - pb.Parcel = parcel; - pb.Building.Address.AdministrativeArea = parcel.Address.AdministrativeArea; - pb.Building.Address.Province = this.Context.Provinces.Find(parcel.Address.ProvinceId); - pb.Building.Classification = this.Context.PropertyClassifications.Find(parcel.ClassificationId); - pb.Building.BuildingConstructionType = this.Context.BuildingConstructionTypes.Find(pb.Building.BuildingConstructionTypeId); - pb.Building.BuildingOccupantType = this.Context.BuildingOccupantTypes.Find(pb.Building.BuildingOccupantTypeId); - pb.Building.BuildingPredominateUse = this.Context.BuildingPredominateUses.Find(pb.Building.BuildingPredominateUseId); - - }); - - this.Context.Parcels.Add(parcel); - this.Context.CommitTransaction(); - return parcel; - } - - /// - /// Update the specified parcel in the datasource. - /// - /// - /// Entity does not exist in the datasource. - /// - public Parcel Update(Parcel parcel) - { - PendingUpdate(parcel); - this.Context.SaveChanges(); - this.Context.CommitTransaction(); - return Get(parcel.Id); - } - - /// - /// Update the specified parcel financial values in the datasource. - /// - /// - /// Entity does not exist in the datasource. - /// - public Parcel UpdateFinancials(Parcel parcel) - { - parcel.ThrowIfNotAllowedToEdit(nameof(parcel), this.User, new[] { Permissions.PropertyEdit, Permissions.AdminProperties }); - var isAdmin = this.User.HasPermission(Permissions.AdminProperties); - - var originalParcel = this.Context.Parcels - .Include(p => p.Evaluations) - .Include(p => p.Fiscals) - .SingleOrDefault(p => p.Id == parcel.Id) ?? throw new KeyNotFoundException(); - originalParcel.Classification = parcel.Classification; - var user = this.Context.Users - .Include(u => u.Agencies) - .ThenInclude(a => a.Agency) - .ThenInclude(a => a.Children) - .SingleOrDefault(u => u.Username == this.User.GetUsername()) ?? throw new KeyNotFoundException(); - IEnumerable userAgencies = _service.User.GetAgencies(user.Id); - var originalAgencyId = (int)this.Context.Entry(originalParcel).OriginalValues[nameof(Parcel.AgencyId)]; - var allowEdit = isAdmin || userAgencies.Contains(originalAgencyId); - if (!allowEdit) throw new NotAuthorizedException("User may not edit parcels outside of their agency."); - - originalParcel.ThrowIfPropertyInSppProject(this.User); - - this.Context.UpdateParcelFinancials(originalParcel, parcel.Evaluations, parcel.Fiscals); - - this.Context.SetOriginalRowVersion(originalParcel); - this.Context.CommitTransaction(); - return Get(parcel.Id); - } - - /// - /// Update the specified parcel in the datasource, but do not commit the transaction. - /// - /// - /// Entity does not exist in the datasource. - /// - public Parcel PendingUpdate(Parcel parcel) - { - parcel.ThrowIfNotAllowedToEdit(nameof(parcel), this.User, new[] { Permissions.PropertyEdit, Permissions.AdminProperties }); - var isAdmin = this.User.HasPermission(Permissions.AdminProperties); - - var originalParcel = this.Context.Parcels - .Include(p => p.Agency) - .Include(p => p.Address) - .Include(p => p.Evaluations) - .Include(p => p.Fiscals) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Evaluations) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Fiscals) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Address) - .Include(p => p.Parcels).ThenInclude(pp => pp.Parcel) - .Include(p => p.Subdivisions).ThenInclude(pp => pp.Subdivision) - .SingleOrDefault(p => p.Id == parcel.Id) ?? throw new KeyNotFoundException(); - - var user = this.Context.Users - .Include(u => u.Agencies) - .ThenInclude(a => a.Agency) - .ThenInclude(a => a.Children) - .SingleOrDefault(u => u.Username == this.User.GetUsername()) ?? throw new KeyNotFoundException(); - IEnumerable userAgencies = _service.User.GetAgencies(user.Id); - var originalAgencyId = (int)this.Context.Entry(originalParcel).OriginalValues[nameof(Parcel.AgencyId)]; - var allowEdit = isAdmin || userAgencies.Contains(originalAgencyId); - var ownsABuilding = originalParcel.Buildings.Any(pb => userAgencies.Contains(pb.Building.AgencyId.Value)); - if (!allowEdit && !ownsABuilding) throw new NotAuthorizedException("User may not edit parcels outside of their agency."); - - parcel.PropertyTypeId = originalParcel.PropertyTypeId; // property type cannot be changed directly. - if (parcel.PropertyTypeId == (int)PropertyTypes.Subdivision && parcel.Parcels.Any()) - { - var parentPid = parcel.Parcels.FirstOrDefault()?.Parcel?.PID; - if (parentPid == null) throw new InvalidOperationException("Invalid parent parcel associated to subdivision, parent parcels must contain a valid PID"); - parcel.PID = parentPid.Value; - } - - originalParcel.ThrowIfPropertyInSppProject(this.User); - - // Do not allow switching agencies through this method. - if (!isAdmin && originalAgencyId != parcel.AgencyId) throw new NotAuthorizedException("Parcel cannot be transferred to the specified agency."); - - // Do not allow making property visible through this service. - if (originalParcel.IsVisibleToOtherAgencies != parcel.IsVisibleToOtherAgencies) throw new InvalidOperationException("Parcel cannot be made visible to other agencies through this service."); - - // Only administrators can dispose a property. - if (!isAdmin && parcel.ClassificationId == (int)ClassificationTypes.Disposed) throw new NotAuthorizedException("Parcel classification cannot be changed to disposed."); // TODO: Classification '4' should be a config settings. - - // Only administrators can set parcel to subdivided - if (!isAdmin && parcel.ClassificationId == (int)ClassificationTypes.Subdivided) throw new NotAuthorizedException("Parcel classification cannot be changed to subdivided."); - - // Only buildings can be set to demolished - if (parcel.ClassificationId == (int)ClassificationTypes.Demolished) throw new NotAuthorizedException("Only buildings may be set to demolished."); - - if ((parcel.Parcels.Count > 0 && parcel.Subdivisions.Count > 0) - || (originalParcel.Parcels.Count > 0 && parcel.Subdivisions.Count > 0) - || (originalParcel.Subdivisions.Count > 0 && parcel.Parcels.Count > 0)) throw new InvalidOperationException("Parcel may only have associated parcels or subdivisions, not both."); - - // Users who don't own the parcel, but only own a building cannot update the parcel. - if (allowEdit) - { - parcel.PropertyTypeId = originalParcel.PropertyTypeId; - this.Context.Entry(originalParcel.Address).CurrentValues.SetValues(parcel.Address); - this.Context.Entry(originalParcel).CurrentValues.SetValues(parcel); - this.Context.SetOriginalRowVersion(originalParcel); - } - - foreach (var building in parcel.Buildings.Select(pb => pb.Building)) - { - // Check if the building already exists. - var existingBuilding = originalParcel.Buildings - .FirstOrDefault(pb => pb.BuildingId == building.Id)?.Building; - - // Reset all relationships that are not changed through this update. - building.Address.Province = this.Context.Provinces.FirstOrDefault(p => p.Id == building.Address.ProvinceId); - building.BuildingConstructionType = this.Context.BuildingConstructionTypes.FirstOrDefault(b => b.Id == building.BuildingConstructionTypeId); - building.BuildingOccupantType = this.Context.BuildingOccupantTypes.FirstOrDefault(b => b.Id == building.BuildingOccupantTypeId); - building.BuildingPredominateUse = this.Context.BuildingPredominateUses.FirstOrDefault(b => b.Id == building.BuildingPredominateUseId); - building.Agency = this.Context.Agencies.FirstOrDefault(a => a.Id == building.AgencyId); - - if (existingBuilding == null) - { - if (!allowEdit) throw new NotAuthorizedException("User may not add properties to a parcel they don't own."); - - originalParcel.Buildings.Add(new ParcelBuilding(parcel, building)); - } - else - { - building.PropertyTypeId = existingBuilding.PropertyTypeId; - this.ThrowIfNotAllowedToUpdate(existingBuilding, _options.Project); - - if (!allowEdit && !userAgencies.Contains(existingBuilding.AgencyId.Value)) throw new NotAuthorizedException("User may not update a property they don't own."); - // Do not allow switching agencies through this method. - if (!isAdmin && existingBuilding.AgencyId != building.AgencyId) throw new NotAuthorizedException("Building cannot be transferred to the specified agency."); - - this.Context.Entry(existingBuilding).CurrentValues.SetValues(building); - this.Context.Entry(existingBuilding.Address).CurrentValues.SetValues(building.Address); - this.Context.UpdateBuildingFinancials(existingBuilding, building.Evaluations, building.Fiscals); - } - } - - // This property is a divided parcel with child subdivision parcels. - if (parcel.Subdivisions.Count > 0 || originalParcel.Subdivisions.Count > 0) - { - // loop through all passed in subdivisions, add any new subdivisions and remove any missing subdivisions from the current divided parcel. - foreach (var subdivisionId in parcel.Subdivisions.Select(pb => pb.SubdivisionId)) - { - // Check if the subdivision already exists. - var existingSubdivision = originalParcel.Subdivisions - .FirstOrDefault(pb => pb.SubdivisionId == subdivisionId)?.Subdivision; - - //Just add any new subdivisions, users cannot edit a subdivision within a parent parcel. - if (existingSubdivision == null) - { - if (!allowEdit) throw new NotAuthorizedException("User may not add subdivisions to a parcel they don't own."); - // This parcel is a divided parent parcel with one or more subdivisions. Therefore, add the current parcel id as the parent divided ParcelId with a ParcelParcel relationship to the new subdivisionId. - var pp = new ParcelParcel() { SubdivisionId = subdivisionId, ParcelId = parcel.Id }; - - originalParcel.Subdivisions.Add(pp); - } - } - foreach (var subdivision in originalParcel.Subdivisions) - { - // Delete the subdivisions that have been removed from this parent divided parcel. - if (!parcel.Subdivisions.Any(e => (e.SubdivisionId == subdivision.SubdivisionId))) - { - this.Context.ParcelParcels.Remove(subdivision); - } - } - } - else - { - // This property is a Subdivision with parent divided parcels. - // loop through all passed in owning divided parcels, adding any new divided parcels and removing any missing divided parcels from the current subdivision. - foreach (var dividedParcelId in parcel.Parcels.Select(pb => pb.ParcelId)) - { - // Check if the subdivided parcel already exists. - var existingDividedParcel = originalParcel.Parcels - .FirstOrDefault(pb => pb.ParcelId == dividedParcelId)?.Parcel; - - //Just add any new divided parcels, users cannot edit a parcel within a subdivision. - if (existingDividedParcel == null) - { - if (!allowEdit) throw new NotAuthorizedException("User may not add divided parcels to a subdivision they don't own."); - // This parcel is a subdivision with one or more parent divided parcels. Therefore, add the current parcel id as the SubdivisionId with a ParcelParcel relationship to the new dividedParcelId. - var pp = new ParcelParcel() { SubdivisionId = parcel.Id, ParcelId = dividedParcelId }; - - originalParcel.Parcels.Add(pp); - } - } - foreach (var dividedParcel in originalParcel.Parcels) - { - // Delete the divided parcels that have been removed from this subdivision parcel. - if (!parcel.Parcels.Any(e => (e.ParcelId == dividedParcel.ParcelId))) - { - this.Context.ParcelParcels.Remove(dividedParcel); - } - } - } - - if (allowEdit) - { - this.Context.UpdateParcelFinancials(originalParcel, parcel.Evaluations, parcel.Fiscals); - - // Go through the existing buildings and see if they have been deleted from the updated parcel. - // If they have been removed, delete them from the datasource. - foreach (var parcelBuilding in originalParcel.Buildings) - { - var updateBuilding = parcel.Buildings.FirstOrDefault(pb => pb.BuildingId == parcelBuilding.BuildingId); - - // The building may have evaluations or fiscals that need to be deleted. - if (updateBuilding != null) - { - foreach (var buildingEvaluation in parcelBuilding.Building.Evaluations) - { - // Delete the evaluations that have been removed. - if (!updateBuilding.Building.Evaluations.Any(e => (e.BuildingId == buildingEvaluation.BuildingId && e.Date == buildingEvaluation.Date && e.Key == buildingEvaluation.Key))) - { - this.Context.BuildingEvaluations.Remove(buildingEvaluation); - } - } - foreach (var buildingFiscal in parcelBuilding.Building.Fiscals) - { - // Delete the fiscals that have been removed. - if (!updateBuilding.Building.Fiscals.Any(e => (e.BuildingId == buildingFiscal.BuildingId && e.FiscalYear == buildingFiscal.FiscalYear && e.Key == buildingFiscal.Key))) - { - this.Context.BuildingFiscals.Remove(buildingFiscal); - } - } - } - } - foreach (var parcelEvaluation in originalParcel.Evaluations) - { - // Delete the evaluations from the parcel that have been removed. - if (!parcel.Evaluations.Any(e => (e.ParcelId == parcelEvaluation.ParcelId && e.Date == parcelEvaluation.Date && e.Key == parcelEvaluation.Key))) - { - this.Context.ParcelEvaluations.Remove(parcelEvaluation); - } - } - foreach (var parcelFiscals in originalParcel.Fiscals) - { - // Delete the fiscals from the parcel that have been removed. - if (!parcel.Fiscals.Any(e => (e.ParcelId == parcelFiscals.ParcelId && e.FiscalYear == parcelFiscals.FiscalYear && e.Key == parcelFiscals.Key))) - { - this.Context.ParcelFiscals.Remove(parcelFiscals); - } - } - } - - return originalParcel; - } - - /// - /// Remove the specified parcel from the datasource. - /// - /// - /// Entity does not exist in the datasource. - /// User does not have required claim to delete property. - /// - public void Remove(Parcel parcel) - { - var user = this.Context.Users - .Include(u => u.Agencies) - .ThenInclude(a => a.Agency) - .ThenInclude(a => a.Children) - .SingleOrDefault(u => u.Username == this.User.GetUsername()) ?? throw new KeyNotFoundException(); - IEnumerable userAgencies = _service.User.GetAgencies(user.Id); - - var viewSensitive = this.User.HasPermission(Permissions.SensitiveView); - var isAdmin = this.User.HasPermission(Permissions.AdminProperties); - var originalParcel = this.Context.Parcels - .Include(p => p.Agency) - .Include(p => p.Address) - .Include(p => p.Evaluations) - .Include(p => p.Fiscals) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Evaluations) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Fiscals) - .Include(p => p.Buildings).ThenInclude(pb => pb.Building).ThenInclude(b => b.Address) - .Include(p => p.Subdivisions).ThenInclude(p => p.Subdivision) - .Include(p => p.Parcels) - .SingleOrDefault(u => u.Id == parcel.Id) ?? throw new KeyNotFoundException(); - - // Subdivisions can be deleted if the user has the edit claim. - if (originalParcel.PropertyTypeId == (int)PropertyTypes.Land) - parcel.ThrowIfNotAllowedToEdit(nameof(parcel), this.User, new[] { Permissions.PropertyDelete, Permissions.AdminProperties }); - else if (originalParcel.PropertyTypeId == (int)PropertyTypes.Subdivision) - parcel.ThrowIfNotAllowedToEdit(nameof(parcel), this.User, new[] { Permissions.PropertyEdit, Permissions.AdminProperties }); - - if (!isAdmin && (!userAgencies.Contains((int)originalParcel.AgencyId) || originalParcel.IsSensitive && !viewSensitive)) - throw new NotAuthorizedException("User does not have permission to delete."); - - originalParcel.ThrowIfPropertyInSppProject(this.User); - - this.ThrowIfNotAllowedToUpdate(originalParcel, _options.Project); - this.Context.Entry(originalParcel).CurrentValues.SetValues(parcel); - this.Context.SetOriginalRowVersion(originalParcel); - - originalParcel.Buildings.ForEach(b => - { - this.ThrowIfNotAllowedToUpdate(b.Building, _options.Project); - this.Context.ParcelBuildings.Remove(b); - this.Context.BuildingEvaluations.RemoveRange(b.Building.Evaluations); - this.Context.BuildingFiscals.RemoveRange(b.Building.Fiscals); - }); - this.Context.ParcelEvaluations.RemoveRange(originalParcel.Evaluations); - this.Context.ParcelFiscals.RemoveRange(originalParcel.Fiscals); - this.Context.ParcelParcels.RemoveRange(originalParcel.Parcels); - this.Context.ParcelParcels.RemoveRange(originalParcel.Subdivisions); - this.Context.Parcels.Remove(originalParcel); // TODO: Shouldn't be allowed to permanently delete parcels entirely under certain conditions. - if (parcel.PropertyTypeId == (int)PropertyTypes.Land) - { - var subdivisions = originalParcel.Subdivisions.Select(s => s.Subdivision); - this.Context.Parcels.RemoveRange(subdivisions); - } - - this.Context.CommitTransaction(); - } - - public bool IsPidAvailable(int parcelId, int PID) - { - return !Context.Parcels.Any(parcel => parcel.PID == PID && parcel.Id != parcelId); - } - - public bool IsPinAvailable(int parcelId, int PIN) - { - return !Context.Parcels.Any(parcel => parcel.PIN == PIN && parcel.Id != parcelId); - } - - #endregion - } -} diff --git a/backend/dal/Services/Concrete/ProjectNotificationService.cs b/backend/dal/Services/Concrete/ProjectNotificationService.cs deleted file mode 100644 index a1bfc1e5de..0000000000 --- a/backend/dal/Services/Concrete/ProjectNotificationService.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Pims.Dal.Entities; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Services -{ - /// - /// ProjectNotificationService class, provides a service layer to interact with notification templates within the datasource. - /// - public class ProjectNotificationService : BaseService, IProjectNotificationService - { - #region Constructors - /// - /// Creates a new instance of a ProjectNotificationService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public ProjectNotificationService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) { } - #endregion - - #region Methods - /// - /// Get the project status notification for the specified 'id'. - /// - /// - /// The project status notification does not exist for the specified 'id'. - /// - public ProjectStatusNotification Get(int id) - { - return this.Context.ProjectStatusNotifications - .Include(t => t.Template) - .FirstOrDefault(t => t.Id == id) ?? throw new KeyNotFoundException(); - } - - /// - /// Get all the project status notifications for the specified 'fromStatusId' and 'toStatusId'. - /// - /// - /// - /// - public IEnumerable GetFor(int? fromStatusId, int? toStatusId) - { - return this.Context.ProjectStatusNotifications - .AsNoTracking() - .Include(t => t.Template) - .Where(t => (t.FromStatusId == fromStatusId && t.ToStatusId == toStatusId)) - .ToArray(); - } - #endregion - } -} diff --git a/backend/dal/Services/Concrete/ProjectReportService.cs b/backend/dal/Services/Concrete/ProjectReportService.cs deleted file mode 100644 index ffbb738751..0000000000 --- a/backend/dal/Services/Concrete/ProjectReportService.cs +++ /dev/null @@ -1,345 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using Pims.Dal.Exceptions; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Services -{ - /// - /// ProjectReportService class, provides a service layer to interact with project reports and report snapshots within the datasource. - /// - public class ProjectReportService : BaseService, IProjectReportService - { - #region Variables - #endregion - - #region Constructors - /// - /// Creates a new instance of a ProjectReportService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public ProjectReportService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) - { - } - #endregion - - #region Methods - /// - /// Get all of the project reports. - /// - /// User does not have permission to view reports. - /// - public IEnumerable GetAll() - { - this.User.ThrowIfNotAuthorized(Permissions.ReportsSpl); - - var snapshots = this.Context.ProjectReports; - - return snapshots; - } - - /// - /// Get the project report for the specified 'id'. - /// - /// - /// Argument 'reportId' is required. - /// Project report does not exist in the datasource. - /// User does not have permission to view report. - /// - public ProjectReport Get(int reportId) - { - this.User.ThrowIfNotAuthorized(Permissions.ReportsSpl); - - var report = this.Context.ProjectReports - .FirstOrDefault(p => p.Id == reportId) ?? throw new KeyNotFoundException(); - - return report; - } - - /// - /// Get all project snapshots matching either the 'To' or 'From' dates of the passed report. - /// The 'To' value may not correspond to any saved values, in this case, generate new snapshot values. - /// Since the 'From' value may correspond to a different 'From' value then what was previously used for this report, all of the baseline integrity values must be re-evaluated. - /// - /// - /// Argument 'report.To' is required. - /// Project report does not exist in the datasource. - /// User does not have permission to view snapshots. - /// - public IEnumerable GetSnapshots(ProjectReport report) - { - this.User.ThrowIfNotAuthorized(Permissions.ReportsSpl); - if (report?.To == null) throw new ArgumentNullException(); - - var currentSnapshots = this.Context.ProjectSnapshots - .Include(s => s.Project).ThenInclude(p => p.Agency) - .Include(s => s.Project).ThenInclude(p => p.Status) - .Include(s => s.Project).ThenInclude(p => p.Risk) - .Where(s => s.SnapshotOn == report.From || s.SnapshotOn == report.To) - .ToArray(); - var toSnapshots = currentSnapshots.Where(s => s.SnapshotOn == report.To); - - //This may occur if a user refreshes their report, and changes the 'From' date without saving. - if (toSnapshots.Count() == 0) - { - return GenerateSnapshots(report.From, (DateTime)report.To); - } - - var fromSnapshots = currentSnapshots.Where(s => s.SnapshotOn == report.From).ToDictionary(s => (int?)s.ProjectId, s => s); - if (fromSnapshots.Count() == 0) throw new KeyNotFoundException("If specified report FROM value must return valid snapshots"); - - foreach (ProjectSnapshot snapshot in toSnapshots) - { - var metadata = !String.IsNullOrWhiteSpace(snapshot.Metadata) ? this.Context.Deserialize(snapshot.Metadata ?? "{}") : new DisposalProjectSnapshotMetadata(); - var prevSnapshot = fromSnapshots.GetValueOrDefault(snapshot.ProjectId); - var prevMetadata = prevSnapshot != null ? this.Context.Deserialize(prevSnapshot.Metadata ?? "{}") : null; - metadata.BaselineIntegrity = (metadata?.NetProceeds ?? 0) - (prevMetadata?.NetProceeds ?? 0); - snapshot.Metadata = this.Context.Serialize(metadata); - } - - return toSnapshots; - } - - /// - /// Get all project snapshots matching either the 'To' date of the passed report. - /// - /// - /// Argument 'reportId' is required. - /// Project report does not exist in the datasource. - /// User does not have permission to view snapshots. - /// - public IEnumerable GetSnapshots(int reportId) - { - this.User.ThrowIfNotAuthorized(Permissions.ReportsSpl); - - var report = this.Context.ProjectReports - .FirstOrDefault(p => p.Id == reportId) ?? throw new KeyNotFoundException(); - - return this.Context.ProjectSnapshots - .Include(s => s.Project).ThenInclude(p => p.Agency) - .Include(s => s.Project).ThenInclude(p => p.Status) - .Include(s => s.Project).ThenInclude(p => p.Risk) - .Where(s => s.SnapshotOn == report.To) - .ToArray(); - } - - /// - /// Add the specified report to the datasource. - /// The 'From' date is set to the 'To' date of the most recent report, if one exists. - /// For every SPL project in the system, a new Snapshot is generated using current project data and a 'snapshotOn' time equal to the newly created reports 'To' date. - /// - /// - /// Argument 'report' is required. - /// User does not have permission to add report. - /// - public ProjectReport Add(ProjectReport report) - { - this.User.ThrowIfNotAuthorized(Permissions.ReportsSpl); - if (report.To == null) - { - report.To = DateTime.UtcNow; - } - if (report.From == null) - { - var mostRecentReport = this.Context.ProjectReports - .Where(r => r.ReportType == ReportTypes.SPL) - .OrderByDescending(r => r.IsFinal) - .ThenByDescending(r => r.To) - .FirstOrDefault(); - report.From = mostRecentReport?.To; - } - this.Context.Add(report); - - this.Context.ProjectSnapshots.AddRange(GenerateSnapshots(report.From, (DateTime)report.To)); - - this.Context.CommitTransaction(); - - return report; - } - - /// - /// Update the specified project report metadata in the datasource. - /// If the project 'To' date has changed, - /// - /// - /// Argument 'report' is required. - /// Project report rowversion is required. - /// Project does not exist. - /// User does not have permission to edit report. - /// - public ProjectReport Update(ProjectReport report) - { - this.User.ThrowIfNotAuthorized(Permissions.ReportsSpl); - var isSPLAdmin = this.User.HasPermission(Permissions.ReportsSplAdmin); - - var originalReport = this.Context.ProjectReports - .SingleOrDefault(p => p.Id == report.Id) ?? throw new KeyNotFoundException(); - - if ((!originalReport.IsFinal && report.IsFinal && !isSPLAdmin) || (originalReport.IsFinal && !report.IsFinal && !isSPLAdmin)) throw new NotAuthorizedException($"You do not have permissions to update the Is Final option."); - if (report.To == null) throw new ArgumentNullException(nameof(report.To)); - if (originalReport.IsFinal && report.IsFinal) throw new InvalidOperationException($"Unable to update FINAL project reports."); - if (report.From == report.To) throw new InvalidOperationException($"Project report start and end dates cannot be the same."); - - // If the report 'To' date has changed regenerate all the snapshots based on that date. - var originalTo = (DateTime?)this.Context.Entry(originalReport).OriginalValues[nameof(ProjectReport.To)]; - if (!originalTo.Equals(report.To)) - { - var snapshots = GenerateSnapshots(report.From, report.To.Value, originalTo); - this.Context.ProjectSnapshots.UpdateRange(snapshots.Where(s => s.Id != 0)); - this.Context.ProjectSnapshots.AddRange(snapshots.Where(s => s.Id == 0)); - } - - this.Context.Entry(originalReport).CurrentValues.SetValues(report); - this.Context.SetOriginalRowVersion(originalReport); - - this.Context.SaveChanges(); - this.Context.CommitTransaction(); - - return Get(originalReport.Id); - } - - /// - /// Generate an updated list of snapshots based on current project data. - /// - /// - /// User does not have permission to get refreshed snapshots. - /// - public IEnumerable Refresh(int reportId) - { - this.User.ThrowIfNotAuthorized(Permissions.ReportsSpl); - var report = Get(reportId); - report.To = DateTime.UtcNow; - this.Update(report); - return this.GetSnapshots(reportId); - } - - /// - /// Remove the specified report from the datasource. - /// - /// - /// Argument 'report' is required. - /// Project report rowversion is required. - /// Project report does not exist. - /// User does not have permission to delete report. - /// - public void Remove(ProjectReport report) - { - if (report.IsFinal) this.User.ThrowIfNotAuthorized(Permissions.ReportsSplAdmin); - this.User.ThrowIfNotAuthorized(Permissions.ReportsSpl); - if (report?.Id == null) throw new ArgumentNullException(); - - var originalReport = this.Context.ProjectReports - .SingleOrDefault(p => p.Id == report.Id) ?? throw new KeyNotFoundException(); - if (originalReport.IsFinal) throw new InvalidOperationException($"Unable to delete FINAL project reports."); - - // Remove all snapshots associated with this report. - var snapshots = this.Context.ProjectSnapshots.Where(s => s.SnapshotOn == originalReport.To.Value).ToArray(); - - this.Context.ProjectSnapshots.RemoveRange(snapshots); - this.Context.ProjectReports.Remove(originalReport); - this.Context.CommitTransaction(); - } - - /// - /// Add a project and snapshots to the datasource. - /// This provides a way to manually generate snapshots with specific projects and historical values. - /// Requires a valid 'report.To' date. - /// - /// - /// - public ProjectReport Add(ProjectReport report, IEnumerable snapshots) - { - this.User.ThrowIfNotAuthorized(Permissions.ReportsSpl); - if (!report.To.HasValue) throw new InvalidOperationException("Argument 'report.To' must have a valid date."); - if (report.From.HasValue && report.From > report.To) throw new InvalidOperationException("Argument 'report.From' must be equal to or greater than 'report.To'."); - - foreach (var snapshot in snapshots) - { - // All the snapshot dates must match the reported 'to' date. - // Regrettably I had to manually recreate this from the mapped objects because EF is attempting to set the primary key with the mapped objects. - var snap = new ProjectSnapshot() - { - ProjectId = snapshot.ProjectId, - SnapshotOn = report.To.Value, - Assessed = snapshot.Assessed, - Appraised = snapshot.Appraised, - Market = snapshot.Market, - NetBook = snapshot.NetBook, - Metadata = snapshot.Metadata - }; - this.Context.ProjectSnapshots.Add(snap); - } - - this.Context.Add(report); - this.Context.CommitTransaction(); - - return report; - } - - #region Helpers - /// - /// Generate snapshots for all SPL projects. - /// To compare prior snapshots use the specified 'from' date. - /// To update prior snapshots use the specified 'originalTo' date. - /// - /// - /// - /// - /// - private IEnumerable GenerateSnapshots(DateTime? from, DateTime to, DateTime? originalTo = null) - { - // Only fetch projects in SPL that have not been cancelled. - var splProjects = this.Context.Projects - .Include(p => p.Agency) - .Include(p => p.Status) - .Include(p => p.Risk) - .Where(p => p.Workflow.Code == "SPL" && p.Status.Code != "CA" && p.Status.Code != "T-GRE"); - // TODO: Because project status codes could change in the future, this should be updated to not be magic strings. - - var fromSnapshots = new Dictionary(); - if (from.HasValue) - { - fromSnapshots = this.Context.ProjectSnapshots - .Where(s => s.SnapshotOn == from) - .ToDictionary(s => s.ProjectId, s => s); - } - - var toSnapshots = new Dictionary(); - if (originalTo.HasValue) - { - toSnapshots = this.Context.ProjectSnapshots - .Where(s => s.SnapshotOn == originalTo) - .ToDictionary(s => s.ProjectId, s => s); - } - - var projectSnapshots = new HashSet(); - - foreach (Project project in splProjects) - { - var metadata = !String.IsNullOrWhiteSpace(project.Metadata) ? this.Context.Deserialize(project.Metadata ?? "{}") : new DisposalProjectSnapshotMetadata(); - var prevSnapshot = fromSnapshots.GetValueOrDefault(project.Id); - var prevMetadata = prevSnapshot != null ? this.Context.Deserialize(prevSnapshot.Metadata ?? "{}") : new DisposalProjectSnapshotMetadata(); - - metadata.BaselineIntegrity = (metadata?.NetProceeds ?? 0) - (prevMetadata?.NetProceeds ?? 0); - - var snapshot = toSnapshots.GetValueOrDefault(project.Id) ?? new ProjectSnapshot(project); - snapshot.SnapshotOn = to; - snapshot.Metadata = this.Context.Serialize(metadata); - projectSnapshots.Add(snapshot); - } - return projectSnapshots.AsEnumerable(); - } - #endregion - #endregion - } -} diff --git a/backend/dal/Services/Concrete/ProjectService.cs b/backend/dal/Services/Concrete/ProjectService.cs deleted file mode 100644 index 4720a3b9f9..0000000000 --- a/backend/dal/Services/Concrete/ProjectService.cs +++ /dev/null @@ -1,1008 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using Pims.Dal.Exceptions; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Services -{ - /// - /// ProjectService class, provides a service layer to interact with projects within the datasource. - /// - public class ProjectService : BaseService, IProjectService - { - #region Variables - /// - /// An array of project status that require a clearance notification date. - /// - private readonly static string[] clearanceRequiredForStatus = new[] { "ERP-ON", "ERP-OH" }; // TODO: Should be configurable, not hard-coded. - private readonly PimsOptions _options; - private readonly INotificationService _notifyService; - #endregion - - #region Constructors - /// - /// Creates a new instance of a ProjectService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - /// - /// - public ProjectService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, INotificationService notifyService, IOptions options, ILogger logger) : base(dbContext, user, service, logger) - { - _options = options.Value; - _notifyService = notifyService; - } - #endregion - - #region Methods - /// - /// Get the total number of projects in the datasource. - /// - /// - public int Count() - { - return this.Context.Projects.Count(); - } - - /// - /// Get a page with an array of projects within the specified filters. - /// - /// - /// Argument 'project' is required. - /// User does not have permission to view projects. - /// - public Paged GetPage(ProjectFilter filter) - { - filter.ThrowIfNull(nameof(filter)); - this.User.ThrowIfNotAuthorized(Permissions.ProjectView); - if (!filter.IsValid()) throw new ArgumentException("Argument must have a valid filter", nameof(filter)); - - var query = this.Context.GenerateQuery(this.User, filter, _options.Project); - var total = query.Count(); - var items = query - .Skip((filter.Page - 1) * filter.Quantity) - .Take(filter.Quantity) - .ToArray(); - - if (filter.ReportId != null) - { - var report = this.Context.ProjectReports.FirstOrDefault(r => r.Id == filter.ReportId); - items.ForEach(p => p.Snapshots.RemoveAll(s => s.SnapshotOn != report?.To)); - } - - return new Paged(items, filter.Page, filter.Quantity, total); - } - - /// - /// Get an Excel page with an array of projects within the specified filters. - /// - /// - /// Argument 'project' is required. - /// User does not have permission to view projects. - /// - -public Paged GetExcelPage(ProjectFilter filter) - { - filter.ThrowIfNull(nameof(filter)); - this.User.ThrowIfNotAuthorized(Permissions.ProjectView); - if (!filter.IsValid()) throw new ArgumentException("Argument must have a valid filter", nameof(filter)); - - var query = this.Context.GenerateExcelQuery(this.User, filter, _options.Project); - var total = query.Count(); - var items = query - .Skip((filter.Page - 1) * filter.Quantity) - .Take(filter.Quantity) - .ToArray(); - - if (filter.ReportId != null) - { - var report = this.Context.ProjectReports.FirstOrDefault(r => r.Id == filter.ReportId); - items.ForEach(p => p.Snapshots.RemoveAll(s => s.SnapshotOn != report?.To)); - } - - return new Paged(items, filter.Page, filter.Quantity, total); - } - /// - /// Get the project for the specified 'id'. - /// Will not return sensitive properties unless the user has the `sensitive-view` claim and belongs to the owning agency. - /// - /// - /// Argument 'project' is required. - /// Project does not exist in the datasource. - /// User does not have permission to view project. - /// - public Project Get(int id) - { - this.User.ThrowIfNotAuthorized(Permissions.ProjectView); - - // Check if user has the ability to view sensitive properties. - var user = this.Context.Users - .Include(u => u.Agencies) - .ThenInclude(a => a.Agency) - .ThenInclude(a => a.Children) - .SingleOrDefault(u => u.Username == this.User.GetUsername()) ?? throw new KeyNotFoundException(); - var userAgencies = user.Agencies.Select(a => a.AgencyId).ToList(); - var viewSensitive = this.User.HasPermission(Permissions.SensitiveView); - var isAdmin = this.User.HasPermission(Permissions.AdminProjects); - - var project = this.Context.Projects - .Include(p => p.TierLevel) - .Include(p => p.Risk) - .Include(p => p.Agency) - .Include(p => p.Agency.Parent) - .Include(p => p.Tasks) - .Include(p => p.Tasks).ThenInclude(t => t.Task) - .Include(p => p.Tasks).ThenInclude(t => t.Task).ThenInclude(t => t.Status) - .Include(p => p.Responses) - .Include(p => p.Responses).ThenInclude(a => a.Agency) - .Include(p => p.Notes) - .Include(p => p.Status) - .Include(p => p.Workflow) - .Include(p => p.StatusHistory).ThenInclude(p => p.Workflow) - .Include(p => p.StatusHistory).ThenInclude(p => p.Status) - .FirstOrDefault(p => p.Id == id && - (isAdmin || userAgencies.Contains(p.AgencyId))) ?? throw new KeyNotFoundException(); - - //The following reduces the load on the database compared to eager loading all parcel/building props. - this.Context.Entry(project) - .Collection(p => p.Properties) - .Load(); - foreach (Entities.ProjectProperty pp in project.Properties) - { - if (pp.PropertyType == PropertyTypes.Land) - { - this.Context.Entry(pp) - .Reference(p => p.Parcel).Query() - .Include(p => p.Parcels).ThenInclude(p => p.Parcel) - .Include(p => p.Evaluations) - .Include(p => p.Fiscals) - .Include(p => p.Classification) - .Include(p => p.Address).ThenInclude(a => a.Province) - .Include(p => p.Agency).ThenInclude(a => a.Parent) - .Load(); - } - else - { - this.Context.Entry(pp) - .Reference(p => p.Building).Query() - .Include(b => b.Parcels).ThenInclude(p => p.Parcel) - .Include(b => b.Evaluations) - .Include(p => p.Fiscals) - .Include(b => b.Classification) - .Include(b => b.Address).ThenInclude(a => a.Province) - .Include(b => b.Agency).ThenInclude(a => a.Parent) - .Include(b => b.BuildingConstructionType) - .Include(b => b.BuildingOccupantType) - .Include(b => b.BuildingPredominateUse) - .Load(); - } - } - - // Remove any sensitive properties from the results if the user is not allowed to view them. - if (!viewSensitive) - { - project?.Properties.RemoveAll(p => p.Parcel?.IsSensitive ?? false); - project?.Properties.RemoveAll(p => p.Building?.IsSensitive ?? false); - } - return project; - } - - /// - /// Get the project for the specified 'projectNumber'. - /// Will not return sensitive properties unless the user has the `sensitive-view` claim and belongs to the owning agency. - /// - /// - /// Argument 'project' is required. - /// Project does not exist in the datasource. - /// User does not have permission to view project. - /// - public Project Get(string projectNumber) - { - if (String.IsNullOrWhiteSpace(projectNumber)) throw new ArgumentException("Argument cannot be null, empty or whitespace.", nameof(projectNumber)); - this.User.ThrowIfNotAuthorized(Permissions.ProjectView); - - // Check if user has the ability to view sensitive properties. - var user = this.Context.Users - .Include(u => u.Agencies) - .ThenInclude(a => a.Agency) - .ThenInclude(a => a.Children) - .SingleOrDefault(u => u.Username == this.User.GetUsername()) ?? throw new KeyNotFoundException(); - var userAgencies = user.Agencies.Select(a => a.AgencyId).ToList(); - var viewSensitive = this.User.HasPermission(Permissions.SensitiveView); - var isAdmin = this.User.HasPermission(Permissions.AdminProjects); - - var project = this.Context.Projects - .Include(p => p.Status) - .Include(p => p.Workflow) - .Include(p => p.TierLevel) - .Include(p => p.Risk) - .Include(p => p.Agency).ThenInclude(a => a.Parent) - .Include(p => p.Tasks).ThenInclude(t => t.Task) - .Include(p => p.Tasks).ThenInclude(t => t.Task).ThenInclude(t => t.Status) - .Include(p => p.Responses).ThenInclude(a => a.Agency) - .Include(p => p.Notes) - .Include(p => p.StatusHistory).ThenInclude(p => p.Workflow) - .Include(p => p.StatusHistory).ThenInclude(p => p.Status) - .FirstOrDefault(p => p.ProjectNumber == projectNumber && - (isAdmin || userAgencies.Contains(p.AgencyId))) ?? throw new KeyNotFoundException(); - - //The following reduces the load on the database compared to eager loading all parcel/building props. - this.Context.Entry(project) - .Collection(p => p.Properties) - .Load(); - foreach (Entities.ProjectProperty pp in project.Properties) - { - if (pp.PropertyType == PropertyTypes.Land) - { - this.Context.Entry(pp) - .Reference(p => p.Parcel).Query() - .Include(p => p.Parcels).ThenInclude(p => p.Parcel) - .Include(p => p.Evaluations) - .Include(p => p.Fiscals) - .Include(p => p.Classification) - .Include(p => p.Address).ThenInclude(a => a.Province) - .Include(p => p.Agency).ThenInclude(a => a.Parent) - .Load(); - } - else - { - this.Context.Entry(pp) - .Reference(p => p.Building).Query() - .Include(b => b.Parcels).ThenInclude(pb => pb.Parcel) - .Include(b => b.Evaluations) - .Include(p => p.Fiscals) - .Include(b => b.Classification) - .Include(b => b.Address).ThenInclude(a => a.Province) - .Include(b => b.Agency).ThenInclude(a => a.Parent) - .Include(b => b.BuildingConstructionType) - .Include(b => b.BuildingOccupantType) - .Include(b => b.BuildingPredominateUse) - .Load(); - } - } - - // Remove any sensitive properties from the results if the user is not allowed to view them. - if (!viewSensitive) - { - project?.Properties.RemoveAll(p => p.Parcel?.IsSensitive ?? false); - project?.Properties.RemoveAll(p => p.Building?.IsSensitive ?? false); - } - this.Context.Entry(project).State = EntityState.Detached; - return project; - } - - /// - /// Get all the notifications in the queue for the specified project 'filter'. - /// - /// - /// - /// - public Paged GetNotificationsInQueue(ProjectNotificationFilter filter) - { - var query = this.Context.NotificationQueue - .AsNoTracking(); - - if (filter.ProjectId.HasValue) - query = query.Where(n => n.ProjectId == filter.ProjectId); - - if (filter.AgencyId.HasValue) - query = query.Where(n => n.ToAgencyId == filter.AgencyId); - - if (!String.IsNullOrWhiteSpace(filter.ProjectNumber)) - query = query.Where(n => n.Project.ProjectNumber == filter.ProjectNumber); - - if (!String.IsNullOrWhiteSpace(filter.To)) - query = query.Where(n => EF.Functions.Like(n.To, $"%{filter.To}%")); - - if (!String.IsNullOrWhiteSpace(filter.Tag)) - query = query.Where(n => EF.Functions.Like(n.Tag, $"%{filter.Tag}%")); - - if (filter.Status?.Any() ?? false) - query = query.Where(n => filter.Status.Contains(n.Status)); - - var total = query.Count(); - var items = query - .Skip((filter.Page - 1) * filter.Quantity) - .Take(filter.Quantity) - .ToArray(); - - return new Paged(items, filter.Page, filter.Quantity, total); - } - - /// - /// Add the specified project to the datasource. - /// All projects start with the default status (i.e. 1:DRAFT). - /// - /// - /// Argument 'project' is required. - /// Argument 'project.Name' is required. - /// Default status does not exist. - /// User does not have permission to add project. - /// - public async System.Threading.Tasks.Task AddAsync(Project project) - { - project.ThrowIfNull(nameof(project)); - this.User.ThrowIfNotAuthorized(Permissions.ProjectAdd); - var user = this.Context.Users - .Include(u => u.Agencies) - .ThenInclude(a => a.Agency) - .ThenInclude(a => a.Children) - .SingleOrDefault(u => u.Username == this.User.GetUsername()) ?? throw new KeyNotFoundException(); - - int agency = user.Agencies.Select(a => a.AgencyId).ToList().ElementAt(0); - - if (String.IsNullOrWhiteSpace(project.Name)) throw new ArgumentException("Project name is required and cannot be null, empty or whitespace.", nameof(project)); - - var workflow = this.Context.Workflows - .Include(w => w.Status) - .FirstOrDefault(w => w.Id == 1) ?? throw new KeyNotFoundException("The default workflow could not be found."); // TODO: The default should be based on configuration for a project type. - - // First status from the workflow. // TODO: The workflow should specify the first status, as this could return a random status. - var status = workflow.Status.OrderBy(s => s.SortOrder).FirstOrDefault() ?? throw new ConfigurationException($"The workflow '{workflow.Name}' status have not been configured."); - - project.ProjectNumber = $"TEMP-{DateTime.UtcNow.Ticks:00000}"; // Temporary project number. - - if (project.AgencyId != 0) - { - var userAgencies = user.Agencies.Select(a => a.AgencyId).ToList(); - - var canCreateAProjectForAgency = userAgencies.Contains(project.AgencyId) || - this.User.HasPermission(Permissions.AdminProjects); - if (!canCreateAProjectForAgency) - { - throw new NotAuthorizedException("User does not have permission to create a project on the behalf of this agency."); - } - - project.Agency = Context.Agencies.FirstOrDefault(a => a.Id == project.AgencyId) ?? - throw new NotAuthorizedException("The specified project agency does not exist."); - } - else - { - project.AgencyId = agency; // Always assign the current user's agency to the project. - } - - project.TierLevel = this.Context.TierLevels.Find(project.TierLevelId); - project.ReportedFiscalYear = project.ReportedFiscalYear <= 0 ? DateTime.UtcNow.GetFiscalYear() : project.ReportedFiscalYear; - project.ActualFiscalYear = project.ReportedFiscalYear; - project.WorkflowId = workflow.Id; - project.Workflow = workflow; - project.StatusId = status.StatusId; - project.Status = status.Status; - project.Risk = this.Context.ProjectRisks.Find(1); // TODO: Provide a way for users to set this value. - - // If the tasks haven't been specified, generate them. - var taskIds = project.Tasks.Select(t => t.TaskId).ToArray(); - - // Add the tasks for project status. - foreach (var projectStatus in this.Context.ProjectStatus.Include(s => s.Tasks).ToArray()) - { - foreach (var task in projectStatus.Tasks.Where(t => !taskIds.Contains(t.Id))) - { - project.Tasks.Add(new ProjectTask(project, task)); - } - } - - this.Context.Projects.Add(project); - this.Context.CommitTransaction(); - - // Update the project number with the identity. - project.ProjectNumber = String.Format(_options.Project.DraftFormat, project.Id); - - // Update all properties with the new project number. - var parcelIds = project.Properties.Where(p => p.ParcelId != null).Select(p => p.ParcelId.Value).ToArray(); - if (parcelIds.Any()) - { - var parcels = this.Context.Parcels.Where(p => parcelIds.Contains(p.Id)); - parcels.ForEach(p => p.UpdateProjectNumbers(project.ProjectNumber)); - } - var buildingIds = project.Properties.Where(b => b.BuildingId != null).Select(b => b.BuildingId.Value).ToArray(); - if (buildingIds.Any()) - { - var buildings = this.Context.Buildings.Where(b => buildingIds.Contains(b.Id)); - buildings.ForEach(b => b.UpdateProjectNumbers(project.ProjectNumber)); - } - - this.Context.Projects.Update(project); - this.Context.CommitTransaction(); - - var notifications = this.Self.NotificationQueue.GenerateNotifications(project, null, project.StatusId); - await this.Self.NotificationQueue.SendNotificationsAsync(notifications); - - return project; - } - - /// - /// Update the specified project in the datasource. - /// - /// - /// Argument 'project' is required. - /// Argument 'project.Name' is required. - /// Project rowversion is required. - /// Project does not exist. - /// Project number cannot be changed. - /// User does not have permission to edit project. - /// Project cannot be transfered to another agency. - /// - public async System.Threading.Tasks.Task UpdateAsync(Project project) - { - project.ThrowIfNotAllowedToEdit(nameof(project), this.User, new[] { Permissions.ProjectEdit, Permissions.AdminProjects }); - var isAdmin = this.User.HasPermission(Permissions.AdminProjects); - - if (String.IsNullOrWhiteSpace(project.Name)) throw new ArgumentException("Project name is required and cannot be null, empty or whitespace.", nameof(project)); - - var originalProject = this.Context.Projects - .Include(p => p.Status) - .Include(p => p.Agency) - .Include(p => p.Tasks).ThenInclude(t => t.Task) - .Include(p => p.Responses) - .Include(p => p.Workflow) - .Include(p => p.Notes) - .SingleOrDefault(p => p.Id == project.Id) ?? throw new KeyNotFoundException(); - - // The following reduces the load on the database compared to eager loading all parcel/building props. - this.Context.Entry(originalProject) - .Collection(p => p.Properties) - .Load(); - foreach (Entities.ProjectProperty pp in originalProject.Properties) - { - if (pp.PropertyType == PropertyTypes.Land) - { - this.Context.Entry(pp) - .Reference(p => p.Parcel).Query() - .Include(p => p.Classification) - .Include(p => p.Evaluations) - .Include(p => p.Fiscals) - .Load(); - } - else - { - this.Context.Entry(pp) - .Reference(p => p.Building).Query() - .Include(p => p.Classification) - .Include(b => b.Parcels).ThenInclude(pb => pb.Parcel) - .Include(b => b.Evaluations) - .Include(p => p.Fiscals) - .Load(); - } - } - - var user = this.Context.Users - .Include(u => u.Agencies) - .ThenInclude(a => a.Agency) - .ThenInclude(a => a.Children) - .SingleOrDefault(u => u.Username == this.User.GetUsername()) ?? throw new KeyNotFoundException(); - var userAgencies = user.Agencies.Select(a => a.AgencyId).ToList(); - var originalAgencyId = (int)this.Context.Entry(originalProject).OriginalValues[nameof(Project.AgencyId)]; - if (!isAdmin && !userAgencies.Contains(originalAgencyId)) throw new NotAuthorizedException("User may not edit projects outside of their agency."); - - // If the user isn't allowed to update the project, just update the notes. - if (!this.IsAllowedToUpdate(originalProject, _options.Project) && !originalProject.IsProjectInDraft(_options.Project) && !originalProject.IsProjectClosed()) - { - originalProject.AddOrUpdateNotes(project); - this.Context.SaveChanges(); - this.Context.CommitTransaction(); - return Get(originalProject.Id); - } - else - { - this.ThrowIfNotAllowedToUpdate(originalProject, _options.Project); - } - - // Do not allow switching agencies through this method. - if (originalAgencyId != project.AgencyId) throw new NotAuthorizedException("Project cannot be transferred to the specified agency."); - - // Not allowed to change the project number. - var originalProjectNumber = (string)this.Context.Entry(originalProject).OriginalValues[nameof(Project.ProjectNumber)]; - if (originalProjectNumber != project.ProjectNumber) throw new InvalidOperationException("Project number cannot be changed."); - - // Only allow valid non-milestone project status transitions. - var fromStatusId = (int)this.Context.Entry(originalProject).OriginalValues[nameof(Project.StatusId)]; - if (fromStatusId != project.StatusId) - { - var fromStatus = this.Context.WorkflowProjectStatus - .Include(s => s.Status) - .ThenInclude(s => s.Tasks) - .Include(s => s.ToStatus) - .FirstOrDefault(s => s.WorkflowId == originalProject.WorkflowId && s.StatusId == fromStatusId); - var toStatus = this.Context.ProjectStatus - .Include(s => s.Tasks) - .FirstOrDefault(s => s.Id == project.StatusId); - if (toStatus.IsMilestone) throw new InvalidOperationException($"Project status transitions from '{fromStatus.Status.Name}' to '{toStatus?.Name}' requires a milestone transition."); - if (!fromStatus.ToStatus.Any(s => s.ToStatusId == project.StatusId)) throw new InvalidOperationException($"Invalid project status transitions from '{fromStatus.Status.Name}' to '{toStatus?.Name}'."); - - // Validate that all required tasks have been completed for the current status before allowing transition from one status to another. - var incompleteTaskIds = project.Tasks.Where(t => t.IsCompleted == false).Select(t => t.TaskId); - var statusTaskIds = fromStatus.Status.Tasks.Select(t => t.Id); - var incompleteStatusTaskIds = incompleteTaskIds.Intersect(statusTaskIds); - if (originalProject.Tasks.Any(t => !t.Task.IsOptional && !t.IsCompleted && incompleteStatusTaskIds.Contains(t.TaskId))) throw new InvalidOperationException("Not all required tasks have been completed."); - - // Add a project status history to record the change. - this.Context.ProjectStatusHistory.Add(new ProjectStatusHistory(originalProject)); - } - - // Determine if there are any response changes. - var responses = originalProject.GetResponseChanges(project); - originalProject.UpdateResponses(project); - - // If the note was changed generate a notification for it. - var noteChanged = !String.IsNullOrWhiteSpace(project.GetNoteText(NoteTypes.Public)) && originalProject.GetNoteText(NoteTypes.Public) != project.GetNoteText(NoteTypes.Public); - - originalProject.Merge(project, this.Context); - originalProject.Metadata = project.Metadata; - originalProject.AddOrUpdateNotes(project); - - this.Context.SaveChanges(); - this.Context.CommitTransaction(); - - await SendNotificationsAsync(Get(originalProject.Id), fromStatusId, responses, noteChanged); - - return Get(originalProject.Id); - } - - /// - /// Remove the specified project from the datasource. - /// - /// - /// Argument 'project' is required. - /// Project rowversion is required. - /// Project does not exist. - /// User does not have permission to delete project. - /// - public async System.Threading.Tasks.Task RemoveAsync(Project project) - { - project.ThrowIfNotAllowedToEdit(nameof(project), this.User, new[] { Permissions.ProjectDelete, Permissions.AdminProjects }); - var user = this.Context.Users - .Include(u => u.Agencies) - .ThenInclude(a => a.Agency) - .ThenInclude(a => a.Children) - .SingleOrDefault(u => u.Username == this.User.GetUsername()) ?? throw new KeyNotFoundException(); - var userAgencies = user.Agencies.Select(a => a.AgencyId).ToList(); - bool isAdmin = this.User.HasPermission(Permissions.AdminProjects); - - // Only add functionality for removing Approved Disposal Projects if the current environment is not production - string env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); - if (!env.IsProduction()) - { - // If the project has been submitted, we need to remove any reference to the project - // from the notification queue table before deleting the project itself - IQueryable notifications = this.Context.NotificationQueue.Where(n => n.ProjectId == project.Id || n.ProjectId.ToString() == project.ProjectNumber); - - // NotificationQueue stores several records for each approved project. This is due to the number of people needing to be CC'd - notifications.ForEach(n => - { - /* this.Context.NotificationQueue.Remove(n); - _notifyService.CancelAsync(n); */ - }); - - } - - var originalProject = this.Context.Projects - .Include(p => p.Status) - .Include(p => p.Properties).ThenInclude(p => p.Parcel).ThenInclude(p => p.Parcels) - - .Include(p => p.Notes) - .Include(p => p.Properties).ThenInclude(p => p.Building) - .Include(p => p.Tasks) - .Include(p => p.Workflow) - .SingleOrDefault(p => p.Id == project.Id || p.ProjectNumber == project.ProjectNumber) ?? throw new KeyNotFoundException(); - - if (!originalProject.IsProjectInDraft(_options.Project)) - { - this.ThrowIfNotAllowedToUpdate(originalProject, _options.Project); - } - - if (!isAdmin && (!userAgencies.Contains(originalProject.AgencyId))) - throw new NotAuthorizedException("User does not have permission to delete."); - - this.Context.Entry(originalProject).CurrentValues.SetValues(project); - this.Context.SetOriginalRowVersion(originalProject); - - originalProject.Tasks.ForEach(t => - { - this.Context.ProjectTasks.Remove(t); - }); - originalProject.Properties.ForEach(p => - { - this.Context.Update(p.RemoveProjectNumber(project.ProjectNumber)); - - this.Context.ProjectProperties.Remove(p); - }); - - await this.CancelNotificationsAsync(project.Id); - - originalProject.Notifications.ForEach(n => this.Context.NotificationQueue.Remove(n)); - originalProject.Notifications.Clear(); // TODO: Need to test this to determine if it'll let us delete a project with existing notifications. - originalProject.StatusHistory.Clear(); - this.Context.Projects.Remove(originalProject); - this.Context.CommitTransaction(); - return originalProject; - } - - /// - /// Change the status of the project. - /// Only valid transitions are allowed. - /// Use this method to transition to milestone project statuses. - /// Performs additional logic on milestone transitions. - /// Make sure you set the specified 'project' status to the destination status you want. - /// - /// - /// - /// Argument 'project' is required. - /// Argument 'workflow' is required. - /// Argument 'status' is required. - /// Project rowversion is required. - /// Project does not exist. - /// User does not have permission to edit project. - /// User does not have permission to submit request. - /// User does not have permission to approve request. - /// Invalid project status transition. - /// Denying a project requires a reason to be included in the shared note. - /// - public async System.Threading.Tasks.Task SetStatusAsync(Project project, string workflowCode) - { - var workflow = this.Context.Workflows - .Include(w => w.Status) - .ThenInclude(s => s.Status) - .FirstOrDefault(w => w.Code == workflowCode) ?? throw new KeyNotFoundException(); - - return await SetStatusAsync(project, workflow); - } - - /// - /// Change the status of the project. - /// Only valid transitions are allowed. - /// Use this method to transition to milestone project statuses. - /// Performs additional logic on milestone transitions. - /// - /// - /// - /// Argument 'project' is required. - /// Argument 'workflow' is required. - /// Argument 'status' is required. - /// Project rowversion is required. - /// Project does not exist. - /// Project status does not exist. - /// User does not have permission to edit project. - /// User does not have permission to submit request. - /// User does not have permission to approve request. - /// Invalid project status transition. - /// Denying a project requires a reason to be included in the shared note. - /// - public async System.Threading.Tasks.Task SetStatusAsync(Project project, Workflow workflow, bool sendNotifications = true) - { - project.ThrowIfNotAllowedToEdit(nameof(project), this.User, new[] { Permissions.ProjectEdit, Permissions.AdminProjects }); - workflow.ThrowIfNull(nameof(workflow)); - - var isAdmin = this.User.HasPermission(Permissions.AdminProjects); - - var originalProject = this.Context.Projects - .Include(p => p.Status) - .Include(p => p.Agency) - .Include(p => p.Agency).ThenInclude(p => p.Parent) - .Include(p => p.Properties).ThenInclude(p => p.Parcel).ThenInclude(p => p.Parcels).ThenInclude(p => p.Parcel) - .Include(p => p.Properties) - .ThenInclude(p => p.Building) - .Include(p => p.Tasks) - .Include(p => p.Workflow) - .Include(p => p.Responses) - .Include(p => p.Notes) - .FirstOrDefault(p => p.Id == project.Id) ?? throw new KeyNotFoundException(); - var user = this.Context.Users - .Include(u => u.Agencies) - .ThenInclude(a => a.Agency) - .ThenInclude(a => a.Children) - .SingleOrDefault(u => u.Username == this.User.GetUsername()) ?? throw new KeyNotFoundException(); - var userAgencies = user.Agencies.Select(a => a.AgencyId).ToList(); - if (!isAdmin && !userAgencies.Contains(originalProject.AgencyId)) throw new NotAuthorizedException("User may not edit projects outside of their agency."); - - // Only allow valid project status transitions. - var fromStatusId = (int)this.Context.Entry(originalProject).OriginalValues[nameof(Project.StatusId)]; - var fromStatus = this.Context.WorkflowProjectStatus - .Include(s => s.ToStatus) - .Include(s => s.Status) - .ThenInclude(s => s.Tasks) - .FirstOrDefault(s => s.WorkflowId == originalProject.WorkflowId && s.StatusId == fromStatusId) ?? throw new ConfigurationException($"Original workflow '{originalProject.Workflow.Code}' no longer has status '{fromStatusId}'."); - var toStatus = this.Context.ProjectStatus - .Include(s => s.Tasks) - .FirstOrDefault(s => s.Id == project.StatusId) ?? throw new KeyNotFoundException(); - - if (fromStatus.StatusId != toStatus.Id && (fromStatus.Status.SortOrder <= toStatus.SortOrder || toStatus.IsTerminal)) - { - var fromWorkflow = fromStatus.ToStatus.FirstOrDefault(s => s.ToStatusId == project.StatusId); - if (fromWorkflow == null) throw new InvalidOperationException($"Invalid project status transitions from '{fromStatus.Status.Name}' to '{toStatus?.Name}'."); - project.WorkflowId = fromWorkflow.ToWorkflowId; // Transition to the new workflow if required. - - // TODO: Ideally this would handle scenarios where some tasks would need to be performed for termnating a project. - if (fromWorkflow.ValidateTasks) - { - // Validate that all required tasks have been completed for the current status before allowing transition from one status to another. - var completedTaskIds = project.Tasks.Where(t => t.IsCompleted).Select(t => t.TaskId); - var incompleteTaskIds = originalProject.Tasks.Where(t => !t.IsCompleted && !completedTaskIds.Contains(t.TaskId)).Select(t => t.TaskId); - var statusTaskIds = fromStatus.Status.Tasks.Where(t => !t.IsOptional).Select(t => t.Id); - if (toStatus.IsTerminal) - { - statusTaskIds = statusTaskIds.Concat(toStatus.Tasks.Where(t => !t.IsOptional).Select(t => t.Id)); - } - var incompleteStatusTaskIds = statusTaskIds.Any() && (project.Tasks.Any() || originalProject.Tasks.Any()) ? incompleteTaskIds.Intersect(statusTaskIds) : statusTaskIds; - if (incompleteStatusTaskIds.Any()) throw new InvalidOperationException("Not all required tasks have been completed."); - } - } - - // Add a project status history to record the change. - this.Context.ProjectStatusHistory.Add(new ProjectStatusHistory(originalProject)); - - // Determine if there are any response changes. - var responses = originalProject.GetResponseChanges(project); - originalProject.UpdateResponses(project); - - // If the note was changed generate a notification for it. - var noteChanged = !String.IsNullOrWhiteSpace(project.GetNoteText(NoteTypes.Public)) && originalProject.GetNoteText(NoteTypes.Public) != project.GetNoteText(NoteTypes.Public); - - var metadata = !String.IsNullOrWhiteSpace(project.Metadata) ? this.Context.Deserialize(project.Metadata ?? "{}") : new DisposalProjectMetadata(); - originalProject.Merge(project, this.Context); - var now = DateTime.UtcNow; - - // Hardcoded logic to handle milestone project status transitions. - // This could be extracted at some point to a configurable layer, but not required presently. - switch (toStatus.Code) - { - case ("AS-I"): // Review - case ("AS-EXE"): // Exemption Review - this.User.ThrowIfNotAuthorized(Permissions.DisposeRequest, "User does not have permission to submit project."); - // This must be done first because it requires its own transaction. - var projectNumber = this.Context.GenerateProjectNumber(_options.Project.NumberFormat); - this.Context.UpdateProjectNumber(originalProject, projectNumber); - originalProject.SubmittedOn = now; - break; - case ("AP-ERP"): // Approve for ERP - this.User.ThrowIfNotAuthorized(Permissions.DisposeApprove, "User does not have permission to approve project."); - this.Context.SetProjectPropertiesVisiblity(originalProject, true); - // Default notification dates. - if (sendNotifications) - { - metadata.InitialNotificationSentOn = now; - metadata.ThirtyDayNotificationSentOn = now.AddDays(30); - metadata.SixtyDayNotificationSentOn = now.AddDays(60); - metadata.NinetyDayNotificationSentOn = now.AddDays(90); - } - originalProject.ApprovedOn = now; - metadata.ExemptionRequested = false; // Adding to ERP removes exemption. - break; - case ("AP-EXE"): // Approve for ERP Exemption - this.User.ThrowIfNotAuthorized(Permissions.DisposeApprove, "User does not have permission to approve project."); - if (metadata.ExemptionApprovedOn == null) throw new InvalidOperationException("ADM approved exemption on date is required before approving."); - originalProject.ApprovedOn = now; - break; - case ("ERP-ON"): // ERP process has begun - this.Context.SetProjectPropertiesVisiblity(originalProject, true); - break; - case ("AP-SPL"): // Approve for SPL - this.User.ThrowIfNotAuthorized(Permissions.DisposeApprove, "User does not have permission to approve project."); - if (metadata.ClearanceNotificationSentOn == null - && clearanceRequiredForStatus.Contains(fromStatus.Status.Code)) throw new InvalidOperationException("Approved for SPL status requires Clearance Notification Sent date."); - if (metadata.RequestForSplReceivedOn == null) throw new InvalidOperationException("Approved for SPL status requires the date when the request was received."); - if (metadata.ApprovedForSplOn == null) throw new InvalidOperationException("Approved for SPL status requires the date when the request for SPL was approved on."); - originalProject.ApprovedOn = originalProject.ApprovedOn.HasValue ? originalProject.ApprovedOn : now; // Only set the date it hasn't been set yet. - this.Context.SetProjectPropertiesVisiblity(originalProject, false); - originalProject.SubmittedOn = now; - break; - case ("AP-!SPL"): // Not in SPL - this.User.ThrowIfNotAuthorized(Permissions.DisposeApprove, "User does not have permission to approve project."); // TODO: Need to update permission claims to handle workflow better. - if (metadata.ClearanceNotificationSentOn == null - && clearanceRequiredForStatus.Contains(fromStatus.Status.Code)) throw new InvalidOperationException("Not in SPL status requires Clearance Notification Sent date."); - originalProject.ApprovedOn = originalProject.ApprovedOn.HasValue ? originalProject.ApprovedOn : now; // Only set the date it hasn't been set yet. - this.Context.SetProjectPropertiesVisiblity(originalProject, false); - break; - case ("SPL-M"): // Marketing - if (metadata.MarketedOn == null) throw new InvalidOperationException("Marketing status requires Marketed On date."); - break; - case ("DE"): // Deny - // Must have shared note with a reason. - if (String.IsNullOrWhiteSpace(project.GetNoteText(NoteTypes.Public))) throw new InvalidOperationException("Shared note must contain a reason before denying project."); - // Remove ProjectNumber from properties. - this.Context.ReleaseProjectProperties(originalProject); - originalProject.DeniedOn = now; - break; - case ("CA"): // Cancel - this.Context.ReleaseProjectProperties(originalProject); - originalProject.CancelledOn = now; - - // Cancel any pending notifications. - await CancelNotificationsAsync(originalProject.Id); - break; - case ("DIS"): // DISPOSED - if (metadata.DisposedOn == null) throw new InvalidOperationException("Disposed status requires date the project was disposed on."); - this.Context.DisposeProjectProperties(originalProject); - originalProject.CompletedOn = metadata.DisposedOn; - break; - case ("ERP-OH"): // OnHold - if (metadata.OnHoldNotificationSentOn == null) throw new InvalidOperationException("On Hold status requires On Hold Notification Sent date."); - this.Context.SetProjectPropertiesVisiblity(originalProject, false); - break; - case ("T-GRE"): // Transferred within the GRE - if (metadata.TransferredWithinGreOn == null) throw new InvalidOperationException("Transferred within GRE status requires Transferred Within GRE date."); - this.Context.TransferProjectProperties(originalProject, project); - break; - default: - // All other status changes can only be done by `admin-projects` or when the project is in draft mode. - this.ThrowIfNotAllowedToUpdate(originalProject, _options.Project); - break; - } - - // Update a project - originalProject.StatusId = toStatus.Id; - originalProject.Status = toStatus; - - originalProject.Metadata = this.Context.Serialize(metadata); - project.CopyRowVersionTo(originalProject); - this.Context.CommitTransaction(); - - if (sendNotifications) - { - await SendNotificationsAsync(originalProject, fromStatusId, responses, noteChanged); - } - - return Get(originalProject.Id); - } - - #region Notifications - /// - /// Cancel all the pending notifications for the specified 'projectId' and 'agencyId'. - /// This function does not update the data source. - /// - /// - /// - /// - public async System.Threading.Tasks.Task> CancelNotificationsAsync(int projectId, int? agencyId = null) - { - var notifications = new List(); - try - { - var qty = 100; - var pos = 1; - var total = 101; - - // Page through pending notifications to cancel them. - while (pos * qty < total) - { - var page = GetNotificationsInQueue(new ProjectNotificationFilter() - { - Page = pos++, - Quantity = qty, - ProjectId = projectId, - AgencyId = agencyId, - Status = new[] { NotificationStatus.Accepted, NotificationStatus.Pending } - }); - total = page.Total; - - await _notifyService.CancelAsync(page); - notifications.AddRange(page.Items); - } - } - catch (Exception ex) - { - this.Logger.LogError(ex, $"Failed to cancel all notifications."); - if (_options.Notifications.ThrowExceptions) throw; - } - return notifications; - } - #endregion - - #region Helpers - /// - /// Generates new notifications for response that have shown interested. - /// Additionally cancels any future dated notifications for responses that have indicated they are not interested in a project. - /// This function does not send notifications, it only generates them. - /// This will generated notifications if there are templates mapped to the current status and their audience is for 'WatchingAgencies'. - /// All 'SendOn' dates will be based on the 'Project.ApprovalDate + DelayDays'. - /// - /// - /// - private async System.Threading.Tasks.Task> GenerateWatchNotificationsAsync(IEnumerable responses) - { - var notifications = new List(); - foreach (var response in responses) - { - switch (response.Response) - { - case NotificationResponses.Unsubscribe: - case NotificationResponses.Watch: - // Cancel all outstanding notifications. - this.Context.NotificationQueue.UpdateRange(await CancelNotificationsAsync(response.ProjectId, response.AgencyId)); - break; - case NotificationResponses.Subscribe: - // Ensure objects are in context - if (response.Project == null) response.Project = Get(response.ProjectId); - if (response.Agency == null) response.Agency = this.Context.Agencies.First(a => a.Id == response.AgencyId); - - // Notifications need to be added to the queue for the interested agency. - var daysSinceApproved = response.Project.ApprovedOn.HasValue ? (DateTime.UtcNow - response.Project.ApprovedOn.Value.ToUniversalTime()).TotalDays : 0; - - // Get all notifications for the project that are configured for watching agencies and have not expired. - var options = this.Context.ProjectStatusNotifications - .Include(s => s.Template) - .Where(s => s.ToStatusId == response.Project.StatusId - && s.Template.Audience == NotificationAudiences.WatchingAgencies - && (s.Delay == NotificationDelays.Days || s.Delay == NotificationDelays.None) - && s.DelayDays > daysSinceApproved).ToArray(); - - foreach (var option in options) - { - // TODO: This is slow as a separate request is made for each notification. Ideally this would be part of an earlier join statement. - // Need to determine if there is already one pending in the queue. - var notificationExists = ( - from nq in this.Context.NotificationQueue - where nq.ProjectId == response.ProjectId - && nq.ToAgencyId == response.AgencyId - && nq.TemplateId == option.TemplateId - && (nq.Status == NotificationStatus.Accepted || nq.Status == NotificationStatus.Pending) - select new { nq.Id } - ).Any(); - - // Only generate a notification if one doesn't already exist in the queue. - if (!notificationExists) - { - var sendOn = option.Delay switch - { - NotificationDelays.None => response.Project.CreatedOn, - NotificationDelays.Days => response.Project.ApprovedOn?.AddDays(option.DelayDays) ?? DateTime.UtcNow.AddDays(option.DelayDays), - _ => response.Project.CreatedOn - }; - - notifications.Add(this.Self.NotificationQueue.GenerateNotification(response.Project, option, response.Agency, sendOn)); - } - } - break; - }; - } - - return notifications; - } - - /// - /// Generate and send notifications for the specified 'project'. - /// - /// - /// - /// - /// - /// - private async System.Threading.Tasks.Task SendNotificationsAsync(Project project, int? fromStatusId, IEnumerable responses, bool noteChanged) - { - var notifications = new List(); - if (noteChanged) - { - notifications.Add(this.Self.NotificationQueue.GenerateNotification(project, "Project Shared Note Changed")); - } - - // If the status did not change, do not send notifications. - if (fromStatusId != project.StatusId) - { - notifications.AddRange(this.Self.NotificationQueue.GenerateNotifications(project, fromStatusId, project.StatusId)); - } - - // Send/Cancel notifications based on responses. - if (responses.Any()) - { - notifications.AddRange(await GenerateWatchNotificationsAsync(responses)); - } - - await this.Self.NotificationQueue.SendNotificationsAsync(notifications); - - this.Context.CommitTransaction(); - } - #endregion - #endregion - } -} diff --git a/backend/dal/Services/Concrete/ProjectStatusService.cs b/backend/dal/Services/Concrete/ProjectStatusService.cs deleted file mode 100644 index cf2e9ef53c..0000000000 --- a/backend/dal/Services/Concrete/ProjectStatusService.cs +++ /dev/null @@ -1,57 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Pims.Dal.Entities; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Services -{ - /// - /// ProjectStatusService class, provides a service layer to interact with project status within the datasource. - /// - public class ProjectStatusService : BaseService, IProjectStatusService - { - #region Constructors - /// - /// Creates a new instance of a ProjectStatusService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public ProjectStatusService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) { } - #endregion - - #region Methods - - /// - /// Get an array of all project status. - /// - /// - /// - public IEnumerable Get() - { - var status = this.Context.ProjectStatus - .AsNoTracking() - .Include(s => s.Workflows) - .ThenInclude(w => w.Workflow) - .OrderBy(s => s.SortOrder); - - return status.ToArray(); - } - - /// - /// Get the project status for the specified 'id'. - /// - /// - /// Project status does not exist for the specified 'id'. - /// - public ProjectStatus Get(int id) - { - return this.Context.ProjectStatus - .Find(id) ?? throw new KeyNotFoundException(); - } - #endregion - } -} diff --git a/backend/dal/Services/Concrete/PropertyService.cs b/backend/dal/Services/Concrete/PropertyService.cs deleted file mode 100644 index 399e38f0f6..0000000000 --- a/backend/dal/Services/Concrete/PropertyService.cs +++ /dev/null @@ -1,253 +0,0 @@ -using Microsoft.Extensions.Logging; -using Pims.Core.Extensions; -using Pims.Dal.Entities.Models; -using Pims.Dal.Entities.Views; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using System.Text.Json; -using Microsoft.EntityFrameworkCore; - -namespace Pims.Dal.Services -{ - /// - /// PropertyService class, provides a service layer to interact with properties within the datasource. - /// - public class PropertyService : BaseService, IPropertyService - { - #region Constructors - /// - /// Creates a new instance of a PropertyService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public PropertyService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) { } - #endregion - - #region Methods - /// - /// Returns the total number of properties in the database. - /// - /// - public int Count() - { - return this.Context.Properties.Count(); - } - - /// - /// Get an array of properties within the specified filters. - /// Will not return sensitive properties unless the user has the `sensitive-view` claim and belongs to the owning agency. - /// Note that the 'parcelFilter' will control the 'page' and 'quantity'. - /// - /// - /// - public IEnumerable Get(AllPropertyFilter filter) - { - this.User.ThrowIfNotAuthorized(Permissions.PropertyView); - filter.ThrowIfNull(nameof(filter)); - if (!filter.IsValid()) throw new ArgumentException("Argument must have a valid filter", nameof(filter)); - - var parcelFilter = (ParcelFilter)filter; - var buildingFilter = (BuildingFilter)filter; - - if (parcelFilter.IsValid() && !buildingFilter.IsValid()) - { - filter.PropertyType = Entities.PropertyTypes.Land; - } - else if (!parcelFilter.IsValid()) - { - filter.PropertyType = Entities.PropertyTypes.Building; - } - - var query = this.Context.GenerateQuery(this.User, filter); - var properties = query.Select(x => new ProjectProperty(x)).ToArray(); - - var projectNumbers = properties.SelectMany(p => JsonSerializer.Deserialize>(p.ProjectNumbers ?? "[]")).Distinct().ToArray(); - var statuses = from p in this.Context.ProjectProperties - where projectNumbers.Contains(p.Project.ProjectNumber) - select new { p.Project.ProjectNumber, p.Project.Status, WorkflowCode = p.Project.Workflow.Code }; - - foreach (var status in statuses) - { - foreach (var projectProperty in properties.Where(property => property.ProjectNumbers.Contains(status.ProjectNumber))) - { - projectProperty.ProjectStatus = status.Status.Code; - projectProperty.ProjectWorkflow = status.WorkflowCode; - } - } - - // TODO: Add optional paging ability to query. - - return properties; - } - - - /// - /// Get an array of property names within the specified filters. - /// Will not return sensitive properties unless the user has the `sensitive-view` claim and belongs to the owning agency. - /// - /// - /// - public IEnumerable GetNames(AllPropertyFilter filter) - { - this.User.ThrowIfNotAuthorized(Permissions.PropertyView); - filter.ThrowIfNull(nameof(filter)); - if (!filter.IsValid()) throw new ArgumentException("Argument must have a valid filter", nameof(filter)); - - var parcelFilter = (ParcelFilter)filter; - var buildingFilter = (BuildingFilter)filter; - - if (parcelFilter.IsValid() && !buildingFilter.IsValid()) - { - filter.PropertyType = Entities.PropertyTypes.Land; - } - else if (!parcelFilter.IsValid()) - { - filter.PropertyType = Entities.PropertyTypes.Building; - } - - var query = this.Context.GenerateQuery(this.User, filter); - var properties = query.Where(x => !string.IsNullOrWhiteSpace(x.Name)).Select(x => x.Name).ToArray(); - - return properties; - } - - /// - /// Get an array of properties within the specified filters. - /// Will not return sensitive properties unless the user has the `sensitive-view` claim and belongs to the owning agency. - /// Note that the 'parcelFilter' will control the 'page' and 'quantity'. - /// - /// - /// - public IEnumerable Search(AllPropertyFilter filter) - { - this.User.ThrowIfNotAuthorized(Permissions.PropertyView); - filter.ThrowIfNull(nameof(filter)); - if (!filter.IsValid()) throw new ArgumentException("Argument must have a valid filter", nameof(filter)); - - var parcelFilter = (ParcelFilter)filter; - var buildingFilter = (BuildingFilter)filter; - - if (parcelFilter.IsValid() && !buildingFilter.IsValid()) - { - filter.PropertyType = Entities.PropertyTypes.Land; - } - else if (!parcelFilter.IsValid()) - { - filter.PropertyType = Entities.PropertyTypes.Building; - } - - IQueryable query = this.Context.GenerateAllPropertyQuery(this.User, filter); - var user = this.Context.Users - .Include(u => u.Agencies) - .ThenInclude(a => a.Agency) - .ThenInclude(a => a.Children) - .SingleOrDefault(u => u.Username == this.User.GetUsername()) ?? throw new KeyNotFoundException(); - var userAgencies = user.Agencies.Select(a => a.AgencyId).ToList(); - - var properties = query.Select(p => new[] { Entities.PropertyTypes.Land, Entities.PropertyTypes.Subdivision }.Contains(p.PropertyTypeId) ? new ParcelModel(p, this.User) as PropertyModel : new BuildingModel(p, this.User)).ToArray(); - - var projectNumbers = properties.SelectMany(p => JsonSerializer.Deserialize>(p.ProjectNumbers ?? "[]")).Distinct().ToArray(); - var statuses = from p in this.Context.ProjectProperties - where projectNumbers.Contains(p.Project.ProjectNumber) - select new { p.Project.ProjectNumber, p.Project.Status, WorkflowCode = p.Project.Workflow.Code, p.Project.Status.IsTerminal }; - - foreach (var status in statuses.Where(s => !s.IsTerminal)) - { - foreach (var property in properties.Where(property => property?.ProjectNumbers?.Contains(status.ProjectNumber) == true)) - { - property.ProjectWorkflow = status.WorkflowCode; - } - } - - //Conditionally removing values from each property object before returning; Ensuring that the user has the correct permissions for each property. - return properties.Select(p => - { - if (userAgencies.Contains((int)p.AgencyId) || this.User.HasClaim(c => c.Value == "admin-properties")) - { - return p; - } - - p.Name = null; - p.Description = null; - p.IsSensitive = true; - p.AgencyCode = null; - p.Agency = null; - p.SubAgencyCode = null; - p.Market = null; - p.MarketFiscalYear = null; - p.NetBook = null; - p.NetBookFiscalYear = null; - - if (p.PropertyTypeId == Entities.PropertyTypes.Land) - { - (p as ParcelModel).Zoning = null; - (p as ParcelModel).ZoningPotential = null; - (p as ParcelModel).AssessedLand = null; - (p as ParcelModel).AssessedLandDate = null; - (p as ParcelModel).AssessedBuilding = null; - (p as ParcelModel).AssessedBuildingDate = null; - - return p; - } - - if (p.PropertyTypeId == Entities.PropertyTypes.Building) - { - (p as BuildingModel).LeaseExpiry = null; - (p as BuildingModel).OccupantName = null; - (p as BuildingModel).TransferLeaseOnSale = null; - (p as BuildingModel).Assessed = null; - (p as BuildingModel).AssessedDate = null; - - return p; - } - - return p; - }); - - } - - - - /// - /// Get a page with an array of properties within the specified filters. - /// Will not return sensitive properties unless the user has the `sensitive-view` claim and belongs to the owning agency. - /// Note that the 'parcelFilter' will control the 'page' and 'quantity'. - /// - /// - /// - public Paged GetPage(AllPropertyFilter filter) - { - this.User.ThrowIfNotAuthorized(Permissions.PropertyView); - filter.ThrowIfNull(nameof(filter)); - if (!filter.IsValid()) throw new ArgumentException("Argument must have a valid filter", nameof(filter)); - - var parcelFilter = (ParcelFilter)filter; - var buildingFilter = (BuildingFilter)filter; - - if (parcelFilter.IsValid() && !buildingFilter.IsValid()) - { - filter.PropertyType = Entities.PropertyTypes.Land; - } - else if (!parcelFilter.IsValid() && buildingFilter.IsValid()) - { - filter.PropertyType = Entities.PropertyTypes.Building; - } - - var skip = (filter.Page - 1) * filter.Quantity; - var query = this.Context.GenerateQuery(this.User, filter); - var items = query - .Skip(skip) - .Take(filter.Quantity) - .ToArray(); - - return new Paged(items, filter.Page, filter.Quantity, query.Count()); - } - #endregion - } -} diff --git a/backend/dal/Services/Concrete/TaskService.cs b/backend/dal/Services/Concrete/TaskService.cs deleted file mode 100644 index 313e3ccb78..0000000000 --- a/backend/dal/Services/Concrete/TaskService.cs +++ /dev/null @@ -1,79 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Pims.Dal.Entities; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Services -{ - /// - /// TaskService class, provides a service layer to interact with tasks within the datasource. - /// - public class TaskService : BaseService, ITaskService - { - #region Constructors - /// - /// Creates a new instance of a TaskService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public TaskService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) { } - #endregion - - #region Methods - /// - /// Get an array of tasks for the specified 'statusId'. - /// - /// - /// - public IEnumerable GetForStatus(int statusId) - { - var tasks = from s in this.Context.ProjectStatus.AsNoTracking() - join t in this.Context.Tasks on s.Id equals t.StatusId - where s.Id == statusId - orderby t.SortOrder, t.Name - select t; - - return tasks.ToArray(); - } - - /// - /// Get an array of tasks for the specified 'statusCode'. - /// - /// - /// - public IEnumerable GetForStatus(string statusCode) - { - var tasks = from s in this.Context.ProjectStatus.AsNoTracking() - join t in this.Context.Tasks on s.Id equals t.StatusId - where s.Code == statusCode - orderby t.SortOrder, t.Name - select t; - - return tasks.ToArray(); - } - - /// - /// Get an array of tasks for the specified 'workflowCode'. - /// - /// - /// - public IEnumerable GetForWorkflow(string workflowCode) - { - var tasks = from w in this.Context.Workflows.AsNoTracking() - join ws in this.Context.WorkflowProjectStatus on w.Id equals ws.WorkflowId - join t in this.Context.Tasks on ws.StatusId equals t.StatusId into gt - from at in gt.DefaultIfEmpty() - where w.Code == workflowCode - && at != null - orderby ws.SortOrder, at.SortOrder, at.Name - select at; - - return tasks.Distinct().ToArray(); - } - #endregion - } -} diff --git a/backend/dal/Services/Concrete/UserService.cs b/backend/dal/Services/Concrete/UserService.cs deleted file mode 100644 index fe60156c2e..0000000000 --- a/backend/dal/Services/Concrete/UserService.cs +++ /dev/null @@ -1,356 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Pims.Core.Extensions; -using Pims.Dal.Entities; -using Pims.Dal.Entities.Comparers; -using Pims.Dal.Exceptions; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Services -{ - /// - /// UserService class, provides a service layer to interact with users within the datasource. - /// - public class UserService : BaseService, IUserService - { - #region Variables - private readonly PimsOptions _options; - #endregion - - #region Constructors - /// - /// Creates a new instance of a UserService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - /// - /// - public UserService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, IOptionsMonitor options, ILogger logger) : base(dbContext, user, service, logger) - { - _options = options.CurrentValue; - } - #endregion - - #region Methods - - /// - /// Determine if the user for the specified 'KeycloakUserId' exists in the datasource. - /// - /// - /// - public bool UserExists(Guid KeycloakUserId) - { - this.User.ThrowIfNotAuthorized(); - - return this.Context.Users.Any(u => u.KeycloakUserId == KeycloakUserId); - } - - /// - /// Determine if the user for the specified 'KeycloakUserId' exists in the datasource. - /// - /// - /// - public bool UserExists(string username) - { - this.User.ThrowIfNotAuthorized(); - - return this.Context.Users.Any(u => u.Username == username); - } - - /// - /// Get the user for the specified 'username'. - /// - /// - /// - public User GetUserForUsername(string username) - { - return this.Context.Users.FirstOrDefault(u => u.Username == username); - } - - /// - /// Get the user for the specified 'keycloakUserId'. - /// - /// - /// - public User GetUserForKeycloakId(Guid keycloakUserId) - { - return this.Context.Users.FirstOrDefault(u => u.KeycloakUserId == keycloakUserId); - } - - /// - /// Activate the new authenticated user with the PIMS datasource. - /// If activating a service account, then the configuration must be provided to set the default attributes. - /// - /// - public User Activate() - { - this.User.ThrowIfNotAuthorized(); - - string username = this.User.GetUsername(); - - User user = GetUserForUsername(username); - bool exists = user != null; - if (!exists) - { - Guid guid = this.User.GetGuid(); - string givenName = this.User.GetFirstName() ?? - throw new ConfigurationException($"Configuration 'Pims:ServiceAccount:FirstName' is invalid or missing."); - string surname = this.User.GetLastName() ?? - throw new ConfigurationException($"Configuration 'Pims:ServiceAccount:LastName' is invalid or missing."); - string email = this.User.GetEmail() ?? - throw new ConfigurationException($"Configuration 'Pims:ServiceAccount:Email' is invalid or missing."); - - this.Logger.LogInformation($"User Activation: keycloak id:{guid}, email:{email}, username:{username}, first:{givenName}, surname:{surname}"); - - user = new User(guid, username, email, givenName, surname); - this.Context.Users.Add(user); - } - else - { - user.LastLogin = DateTime.UtcNow; - user.KeycloakUserId = this.User.GetGuid(); - this.Context.Entry(user).State = EntityState.Modified; - } - - this.Context.CommitTransaction(); - if (!exists) this.Logger.LogInformation($"User Activated: '{user.KeycloakUserId}' - '{user.Username}'."); - return user; - } - - #region Access Requests - /// - /// Get the most recent access request that has not been disabled for the current user. - /// - /// - public AccessRequest GetAccessRequest() - { - var username = this.User.GetUsername(); - var user = GetUserForUsername(username); - - var accessRequest = this.Context.AccessRequests - .Include(a => a.Agencies) - .ThenInclude(a => a.Agency) - .Include(a => a.Roles) - .ThenInclude(r => r.Role) - .Include(a => a.User) - .AsNoTracking() - .OrderByDescending(a => a.CreatedOn) - .FirstOrDefault(a => a.UserId == user.Id && a.Status == AccessRequestStatus.OnHold); - return accessRequest; - } - - /// - /// Get the access request for the specified 'id'. - /// - /// - /// - public AccessRequest GetAccessRequest(int id) - { - var accessRequest = this.Context.AccessRequests - .Include(a => a.Agencies) - .ThenInclude(a => a.Agency) - .Include(a => a.Roles) - .ThenInclude(r => r.Role) - .Include(a => a.User) - .AsNoTracking() - .FirstOrDefault(a => a.Id == id) ?? throw new KeyNotFoundException(); - var username = this.User.GetUsername(); - var user = this.GetUserForUsername(username); - if (accessRequest.UserId != user.Id) throw new NotAuthorizedException(); - return accessRequest; - } - /// - /// Delete an access request - /// - /// The item to be deleted - /// - public AccessRequest DeleteAccessRequest(AccessRequest accessRequest) - { - var entity = Context.AccessRequests - .Include(a => a.Agencies) - .ThenInclude(a => a.Agency) - .Include(a => a.Roles) - .ThenInclude(r => r.Role) - .Include(a => a.User) - .AsNoTracking() - .FirstOrDefault(a => a.Id == accessRequest.Id) ?? throw new KeyNotFoundException(); - Context.AccessRequests.Remove(entity); - Context.CommitTransaction(); - - return accessRequest; - } - - /// - /// Add a new access request for the current user. - /// - /// - /// - public AccessRequest AddAccessRequest(AccessRequest request) - { - if (request == null || request.Agencies == null || request.Roles == null) throw new ArgumentNullException(nameof(request)); - var username = this.User.GetUsername(); - var position = request.User.Position; - request.User = this.GetUserForUsername(username) ?? throw new KeyNotFoundException("Your account has not been activated."); - request.UserId = request.User.Id; - request.User.Position = position; - this.Context.Entry(request.User).State = EntityState.Modified; - - request.Agencies.ForEach((accessRequestAgency) => - { - accessRequestAgency.Agency = this.Context.Agencies.Find(accessRequestAgency.AgencyId); - }); - request.Roles.ForEach((accessRequestRole) => - { - accessRequestRole.Role = this.Context.Roles.Find(accessRequestRole.RoleId); - }); - this.Context.AccessRequests.Add(request); - this.Context.CommitTransaction(); - return request; - } - - /// - /// Update the access request for the current user. - /// - /// - /// - public AccessRequest UpdateAccessRequest(AccessRequest request) - { - if (request == null || request.Agencies == null || request.Roles == null) throw new ArgumentNullException(nameof(request)); - var username = this.User.GetUsername(); - var position = request.User.Position; - request.User = this.GetUserForUsername(username) ?? throw new KeyNotFoundException("Your account has not been activated."); - - if (request.UserId != request.User.Id) throw new NotAuthorizedException(); // Not allowed to update someone elses request. - - // fetch the existing request from the datasource. - var entity = this.Context.AccessRequests - .Include(a => a.Agencies) - .ThenInclude(a => a.Agency) - .Include(a => a.Roles) - .ThenInclude(r => r.Role) - .Include(a => a.User) - .FirstOrDefault(a => a.Id == request.Id) ?? throw new KeyNotFoundException(); - - if (entity.User.Position != position) - { - entity.User.Position = position; - this.Context.Entry(entity.User).State = EntityState.Modified; - } - - // Remove agencies and roles if required. - var removeAgencies = entity.Agencies.Except(request.Agencies, new AccessRequestAgencyAgencyIdComparer()); - if (removeAgencies.Any()) entity.Agencies.RemoveAll(a => removeAgencies.Any(r => r.AgencyId == a.AgencyId)); - - var removeRoles = entity.Roles.Except(request.Roles, new AccessRequestRoleRoleIdComparer()); - if (removeRoles.Any()) entity.Roles.RemoveAll(a => removeRoles.Any(r => r.RoleId == a.RoleId)); - - // Add agencies and roles if required. - var addAgencies = request.Agencies.Except(entity.Agencies, new AccessRequestAgencyAgencyIdComparer()); - addAgencies.ForEach(a => entity.Agencies.Add(a)); - - var addRoles = request.Roles.Except(entity.Roles, new AccessRequestRoleRoleIdComparer()); - addRoles.ForEach(r => entity.Roles.Add(r)); - - // Copy values into entity. - this.Context.Entry(entity).CurrentValues.SetValues(request); - this.Context.SetOriginalRowVersion(entity); - - this.Context.AccessRequests.Update(entity); - this.Context.CommitTransaction(); - this.Context.Entry(request).CurrentValues.SetValues(entity); - return entity; - } - #endregion - - /// - /// Get an array of agency IDs for the specified 'userId'. - /// This only returns the first two layers (direct parents, their immediate children). - /// - /// - /// - public IEnumerable GetAgencies(Guid userId) - { - var user = this.Context.Users - .Include(u => u.Agencies) - .ThenInclude(a => a.Agency) - .ThenInclude(a => a.Children) - .Single(u => u.Id == userId) ?? throw new KeyNotFoundException(); - var agencies = user.Agencies.Select(a => a.AgencyId).ToList(); - agencies.AddRange(user.Agencies.SelectMany(a => a.Agency?.Children.Where(ac => !ac.IsDisabled)).Select(a => a.Id)); - - return agencies.ToArray(); - } - - /// - /// Get an array of agency IDs for the specified 'userId'. - /// This only returns the first two layers (direct parents, their immediate children). - /// - /// - /// - public IEnumerable GetAgencies(string username) - { - var user = this.Context.Users - .Include(u => u.Agencies) - .ThenInclude(a => a.Agency) - .ThenInclude(a => a.Children) - .SingleOrDefault(u => u.Username == username) ?? throw new KeyNotFoundException(); - var agencies = user.Agencies.Select(a => a.AgencyId).ToList(); - agencies.AddRange(user.Agencies.SelectMany(a => a.Agency?.Children.Where(ac => !ac.IsDisabled)).Select(a => a.Id)); - - return agencies.ToArray(); - } - - /// - /// Get the all of the agency ids that a user belongs to, given the Guid. - /// - /// - /// - public IEnumerable GetUsersAgencies(Guid id) - { - if (id != this.User.GetGuid()) - { - throw new UnauthorizedAccessException(); - } - User user = this.Context.Users - .Include(u => u.Agencies) - .ThenInclude(a => a.Agency) - .ThenInclude(a => a.Children) - .SingleOrDefault(u => u.Id == id); - - if (user == null) - { - return new int[0]; - } - - List agencies = user.Agencies.Select(a => a.AgencyId).ToList(); - agencies.AddRange(user.Agencies.SelectMany(a => a.Agency?.Children.Where(ac => !ac.IsDisabled)).Select(a => a.Id)); - - return agencies.ToArray(); - } - - /// - /// Get all the system administrators, and agency administrators for the specified 'agencyId'. - /// - /// - /// - public IEnumerable GetAdmininstrators(params int[] agencies) - { - if (agencies == null) throw new ArgumentNullException(nameof(agencies)); - - return this.Context.Users - .AsNoTracking() - .Where(u => u.Roles.Any(r => r.Role.Claims.Any(c => c.Claim.Name == Permissions.SystemAdmin.GetName())) - || (u.Agencies.Any(a => agencies.Contains(a.AgencyId)) && u.Roles.Any(r => r.Role.Claims.Any(c => c.Claim.Name == Permissions.AgencyAdmin.GetName()))) - ); - } - #endregion - } -} diff --git a/backend/dal/Services/Concrete/WorkflowService.cs b/backend/dal/Services/Concrete/WorkflowService.cs deleted file mode 100644 index 3f4e1145d9..0000000000 --- a/backend/dal/Services/Concrete/WorkflowService.cs +++ /dev/null @@ -1,92 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Pims.Dal.Entities; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Dal.Services -{ - /// - /// WorkflowService class, provides a service layer to interact with workflows within the datasource. - /// - public class WorkflowService : BaseService, IWorkflowService - { - #region Constructors - /// - /// Creates a new instance of a WorkflowService, and initializes it with the specified arguments. - /// - /// - /// - /// - /// - public WorkflowService(PimsContext dbContext, ClaimsPrincipal user, IPimsService service, ILogger logger) : base(dbContext, user, service, logger) - { - } - #endregion - - #region Methods - /// - /// Get an array of workflows for the specified type. - /// - /// - /// - public IEnumerable Get() - { - this.User.ThrowIfNotAuthorized(Permissions.ProjectView); - var workflows = this.Context.Workflows - .AsNoTracking() - .OrderBy(t => t.SortOrder) - .ThenBy(t => t.Name); - - return workflows.ToArray(); - } - - /// - /// Get the workflow for the specified 'id'. - /// - /// - /// The workflow for the specified 'id' does not exist. - /// - public Workflow Get(int id) - { - this.User.ThrowIfNotAuthorized(Permissions.ProjectView); - var workflow = this.Context.Workflows - .AsNoTracking() - .Include(w => w.Status) - .ThenInclude(s => s.Status) - .FirstOrDefault(w => w.Id == id) ?? throw new KeyNotFoundException(); - - return workflow; - } - - /// - /// Get the workflow for the specified 'code'. - /// - /// - /// The workflow for the specified 'code' does not exist. - /// - public Workflow Get(string code) - { - this.User.ThrowIfNotAuthorized(Permissions.ProjectView); - var workflow = this.Context.Workflows - .AsNoTracking() - .Include(w => w.Status) - .ThenInclude(s => s.Status) - .Include(w => w.Status) - .ThenInclude(s => s.ToStatus) - .ThenInclude(t => t.ToWorkflowStatus) - .ThenInclude(s => s.Status) - .Include(w => w.Status) - .ThenInclude(s => s.ToStatus) - .ThenInclude(t => t.ToWorkflowStatus) - .ThenInclude(s => s.Workflow) - .FirstOrDefault(w => w.Code == code) ?? throw new KeyNotFoundException(); - - return workflow; - } - #endregion - } -} diff --git a/backend/dal/Services/IBuildingService.cs b/backend/dal/Services/IBuildingService.cs deleted file mode 100644 index 6849a30000..0000000000 --- a/backend/dal/Services/IBuildingService.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using System.Collections.Generic; - -namespace Pims.Dal.Services -{ - /// - /// IBuildingService interface, provides functions to interact with buildings within the datasource. - /// - public interface IBuildingService : IService - { - IEnumerable Get(double neLat, double neLong, double swLat, double swLong); - IEnumerable Get(BuildingFilter filter); - Paged GetPage(BuildingFilter filter); - Building Get(int id); - Building Add(Building parcel); - Building Update(Building parcel); - Building UpdateFinancials(Building parcel); - void Remove(Building parcel); - } -} diff --git a/backend/dal/Services/ILookupService.cs b/backend/dal/Services/ILookupService.cs deleted file mode 100644 index 579f179c98..0000000000 --- a/backend/dal/Services/ILookupService.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Pims.Dal.Entities; -using System.Collections.Generic; - -namespace Pims.Dal.Services -{ - /// - /// ILookupService interface, provides a way to fetch lookup lists from the datasource. - /// - public interface ILookupService : IService - { - IEnumerable GetAgencies(); - IEnumerable GetAdministrativeAreas(); - IEnumerable GetProvinces(); - IEnumerable GetPropertyClassifications(); - IEnumerable GetPropertyTypes(); - IEnumerable GetBuildingConstructionTypes(); - IEnumerable GetBuildingPredominateUses(); - IEnumerable GetBuildingOccupantTypes(); - IEnumerable GetRoles(); - IEnumerable GetTierLevels(); - IEnumerable GetProjectRisks(); - } -} diff --git a/backend/dal/Services/INotificationQueueService.cs b/backend/dal/Services/INotificationQueueService.cs deleted file mode 100644 index d3a0cf7421..0000000000 --- a/backend/dal/Services/INotificationQueueService.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using System; -using System.Collections.Generic; - -namespace Pims.Dal.Services -{ - /// - /// INotificationQueueService interface, provides functions to interact with the notification queue within the datasource. - /// - public interface INotificationQueueService : IService - { - Paged GetPage(NotificationQueueFilter filter); - NotificationQueue Get(int id); - void Add(IEnumerable notifications); - void Add(NotificationQueue notification); - void Update(NotificationQueue notification); - void Update(IEnumerable notifications); - System.Threading.Tasks.Task CancelNotificationAsync(int id); - NotificationQueue GenerateNotification(Project project, string templateName); - NotificationQueue GenerateNotification(Project project, NotificationTemplate template); - IEnumerable GenerateNotifications(Project project, int? fromStatusId, int? toStatusId, bool includeOnlyTo = true); - IEnumerable GenerateNotifications(Project project, int projectStatusNotificationId); - IEnumerable GenerateNotifications(Project project, ProjectStatusNotification options, DateTime? sendOn = null); - NotificationQueue GenerateNotification(Project project, ProjectStatusNotification options, Agency agency, DateTime? sendOn = null); - NotificationQueue GenerateNotification(string to, string cc, NotificationTemplate template, T model, DateTime? sendOn = null); - NotificationQueue GenerateNotification(NotificationTemplate template, T model, DateTime? sendOn = null); - System.Threading.Tasks.Task SendNotificationsAsync(IEnumerable notifications, bool saveChanges = true); - } -} diff --git a/backend/dal/Services/INotificationService.cs b/backend/dal/Services/INotificationService.cs deleted file mode 100644 index 44f3e981ec..0000000000 --- a/backend/dal/Services/INotificationService.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Pims.Dal.Entities; -using System.Collections.Generic; - -namespace Pims.Dal.Services -{ - /// - /// INotificationService interface, provides functions to send notifications. - /// - public interface INotificationService - { - System.Threading.Tasks.Task SendAsync(NotificationQueue notification); - System.Threading.Tasks.Task SendAsync(IEnumerable notifications); - System.Threading.Tasks.Task CancelAsync(NotificationQueue notificat); - System.Threading.Tasks.Task CancelAsync(IEnumerable notifications); - void Generate(NotificationQueue notification, TModel model); - } -} diff --git a/backend/dal/Services/INotificationTemplateService.cs b/backend/dal/Services/INotificationTemplateService.cs deleted file mode 100644 index 50e2764df6..0000000000 --- a/backend/dal/Services/INotificationTemplateService.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Pims.Dal.Entities; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Pims.Dal.Services -{ - /// - /// INotificationTemplateService interface, provides functions to interact with notification templates within the datasource. - /// - public interface INotificationTemplateService : IService - { - IEnumerable Get(); - NotificationTemplate Get(int id); - NotificationTemplate Get(string name); - NotificationTemplate Add(NotificationTemplate template); - NotificationTemplate Update(NotificationTemplate template); - void Remove(NotificationTemplate template); - Task SendNotificationAsync(int templateId, string to); - Task SendNotificationAsync(int templateId, string to, T model) where T : class; - Task SendNotificationAsync(int templateId, string to, string cc, string bcc, T model) where T : class; - } -} diff --git a/backend/dal/Services/IParcelService.cs b/backend/dal/Services/IParcelService.cs deleted file mode 100644 index 8739353321..0000000000 --- a/backend/dal/Services/IParcelService.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using System.Collections.Generic; - -namespace Pims.Dal.Services -{ - /// - /// IParcelService interface, provides functions to interact with parcels within the datasource. - /// - public interface IParcelService : IService - { - IEnumerable Get(double neLat, double neLong, double swLat, double swLong); - IEnumerable Get(ParcelFilter filter); - Paged GetPage(ParcelFilter filter); - Parcel Get(int id); - Parcel Add(Parcel parcel); - Parcel PendingUpdate(Parcel parcel); - Parcel Update(Parcel parcel); - Parcel UpdateFinancials(Parcel parcel); - void Remove(Parcel parcel); - bool IsPidAvailable(int parcelId, int PID); - bool IsPinAvailable(int parcelId, int PIN); - } -} diff --git a/backend/dal/Services/IProjectNotificationService.cs b/backend/dal/Services/IProjectNotificationService.cs deleted file mode 100644 index 6b3540b6a8..0000000000 --- a/backend/dal/Services/IProjectNotificationService.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Pims.Dal.Entities; -using System.Collections.Generic; - -namespace Pims.Dal.Services -{ - /// - /// IProjectNotificationService interface, provides functions to interact with project notifications within the datasource. - /// - public interface IProjectNotificationService : IService - { - ProjectStatusNotification Get(int id); - IEnumerable GetFor(int? fromStatusId, int? toStatusId); - } -} diff --git a/backend/dal/Services/IProjectReportService.cs b/backend/dal/Services/IProjectReportService.cs deleted file mode 100644 index 75723e2cde..0000000000 --- a/backend/dal/Services/IProjectReportService.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Pims.Dal.Entities; -using System.Collections.Generic; - -namespace Pims.Dal.Services -{ - /// - /// IProjectReportService interface, provides functions to interact with project reports within the datasource. - /// - public interface IProjectReportService : IService - { - IEnumerable GetAll(); - ProjectReport Get(int id); - IEnumerable GetSnapshots(int reportId); - IEnumerable GetSnapshots(ProjectReport report); - ProjectReport Add(ProjectReport report); - ProjectReport Add(ProjectReport report, IEnumerable snapshots); - ProjectReport Update(ProjectReport report); - IEnumerable Refresh(int id); - void Remove(ProjectReport report); - } -} diff --git a/backend/dal/Services/IProjectService.cs b/backend/dal/Services/IProjectService.cs deleted file mode 100644 index 20cf7c0b70..0000000000 --- a/backend/dal/Services/IProjectService.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using System.Collections.Generic; - -namespace Pims.Dal.Services -{ - /// - /// IProjectService interface, provides functions to interact with projects within the datasource. - /// - public interface IProjectService : IService - { - int Count(); - Paged GetPage(ProjectFilter filter); - Paged GetExcelPage(ProjectFilter filter); - Project Get(int id); - Project Get(string projectNumber); - Paged GetNotificationsInQueue(ProjectNotificationFilter filter); - System.Threading.Tasks.Task AddAsync(Project project); - System.Threading.Tasks.Task UpdateAsync(Project project); - System.Threading.Tasks.Task RemoveAsync(Project project); - System.Threading.Tasks.Task SetStatusAsync(Project project, Workflow workflow, bool sendNotifications = true); - System.Threading.Tasks.Task SetStatusAsync(Project project, string workflowCode); - System.Threading.Tasks.Task> CancelNotificationsAsync(int projectId, int? agencyId = null); - } -} diff --git a/backend/dal/Services/IProjectStatusService.cs b/backend/dal/Services/IProjectStatusService.cs deleted file mode 100644 index 4516e1152b..0000000000 --- a/backend/dal/Services/IProjectStatusService.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Pims.Dal.Entities; -using System.Collections.Generic; - -namespace Pims.Dal.Services -{ - /// - /// IProjectStatusService interface, provides functions to interact with project status within the datasource. - /// - public interface IProjectStatusService : IService - { - IEnumerable Get(); - ProjectStatus Get(int id); - } -} diff --git a/backend/dal/Services/IPropertyService.cs b/backend/dal/Services/IPropertyService.cs deleted file mode 100644 index 65bb7c4ffa..0000000000 --- a/backend/dal/Services/IPropertyService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Pims.Dal.Entities.Models; -using Pims.Dal.Entities.Views; -using System.Collections.Generic; - -namespace Pims.Dal.Services -{ - /// - /// IPropertyService interface, provides functions to interact with properties within the datasource. - /// - public interface IPropertyService : IService - { - int Count(); - IEnumerable Get(AllPropertyFilter filter); - IEnumerable GetNames(AllPropertyFilter filter); - IEnumerable Search(AllPropertyFilter filter); - Paged GetPage(AllPropertyFilter filter); - } -} diff --git a/backend/dal/Services/ITaskService.cs b/backend/dal/Services/ITaskService.cs deleted file mode 100644 index 07651e8ac0..0000000000 --- a/backend/dal/Services/ITaskService.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Pims.Dal.Entities; -using System.Collections.Generic; - -namespace Pims.Dal.Services -{ - /// - /// ITaskService interface, provides functions to interact with tasks within the datasource. - /// - public interface ITaskService : IService - { - IEnumerable GetForStatus(int statusId); - IEnumerable GetForStatus(string statusCode); - IEnumerable GetForWorkflow(string workflowCode); - } -} diff --git a/backend/dal/Services/IUserService.cs b/backend/dal/Services/IUserService.cs deleted file mode 100644 index b1c4c46aa2..0000000000 --- a/backend/dal/Services/IUserService.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Pims.Dal.Entities; -using System; -using System.Collections.Generic; - -namespace Pims.Dal.Services -{ - /// - /// IUserService interface, provides functions to interact with users within the datasource. - /// - public interface IUserService : IService - { - bool UserExists(Guid KeycloakUserId); - bool UserExists(string username); - User GetUserForUsername(string username); - User GetUserForKeycloakId(Guid keycloakUserId); - User Activate(); - IEnumerable GetAgencies(Guid userId); - IEnumerable GetAgencies(string username); - IEnumerable GetUsersAgencies(Guid id); - AccessRequest GetAccessRequest(); - AccessRequest GetAccessRequest(int id); - AccessRequest DeleteAccessRequest(AccessRequest accessRequest); - AccessRequest AddAccessRequest(AccessRequest request); - AccessRequest UpdateAccessRequest(AccessRequest request); - IEnumerable GetAdmininstrators(params int[] agencyId); - } -} diff --git a/backend/dal/Services/IWorkflowService.cs b/backend/dal/Services/IWorkflowService.cs deleted file mode 100644 index 46fdcd3f50..0000000000 --- a/backend/dal/Services/IWorkflowService.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Pims.Dal.Entities; -using System.Collections.Generic; - -namespace Pims.Dal.Services -{ - /// - /// IWorkflowService interface, provides functions to interact with workflows within the datasource. - /// - public interface IWorkflowService : IService - { - #region Methods - IEnumerable Get(); - Workflow Get(int id); - Workflow Get(string code); - #endregion - } -} diff --git a/backend/entities/AccessRequest.cs b/backend/entities/AccessRequest.cs deleted file mode 100644 index 64d967aa2b..0000000000 --- a/backend/entities/AccessRequest.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Dal.Entities -{ - /// - /// AccessRequest class, provides an entity for the datamodel to manage submitted access request forms for unauthorized users. - /// - public class AccessRequest : BaseEntity - { - #region Properties - /// - /// get/set - The primary key IDENTITY. - /// - /// - public int Id { get; set; } - - /// - /// get/set - Foreign key to User - /// - /// - public Guid UserId { get; set; } // TODO: This shouldn't be nullable. - - /// - /// get/set - the user originating this request - /// - /// - /// - public User User { get; set; } - - /// - /// get/set - A note related to the access request. - /// - /// - public string Note { get; set; } - - /// - /// get - the list of agencies that the user is requesting to be added to. - /// - /// - public ICollection Agencies { get; private set; } = new List(); - - /// - /// get - the list of roles this user is requesting. - /// - /// - /// - public ICollection Roles { get; private set; } = new List(); - - /// - /// get - whether the request is approved, on hold or declined - /// - public AccessRequestStatus Status { get; set; } = AccessRequestStatus.OnHold; - #endregion - - #region Constructors - /// - /// Create a new instance of a User class. - /// - public AccessRequest() { } - - /// - /// Create a new instance of a User class. - /// - /// - public AccessRequest(User requestUser) - { - this.User = requestUser; - } - #endregion - } -} diff --git a/backend/entities/AccessRequestAgency.cs b/backend/entities/AccessRequestAgency.cs deleted file mode 100644 index f7d94c0f34..0000000000 --- a/backend/entities/AccessRequestAgency.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// AccessRequestAgency class, provides an entity for the datamodel to manage access request agencies. - /// - public class AccessRequestAgency : BaseEntity - { - #region Properties - /// - /// get/set - The foreign key to the AccessRequest - PRIMARY KEY. - /// - /// - public int AccessRequestId { get; set; } - - /// - /// get/set - The access request that belongs to an Agency. - /// - /// - public AccessRequest AccessRequest { get; set; } - - /// - /// get/set - The foreign key to the role the Agency belongs to - PRIMARY KEY. - /// - /// - public int AgencyId { get; set; } - - /// - /// get/set - The Agency the AccessRequest belongs to. - /// - /// - public Agency Agency { get; set; } - #endregion - - #region Constructors - /// - /// Create a new instance of a AccessRequestAgency class. - /// - public AccessRequestAgency() { } - - /// - /// Create a new instance of a AccessRequestAgency class. - /// - /// - /// - public AccessRequestAgency(int accessRequestId, int agencyId) - { - this.AccessRequestId = accessRequestId; - this.AgencyId = agencyId; - } - - /// - /// Create a new instance of a AccessRequestAgency class. - /// - /// - /// - public AccessRequestAgency(AccessRequest accessRequest, Agency agency) - { - this.AccessRequest = accessRequest; - this.AccessRequestId = accessRequest?.Id ?? - throw new ArgumentNullException(nameof(accessRequest)); - this.Agency = agency; - this.AgencyId = agency?.Id ?? - throw new ArgumentNullException(nameof(agency)); - } - #endregion - } -} diff --git a/backend/entities/AccessRequestRole.cs b/backend/entities/AccessRequestRole.cs deleted file mode 100644 index c4fba7e70d..0000000000 --- a/backend/entities/AccessRequestRole.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// AccessRequestRole class, provides an entity for the datamodel to manage AccessRequest Roles. - /// - public class AccessRequestRole : BaseEntity - { - #region Properties - /// - /// get/set - The foreign key to the AccessRequest - PRIMARY KEY. - /// - /// - public int AccessRequestId { get; set; } - - /// - /// get/set - The access request that belongs to an Role. - /// - /// - public AccessRequest AccessRequest { get; set; } - - /// - /// get/set - The foreign key to the role the Role belongs to - PRIMARY KEY. - /// - /// - public Guid RoleId { get; set; } - - /// - /// get/set - The Role the AccessRequest belongs to. - /// - /// - public Role Role { get; set; } - #endregion - - #region Constructors - /// - /// Create a new instance of a AccessRequestRole class. - /// - public AccessRequestRole() { } - - /// - /// Create a new instance of a AccessRequestRole class. - /// - /// - /// - public AccessRequestRole(int accessRequestId, Guid roleId) - { - this.AccessRequestId = accessRequestId; - this.RoleId = roleId; - } - - /// - /// Create a new instance of a AccessRequestRole class. - /// - /// - /// - public AccessRequestRole(AccessRequest accessRequest, Role role) - { - this.AccessRequest = accessRequest; - this.AccessRequestId = accessRequest?.Id ?? - throw new ArgumentNullException(nameof(accessRequest)); - this.Role = role; - this.RoleId = role?.Id ?? - throw new ArgumentNullException(nameof(role)); - } - #endregion - } -} diff --git a/backend/entities/AccessRequestStatus.cs b/backend/entities/AccessRequestStatus.cs deleted file mode 100644 index a1e20713ef..0000000000 --- a/backend/entities/AccessRequestStatus.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Pims.Dal.Entities -{ - public enum AccessRequestStatus - { - Approved, - OnHold, - Declined - } -} diff --git a/backend/entities/Address.cs b/backend/entities/Address.cs deleted file mode 100644 index e3787d4112..0000000000 --- a/backend/entities/Address.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// Address class, provides an entity for the datamodel to manage property addresses. - /// - public class Address : BaseEntity - { - #region Properties - /// - /// get/set - The primary key IDENTITY SEED. - /// - /// - public int Id { get; set; } - - /// - /// get/set - The first address line. - /// - /// - public string Address1 { get; set; } - - /// - /// get/set - The second address line. - /// - /// - public string Address2 { get; set; } - - /// - /// get/set - The name of the location (city, municipality, area, etc.) - /// - /// - public string AdministrativeArea { get; set; } - - /// - /// get/set - The foreign key to the province. - /// - /// - public string ProvinceId { get; set; } - - /// - /// get/set - The province of the address. - /// - /// - public Province Province { get; set; } - - /// - /// get/set - The postal code. - /// - /// - public string Postal { get; set; } - #endregion - - #region Constructors - /// - /// Create a new instance of a Address class. - /// - public Address() { } - - /// - /// Create a new instance of a Address class. - /// - /// - /// - /// - /// - /// - public Address(string address1, string address2, string administrativeArea, string provinceId, string postal) - { - this.Address1 = address1; - this.Address2 = address2; - this.AdministrativeArea = administrativeArea ?? throw new ArgumentNullException(nameof(administrativeArea)); - this.ProvinceId = provinceId; - this.Postal = postal; - this.CreatedOn = DateTime.UtcNow; - } - - /// - /// Create a new instance of a Address class. - /// - /// - /// - /// - /// - /// - public Address(string address1, string address2, string administrativeArea, Province province, string postal) - { - this.Address1 = address1; - this.Address2 = address2; - this.AdministrativeArea = administrativeArea ?? throw new ArgumentNullException(nameof(administrativeArea)); - this.Province = province; - this.ProvinceId = province?.Id ?? - throw new ArgumentNullException(nameof(province)); - this.Postal = postal; - } - #endregion - - #region Methods - /// - /// Return the address as a string. - /// - /// - public override string ToString() - { - return this.Address1 + ", " + this.AdministrativeArea + ", " + this.ProvinceId; - } - #endregion - } -} diff --git a/backend/entities/AdministrativeArea.cs b/backend/entities/AdministrativeArea.cs deleted file mode 100644 index 828396c0ed..0000000000 --- a/backend/entities/AdministrativeArea.cs +++ /dev/null @@ -1,41 +0,0 @@ -namespace Pims.Dal.Entities -{ - /// - /// AdministrativeArea class, provides an entity for the datamodel to manage a list of administrative areas (city, municipality, district, etc.). - /// - public class AdministrativeArea : LookupEntity - { - #region Properties - /// - /// get/set - An appreviated name. - /// - public string Abbreviation { get; set; } - - /// - /// get/set - A description of the boundary type for this area (o.e. Legal). - /// - public string BoundaryType { get; set; } - - /// - /// get/set - The parent group name for this area. - /// - public string GroupName { get; set; } - #endregion - - #region Constructors - /// - /// Create a new instance of a AdministrativeArea class. - /// - public AdministrativeArea() { } - - /// - /// Create a new instance of a AdministrativeArea class. - /// - /// - public AdministrativeArea(string name) - { - this.Name = name; - } - #endregion - } -} diff --git a/backend/entities/Agency.cs b/backend/entities/Agency.cs deleted file mode 100644 index 02f618a062..0000000000 --- a/backend/entities/Agency.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System.Collections.Generic; - -namespace Pims.Dal.Entities -{ - /// - /// Agency class, provides an entity for the datamodel to manage property agencies. - /// - public class Agency : CodeEntity - { - #region Properties - /// - /// get/set - A description of the code. - /// - /// - public string Description { get; set; } - - /// - /// get/set - The foreign key to the parent agency. - /// - /// - public int? ParentId { get; set; } - - /// - /// get/set - The parent agency this agency belongs to. - /// - /// - public Agency Parent { get; set; } - - /// - /// get/set - An email address for the agency. - /// - public string Email { get; set; } - - /// - /// get/set - A CC email address for the agency. - /// - public string CCEmail { get; set; } - - /// - /// get/set - Whether notifications should be sent to this agency. - /// - public bool SendEmail { get; set; } = true; - - /// - /// get/set - The name or title of whom the notification should be addressed to. - /// - public string AddressTo { get; set; } - - /// - /// get - A collection of child agencies. - /// - /// - /// - public ICollection Children { get; } = new List(); - - /// - /// get - A collection of parcels this agency owns. - /// - /// - /// - public ICollection Parcels { get; } = new List(); - - /// - /// get - A collection of buildings this agency owns. - /// - /// - /// - public ICollection Buildings { get; } = new List(); - - /// - /// get - A collection of users that belong to this agency. - /// - /// - /// - public ICollection Users { get; } = new List(); - - /// - /// get - A collection of projects that belong to this agency. - /// - public ICollection Projects { get; } = new List(); - - /// - /// get - A collection of responses to project notifications. - /// - public ICollection ProjectResponses { get; } = new List(); - - /// - /// get/set - A collection of notifications sent to this agency. - /// - public ICollection Notifications { get; } = new List(); - #endregion - - #region Constructors - /// - /// Create a new instance of a Agency class. - /// - public Agency() { } - - /// - /// Create a new instance of a Agency class. - /// - /// - /// - public Agency(string code, string name) - { - this.Code = code; - this.Name = name; - } - #endregion - } -} diff --git a/backend/entities/BaseEntity.cs b/backend/entities/BaseEntity.cs deleted file mode 100644 index 47d252dd75..0000000000 --- a/backend/entities/BaseEntity.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// BaseEntity class, provides a way to inherit shared properties on all entities. - /// - public abstract class BaseEntity - { - #region Properties - - /// - /// get/set - The foreign key to the user who created this entity. - /// - /// - public Guid? CreatedById { get; set; } - - /// - /// get/set - The user who created this entity. - /// - /// - public User CreatedBy { get; set; } - - /// - /// get/set - When this entity was created. - /// - /// - public DateTime CreatedOn { get; set; } - - /// - /// get/set - Who updated this entity last. - /// - /// - public Guid? UpdatedById { get; set; } - - /// - /// get/set - The user updated this entity last. - /// - /// - public User UpdatedBy { get; set; } - - /// - /// get/set - When this entity was updated. - /// - /// - public DateTime? UpdatedOn { get; set; } - - /// - /// get/set - The concurrency row version. - /// - /// - public byte[] RowVersion { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a BaseEntity class. - /// Initializes the default values. - /// - public BaseEntity() - { - this.CreatedOn = DateTime.UtcNow; - } - #endregion - } -} diff --git a/backend/entities/Building.cs b/backend/entities/Building.cs deleted file mode 100644 index 2fd6b44fcf..0000000000 --- a/backend/entities/Building.cs +++ /dev/null @@ -1,131 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Dal.Entities -{ - /// - /// Building class, provides an entity for the datamodel to manage buildings. - /// - public class Building : Property - { - #region Properties - /// - /// get/set - The foreign key to the property building construction type. - /// - public int BuildingConstructionTypeId { get; set; } - - /// - /// get/set - The building construction type for this property. - /// - public BuildingConstructionType BuildingConstructionType { get; set; } - - /// - /// get/set - The number of floors in the building. - /// - public int BuildingFloorCount { get; set; } - - /// - /// get/set - The foreign key to the building predominant use. - /// - public int BuildingPredominateUseId { get; set; } - - /// - /// get/set - The building predominant use for this building. - /// - public BuildingPredominateUse BuildingPredominateUse { get; set; } - - /// - /// get/set - The type of tenancy for this building. - /// - public string BuildingTenancy { get; set; } - - /// - /// get/set - The date the building tenancy was last updated. - /// - public DateTime? BuildingTenancyUpdatedOn { get; set; } - - /// - /// get/set - The building rentable area. - /// - public float RentableArea { get; set; } - - /// - /// get/set - The building total area. - /// - public float TotalArea { get; set; } - - /// - /// get/set - The foreign key to the building occupant type. - /// - public int BuildingOccupantTypeId { get; set; } - - /// - /// get/set - The type of occupant for this building. - /// - public BuildingOccupantType BuildingOccupantType { get; set; } - - /// - /// get/set - The expiry date of the currently active lease - /// - public DateTime? LeaseExpiry { get; set; } - - /// - /// get/set - The name of the occupant/organization - /// - public string OccupantName { get; set; } - - /// - /// get/set - Whether the lease on this building would be transferred if the building is sold. - /// - public bool TransferLeaseOnSale { get; set; } = false; - - /// - /// get/set - Metadata related to the buildings leased status. - /// - public string LeasedLandMetadata { get; set; } - - /// - /// get - A collection of parcels this building is located on. - /// - public ICollection Parcels { get; } = new List(); - - /// - /// get - A collection of evaluations for this building. - /// - /// - public ICollection Evaluations { get; } = new List(); - - /// - /// get - A collection of fiscal values for this building. - /// - /// - public ICollection Fiscals { get; } = new List(); - - /// - /// get - A collection of projects this building is assocated to. - /// - public ICollection Projects { get; } = new List(); - #endregion - - #region Constructors - /// - /// Create a new instance of a Building class. - /// - public Building() { } - - /// - /// Create a new instance of a Building class. - /// - /// - /// - /// - public Building(Parcel parcel, double latitude, double longitude) : base(latitude, longitude) - { - if (parcel != null) { - var pb = new ParcelBuilding(parcel, this); - this.Parcels.Add(pb); - } - } - #endregion - } -} diff --git a/backend/entities/BuildingConstructionType.cs b/backend/entities/BuildingConstructionType.cs deleted file mode 100644 index 550b83b586..0000000000 --- a/backend/entities/BuildingConstructionType.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace Pims.Dal.Entities -{ - /// - /// BuildingConstructionType class, provides an entity for the datamodel to manage a list of building contruction types. - /// - public class BuildingConstructionType : LookupEntity - { - #region Properties - #endregion - - #region Constructors - /// - /// Create a new instance of a BuildingConstructionType class. - /// - public BuildingConstructionType() { } - - /// - /// Create a new instance of a BuildingConstructionType class. - /// - /// - /// - public BuildingConstructionType(int id, string name) : base(id, name) - { - } - #endregion - } -} diff --git a/backend/entities/BuildingEvaluation.cs b/backend/entities/BuildingEvaluation.cs deleted file mode 100644 index 649d2e23cb..0000000000 --- a/backend/entities/BuildingEvaluation.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// BuildingEvaluation class, provides an entity to map building evaluation values to a date. - /// - public class BuildingEvaluation : BaseEntity - { - #region Properties - - /// - /// get/set - The primary key and the foreign key to the building. - /// - /// - public int BuildingId { get; set; } - - /// - /// get/set - The building. - /// - /// - public Building Building { get; set; } - - /// - /// get/set - The primary key and the date the evaluation is for. - /// - /// - public DateTime Date { get; set; } - - /// - /// get/set - The key for this fiscal value. - /// - /// - public EvaluationKeys Key { get; set; } - - /// - /// get/set - The value of the fiscal key for this building. - /// - /// - public decimal Value { get; set; } - - /// - /// get/set - A note related to this fiscal value. - /// - /// - public string Note { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a BuildingEvaluation class. - /// - public BuildingEvaluation() { } - - /// - /// Creates a new instance of a BuildingEvaluation class, initializes it with the specified arguments. - /// - /// - /// - /// - /// - public BuildingEvaluation(Building building, DateTime date, EvaluationKeys key, decimal value) - { - this.BuildingId = building?.Id ?? - throw new ArgumentNullException(nameof(building)); - this.Building = building; - this.Date = date; - this.Key = key; - this.Value = value; - } - #endregion - } -} diff --git a/backend/entities/BuildingFiscal.cs b/backend/entities/BuildingFiscal.cs deleted file mode 100644 index 3917928f75..0000000000 --- a/backend/entities/BuildingFiscal.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// BuildingFiscal class, provides an entity to map values to a fiscal year. - /// - public class BuildingFiscal : BaseEntity - { - #region Properties - /// - /// get/set - The primary key and the foreign key to the building. - /// - /// - public int BuildingId { get; set; } - - /// - /// get/set - The building. - /// - /// - public Building Building { get; set; } - - /// - /// get/set - The primary key and the fiscal year the evaluation is for. - /// - /// - public int FiscalYear { get; set; } - - /// - /// get/set - The effective date of this fiscal value - /// - /// - public DateTime? EffectiveDate { get; set; } - - /// - /// get/set - The key for this fiscal value. - /// - /// - public FiscalKeys Key { get; set; } - - /// - /// get/set - The value of the fiscal key for this building. - /// - /// - public decimal Value { get; set; } - - /// - /// get/set - A note related to this fiscal value. - /// - /// - public string Note { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a BuildingFiscal class. - /// - public BuildingFiscal() { } - - /// - /// Creates a new instance of a BuildingFiscal class, initializes it with the specified arguments. - /// - /// - /// - /// - /// - public BuildingFiscal(Building building, int fiscalYear, FiscalKeys key, decimal value) - { - this.BuildingId = building?.Id ?? - throw new ArgumentNullException(nameof(building)); - this.Building = building; - this.FiscalYear = fiscalYear; - this.Key = key; - this.Value = value; - } - #endregion - } -} diff --git a/backend/entities/BuildingOccupantType.cs b/backend/entities/BuildingOccupantType.cs deleted file mode 100644 index bd4ffb6f7c..0000000000 --- a/backend/entities/BuildingOccupantType.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace Pims.Dal.Entities -{ - /// - /// BuildingOccupantType class, provides an entity for the datamodel to manage a list of building occupant types. - /// - public class BuildingOccupantType : LookupEntity - { - #region Properties - #endregion - - #region Constructors - /// - /// Create a new instance of a BuildingOccupantType class. - /// - public BuildingOccupantType() { } - - /// - /// Create a new instance of a BuildingOccupantType class. - /// - /// - /// - public BuildingOccupantType(int id, string name) : base(id, name) - { - } - #endregion - } -} diff --git a/backend/entities/BuildingPredominateUse.cs b/backend/entities/BuildingPredominateUse.cs deleted file mode 100644 index d896568bf0..0000000000 --- a/backend/entities/BuildingPredominateUse.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace Pims.Dal.Entities -{ - /// - /// BuildingPredominateUse class, provides an entity for the datamodel to manage a list of building predominate uses. - /// - public class BuildingPredominateUse : LookupEntity - { - #region Properties - #endregion - - #region Constructors - /// - /// Create a new instance of a BuildingPredominateUse class. - /// - public BuildingPredominateUse() { } - - /// - /// Create a new instance of a BuildingPredominateUse class. - /// - /// - /// - public BuildingPredominateUse(int id, string name) : base(id, name) - { - } - #endregion - } -} diff --git a/backend/entities/Claim.cs b/backend/entities/Claim.cs deleted file mode 100644 index 104cbccece..0000000000 --- a/backend/entities/Claim.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Dal.Entities -{ - /// - /// Claim class, provides an entity for the datamodel to manage claims. - /// - public class Claim : BaseEntity - { - #region Properties - /// - /// get/set - The primary key IDENTITY. - /// - /// - public Guid Id { get; set; } - - /// - /// get/set - The claims display name. - /// - /// - public string Name { get; set; } - - /// - /// get/set - The GUID that identifies this Role in Keycloak. - /// - public Guid? KeycloakRoleId { get; set; } - - /// - /// get/set - The claims first name. - /// - /// - public string Description { get; set; } - - /// - /// get/set - Whether the user is disabled. - /// - /// - public bool IsDisabled { get; set; } - - /// - /// get - A collection of roles that have this claim. - /// - /// - /// - public ICollection Roles { get; } = new List(); - #endregion - - #region Constructors - /// - /// Create a new instance of a Claim class. - /// - public Claim() { } - - /// - /// Create a new instance of a Claim class. - /// - /// - /// - public Claim(Guid id, string name) - { - this.Id = id; - this.Name = name; - } - #endregion - } -} diff --git a/backend/entities/ClassificationTypes.cs b/backend/entities/ClassificationTypes.cs deleted file mode 100644 index c580382d20..0000000000 --- a/backend/entities/ClassificationTypes.cs +++ /dev/null @@ -1,38 +0,0 @@ -namespace Pims.Dal.Entities -{ - /// - /// ClassificationTypes enum, provides compile-time values for classifications. - /// TODO: Property classifications are database driven, this enum hardcodes these values and isn't ideal. - /// - public enum ClassificationTypes - { - /// - /// The property is currently being used. - /// - CoreOperational = 0, - /// - /// The property is not currently being used but has a strategic purpose. - /// - CoreStrategic = 1, - /// - /// The property is surplus. - /// - SurplusActive = 2, - /// - /// The property is surplus with an encumberance. - /// - SurplusEncumbered = 3, - /// - /// The property has been disposed. - /// - Disposed = 4, - /// - /// The property has been demolished - /// - Demolished = 5, - /// - /// The property has been subdivided - /// - Subdivided = 6, - } -} diff --git a/backend/entities/CodeEntity.cs b/backend/entities/CodeEntity.cs deleted file mode 100644 index 7e8b9da48e..0000000000 --- a/backend/entities/CodeEntity.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// CodeEntity class, provides an entity for the datamodel to manage entities that represent codified values. - /// - /// - public abstract class CodeEntity : LookupEntity - { - #region Properties - /// - /// get/set - A unique code for the lookup. - /// - /// - public string Code { get; set; } - #endregion - - #region Constructors - /// - /// Create a new instance of a CodeEntity class. - /// - public CodeEntity() { } - - /// - /// Create a new instance of a CodeEntity class. - /// - /// - /// - public CodeEntity(TKey id, string code, string name) : base(id, name) - { - if (String.IsNullOrWhiteSpace(code)) throw new ArgumentException($"Argument '{nameof(code)}' must have a valid value.", nameof(code)); - - this.Code = code; - } - #endregion - } -} diff --git a/backend/entities/Comparers/AccessRequestAgencyAgencyIdComparer.cs b/backend/entities/Comparers/AccessRequestAgencyAgencyIdComparer.cs deleted file mode 100644 index 89f7ca6147..0000000000 --- a/backend/entities/Comparers/AccessRequestAgencyAgencyIdComparer.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; - -namespace Pims.Dal.Entities.Comparers -{ - public class AccessRequestAgencyAgencyIdComparer : IEqualityComparer - { - public bool Equals([AllowNull] AccessRequestAgency x, [AllowNull] AccessRequestAgency y) - { - return x != null && y != null && GetHashCode(x) == GetHashCode(y); - } - - public int GetHashCode([DisallowNull] AccessRequestAgency obj) - { - var hash = new HashCode(); - hash.Add(obj.AgencyId); - return hash.ToHashCode(); - } - } -} diff --git a/backend/entities/Comparers/AccessRequestRoleRoleIdComparer.cs b/backend/entities/Comparers/AccessRequestRoleRoleIdComparer.cs deleted file mode 100644 index 6acbe72589..0000000000 --- a/backend/entities/Comparers/AccessRequestRoleRoleIdComparer.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; - -namespace Pims.Dal.Entities.Comparers -{ - public class AccessRequestRoleRoleIdComparer : IEqualityComparer - { - public bool Equals([AllowNull] AccessRequestRole x, [AllowNull] AccessRequestRole y) - { - return x != null && y != null && GetHashCode(x) == GetHashCode(y); - } - - public int GetHashCode([DisallowNull] AccessRequestRole obj) - { - var hash = new HashCode(); - hash.Add(obj.RoleId); - return hash.ToHashCode(); - } - } -} diff --git a/backend/entities/Comparers/AgencyIdComparer.cs b/backend/entities/Comparers/AgencyIdComparer.cs deleted file mode 100644 index 43c466f684..0000000000 --- a/backend/entities/Comparers/AgencyIdComparer.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; - -namespace Pims.Dal.Entities.Comparers -{ - public class AgencyIdComparer : IEqualityComparer - { - public bool Equals([AllowNull] Agency x, [AllowNull] Agency y) - { - return x != null && y != null && GetHashCode(x) == GetHashCode(y); - } - - public int GetHashCode([DisallowNull] Agency obj) - { - var hash = new HashCode(); - hash.Add(obj.Id); - return hash.ToHashCode(); - } - } -} diff --git a/backend/entities/Comparers/RoleIdComparer.cs b/backend/entities/Comparers/RoleIdComparer.cs deleted file mode 100644 index 8b4cf1e47d..0000000000 --- a/backend/entities/Comparers/RoleIdComparer.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; - -namespace Pims.Dal.Entities.Comparers -{ - public class RoleIdComparer : IEqualityComparer - { - public bool Equals([AllowNull] Role x, [AllowNull] Role y) - { - return x != null && y != null && GetHashCode(x) == GetHashCode(y); - } - - public int GetHashCode([DisallowNull] Role obj) - { - var hash = new HashCode(); - hash.Add(obj.Id); - return hash.ToHashCode(); - } - } -} diff --git a/backend/entities/Comparers/UserAgencyAgencyIdComparer.cs b/backend/entities/Comparers/UserAgencyAgencyIdComparer.cs deleted file mode 100644 index aab557fe82..0000000000 --- a/backend/entities/Comparers/UserAgencyAgencyIdComparer.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; - -namespace Pims.Dal.Entities.Comparers -{ - public class UserAgencyAgencyIdComparer : IEqualityComparer - { - public bool Equals([AllowNull] UserAgency x, [AllowNull] UserAgency y) - { - return x != null && y != null && GetHashCode(x) == GetHashCode(y); - } - - public int GetHashCode([DisallowNull] UserAgency obj) - { - var hash = new HashCode(); - hash.Add(obj.AgencyId); - return hash.ToHashCode(); - } - } -} diff --git a/backend/entities/Comparers/UserRoleRoleIdComparer.cs b/backend/entities/Comparers/UserRoleRoleIdComparer.cs deleted file mode 100644 index 8a331c9f42..0000000000 --- a/backend/entities/Comparers/UserRoleRoleIdComparer.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; - -namespace Pims.Dal.Entities.Comparers -{ - public class UserRoleRoleIdComparer : IEqualityComparer - { - public bool Equals([AllowNull] UserRole x, [AllowNull] UserRole y) - { - return x != null && y != null && GetHashCode(x) == GetHashCode(y); - } - - public int GetHashCode([DisallowNull] UserRole obj) - { - var hash = new HashCode(); - hash.Add(obj.RoleId); - return hash.ToHashCode(); - } - } -} diff --git a/backend/entities/EvalutationKeys.cs b/backend/entities/EvalutationKeys.cs deleted file mode 100644 index aad3c0e0ca..0000000000 --- a/backend/entities/EvalutationKeys.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Pims.Dal.Entities -{ - /// - /// EvaluationKeys enum, provides a list of valid keys for evaluation values. - /// - public enum EvaluationKeys - { - Assessed, - Appraised, - Improvements - } -} diff --git a/backend/entities/FiscalKeys.cs b/backend/entities/FiscalKeys.cs deleted file mode 100644 index 095af8cf9c..0000000000 --- a/backend/entities/FiscalKeys.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Pims.Dal.Entities -{ - /// - /// FiscalKeys enum, provides a list of valid keys for fiscal values. - /// - public enum FiscalKeys - { - /// - /// Net Book Value. - /// - NetBook, - /// - /// Estimated/Current Market Value. - /// - Market - } -} diff --git a/backend/entities/GoldUser.cs b/backend/entities/GoldUser.cs deleted file mode 100644 index 0a156ec3c3..0000000000 --- a/backend/entities/GoldUser.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Collections.Generic; - -namespace Pims.Dal.Entities -{ - /// - /// Gold User class, used for describing a User that has an array of string roles provided by Keycloak Gold. - /// - public class GoldUser : User - { - public IEnumerable GoldUserRoles { get; set; } - - public GoldUser() { } - public GoldUser(User user) - { - this.Id = user.Id; - this.KeycloakUserId = user.KeycloakUserId; - this.Username = user.Username; - this.DisplayName = user.DisplayName; - this.FirstName = user.FirstName; - this.MiddleName = user.MiddleName; - this.LastName = user.LastName; - this.Email = user.Email; - this.Position = user.Position; - this.IsDisabled = user.IsDisabled; - this.EmailVerified = user.EmailVerified; - this.Note = user.Note; - this.IsSystem = user.IsSystem; - this.LastLogin = user.LastLogin; - this.ApprovedById = user.ApprovedById; - this.ApprovedBy = user.ApprovedBy; - this.ApprovedOn = user.ApprovedOn; - this.Agencies = user.Agencies; - this.Roles = user.Roles; - this.RowVersion = user.RowVersion; - } - } - - -} \ No newline at end of file diff --git a/backend/entities/Helpers/Extensions/BuildingExtensions.cs b/backend/entities/Helpers/Extensions/BuildingExtensions.cs deleted file mode 100644 index 4f55d4b0a5..0000000000 --- a/backend/entities/Helpers/Extensions/BuildingExtensions.cs +++ /dev/null @@ -1,132 +0,0 @@ -using System; -using System.Linq; -using Pims.Core.Extensions; -namespace Pims.Dal.Entities.Helpers.Extensions -{ - /// - /// BuildingExtensions static class, provides extension methods for buildings. - /// - public static class BuildingExtensions - { - /// - /// Get the most recent evaluation for the specified 'key'. - /// - /// - /// - /// - public static decimal? GetMostRecentEvaluation(this Building building, EvaluationKeys key) - { - return building.Evaluations.OrderByDescending(f => f.Date).FirstOrDefault(f => f.Key == key)?.Value; - } - - /// - /// Get the most recent evaluation date for the specified 'key'. - /// - /// - /// - /// - public static DateTime? GetMostRecentEvaluationDate(this Building building, EvaluationKeys key) - { - return building.Evaluations.OrderByDescending(f => f.Date).FirstOrDefault(f => f.Key == key)?.Date; - } - - /// - /// Get the most recent fiscal for the specified 'key'. - /// - /// - /// - /// - public static decimal? GetMostRecentFiscal(this Building building, FiscalKeys key) - { - return building.Fiscals.OrderByDescending(f => f.FiscalYear).FirstOrDefault(f => f.Key == key)?.Value; - } - - /// - /// Get the most recent fiscal year for the specified 'key'. - /// - /// - /// - /// - public static int? GetMostRecentFiscalYear(this Building building, FiscalKeys key) - { - return building.Fiscals.OrderByDescending(f => f.FiscalYear).FirstOrDefault(f => f.Key == key)?.FiscalYear; - } - - /// - /// Get the current evaluation for the specified 'key'. - /// - /// - /// - /// - public static decimal? GetCurrentEvaluation(this Building building, EvaluationKeys key) - { - return building.Evaluations.FirstOrDefault(e => e.Date.Year == DateTime.Now.Year && e.Key == key)?.Value; - } - - /// - /// Get the current evaluation date for the specified 'key'. - /// - /// - /// - /// - public static DateTime? GetCurrentEvaluationDate(this Building building, EvaluationKeys key) - { - return building.Evaluations.FirstOrDefault(e => e.Date.Year == DateTime.Now.Year && e.Key == key)?.Date; - } - - /// - /// Get the current fiscal for the specified 'key'. - /// - /// - /// - /// - public static decimal? GetCurrentFiscal(this Building building, FiscalKeys key) - { - return building.Fiscals.FirstOrDefault(f => f.FiscalYear == DateTime.Now.GetFiscalYear() && f.Key == key)?.Value; - } - - /// - /// Get the current fiscal year for the specified 'key'. - /// - /// - /// - /// - public static int? GetCurrentFiscalYear(this Building building, FiscalKeys key) - { - return building.Fiscals.FirstOrDefault(f => f.FiscalYear == DateTime.Now.GetFiscalYear() && f.Key == key)?.FiscalYear; - } - - /// - /// Get the first parcel relationship that this building is located on. - /// Note - A building could be located on more than one parcel. - /// - /// - /// - public static int? GetPID(this Building building) - { - return building.Parcels.FirstOrDefault()?.Parcel?.PID; - } - - /// - /// Get the first parcel relationship that this building is located on. - /// Note - A building could be located on more than one parcel. - /// - /// - /// - public static string GetParcelIdentity(this Building building) - { - return building.Parcels.FirstOrDefault()?.Parcel?.ParcelIdentity; - } - - /// - /// Get the first parcel relationship that this building is located on. - /// Note - A building could be located on more than one parcel. - /// - /// - /// - public static int? GetPIN(this Building building) - { - return building.Parcels.FirstOrDefault()?.Parcel?.PIN; - } - } -} diff --git a/backend/entities/Helpers/Extensions/ParcelExtensions.cs b/backend/entities/Helpers/Extensions/ParcelExtensions.cs deleted file mode 100644 index 5801b444c8..0000000000 --- a/backend/entities/Helpers/Extensions/ParcelExtensions.cs +++ /dev/null @@ -1,100 +0,0 @@ -using System; -using System.Linq; -using Pims.Core.Extensions; - -namespace Pims.Dal.Entities.Helpers.Extensions -{ - /// - /// ParcelExtensions static class, provides extension methods for parcels. - /// - public static class ParcelExtensions - { - /// - /// Get the most recent fiscal for the specified 'key'. - /// - /// - /// - /// - public static decimal? GetMostRecentFiscal(this Parcel parcel, FiscalKeys key) - { - return parcel.Fiscals.OrderByDescending(f => f.FiscalYear).FirstOrDefault(f => f.Key == key)?.Value; - } - - /// - /// Get the most recent fiscal year for the specified 'key'. - /// - /// - /// - /// - public static int? GetMostRecentFiscalYear(this Parcel parcel, FiscalKeys key) - { - return parcel.Fiscals.OrderByDescending(f => f.FiscalYear).FirstOrDefault(f => f.Key == key)?.FiscalYear; - } - - /// - /// Get the most recent evaluation for the specified 'key'. - /// - /// - /// - /// - public static decimal? GetMostRecentEvaluation(this Parcel parcel, EvaluationKeys key) - { - return parcel.Evaluations.OrderByDescending(f => f.Date).FirstOrDefault(f => f.Key == key)?.Value; - } - - /// - /// Get the most recent evaluation date for the specified 'key'. - /// - /// - /// - /// - public static DateTime? GetMostRecentEvaluationDate(this Parcel parcel, EvaluationKeys key) - { - return parcel.Evaluations.OrderByDescending(f => f.Date).FirstOrDefault(f => f.Key == key)?.Date; - } - - /// - /// Get the current evaluation for the specified 'key'. - /// - /// - /// - /// - public static decimal? GetCurrentEvaluation(this Parcel parcel, EvaluationKeys key) - { - return parcel.Evaluations.FirstOrDefault(e => e.Date.Year == DateTime.Now.Year && e.Key == key)?.Value; - } - - /// - /// Get the current evaluation date for the specified 'key'. - /// - /// - /// - /// - public static DateTime? GetCurrentEvaluationDate(this Parcel parcel, EvaluationKeys key) - { - return parcel.Evaluations.FirstOrDefault(e => e.Date.Year == DateTime.Now.Year && e.Key == key)?.Date; - } - - /// - /// Get the current fiscal for the specified 'key'. - /// - /// - /// - /// - public static decimal? GetCurrentFiscal(this Parcel parcel, FiscalKeys key) - { - return parcel.Fiscals.FirstOrDefault(f => f.FiscalYear == DateTime.Now.GetFiscalYear() && f.Key == key)?.Value; - } - - /// - /// Get the current fiscal year for the specified 'key'. - /// - /// - /// - /// - public static int? GetCurrentFiscalYear(this Parcel parcel, FiscalKeys key) - { - return parcel.Fiscals.FirstOrDefault(f => f.FiscalYear == DateTime.Now.GetFiscalYear() && f.Key == key)?.FiscalYear; - } - } -} diff --git a/backend/entities/Helpers/Extensions/ProjectExtensions.cs b/backend/entities/Helpers/Extensions/ProjectExtensions.cs deleted file mode 100644 index 651a76cd45..0000000000 --- a/backend/entities/Helpers/Extensions/ProjectExtensions.cs +++ /dev/null @@ -1,124 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text.Json; -using Entity = Pims.Dal.Entities; - -namespace Pims.Dal.Helpers.Extensions -{ - /// - /// ProjectExtensions static class, provides extension methods for projects. - /// - public static class ProjectExtensions - { - /// - /// Add the passed project number to the array, and then return the result with no duplicates - /// - /// - /// - /// - private static List AddProjectNumber(IEnumerable projectNumbers, string projectNumber) - { - if (projectNumber == null) - { - return projectNumbers.ToList(); - } - - var updatedProjectNumbers = projectNumbers.ToList(); - updatedProjectNumbers.Add(projectNumber); - return updatedProjectNumbers.Distinct().ToList(); - } - - /// - /// Update the property.ProjectNumbers with the specified 'projectNumber', de-duplicating based on the numeric portion. - /// - /// - /// - /// - public static Entity.Property UpdateProjectNumbers(this Entity.ProjectProperty property, string projectNumber) - { - IEnumerable projectNumbers; - switch (property.PropertyType) - { - case (Entity.PropertyTypes.Land): - if (property.Parcel == null) throw new InvalidOperationException("Unable to update parcel project number."); - projectNumbers = JsonSerializer.Deserialize>(property.Parcel.ProjectNumbers ?? "[]"); - property.Parcel.ProjectNumbers = JsonSerializer.Serialize(AddProjectNumber(projectNumbers, projectNumber)); - return property.Parcel; - case (Entity.PropertyTypes.Building): - if (property.Building == null) throw new InvalidOperationException("Unable to update building project number."); - projectNumbers = JsonSerializer.Deserialize>(property.Building.ProjectNumbers ?? "[]"); - property.Building.ProjectNumbers = JsonSerializer.Serialize(AddProjectNumber(projectNumbers, projectNumber)); - return property.Building; - } - - return null; - } - - /// - /// Update the property.ProjectNumbers with the specified 'projectNumber', de-duplicating based on the numeric portion. - /// - /// - /// - /// - public static Entity.Property UpdateProjectNumbers(this Entity.Property property, string projectNumber) - { - IEnumerable projectNumbers = JsonSerializer.Deserialize>(property.ProjectNumbers ?? "[]"); - property.ProjectNumbers = JsonSerializer.Serialize(AddProjectNumber(projectNumbers, projectNumber)); - return property; - } - - /// - /// Update the property.ProjectNumbers with the specified 'projectNumber', de-duplicating based on the numeric portion. - /// - /// - /// - /// - public static Entity.Models.ProjectProperty UpdateProjectNumbers(this Entity.Models.ProjectProperty projectProperty, string projectNumber) - { - IEnumerable projectNumbers = JsonSerializer.Deserialize>(projectProperty.ProjectNumbers ?? "[]"); - projectProperty.ProjectNumbers = JsonSerializer.Serialize(AddProjectNumber(projectNumbers, projectNumber)); - return projectProperty; - } - - /// - /// Remove from the property.ProjectNumbers using the specified 'projectNumber'. - /// - /// - /// - /// - public static Entity.Property RemoveProjectNumber(this Entity.ProjectProperty property, string projectNumber) - { - IEnumerable projectNumbers; - switch (property.PropertyType) - { - case (Entity.PropertyTypes.Land): - if (property.Parcel == null) throw new InvalidOperationException("Unable to update parcel project number."); - projectNumbers = JsonSerializer.Deserialize>(property.Parcel.ProjectNumbers ?? "[]"); - property.Parcel.ProjectNumbers = JsonSerializer.Serialize(projectNumbers.Where(p => p != projectNumber)); - return property.Parcel; - case (Entity.PropertyTypes.Building): - if (property.Building == null) throw new InvalidOperationException("Unable to update building project number."); - projectNumbers = JsonSerializer.Deserialize>(property.Building.ProjectNumbers ?? "[]"); - property.Building.ProjectNumbers = JsonSerializer.Serialize(projectNumbers.Where(p => p != projectNumber)); - return property.Building; - } - - return null; - } - - - /// - /// Remove from the property.ProjectNumbers using the specified 'projectNumber'. - /// - /// - /// - /// - public static Entity.Property RemoveProjectNumber(this Entity.Property property, string projectNumber) - { - IEnumerable projectNumbers = JsonSerializer.Deserialize>(property.ProjectNumbers ?? "[]"); - property.ProjectNumbers = JsonSerializer.Serialize(projectNumbers.Where(p => p != projectNumber)); - return property; - } - } -} diff --git a/backend/entities/LeasedLandTypes.cs b/backend/entities/LeasedLandTypes.cs deleted file mode 100644 index f6a7be36e4..0000000000 --- a/backend/entities/LeasedLandTypes.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Pims.Dal.Entities -{ - /// - /// LeasedLandTypes enum, provides the valid building leased land types that can be used. - /// - public enum LeasedLandTypes - { - /// - /// The ministry owns the land the building is on. - /// - Owned = 0, - /// - /// The ministry leases the land the building is on. - /// - Leased = 1, - /// - /// The relationship with the land is complex. - /// - Other = 2, - } -} diff --git a/backend/entities/LookupEntity.cs b/backend/entities/LookupEntity.cs deleted file mode 100644 index cb7366c834..0000000000 --- a/backend/entities/LookupEntity.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// LookupEntity class, provides an entity for the datamodel to manage entities that represent codified values. - /// - /// - public abstract class LookupEntity : BaseEntity - { - #region Properties - /// - /// get/set - A unique id for the code. - /// - /// - public TKey Id { get; set; } - - /// - /// get/set - The name of the code. - /// - /// - public string Name { get; set; } - - /// - /// get/set - Whether this code is disabled. - /// - /// - public bool IsDisabled { get; set; } - - /// - /// get/set - The sort order of the lookup item. - /// - /// - public int SortOrder { get; set; } - #endregion - - #region Constructors - /// - /// Create a new instance of a LookupEntity class. - /// - public LookupEntity() { } - - /// - /// Create a new instance of a LookupEntity class. - /// - /// - /// - public LookupEntity(TKey id, string name) - { - if (String.IsNullOrWhiteSpace(name)) throw new ArgumentException($"Argument '{nameof(name)}' must have a valid value.", nameof(name)); - - this.Id = id; - this.Name = name; - } - #endregion - } -} diff --git a/backend/entities/Models/AccessRequestFilter.cs b/backend/entities/Models/AccessRequestFilter.cs deleted file mode 100644 index cf5837adbe..0000000000 --- a/backend/entities/Models/AccessRequestFilter.cs +++ /dev/null @@ -1,37 +0,0 @@ -namespace Pims.Dal.Entities.Models -{ - public class AccessRequestFilter : PageFilter - { - /// - /// Get/Set - searchText - /// - public string SearchText { get; set; } - - /// - /// Get/Set - role - /// - public string Role { get; set; } - - /// - /// Get/Set - agency - /// - public string Agency { get; set; } - - /// - /// Get/Set - Status - /// - public AccessRequestStatus Status { get; set; } - - public AccessRequestFilter(int page, int quantity, string[] sort, string searchText, string role, string agency, - AccessRequestStatus status) - { - Page = page; - Quantity = quantity; - Sort = sort; - SearchText = searchText; - Role = role; - Agency = agency; - Status = status; - } - } -} diff --git a/backend/entities/Models/AdministrativeAreaFilter.cs b/backend/entities/Models/AdministrativeAreaFilter.cs deleted file mode 100644 index 17239b6c18..0000000000 --- a/backend/entities/Models/AdministrativeAreaFilter.cs +++ /dev/null @@ -1,92 +0,0 @@ -using Pims.Core.Extensions; -using System; -using System.Collections.Generic; - -namespace Pims.Dal.Entities.Models -{ - /// - /// AdministrativeAreaFilter class, provides a model for filtering administrative areas - /// - public class AdministrativeAreaFilter - { - #region Properties - /// - /// get/set - The page number. - /// - /// - public int Page { get; set; } = 1; - - /// - /// get/set - The quantity to return in each page. - /// - /// - public int Quantity { get; set; } = 10; - - /// - /// get/set - A description of the boundary type for this area (o.e. Legal). - /// - public string BoundaryType { get; set; } - - /// - /// get/set - The parent group name for this area. - /// - public string Name { get; set; } - - /// - /// get/set - An appreviated name. - /// - public string Abbreviation { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a AgencyFilter class. - /// - public AdministrativeAreaFilter() { } - - /// - /// Creates a new instance of a AdministrativeAreaFilter class, initializes it with the specified arguments. - /// - /// - /// - public AdministrativeAreaFilter(int page, int quantity) - { - this.Page = page; - this.Quantity = quantity; - } - - /// - /// Creates a new instance of a AdministrativeAreaFilter class, initializes it with the specified arguments. - /// - /// - /// - /// - /// - /// - /// - public AdministrativeAreaFilter(int page, int quantity, string name, string boundaryType, string abbreviation) : this(page, quantity) - { - this.Name = name; - this.BoundaryType = boundaryType; - this.Abbreviation = abbreviation; - } - - /// - /// Creates a new instance of a AdministrativeAreaFilter class, initializes it with the specified arguments. - /// Extracts the properties from the query string to generate the filter. - /// - /// - public AdministrativeAreaFilter(Dictionary query) - { - // We want case-insensitive query parameter properties. - var filter = new Dictionary(query, StringComparer.OrdinalIgnoreCase); - this.Page = filter.GetIntValue(nameof(this.Page), 1); - this.Quantity = filter.GetIntValue(nameof(this.Quantity), 10); - this.Name = filter.GetStringValue(nameof(this.Name)); - this.BoundaryType = filter.GetStringValue(nameof(this.BoundaryType)); - this.Abbreviation = filter.GetStringValue(nameof(this.Abbreviation)); - } - #endregion - - } -} diff --git a/backend/entities/Models/AgencyFilter.cs b/backend/entities/Models/AgencyFilter.cs deleted file mode 100644 index fd6ddd3190..0000000000 --- a/backend/entities/Models/AgencyFilter.cs +++ /dev/null @@ -1,112 +0,0 @@ -using Pims.Core.Extensions; -using System; -using System.Collections.Generic; - -namespace Pims.Dal.Entities.Models -{ - /// - /// AgencyFilter class, provides a model for filtering agencies. - /// - public class AgencyFilter - { - #region Properties - /// - /// get/set - The page number. - /// - /// - public int Page { get; set; } = 1; - - /// - /// get/set - The quantity to return in each page. - /// - /// - public int Quantity { get; set; } = 10; - - /// - /// get/set - The name of the agency. - /// - /// - public string Name { get; set; } - - /// - /// get/set - The parent id of given agency. - /// - /// - public int ParentId { get; set; } - - /// - /// get/set - account status - /// - /// - public bool? IsDisabled { get; set; } - - /// - /// get/set - The agency ID - /// - /// - public int? Id { get; set; } - - /// - /// get/set - An array of sorting conditions (i.e. FirstName desc, LastName asc) - /// - /// - public string[] Sort { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a AgencyFilter class. - /// - public AgencyFilter() { } - - /// - /// Creates a new instance of a AgencyFilter class, initializes it with the specified arguments. - /// - /// - /// - public AgencyFilter(int page, int quantity) - { - this.Page = page; - this.Quantity = quantity; - } - - /// - /// Creates a new instance of a AgencyFilter class, initializes it with the specified arguments. - /// - /// - /// - /// - /// - /// - /// - /// - /// - public AgencyFilter(int page, int quantity, int id, String name, string description, int parentId, bool? isDisabled, string[] sort) : this(page, quantity) - { - this.Name = name; - this.ParentId = parentId; - this.IsDisabled = isDisabled; - this.Sort = sort; - this.Id = id; - } - - /// - /// Creates a new instance of a AgencyFilter class, initializes it with the specified arguments. - /// Extracts the properties from the query string to generate the filter. - /// - /// - public AgencyFilter(Dictionary query) - { - // We want case-insensitive query parameter properties. - var filter = new Dictionary(query, StringComparer.OrdinalIgnoreCase); - this.Page = filter.GetIntValue(nameof(this.Page), 1); - this.Quantity = filter.GetIntValue(nameof(this.Quantity), 10); - this.Name = filter.GetStringValue(nameof(this.Name)); - this.ParentId = filter.GetIntValue(nameof(this.ParentId)); - this.IsDisabled = filter.GetValue(nameof(this.IsDisabled)); - this.Id = filter.GetIntValue(nameof(this.Id)); - this.Sort = filter.GetStringArrayValue(nameof(this.Sort)); - } - #endregion - } -} diff --git a/backend/entities/Models/AllPropertyFilter.cs b/backend/entities/Models/AllPropertyFilter.cs deleted file mode 100644 index 8b35802f4f..0000000000 --- a/backend/entities/Models/AllPropertyFilter.cs +++ /dev/null @@ -1,254 +0,0 @@ -using NetTopologySuite.Geometries; -using Pims.Core.Extensions; -using System; -using System.Collections.Generic; - -namespace Pims.Dal.Entities.Models -{ - /// - /// AllPropertyFilter class, provides a filter for filtering property queries. - /// - public class AllPropertyFilter : PropertyFilter - { - #region Properties - - #region Parcel Properties - /// - /// get/set - The parcel PID. - /// - public string PID { get; set; } - - /// - /// get/set - The parcel zoning. - /// - public string Zoning { get; set; } - - /// - /// get/set - The parcel potential zoning. - /// - public string ZoningPotential { get; set; } - - /// - /// get/set - Parcel minimum land area. - /// - /// - public float? MinLandArea { get; set; } - - /// - /// get/set - Parcel maximum land area. - /// - /// - public float? MaxLandArea { get; set; } - #endregion - - #region Building Properties - /// - /// get/set - Building construction type Id. - /// - /// - public int? ConstructionTypeId { get; set; } - - /// - /// get/set - Building predominant use Id. - /// - /// - public int? PredominateUseId { get; set; } - - /// - /// get/set - Building floor count Id. - /// - /// - public int? FloorCount { get; set; } - - /// - /// get/set - Building tenancy. - /// - /// - public string Tenancy { get; set; } - - /// - /// get/set - Building minimum rentable area. - /// - /// - public float? MinRentableArea { get; set; } - - /// - /// get/set - Building maximum rentable area. - /// - /// - public float? MaxRentableArea { get; set; } - - /// - /// get/set - Whether to include properties not owned by user's agency when searching. - /// - public bool IncludeAllProperties { get; set; } - #endregion - #endregion - - #region Constructors - /// - /// Creates a new instance of a AllPropertyFilter class. - /// - public AllPropertyFilter() { } - - /// - /// Creates a new instance of a AllPropertyFilter class, initializes it with the specified arguments. - /// - /// - /// - /// - /// - public AllPropertyFilter(double neLat, double neLong, double swLat, double swLong) - { - this.NELatitude = neLat; - this.NELongitude = neLong; - this.SWLatitude = swLat; - this.SWLongitude = swLong; - } - - /// - /// Creates a new instance of a AllPropertyFilter class, initializes it with the specified arguments. - /// - /// - public AllPropertyFilter(Envelope boundary) - { - this.NELatitude = boundary?.MaxY; - this.NELongitude = boundary?.MaxX; - this.SWLatitude = boundary?.MinY; - this.SWLongitude = boundary?.MinX; - } - - /// - /// Creates a new instance of a PropertyFilter class, initializes it with the specified arguments. - /// Extracts the properties from the query string to generate the filter. - /// - /// - public AllPropertyFilter(Dictionary query) : base(query) - { - // We want case-insensitive query parameter properties. - var filter = new Dictionary(query, StringComparer.OrdinalIgnoreCase); - - this.PID = filter.GetStringValue(nameof(this.PID)); - this.Zoning = filter.GetStringValue(nameof(this.Zoning)); - this.ZoningPotential = filter.GetStringValue(nameof(this.ZoningPotential)); - this.MinLandArea = filter.GetFloatNullValue(nameof(this.MinLandArea)); - this.MaxLandArea = filter.GetFloatNullValue(nameof(this.MaxLandArea)); - - this.PropertyType = Enum.TryParse(filter.GetStringValue(nameof(this.PropertyType), null), out PropertyTypes propType) ? (PropertyTypes?)propType : null; - this.ConstructionTypeId = filter.GetIntNullValue(nameof(this.ConstructionTypeId)); - this.PredominateUseId = filter.GetIntNullValue(nameof(this.PredominateUseId)); - this.FloorCount = filter.GetIntNullValue(nameof(this.FloorCount)); - this.Tenancy = filter.GetStringValue(nameof(this.Tenancy)); - this.MinRentableArea = filter.GetFloatNullValue(nameof(this.MinRentableArea)); - this.MaxRentableArea = filter.GetFloatNullValue(nameof(this.MaxRentableArea)); - this.IncludeAllProperties = filter.GetBoolValue(nameof(this.IncludeAllProperties)); - } - #endregion - - #region Methods - /// - /// Determine if a valid filter was provided. - /// - /// - public override bool IsValid() - { - return base.IsValid() - || !String.IsNullOrWhiteSpace(this.PID) - || !String.IsNullOrWhiteSpace(this.Zoning) - || !String.IsNullOrWhiteSpace(this.ZoningPotential) - || this.MinLandArea.HasValue - || this.MaxLandArea.HasValue - || this.ConstructionTypeId.HasValue - || this.PredominateUseId.HasValue - || this.FloorCount.HasValue - || this.MinRentableArea.HasValue - || this.MaxRentableArea.HasValue - || !String.IsNullOrWhiteSpace(this.Tenancy); - } - - /// - /// Convert to a ParcelFilter. - /// - /// - public static explicit operator ParcelFilter(AllPropertyFilter filter) - { - var parcel = new ParcelFilter - { - Page = filter.Page, - Quantity = filter.Quantity, - - NELatitude = filter.NELatitude, - NELongitude = filter.NELongitude, - SWLatitude = filter.SWLatitude, - SWLongitude = filter.SWLongitude, - - ProjectNumber = filter.ProjectNumber, - ClassificationId = filter.ClassificationId, - Address = filter.Address, - - PID = filter.PID, - AdministrativeArea = filter.AdministrativeArea, - MinLandArea = filter.MinLandArea, - MaxLandArea = filter.MaxLandArea, - Zoning = filter.Zoning, - ZoningPotential = filter.ZoningPotential, - - MinMarketValue = filter.MinMarketValue, - MaxMarketValue = filter.MaxMarketValue, - MinAssessedValue = filter.MinAssessedValue, - MaxAssessedValue = filter.MaxAssessedValue, - - Agencies = filter.Agencies, - Sort = filter.Sort - }; - - return parcel; - } - - /// - /// Convert to a BuildingFilter. - /// - /// - public static explicit operator BuildingFilter(AllPropertyFilter filter) - { - var parcel = new BuildingFilter - { - Page = filter.Page, - Quantity = filter.Quantity, - - NELatitude = filter.NELatitude, - NELongitude = filter.NELongitude, - SWLatitude = filter.SWLatitude, - SWLongitude = filter.SWLongitude, - - ProjectNumber = filter.ProjectNumber, - ClassificationId = filter.ClassificationId, - Address = filter.Address, - - AdministrativeArea = filter.AdministrativeArea, - MinLandArea = filter.MinLandArea, - MaxLandArea = filter.MaxLandArea, - Zoning = filter.Zoning, - ZoningPotential = filter.ZoningPotential, - - ConstructionTypeId = filter.ConstructionTypeId, - PredominateUseId = filter.PredominateUseId, - FloorCount = filter.FloorCount, - Tenancy = filter.Tenancy, - MinRentableArea = filter.MinRentableArea, - MaxRentableArea = filter.MaxRentableArea, - - MinMarketValue = filter.MinMarketValue, - MaxMarketValue = filter.MaxMarketValue, - MinAssessedValue = filter.MinAssessedValue, - MaxAssessedValue = filter.MaxAssessedValue, - - Agencies = filter.Agencies, - Sort = filter.Sort - }; - - return parcel; - } - #endregion - } -} diff --git a/backend/entities/Models/BuildingFilter.cs b/backend/entities/Models/BuildingFilter.cs deleted file mode 100644 index 7dc52d1ad0..0000000000 --- a/backend/entities/Models/BuildingFilter.cs +++ /dev/null @@ -1,137 +0,0 @@ -using Pims.Core.Extensions; -using System; -using System.Collections.Generic; - -namespace Pims.Dal.Entities.Models -{ - /// - /// BuildingFilter class, provides a model for filtering building queries. - /// - public class BuildingFilter : ParcelFilter - { - #region Properties - /// - /// get/set - Building construction type Id. - /// - /// - public int? ConstructionTypeId { get; set; } - - /// - /// get/set - Building predominant use Id. - /// - /// - public int? PredominateUseId { get; set; } - - /// - /// get/set - Building floor count Id. - /// - /// - public int? FloorCount { get; set; } - - /// - /// get/set - Building tenancy. - /// - /// - public string Tenancy { get; set; } - - /// - /// get/set - Building minimum rentable area. - /// - /// - public float? MinRentableArea { get; set; } - - /// - /// get/set - Building maximum rentable area. - /// - /// - public float? MaxRentableArea { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a BuildingFilter class. - /// - public BuildingFilter() { } - - /// - /// Creates a new instance of a BuildingFilter class, initializes it with the specified arguments. - /// - /// - /// - /// - /// - public BuildingFilter(double neLat, double neLong, double swLat, double swLong) : base(neLat, neLong, swLat, swLong) - { - } - - /// - /// Creates a new instance of a BuildingFilter class, initializes it with the specified arguments. - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public BuildingFilter(string address, int? agencyId, int? constructionTypeId, int? predominateUseId, int? floorCount, string tenancy, float? minRentableArea, float? maxRentableArea, decimal? minMarketValue, decimal? maxMarketValue, decimal? minAssessedValue, decimal? maxAssessedValue, string[] sort) - { - this.Address = address; - this.ConstructionTypeId = constructionTypeId; - this.PredominateUseId = predominateUseId; - this.FloorCount = floorCount; - this.Tenancy = tenancy; - this.MinRentableArea = minRentableArea; - this.MaxRentableArea = maxRentableArea; - this.MinMarketValue = minMarketValue; - this.MaxMarketValue = maxMarketValue; - this.MinAssessedValue = minAssessedValue; - this.MaxAssessedValue = maxAssessedValue; - if (agencyId.HasValue) - this.Agencies = new[] { agencyId.Value }; - this.Sort = sort; - } - - /// - /// Creates a new instance of a BuildingFilter class, initializes it with the specified arguments. - /// Extracts the properties from the query string to generate the filter. - /// - /// - public BuildingFilter(Dictionary query) : base(query) - { - // We want case-insensitive query parameter properties. - var filter = new Dictionary(query, StringComparer.OrdinalIgnoreCase); - this.ConstructionTypeId = filter.GetIntNullValue(nameof(this.ConstructionTypeId)); - this.PredominateUseId = filter.GetIntNullValue(nameof(this.PredominateUseId)); - this.FloorCount = filter.GetIntNullValue(nameof(this.FloorCount)); - this.Tenancy = filter.GetStringValue(nameof(this.Tenancy)); - this.MinRentableArea = filter.GetFloatNullValue(nameof(this.MinRentableArea)); - this.MaxRentableArea = filter.GetFloatNullValue(nameof(this.MaxRentableArea)); - } - #endregion - - #region Methods - /// - /// Determine if the filter is specific to building criteria. - /// - /// - public override bool IsValid() - { - return base.IsValid() - || this.ConstructionTypeId.HasValue - || this.PredominateUseId.HasValue - || this.FloorCount.HasValue - || this.MinRentableArea.HasValue - || this.MaxRentableArea.HasValue - || !String.IsNullOrWhiteSpace(this.Tenancy); - } - #endregion - } -} diff --git a/backend/entities/Models/BuildingModel.cs b/backend/entities/Models/BuildingModel.cs deleted file mode 100644 index df137111aa..0000000000 --- a/backend/entities/Models/BuildingModel.cs +++ /dev/null @@ -1,123 +0,0 @@ -using System; -using System.Security.Claims; - -namespace Pims.Dal.Entities.Models -{ - /// - /// BuildingModel class, provides a model that represents a building within PIMS. - /// - public class BuildingModel : PropertyModel - { - #region Properties - #region Building Information - /// - /// get/set - The foreign key to the property building construction type. - /// - public int? BuildingConstructionTypeId { get; set; } - - /// - /// get/set - The building construction type for this property. - /// - public string BuildingConstructionType { get; set; } - - /// - /// get/set - The number of floors in the building. - /// - public int? BuildingFloorCount { get; set; } - - /// - /// get/set - The foreign key to the building predominant use. - /// - public int? BuildingPredominateUseId { get; set; } - - /// - /// get/set - The building predominant use for this building. - /// - public string BuildingPredominateUse { get; set; } - - /// - /// get/set - The type of tenancy for this building. - /// - public string BuildingTenancy { get; set; } - - /// - /// get/set - The building rentable area. - /// - public float? RentableArea { get; set; } - - /// - /// get/set - The foreign key to the building occupant type. - /// - public int? BuildingOccupantTypeId { get; set; } - - /// - /// get/set - The type of occupant for this building. - /// - public string BuildingOccupantType { get; set; } - - /// - /// get/set - The expiry date of the currently active lease - /// - public DateTime? LeaseExpiry { get; set; } - - /// - /// get/set - The name of the occupant/organization - /// - public string OccupantName { get; set; } - - /// - /// get/set - Whether the lease on this building would be transferred if the building is sold. - /// - public bool? TransferLeaseOnSale { get; set; } - #endregion - - #region Financials - /// - /// get/set - The most recent assessment for the buildings and improvements. - /// - public decimal? Assessed { get; set; } - - /// - /// get/set - When the assessment was completed. - /// - public DateTime? AssessedDate { get; set; } - - #endregion - #endregion - - #region Constructors - /// - /// Creates a new instance of a BuildingModel object. - /// - public BuildingModel() { } - - /// - /// Creates a new instance of a BuildingModel object, initializes with specified parameters. - /// - /// - /// - public BuildingModel(Views.Property property, ClaimsPrincipal user) : base(property, user) - { - this.PropertyTypeId = PropertyTypes.Building; - this.BuildingConstructionTypeId = property.BuildingConstructionTypeId; - this.BuildingConstructionType = property.BuildingConstructionType; - this.BuildingOccupantTypeId = property.BuildingOccupantTypeId; - this.BuildingOccupantType = property.BuildingOccupantType; - this.BuildingPredominateUseId = property.BuildingPredominateUseId; - this.BuildingPredominateUse = property.BuildingPredominateUse; - this.BuildingFloorCount = property.BuildingFloorCount; - this.BuildingTenancy = property.BuildingTenancy; - this.RentableArea = property.RentableArea; - - // The following values are conditionally removed in PropertyService.cs. - // These values are only to be included in the object if the user has the "admin-properties" claim, - // or the user belongs to the agency of the building. - this.LeaseExpiry = property.LeaseExpiry; - this.OccupantName = property.OccupantName; - this.TransferLeaseOnSale = property.TransferLeaseOnSale; - this.Assessed = property.AssessedBuilding; - this.AssessedDate = property.AssessedBuildingDate; - } - #endregion - } -} diff --git a/backend/entities/Models/DisposalProjectMetadata.cs b/backend/entities/Models/DisposalProjectMetadata.cs deleted file mode 100644 index 1f06bf4cb9..0000000000 --- a/backend/entities/Models/DisposalProjectMetadata.cs +++ /dev/null @@ -1,237 +0,0 @@ -using System; - -namespace Pims.Dal.Entities.Models -{ - /// - /// DisposalProjectMetadata class, provides a model to capture disposal project metadata. - /// - public class DisposalProjectMetadata - { - #region Properties - #region Exemption - /// - /// get/set - Whether an exemption was requested for the ERP. - /// - public bool ExemptionRequested { get; set; } - - /// - /// get/set - The date when the ADM approved the exemption on. - /// - public DateTime? ExemptionApprovedOn { get; set; } - #endregion - - #region ERP - /// - /// get/set - When the initial enhanced referral notification was sent. - /// - public DateTime? InitialNotificationSentOn { get; set; } - - /// - /// get/set - When the 30 day enhanced referral notification was sent. - /// - public DateTime? ThirtyDayNotificationSentOn { get; set; } - - /// - /// get/set - When the 60 day enhanced referral notification was sent. - /// - public DateTime? SixtyDayNotificationSentOn { get; set; } - - /// - /// get/set - When the 90 day enhanced referral notification was sent. - /// - public DateTime? NinetyDayNotificationSentOn { get; set; } - - /// - /// get/set - When the on hold enhanced referral notification was sent. - /// - public DateTime? OnHoldNotificationSentOn { get; set; } - - /// - /// get/set - When interest was received on. - /// - public DateTime? InterestedReceivedOn { get; set; } - - /// - /// get/set - When the project was transferred within the GRE. - /// - public DateTime? TransferredWithinGreOn { get; set; } - - /// - /// get/set - When the clearance enhanced referral notification was sent. - /// - public DateTime? ClearanceNotificationSentOn { get; set; } - #endregion - - #region SPL - /// - /// get/set - When a request to be added to SPL was received. - /// - public DateTime? RequestForSplReceivedOn { get; set; } - - /// - /// get/set - When the project was approved to be added to SPL. - /// - public DateTime? ApprovedForSplOn { get; set; } - - /// - /// get/set - When the project was externally marketed. - /// - public DateTime? MarketedOn { get; set; } - - /// - /// get/set - Text field describing project purchaser. - /// - public string Purchaser { get; set; } - - /// - /// get/set - When the offer was accepted on. - /// - public DateTime? OfferAcceptedOn { get; set; } - - /// - /// get/set - When the project had its sale adjusted. - /// - public DateTime? AdjustedOn { get; set; } - - /// - /// get/set - When the preliminary form was signed on. - /// - public DateTime? PreliminaryFormSignedOn { get; set; } - - /// - /// get/set - When the final form was signed on. - /// - public DateTime? FinalFormSignedOn { get; set; } - - /// - /// get/set - When the prior year adjustment sale date occurred on. - /// - public DateTime? PriorYearAdjustmentOn { get; set; } - - /// - /// get/set - When the project was disposed. - /// - public DateTime? DisposedOn { get; set; } - #endregion - - #region Remove from SPL - /// - /// get/set - When the request to be removed from SPL was. - /// - public DateTime? RemovalFromSplRequestOn { get; set; } - - /// - /// get/set - When the request to be removed from SPL was approved on. - /// - public DateTime? RemovalFromSplApprovedOn { get; set; } - #endregion - - #region Financials - /// - /// get/set - When the project received an BC assessment. - /// - public DateTime? AssessedOn { get; set; } - - /// - /// get/set - When the appraisal value was made. - /// - public string AppraisedBy { get; set; } - - /// - /// get/set - The date the appraisal was provided. - /// - public DateTime? AppraisedOn { get; set; } - - /// - /// get/set - The sales cost. - /// - public decimal? SalesCost { get; set; } - - /// - /// get/set - The net proceeds - /// - public decimal? NetProceeds { get; set; } - - /// - /// get/set - The program cost. - /// - public decimal? ProgramCost { get; set; } - - /// - /// get/set - The gain or loss from selling the properties. - /// - public decimal? GainLoss { get; set; } - - /// - /// get/set - The SPP Capitalization value. - /// - public decimal? SppCapitalization { get; set; } - - /// - /// get/set - The gain before SPL. - /// - public decimal? GainBeforeSpl { get; set; } - - /// - /// get/set - OCG final statement. - /// - public decimal? OcgFinancialStatement { get; set; } - - /// - /// get/set - Record the interest component. - /// - public decimal? InterestComponent { get; set; } - - /// - /// get/set - Best information of planned future use. - /// - public string PlannedFutureUse { get; set; } - - /// - /// get/set - Amount offered during SPL - /// - public decimal? OfferAmount { get; set; } - - /// - /// get/set - Whether the sale includes a lease in place (SLIP). - /// - public bool SaleWithLeaseInPlace { get; set; } - - /// - /// get/set - Whether an adjustment to prior year sale is required. - /// - public bool PriorYearAdjustment { get; set; } - - /// - /// get/set - Whether an adjustment to prior year sale is required. - /// - public decimal? PriorYearAdjustmentAmount { get; set; } - - /// - /// get/set - the real estate agent - /// - public string Realtor { get; set; } - - /// - /// get/set - the real estate agent's rate for this project - /// - public string RealtorRate { get; set; } - - /// - /// get/set - the real estate agent's commission for this project - /// - public decimal? RealtorCommission { get; set; } - - /// - /// get/set - who signed the preliminary form. - /// - public string PreliminaryFormSignedBy { get; set; } - - /// - /// get/set - who signed the final form. - /// - public string FinalFormSignedBy { get; set; } - #endregion - #endregion - } -} diff --git a/backend/entities/Models/DisposalProjectSnapshotMetadata.cs b/backend/entities/Models/DisposalProjectSnapshotMetadata.cs deleted file mode 100644 index 8ca93601ab..0000000000 --- a/backend/entities/Models/DisposalProjectSnapshotMetadata.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Pims.Dal.Entities.Models -{ - public class DisposalProjectSnapshotMetadata : DisposalProjectMetadata - { - #region Properties - /// - /// get/set - The net proceeds baseline from the prior report. - /// This is the difference between the prior net proceeds and the current. - /// - public decimal? BaselineIntegrity { get; set; } - #endregion - } -} diff --git a/backend/entities/Models/EnvironmentModel.cs b/backend/entities/Models/EnvironmentModel.cs deleted file mode 100644 index 7e621e7b8b..0000000000 --- a/backend/entities/Models/EnvironmentModel.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; - -namespace Pims.Dal.Entities.Models -{ - /// - /// EnvironmentModel class, provides a model that is used to generate notifications. - /// - public class EnvironmentModel - { - #region Properties - /// - /// get/set - The application URI. - /// - public Uri Uri { get; set; } - - /// - /// get/set - The environment name. - /// - public string Name { get; set; } - - /// - /// get/set - The application title. - /// - public string Title { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a EnvironmentModel. - /// - public EnvironmentModel() { } - - /// - /// Creates a new instance of a EnvironmentModel, initialize with specified arguments. - /// - /// - /// - /// - public EnvironmentModel(Uri uri, string name, string title) - { - this.Uri = uri; - this.Name = name; - this.Title = title; - } - #endregion - } -} diff --git a/backend/entities/Models/LeasedLandMetadataModel.cs b/backend/entities/Models/LeasedLandMetadataModel.cs deleted file mode 100644 index 6fce91df52..0000000000 --- a/backend/entities/Models/LeasedLandMetadataModel.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace Pims.Dal.Entities.Models -{ - /// - /// LeasedLandMetadata class, provides a model to represent leased land so that a building can include this information. - /// - public class LeasedLandMetadataModel - { - #region Properties - /// - /// get/set - Note related to the ownership of the land associated to this building. - /// - public string OwnershipNote { get; set; } - - /// - /// get/set - An id used to associate this metadata with a parcel. - /// - public int ParcelId { get; set; } - - /// - /// get/set - the lease type - /// - public LeasedLandTypes Type { get; set; } - #endregion - } -} diff --git a/backend/entities/Models/NotificationQueueFilter.cs b/backend/entities/Models/NotificationQueueFilter.cs deleted file mode 100644 index 5e90d7b87e..0000000000 --- a/backend/entities/Models/NotificationQueueFilter.cs +++ /dev/null @@ -1,129 +0,0 @@ -using Pims.Core.Extensions; -using System; -using System.Collections.Generic; - -namespace Pims.Dal.Entities.Models -{ - /// - /// NotificationQueueFilter class, provides a model for filtering notification queue queries. - /// - public class NotificationQueueFilter : PageFilter - { - #region Properties - /// - /// get/set - Search for notifications with this key. - /// - public Guid? Key { get; set; } - - /// - /// get/set - Search for notifications with this status. - /// - public NotificationStatus? Status { get; set; } - - /// - /// get/set - Search for notifications sent on or after. - /// - /// - public DateTime? MinSendOn { get; set; } - - /// - /// get/set - Search for notifications sent on or before. - /// - /// - public DateTime? MaxSendOn { get; set; } - - /// - /// get/set - Search for notifications sent to. - /// - /// - public string To { get; set; } - - /// - /// get/set - Search the tags. - /// - /// - public string Tag { get; set; } - - /// - /// get/set - Search the subject line. - /// - /// - public string Subject { get; set; } - - /// - /// get/set - Search the body. - /// - /// - public string Body { get; set; } - - /// - /// get/set - The project associated with the notification. - /// - /// - public int? ProjectId { get; set; } - - /// - /// get/set - The project number associated with the notification. - /// - /// - public string ProjectNumber { get; set; } - - /// - /// get/set - The agency the notification was sent to. - /// - /// - public int? AgencyId { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a NotificationQueueFilter class. - /// - public NotificationQueueFilter() { } - - /// - /// Creates a new instance of a NotificationQueueFilter class, initializes it with the specified arguments. - /// Extracts the properties from the query string to generate the filter. - /// - /// - public NotificationQueueFilter(Dictionary query) : base(query) - { - // We want case-insensitive query parameter properties. - var filter = new Dictionary(query, StringComparer.OrdinalIgnoreCase); - this.ProjectNumber = filter.GetStringValue(nameof(this.ProjectNumber)); - this.To = filter.GetStringValue(nameof(this.To)); - this.Tag = filter.GetStringValue(nameof(this.Tag)); - this.Subject = filter.GetStringValue(nameof(this.Subject)); - this.Body = filter.GetStringValue(nameof(this.Body)); - this.ProjectId = filter.GetIntNullValue(nameof(this.ProjectId)); - this.AgencyId = filter.GetIntNullValue(nameof(this.AgencyId)); - this.Key = filter.GetGuidNullValue(nameof(this.Key)); - this.MinSendOn = filter.GetDateTimeNullValue(nameof(this.MinSendOn)); - this.MaxSendOn = filter.GetDateTimeNullValue(nameof(this.MaxSendOn)); - this.Status = filter.GetEnumNullValue(nameof(this.Status)); - } - #endregion - - #region Methods - /// - /// Determine if a valid filter was provided. - /// - /// - public override bool IsValid() - { - return base.IsValid() - || !String.IsNullOrWhiteSpace(this.ProjectNumber) - || !String.IsNullOrWhiteSpace(this.To) - || !String.IsNullOrWhiteSpace(this.Tag) - || !String.IsNullOrWhiteSpace(this.Subject) - || !String.IsNullOrWhiteSpace(this.Body) - || this.ProjectId.HasValue - || this.AgencyId.HasValue - || this.Key.HasValue - || this.MinSendOn.HasValue - || this.MaxSendOn.HasValue - || this.Status.HasValue; - } - #endregion - } -} diff --git a/backend/entities/Models/PageFilter.cs b/backend/entities/Models/PageFilter.cs deleted file mode 100644 index b229f8779b..0000000000 --- a/backend/entities/Models/PageFilter.cs +++ /dev/null @@ -1,90 +0,0 @@ -using Pims.Core.Extensions; -using System; -using System.Collections.Generic; - -namespace Pims.Dal.Entities.Models -{ - /// - /// PageFilter class, provides a model for filtering page queries. - /// - public abstract class PageFilter - { - #region Properties - /// - /// get/set - The page number. - /// - public int Page { get; set; } = 1; - - /// - /// get/set - The quantity of pages to return in a single request. - /// - public int Quantity { get; set; } = 10; - - /// - /// get/set - An array of sorting page conditions (i.e. AgencyId desc, ClassificationId asc) - /// - /// - public string[] Sort { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a PageFilter class. - /// - public PageFilter() { } - - /// - /// Creates a new instance of a PageFilter class, initializes it with the specified arguments. - /// - /// - /// - /// - public PageFilter(int page, int quantity, string[] sort = null) - { - this.Page = page; - this.Quantity = quantity; - this.Sort = sort; - } - - /// - /// Creates a new instance of a PageFilter class, initializes it with the specified arguments. - /// Extracts the properties from the query string to generate the filter. - /// - /// - public PageFilter(Dictionary query) - { - // We want case-insensitive query parameter properties. - var filter = new Dictionary(query, StringComparer.OrdinalIgnoreCase); - this.Quantity = filter.GetIntValue(nameof(this.Quantity), filter.GetIntValue("count", 10)); - var startIndex = filter.GetIntValue("startIndex", 0); - this.Page = filter.GetIntValue(nameof(this.Page), startIndex <= 0 ? 1 : CalcPage(startIndex, this.Quantity)); - this.Sort = filter.GetStringArrayValue(nameof(this.Sort)); - } - #endregion - - #region Methods - /// - /// Determine if a valid filter was provided. - /// - /// - public virtual bool IsValid() - { - return this.Page > 0 - && this.Quantity > 0; - } - - /// - /// Convert a start index to a page for paging. // TODO: Should switch to using start index instead of paging because it has a little more control. - /// - /// - /// - /// - private int CalcPage(int startIndex, int quantity) - { - if (startIndex < quantity) return 1; - - return startIndex / quantity; - } - #endregion - } -} diff --git a/backend/entities/Models/Paged`.cs b/backend/entities/Models/Paged`.cs deleted file mode 100644 index e6df981138..0000000000 --- a/backend/entities/Models/Paged`.cs +++ /dev/null @@ -1,176 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; - -namespace Pims.Dal.Entities.Models -{ - /// - /// Paged generic class, provides a structure to hold a single page of items. - /// - /// - public class Paged : ICollection - { - #region Properties - /// - /// get/set - The page number. - /// - /// - public int Page { get; set; } = 1; - - /// - /// get/set - The quantity that was requested in the query. This is not the number of items in this page. - /// - /// - public int Quantity { get; set; } = 10; - - /// - /// get/set - The total number of items in the datasource that match the query. This is not the number of items in this page. - /// - /// - public int Total { get; set; } - - /// - /// get/set - A collection of items in this page as the result of the query. - /// - /// - /// - public List Items { get; set; } = new List(); - - /// - /// get/set - Number of items in the collection on the page. - /// - public int Count => this.Items.Count; - - /// - /// get/set - Whether the collection is read-only. - /// - public bool IsReadOnly => false; - #endregion - - #region Constructors - /// - /// Creates a new instance of a Paged class. - /// - public Paged() { } - - /// - /// Creates a new instance of a Paged class, and initializes it with the specified data. - /// - /// - /// - /// - public Paged(IEnumerable items, int page = 1, int quantity = 10) - { - if (items == null) throw new ArgumentNullException(nameof(items)); - if (page < 1) throw new ArgumentOutOfRangeException(nameof(page)); - if (quantity < 1) throw new ArgumentOutOfRangeException(nameof(quantity)); - - this.Items.AddRange(items); - this.Page = page; - this.Quantity = quantity; - this.Total = items.Count(); - } - - /// - /// Creates a new instance of a Paged class, and initializes it with the specified data. - /// - /// - /// - /// - /// - public Paged(IEnumerable items, int page, int quantity, int total) - { - if (items == null) throw new ArgumentNullException(nameof(items)); - if (page < 1) throw new ArgumentOutOfRangeException(nameof(page)); - if (quantity < 1) throw new ArgumentOutOfRangeException(nameof(quantity)); - if (total < 0) throw new ArgumentOutOfRangeException(nameof(total)); - - this.Items.AddRange(items); - this.Page = page; - this.Quantity = quantity; - this.Total = total; - } - #endregion - - #region Methods - /// - /// Convert the items in the page to another type via the specified 'converter'. - /// - /// - /// - /// - public Paged To(Func, IEnumerable> converter) - { - if (converter == null) throw new ArgumentNullException(nameof(converter)); - - return new Paged(converter(this.Items), this.Page, this.Quantity, this.Total); - } - - /// - /// Get the enumerator for the items. - /// - /// - public IEnumerator GetEnumerator() - { - return ((IEnumerable)Items).GetEnumerator(); - } - - /// - /// Get the enumerator for the items. - /// - /// - IEnumerator IEnumerable.GetEnumerator() - { - return ((IEnumerable)Items).GetEnumerator(); - } - - /// - /// Add the item to the page. - /// - /// - public void Add(TModel item) - { - this.Items.Add(item); - } - - /// - /// Clear the items from the page. - /// - public void Clear() - { - this.Items.Clear(); - } - - /// - /// Check if the page contains the specified 'item'. - /// - /// - /// - public bool Contains(TModel item) - { - return this.Items.Contains(item); - } - - /// - /// Copy items to the specified array. - /// - /// - /// - public void CopyTo(TModel[] array, int arrayIndex) - { - this.Items.CopyTo(array, arrayIndex); - } - - /// - /// Remove the specified 'item' from the page. - /// - /// - /// - public bool Remove(TModel item) - { - return this.Items.Remove(item); - } - #endregion - } -} diff --git a/backend/entities/Models/ParcelFilter.cs b/backend/entities/Models/ParcelFilter.cs deleted file mode 100644 index f10bfb48db..0000000000 --- a/backend/entities/Models/ParcelFilter.cs +++ /dev/null @@ -1,97 +0,0 @@ -using Pims.Core.Extensions; -using System; -using System.Collections.Generic; - -namespace Pims.Dal.Entities.Models -{ - /// - /// ParcelFilter class, provides a model for filtering parcel queries. - /// - public class ParcelFilter : PropertyFilter - { - #region Properties - /// - /// get/set - The parcel PID. - /// - public string PID { get; set; } - - /// - /// get/set - The parcel PIN. - /// - public string PIN { get; set; } - - /// - /// get/set - The parcel zoning. - /// - public string Zoning { get; set; } - - /// - /// get/set - The parcel potential zoning. - /// - public string ZoningPotential { get; set; } - - /// - /// get/set - Parcel minimum land area. - /// - /// - public float? MinLandArea { get; set; } - - /// - /// get/set - Parcel maximum land area. - /// - /// - public float? MaxLandArea { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a ParcelFilter class. - /// - public ParcelFilter() { } - - /// - /// Creates a new instance of a ParcelFilter class, initializes it with the specified arguments. - /// - /// - /// - /// - /// - public ParcelFilter(double neLat, double neLong, double swLat, double swLong) : base(neLat, neLong, swLat, swLong) - { - } - - /// - /// Creates a new instance of a ParcelFilter class, initializes it with the specified arguments. - /// Extracts the properties from the query string to generate the filter. - /// - /// - public ParcelFilter(Dictionary query) : base(query) - { - // We want case-insensitive query parameter properties. - var filter = new Dictionary(query, StringComparer.OrdinalIgnoreCase); - this.PID = filter.GetStringValue(nameof(this.PID)); - this.PIN = filter.GetStringValue(nameof(this.PIN)); - this.Zoning = filter.GetStringValue(nameof(this.Zoning)); - this.ZoningPotential = filter.GetStringValue(nameof(this.ZoningPotential)); - this.MinLandArea = filter.GetFloatNullValue(nameof(this.MinLandArea)); - this.MaxLandArea = filter.GetFloatNullValue(nameof(this.MaxLandArea)); - } - #endregion - - #region Methods - /// - /// Determine if a valid filter was provided. - /// - /// - public override bool IsValid() - { - return base.IsValid() - || !String.IsNullOrWhiteSpace(this.PID) - || !String.IsNullOrWhiteSpace(this.Zoning) - || !String.IsNullOrWhiteSpace(this.ZoningPotential) - || this.MinLandArea.HasValue - || this.MaxLandArea.HasValue; - } - #endregion - } -} diff --git a/backend/entities/Models/ParcelModel.cs b/backend/entities/Models/ParcelModel.cs deleted file mode 100644 index a1b74f67c4..0000000000 --- a/backend/entities/Models/ParcelModel.cs +++ /dev/null @@ -1,104 +0,0 @@ -using System; -using System.Security.Claims; - -namespace Pims.Dal.Entities.Models -{ - /// - /// ParcelModel class, provides a model that represents a parcel within PIMS. - /// - public class ParcelModel : PropertyModel - { - #region Properties - #region Parcel Information - /// - /// get/set - The property identification number for Titled land. - /// - public int? PID { get; set; } - - /// - /// get - The friendly formated Parcel Id. - /// - public string ParcelIdentity { get { return this.PID > 0 ? $"{this.PID:000-000-000}" : null; } } - - /// - /// get/set - The property identification number of Crown Lands Registry that are not Titled. - /// - /// - public int? PIN { get; set; } - - /// - /// get/set - The land area. - /// - public float? LandArea { get; set; } - - /// - /// get/set - The land legal description. - /// - public string LandLegalDescription { get; set; } - - /// - /// get/set - Current Parcel zoning information - /// - public string Zoning { get; set; } - - /// - /// get/set - Potential future Parcel zoning information - /// - public string ZoningPotential { get; set; } - #endregion - - #region Financials - /// - /// get/set - The most recent assessment for the land. - /// - public decimal? AssessedLand { get; set; } - - /// - /// get/set - When the assessment was completed. - /// - public DateTime? AssessedLandDate { get; set; } - - /// - /// get/set - The most recent assessment for the buildings and improvements. - /// - public decimal? AssessedBuilding { get; set; } - - /// - /// get/set - When the assessment was completed. - /// - public DateTime? AssessedBuildingDate { get; set; } - #endregion - #endregion - - #region Constructors - /// - /// Creates a new instance of a ParcelModel object. - /// - public ParcelModel() { } - - /// - /// Creates a new instance of a ParcelModel object, initializes with specified parameters. - /// - /// - /// - public ParcelModel(Views.Property property, ClaimsPrincipal user) : base(property, user) - { - this.PropertyTypeId = property.PropertyTypeId; - this.PID = property.PID; - this.PIN = property.PIN; - this.LandLegalDescription = property.LandLegalDescription; - this.LandArea = property.LandArea; - - // The following values are conditionally removed in PropertyService.cs. - // These values are only to be included in the object if the user has the "admin-properties" claim, - // or the user belongs to the agency of the property. - this.Zoning = property.Zoning; - this.ZoningPotential = property.ZoningPotential; - this.AssessedLand = property.AssessedLand; - this.AssessedLandDate = property.AssessedLandDate; - this.AssessedBuilding = property.AssessedBuilding; - this.AssessedBuildingDate = property.AssessedBuildingDate; - } - #endregion - } -} diff --git a/backend/entities/Models/ProjectFilter.cs b/backend/entities/Models/ProjectFilter.cs deleted file mode 100644 index 4df82c4dbe..0000000000 --- a/backend/entities/Models/ProjectFilter.cs +++ /dev/null @@ -1,140 +0,0 @@ -using Pims.Core.Extensions; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Pims.Dal.Entities.Models -{ - /// - /// ProjectFilter class, provides a model for filtering project queries. - /// - public class ProjectFilter : PageFilter - { - #region Properties - /// - /// get/set - The project number. - /// - public string ProjectNumber { get; set; } - - /// - /// get/set - The project name. - /// - public string Name { get; set; } - - /// - /// get/set - The workflow Id. - /// - public int? WorkflowId { get; set; } - - /// - /// get/set - An array of status Id. - /// - public int[] StatusId { get; set; } - - /// - /// get/set - An array of status Id. - /// - public int[] NotStatusId { get; set; } - - /// - /// get/set - The project tier level. - /// - /// - public int? TierLevelId { get; set; } - - /// - /// get/set - The actual or forecasted fiscal year of the project. - /// - public int? FiscalYear { get; set; } - - /// - /// get/set - Only limit to projects created by current user. - /// - /// - public bool? CreatedByMe { get; set; } - - /// - /// get/set - Filter by workflow - SPL - /// - /// - public bool? SPLWorkflow { get; set; } - - /// - /// get/set - Only return active projects. - /// - /// - public bool? Active { get; set; } - - /// - /// get/set - An array of agencies. - /// - /// - public int[] Agencies { get; set; } - - /// - /// get/set - An array of workflow [SUBMIT-DISPOSAL, ASSESS-DISPOSAL, ASSESS-EXEMPTION, ERP, SPL]. - /// - public string[] Workflows { get; set; } - - /// - /// get/set - The spl project report that should be used to populate report data. - /// - public int? ReportId { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a ProjectFilter class. - /// - public ProjectFilter() { } - - /// - /// Creates a new instance of a ProjectFilter class, initializes it with the specified arguments. - /// Extracts the properties from the query string to generate the filter. - /// - /// - public ProjectFilter(Dictionary query) : base(query) - { - // We want case-insensitive query parameter properties. - var filter = new Dictionary(query, StringComparer.OrdinalIgnoreCase); - this.ProjectNumber = filter.GetStringValue(nameof(this.ProjectNumber)); - this.Name = filter.GetStringValue(nameof(this.Name)); - this.WorkflowId = filter.GetIntNullValue(nameof(this.WorkflowId)); - this.StatusId = filter.GetIntArrayValue("status"); - this.StatusId = filter.GetIntArrayValue(nameof(this.StatusId)); - this.NotStatusId = filter.GetIntArrayValue(nameof(this.NotStatusId)); - this.TierLevelId = filter.GetIntNullValue(nameof(this.TierLevelId)); - this.CreatedByMe = filter.GetBoolNullValue(nameof(this.CreatedByMe)); - this.SPLWorkflow = filter.GetBoolNullValue(nameof(this.SPLWorkflow)); - this.Active = filter.GetBoolNullValue(nameof(this.Active)); - this.Agencies = filter.GetIntArrayValue(nameof(this.Agencies)); - this.Workflows = filter.GetStringArrayValue(nameof(this.Workflows)); - this.ReportId = filter.GetIntNullValue(nameof(this.ReportId)); - this.FiscalYear = filter.GetIntNullValue(nameof(this.FiscalYear)); - } - #endregion - - #region Methods - /// - /// Determine if a valid filter was provided. - /// - /// - public override bool IsValid() - { - return base.IsValid() - || !String.IsNullOrWhiteSpace(this.ProjectNumber) - || !String.IsNullOrWhiteSpace(this.Name) - || this.TierLevelId.HasValue - || this.Active.HasValue - || this.SPLWorkflow.HasValue - || this.CreatedByMe.HasValue - || this.FiscalYear.HasValue - || this.WorkflowId.HasValue - || (this.StatusId?.Any() ?? false) - || (this.NotStatusId?.Any() ?? false) - || (this.Agencies?.Any() ?? false) - || (this.Workflows?.Any() ?? false); - } - #endregion - } -} diff --git a/backend/entities/Models/ProjectNotificationFilter.cs b/backend/entities/Models/ProjectNotificationFilter.cs deleted file mode 100644 index c00b8dd77b..0000000000 --- a/backend/entities/Models/ProjectNotificationFilter.cs +++ /dev/null @@ -1,92 +0,0 @@ -using Pims.Core.Extensions; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Pims.Dal.Entities.Models -{ - /// - /// ProjectNotificationFilter class, provides a model for filtering project queries. - /// - public class ProjectNotificationFilter : PageFilter - { - #region Properties - /// - /// get/set - The project number. - /// - public string ProjectNumber { get; set; } - - /// - /// get/set - The project id. - /// - public int? ProjectId { get; set; } - - /// - /// get/set - The agency id. - /// - public int? AgencyId { get; set; } - - /// - /// get/set - The tag. - /// - public string Tag { get; set; } - - /// - /// get/set - An array of status Id. - /// - public NotificationStatus[] Status { get; set; } - - /// - /// get/set - Who the notification was sent to. - /// - public string To { get; set; } - - /// - /// get/set - The subject line. - /// - public string Subject { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a ProjectNotificationFilter class. - /// - public ProjectNotificationFilter() { } - - /// - /// Creates a new instance of a ProjectNotificationFilter class, initializes it with the specified arguments. - /// Extracts the properties from the query string to generate the filter. - /// - /// - public ProjectNotificationFilter(Dictionary query) : base(query) - { - // We want case-insensitive query parameter properties. - var filter = new Dictionary(query, StringComparer.OrdinalIgnoreCase); - this.ProjectNumber = filter.GetStringValue(nameof(this.ProjectNumber)); - this.ProjectId = filter.GetIntNullValue(nameof(this.ProjectId)); - this.AgencyId = filter.GetIntNullValue(nameof(this.AgencyId)); - this.Tag = filter.GetStringValue(nameof(this.Tag)); - this.To = filter.GetStringValue(nameof(this.To)); - this.Subject = filter.GetStringValue(nameof(this.Subject)); - this.Status = filter.GetStringArrayValue(nameof(this.Status)).Select(s => (NotificationStatus)Enum.Parse(typeof(NotificationStatus), s)).ToArray(); - } - #endregion - - #region Methods - /// - /// Determine if a valid filter was provided. - /// - /// - public override bool IsValid() - { - return base.IsValid() - || !String.IsNullOrWhiteSpace(this.ProjectNumber) - || !String.IsNullOrWhiteSpace(this.To) - || !String.IsNullOrWhiteSpace(this.Tag) - || this.ProjectId.HasValue - || this.AgencyId.HasValue - || (this.Status?.Any() ?? false); - } - #endregion - } -} diff --git a/backend/entities/Models/ProjectNotificationModel.cs b/backend/entities/Models/ProjectNotificationModel.cs deleted file mode 100644 index 29f000ee5d..0000000000 --- a/backend/entities/Models/ProjectNotificationModel.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; - -namespace Pims.Dal.Entities.Models -{ - /// - /// ProjectNotificationModel class, provides a model that is used to generate notifications. - /// - public class ProjectNotificationModel - { - #region Properties - /// - /// get/set - The unique key to identify this notification. - /// - public Guid NotificationKey { get; set; } - - /// - /// get/set - The project associated with the notification. - /// - public Project Project { get; set; } - - /// - /// get/set - The agency this notification was sent to. - /// - public Agency ToAgency { get; set; } - - /// - /// get/set - The email address the notification will be sent to. - /// - public string To { get; set; } - - /// - /// get/set - Environmental variables. - /// - public EnvironmentModel Environment { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a ProjectNotificationModel. - /// - public ProjectNotificationModel() { } - - /// - /// Creates a new instance of a ProjectNotificationModel, initialize with specified arguments. - /// - /// - /// - /// - /// - /// - public ProjectNotificationModel(Guid notificationKey, EnvironmentModel environment, Project project, Agency toAgency = null, string toAddress = null) - { - this.NotificationKey = notificationKey; - this.Project = project; - this.ToAgency = toAgency; - this.Environment = environment; - this.To = toAddress; - } - #endregion - } -} diff --git a/backend/entities/Models/ProjectProperty.cs b/backend/entities/Models/ProjectProperty.cs deleted file mode 100644 index 908a254293..0000000000 --- a/backend/entities/Models/ProjectProperty.cs +++ /dev/null @@ -1,75 +0,0 @@ -namespace Pims.Dal.Entities.Models -{ - public class ProjectProperty : Views.Property - { - #region Properties - /// - /// get/set - The RAEG/SPP project status - /// - public string ProjectStatus { get; set; } - - /// - /// get/set - The RAEG/SPP project workflow - /// - public string ProjectWorkflow { get; set; } - #endregion - - #region Constructors - public ProjectProperty(Views.Property property) - { - Id = property.Id; - PropertyTypeId = property.PropertyTypeId; - Name = property.Name; - Description = property.Description; - ClassificationId = property.ClassificationId; - Classification = property.Classification; - - Agency = property.Agency; - AgencyId = property.AgencyId; - AgencyCode = property.AgencyCode; - SubAgencyCode = property.SubAgencyCode; - SubAgency = property.SubAgency; - - IsSensitive = property.IsSensitive; - IsVisibleToOtherAgencies = property.IsVisibleToOtherAgencies; - - AddressId = property.AddressId; - Address = property.Address; - AdministrativeArea = property.AdministrativeArea; - Province = property.Province; - Postal = property.Postal; - Location = property.Location; - - Market = property.Market; - MarketFiscalYear = property.MarketFiscalYear; - NetBook = property.NetBook; - NetBookFiscalYear = property.NetBookFiscalYear; - AssessedLand = property.AssessedLand; - AssessedLandDate = property.AssessedLandDate; - AssessedBuilding = property.AssessedBuilding; - AssessedBuildingDate = property.AssessedBuildingDate; - - PID = property.PID; - PIN = property.PIN; - LandArea = property.LandArea; - LandLegalDescription = property.LandLegalDescription; - Zoning = property.Zoning; - ZoningPotential = property.ZoningPotential; - ParcelId = property.ParcelId; - - BuildingConstructionTypeId = property.BuildingConstructionTypeId; - BuildingConstructionType = property.BuildingConstructionType; - BuildingFloorCount = property.BuildingFloorCount; - BuildingPredominateUseId = property.BuildingPredominateUseId; - BuildingPredominateUse = property.BuildingPredominateUse; - BuildingTenancy = property.BuildingTenancy; - RentableArea = property.RentableArea; - BuildingOccupantType = property.BuildingOccupantType; - BuildingOccupantTypeId = property.BuildingOccupantTypeId; - LeaseExpiry = property.LeaseExpiry; - OccupantName = property.OccupantName; - TransferLeaseOnSale = property.TransferLeaseOnSale; - } - #endregion - } -} diff --git a/backend/entities/Models/PropertyFilter.cs b/backend/entities/Models/PropertyFilter.cs deleted file mode 100644 index bc9ea2d30c..0000000000 --- a/backend/entities/Models/PropertyFilter.cs +++ /dev/null @@ -1,260 +0,0 @@ -using Pims.Core.Extensions; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; - -namespace Pims.Dal.Entities.Models -{ - /// - /// PropertyFilter class, provides a model for filtering property queries. - /// - public abstract class PropertyFilter : PageFilter - { - #region Properties - /// - /// get/set - Defines a rectangle region of the 2D cordinate plane. - /// - [DisplayName("bbox")] - public NetTopologySuite.Geometries.Envelope Boundary { get; set; } - - /// - /// get/set - North East Latitude. - /// - /// - public double? NELatitude { get; set; } - - /// - /// get/set - North East Longitude. - /// - /// - public double? NELongitude { get; set; } - - /// - /// get/set - South West Latitude. - /// - /// - public double? SWLatitude { get; set; } - - /// - /// get/set - South West Longitude. - /// - /// - public double? SWLongitude { get; set; } - - /// - /// get/set - The RAEG/SPP number. - /// - public string ProjectNumber { get; set; } - - /// - /// get/set - The property type - /// - public PropertyTypes? PropertyType { get; set; } - - /// - /// get/set - Flag indicating properties in projects should be ignored. - /// - /// - public bool? IgnorePropertiesInProjects { get; set; } - - /// - /// get/set - Flag indicating to show only properties that belong to a project. - /// - /// - public bool? InSurplusPropertyProgram { get; set; } - - /// - /// get/set - Flag indicating to show only properties that are in en enhanced referral program. - /// - /// - public bool? InEnhancedReferralProcess { get; set; } - - /// - /// get/set - The value of the property name. - /// - /// - public string Name { get; set; } - - /// - /// get/set - The parcelId for the property - /// - /// - public int? ParcelId { get; set; } - - /// - /// get/set - Building classification Id. - /// - /// - public int? ClassificationId { get; set; } - - /// - /// get/set - The property description. - /// - public string Description { get; set; } - - /// - /// get/set - The property address. - /// - /// - public string Address { get; set; } - - /// - /// get/set - The property administrative area (city, muncipality, district, etc.). - /// - public string AdministrativeArea { get; set; } - - /// - /// get/set - Building minimum market value. - /// - /// - public decimal? MinMarketValue { get; set; } - - /// - /// get/set - Bare land only flag - /// - /// - public bool? BareLandOnly { get; set; } - - /// - /// get/set - Rentable Area - /// - /// - public float? RentableArea { get; set; } - - /// - /// get/set - Building maximum market value. - /// - /// - public decimal? MaxMarketValue { get; set; } - - /// - /// get/set - Property minimum assessed value. - /// - /// - public decimal? MinAssessedValue { get; set; } - - /// - /// get/set - Property maximum assessed value. - /// - /// - public decimal? MaxAssessedValue { get; set; } - - /// - /// get/set - An array of agencies. - /// - /// - public int[] Agencies { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a PropertyFilter class. - /// - public PropertyFilter() { } - - /// - /// Creates a new instance of a PropertyFilter class, initializes it with the specified arguments. - /// - /// - /// - /// - /// - public PropertyFilter(double neLat, double neLong, double swLat, double swLong) - { - this.NELatitude = neLat; - this.NELongitude = neLong; - this.SWLatitude = swLat; - this.SWLongitude = swLong; - } - - /// - /// Creates a new instance of a PropertyFilter class, initializes it with the specified arguments. - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public PropertyFilter(string address, int? agencyId, int? classificationId, decimal? minMarketValue, decimal? maxMarketValue, decimal? minAssessedValue, decimal? maxAssessedValue, string[] sort) - { - this.Address = address; - this.ClassificationId = classificationId; - this.MinMarketValue = minMarketValue; - this.MaxMarketValue = maxMarketValue; - this.MinAssessedValue = minAssessedValue; - this.MaxAssessedValue = maxAssessedValue; - if (agencyId.HasValue) - this.Agencies = new[] { agencyId.Value }; - this.Sort = sort; - } - - /// - /// Creates a new instance of a PropertyFilter class, initializes it with the specified arguments. - /// Extracts the properties from the query string to generate the filter. - /// - /// - public PropertyFilter(Dictionary query) : base(query) - { - // We want case-insensitive query parameter properties. - var filter = new Dictionary(query, StringComparer.OrdinalIgnoreCase); - - this.Boundary = filter.GetEnvelopNullValue("bbox"); - this.NELatitude = filter.GetDoubleNullValue(nameof(this.NELatitude)); - this.NELongitude = filter.GetDoubleNullValue(nameof(this.NELongitude)); - this.SWLatitude = filter.GetDoubleNullValue(nameof(this.SWLatitude)); - this.SWLongitude = filter.GetDoubleNullValue(nameof(this.SWLongitude)); - - this.ProjectNumber = filter.GetStringValue(nameof(this.ProjectNumber)); - this.IgnorePropertiesInProjects = filter.GetBoolNullValue(nameof(this.IgnorePropertiesInProjects)); - this.InSurplusPropertyProgram = filter.GetBoolNullValue(nameof(this.InSurplusPropertyProgram)); - this.PropertyType = Enum.TryParse(filter.GetStringValue(nameof(this.PropertyType), null), out PropertyTypes propType) ? (PropertyTypes?)propType : null; - this.Address = filter.GetStringValue(nameof(this.Address)); - this.AdministrativeArea = filter.GetStringValue(nameof(this.AdministrativeArea)); - - this.BareLandOnly = filter.GetBoolNullValue(nameof(this.BareLandOnly)); - this.ClassificationId = filter.GetIntNullValue(nameof(this.ClassificationId)); - this.Description = filter.GetStringValue(nameof(this.Description)); - this.MinMarketValue = filter.GetDecimalNullValue(nameof(this.MinMarketValue)); - this.MaxMarketValue = filter.GetDecimalNullValue(nameof(this.MaxMarketValue)); - this.MinAssessedValue = filter.GetDecimalNullValue(nameof(this.MinAssessedValue)); - this.MaxAssessedValue = filter.GetDecimalNullValue(nameof(this.MaxAssessedValue)); - - this.Agencies = filter.GetIntArrayValue(nameof(this.Agencies)).Where(a => a != 0).ToArray(); - } - #endregion - - #region Methods - /// - /// Determine if a valid filter was provided. - /// - /// - public override bool IsValid() - { - return base.IsValid() - || this.NELatitude.HasValue - || this.NELongitude.HasValue - || this.SWLatitude.HasValue - || this.SWLongitude.HasValue - || !String.IsNullOrWhiteSpace(this.ProjectNumber) - || this.IgnorePropertiesInProjects == true - || this.InSurplusPropertyProgram == true - || !String.IsNullOrWhiteSpace(this.Address) - || !String.IsNullOrWhiteSpace(this.AdministrativeArea) - || !String.IsNullOrWhiteSpace(this.Description) - || this.MaxAssessedValue.HasValue - || this.MinAssessedValue.HasValue - || this.MinMarketValue.HasValue - || this.MaxMarketValue.HasValue - || this.BareLandOnly == true - || this.Agencies?.Any() == true - || this.PropertyType.HasValue - || this.ClassificationId.HasValue; - } - #endregion - } -} diff --git a/backend/entities/Models/PropertyModel.cs b/backend/entities/Models/PropertyModel.cs deleted file mode 100644 index 7557175de8..0000000000 --- a/backend/entities/Models/PropertyModel.cs +++ /dev/null @@ -1,211 +0,0 @@ -using System; -using System.Security.Claims; -using NetTopologySuite.Geometries; - -namespace Pims.Dal.Entities.Models -{ - /// - /// PropertyModel class, provides a model that represents a property within PIMS. - /// - public abstract class PropertyModel - { - #region Properties - #region Identification - /// - /// get/set - The primary key to identify the property within PIMS. - /// - public int Id { get; set; } - - /// - /// get/set - The type of property [Land|Building] - /// - public PropertyTypes PropertyTypeId { get; set; } - - /// - /// get/set - The name of the property. - /// - public string Name { get; set; } - - /// - /// get/set - A description of the property. - /// - public string Description { get; set; } - - /// - /// get/set - Foreign key to the property classification [Core Active|Core Strategic|Surplus Active|Surplus Encumbered|Disposed] - /// - public int ClassificationId { get; set; } - - /// - /// get/set - The classification name of the property [Core Active|Core Strategic|Surplus Active|Surplus Encumbered|Disposed] - /// - public string Classification { get; set; } - - /// - /// get/set - The SPP project number(s). - /// - public string ProjectNumbers { get; set; } - /// - /// get/set - Whether this is a sensitive property that would be harmful if visible to other agencies. - /// - public bool IsSensitive { get; set; } - - /// - /// get/set - The workflow code of this project, if in a project. - /// - public string ProjectWorkflow { get; set; } - - /// - /// get/set - The status code of this project, if in a project. - /// - public string ProjectStatus { get; set; } - - /// - /// get/set - Whether this property should be fully visible to other agencies (normally during ERP). - /// - /// - public bool IsVisibleToOtherAgencies { get; set; } - #endregion - - #region Agency - /// - /// get/set - The foreign key to the owning agency. - /// - public int? AgencyId { get; set; } - - /// - /// get/set - The agency or ministry name that owns the property. - /// - public string Agency { get; set; } - - /// - /// get/set - The code of the parent agency or ministry. - /// - /// - public string AgencyCode { get; set; } - - /// - /// get/set - The sub-agency name that owns the property. - /// - /// - public string SubAgency { get; set; } - - /// - /// get/set - The sub-agency code that owns the property. - /// - /// - public string SubAgencyCode { get; set; } - #endregion - - #region Address - /// - /// get/set - The foreign key to the address of the property. - /// - public int AddressId { get; set; } - - /// - /// get/set - The address of the property. - /// - public string Address { get; set; } - - /// - /// get/set - The administrative area (city, municipality, district, etc) for this property. - /// - public string AdministrativeArea { get; set; } - - /// - /// get/set - The address for this property. - /// - public string Province { get; set; } - - /// - /// get/set - The address for this property. - /// - public string Postal { get; set; } - - /// - /// get/set - The latitude and longitude that identifies the location of the property. - /// - public Point Location { get; set; } - - /// - /// get/set - A polygon that represents the boundary of the property. - /// - public Geometry Boundary { get; set; } - #endregion - - #region Financials - /// - /// get/set - The most recent market value. - /// - public decimal? Market { get; set; } - - /// - /// get/set - The fiscal year for the market value. - /// - public int? MarketFiscalYear { get; set; } - - /// - /// get/set - The most recent netbook value. - /// - public decimal? NetBook { get; set; } - - /// - /// get/set - The fiscal year netbook value. - /// - public int? NetBookFiscalYear { get; set; } - #endregion - #endregion - - #region Constructors - /// - /// Creates a new instance of a PropertyModel object. - /// - public PropertyModel() { } - - /// - /// Creates a new instance of a PropertyModel object, initializes with specified parameters. - /// - /// - /// - public PropertyModel(Views.Property property, ClaimsPrincipal user) - { - if (property == null) throw new ArgumentNullException(nameof(property)); - if (user == null) throw new ArgumentNullException(nameof(user)); - - this.Id = property.Id; - this.PropertyTypeId = property.PropertyTypeId; - this.ClassificationId = property.ClassificationId; - this.Classification = property.Classification; - this.IsVisibleToOtherAgencies = property.IsVisibleToOtherAgencies; - this.ProjectNumbers = property.ProjectNumbers; - - this.AddressId = property.AddressId; - this.Address = property.Address; - this.AdministrativeArea = property.AdministrativeArea; - this.Province = property.Province; - this.Postal = property.Postal; - - this.Location = property.Location; - this.Boundary = property.Boundary; - - // The following values are conditionally removed in PropertyService.cs. - // These values are only to be included in the object if the user has the "admin-properties" claim, - // or the user belongs to the agency of the property. - this.Name = property.Name; - this.Description = property.Description; - this.IsSensitive = property.IsSensitive; - this.AgencyId = property.AgencyId; - this.AgencyCode = property.AgencyCode; - this.Agency = property.Agency; - this.SubAgencyCode = property.SubAgencyCode; - this.SubAgency = property.SubAgency; - - this.Market = property.Market; - this.MarketFiscalYear = property.MarketFiscalYear; - this.NetBook = property.NetBook; - this.NetBookFiscalYear = property.NetBookFiscalYear; - } - #endregion - } -} diff --git a/backend/entities/Models/UserFilter.cs b/backend/entities/Models/UserFilter.cs deleted file mode 100644 index 379bd68fa9..0000000000 --- a/backend/entities/Models/UserFilter.cs +++ /dev/null @@ -1,158 +0,0 @@ -using Pims.Core.Extensions; -using System; -using System.Collections.Generic; - -namespace Pims.Dal.Entities.Models -{ - /// - /// UserFilter class, provides a model for filtering user queries. - /// - public class UserFilter - { - #region Properties - /// - /// get/set - The page number. - /// - /// - public int Page { get; set; } = 1; - - /// - /// get/set - The quantity to return in each page. - /// - /// - public int Quantity { get; set; } = 10; - - /// - /// get/set - The username. - /// - /// - public string Username { get; set; } - - /// - /// get/set - The user display name. - /// - /// - public string DisplayName { get; set; } - - /// - /// get/set - The user last name. - /// - /// - public string LastName { get; set; } - - /// - /// get/set - The user first name. - /// - /// - public string FirstName { get; set; } - - /// - /// get/set - The user email. - /// - /// - public string Email { get; set; } - - /// - /// get/set - agency name. - /// - /// - public String Agency { get; set; } - - /// - /// get/set - role name. - /// - /// - public String Role { get; set; } - - /// - /// get/set - position. - /// - /// - public String Position { get; set; } - - /// - /// get/set - account status - /// - /// - public bool? IsDisabled { get; set; } - - /// - /// get/set - An array of sorting conditions (i.e. FirstName desc, LastName asc) - /// - /// - public string[] Sort { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a UserFilter class. - /// - public UserFilter() { } - - /// - /// Creates a new instance of a UserFilter class, initializes it with the specified arguments. - /// - /// - /// - public UserFilter(int page, int quantity) - { - this.Page = page; - this.Quantity = quantity; - } - - /// - /// Creates a new instance of a UserFilter class, initializes it with the specified arguments. - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public UserFilter(int page, int quantity, String agency, string username, string displayName, string lastName, - string firstName, string email, bool? isDisabled, string position, string role, string[] sort) : this(page, quantity) - { - this.Agency = agency; - this.Username = username; - this.DisplayName = displayName; - this.LastName = lastName; - this.FirstName = firstName; - this.Email = email; - this.IsDisabled = isDisabled; - this.Position = position; - this.Role = role; - this.Sort = sort; - } - - /// - /// Creates a new instance of a UserFilter class, initializes it with the specified arguments. - /// Extracts the properties from the query string to generate the filter. - /// - /// - public UserFilter(Dictionary query) - { - // We want case-insensitive query parameter properties. - var filter = new Dictionary(query, StringComparer.OrdinalIgnoreCase); - this.Page = filter.GetIntValue(nameof(this.Page), 1); - this.Quantity = filter.GetIntValue(nameof(this.Quantity), 10); - this.Username = filter.GetStringValue(nameof(this.Username)); - this.DisplayName = filter.GetStringValue(nameof(this.DisplayName)); - this.LastName = filter.GetStringValue(nameof(this.LastName)); - this.FirstName = filter.GetStringValue(nameof(this.FirstName)); - this.Email = filter.GetStringValue(nameof(this.Email)); - this.Agency = filter.GetStringValue(nameof(this.Agency)); - this.Position = filter.GetStringValue(nameof(this.Position)); - this.Role = filter.GetStringValue(nameof(this.Role)); - this.IsDisabled = filter.GetValue(nameof(this.IsDisabled)); - this.Sort = filter.GetStringArrayValue(nameof(this.Sort)); - } - #endregion - } -} diff --git a/backend/entities/NoteTypes.cs b/backend/entities/NoteTypes.cs deleted file mode 100644 index 46d214a786..0000000000 --- a/backend/entities/NoteTypes.cs +++ /dev/null @@ -1,101 +0,0 @@ -namespace Pims.Dal.Entities -{ - /// - /// NoteTypes enum, provides note type options. - /// - public enum NoteTypes - { - /// - /// General default notes. - /// - General = 0, - /// - /// Publically shared notes. - /// - Public = 1, - /// - /// Private notes only visible to SRES. - /// - Private = 2, - /// - /// Exception notes. - /// - Exemption = 3, - /// - /// ERP agency interest notes. - /// - AgencyInterest = 4, - /// - /// Financial notes. - /// - Financial = 5, - /// - /// Pre-marketing notes for SPL. - /// - PreMarketing = 6, - /// - /// Marketing notes for SPL. - /// - Marketing = 7, - /// - /// Contract in place notes for SPL. - /// - ContractInPlace = 8, - /// - /// Notes to include in reports. - /// - Reporting = 9, - /// - /// Loan term notes. - /// - LoanTerms = 10, - /// - /// Adjustment notes. - /// - Adjustment = 11, - /// - /// SPL program cost notes. - /// - SplCost = 12, - /// - /// SPL gain or loss notes. - /// - SplGain = 13, - /// - /// Sales history notes. - /// - SalesHistory = 14, - /// - /// Close out form notes. - /// - CloseOut = 15, - /// - /// General comments. - /// - Comments = 16, - /// - /// Appraisal note. - /// - Appraisal = 17, - /// - /// A purchaser has made an offer. - /// - Offer = 18, - /// - /// A disposed project remediation note. - /// - Remediation = 19, - /// - /// Rational for being removed from SPL. - /// - SplRemoval = 20, - /// - /// Notes related to the provided documentation. - /// - Documentation = 21, - /// - /// Notes displayed on ERP notifications. - /// - ErpNotification = 22 - } -} diff --git a/backend/entities/NotificationAudiences.cs b/backend/entities/NotificationAudiences.cs deleted file mode 100644 index d0a7b553eb..0000000000 --- a/backend/entities/NotificationAudiences.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace Pims.Dal.Entities -{ - /// - /// NotificationAudiences enum, provides notification audience options. - /// - public enum NotificationAudiences - { - /// - /// Notifications are sent to the `NotificationTemplate.To` addresses. - /// - Default = 0, - /// - /// Notifications are sent to all agencies that have emails enabled and haven't opted out. - /// - Agencies = 1, - /// - /// Notifications are sent to only parent agencies that have emails enabled and havne't opted out. - /// - ParentAgencies = 2, - /// - /// Notifications are sent to the owning agency. - /// - OwningAgency = 3, - /// - /// Agencies that have shown interest in the project. - /// - WatchingAgencies = 4, - /// - /// Notifications are sent to the owner of the project. - /// - ProjectOwner = 5, - } -} diff --git a/backend/entities/NotificationBodyTypes.cs b/backend/entities/NotificationBodyTypes.cs deleted file mode 100644 index 5b7ff0058b..0000000000 --- a/backend/entities/NotificationBodyTypes.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Pims.Dal.Entities -{ - /// - /// NotificationBodyTypes enum, provides notification body type options. - /// - public enum NotificationBodyTypes - { - Html = 0, - Text = 1 - } -} diff --git a/backend/entities/NotificationDelays.cs b/backend/entities/NotificationDelays.cs deleted file mode 100644 index 59ad017d81..0000000000 --- a/backend/entities/NotificationDelays.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Pims.Dal.Entities -{ - /// - /// NotificationDelays enum, provides notification delaying options. - /// - public enum NotificationDelays - { - None = 0, - EndOfDay = 1, - EndOfMonth = 2, - Days = 3, - SetDate = 4 - } -} diff --git a/backend/entities/NotificationEncodings.cs b/backend/entities/NotificationEncodings.cs deleted file mode 100644 index 9b0bd59345..0000000000 --- a/backend/entities/NotificationEncodings.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Pims.Core.Json; - -namespace Pims.Dal.Entities -{ - /// - /// NotificationEncodings enum, provides notification encoding options. - /// - public enum NotificationEncodings - { - [EnumValue("utf-8")] - Utf8 = 0, - Base64 = 1, - Binary = 2, - Hex = 3 - } -} diff --git a/backend/entities/NotificationPriorities.cs b/backend/entities/NotificationPriorities.cs deleted file mode 100644 index cac9932770..0000000000 --- a/backend/entities/NotificationPriorities.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Pims.Dal.Entities -{ - /// - /// NotificationPriorities enum, provides notification priority options. - /// - public enum NotificationPriorities - { - Low = 0, - Normal = 1, - High = 2 - } -} diff --git a/backend/entities/NotificationQueue.cs b/backend/entities/NotificationQueue.cs deleted file mode 100644 index ee41e4db65..0000000000 --- a/backend/entities/NotificationQueue.cs +++ /dev/null @@ -1,230 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Dal.Entities -{ - /// - /// NotificationQueue class, provides an entity for the datamodel to manage a notification queue. - /// - public class NotificationQueue : BaseEntity - { - #region Properties - /// - /// get/set - Primary key unique identity for notification template. - /// - public int Id { get; set; } - - /// - /// get/set - A unique key to identify this notification when recipients respond. - /// - public Guid Key { get; set; } - - /// - /// get/set - The status of the notification [accepted, pending, cancelled, failed, completed]. - /// - public NotificationStatus Status { get; set; } = NotificationStatus.Pending; - - /// - /// get/set - The priority of the notification [low, normal, high]. - /// - public NotificationPriorities Priority { get; set; } = NotificationPriorities.Normal; - - /// - /// get/set - The notification encoding [base64, binary, hex, utf-8]. - /// - public NotificationEncodings Encoding { get; set; } = NotificationEncodings.Utf8; - - /// - /// get/set - The date the notification should be sent on. - /// - public DateTime SendOn { get; set; } - - /// - /// get/set - Semi-colon separated list of email addresses that the notification will be sent to. - /// - public string To { get; set; } - - /// - /// get/set - The notification subject line. - /// - public string Subject { get; set; } - - /// - /// get/set - The body type of the notification [html, text]. - /// - public NotificationBodyTypes BodyType { get; set; } = NotificationBodyTypes.Html; - - /// - /// get/set - The notification body message. - /// - public string Body { get; set; } - - /// - /// get/set - Semi-colon separated list of email addresses that the notification will be blind-copied to. - /// - public string Bcc { get; set; } - - /// - /// get/set - Semi-colon separated list of email addresses that the notification will be carbon-copied to. - /// - public string Cc { get; set; } - - /// - /// get/set - A tag to group related notifications. - /// - public string Tag { get; set; } - - /// - /// get/set - Foreign key to the project this notification is related to. - /// - public int? ProjectId { get; set; } - - /// - /// get/set - The project this notification is related to. - /// - public Project Project { get; set; } - - /// - /// get/set - Foreign key to the agency this notification was sent to. - /// - public int? ToAgencyId { get; set; } - - /// - /// get/set - The agency this notification was sent to. - /// - public Agency ToAgency { get; set; } - - /// - /// get/set - Foreign key to the template that generated this notification. - /// - public int? TemplateId { get; set; } - - /// - /// get/set - The notification template that generated this notification. - /// - public NotificationTemplate Template { get; set; } - - /// - /// get/set - CHES message Id. - /// - public Guid? ChesMessageId { get; set; } - - /// - /// get/set - CHES transaction Id. - /// - public Guid? ChesTransactionId { get; set; } - - /// - /// get - A collection of responses to this notification. - /// - public ICollection Responses { get; } = new List(); - #endregion - - #region Constructors - /// - /// Create a new instance of a NotificationQueue class. - /// - public NotificationQueue() { } - - /// - /// Create a new instance of a NotificationQueue class, initializes with specified parameters. - /// - /// - /// - /// - /// - /// - public NotificationQueue(NotificationTemplate template, Project project, string to, string subject, string body) - { - if (String.IsNullOrWhiteSpace(to)) throw new ArgumentException("Argument is required and cannot be null, empty or whitespace.", nameof(to)); - if (String.IsNullOrWhiteSpace(subject)) throw new ArgumentException("Argument is required and cannot be null, empty or whitespace.", nameof(subject)); - if (String.IsNullOrWhiteSpace(body)) throw new ArgumentException("Argument is required and cannot be null, empty or whitespace.", nameof(body)); - - this.Key = Guid.NewGuid(); - this.TemplateId = template?.Id ?? throw new ArgumentNullException(nameof(template)); - this.Template = template; - this.Subject = subject; - this.Body = body; - this.BodyType = template.BodyType; - this.Encoding = template.Encoding; - this.Priority = template.Priority; - this.ProjectId = project?.Id; - this.Project = project; - this.To = to; - this.SendOn = DateTime.UtcNow; - this.Tag = template.Tag; - } - - /// - /// Create a new instance of a NotificationQueue class, initializes with specified parameters. - /// - /// - /// - /// - /// - /// - public NotificationQueue(NotificationTemplate template, Project project, Agency toAgency, string subject, string body) - { - if (String.IsNullOrWhiteSpace(subject)) throw new ArgumentException("Argument is required and cannot be null, empty or whitespace.", nameof(subject)); - if (String.IsNullOrWhiteSpace(body)) throw new ArgumentException("Argument is required and cannot be null, empty or whitespace.", nameof(body)); - - this.Key = Guid.NewGuid(); - this.TemplateId = template?.Id ?? throw new ArgumentNullException(nameof(template)); - this.Template = template; - this.Subject = subject; - this.Body = body; - this.BodyType = template.BodyType; - this.Encoding = template.Encoding; - this.Priority = template.Priority; - this.ProjectId = project?.Id; - this.Project = project; - this.ToAgencyId = toAgency?.Id; - this.ToAgency = toAgency; - this.To = toAgency?.Email; - this.SendOn = DateTime.UtcNow; - this.Tag = template.Tag; - } - - /// - /// Create a new instance of a NotificationQueue class, initializes with specified parameters. - /// - /// - /// - /// - /// - public NotificationQueue(NotificationTemplate template, string to, string subject, string body) : this(template, to, null, null, subject, body) - { - } - - /// - /// Create a new instance of a NotificationQueue class, initializes with specified parameters. - /// - /// - /// - /// - /// - /// - /// - public NotificationQueue(NotificationTemplate template, string to, string cc, string bcc, string subject, string body) - { - if (String.IsNullOrWhiteSpace(to)) throw new ArgumentException("Argument is required and cannot be null, empty or whitespace.", nameof(to)); - if (String.IsNullOrWhiteSpace(subject)) throw new ArgumentException("Argument is required and cannot be null, empty or whitespace.", nameof(subject)); - if (String.IsNullOrWhiteSpace(body)) throw new ArgumentException("Argument is required and cannot be null, empty or whitespace.", nameof(body)); - - this.Key = Guid.NewGuid(); - this.TemplateId = template?.Id ?? throw new ArgumentNullException(nameof(template)); - this.Template = template; - this.To = to; - this.Cc = cc; - this.Bcc = bcc; - this.Subject = subject; - this.Body = body; - this.BodyType = template.BodyType; - this.Encoding = template.Encoding; - this.Priority = template.Priority; - this.SendOn = DateTime.UtcNow; - this.Tag = template.Tag; - } - #endregion - } -} diff --git a/backend/entities/NotificationResponses.cs b/backend/entities/NotificationResponses.cs deleted file mode 100644 index ccb3fd1d30..0000000000 --- a/backend/entities/NotificationResponses.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Pims.Dal.Entities -{ - /// - /// NotificationResponses enum, provides the notification response options. - /// - public enum NotificationResponses - { - /// - /// Agency does not want to receive notifications. - /// - Unsubscribe = 0, - /// - /// Agency wants to receive notifications. - /// - Subscribe = 1, - /// - /// Agency does not want to receive notifications, but is interested in watching the project. - /// - Watch = 2 - } -} diff --git a/backend/entities/NotificationStatus.cs b/backend/entities/NotificationStatus.cs deleted file mode 100644 index 66896a3505..0000000000 --- a/backend/entities/NotificationStatus.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Pims.Dal.Entities -{ - /// - /// NotificationStatus enum, provides notification status options. - /// - public enum NotificationStatus - { - Accepted = 0, - Pending = 1, - Cancelled = 2, - Failed = 3, - Completed = 4 - } -} diff --git a/backend/entities/NotificationTemplate.cs b/backend/entities/NotificationTemplate.cs deleted file mode 100644 index a34c848eb8..0000000000 --- a/backend/entities/NotificationTemplate.cs +++ /dev/null @@ -1,134 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Dal.Entities -{ - /// - /// NotificationTemplate class, provides an entity for the datamodel to manage a notification templates. - /// - public class NotificationTemplate : BaseEntity - { - #region Properties - /// - /// get/set - Primary key unique identity for notification template. - /// - public int Id { get; set; } - - /// - /// get/set - A unique name to identify the template. - /// - public string Name { get; set; } - - /// - /// get/set - A description of the template. - /// - public string Description { get; set; } - - /// - /// get/set - A semi-colon separated list of email addresses this notification will be sent to. - /// - public string To { get; set; } - - /// - /// get/set - A semi-colon separated list of email addresses this notification will be carbon-copied to. - /// - public string Cc { get; set; } - - /// - /// get/set - A semi-colon separated list of email addresses this notification will be blind carbon-copied to. - /// - public string Bcc { get; set; } - - /// - /// get/set - The audience for this notification template. - /// - public NotificationAudiences Audience { get; set; } = NotificationAudiences.Default; - - /// - /// get/set - The notification encoding [base64, binary, hex, utf-8]. - /// - public NotificationEncodings Encoding { get; set; } = NotificationEncodings.Utf8; - - /// - /// get/set - The notification body type [html, text]. - /// - public NotificationBodyTypes BodyType { get; set; } = NotificationBodyTypes.Html; - - /// - /// get/set - The notification priority [low, normal, high] - /// - public NotificationPriorities Priority { get; set; } = NotificationPriorities.Normal; - - /// - /// get/set - The subject line of the notification (supports variables). - /// - public string Subject { get; set; } - - /// - /// get/set - The body of the notification (supports variables). - /// - public string Body { get; set; } - - /// - /// get/set - Whether this template is disabled. - /// - public bool IsDisabled { get; set; } - - /// - /// get/set - A way to group notifications within CHES. - /// - public string Tag { get; set; } - - /// - /// get - A collection of project status that reference this template. - /// - public ICollection Status { get; } = new List(); - - /// - /// get - A collection of notifications in the queue that used this template. - /// - public ICollection Notifications { get; } = new List(); - #endregion - - #region Constructors - /// - /// Create a new instance of a NotificationTemplate class. - /// - public NotificationTemplate() { } - - /// - /// Create a new instance of a NotificationTemplate class. - /// - /// - /// - /// - public NotificationTemplate(string name, string subject, string body) - { - if (String.IsNullOrWhiteSpace(name)) throw new ArgumentException("Argument is required and cannot be null, empty or whitespace.", nameof(name)); - - this.Name = name; - this.Subject = subject; - this.Body = body; - } - - /// - /// Create a new instance of a NotificationTemplate class. - /// - /// - /// - /// - /// - /// - public NotificationTemplate(string name, NotificationEncodings encoding, NotificationBodyTypes bodyType, string subject, string body) - { - if (String.IsNullOrWhiteSpace(name)) throw new ArgumentException("Argument is required and cannot be null, empty or whitespace.", nameof(name)); - - this.Name = name; - this.Encoding = encoding; - this.BodyType = bodyType; - this.Subject = subject; - this.Body = body; - } - #endregion - } -} diff --git a/backend/entities/Parcel.cs b/backend/entities/Parcel.cs deleted file mode 100644 index 1c6c4d1a1a..0000000000 --- a/backend/entities/Parcel.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Pims.Dal.Entities -{ - /// - /// Parcel class, provides an entity for the datamodel to manage parcels. - /// - public class Parcel : Property - { - #region Properties - /// - /// get/set - The property identification number for Titled land. - /// - public int PID { get; set; } - - /// - /// get - The friendly formated Parcel Id. - /// - [NotMapped] - public string ParcelIdentity { get { return this.PID > 0 ? $"{this.PID:000-000-000}" : null; } } - - /// - /// get/set - The property identification number of Crown Lands Registry that are not Titled. - /// - /// - public int? PIN { get; set; } - - /// - /// get/set - The land area. - /// - public float LandArea { get; set; } - - /// - /// get/set - The land legal description. - /// - public string LandLegalDescription { get; set; } - - /// - /// get/set - Current Parcel zoning information - /// - public string Zoning { get; set; } - - /// - /// get/set - Potential future Parcel zoning information - /// - public string ZoningPotential { get; set; } - - /// - /// get/set - Provides a way to identify parcels that are not owned by the agency. - /// - public bool NotOwned { get; set; } - - /// - /// get/set - A collection of buildings on this parcel. - /// - /// - public ICollection Buildings { get; } = new List(); - - /// - /// get - A collection of evaluations for this parcel. - /// - /// - public ICollection Evaluations { get; } = new List(); - - /// - /// get - A collection of fiscal values for this parcel. - /// - /// - public ICollection Fiscals { get; } = new List(); - - /// - /// get - A collection of projects this parcel is assocated to. - /// - public ICollection Projects { get; } = new List(); - - /// - /// get/set - A collection of parcels associated to this subdivision (empty if this parcel is not a subdivision). - /// - /// - public ICollection Parcels { get; } = new List(); - - /// - /// get/set - A collection of subdivisions associated to this parcel (empty if this parcel is not subdivided). - /// - /// - public ICollection Subdivisions { get; } = new List(); - #endregion - - #region Constructors - /// - /// Create a new instance of a Parcel class. - /// - public Parcel() { } - - /// - /// Create a new instance of a Parcel class. - /// - /// - /// - /// - public Parcel(int pid, double latitude, double longitude) : base(latitude, longitude) - { - this.PID = pid; - } - #endregion - } -} diff --git a/backend/entities/ParcelBuildings.cs b/backend/entities/ParcelBuildings.cs deleted file mode 100644 index 0877fb6ae8..0000000000 --- a/backend/entities/ParcelBuildings.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// ParcelBuilding class, provides the many-to-many relationship between parcels and buildings. - /// - public class ParcelBuilding : BaseEntity - { - #region Properties - /// - /// get/set - Primary key: The foreign key to the parcel. - /// - public int ParcelId { get; set; } - - /// - /// get/set - The parcel that the building is located on. - /// - public Parcel Parcel { get; set; } - - /// - /// get/set - Primary key: The foreign key to the building. - /// - public int BuildingId { get; set; } - - /// - /// get/set - The building located on the parcel. - /// - public Building Building { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a ParcelBuilding object. - /// - public ParcelBuilding() { } - - /// - /// Creates a new instance of a ParcelBuilding object, initializes with specified arguments. - /// - /// - /// - public ParcelBuilding(Parcel parcel, Building building) - { - this.ParcelId = parcel?.Id ?? throw new ArgumentNullException(nameof(parcel)); - this.Parcel = parcel; - this.BuildingId = building?.Id ?? throw new ArgumentNullException(nameof(building)); - this.Building = building; - } - #endregion - } -} diff --git a/backend/entities/ParcelEvaluation.cs b/backend/entities/ParcelEvaluation.cs deleted file mode 100644 index e88201c2cb..0000000000 --- a/backend/entities/ParcelEvaluation.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// ParcelEvaluation class, provides an entity to map parcel evaluation values to a date. - /// - public class ParcelEvaluation : BaseEntity - { - #region Properties - - /// - /// get/set - The primary key and the foreign key to the parcel. - /// - /// - public int ParcelId { get; set; } - - /// - /// get/set - The parcel. - /// - /// - public Parcel Parcel { get; set; } - - /// - /// get/set - The primary key and the date the evaluation is for. - /// - /// - public DateTime Date { get; set; } - - /// - /// get/set - the firm that performed this evaluation. - /// - /// - public string Firm { get; set; } - - /// - /// get/set - The key for this fiscal value. - /// - /// - public EvaluationKeys Key { get; set; } - - /// - /// get/set - The value of the fiscal key for this parcel. - /// - /// - public decimal Value { get; set; } - - /// - /// get/set - A note related to this fiscal value. - /// - /// - public string Note { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a ParcelEvaluation class. - /// - public ParcelEvaluation() { } - - /// - /// Creates a new instance of a ParcelEvaluation class, initializes it with the specified arguments. - /// - /// - /// - /// - /// - public ParcelEvaluation(Parcel parcel, DateTime date, EvaluationKeys key, decimal value) - { - this.ParcelId = parcel?.Id ?? - throw new ArgumentNullException(nameof(parcel)); - this.Parcel = parcel; - this.Date = date; - this.Key = key; - this.Value = value; - } - #endregion - } -} diff --git a/backend/entities/ParcelFiscal.cs b/backend/entities/ParcelFiscal.cs deleted file mode 100644 index 44a7ec138d..0000000000 --- a/backend/entities/ParcelFiscal.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// ParcelFiscal class, provides an entity to map values to a fiscal year. - /// - public class ParcelFiscal : BaseEntity - { - #region Properties - /// - /// get/set - The primary key and the foreign key to the parcel. - /// - /// - public int ParcelId { get; set; } - - /// - /// get/set - The parcel. - /// - /// - public Parcel Parcel { get; set; } - - /// - /// get/set - The primary key and the fiscal year the evaluation is for. - /// - /// - public int FiscalYear { get; set; } - - /// - /// get/set - The effective date of this fiscal value - /// - /// - public DateTime? EffectiveDate { get; set; } - - /// - /// get/set - The key for this fiscal value. - /// - /// - public FiscalKeys Key { get; set; } - - /// - /// get/set - The value of the fiscal key for this parcel. - /// - /// - public decimal Value { get; set; } - - /// - /// get/set - A note related to this fiscal value. - /// - /// - public string Note { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a ParcelFiscal class. - /// - public ParcelFiscal() { } - - /// - /// Creates a new instance of a ParcelFiscal class, initializes it with the specified arguments. - /// - /// - /// - /// - /// - public ParcelFiscal(Parcel parcel, int fiscalYear, FiscalKeys key, decimal value) - { - this.ParcelId = parcel?.Id ?? - throw new ArgumentNullException(nameof(parcel)); - this.Parcel = parcel; - this.FiscalYear = fiscalYear; - this.Key = key; - this.Value = value; - } - #endregion - } -} diff --git a/backend/entities/ParcelParcel.cs b/backend/entities/ParcelParcel.cs deleted file mode 100644 index ec5d3bba3e..0000000000 --- a/backend/entities/ParcelParcel.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// ParcelParcels class, provides the many-to-many relationship between parcels and parcels (generally for subdivisions). - /// - public class ParcelParcel : BaseEntity - { - #region Properties - /// - /// get/set - Primary key: The foreign key to the parcel. - /// - public int ParcelId { get; set; } - - /// - /// get/set - The parcel that the subdivision is located on. - /// - public virtual Parcel Parcel { get; set; } - - /// - /// get/set - Primary key: The foreign key to the subdivision parcel. - /// - public int SubdivisionId { get; set; } - - /// - /// get/set - The subdivision located on the parcel. - /// - public virtual Parcel Subdivision { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a ParcelParcels object. - /// - public ParcelParcel() { } - - /// - /// Creates a new instance of a ParcelParcels object, initializes with specified arguments. - /// - /// - /// - public ParcelParcel(Parcel parcel, Parcel subdivision) - { - this.ParcelId = parcel?.Id ?? throw new ArgumentNullException(nameof(parcel)); - this.Parcel = parcel; - this.SubdivisionId = subdivision?.Id ?? throw new ArgumentNullException(nameof(subdivision)); - this.Subdivision = subdivision; - } - #endregion - } -} diff --git a/backend/entities/Pims.Dal.Entities.csproj b/backend/entities/Pims.Dal.Entities.csproj deleted file mode 100644 index 552b454c11..0000000000 --- a/backend/entities/Pims.Dal.Entities.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - net7.0 - Library - 1.0.0.0 - 1.0.0.0 - 1C724CD5-CD24-46CD-835A-A83F673F97B5 - - - - - - - - - - - - diff --git a/backend/entities/Project.cs b/backend/entities/Project.cs deleted file mode 100644 index 302f57dc97..0000000000 --- a/backend/entities/Project.cs +++ /dev/null @@ -1,239 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Dal.Entities -{ - /// - /// Project class, provides an entity for the datamodel to manage projects. - /// - public class Project : BaseEntity - { - #region Properties - #region Identification - /// - /// get/set - The primary key provides a unique identity for the project. - /// - public int Id { get; set; } - - /// - /// get/set - A unique identity for the project. - /// - public string ProjectNumber { get; set; } - - /// - /// get/set - The type of project this is. - /// - public ProjectTypes ProjectType { get; set; } - - /// - /// get/set - A display name to identify the project. - /// - public string Name { get; set; } - - /// - /// get/set - A description of the project. - /// - public string Description { get; set; } - - /// - /// get/set - The reported fiscal year this project. - /// - public int ReportedFiscalYear { get; set; } - - /// - /// get/set - The actual or forecasted fiscal year. - /// - public int ActualFiscalYear { get; set; } - #endregion - - #region Owning agency - /// - /// get/set - The foreign key to the owning agency. - /// - public int AgencyId { get; set; } - - /// - /// get/set - The owning agency. - /// - public Agency Agency { get; set; } - - /// - /// get/set - The project manager name(s). - /// - public string Manager { get; set; } - #endregion - - #region Tier - /// - /// get/set - The foreign key to the tier level. - /// - public int TierLevelId { get; set; } - - /// - /// get/set - The tier level. - /// - public TierLevel TierLevel { get; set; } - #endregion - - #region Risk - /// - /// get/set - Foreign key to the risk level of the project. - /// - public int RiskId { get; set; } - - /// - /// get/set - The risk level of the project. - /// - public ProjectRisk Risk { get; set; } - #endregion - - #region workflow and status - /// - /// get/set - Foreign key to the current workflow the project is in. - /// - public int? WorkflowId { get; set; } - - /// - /// get/set - The current workflow the project is in. - /// - public Workflow Workflow { get; set; } - - /// - /// get/set - The foreign key to the project status. - /// - public int StatusId { get; set; } - - /// - /// get/set - The project status. - /// - public ProjectStatus Status { get; set; } - #endregion - - /// - /// get/set - Additional serialized metadata. - /// - public string Metadata { get; set; } - - #region Dates - /// - /// get/set - When the project was submitted. - /// - public DateTime? SubmittedOn { get; set; } - - /// - /// get/set - When the project was approved. - /// - public DateTime? ApprovedOn { get; set; } - - /// - /// get/set - When the project was denied. - /// - public DateTime? DeniedOn { get; set; } - - /// - /// get/set - When the project was cancelled. - /// - public DateTime? CancelledOn { get; set; } - - /// - /// get/set - When the project was completed. - /// - /// - public DateTime? CompletedOn { get; set; } - #endregion - - #region Financials - /// - /// get/set - The net book value. - /// - public decimal? NetBook { get; set; } - - /// - /// get/set - The market value. - /// - public decimal? Market { get; set; } - - /// - /// get/set - The assessed value. - /// - public decimal? Assessed { get; set; } - - /// - /// get/set - The appraised value. - /// - public decimal? Appraised { get; set; } - #endregion - - /// - /// get - A collection of properties associated to this project. - /// - public ICollection Properties { get; } = new List(); - - /// - /// get - A collection of tasks associated to this project. - /// - public ICollection Tasks { get; } = new List(); - - /// - /// get - A collection of responses from notifications for this project. - /// - public ICollection Responses { get; } = new List(); - - /// - /// get - A collection of notifications sent for this project. - /// - public ICollection Notifications { get; } = new List(); - - /// - /// get - A collection of notes for this project. - /// - public ICollection Notes { get; } = new List(); - - /// - /// get - A collection of snapshots of this project. - /// - public ICollection Snapshots { get; } = new List(); - - /// - /// get - A collection of project history status transitions. - /// - public ICollection StatusHistory { get; } = new List(); - #endregion - - #region Constructors - /// - /// Create a new instance of a Project class. - /// - public Project() { } - - /// - /// Create a new instance of a Project class, initializes with specified arguments - /// - /// - /// - /// - public Project(string projectNumber, string name, TierLevel tierLevel) - { - if (String.IsNullOrWhiteSpace(projectNumber)) throw new ArgumentException("Argument cannot be null, empty or whitespace.", nameof(projectNumber)); - if (String.IsNullOrWhiteSpace(name)) throw new ArgumentException("Argument cannot be null, empty or whitespace.", nameof(name)); - - this.ProjectNumber = projectNumber; - this.Name = name; - this.TierLevelId = tierLevel?.Id ?? throw new ArgumentNullException(nameof(tierLevel)); - this.TierLevel = tierLevel; - } - - /// - /// Create a new instance of a Project class, initializes with specified arguments - /// - /// - /// - /// - /// - public Project(ProjectTypes type, string projectNumber, string name, TierLevel tierLevel) : this(projectNumber, name, tierLevel) - { - this.ProjectType = type; - } - #endregion - } -} diff --git a/backend/entities/ProjectAgencyResponse.cs b/backend/entities/ProjectAgencyResponse.cs deleted file mode 100644 index cb7bcc3a4f..0000000000 --- a/backend/entities/ProjectAgencyResponse.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// ProjectAgencyResponse class, provides an entity for the datamodel to manage a responses from agencies on specific projects. - /// - public class ProjectAgencyResponse : BaseEntity - { - #region Properties - /// - /// get/set - Primary key and foreign key to the project. - /// - public int ProjectId { get; set; } - - /// - /// get/set - The project this response is for. - /// - public Project Project { get; set; } - - /// - /// get/set - Primary key and foreign key to the agency responding.. - /// - public int AgencyId { get; set; } - - /// - /// get/set - The agency who responded. - /// - public Agency Agency { get; set; } - - /// - /// get/set - amount offered by an agency for the project. - /// - public decimal OfferAmount { get; set; } - - /// - /// get/set - Foreign key to the notification queue. - /// - public int? NotificationId { get; set; } - - /// - /// get/set - The notification queue. - /// - public NotificationQueue Notification { get; set; } - - /// - /// get/set - The agencies response to the project [ignore, watch]. - /// - public NotificationResponses Response { get; set; } - - /// - /// get/set - The date SRES received a business case from this agency. - /// - public DateTime? ReceivedOn { get; set; } - - /// - /// get/set - An agency specific note viewable/editable by SRES only. - /// - public string Note { get; set; } - #endregion - - #region Constructors - /// - /// Create a new instance of a ProjectAgencyResponse class. - /// - public ProjectAgencyResponse() { } - - /// - /// Create a new instance of a ProjectAgencyResponse class, initializes with specified arguments. - /// - /// - /// - /// - /// - /// - public ProjectAgencyResponse(Project project, Agency agency, NotificationQueue notification, NotificationResponses response, DateTime? receivedOn = null) - : this(project, agency, response, receivedOn) - { - this.NotificationId = notification?.Id ?? throw new ArgumentNullException(nameof(notification)); - this.Notification = notification; - } - - /// - /// Create a new instance of a ProjectAgencyResponse class, initializes with specified arguments. - /// - /// - /// - /// - /// - public ProjectAgencyResponse(Project project, Agency agency, NotificationResponses response, DateTime? receivedOn = null) - { - this.ProjectId = project?.Id ?? throw new ArgumentNullException(nameof(project)); - this.Project = project; - this.AgencyId = agency?.Id ?? throw new ArgumentNullException(nameof(agency)); - this.Agency = agency; - this.Response = response; - this.ReceivedOn = receivedOn ?? DateTime.UtcNow; - } - #endregion - } -} diff --git a/backend/entities/ProjectNote.cs b/backend/entities/ProjectNote.cs deleted file mode 100644 index 54b969ef40..0000000000 --- a/backend/entities/ProjectNote.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// ProjectNote class, provides an entity for the datamodel to manage project notes. - /// - public class ProjectNote : BaseEntity - { - #region Properties - /// - /// get/set - Primary key identity insert. - /// - public int Id { get; set; } - - /// - /// get/set - Foreign key to the owning project. - /// - public int ProjectId { get; set; } - - /// - /// get/set - the project that this note belongs to. - /// - public Project Project { get; set; } - - /// - /// get/set - The type of note. - /// - public NoteTypes NoteType { get; set; } - - /// - /// get/set - The note. - /// - public string Note { get; set; } - #endregion - - #region Constructors - /// - /// Create a new instance of a ProjectNote class. - /// - public ProjectNote() { } - - /// - /// Create a new instance of a ProjectNote class, initializes with specified arguments. - /// - /// - /// - /// - public ProjectNote(Project project, NoteTypes type, string note) - { - this.Note = note ?? throw new ArgumentNullException(nameof(project)); - this.NoteType = type; - this.ProjectId = project?.Id ?? throw new ArgumentNullException(nameof(project)); - this.Project = project; - } - #endregion - } -} diff --git a/backend/entities/ProjectNumber.cs b/backend/entities/ProjectNumber.cs deleted file mode 100644 index 20ab027963..0000000000 --- a/backend/entities/ProjectNumber.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace Pims.Dal.Entities -{ - /// - /// ProjectNumber class, provides an entity for the datamodel to manage project numbers. - /// - public class ProjectNumber : BaseEntity - { - #region Properties - /// - /// get/set - The primary key provides a unique identity for the project. - /// - public int Id { get; set; } - #endregion - - #region Constructors - /// - /// Create a new instance of a ProjectNumber class. - /// - public ProjectNumber() { } - #endregion - - #region Methods - /// - /// Returns the `Id` property to identify this project number. - /// - /// - public override string ToString() - { - return this.Id.ToString(); - } - #endregion - } -} diff --git a/backend/entities/ProjectProperty.cs b/backend/entities/ProjectProperty.cs deleted file mode 100644 index 5cfbb4c1b8..0000000000 --- a/backend/entities/ProjectProperty.cs +++ /dev/null @@ -1,119 +0,0 @@ -using Pims.Dal.Helpers.Extensions; -using System; - -namespace Pims.Dal.Entities -{ - /// - /// ProjectProperty class, provides an entity for the datamodel to manage what properties are associated to which projects. - /// A ProjectProperty must link to either a Parcel or a Building, not both. - /// - public class ProjectProperty : BaseEntity - { - #region Properties - /// - /// get/set - The PRIMARY KEY - /// - public int Id { get; set; } - - /// - /// get/set - The foreign key to the project - PRIMARY KEY. - /// - /// - public int ProjectId { get; set; } - - /// - /// get/set - The project. - /// - /// - public Project Project { get; set; } - - /// - /// get/set - The property type [Land, Building]. - /// - /// - public PropertyTypes PropertyType { get; set; } - - /// - /// get/set - The foreign key to the parcel - PRIMARY KEY. - /// - /// - public int? ParcelId { get; set; } - - /// - /// get/set - The parcel. - /// - /// - public Parcel Parcel { get; set; } - - - /// - /// get/set - The foreign key to the building - PRIMARY KEY. - /// - /// - public int? BuildingId { get; set; } - - /// - /// get/set - The building. - /// - /// - public Building Building { get; set; } - #endregion - - #region Constructors - /// - /// Create a new instance of a ProjectProperty class. - /// - public ProjectProperty() { } - - /// - /// Create a new instance of a ProjectProperty class, initialize it with link to specified parcel. - /// - /// - /// - public ProjectProperty(Project project, Parcel parcel) : this(project, (Property)parcel) - { - } - - /// - /// Create a new instance of a ProjectProperty class, initialize it with link to specified building. - /// - /// - /// - public ProjectProperty(Project project, Building building) : this(project, (Property)building) - { - } - - /// - /// Create a new instance of a ProjectProperty class, initialize it with link to specified property. - /// Also updates the property.ProjectNumber to match the project. - /// - /// - /// - public ProjectProperty(Project project, Property property) - { - this.ProjectId = project?.Id ?? - throw new ArgumentNullException(nameof(project)); - this.Project = project; - - this.PropertyType = property.GetType() == typeof(Parcel) ? PropertyTypes.Land : PropertyTypes.Building; - property.UpdateProjectNumbers(project.ProjectNumber); - - switch (this.PropertyType) - { - case (PropertyTypes.Land): - this.ParcelId = property?.Id ?? - throw new ArgumentNullException(nameof(property)); - this.Parcel = property as Parcel; - break; - case (PropertyTypes.Building): - this.BuildingId = property?.Id ?? - throw new ArgumentNullException(nameof(property)); - this.Building = property as Building; - break; - default: - throw new ArgumentException("A property must be a parcel or a building.", nameof(property)); - } - } - #endregion - } -} diff --git a/backend/entities/ProjectReport.cs b/backend/entities/ProjectReport.cs deleted file mode 100644 index 5fd66cd320..0000000000 --- a/backend/entities/ProjectReport.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// ProjectReport class, provides an entity for the datamodel to manage project reports. - /// - public class ProjectReport : BaseEntity - { - #region Properties - /// - /// get/set - The primary key provides a unique identity for the project report. - /// - public int Id { get; set; } - - /// - /// get/set - Whether this report is final and should not be deleted. - /// - public bool IsFinal { get; set; } - - /// - /// get/set - An optional, descriptive name given to the report. - /// - public string Name { get; set; } - - /// - /// get/set - The oldest date of comparison snapshots used in the report. - /// - public DateTime? From { get; set; } - - /// - /// get/set - The most recent date of comparison snapshots used in the report. - /// - public DateTime? To { get; set; } - - /// - /// get/set - The type of this report. - /// - public ReportTypes ReportType { get; set; } - - #endregion - - #region Constructors - /// - /// Creates a new instance of a ProejctReport. - /// - public ProjectReport() { } - - /// - /// Creates a new instance of a ProjectReport, initializes with specified arguments. - /// - /// - /// - /// - public ProjectReport(ReportTypes type, DateTime? from, DateTime? to) - { - this.ReportType = type; - this.From = from; - this.To = to; - } - - /// - /// Creates a new instance of a ProjectReport, initializes with specified argumentss - /// - /// - /// - /// - /// - public ProjectReport(ReportTypes type, string name, DateTime? from, DateTime? to) : this(type, from, to) - { - this.Name = name; - } - #endregion - } -} diff --git a/backend/entities/ProjectRisk.cs b/backend/entities/ProjectRisk.cs deleted file mode 100644 index 33bd866401..0000000000 --- a/backend/entities/ProjectRisk.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Dal.Entities -{ - /// - /// ProjectRisk class, provides an entity for the datamodel to manage project risks. - /// - public class ProjectRisk : CodeEntity - { - #region Properties - /// - /// get/set - A description of the risk. - /// - public string Description { get; set; } - - /// - /// get - A collection of notes for this project. - /// - public ICollection Projects { get; } = new List(); - #endregion - - #region Constructors - /// - /// Create a new instance of a ProjectRisk class. - /// - public ProjectRisk() { } - - /// - /// Create a new instance of a ProjectRisk class, initializes with specified arguments. - /// - /// - /// - /// - public ProjectRisk(string name, string code, int sortOrder) - { - if (String.IsNullOrWhiteSpace(name)) throw new ArgumentException("Argument cannot be null, empty or whitespace.", nameof(name)); - if (String.IsNullOrWhiteSpace(code)) throw new ArgumentException("Argument cannot be null, empty or whitespace.", nameof(code)); - - this.Name = name; - this.Code = code; - this.SortOrder = sortOrder; - } - #endregion - } -} diff --git a/backend/entities/ProjectSnapshot.cs b/backend/entities/ProjectSnapshot.cs deleted file mode 100644 index b31c245fbf..0000000000 --- a/backend/entities/ProjectSnapshot.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// ProjectSnapshot class, provides an entity for the datamodel to manage project snapshots which are used for reporting. - /// - public class ProjectSnapshot : BaseEntity - { - #region Properties - /// - /// get/set - The primary key provides a unique identity for the project snapshot. - /// - public int Id { get; set; } - - /// - /// get/set - The foreign key to the owning project. - /// - public int ProjectId { get; set; } - - /// - /// get/set - The project this snapshot is from. - /// - public Project Project { get; set; } - - /// - /// get/set - The date that this snapshot was taken. - /// - public DateTime SnapshotOn { get; set; } - - /// - /// get/set - Additional serialized metadata. - /// - public string Metadata { get; set; } - - #region Financials - /// - /// get/set - The net book value. - /// - public decimal? NetBook { get; set; } - - /// - /// get/set - The market value. - /// - public decimal? Market { get; set; } - - /// - /// get/set - The assessed value. - /// - public decimal? Assessed { get; set; } - - /// - /// get/set - The appraised value. - /// - public decimal? Appraised { get; set; } - #endregion - #endregion - - #region Constructors - /// - /// Create a new instance of a ProjectSnapshot class. - /// - public ProjectSnapshot() { } - - /// - /// Create a new instance of a ProjectSnapshot class, initializes with specified arguments - /// - /// - public ProjectSnapshot(Project project) - { - this.ProjectId = project?.Id ?? throw new ArgumentNullException(nameof(project)); - - this.SnapshotOn = DateTime.UtcNow; - this.Project = project; - - this.NetBook = project.NetBook; - this.Market = project.Market; - this.Assessed = project.Assessed; - this.Appraised = project.Appraised; - - this.Metadata = project.Metadata; - } - #endregion - } -} diff --git a/backend/entities/ProjectStatus.cs b/backend/entities/ProjectStatus.cs deleted file mode 100644 index 32a72f0f70..0000000000 --- a/backend/entities/ProjectStatus.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Dal.Entities -{ - /// - /// ProjectStatus class, provides an entity for the datamodel to manage a list project statuses. - /// - public class ProjectStatus : CodeEntity - { - #region Properties - /// - /// get/set - A group name is used instead of the name when a group of status are related and should be presented as one. - /// - public string GroupName { get; set; } - - /// - /// get/set - A description of the tier. - /// - public string Description { get; set; } - - /// - /// get/set - Whether this status is a milestone and requires a special workflow transition to go to this status. - /// - public bool IsMilestone { get; set; } - - /// - /// get/set - Whether this status represents a terminal status - /// - public bool IsTerminal { get; set; } - - /// - /// get/set - The route to the component/page that represents this status. - /// - public string Route { get; set; } - - /// - /// get - Collection of tasks associated to this project status. - /// - public ICollection Tasks { get; } = new List(); - - /// - /// get - Collection of workflows that contain this project status. - /// - public ICollection Workflows { get; } = new List(); - - /// - /// get - Collection of projects. - /// - public ICollection Projects { get; } = new List(); - #endregion - - #region Constructors - /// - /// Create a new instance of a ProjectStatus class. - /// - public ProjectStatus() { } - - /// - /// Create a new instance of a ProjectStatus class. - /// - /// - /// - /// - public ProjectStatus(string name, string code, bool isMilestone = false) - { - if (String.IsNullOrWhiteSpace(name)) throw new ArgumentException("Argument is required and cannot be null, empty or whitespace.", nameof(name)); - if (String.IsNullOrWhiteSpace(code)) throw new ArgumentException("Argument is required and cannot be null, empty or whitespace.", nameof(code)); - this.Name = name; - this.Code = code; - this.IsMilestone = isMilestone; - this.Route = ""; - } - #endregion - } -} diff --git a/backend/entities/ProjectStatusHistory.cs b/backend/entities/ProjectStatusHistory.cs deleted file mode 100644 index 661730f19c..0000000000 --- a/backend/entities/ProjectStatusHistory.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// ProjectStatusHistory class, provides an entity for the datamodel to manage project status transition history. - /// - public class ProjectStatusHistory : BaseEntity - { - #region Properties - /// - /// get/set - The primary key provides a unique identity for the project history. - /// - public int Id { get; set; } - - /// - /// get/set - Foreign key to the project. - /// - public int ProjectId { get; set; } - - /// - /// get/set - The project this history is for. - /// - public Project Project { get; set; } - - /// - /// get/set - Foreign key to the project workflow. - /// - public int WorkflowId { get; set; } - - /// - /// get/set - The project workflow at this point in time. - /// - public Workflow Workflow { get; set; } - - /// - /// get/set - Foreign key to the project status. - /// - public int StatusId { get; set; } - - /// - /// get/set - The project status at this point in time. - /// - public ProjectStatus Status { get; set; } - #endregion - - #region Constructors - /// - /// Create a new instance of a ProjectStatusHistory class. - /// - public ProjectStatusHistory() { } - - /// - /// Create a new instance of a ProjectStatusHistory class, initializes with specified arguments - /// - /// - public ProjectStatusHistory(Project project) - { - this.ProjectId = project?.Id ?? throw new ArgumentNullException(nameof(project)); - this.Project = project; - this.WorkflowId = project.WorkflowId ?? throw new ArgumentException($"Parameter 'project.WorkflowId' is required."); - this.Workflow = project.Workflow; - this.StatusId = project.StatusId; - this.Status = project.Status; - } - #endregion - } -} diff --git a/backend/entities/ProjectStatusNotification.cs b/backend/entities/ProjectStatusNotification.cs deleted file mode 100644 index e5b1219701..0000000000 --- a/backend/entities/ProjectStatusNotification.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// ProjectStatusNotification class, provides an entity for the datamodel to manage a notifications associated to project status. - /// - public class ProjectStatusNotification : BaseEntity - { - #region Properties - /// - /// get/set - Primary key unique identity for project status notification. - /// - public int Id { get; set; } - - /// - /// get/set - Foreign key to the notification template. - /// - public int TemplateId { get; set; } - - /// - /// get/set - The notification template. - /// - public NotificationTemplate Template { get; set; } - - /// - /// get/set - Foreign key to the original project status before the status change. - /// - public int? FromStatusId { get; set; } - - /// - /// get/set - The original project status before the status change.. - /// - public ProjectStatus FromStatus { get; set; } - - /// - /// get/set - Foreign key to the desired project status after the status change. - /// - public int? ToStatusId { get; set; } - - /// - /// get/set - The desired project status after the status change. - /// - public ProjectStatus ToStatus { get; set; } - - /// - /// get/set - The notification priority [low, normal, high] - /// - public NotificationPriorities Priority { get; set; } - - /// - /// get/set - Controls when the notification will be sent. - /// - public NotificationDelays Delay { get; set; } - - /// - /// get/set - The number of days to delay the notification. - /// - public int DelayDays { get; set; } - #endregion - - #region Constructors - /// - /// Create a new instance of a ProjectStatusNotification class. - /// - public ProjectStatusNotification() { } - - /// - /// Create a new instance of a ProjectStatusNotification class. - /// - /// - /// - /// - /// - /// - public ProjectStatusNotification(NotificationTemplate template, ProjectStatus fromStatus, ProjectStatus toStatus, NotificationDelays delay, int delayDays = 0) - { - this.TemplateId = template?.Id ?? throw new ArgumentNullException(nameof(template)); - this.Template = template; - this.FromStatusId = fromStatus?.Id; - this.FromStatus = fromStatus; - this.ToStatusId = toStatus?.Id; - this.ToStatus = toStatus; - this.Priority = template.Priority; - this.Delay = delay; - this.DelayDays = delayDays; - } - #endregion - } -} diff --git a/backend/entities/ProjectStatusTransition.cs b/backend/entities/ProjectStatusTransition.cs deleted file mode 100644 index 10a678e1d5..0000000000 --- a/backend/entities/ProjectStatusTransition.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// ProjectStatusTransition class, provides a way to manage workflow project status transitions within the solution. - /// - public class ProjectStatusTransition : BaseEntity - { - #region Properties - /// - /// get/set - Foreign key to the workflow project status this transitions is from. - /// - public int FromWorkflowId { get; set; } - - /// - /// get/set - Foreign key to the workflow project status this transition is from. - /// - public int FromStatusId { get; set; } - - /// - /// get/set - The workflow project status this transition is from. - /// - public WorkflowProjectStatus FromWorkflowStatus { get; set; } - - /// - /// get/set - The action name that describes the transition. - /// - public string Action { get; set; } - - /// - /// get/set - Foreign key to the workflow project status this goes to. - /// - public int ToWorkflowId { get; set; } - - /// - /// get/set - Foreign key to the workflow project status this goes to. - /// - public int ToStatusId { get; set; } - - /// - /// get/set - Whether this status requires validating prior tasks before transitioning. - /// - public bool ValidateTasks { get; set; } = true; - - /// - /// get/set - The workflow project status this goes to. - /// - public WorkflowProjectStatus ToWorkflowStatus { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a ProjectStatusTransition object. - /// - public ProjectStatusTransition() { } - - /// - /// Creates a new instance of a ProjectStatusTransition object, initializes it with specified arguments. - /// - /// - /// - /// - public ProjectStatusTransition(WorkflowProjectStatus from, string action, WorkflowProjectStatus to) - { - this.FromWorkflowStatus = from ?? throw new ArgumentNullException(nameof(from)); - this.FromWorkflowId = from.WorkflowId; - this.FromStatusId = from.StatusId; - from.ToStatus.Add(this); - this.Action = action; - this.ToWorkflowStatus = to ?? throw new ArgumentNullException(nameof(to)); - this.ToWorkflowId = to.WorkflowId; - this.ToStatusId = to.StatusId; - to.FromStatus.Add(this); - } - #endregion - } -} diff --git a/backend/entities/ProjectTask.cs b/backend/entities/ProjectTask.cs deleted file mode 100644 index c8e2cc2437..0000000000 --- a/backend/entities/ProjectTask.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// ProjectTask class, provides an entity for the datamodel to manage what tasks are associated and completed for the project. - /// - public class ProjectTask : BaseEntity - { - #region Properties - /// - /// get/set - The foreign key to the project - PRIMARY KEY. - /// - /// - public int ProjectId { get; set; } - - /// - /// get/set - The project. - /// - /// - public Project Project { get; set; } - - /// - /// get/set - The foreign key to the task - PRIMARY KEY. - /// - /// - public int TaskId { get; set; } - - /// - /// get/set - The task. - /// - /// - public Task Task { get; set; } - - /// - /// get/set - Whether the task was completed. - /// - public bool IsCompleted { get; set; } - - /// - /// get/set - The date when the task was completed. - /// - public DateTime? CompletedOn { get; set; } - #endregion - - #region Constructors - /// - /// Create a new instance of a ProjectTask class. - /// - public ProjectTask() { } - - /// - /// Create a new instance of a ProjectTask class, initialize it with link to specified task. - /// - /// - /// - public ProjectTask(Project project, Task task) - { - this.ProjectId = project?.Id ?? - throw new ArgumentNullException(nameof(project)); - this.Project = project; - - this.TaskId = task?.Id ?? - throw new ArgumentNullException(nameof(task)); - this.Task = task; - } - #endregion - } -} diff --git a/backend/entities/ProjectTypes.cs b/backend/entities/ProjectTypes.cs deleted file mode 100644 index 99375c940d..0000000000 --- a/backend/entities/ProjectTypes.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Pims.Dal.Entities -{ - /// - /// ProjectTypes enum, provides the valid project types that can be used. - /// - public enum ProjectTypes - { - Disposal = 0 - } -} diff --git a/backend/entities/Property.cs b/backend/entities/Property.cs deleted file mode 100644 index 00615a1347..0000000000 --- a/backend/entities/Property.cs +++ /dev/null @@ -1,118 +0,0 @@ -using NetTopologySuite.Geometries; - -namespace Pims.Dal.Entities -{ - /// - /// Property class, provides an entity for the datamodel to manage propertys. - /// - public abstract class Property : BaseEntity - { - #region Properties - #region Identity - /// - /// get/set - The primary key IDENTITY SEED. - /// - public int Id { get; set; } - - /// - /// get/set - The type of the property. Type is managed by business logic. - /// - public PropertyType PropertyType { get; set; } - - /// - /// get/set - The id referencing the type of the property. Type is managed by business logic. - /// - public int PropertyTypeId { get; set; } - - /// - /// get/set - The RAEG/SPP project numbers. - /// - public string ProjectNumbers { get; set; } - - /// - /// get/set - The property name. - /// - public string Name { get; set; } - - /// - /// get/set - The property description. - /// - public string Description { get; set; } - - /// - /// get/set - The foreign key to the property classification. - /// - public int ClassificationId { get; set; } - - /// - /// get/set - The classification for this property. - /// - public PropertyClassification Classification { get; set; } - - /// - /// get/set - The encumbrance reason for this property. - /// - public string EncumbranceReason { get; set; } - - /// - /// get/set - The foreign key to the agency that owns this property. - /// - public int? AgencyId { get; set; } - - /// - /// get/set - The agency this property belongs to. - /// /summary> - public Agency Agency { get; set; } - #endregion - - #region Location - /// - /// get/set - The foreign key to the property address. - /// - public int AddressId { get; set; } - - /// - /// get/set - The address for this property. - /// - public Address Address { get; set; } - - /// - /// get/set - The longitude (x), latitude (y) location of the property. - /// - public Point Location { get; set; } - - /// - /// get/set - The property boundary polygon. - /// - public Geometry Boundary { get; set; } - #endregion - - /// - /// get/set - Whether this property is considered sensitive and should only be visible to users who are part of the owning agency. - /// - public bool IsSensitive { get; set; } - - /// - /// get/set - Whether the property is visible to other agencies. This is used to make properties visible during ERP, but can be used at other times too. - /// - public bool IsVisibleToOtherAgencies { get; set; } - #endregion - - #region Constructors - /// - /// Create a new instance of a Property class. - /// - public Property() { } - - /// - /// Create a new instance of a Property class. - /// - /// - /// - public Property(double lat, double lng) - { - this.Location = new Point(lng, lat) { SRID = 4326 }; - } - #endregion - } -} diff --git a/backend/entities/PropertyClassification.cs b/backend/entities/PropertyClassification.cs deleted file mode 100644 index 6a20848a1c..0000000000 --- a/backend/entities/PropertyClassification.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace Pims.Dal.Entities -{ - /// - /// PropertyClassificationClassification class, provides an entity for the datamodel to manage a list of property classifications. - /// - public class PropertyClassification : LookupEntity - { - #region Properties - /// - /// get/set - Whether this classification is generally visible. - /// - public bool IsVisible { get; set; } - #endregion - - #region Constructors - /// - /// Create a new instance of a PropertyClassification class. - /// - public PropertyClassification() { } - - /// - /// Create a new instance of a PropertyClassification class. - /// - /// - /// - /// - public PropertyClassification(int id, string name, bool isVisible = true) : base(id, name) - { - this.IsVisible = isVisible; - } - #endregion - } -} diff --git a/backend/entities/PropertyType.cs b/backend/entities/PropertyType.cs deleted file mode 100644 index 2aebe8914b..0000000000 --- a/backend/entities/PropertyType.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace Pims.Dal.Entities -{ - /// - /// PropertyType class, provides an entity for the datamodel to manage a list of property types. - /// - public class PropertyType : LookupEntity - { - #region Properties - #endregion - - #region Constructors - /// - /// Create a new instance of a PropertyType class. - /// - public PropertyType() { } - - /// - /// Create a new instance of a PropertyType class. - /// - /// - /// - public PropertyType(int id, string name) : base(id, name) - { - } - #endregion - } -} diff --git a/backend/entities/PropertyTypes.cs b/backend/entities/PropertyTypes.cs deleted file mode 100644 index 00431c987c..0000000000 --- a/backend/entities/PropertyTypes.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Pims.Dal.Entities -{ - /// - /// PropertyTypes enum, provides the valid property types that can be used. - /// - public enum PropertyTypes - { - Land = 0, - Building = 1, - Subdivision = 2 - } -} diff --git a/backend/entities/Province.cs b/backend/entities/Province.cs deleted file mode 100644 index 520441019f..0000000000 --- a/backend/entities/Province.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// Province class, provides an entity for the datamodel to manage a list of provinces. - /// - public class Province : BaseEntity - { - #region Properties - /// - /// get/set - The primary key. - /// - /// - public string Id { get; set; } - - /// - /// get/set - The unique name for this province. - /// - /// - public string Name { get; set; } - #endregion - - #region Constructors - /// - /// Create a new instance of a Province class. - /// - public Province() { } - - /// - /// Create a new instance of a Province class. - /// - /// - /// - public Province(string id, string name) - { - if (String.IsNullOrWhiteSpace(id)) throw new ArgumentException($"Argument '{nameof(id)}' must be a valid value.", nameof(id)); - if (String.IsNullOrWhiteSpace(name)) throw new ArgumentException($"Argument '{nameof(name)}' must be a valid value.", nameof(name)); - - this.Id = id; - this.Name = name; - } - #endregion - } -} diff --git a/backend/entities/ReportTypes.cs b/backend/entities/ReportTypes.cs deleted file mode 100644 index e52aff0cab..0000000000 --- a/backend/entities/ReportTypes.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Pims.Dal.Entities -{ - /// - /// ReportTypes enum, provides a strongly typed wrapper on the valid project report types that can be used. - /// - public enum ReportTypes - { - SPL = 0, - } -} diff --git a/backend/entities/Role.cs b/backend/entities/Role.cs deleted file mode 100644 index 8693a803b4..0000000000 --- a/backend/entities/Role.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Dal.Entities -{ - /// - /// Role class, provides an entity for the datamodel to manage roles. - /// - public class Role : LookupEntity - { - #region Properties - /// - /// get/set - The GUID that identifies this Group in Keycloak. - /// - public Guid? KeycloakGroupId { get; set; } - - /// - /// get/set - The roles first name. - /// - /// - public string Description { get; set; } - - /// - /// get/set - Whether the role is a public role. - /// One which new users can request to join. - /// - public bool IsPublic { get; set; } = false; - - /// - /// get - A collection of users that have this role. - /// - /// - /// - public ICollection Users { get; } = new List(); - - /// - /// get - A collection of claims for this role. - /// - /// - /// - public ICollection Claims { get; } = new List(); - #endregion - - #region Constructors - /// - /// Create a new instance of a Role class. - /// - public Role() { } - - /// - /// Create a new instance of a Role class. - /// - /// - /// - public Role(Guid id, string name) - { - this.Id = id; - this.Name = name; - } - #endregion - } -} diff --git a/backend/entities/RoleClaim.cs b/backend/entities/RoleClaim.cs deleted file mode 100644 index 7feef31891..0000000000 --- a/backend/entities/RoleClaim.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// RoleClaim class, provides an entity for the datamodel to manage role agencies. - /// - public class RoleClaim : BaseEntity - { - #region Properties - /// - /// get/set - The foreign key to the role - PRIMARY KEY. - /// - /// - public Guid RoleId { get; set; } - - /// - /// get/set - The role that belongs to this claim. - /// - /// - public Role Role { get; set; } - - /// - /// get/set - The foreign key to the claim the role belongs to - PRIMARY KEY. - /// - /// - public Guid ClaimId { get; set; } - - /// - /// get/set - The claim the role belongs to. - /// - /// - public Claim Claim { get; set; } - #endregion - - #region Constructors - /// - /// Create a new instance of a RoleClaim class. - /// - public RoleClaim() { } - - /// - /// Create a new instance of a RoleClaim class. - /// - /// - /// - public RoleClaim(Guid roleId, Guid claimId) - { - this.RoleId = roleId; - this.ClaimId = claimId; - } - - /// - /// Create a new instance of a RoleClaim class. - /// - /// - /// - public RoleClaim(Role role, Claim claim) - { - this.Role = role; - this.RoleId = role?.Id ?? - throw new ArgumentNullException(nameof(role)); - this.Claim = claim; - this.ClaimId = claim?.Id ?? - throw new ArgumentNullException(nameof(claim)); - } - #endregion - } -} diff --git a/backend/entities/Task.cs b/backend/entities/Task.cs deleted file mode 100644 index 910a7a3603..0000000000 --- a/backend/entities/Task.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// Task class, provides an entity for the datamodel to manage a list of process tasks that represent a to-do list. - /// - public class Task : LookupEntity - { - #region Properties - /// - /// get/set - A description of the tier. - /// - public string Description { get; set; } - - /// - /// get/set - Whether this task is required before a process can be completed. - /// - public bool IsOptional { get; set; } - - /// - /// get/set - Foreign key to the project status. - /// - public int? StatusId { get; set; } - - /// - /// get/set - The project status this task is associated with. - /// - public ProjectStatus Status { get; set; } - #endregion - - #region Constructors - /// - /// Create a new instance of a Task class. - /// - public Task() { } - - /// - /// Create a new instance of a Task class, initializes with specified arguments. - /// - /// - /// - public Task(string name, bool isOptional = true) - { - if (String.IsNullOrWhiteSpace(name)) throw new ArgumentException("Argument is required and cannot be null, empty or whitespace.", nameof(name)); - this.Name = name; - this.IsOptional = isOptional; - } - - /// - /// Create a new instance of a Task class, initializes with specified arguments. - /// - /// - /// - /// - public Task(string name, ProjectStatus status, bool isOptional = true) : this(name, isOptional) - { - this.StatusId = status?.Id; - this.Status = status; - } - #endregion - } -} diff --git a/backend/entities/TierLevel.cs b/backend/entities/TierLevel.cs deleted file mode 100644 index ae97e1c844..0000000000 --- a/backend/entities/TierLevel.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.Collections.Generic; - -namespace Pims.Dal.Entities -{ - /// - /// TierLevel class, provides an entity for the datamodel to manage a list of project tier levels. - /// - public class TierLevel : LookupEntity - { - #region Properties - /// - /// get/set - A description of the tier. - /// - public string Description { get; set; } - - /// - /// get - Collection of projects. - /// - public ICollection Projects { get; } = new List(); - #endregion - - #region Constructors - /// - /// Create a new instance of a TierLevel class. - /// - public TierLevel() { } - - /// - /// Create a new instance of a TierLevel class. - /// - /// - /// - public TierLevel(int id, string name) : base(id, name) - { - } - #endregion - } -} diff --git a/backend/entities/User.cs b/backend/entities/User.cs deleted file mode 100644 index 07f3eedb69..0000000000 --- a/backend/entities/User.cs +++ /dev/null @@ -1,153 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Dal.Entities -{ - /// - /// User class, provides an entity for the datamodel to manage users. - /// - public class User : BaseEntity - { - #region Properties - /// - /// get/set - The primary key IDENTITY. - /// - public Guid Id { get; set; } - - /// - /// get/set - Unique identifier to link user with Keycloak user. - /// - public Guid? KeycloakUserId { get; set; } - - /// - /// get/set - The unique user name to identify the user. - /// - public string Username { get; set; } - - /// - /// get/set - The users display name. - /// - public string DisplayName { get; set; } - - /// - /// get/set - The users first name. - /// - public string FirstName { get; set; } - - /// - /// get/set - The users middle name. - /// - public string MiddleName { get; set; } - - /// - /// get/set - The users last name. - /// - public string LastName { get; set; } - - /// - /// get/set - The users email address. - /// - public string Email { get; set; } - - /// - /// get/set - The user's position title. - /// - public string Position { get; set; } - - /// - /// get/set - Whether the user is disabled. - /// - public bool IsDisabled { get; set; } - - /// - /// get/set - Whether their email has been verified. - /// - public bool EmailVerified { get; set; } - - /// - /// get/set - A note about the user. - /// - public string Note { get; set; } - - /// - /// get/set - Whether this user account is a system account. - /// A system account will not be visible through user management. - /// - public bool IsSystem { get; set; } - - /// - /// get/set - Last Login date time - /// - public DateTime? LastLogin { get; set; } - - /// - /// get/set - Foreign key to the user who approved this user. - /// - public Guid? ApprovedById { get; set; } - - /// - /// get/set - The user who approved this user. - /// - public User ApprovedBy { get; set; } - - /// - /// get/set - When the user was approved. - /// - public DateTime? ApprovedOn { get; set; } - - /// - /// get - A collection of agencies this user belongs to. - /// - /// - public ICollection Agencies { get; set; } = new List(); - - /// - /// get - A collection of roles this user belongs to. - /// - /// - public ICollection Roles { get; set; } = new List(); - #endregion - - #region Constructors - /// - /// Create a new instance of a User class. - /// - public User() { } - - /// - /// Create a new instance of a User class, initializes with specified arguments. - /// - /// - /// - /// - public User(Guid id, string userName, string email) - { - if (id == Guid.Empty) throw new ArgumentException("User id must be unique.", nameof(id)); - if (String.IsNullOrWhiteSpace(userName)) throw new ArgumentException("Argument cannot be null, whitespace or empty.", nameof(userName)); - if (String.IsNullOrWhiteSpace(email)) throw new ArgumentException("Argument cannot be null, whitespace or empty.", nameof(email)); - - this.Id = id; - this.KeycloakUserId = id; - this.Username = userName; - this.Email = email; - } - - /// - /// Create a new instance of a User class, initializes with specified arguments. - /// - /// - /// - /// - /// - /// - public User(Guid id, string userName, string email, string firstName, string lastName) : this(id, userName, email) - { - this.FirstName = firstName; - this.LastName = lastName; - this.DisplayName = $"{lastName}, {firstName}"; - this.LastLogin = DateTime.UtcNow; - this.CreatedOn = DateTime.UtcNow; - } - #endregion - } -} diff --git a/backend/entities/UserAgency.cs b/backend/entities/UserAgency.cs deleted file mode 100644 index 1e3cdd10a0..0000000000 --- a/backend/entities/UserAgency.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// UserAgency class, provides an entity for the datamodel to manage user agencies. - /// - public class UserAgency : BaseEntity - { - #region Properties - /// - /// get/set - The foreign key to the user - PRIMARY KEY. - /// - /// - public Guid UserId { get; set; } - - /// - /// get/set - The user that belongs to this agency. - /// - /// - public User User { get; set; } - - /// - /// get/set - The foreign key to the agency the user belongs to - PRIMARY KEY. - /// - /// - public int AgencyId { get; set; } - - /// - /// get/set - The agency the user belongs to. - /// - /// - public Agency Agency { get; set; } - #endregion - - #region Constructors - /// - /// Create a new instance of a UserAgency class. - /// - public UserAgency() { } - - /// - /// Create a new instance of a UserAgency class. - /// - /// - /// - public UserAgency(Guid userId, int agencyId) - { - this.UserId = userId; - this.AgencyId = agencyId; - } - - /// - /// Create a new instance of a UserAgency class. - /// - /// - /// - public UserAgency(User user, Agency agency) - { - this.User = user; - this.UserId = user?.Id ?? - throw new ArgumentNullException(nameof(user)); - this.Agency = agency; - this.AgencyId = agency?.Id ?? - throw new ArgumentNullException(nameof(agency)); - } - #endregion - } -} diff --git a/backend/entities/UserRole.cs b/backend/entities/UserRole.cs deleted file mode 100644 index 42ecb5c5ee..0000000000 --- a/backend/entities/UserRole.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; - -namespace Pims.Dal.Entities -{ - /// - /// UserRole class, provides an entity for the datamodel to manage user agencies. - /// - public class UserRole : BaseEntity - { - #region Properties - /// - /// get/set - The foreign key to the user - PRIMARY KEY. - /// - /// - public Guid UserId { get; set; } - - /// - /// get/set - The user that belongs to this role. - /// - /// - public User User { get; set; } - - /// - /// get/set - The foreign key to the role the user belongs to - PRIMARY KEY. - /// - /// - public Guid RoleId { get; set; } - - /// - /// get/set - The role the user belongs to. - /// - /// - public Role Role { get; set; } - #endregion - - #region Constructors - /// - /// Create a new instance of a UserRole class. - /// - public UserRole() { } - - /// - /// Create a new instance of a UserRole class. - /// - /// - /// - public UserRole(Guid userId, Guid roleId) - { - this.UserId = userId; - this.RoleId = roleId; - } - - /// - /// Create a new instance of a UserRole class. - /// - /// - /// - public UserRole(User user, Role role) - { - this.User = user; - this.UserId = user?.Id ?? - throw new ArgumentNullException(nameof(user)); - this.Role = role; - this.RoleId = role?.Id ?? - throw new ArgumentNullException(nameof(role)); - } - #endregion - } -} diff --git a/backend/entities/Views/Property.cs b/backend/entities/Views/Property.cs deleted file mode 100644 index b8c45cd587..0000000000 --- a/backend/entities/Views/Property.cs +++ /dev/null @@ -1,389 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using NetTopologySuite.Geometries; - -namespace Pims.Dal.Entities.Views -{ - /// - /// Property class, provides a model that represents a view in the database. - /// - public class Property - { - #region Properties - /// - /// get/set - The primary key IDENTITY SEED. - /// - public int Id { get; set; } - - /// - /// get/set - The concurrency row version. - /// - /// - public byte[] RowVersion { get; set; } - - /// - /// get/set - The property type [0=Parcel, 1=Building]. - /// - public PropertyTypes PropertyTypeId { get; set; } - - /// - /// get/set - The RAEG/SPP project number. - /// - public string ProjectNumbers { get; set; } - - /// - /// get/set - The foreign key to the property classification. - /// - public int ClassificationId { get; set; } - - /// - /// get/set - The classification for this property. - /// - public string Classification { get; set; } - - /// - /// get/set - The foreign key to the agency that owns this property. - /// - public int? AgencyId { get; set; } - - /// - /// get/set - The parent agency this property belongs to. - /// /summary> - public string Agency { get; set; } - - /// - /// get/set - The parent agency code this property belongs to. - /// /summary> - public string AgencyCode { get; set; } - - /// - /// get/set - The sub agency this property belongs to. - /// /summary> - public string SubAgency { get; set; } - - /// - /// get/set - The sub agency code this property belongs to. - /// /summary> - public string SubAgencyCode { get; set; } - - /// - /// get/set - The property name. - /// - public string Name { get; set; } - - /// - /// get/set - The property description. - /// - public string Description { get; set; } - - /// - /// get/set - The foreign key to the property address. - /// - public int AddressId { get; set; } - - /// - /// get/set - The address for this property. - /// - public string Address { get; set; } - - /// - /// get/set - The administrative area (city, municipality, district, etc) for this property. - /// - public string AdministrativeArea { get; set; } - - /// - /// get/set - The address for this property. - /// - public string Province { get; set; } - - /// - /// get/set - The address for this property. - /// - public string Postal { get; set; } - - /// - /// get/set - The location of the property. - /// - public Point Location { get; set; } - - /// - /// get/set - The property boundary polygon. - /// - public Geometry Boundary { get; set; } - - /// - /// get/set - Whether this property is considered sensitive and should only be visible to users who are part of the owning agency. - /// - public bool IsSensitive { get; set; } - - /// - /// get/set - Whether the property is visible to other agencies. This is used to make properties visible during ERP, but can be used at other times too. - /// - public bool IsVisibleToOtherAgencies { get; set; } - - #region Financials - /// - /// get/set - The most recent market value. - /// - [Column(TypeName = "MONEY")] - public decimal? Market { get; set; } - - /// - /// get/set - The fiscal year for the market value. - /// - public int? MarketFiscalYear { get; set; } - - /// - /// get/set - The most recent netbook value. - /// - [Column(TypeName = "MONEY")] - public decimal? NetBook { get; set; } - - /// - /// get/set - The fiscal year netbook value. - /// - public int? NetBookFiscalYear { get; set; } - - /// - /// get/set - The most recent assessment for the land. - /// - [Column(TypeName = "MONEY")] - public decimal? AssessedLand { get; set; } - - /// - /// get/set - When the most recent assessment was taken. - /// - public DateTime? AssessedLandDate { get; set; } - - /// - /// get/set - The most recent assessment for the building and improvements. - /// - [Column(TypeName = "MONEY")] - public decimal? AssessedBuilding { get; set; } - - /// - /// get/set - When the most recent assessment was taken. - /// - public DateTime? AssessedBuildingDate { get; set; } - #endregion - - #region Parcel Properties - /// - /// get/set - The property identification number for Titled land. - /// - public int? PID { get; set; } - - /// - /// get - The friendly formated Parcel Id. - /// - public string ParcelIdentity { get { return this.PID > 0 ? $"{this.PID:000-000-000}" : null; } } - - /// - /// get/set - The property identification number of Crown Lands Registry that are not Titled. - /// - /// - public int? PIN { get; set; } - - /// - /// get/set - The land area. - /// - public float? LandArea { get; set; } - - /// - /// get/set - The land legal description. - /// - public string LandLegalDescription { get; set; } - - /// - /// get/set - Current Parcel zoning information - /// - public string Zoning { get; set; } - - /// - /// get/set - Potential future Parcel zoning information - /// - public string ZoningPotential { get; set; } - #endregion - - #region Building Properties - /// - /// get/set - The parent parcel Id. - /// - public int? ParcelId { get; set; } - - /// - /// get/set - The foreign key to the property building construction type. - /// - public int? BuildingConstructionTypeId { get; set; } - - /// - /// get/set - The building construction type for this property. - /// - public string BuildingConstructionType { get; set; } - - /// - /// get/set - The number of floors in the building. - /// - public int? BuildingFloorCount { get; set; } - - /// - /// get/set - The foreign key to the building predominant use. - /// - public int? BuildingPredominateUseId { get; set; } - - /// - /// get/set - The building predominant use for this building. - /// - public string BuildingPredominateUse { get; set; } - - /// - /// get/set - The type of tenancy for this building. - /// - public string BuildingTenancy { get; set; } - - /// - /// get/set - The building rentable area. - /// - public float? RentableArea { get; set; } - - /// - /// get/set - The foreign key to the building occupant type. - /// - public int? BuildingOccupantTypeId { get; set; } - - /// - /// get/set - The type of occupant for this building. - /// - public string BuildingOccupantType { get; set; } - - /// - /// get/set - The expiry date of the currently active lease - /// - public DateTime? LeaseExpiry { get; set; } - - /// - /// get/set - The date lasted updated on - /// - public DateTime? UpdatedOn { get; set; } - - /// - /// get/set - The name of the person who had last updated the record - /// - public string DisplayName { get; set; } - - /// - /// get/set - The name of the occupant/organization - /// - public string OccupantName { get; set; } - - /// - /// get/set - Whether the lease on this building would be transferred if the building is sold. - /// - public bool? TransferLeaseOnSale { get; set; } - #endregion - #endregion - - #region Constructors - /// - /// Creates a new instance of a Property object. - /// - public Property() - { - - } - - /// - /// Creates a new instance of a Property object, initializes it with the specified arguments. - /// - /// - public Property(Entities.Property property) - { - this.Id = property.Id; - this.ProjectNumbers = property.ProjectNumbers; - this.ClassificationId = property.ClassificationId; - this.Classification = property.Classification?.Name; - - this.AgencyId = property.AgencyId; - this.Agency = property.Agency?.ParentId != null ? property.Agency.Parent?.Name : property.Agency?.Name; - this.AgencyCode = property.Agency?.ParentId != null ? property.Agency.Parent?.Code : property.Agency?.Code; - this.SubAgency = property.Agency?.ParentId != null ? null : property.Agency?.Name; - this.SubAgencyCode = property.Agency?.ParentId != null ? null : property.Agency?.Code; - - this.Name = property.Name; - this.Description = property.Description; - this.AddressId = property.AddressId; - this.Address = property.Address != null ? $"{property.Address?.Address1} {property.Address?.Address2}".Trim() : null; - this.AdministrativeArea = property.Address?.AdministrativeArea; - this.Province = property.Address?.Province?.Name; - this.Postal = property.Address?.Postal; - this.Location = property.Location; - this.Boundary = property.Boundary; - this.IsSensitive = property.IsSensitive; - } - - /// - /// Creates a new instance of a Property object, initializes it with the specified arguments. - /// - /// - public Property(Parcel parcel) : this((Entities.Property)parcel) - { - this.PropertyTypeId = PropertyTypes.Land; - this.PID = parcel.PID; - this.PIN = parcel.PIN; - this.LandArea = parcel.LandArea; - this.LandLegalDescription = parcel.LandLegalDescription; - this.Zoning = parcel.Zoning; - this.ZoningPotential = parcel.ZoningPotential; - - var assessed = parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - this.AssessedLand = assessed?.Value; - this.AssessedLandDate = assessed?.Date; - this.UpdatedOn = parcel.UpdatedOn?.Date; - this.DisplayName = parcel.UpdatedBy?.DisplayName; - - var improvements = parcel.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Improvements); - this.AssessedBuilding = improvements?.Value; - this.AssessedBuildingDate = improvements?.Date; - - var netbook = parcel.Fiscals.OrderByDescending(n => n.FiscalYear).FirstOrDefault(n => n.Key == FiscalKeys.NetBook); - this.NetBook = netbook?.Value; - this.NetBookFiscalYear = netbook?.FiscalYear; - } - - /// - /// Creates a new instance of a Property object, initializes it with the specified arguments. - /// - /// - public Property(Building building) : this((Entities.Property)building) - { - this.PropertyTypeId = PropertyTypes.Building; - this.PID = building.Parcels.FirstOrDefault()?.Parcel.PID ?? 0; - this.PIN = building.Parcels.FirstOrDefault()?.Parcel.PIN; - this.ParcelId = building.Parcels.FirstOrDefault()?.ParcelId; - this.BuildingConstructionTypeId = building.BuildingConstructionTypeId; - this.BuildingConstructionType = building.BuildingConstructionType?.Name; - this.BuildingFloorCount = building.BuildingFloorCount; - this.BuildingPredominateUseId = building.BuildingPredominateUseId; - this.BuildingPredominateUse = building.BuildingPredominateUse?.Name; - this.BuildingTenancy = building.BuildingTenancy; - this.RentableArea = building.RentableArea; - this.BuildingOccupantTypeId = building.BuildingOccupantTypeId; - this.BuildingOccupantType = building.BuildingOccupantType?.Name; - this.LeaseExpiry = building.LeaseExpiry; - this.OccupantName = building.OccupantName; - this.TransferLeaseOnSale = building.TransferLeaseOnSale; - this.UpdatedOn = building.UpdatedOn?.Date; - this.DisplayName = building.UpdatedBy?.DisplayName; - - var improvements = building.Evaluations.OrderByDescending(e => e.Date).FirstOrDefault(e => e.Key == EvaluationKeys.Assessed); - this.AssessedBuilding = improvements?.Value; - this.AssessedBuildingDate = improvements?.Date; - - var netbook = building.Fiscals.OrderByDescending(n => n.FiscalYear).FirstOrDefault(n => n.Key == FiscalKeys.NetBook); - this.NetBook = netbook?.Value; - this.NetBookFiscalYear = netbook?.FiscalYear; - } - #endregion - } -} diff --git a/backend/entities/Workflow.cs b/backend/entities/Workflow.cs deleted file mode 100644 index ccb49c26ee..0000000000 --- a/backend/entities/Workflow.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Dal.Entities -{ - /// - /// Workflow class, provides a way to manage workflows within the solution. - /// - public class Workflow : CodeEntity - { - #region Properties - /// - /// get/set - A description of - /// - public string Description { get; set; } - - /// - /// get - Collection of project status that belong to this workflow. - /// - public ICollection Status { get; } = new List(); - - /// - /// get - Collection of projects currently in this workflow. - /// - public ICollection Projects { get; } = new List(); - #endregion - - #region Constructors - /// - /// Creates a new instance of a Workflow object. - /// - public Workflow() { } - - /// - /// Creates a new instance of a Workflow object, initializes it with specified arguments. - /// - /// - /// - public Workflow(string name, string code) - { - if (String.IsNullOrWhiteSpace(name)) throw new ArgumentException("Argument cannot be null, empty or whitespace.", nameof(name)); - if (String.IsNullOrWhiteSpace(code)) throw new ArgumentException("Argument cannot be null, empty or whitespace.", nameof(code)); - this.Name = name; - this.Code = code; - this.Description = ""; - } - #endregion - } -} diff --git a/backend/entities/WorkflowProjectStatus.cs b/backend/entities/WorkflowProjectStatus.cs deleted file mode 100644 index c5466a8d05..0000000000 --- a/backend/entities/WorkflowProjectStatus.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Dal.Entities -{ - /// - /// WorkflowProjectStatus class, provides a way to manage which project status are related to this workflow. - /// - public class WorkflowProjectStatus : BaseEntity - { - #region Properties - /// - /// get/set - Primary key and foreign key to the owning workflow. - /// - public int WorkflowId { get; set; } - - /// - /// get/set - Owning workflow. - /// - public Workflow Workflow { get; set; } - - /// - /// get/set - Primary key and foreign key to the project status. - /// - public int StatusId { get; set; } - - /// - /// get/set - The project status. - /// - public ProjectStatus Status { get; set; } - - /// - /// get/set - The sort order of the status for this workflow. - /// - public int SortOrder { get; set; } - - /// - /// get/set - Whether this workflow project status is an optional path. - /// - public bool IsOptional { get; set; } - - /// - /// get - Collection of status transitions this status can go to. - /// - public ICollection ToStatus { get; } = new List(); - - /// - /// get - Collection of status transitions this status can come from. - /// - public ICollection FromStatus { get; } = new List(); - #endregion - - #region Constructors - /// - /// Creates a new instance of a WorkflowProjectStatus object. - /// - public WorkflowProjectStatus() { } - - /// - /// Creates a new instance of a WorkflowProjectStatus object, initializes it with specified arguments. - /// - /// - /// - /// - public WorkflowProjectStatus(Workflow workflow, ProjectStatus status, int sortOrder = 0) - { - this.Workflow = workflow; - this.WorkflowId = workflow?.Id ?? throw new ArgumentNullException(nameof(workflow)); - this.Status = status; - this.StatusId = status?.Id ?? throw new ArgumentNullException(nameof(status)); - this.SortOrder = sortOrder; - } - #endregion - } -} diff --git a/backend/entrypoint.sh b/backend/entrypoint.sh deleted file mode 100644 index a544e67d9e..0000000000 --- a/backend/entrypoint.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -# export MAIL_SERVER_URL=`route -n | grep "UG" | grep -v "UGH" | cut -f 10 -d " "` -# export MAIL_SERVER_PORT=1025 -dotnet Pims.Api.dll diff --git a/backend/geocoder/Configuration/GeocoderOptions.cs b/backend/geocoder/Configuration/GeocoderOptions.cs deleted file mode 100644 index acaa955a95..0000000000 --- a/backend/geocoder/Configuration/GeocoderOptions.cs +++ /dev/null @@ -1,40 +0,0 @@ -namespace Pims.Geocoder.Configuration -{ - /// - /// GeocoderOptions class, provides a way to configure the Geocoder. - /// - public class GeocoderOptions - { - #region Properties - /// - /// get/set - The URI to the Geocoder API service. - /// - public string HostUri { get; set; } = "https://geocoder.api.gov.bc.ca"; - - /// - /// get/set - The API Key to include when making requests to the Geocoder API. - /// - public string Key { get; set; } - - /// - /// get/set - Site endpoint URLs. - /// - public SiteOptions Sites { get; set; } = new SiteOptions(); - - /// - /// get/set - Intersection endpoint URLs. - /// - public IntersectionOptions Intersections { get; set; } = new IntersectionOptions(); - - /// - /// get/set - Occupant endpoint URLs. - /// - public OccupantOptions Occupants { get; set; } = new OccupantOptions(); - - /// - /// get/set - Parcel endpiont URLs. - /// - public ParcelOptions Parcels { get; set; } = new ParcelOptions(); - #endregion - } -} diff --git a/backend/geocoder/Configuration/IntersectionOptions.cs b/backend/geocoder/Configuration/IntersectionOptions.cs deleted file mode 100644 index f160a5b63a..0000000000 --- a/backend/geocoder/Configuration/IntersectionOptions.cs +++ /dev/null @@ -1,32 +0,0 @@ -namespace Pims.Geocoder.Configuration -{ - public class IntersectionOptions - { - #region Properties - /// - /// get/set - The URL to the intersection addresses endpoint. - /// - public string AddressesUrl { get; set; } = "/addresses.{outputFormat}"; - - /// - /// get/set - The URL to the intersection nearest endpoint. - /// - public string NearestUrl { get; set; } = "/intersections/nearest.{outputFormat}"; - - /// - /// get/set - The URL to the intersection near endpoint. - /// - public string NearUrl { get; set; } = "/intersections/near.{outputFormat}"; - - /// - /// get/set - The URL to the intersection within endpoint. - /// - public string WithinUrl { get; set; } = "/intersections/within.{outputFormat}"; - - /// - /// get/set - The URL to the intersection site endpoint. - /// - public string SiteUrl { get; set; } = "/intersections/{intersectionId}.{outputFormat}"; - #endregion - } -} diff --git a/backend/geocoder/Configuration/OccupantOptions.cs b/backend/geocoder/Configuration/OccupantOptions.cs deleted file mode 100644 index 872df483ba..0000000000 --- a/backend/geocoder/Configuration/OccupantOptions.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace Pims.Geocoder.Configuration -{ - public class OccupantOptions - { - #region Properties - - /// - /// get/set - The URL to the occupant addresses endpoint. - /// - public string AddressesUrl { get; set; } = "/occupants/addresses.{outputFormat}"; - - /// - /// get/set - The URL to the occupant nearest endpoint. - /// - public string NearestUrl { get; set; } = "/occupants/nearest.{outputFormat}"; - - /// - /// get/set - The URL to the occupant near endpoint. - /// - public string NearUrl { get; set; } = "/occupants/near.{outputFormat}"; - - /// - /// get/set - The URL to the occupant within endpoint. - /// - public string WithinUrl { get; set; } = "/occupants/within.{outputFormat}"; - - /// - /// get/set - The URL to the occupant site endpoint. - /// - public string SiteUrl { get; set; } = "/occupants/{occupantId}.{outputFormat}"; - #endregion - } -} diff --git a/backend/geocoder/Configuration/ParcelOptions.cs b/backend/geocoder/Configuration/ParcelOptions.cs deleted file mode 100644 index 8d0af708be..0000000000 --- a/backend/geocoder/Configuration/ParcelOptions.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Pims.Geocoder.Configuration -{ - public class ParcelOptions - { - #region Properties - - /// - /// get/set - The URL to the parcel pids endpoint. - /// - public string PidsUrl { get; set; } = "/parcels/pids/{siteId}.{outputFormat}"; - #endregion - } -} diff --git a/backend/geocoder/Configuration/SiteOptions.cs b/backend/geocoder/Configuration/SiteOptions.cs deleted file mode 100644 index 433866038a..0000000000 --- a/backend/geocoder/Configuration/SiteOptions.cs +++ /dev/null @@ -1,38 +0,0 @@ -namespace Pims.Geocoder.Configuration -{ - public class SiteOptions - { - #region Properties - - /// - /// get/set - The URL to the site addresses endpoint. - /// - public string AddressesUrl { get; set; } = "/addresses.{outputFormat}"; - - /// - /// get/set - The URL to the site nearest endpoint. - /// - public string NearestUrl { get; set; } = "/sites/nearest.{outputFormat}"; - - /// - /// get/set - The URL to the site near endpoint. - /// - public string NearUrl { get; set; } = "/sites/near.{outputFormat}"; - - /// - /// get/set - The URL to the site within endpoint. - /// - public string WithinUrl { get; set; } = "/sites/within.{outputFormat}"; - - /// - /// get/set - The URL to the site subsites endpoint. - /// - public string SubsitesUrl { get; set; } = "/sites/{siteId}/subsites.{outputFormat}"; - - /// - /// get/set - The URL to the site endpoint. - /// - public string SiteUrl { get; set; } = "/sites/{siteId}.{outputFormat}"; - #endregion - } -} diff --git a/backend/geocoder/Extensions/ParameterExtensions.cs b/backend/geocoder/Extensions/ParameterExtensions.cs deleted file mode 100644 index c3bde97e25..0000000000 --- a/backend/geocoder/Extensions/ParameterExtensions.cs +++ /dev/null @@ -1,85 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.WebUtilities; -using Microsoft.Extensions.Primitives; -using Pims.Core.Extensions; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; - -namespace Pims.Geocoder.Extensions -{ - /// - /// ParameterExtensions static class, provides extension methods for query parameters. - /// - public static class ParameterExtensions - { - /// - /// Converts the specified 'obj' into a dictionary. - /// Lowercases the first letter of each property name. - /// Only return non-null values. - /// Lowercases boolean values. - /// - /// - /// - /// - public static Dictionary ToQueryStringDictionary(this T obj) - where T : class - { - return typeof(T).GetProperties(BindingFlags.Instance | BindingFlags.Public) - .ToDictionary(p => p.Name.LowercaseFirstCharacter(), p => p.PropertyType == typeof(bool) ? $"{p.GetValue(obj, null)}".ToLower() : $"{p.GetValue(obj, null)}") - .Where(p => !String.IsNullOrWhiteSpace(p.Value)) - .ToDictionary(p => p.Key, p => p.Value); - } - - /// - /// Parses the query string and returns an object initialized with the specified parameters. - /// - /// - /// - /// - public static T ParseQueryString(this QueryString queryString) - { - var query = QueryHelpers.ParseQuery(queryString.Value); - - return query.ParseQueryString(); - } - - /// - /// Parses the dictionary and returns an object initialized with the specified parameters. - /// - /// - /// - /// - public static T ParseQueryString(this Dictionary parameters) - { - var result = Activator.CreateInstance(); - var props = typeof(T).GetProperties(BindingFlags.Instance | BindingFlags.Public).ToDictionary(p => p.Name.ToLower()); - foreach (var p in parameters) - { - var key = p.Key.ToLower(); - if (props.ContainsKey(key)) - { - if (props[key].PropertyType == typeof(int)) - { - props[key].SetValue(result, Int32.Parse(p.Value)); - } - else if (props[key].PropertyType == typeof(bool)) - { - props[key].SetValue(result, Boolean.Parse(p.Value)); - } - else if (props[key].PropertyType == typeof(double)) - { - props[key].SetValue(result, Double.Parse(p.Value)); - } - else - { - props[key].SetValue(result, $"{p.Value}"); - } - } - } - - return result; - } - } -} diff --git a/backend/geocoder/Extensions/ServiceCollectionExtensions.cs b/backend/geocoder/Extensions/ServiceCollectionExtensions.cs deleted file mode 100644 index d66ed30830..0000000000 --- a/backend/geocoder/Extensions/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Pims.Core.Http; - -namespace Pims.Geocoder -{ - /// - /// ServiceCollectionExtensions static class, provides extension methods for ServiceCollection objects. - /// - public static class ServiceCollectionExtensions - { - /// - /// Add the AddGeocoderService to the dependency injection service collection. - /// - /// - /// - /// - public static IServiceCollection AddGeocoderService(this IServiceCollection services, IConfigurationSection section) - { - return services - .Configure(section) - .AddScoped() - .AddScoped(); - } - } -} diff --git a/backend/geocoder/GeocoderService.cs b/backend/geocoder/GeocoderService.cs deleted file mode 100644 index c033f5f20d..0000000000 --- a/backend/geocoder/GeocoderService.cs +++ /dev/null @@ -1,98 +0,0 @@ -using Microsoft.AspNetCore.WebUtilities; -using Microsoft.Extensions.Options; -using Pims.Core.Http; -using Pims.Geocoder.Configuration; -using Pims.Geocoder.Extensions; -using Pims.Geocoder.Models; -using Pims.Geocoder.Parameters; -using System; -using System.Net; -using System.Threading.Tasks; - -namespace Pims.Geocoder -{ - /// - /// GeocoderService class, provides a service for integration with Geocoder API services. - /// - public class GeocoderService : IGeocoderService - { - #region Properties - protected IHttpRequestClient Client { get; } - public GeocoderOptions Options { get; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a GeocoderService, initializes with specified arguments. - /// - /// - /// - public GeocoderService(IOptions options, IHttpRequestClient client) - { - this.Options = options.Value; - this.Client = client; - if (!String.IsNullOrWhiteSpace(this.Options.Key)) - { - client.Client.DefaultRequestHeaders.Add("apikey", this.Options.Key); - } - } - #endregion - - #region Methods - /// - /// Generates the full URL including the host. - /// - /// - /// - /// - private string GenerateUrl(string endpoint, string outputFormat = "json") - { - var host = this.Options.HostUri; - return $"{host}{endpoint.Replace("{outputFormat}", outputFormat)}"; - } - - /// - /// Sends an HTTP request to Geocoder for addresses that match the specified 'address'. - /// - /// The address to geocode - /// The output format. Defaults to "json" - /// - public async Task GetSiteAddressesAsync(string address, string outputFormat = "json") - { - var parameters = new AddressesParameters() - { - AddressString = WebUtility.UrlEncode(address) - }; - return await GetSiteAddressesAsync(parameters, outputFormat); - } - - /// - /// Sends an HTTP request to Geocoder for addresses that match the specified 'parameters'. - /// - /// The address search paramenters - /// The output format. Defaults to "json" - /// - public async Task GetSiteAddressesAsync(AddressesParameters parameters, string outputFormat = "json") - { - var uri = new Uri(GenerateUrl(this.Options.Sites.AddressesUrl, outputFormat)); - var url = QueryHelpers.AddQueryString(uri.AbsoluteUri, parameters.ToQueryStringDictionary()); - return await this.Client.GetAsync(url); - } - - /// - /// Sends an HTTP request to Geocoder for all parcel identifiers (PIDs) associated with an individual site. - /// A 'siteId' is a unique identifier assigned to every site in B.C. - /// Valid 'siteId' values for an address are returned by GetSiteAddressesAsync. - /// - /// The site identifier - /// The output format. Defaults to "json" - /// - public async Task GetPids(Guid siteId, string outputFormat = "json") - { - var endpoint = this.Options.Parcels.PidsUrl.Replace("{siteId}", siteId.ToString()); - var uri = new Uri(GenerateUrl(endpoint, outputFormat)); - return await this.Client.GetAsync(uri); - } - #endregion - } -} diff --git a/backend/geocoder/IGeocoderService.cs b/backend/geocoder/IGeocoderService.cs deleted file mode 100644 index 81e0dc1467..0000000000 --- a/backend/geocoder/IGeocoderService.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Pims.Geocoder.Models; -using Pims.Geocoder.Parameters; -using System; -using System.Threading.Tasks; - -namespace Pims.Geocoder -{ - public interface IGeocoderService - { - Task GetSiteAddressesAsync(string address, string outputFormat = "json"); - Task GetSiteAddressesAsync(AddressesParameters parameters, string outputFormat = "json"); - Task GetPids(Guid siteId, string outputFormat = "json"); - } -} diff --git a/backend/geocoder/Models/CrsModel.cs b/backend/geocoder/Models/CrsModel.cs deleted file mode 100644 index e619259334..0000000000 --- a/backend/geocoder/Models/CrsModel.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Collections.Generic; - -namespace Pims.Geocoder.Models -{ - public class CrsModel - { - #region Properties - public string Type { get; set; } - public Dictionary Properties { get; set; } - #endregion - } -} diff --git a/backend/geocoder/Models/FaultModel.cs b/backend/geocoder/Models/FaultModel.cs deleted file mode 100644 index ae31301b81..0000000000 --- a/backend/geocoder/Models/FaultModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Pims.Geocoder.Models -{ - public class FaultModel - { - #region Properties - public string Element { get; set; } - public string Fault { get; set; } - public int Penalty { get; set; } - #endregion - } -} diff --git a/backend/geocoder/Models/FeatureCollectionModel.cs b/backend/geocoder/Models/FeatureCollectionModel.cs deleted file mode 100644 index befb8c1759..0000000000 --- a/backend/geocoder/Models/FeatureCollectionModel.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Collections.Generic; - -namespace Pims.Geocoder.Models -{ - public class FeatureCollectionModel - { - #region Properties - public string Type { get; set; } - public string QueryAddress { get; set; } - public string SearchTimestamp { get; set; } - public double ExecutionTime { get; set; } - public string Version { get; set; } - public string BaseDataDate { get; set; } - public CrsModel Crs { get; set; } - public string Interpolation { get; set; } - public string Echo { get; set; } - public string LocationDescripture { get; set; } - public int SetBack { get; set; } - public int MinScore { get; set; } - public int MaxResults { get; set; } - public string Disclaimer { get; set; } - public string PrivacyStatement { get; set; } - public string CopyrightNotice { get; set; } - public string CopyrightLicense { get; set; } - public IEnumerable Features { get; set; } - #endregion - } -} diff --git a/backend/geocoder/Models/FeatureModel.cs b/backend/geocoder/Models/FeatureModel.cs deleted file mode 100644 index 994dc52bc2..0000000000 --- a/backend/geocoder/Models/FeatureModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Pims.Geocoder.Models -{ - public class FeatureModel - { - #region Properties - public string Type { get; set; } - public GeometryModel Geometry { get; set; } - public PropertyModel Properties { get; set; } - #endregion - } -} diff --git a/backend/geocoder/Models/GeometeryModel.cs b/backend/geocoder/Models/GeometeryModel.cs deleted file mode 100644 index 0cd8d1e607..0000000000 --- a/backend/geocoder/Models/GeometeryModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Pims.Geocoder.Models -{ - public class GeometeryModel - { - #region Properties - public string Type { get; set; } - public CrsModel Crs { get; set; } - public double[] Coordinates { get; set; } - #endregion - } -} diff --git a/backend/geocoder/Models/GeometryModel.cs b/backend/geocoder/Models/GeometryModel.cs deleted file mode 100644 index 20f51c23f1..0000000000 --- a/backend/geocoder/Models/GeometryModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Pims.Geocoder.Models -{ - public class GeometryModel - { - #region Properties - public string Type { get; set; } - public CrsModel Crs { get; set; } - public double[] Coordinates { get; set; } - #endregion - } -} diff --git a/backend/geocoder/Models/PropertyModel.cs b/backend/geocoder/Models/PropertyModel.cs deleted file mode 100644 index 2c2fcdd999..0000000000 --- a/backend/geocoder/Models/PropertyModel.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Pims.Core.Converters; -using System.Collections.Generic; -using System.Text.Json.Serialization; - -namespace Pims.Geocoder.Models -{ - public class PropertyModel - { - #region Properties - public string FullAddress { get; set; } - public int Score { get; set; } - public string MatchPrecision { get; set; } - public int PrecisionPoints { get; set; } - public IEnumerable Faults { get; set; } - public string SiteName { get; set; } - public string UnitDesignator { get; set; } - [JsonConverter(typeof(Int32ToStringJsonConverter))] - public string UnitNumber { get; set; } - public string UnitNumberSuffix { get; set; } - [JsonConverter(typeof(Int32ToStringJsonConverter))] - public string CivicNumber { get; set; } - public string CivicNumberSuffix { get; set; } - [JsonConverter(typeof(Int32ToStringJsonConverter))] - public string StreetName { get; set; } - public string StreetType { get; set; } - [JsonConverter(typeof(BooleanJsonConverter))] - public bool IsStreetTypePrefix { get; set; } - public string StreetDirection { get; set; } - [JsonConverter(typeof(BooleanJsonConverter))] - public bool IsStreetDirectionPrefix { get; set; } - public string StreetQualifier { get; set; } - public string LocalityName { get; set; } - public string LocalityType { get; set; } - public string ElectoralArea { get; set; } - public string ProvinceCode { get; set; } - public string LocationPositionalAccuracy { get; set; } - public string LocationDescriptor { get; set; } - public string SiteID { get; set; } - [JsonConverter(typeof(Int32ToStringJsonConverter))] - public string BlockID { get; set; } - public string FullSiteDescriptor { get; set; } - public string AccessNotes { get; set; } - public string SiteStatus { get; set; } - public string SiteRetireDate { get; set; } - public string ChangeDate { get; set; } - public string IsOfficial { get; set; } - #endregion - } -} diff --git a/backend/geocoder/Models/SitePidsResponseModel.cs b/backend/geocoder/Models/SitePidsResponseModel.cs deleted file mode 100644 index 39ae84ad00..0000000000 --- a/backend/geocoder/Models/SitePidsResponseModel.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace Pims.Geocoder.Models -{ - public class SitePidsResponseModel - { - #region Properties - public Guid SiteID { get; set; } - public string Pids { get; set; } - #endregion - } -} diff --git a/backend/geocoder/Parameters/AddressesParameters.cs b/backend/geocoder/Parameters/AddressesParameters.cs deleted file mode 100644 index e3ffd3f166..0000000000 --- a/backend/geocoder/Parameters/AddressesParameters.cs +++ /dev/null @@ -1,186 +0,0 @@ -namespace Pims.Geocoder.Parameters -{ - /// - /// AddressesParameters class, provides a way to pass parametesr to the addresses endpoint. - /// - public class AddressesParameters - { - #region Properties - /// - /// get/set - The API version. - /// - public string Ver { get; set; } = "1.2"; - - /// - /// get/set - Civic address or intersection address as a single string in Single-line Address Format. If not present in an address request, individual address elements, such as streetName, localityName, and provinceCode must be provided. - /// In an occupant/addresses resource, addressString represents an Occupant name followed by a frontGate delimiter('--') followed by an optional address. - /// - public string AddressString { get; set; } - - /// - /// get/set - Describes the nature of the address location. Values include accessPoint, frontDoorPoint, parcelPoint, rooftopPoint, and routingPoint. As an input parameter, a value of any is allowed. When any is specified, a point type other than accessPoint will be returned if one is defined; otherwise, an accessPoint will be returned. - /// - public string LocationDescriptor { get; set; } = "any"; - - /// - /// get/set - The maximum number of search results to return. - /// - public int MaxResults { get; set; } = 5; - - /// - /// get/set - In the case of a block level match, the method of interpolation to determine how far down the block the accessPoint should be. The geocoder supports linear and adaptive interpolation. - /// - public string Interpolation { get; set; } = "adaptive"; - - /// - /// get/set - If true, include unmatched address details such as site name in results. - /// - public bool Echo { get; set; } - - /// - /// get/set - If true, include only basic match and address details in results. Not supported for shp, csv, and gml formats. - /// - public bool Brief { get; set; } - - /// - /// get/set - If true, addressString is expected to contain a partial address that requires completion. Not supported for shp, csv, gml formats. - /// - public bool AutoComplete { get; set; } - - /// - /// get/set - The distance to move the accessPoint away from the curb and towards the inside of the parcel (in metres). Ignored if locationDescriptor not set to accessPoint. - /// - public int SetBack { get; set; } - - /// - /// get/set - The EPSG code of the spatial reference system used to state the coordination location of a named feature. It is ignored if KML output is specified since KML only supports 4326 (WGS84). Allowed values are: - /// 3005: BC Albers - /// 4326: WGS 84 (default) - /// 26907-26911: NAD83/UTM Zones 7N through 11N - /// 32607-32611: WGS84/UTM Zones 7N through 11N - /// 26707-26711: NAD27/UTM Zones 7N through 11N - /// - public int OutputSRS { get; set; } = 4326; - - /// - /// get/set - The minimum score required for a match to be returned. - /// - public int MinScore { get; set; } - - /// - /// get/set - The level of precision of an address match. Here are the nine levels from the most precise to least precise: - /// OCCUPANT – the site occupant name matched - /// SITE – the site name matched - /// UNIT – the unit number, unit number suffix, and unit designator matched - /// CIVIC_NUMBER – the civic number matched - /// INTERSECTION – the intersection matched - /// BLOCK – the civic number falls within a known block range - /// STREET – the street name, street direction, and street type matched - /// LOCALITY – the locality matched - /// PROVINCE - no match - /// When used as an input parameter, matchPrecision is a comma-separated list of matchPrecision levels.Only matches with a matchPrecision in this list will be included in the request results.For example, matchPrecision = STREET will only include street-level matches. - /// - public string MatchPrecision { get; set; } - - /// - /// get/set - A comma-separated list of matchPrecision levels to exclude from request results. For example, &matchPrecisionNot=UNIT,SITE will exclude matches at the unit and site levels. - /// - public string MatchPrecisionNot { get; set; } - - /// - /// get/set - A string containing the name of a site (e.g., Duck Building, Casa Del Mar, Crystal Garden, Bluebird House). A business name should only be used if it is permanently affixed to the site and the site has no other, more generic name. If a site is a unit within a complex, it may have a sitename in addition to a unitNumber and unitNumberSuffix. - /// - public string SiteName { get; set; } - - /// - /// get/set - The type of unit. Examples include APT, BLDG, BSMT, FLR, LOBBY, LWR, PAD, PH, REAR, RM, SIDE, SITE, SUITE, TH, UNIT, UPPR. - /// - public string UnitDesignator { get; set; } - - /// - /// get/set - The number of the unit, suite, or apartment within a house or building. - /// - public string UnitNumber { get; set; } - - /// - /// get/set - A letter that follows the unit number as in Unit 1A or Suite 302B. - /// - public string UnitNumberSuffix { get; set; } - - /// - /// get/set - The official number assigned to a site by an address authority. - /// - public string CivicNumber { get; set; } - - /// - /// get/set - A letter or fraction that follows the civic number (e.g., the A in 1039A Bledsoe St). - /// - public string CivicNumberSuffix { get; set; } - - /// - /// get/set - The official name of the street as assigned by an address authority (e.g., the Douglas in 1175 Douglas Street). - /// - public string StreetName { get; set; } - - /// - /// get/set - The type of street as assigned by a municipality (e.g., the ST in 1175 DOUGLAS St). - /// - public string StreetType { get; set; } - - /// - /// get/set - The abbreviated compass direction as defined by Canada Post and B.C. civic addressing authorities. - /// - public string StreetDirection { get; set; } - - /// - /// get/set - Example: the Bridge in Johnson St Bridge. The qualifier of a street name. - /// - public string StreetQualifier { get; set; } - - /// - /// get/set - The name of the locality assigned to a given site by an address authority. - /// - public string LocalityName { get; set; } - - /// - /// get/set - The ISO 3166-2 Sub-Country Code. The code for British Columbia is BC. - /// - public string ProvinceCode { get; set; } - - /// - /// get/set - A comma separated list of locality names that matched addresses must belong to. For example, setting localities to Nanaimo only returns addresses in Nanaimo - /// - public string Localities { get; set; } - - /// - /// get/set - A comma-separated list of localities to exclude from the search. - /// - public string NotLocalities { get; set; } - - /// - /// get/set - Example: -126.07929,49.7628,-126.0163,49.7907. A bounding box (xmin,ymin,xmax,ymax) that limits the search area. - /// - public string Bbox { get; set; } - - /// - /// get/set - Example: -124.0165926,49.2296251 . The coordinates of a centre point (x,y) used to define a bounding circle that will limit the search area. This parameter must be specified together with 'maxDistance'. - /// - public string Center { get; set; } - - /// - /// get/set - The maximum distance (in metres) to search from the given point. If not specified, the search distance is unlimited. - /// - public double MaxDistance { get; set; } - - /// - /// get/set - If true, uses supplied parcelPoint to derive an appropriate accessPoint. - /// - public bool Extrapolate { get; set; } - - /// - /// get/set - The coordinates of a point (x,y) known to be inside the parcel containing a given address. - /// - public string ParcelPoint { get; set; } - #endregion - } -} diff --git a/backend/geocoder/Pims.Geocoder.csproj b/backend/geocoder/Pims.Geocoder.csproj deleted file mode 100644 index 0da8f3425b..0000000000 --- a/backend/geocoder/Pims.Geocoder.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - net7.0 - Library - 1.0.0.0 - 1.0.0.0 - BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC - - - - - - - - - - - - - - - diff --git a/backend/keycloak/Configuration/KeycloakAdminOptions.cs b/backend/keycloak/Configuration/KeycloakAdminOptions.cs deleted file mode 100644 index 6dc8e0f0da..0000000000 --- a/backend/keycloak/Configuration/KeycloakAdminOptions.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Pims.Core.Exceptions; -using System; -using System.ComponentModel.DataAnnotations; - -namespace Pims.Keycloak.Configuration -{ - /// - /// KeycloakAdminOptions class, provides a way to configure the keycloak admin API endpoints. - /// - public class KeycloakAdminOptions - { - #region Properties - /// - /// get/set - The authority URL to the keycloak admin API. - /// - /// - [Required(ErrorMessage = "Configuration Keycloak:Admin:Authority is required.")] - public string Authority { get; set; } - - /// - /// get/set - The users endpoint path. - /// - /// - public string Users { get; set; } - #endregion - - #region Methods - /// - /// Validates the configuration for the admin endpoints. - /// - /// If the configuration property is invald. - public void Validate() - { - if (String.IsNullOrWhiteSpace(this.Authority)) - throw new ConfigurationException("The configuration for Keycloak:Admin:Authority is invalid or missing."); - - if (String.IsNullOrWhiteSpace(this.Users)) - throw new ConfigurationException("The configuration for Keycloak:Admin:Users is invalid or missing."); - } - #endregion - } -} diff --git a/backend/keycloak/Configuration/KeycloakOptions.cs b/backend/keycloak/Configuration/KeycloakOptions.cs deleted file mode 100644 index 00017e8da6..0000000000 --- a/backend/keycloak/Configuration/KeycloakOptions.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Pims.Core.Exceptions; -using Pims.Core.Http.Configuration; -using System; - -namespace Pims.Keycloak.Configuration -{ - /// - /// KeycloakOptions class, provides a way to configure keycloak. - /// - public class KeycloakOptions : AuthClientOptions - { - #region Properties - /// - /// get/set - The keycloak service account configuration. - /// This is for authenticating the api interaction with keycloak. - /// - /// - public KeycloakServiceAccountOptions ServiceAccount { get; set; } - - /// - /// get/set - The keycloak open id connect endpoint configuration. - /// - /// - public OpenIdConnectOptions OpenIdConnect { get; set; } - - /// - /// get/set - The keycloak admin API endpoint configuration. - /// - /// - public KeycloakAdminOptions Admin { get; set; } - #endregion - - #region Methods - /// - /// Validates the configuration for keycloak. - /// - /// If the configuration property is invald. - public override void Validate() - { - if (String.IsNullOrWhiteSpace(this.Authority)) - throw new ConfigurationException("The configuration for Keycloak:Authority is invalid or missing."); - if (String.IsNullOrWhiteSpace(this.Audience)) - throw new ConfigurationException("The configuration for Keycloak:Audience is invalid or missing."); - if (String.IsNullOrWhiteSpace(this.Client)) - throw new ConfigurationException("The configuration for Keycloak:Client is invalid or missing."); - } - #endregion - } -} diff --git a/backend/keycloak/Configuration/KeycloakServiceAccountOptions.cs b/backend/keycloak/Configuration/KeycloakServiceAccountOptions.cs deleted file mode 100644 index 4377326024..0000000000 --- a/backend/keycloak/Configuration/KeycloakServiceAccountOptions.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Pims.Core.Exceptions; -using Pims.Core.Http.Configuration; -using System; - -namespace Pims.Keycloak.Configuration -{ - /// - /// KeycloakServiceAccountOptions class, provides a way to configure keycloak service account. - /// - public class KeycloakServiceAccountOptions : AuthClientOptions - { - #region Methods - /// - /// Validate the configuration. - /// - /// The configuration is missing or invalid. - public override void Validate() - { - if (String.IsNullOrWhiteSpace(this.Client)) - throw new ConfigurationException("The configuration for Keycloak:ServiceAccount:Client is invalid or missing."); - - if (String.IsNullOrWhiteSpace(this.Secret)) - throw new ConfigurationException("The configuration for Keycloak:ServiceAccount:Secret is invalid or missing."); - } - #endregion - } -} diff --git a/backend/keycloak/Extensions/HttpResponseMessageExtensions.cs b/backend/keycloak/Extensions/HttpResponseMessageExtensions.cs deleted file mode 100644 index cc88d39410..0000000000 --- a/backend/keycloak/Extensions/HttpResponseMessageExtensions.cs +++ /dev/null @@ -1,75 +0,0 @@ -using Pims.Core.Exceptions; -using Pims.Core.Extensions; -using System; -using System.Net; -using System.Net.Http; -using System.Threading.Tasks; - -namespace Pims.Keycloak.Extensions -{ - /// - /// HttpResponseMessageExtensions static class, provides extension methods for HttpResponseMessage objects. - /// - public static class HttpResponseMessageExtensions - { - /// - /// Provides a generic way to deserialize the response to return the specified 'T' type, or to throw an exception if the request failed. - /// - /// - /// - /// The request failed. - /// - public static async Task HandleResponseAsync(this HttpResponseMessage response) - { - if (response.IsSuccessStatusCode) - { - if (response.StatusCode != HttpStatusCode.NoContent) - { - try - { - using var responseStream = await response.Content.ReadAsStreamAsync(); - return await responseStream.DeserializeAsync(); - } - catch (Exception ex) - { - throw new HttpClientRequestException(response, ex); - } - } - - return default; - } - else - { - if (response.StatusCode == HttpStatusCode.NotFound) - { - // Keycloak returns 404s when an item doesn't exist instead of the correct 204... - // We will have to assume that all 404 are now item does not exist and should be returning a 204 instead. - // We will then return 'null'. - return default; - } - throw new HttpClientRequestException(response); - } - } - - - /// - /// Provides a generic way to return the specified restul, or to throw an exception if the request failed. - /// - /// - /// - /// - /// The request failed. - /// - public static T HandleResponse(this HttpResponseMessage response, T result) - { - if (response.IsSuccessStatusCode) - { - return result; - } - else - { - throw new HttpClientRequestException(response); - } - } - } -} diff --git a/backend/keycloak/Extensions/ServiceCollectionExtensions.cs b/backend/keycloak/Extensions/ServiceCollectionExtensions.cs deleted file mode 100644 index aec90e7bfb..0000000000 --- a/backend/keycloak/Extensions/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; - -namespace Pims.Keycloak -{ - /// - /// ServiceCollectionExtensions static class, provides extension methods for ServiceCollectionExtensions objects. - /// - public static class ServiceCollectionExtensions - { - /// - /// Add the PimsKeycloakService to the dependency injection service collection. - /// - /// - /// - public static IServiceCollection AddKeycloakService(this IServiceCollection services) - { - return services.AddScoped(); - } - } -} diff --git a/backend/keycloak/IKeycloakService.cs b/backend/keycloak/IKeycloakService.cs deleted file mode 100644 index 4cb7c8b7e9..0000000000 --- a/backend/keycloak/IKeycloakService.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System; -using System.Threading.Tasks; - -namespace Pims.Keycloak -{ - public interface IKeycloakService - { - #region Attack Detection - Task DeleteAttackDetectionAsync(); - #endregion - - #region Users - Task GetUserCountAsync(); - Task GetUsersAsync(int first = 0, int max = 10, string search = null); - Task GetUserAsync(Guid id); - Task CreateUserAsync(Models.UserModel user); - Task UpdateUserAsync(Models.UserModel user); - Task DeleteUserAsync(Guid id); - Task GetUserGroupsAsync(Guid id); - Task GetUserGroupCountAsync(Guid id); - Task AddGroupToUserAsync(Guid userId, Guid groupId); - Task RemoveGroupFromUserAsync(Guid userId, Guid groupId); - #endregion - - #region Groups - Task GetGroupCountAsync(); - Task GetGroupsAsync(int first = 0, int max = 10, string search = null); - Task GetGroupAsync(Guid id); - Task CreateGroupAsync(Models.GroupModel group); - Task CreateSubGroupAsync(Guid parentId, Models.GroupModel group); - Task UpdateGroupAsync(Models.GroupModel group); - Task DeleteGroupAsync(Guid id); - Task GetGroupMembersAsync(Guid id, int first = 0, int max = 10); - #endregion - - #region Roles - #region By ID - Task GetRoleAsync(Guid id); - Task UpdateRoleAsync(Models.RoleModel role); - Task DeleteRoleAsync(Guid id); - Task CreateCompositeRolesAsync(Guid parentId, Models.RoleModel[] roles); - Task GetCompositeRolesAsync(Guid parentId); - Task DeleteCompositeRolesAsync(Guid parentId, Models.RoleModel[] roles); - Task GetClientCompositeRolesAsync(Guid parentId, string clientName); - Task GetRealmCompositeRolesAsync(Guid parentId); - #endregion - - #region Realm - Task GetRolesAsync(); - Task GetRoleAsync(string name); - Task CreateRoleAsync(Models.RoleModel role); - Task UpdateRoleAsync(string name, Models.RoleModel role); - Task DeleteRoleAsync(string name); - Task CreateCompositeRoleAsync(string parentName, Models.RoleModel role); - Task GetCompositeRolesAsync(string parentName); - Task DeleteCompositeRolesAsync(string parentName, Models.RoleModel[] roles); - Task GetClientCompositeRolesAsync(string parentName, string clientName); - Task GetRealmCompositeRolesAsync(string parentName); - Task GetRoleMembersAsync(string parentName, int first = 0, int max = 10); - #endregion - - #region Client - Task GetRolesAsync(Guid clientId); - Task GetRoleAsync(Guid clientId, string name); - Task CreateRoleAsync(Guid clientId, Models.RoleModel role); - Task UpdateRoleAsync(Guid clientId, Models.RoleModel role); - Task DeleteRoleAsync(Guid clientId, string name); - Task CreateCompositeRoleAsync(Guid clientId, string parentName, Models.RoleModel role); - Task GetCompositeRolesAsync(Guid clientId, string parentName); - Task DeleteCompositeRoleAsync(Guid clientId, string parentName, Models.RoleModel[] roles); - Task GetClientCompositeRolesAsync(Guid clientId, string parentName, string clientName); - Task GetRealmCompositeRolesAsync(Guid clientId, string parentName); - Task GetRoleMembersAsync(Guid clientId, string parentName, int first = 0, int max = 10); - #endregion - #endregion - } -} - diff --git a/backend/keycloak/KeycloakService.cs b/backend/keycloak/KeycloakService.cs deleted file mode 100644 index 7ad921e886..0000000000 --- a/backend/keycloak/KeycloakService.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Microsoft.Extensions.Options; -using Pims.Core.Http; - -namespace Pims.Keycloak -{ - /// - /// KeycloakService class, provides a service for sending HTTP requests to the keycloak admin API. - /// - https://www.keycloak.org/docs-api/5.0/rest-api/index.html#_overview - /// - public partial class KeycloakService : IKeycloakService - { - #region Variables - private readonly IOpenIdConnectRequestClient _client; - #endregion - - #region Properties - /// - /// get - The configuration options for keycloak. - /// - /// - public Configuration.KeycloakOptions Options { get; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a KeycloakAdmin class, initializes it with the specified arguments. - /// - /// - /// - public KeycloakService(IOpenIdConnectRequestClient client, IOptions options) - { - this.Options = options.Value; - this.Options.Validate(); // TODO: Figure out how to automatically validate. - this.Options.Admin.Validate(); - this.Options.OpenIdConnect.Validate(); - this.Options.ServiceAccount.Validate(); - _client = client; - _client.AuthClientOptions.Audience = this.Options.ServiceAccount.Audience ?? this.Options.Audience; - _client.AuthClientOptions.Authority = this.Options.ServiceAccount.Authority ?? this.Options.Authority; - _client.AuthClientOptions.Client = this.Options.ServiceAccount.Client; - _client.AuthClientOptions.Secret = this.Options.ServiceAccount.Secret; - } - #endregion - - #region Methods - #endregion - } -} diff --git a/backend/keycloak/Models/CountModel.cs b/backend/keycloak/Models/CountModel.cs deleted file mode 100644 index a8eefe16c8..0000000000 --- a/backend/keycloak/Models/CountModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace Pims.Keycloak.Models -{ - /// - /// CountModel class, provides a way to deserialize counts. - /// - public class CountModel - { - #region Properties - /// - /// get/set - The number of items returned - /// - /// - public int Count { get; set; } - #endregion - } -} diff --git a/backend/keycloak/Models/GroupModel.cs b/backend/keycloak/Models/GroupModel.cs deleted file mode 100644 index d778f4159a..0000000000 --- a/backend/keycloak/Models/GroupModel.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Keycloak.Models -{ - /// - /// GroupModel class, provides a way to manage groups within keycloak. - /// - public class GroupModel - { - #region Properties - /// - /// get/set - The unique key that identifies this group. - /// - /// - public Guid Id { get; set; } - - /// - /// get/set - The unique name for this group. - /// - /// - public string Name { get; set; } - - /// - /// get/set - The path to the group. - /// - /// - public string Path { get; set; } - - /// - /// get/set - A dictionary of client roles. - /// - /// - public Dictionary ClientRoles { get; set; } - - /// - /// get/set - An array of realm roles. - /// - /// - public IEnumerable RealmRoles { get; set; } - - /// - /// get/set - A dictionary of group attributes. - /// - /// - public Dictionary Attributes { get; set; } - - /// - /// get/set - An array of sub-groups. - /// - /// - public GroupModel[] SubGroups { get; set; } - #endregion - } -} diff --git a/backend/keycloak/Models/RoleCompositieModel.cs b/backend/keycloak/Models/RoleCompositieModel.cs deleted file mode 100644 index 7fee3d6460..0000000000 --- a/backend/keycloak/Models/RoleCompositieModel.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Collections.Generic; - -namespace Pims.Keycloak.Models -{ - /// - /// RoleCompositeModel class, provides a way to manage role composites within keycloak. - /// - public class RoleCompositeModel - { - #region Properties - /// - /// get/set - A dictionary of clients. - /// - /// - public Dictionary Client { get; set; } - - /// - /// get/set - An array of realms. - /// - /// - public IEnumerable Realm { get; set; } - #endregion - } -} diff --git a/backend/keycloak/Models/RoleModel.cs b/backend/keycloak/Models/RoleModel.cs deleted file mode 100644 index 1c40343620..0000000000 --- a/backend/keycloak/Models/RoleModel.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Keycloak.Models -{ - /// - /// RoleModel class, provides a way to manage roles within keycloak. - /// - public class RoleModel - { - #region Properties - /// - /// get/set - The unique key that identifies this role. - /// - /// - public Guid Id { get; set; } - - /// - /// get/set - The unique name for this role. - /// - /// - public string Name { get; set; } - - /// - /// get/set - The description of the role. - /// - /// - public string Description { get; set; } - - /// - /// get/set - Whether this role belongs to a client. - /// - /// - public bool ClientRole { get; set; } - - /// - /// get/set - Whether this role is a composite role. - /// - /// - public bool Composite { get; set; } - - /// - /// get/set - The unique container Id for this role. - /// - /// - public string ContainerId { get; set; } - - /// - /// get/set - A tree of composite roles. - /// - /// - public RoleCompositeModel Composites { get; set; } - - /// - /// get/set - A dictionary of user attributes. - /// - /// - public Dictionary Attributes { get; set; } - #endregion - } -} diff --git a/backend/keycloak/Models/UserInfoModel.cs b/backend/keycloak/Models/UserInfoModel.cs deleted file mode 100644 index d0a0fa5c86..0000000000 --- a/backend/keycloak/Models/UserInfoModel.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; - -namespace Pims.Keycloak.Models -{ - /// - /// UserInfoModel class, provides a way to manage user information from the membership datasource. - /// - public class UserInfoModel - { - #region Properties - /// - /// get/set - The unique key for the user. - /// - /// - public Guid Id { get; set; } - - /// - /// get/set - The username for the user. - /// - /// - public string Username { get; set; } - - /// - /// get/set - The given name of the user. - /// - /// - public string FirstName { get; set; } - - /// - /// get/set - The surname of the user. - /// - /// - public string LastName { get; set; } - - /// - /// get/set - The user's email. - /// - /// - public string Email { get; set; } - - /// - /// get/set - Whether the user's email has been verified. - /// - /// - public bool EmailVerified { get; set; } - - /// - /// get/set - An array of realm roles the user is a member of. - /// - /// - public string[] RealmRoles { get; set; } - - /// - /// get/set - An array of client roles the user is a member of. - /// - /// - public string[] ClientRoles { get; set; } - - /// - /// get/set - An array of groups the user is a member of. - /// - /// - public string[] Groups { get; set; } - - /// - /// get/set - An array of agencies the user is a member of. - /// - /// - public int[] Agencies { get; set; } - #endregion - } -} diff --git a/backend/keycloak/Models/UserModel.cs b/backend/keycloak/Models/UserModel.cs deleted file mode 100644 index 1085ea3bf0..0000000000 --- a/backend/keycloak/Models/UserModel.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Keycloak.Models -{ - /// - /// UserModel class, provides a way to manage users within keycloak. - /// - public class UserModel - { - #region Properties - /// - /// get/set - The unique key that identifies this user. - /// - /// - public Guid Id { get; set; } - - /// - /// get/set - The unique user name for this user. - /// - /// - public string Username { get; set; } - - /// - /// get/set - The user's given name. - /// - /// - public string FirstName { get; set; } - - /// - /// get/set - The user's surname. - /// - /// - public string LastName { get; set; } - - /// - /// get/set - The user's email. - /// - /// - public string Email { get; set; } - - /// - /// get/set - Whether the user's email has been verified. - /// - /// - public bool? EmailVerified { get; set; } - - /// - /// get/set - Whether the user is enabled. - /// - /// - public bool Enabled { get; set; } - - /// - /// get/set - An array of realm roles the user belongs to. - /// - /// - public string[] RealmRoles { get; set; } - - /// - /// get/set - An array of client roles the user belongs to. - /// - /// - public string[] ClientRoles { get; set; } - - /// - /// get/set - An array of groups the user belongs to. - /// - /// - public string[] Groups { get; set; } - - /// - /// get/set - A dictionary of user attributes. - /// - /// - public Dictionary Attributes { get; set; } - #endregion - } -} diff --git a/backend/keycloak/Partials/KeycloakServiceAttackDetection.cs b/backend/keycloak/Partials/KeycloakServiceAttackDetection.cs deleted file mode 100644 index 19e780ddc3..0000000000 --- a/backend/keycloak/Partials/KeycloakServiceAttackDetection.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Pims.Core.Exceptions; -using System.Threading.Tasks; - -namespace Pims.Keycloak -{ - /// - /// KeycloakAdmin class, provides a service for sending HTTP requests to the keycloak admin API. - /// - https://www.keycloak.org/docs-api/5.0/rest-api/index.html#_overview - /// - public partial class KeycloakService : IKeycloakService - { - #region Methods - /// - /// Clear any user login failures for all users This can release temporary disabled users - /// - /// - public async Task DeleteAttackDetectionAsync() - { - var response = await _client.DeleteAsync($"{this.Options.Admin.Authority}/attack-detection/brute-force/users"); - - if (!response.IsSuccessStatusCode) - throw new HttpClientRequestException(response); - } - #endregion - } -} diff --git a/backend/keycloak/Partials/KeycloakServiceGroups.cs b/backend/keycloak/Partials/KeycloakServiceGroups.cs deleted file mode 100644 index 546931ed10..0000000000 --- a/backend/keycloak/Partials/KeycloakServiceGroups.cs +++ /dev/null @@ -1,127 +0,0 @@ -using Pims.Core.Extensions; -using Pims.Keycloak.Extensions; -using System; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; - -namespace Pims.Keycloak -{ - /// - /// KeycloakAdmin class, provides a service for sending HTTP requests to the keycloak admin API. - /// - https://www.keycloak.org/docs-api/5.0/rest-api/index.html#_overview - /// - public partial class KeycloakService : IKeycloakService - { - #region Methods - /// - /// Get the total number of groups. - /// - /// - public async Task GetGroupCountAsync() - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/groups/count"); - var result = await response.HandleResponseAsync(); - - return result.Count; - } - - /// - /// Get an array of groups. - /// This method supports paging. - /// - /// - /// - /// - /// - public async Task GetGroupsAsync(int first = 0, int max = 10, string search = null) - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/groups?first={first}&max={max}&search={search}"); - - return await response.HandleResponseAsync(); - } - - /// - /// Get the group for the specified 'id'. - /// - /// - /// - public async Task GetGroupAsync(Guid id) - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/groups/{id}"); - - return await response.HandleResponseAsync(); - } - - /// - /// Create a new group. - /// - /// - /// - public async Task CreateGroupAsync(Models.GroupModel group) - { - var json = group.Serialize(); - var content = new StringContent(json, Encoding.UTF8, "application/json"); - var response = await _client.PostAsync($"{this.Options.Admin.Authority}/groups", content); - - return await response.HandleResponseAsync(); - } - - /// - /// Create a sub-group to the parent group specified for the 'parentId'. - /// - /// - /// - /// - public async Task CreateSubGroupAsync(Guid parentId, Models.GroupModel group) - { - var json = group.Serialize(); - var content = new StringContent(json, Encoding.UTF8, "application/json"); - var response = await _client.PostAsync($"{this.Options.Admin.Authority}/groups/{parentId}/children", content); - - return await response.HandleResponseAsync(); - } - - /// - /// Update the specified group. - /// - /// - /// - public async Task UpdateGroupAsync(Models.GroupModel group) - { - var json = group.Serialize(); - var content = new StringContent(json, Encoding.UTF8, "application/json"); - var response = await _client.PutAsync($"{this.Options.Admin.Authority}/groups/{group.Id}", content); - - return response.HandleResponse(group); - } - - /// - /// Delete the group specified for the 'id'. - /// - /// - /// - public async Task DeleteGroupAsync(Guid id) - { - var response = await _client.DeleteAsync($"{this.Options.Admin.Authority}/groups/{id}"); - - return response.HandleResponse(id); - } - - /// - /// Get an array of users that are members of the group specified by the 'id'. - /// This method supports paging. - /// - /// - /// - /// - /// - public async Task GetGroupMembersAsync(Guid id, int first = 0, int max = 10) - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/groups/{id}/members?first={first}&max={max}"); - - return await response.HandleResponseAsync(); - } - #endregion - } -} diff --git a/backend/keycloak/Partials/KeycloakServiceRoles.cs b/backend/keycloak/Partials/KeycloakServiceRoles.cs deleted file mode 100644 index b174dfcfdc..0000000000 --- a/backend/keycloak/Partials/KeycloakServiceRoles.cs +++ /dev/null @@ -1,430 +0,0 @@ -using Pims.Core.Extensions; -using Pims.Keycloak.Extensions; -using System; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; - -namespace Pims.Keycloak -{ - /// - /// KeycloakAdmin class, provides a service for sending HTTP requests to the keycloak admin API. - /// - https://www.keycloak.org/docs-api/5.0/rest-api/index.html#_overview - /// - public partial class KeycloakService : IKeycloakService - { - #region Methods - #region By ID - /// - /// Get the role for the specified 'id'. - /// - /// - /// - public async Task GetRoleAsync(Guid id) - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/roles-by-id/{id}"); - - return await response.HandleResponseAsync(); - } - - /// - /// Update the specified role. - /// - /// - /// - public async Task UpdateRoleAsync(Models.RoleModel role) - { - var json = role.Serialize(); - var content = new StringContent(json, Encoding.UTF8, "application/json"); - var response = await _client.PutAsync($"{this.Options.Admin.Authority}/roles-by-id/{role.Id}", content); - - return response.HandleResponse(role); - } - - /// - /// Delete the specified role. - /// - /// - /// - public async Task DeleteRoleAsync(Guid id) - { - var response = await _client.DeleteAsync($"{this.Options.Admin.Authority}/roles-by-id/{id}"); - - return response.HandleResponse(id); - } - - /// - /// Create a new composite role. - /// - /// - /// - /// - public async Task CreateCompositeRolesAsync(Guid parentId, Models.RoleModel[] roles) - { - var json = roles.Serialize(); - var content = new StringContent(json, Encoding.UTF8, "application/json"); - var response = await _client.PostAsync($"{this.Options.Admin.Authority}/roles-by-id/{parentId}/composites", content); - - return await response.HandleResponseAsync(); - } - - /// - /// Get an array of composite roles for the parent role with the specified 'parentId'. - /// - /// - /// - public async Task GetCompositeRolesAsync(Guid parentId) - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/roles-by-id/{parentId}/composites"); - - return await response.HandleResponseAsync(); - } - - /// - /// Delete the composite roles for the parent role with the specified 'parentId'. - /// - /// - /// - /// - public async Task DeleteCompositeRolesAsync(Guid parentId, Models.RoleModel[] roles) - { - var json = roles.Serialize(); - var content = new StringContent(json, Encoding.UTF8, "application/json"); - var response = await _client.DeleteAsync($"{this.Options.Admin.Authority}/roles-by-id/{parentId}/composites", content); - - return response.HandleResponse(roles); - } - - /// - /// Get an array of composite roles for the parent with the specified 'parentId' within the client for the specified 'clientName'. - /// - /// - /// - /// - public async Task GetClientCompositeRolesAsync(Guid parentId, string clientName) - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/roles-by-id/{parentId}/composites/clients/{clientName}"); - - return await response.HandleResponseAsync(); - } - - /// - /// Get an array of composite roles for the parent with the specified 'parentId' within the realm. - /// - /// - /// - public async Task GetRealmCompositeRolesAsync(Guid parentId) - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/roles-by-id/{parentId}/composites/realm"); - - return await response.HandleResponseAsync(); - } - #endregion - - #region Realm - /// - /// Get an array of realm roles. - /// - /// - public async Task GetRolesAsync() - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/roles"); - - return await response.HandleResponseAsync(); - } - - /// - /// Get the realm role for the specified 'name'. - /// - /// - /// - public async Task GetRoleAsync(string name) - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/roles/{name}"); - - return await response.HandleResponseAsync(); - } - - /// - /// Create a new realm role. - /// - /// - /// - public async Task CreateRoleAsync(Models.RoleModel role) - { - var json = role.Serialize(); - var content = new StringContent(json, Encoding.UTF8, "application/json"); - var response = await _client.PostAsync($"{this.Options.Admin.Authority}/roles", content); - - return await response.HandleResponseAsync(); - } - - /// - /// Update the realm role for the specified 'name'. - /// - /// - /// - /// - public async Task UpdateRoleAsync(string name, Models.RoleModel role) - { - var json = role.Serialize(); - var content = new StringContent(json, Encoding.UTF8, "application/json"); - var response = await _client.PutAsync($"{this.Options.Admin.Authority}/roles/{name}", content); - - return response.HandleResponse(role); - } - - /// - /// Delete the realm role for the specified 'name'. - /// - /// - /// - public async Task DeleteRoleAsync(string name) - { - var response = await _client.DeleteAsync($"{this.Options.Admin.Authority}/roles/{name}"); - - return response.HandleResponse(name); - } - - /// - /// Create a composite realm role for the parent with the specified 'parentName'. - /// - /// - /// - /// - public async Task CreateCompositeRoleAsync(string parentName, Models.RoleModel role) - { - var json = role.Serialize(); - var content = new StringContent(json, Encoding.UTF8, "application/json"); - var response = await _client.PostAsync($"{this.Options.Admin.Authority}/roles/{parentName}/composites", content); - - return await response.HandleResponseAsync(); - } - - /// - /// Get an array of composite realm roles for the specified 'parentName'. - /// - /// - /// - public async Task GetCompositeRolesAsync(string parentName) - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/roles/{parentName}/composites"); - - return await response.HandleResponseAsync(); - } - - /// - /// Delete the composite realm roles for the specified 'parentName'. - /// - /// - /// - /// - public async Task DeleteCompositeRolesAsync(string parentName, Models.RoleModel[] roles) - { - var json = roles.Serialize(); - var content = new StringContent(json, Encoding.UTF8, "application/json"); - var response = await _client.DeleteAsync($"{this.Options.Admin.Authority}/roles/{parentName}/composites", content); - - return response.HandleResponse(roles); - } - - /// - /// Get an array of client composite roles for the parent role specified by the 'parentName' and the client specified by the 'clientName'. - /// - /// - /// - /// - public async Task GetClientCompositeRolesAsync(string parentName, string clientName) - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/roles/{parentName}/composites/clients/{clientName}"); - - return await response.HandleResponseAsync(); - } - - /// - /// Get an array of realm composite roles for the parent specified by the 'parentName'. - /// - /// - /// - public async Task GetRealmCompositeRolesAsync(string parentName) - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/roles/{parentName}/composites/realm"); - - return await response.HandleResponseAsync(); - } - - /// - /// Get an array of users that belong to role for the specified 'name'. - /// This method support paging. - /// - /// - /// - /// - /// - public async Task GetRoleMembersAsync(string name, int first = 0, int max = 10) - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/roles/{name}/users?first={first}&max={max}"); - - return await response.HandleResponseAsync(); - } - #endregion - - #region Client - /// - /// Get an array of roles for the client specified by the 'clientId'. - /// - /// - /// - public async Task GetRolesAsync(Guid clientId) - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/clients/{clientId}/roles"); - - return await response.HandleResponseAsync(); - } - - /// - /// Get the role specified by the 'name', within the client specified by the 'clientId' - /// - /// - /// - /// - public async Task GetRoleAsync(Guid clientId, string name) - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/clients/{clientId}/roles/{name}"); - - return await response.HandleResponseAsync(); - } - - /// - /// Create a new role within the client specified by the 'clientId'. - /// - /// - /// - /// - public async Task CreateRoleAsync(Guid clientId, Models.RoleModel role) - { - var json = role.Serialize(); - var content = new StringContent(json, Encoding.UTF8, "application/json"); - var response = await _client.PostAsync($"{this.Options.Admin.Authority}/clients/{clientId}/roles", content); - - return await response.HandleResponseAsync(); - } - - /// - /// Update the role within the client specified by the 'clientId'. - /// - /// - /// - /// - public async Task UpdateRoleAsync(Guid clientId, Models.RoleModel role) - { - var json = role.Serialize(); - var content = new StringContent(json, Encoding.UTF8, "application/json"); - var response = await _client.PutAsync($"{this.Options.Admin.Authority}/clients/{clientId}/roles/{role.Name}", content); - - return response.HandleResponse(role); - } - - /// - /// Delete the role specified by the 'name' within the client specified by the 'clientId'. - /// - /// - /// - /// - public async Task DeleteRoleAsync(Guid clientId, string name) - { - var response = await _client.DeleteAsync($"{this.Options.Admin.Authority}/clients/{clientId}/roles/{name}"); - - return response.HandleResponse(name); - } - - /// - /// Create a new composite role within the client specified by the 'clientId', the belongs to the role specified by the 'parentName'. - /// - /// - /// - /// - /// - public async Task CreateCompositeRoleAsync(Guid clientId, string parentName, Models.RoleModel role) - { - var json = role.Serialize(); - var content = new StringContent(json, Encoding.UTF8, "application/json"); - var response = await _client.PostAsync($"{this.Options.Admin.Authority}/clients/{clientId}/roles/{parentName}/composites", content); - - return await response.HandleResponseAsync(); - } - - /// - /// Get an array of composite roles - /// - /// - /// - /// - public async Task GetCompositeRolesAsync(Guid clientId, string parentName) - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/clients/{clientId}/roles/{parentName}/composites"); - - return await response.HandleResponseAsync(); - } - - /// - /// Delete composite roles within the client specified by the 'clientId', that belong to the parent role specified by the 'parentName'. - /// - /// - /// - /// - /// - public async Task DeleteCompositeRoleAsync(Guid clientId, string parentName, Models.RoleModel[] roles) - { - var json = roles.Serialize(); - var content = new StringContent(json, Encoding.UTF8, "application/json"); - var response = await _client.DeleteAsync($"{this.Options.Admin.Authority}/clients/{clientId}/roles/{parentName}/composites", content); - - return response.HandleResponse(roles); - } - - /// - /// Get an array of composite roles within the client specified by the 'clientId', that belong to the parent role specified by the 'parentName' - /// - /// - /// - /// - /// - public async Task GetClientCompositeRolesAsync(Guid clientId, string parentName, string clientName) - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/clients/{clientId}/roles/{parentName}/composites/clients/{clientName}"); - - return await response.HandleResponseAsync(); - } - - /// - /// Get an array of composite roles within the client specified by the 'clientId', that belong to the parent role specified by the 'parentName' - /// - /// - /// - /// - public async Task GetRealmCompositeRolesAsync(Guid clientId, string parentName) - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/clients/{clientId}/roles/{parentName}/composites/realm"); - - return await response.HandleResponseAsync(); - } - - /// - /// Get an array of users who are within the client specified by the 'clientId', that belong to the parent role specified by the 'parentName'. - /// - /// - /// - /// - /// - /// - public async Task GetRoleMembersAsync(Guid clientId, string parentName, int first = 0, int max = 10) - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/clients/{clientId}/roles/{parentName}/users?first={first}&max={max}"); - - return await response.HandleResponseAsync(); - } - #endregion - #endregion - } -} diff --git a/backend/keycloak/Partials/KeycloakServiceUsers.cs b/backend/keycloak/Partials/KeycloakServiceUsers.cs deleted file mode 100644 index 711b1761f5..0000000000 --- a/backend/keycloak/Partials/KeycloakServiceUsers.cs +++ /dev/null @@ -1,149 +0,0 @@ -using Pims.Core.Extensions; -using Pims.Keycloak.Extensions; -using System; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; - -namespace Pims.Keycloak -{ - /// - /// KeycloakAdmin class, provides a service for sending HTTP requests to the keycloak admin API. - /// - https://www.keycloak.org/docs-api/5.0/rest-api/index.html#_overview - /// - public partial class KeycloakService : IKeycloakService - { - #region Methods - /// - /// Get the total number of users. - /// - /// - public async Task GetUserCountAsync() - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/users/count"); - var result = await response.HandleResponseAsync(); - - return result.Count; - } - - /// - /// Get an array of users. - /// This function supports paging. - /// - /// - /// - /// - /// - public async Task GetUsersAsync(int first = 0, int max = 10, string search = null) - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/users?first={first}&max={max}&search={search}"); - - return await response.HandleResponseAsync(); - } - - /// - /// Get the user for the specified 'id'. - /// - /// - /// - public async Task GetUserAsync(Guid id) - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/users/{id}"); - - return await response.HandleResponseAsync(); - } - - /// - /// Create a new user. - /// - /// - /// - public async Task CreateUserAsync(Models.UserModel user) - { - var json = user.Serialize(); - var content = new StringContent(json, Encoding.UTF8, "application/json"); - var response = await _client.PostAsync($"{this.Options.Admin.Authority}/users", content); - - return await response.HandleResponseAsync(); - } - - /// - /// Update the specified user. - /// - /// - /// - public async Task UpdateUserAsync(Models.UserModel user) - { - var json = user.Serialize(); - var content = new StringContent(json, Encoding.UTF8, "application/json"); - var response = await _client.PutAsync($"{this.Options.Admin.Authority}/users/{user.Id}", content); - - return response.HandleResponse(user.Id); - } - - /// - /// Delete the user for the specified 'id'. - /// - /// - /// - public async Task DeleteUserAsync(Guid id) - { - var response = await _client.DeleteAsync($"{this.Options.Admin.Authority}/users/{id}"); - - return response.HandleResponse(id); - } - - /// - /// Get an array of the groups the user for the specified 'id' is a member of. - /// - /// - /// - public async Task GetUserGroupsAsync(Guid id) - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/users/{id}/groups"); - - return await response.HandleResponseAsync(); - } - - /// - /// Get the total number of groups the user for the specified 'id' is a member of. - /// - /// - /// - public async Task GetUserGroupCountAsync(Guid id) - { - var response = await _client.GetAsync($"{this.Options.Admin.Authority}/users/{id}/groups/count"); - - return await response.HandleResponseAsync(); - } - - /// - /// Add the user to the group for the specified 'userId' and 'groupId'. - /// - /// - /// - /// - public async Task AddGroupToUserAsync(Guid userId, Guid groupId) - { - var response = await _client.PutAsync($"{this.Options.Admin.Authority}/users/{userId}/groups/{groupId}"); - - return response.HandleResponse(userId); - } - - /// - /// Remove the user from the group for the specified 'userId' and 'groupId'. - /// - /// - /// - /// - public async Task RemoveGroupFromUserAsync(Guid userId, Guid groupId) - { - var response = await _client.DeleteAsync($"{this.Options.Admin.Authority}/users/{userId}/groups/{groupId}"); - - return response.HandleResponse(userId); - } - - - #endregion - } -} diff --git a/backend/keycloak/Pims.Keycloak.csproj b/backend/keycloak/Pims.Keycloak.csproj deleted file mode 100644 index cf82d4119c..0000000000 --- a/backend/keycloak/Pims.Keycloak.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - net7.0 - Library - 1.0.0.0 - 1.0.0.0 - 970903E9-BC53-436F-BA77-C62349546425 - - - - - - - - - - - - - - - - diff --git a/backend/keycloak/README.md b/backend/keycloak/README.md deleted file mode 100644 index 1873c50aed..0000000000 --- a/backend/keycloak/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# Keycloak Admin Library - -This library provides a way to make HTTP requests to the [Keycloak Administration API](https://www.keycloak.org/docs-api/5.0/rest-api/index.html#_overview). -## Setting up local Keycloak to authenticate with DEV - -Login to your local Keycloak container: http://localhost:8080/ -Click on identity Providers from the left menu, then add a new "provider" of type "Keycloak OpenID Connect". -Give it an alias, it can be anything you want. - -Then fill in the following 5 fields: - - Authorization URL: https://dev.oidc.gov.bc.ca/auth/realms/xz0xtue5/protocol/openid-connect/auth - - Token URL: https://dev.oidc.gov.bc.ca/auth/realms/xz0xtue5/protocol/openid-connect/token - - Client Authentication: Client secret sent as post - - Client ID: local-PIMS - - Client Secret: For this you will need to copy the client secret from the "Local-PIMS" client on the Keycloak dev environment - -Once this is done, you should have the ability to login to your local PIMS environment using either the default users in the local database or now you should have a "new" option of using your IDIR or BCeID account which will authenticate with Keycloak in DEV. - -More documentation to come. diff --git a/backend/ltsa/Configuration/LtsaOptions.cs b/backend/ltsa/Configuration/LtsaOptions.cs deleted file mode 100644 index 70a6459477..0000000000 --- a/backend/ltsa/Configuration/LtsaOptions.cs +++ /dev/null @@ -1,40 +0,0 @@ -namespace Pims.Ltsa.Configuration -{ - /// - /// LtsaOptions class, provides a way to configure Ltsa options. - /// - public class LtsaOptions - { - #region Properties - /// - /// get/set - The authentication URL. - /// - public string AuthUrl { get; set; } - - /// - /// get/set - The URI to the LTSA API service. - /// - public string HostUri { get; set; } - - /// - /// get/set - The API username. - /// - public string UserName { get; set; } - - /// - /// get/set - The API user password. - /// - public string UserPassword { get; set; } - - /// - /// get/set - The LTSA integrator username. - /// - public string IntegratorUsername { get; set; } - - /// - /// get/set - The API integrator password. - /// - public string IntegratorPassword { get; set; } - #endregion - } -} diff --git a/backend/ltsa/Extensions/ServiceCollectionExtensions.cs b/backend/ltsa/Extensions/ServiceCollectionExtensions.cs deleted file mode 100644 index f532021a71..0000000000 --- a/backend/ltsa/Extensions/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Pims.Core.Http; -using System.IdentityModel.Tokens.Jwt; - -namespace Pims.Ltsa -{ - /// - /// ServiceCollectionExtensions static class, provides extension methods for ServiceCollection objects. - /// - public static class ServiceCollectionExtensions - { - /// - /// Add the AddLtsaService to the dependency injection service collection. - /// - /// - /// - /// - public static IServiceCollection AddLtsaService(this IServiceCollection services, IConfigurationSection section) - { - return services - .Configure(section) - .AddScoped() - .AddScoped() - .AddTransient(); - } - } -} diff --git a/backend/ltsa/ILtsaService.cs b/backend/ltsa/ILtsaService.cs deleted file mode 100644 index 342e47da37..0000000000 --- a/backend/ltsa/ILtsaService.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Pims.Core.Http.Models; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Pims.Ltsa -{ - public interface ILtsaService - { - Task GetTokenAsync(string pid); - Task ProcessLTSARequest(string pid); - } -} diff --git a/backend/ltsa/LtsaService.cs b/backend/ltsa/LtsaService.cs deleted file mode 100644 index 36199defe2..0000000000 --- a/backend/ltsa/LtsaService.cs +++ /dev/null @@ -1,204 +0,0 @@ -using Microsoft.Extensions.Options; -using Pims.Ltsa.Configuration; -using Pims.Core.Exceptions; -using Pims.Core.Http; -using Pims.Core.Http.Models; -using System; -using System.Text; -using System.Text.Json; -using System.Threading.Tasks; -using System.Net.Http; - -namespace Pims.Ltsa -{ - public class LtsaService : ILtsaService - { - #region Properties - protected IHttpRequestClient Client { get; } - public LtsaOptions Options { get; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a LtsaService, initializes with specified arguments. - /// - /// - /// - /// - public LtsaService(IOptions options, IHttpRequestClient client) //, IConfiguration configuration) - { - this.Options = options.Value; - this.Client = client; - } - #endregion - - - - #region Methods - - /// - /// Generates the URL for authentication. - /// - /// - private string AuthenticateUrl() - { - return $"{this.Options.AuthUrl}"; - } - - /// - /// Generates the URL for the LTSA api. - /// - /// - private string HostUri() - { - return $"{this.Options.HostUri}"; - } - - // Custom exception class for LTSAApi errors - public class LTSAApiException : Exception - { - public LTSAApiException(string message) : base(message) - { - } - } - - /// - /// Process the LTSA request by retrieving an access token, title summary information, and creating an order. - /// - /// The parcel identifier. - /// The LTSA order model. - public async Task ProcessLTSARequest(string pid) - { - // make a request to get an access token from LTSA - LtsaTokenModel ltsaToken = await GetTokenAsync(pid); - - // make a request to get title summary info from LTSA - LtsaTitleSummaryResponse titleSummaryResponse = await GetTitleSummary(ltsaToken.AccessToken, pid); - - // Access the first title summary in the list - LtsaTitleSummaryModel titleSummary = titleSummaryResponse.TitleSummaries[0]; - - // titleNumber and district code for making order request - string titleNumber = titleSummary.TitleNumber; - string landTitleDistrictCode = titleSummary.LandTitleDistrictCode; - - // make a request to get the LTSA Order - LtsaOrderModel order = await CreateOrderAsync(ltsaToken.AccessToken, titleNumber, landTitleDistrictCode); - - return order; - } - - /// - /// Makes an HTTP request to LTSA to get an access token for the specified parcel id. - /// - /// The parcel id for which to retrieve the access token. - /// The access token as a LtsaTokenModel. - public async Task GetTokenAsync(string pid) - { - var url = AuthenticateUrl(); - string integratorUsername = this.Options.IntegratorUsername; - string integratorPassword = this.Options.IntegratorPassword; - string myLtsaUserName = this.Options.UserName; - string myLtsaUserPassword = this.Options.UserPassword; - - var credentials = new - { - integratorUsername, - integratorPassword, - myLtsaUserName, - myLtsaUserPassword - }; - - string json = JsonSerializer.Serialize(credentials); - var content = new StringContent(json, Encoding.UTF8, "application/json"); - - try - { - return await this.Client.SendAsync(url, HttpMethod.Post, content); - } - catch (HttpClientRequestException ex) - { - Console.WriteLine($"Unable to get token from LTSA: {ex.Message}"); - throw new LTSAApiException(ex.Message); - } - } - - - /// - /// Retrieves title summaries from the API using the provided access token and parcel identifier. - /// - /// The access token for authentication. - /// The parcel identifier for filtering the results. - /// The response content as a string. - public async Task GetTitleSummary(string accessToken, string parcelIdentifier) - { - // Set the API endpoint URL - var apiUrl = HostUri() + "titleSummaries"; - // Create the request message - var queryParams = $"filter=parcelIdentifier:{parcelIdentifier}"; - var requestUrl = $"{apiUrl}?{queryParams}"; - - var headers = new HttpRequestMessage().Headers; - headers.Add("Accept", "application/vnd.ltsa.astra.titleSummaries+json"); - headers.Add("X-Authorization", $"Bearer {accessToken}"); - - try - { - return await this.Client.SendAsync(requestUrl, HttpMethod.Get, headers); - } - catch (HttpClientRequestException ex) - { - Console.WriteLine($"Failed to retrieve title summary for parcel id: {parcelIdentifier}. Status code: {ex.Message}"); - throw new LTSAApiException($"Failed to retrieve title summary for parcel id: {parcelIdentifier}. Status code: {ex.Message}"); - } - } - - /// - /// Makes a POST request to the API to create an order. - /// - /// The access token for authentication. - /// The title number for the order. - /// The land title district code for the order. - /// The response content as a string. - public async Task CreateOrderAsync(string accessToken, string titleNumber, string landTitleDistrictCode) - { - var apiUrl = HostUri() + "orders"; - - var headers = new HttpRequestMessage().Headers; - headers.Add("Accept", "application/vnd.ltsa.astra.orders+json"); - headers.Add("X-Authorization", $"Bearer {accessToken}"); - - var order = new - { - productType = "title", - fileReference = "Test", - productOrderParameters = new - { - titleNumber, - landTitleDistrictCode, - includeCancelledInfo = false - } - }; - - var requestBody = new - { - order - }; - - var json = JsonSerializer.Serialize(requestBody); - var content = new StringContent(json, Encoding.UTF8, "application/json"); - - try - { - return await this.Client.SendAsync(apiUrl, HttpMethod.Post, headers, content); - } - catch (HttpClientRequestException ex) - { - // Handle the exception here - Console.WriteLine($"An error occurred: {ex.Message}"); - throw new LTSAApiException($"Failed to create an order. An error occurred during the HTTP request. {ex.Message}"); - } - } - #endregion - } -} diff --git a/backend/ltsa/Pims.Ltsa.csproj b/backend/ltsa/Pims.Ltsa.csproj deleted file mode 100644 index c479930593..0000000000 --- a/backend/ltsa/Pims.Ltsa.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - net7.0 - Library - 1.0.0.0 - 1.0.0.0 - 4DB543FF-19CF-4FA8-B772-2AE7E6721F86 - - - - - - - - - - - - - - - - diff --git a/backend/notifications/Configuration/NotificationOptions.cs b/backend/notifications/Configuration/NotificationOptions.cs deleted file mode 100644 index 591bbd2b0e..0000000000 --- a/backend/notifications/Configuration/NotificationOptions.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Pims.Notifications.Configuration -{ - /// - /// NotificationOptions class, provides a way to configure notifications. - /// - public class NotificationOptions - { - /// - /// get/set - Whether to immediately send all notifications and ignore their configured SendOn delay values. - /// This option is helpful for testing and debugging. - /// - public bool SendAllNow { get; set; } - } -} diff --git a/backend/notifications/Extensions/ServiceCollectionExtensions.cs b/backend/notifications/Extensions/ServiceCollectionExtensions.cs deleted file mode 100644 index 173f59d6ab..0000000000 --- a/backend/notifications/Extensions/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; - -namespace Pims.Notifications -{ - /// - /// ServiceCollectionExtensions static class, provides extension methods for ServiceCollection objects. - /// - public static class ServiceCollectionExtensions - { - /// - /// Add the NotificationsService to the dependency injection service collection. - /// - /// - /// - public static IServiceCollection AddNotificationsService(this IServiceCollection services) - { - return services - .AddScoped() - .AddScoped(); - } - - /// - /// Add the NotificationsService to the dependency injection service collection. - /// - /// - /// - /// - public static IServiceCollection AddNotificationsService(this IServiceCollection services, IConfigurationSection section) - { - return services - .Configure(section) - .AddScoped() - .AddScoped(); - } - } -} diff --git a/backend/notifications/INotificationService.cs b/backend/notifications/INotificationService.cs deleted file mode 100644 index 2463feb63c..0000000000 --- a/backend/notifications/INotificationService.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Model = Pims.Notifications.Models; - -namespace Pims.Notifications -{ - public interface INotificationService : Dal.Services.INotificationService - { - void Build(string templateKey, Model.IEmailTemplate template, TModel model); - Task SendAsync(string templateKey, Model.IEmail email, TModel model); - Task SendAsync(Model.IEmail notification); - Task SendAsync(IEnumerable notifications); - Task GetStatusAsync(Guid messageId); - Task CancelAsync(Guid messageId); - } -} diff --git a/backend/notifications/Models/Email.cs b/backend/notifications/Models/Email.cs deleted file mode 100644 index 365fdf181b..0000000000 --- a/backend/notifications/Models/Email.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Pims.Notifications.Models -{ - /// - /// Email class, provides a model that represents an email. - /// - public class Email : IEmail - { - /// - /// get/set - The email address that identifies who it is from (i.e. First Last ). - /// - public string From { get; set; } - - /// - /// get/set - An array of email addresses to send the email to. - /// - public IEnumerable To { get; set; } - - /// - /// get/set - An array of email addresses to carbon-copy. - /// - public IEnumerable Cc { get; set; } - - /// - /// get/set - An array of email addresses to blind carbon-copy. - /// - public IEnumerable Bcc { get; set; } - - /// - /// get/set - The email encoding. - /// - public EmailEncodings Encoding { get; set; } = EmailEncodings.Utf8; - - /// - /// get/set - The email priority. - /// - public EmailPriorities Priority { get; set; } = EmailPriorities.Normal; - - /// - /// get/set - A tag to identify related emails. - /// - public string Tag { get; set; } - - /// - /// get/set - When to send the email. - /// - public DateTime SendOn { get; set; } - - /// - /// getset - The email subject. - /// - public string Subject { get; set; } - - /// - /// get/set - The email body type. - /// - public EmailBodyTypes BodyType { get; set; } = EmailBodyTypes.Html; - - /// - /// get/set - The email body. - /// - public string Body { get; set; } - } -} diff --git a/backend/notifications/Models/EmailBodyTypes.cs b/backend/notifications/Models/EmailBodyTypes.cs deleted file mode 100644 index ba8613ca9b..0000000000 --- a/backend/notifications/Models/EmailBodyTypes.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Pims.Notifications.Models -{ - /// - /// EmailBodyTypes enum, provides email body type options. - /// - public enum EmailBodyTypes - { - Html = 0, - Text = 1 - } -} diff --git a/backend/notifications/Models/EmailEncodings.cs b/backend/notifications/Models/EmailEncodings.cs deleted file mode 100644 index 6a50003018..0000000000 --- a/backend/notifications/Models/EmailEncodings.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Pims.Core.Json; - -namespace Pims.Notifications.Models -{ - /// - /// EmailEncodings enum, provides notification encoding options. - /// - public enum EmailEncodings - { - [EnumValue("utf-8")] - Utf8 = 0, - Base64 = 1, - Binary = 2, - Hex = 3 - } -} diff --git a/backend/notifications/Models/EmailPriorities.cs b/backend/notifications/Models/EmailPriorities.cs deleted file mode 100644 index 7bc189293c..0000000000 --- a/backend/notifications/Models/EmailPriorities.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Pims.Notifications.Models -{ - /// - /// EmailPriorities enum, provides email priority options. - /// - public enum EmailPriorities - { - Low = 0, - Normal = 1, - High = 2 - } -} diff --git a/backend/notifications/Models/EmailResponse.cs b/backend/notifications/Models/EmailResponse.cs deleted file mode 100644 index 6b727757cf..0000000000 --- a/backend/notifications/Models/EmailResponse.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Pims.Notifications.Models -{ - /// - /// EmailResponse class, provides a model that represents an email response. - /// - public class EmailResponse - { - #region Properties - public Guid TransactionId { get; set; } - public IEnumerable Messages { get; set; } = new List(); - #endregion - - #region Constructors - public EmailResponse() - { - - } - - public EmailResponse(Ches.Models.EmailResponseModel response) - { - this.TransactionId = response.TransactionId; - - if (response.Messages?.Any() ?? false) - { - ((List)this.Messages).AddRange(response.Messages.Select(m => new MessageResponse(m))); - } - } - #endregion - } -} diff --git a/backend/notifications/Models/EmailTemplate.cs b/backend/notifications/Models/EmailTemplate.cs deleted file mode 100644 index 868e16e8d9..0000000000 --- a/backend/notifications/Models/EmailTemplate.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace Pims.Notifications.Models -{ - /// - /// EmailTemplate class, provides a model for email templates. - /// - public class EmailTemplate : IEmailTemplate - { - #region Properties - /// - /// get/set - The subject template. - /// - public string Subject { get; set; } - - /// - /// get/set - The body type [html, text]. - /// - public EmailBodyTypes BodyType { get; set; } = EmailBodyTypes.Html; - - /// - /// get/set - The body template. - /// - public string Body { get; set; } - #endregion - } -} diff --git a/backend/notifications/Models/IEmail.cs b/backend/notifications/Models/IEmail.cs deleted file mode 100644 index 504cab2317..0000000000 --- a/backend/notifications/Models/IEmail.cs +++ /dev/null @@ -1,55 +0,0 @@ -using Pims.Core.Converters; -using System; -using System.Collections.Generic; -using System.Text.Json.Serialization; - -namespace Pims.Notifications.Models -{ - /// - /// IEmail interface, provides a common structure for emails. - /// - public interface IEmail : IEmailTemplate - { - /// - /// get/set - Who the email is from (i.e. First Last ). - /// - string From { get; set; } - - /// - /// get/set - An array of email addresses this email will be sent to. - /// - IEnumerable To { get; set; } - - /// - /// get/set - An array of email addresses to carbon-copy. - /// - IEnumerable Cc { get; set; } - - /// - /// get/set - An array of email addresses to blind carbon-copy. - /// - IEnumerable Bcc { get; set; } - - /// - /// get/set - The email encoding. - /// - [JsonConverter(typeof(EnumValueJsonConverter))] - EmailEncodings Encoding { get; set; } - - /// - /// get/set - The email priority. - /// - [JsonConverter(typeof(EnumValueJsonConverter))] - EmailPriorities Priority { get; set; } - - /// - /// get/set - A tag to identify related emails. - /// - string Tag { get; set; } - - /// - /// get/set - The date that the email should be sent. - /// - DateTime SendOn { get; set; } - } -} diff --git a/backend/notifications/Models/IEmailTemplate.cs b/backend/notifications/Models/IEmailTemplate.cs deleted file mode 100644 index 959b38231d..0000000000 --- a/backend/notifications/Models/IEmailTemplate.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Pims.Core.Converters; -using System.Text.Json.Serialization; - -namespace Pims.Notifications.Models -{ - /// - /// IEmailTemplate interface, provides a common structure for email templates. - /// - public interface IEmailTemplate - { - /// - /// get/set - The email subject. - /// - string Subject { get; set; } - - /// - /// get/set - The email body type. - /// - [JsonConverter(typeof(EnumValueJsonConverter))] - EmailBodyTypes BodyType { get; set; } - - /// - /// get/set - The email body. - /// - string Body { get; set; } - } -} diff --git a/backend/notifications/Models/MessageResponse.cs b/backend/notifications/Models/MessageResponse.cs deleted file mode 100644 index 6b1b54cd34..0000000000 --- a/backend/notifications/Models/MessageResponse.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Pims.Notifications.Models -{ - public class MessageResponse - { - #region Properties - /// - /// get/set - The message ID that uniquely identifies it. - /// - public Guid MessageId { get; set; } - - /// - /// get/set - The tag that provides a way to identify related messages. - /// - public string Tag { get; set; } - - /// - /// get/set - An array of email addresses that the message was sent to. - /// - public IEnumerable To { get; set; } = new List(); - #endregion - - #region Constructors - /// - /// Creates a new instance of a MessageResponse class. - /// - public MessageResponse() { } - - /// - /// Creates a new instance of a MessageResponse class, initializes with specified arguments. - /// - /// - public MessageResponse(Ches.Models.MessageResponseModel message) - { - this.MessageId = message.MessageId; - this.Tag = message.Tag; - - if (message.To?.Any() ?? false) ((List)this.To).AddRange(message.To); - } - #endregion - } -} diff --git a/backend/notifications/Models/StatusResponse.cs b/backend/notifications/Models/StatusResponse.cs deleted file mode 100644 index cb514e6f8e..0000000000 --- a/backend/notifications/Models/StatusResponse.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; - -namespace Pims.Notifications.Models -{ - /// - /// StatusResponse class, provides a model that represents the status response. - /// - public class StatusResponse - { - #region Properties - /// - /// get/set - The transaction Id to identify a group of messages. - /// - public Guid TransactionId { get; set; } - - /// - /// get/set - The transaction Id to identify a group of messages. - /// - public Guid MessageId { get; set; } - - /// - /// get/set - When the message was created. - /// - public DateTime CreatedOn { get; set; } - - /// - /// get/set - When the message has been schedule to be sent. - /// - public DateTime SendOn { get; set; } - - /// - /// get/set - When the message was last updated. - /// - public DateTime UpdatedOn { get; set; } - - /// - /// get/set - The current status of the message. - /// - public string Status { get; set; } - - /// - /// get/set - A tag to identify related messages. - /// - public string Tag { get; set; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a StatusResponse class. - /// - public StatusResponse() { } - - /// - /// Creates a new instance of a StatusResponse class, initializes with specified arguments. - /// - /// - public StatusResponse(Ches.Models.StatusResponseModel response) - { - this.TransactionId = response.TransactionId; - this.MessageId = response.MessageId; - this.CreatedOn = response.CreatedOn; - this.SendOn = response.SendOn; - this.UpdatedOn = response.UpdatedOn; - this.Status = response.Status; - this.Tag = response.Tag; - } - #endregion - } -} diff --git a/backend/notifications/NotificationService.cs b/backend/notifications/NotificationService.cs deleted file mode 100644 index 1b1ecd4574..0000000000 --- a/backend/notifications/NotificationService.cs +++ /dev/null @@ -1,354 +0,0 @@ -using Microsoft.Extensions.Options; -using Pims.Ches; -using Pims.Core.Extensions; -using Pims.Notifications.Configuration; -using RazorEngine; -using RazorEngine.Templating; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Model = Pims.Notifications.Models; -using Entity = Pims.Dal.Entities; -using Pims.Core.Exceptions; -using Microsoft.Extensions.Logging; -using Pims.Dal.Helpers.Extensions; -using System.Net; - -namespace Pims.Notifications -{ - /// - /// NotificationService class, provides a service for generating notifications. - /// - public class NotificationService : INotificationService - { - #region Variables - private const string SUBJECT_TEMPLATE_KEY = "template-subject:{0}"; - private const string BODY_TEMPLATE_KEY = "template-body:{0}"; - private static readonly Dictionary _cache = new Dictionary(); - private readonly ILogger _logger; - #endregion - - #region Properties - /// - /// get - The CHES service. - /// - protected IChesService Ches { get; } - - /// - /// get - The notification configuration settings. - /// - public NotificationOptions Options { get; } - #endregion - - #region Constructors - /// - /// Creates a new instance of a NotificationService, initializes with specified arguments. - /// - /// - /// - public NotificationService(IOptions options, IChesService ches, ILogger logger) - { - this.Options = options.Value; - this.Ches = ches; - _logger = logger; - } - #endregion - - #region Methods - #region NotificationQueue - /// - /// Send the specified 'notification' to CHES. - /// Change the notification status based on the response. - /// - /// - /// - public async Task SendAsync(Entity.NotificationQueue notification) - { - if (notification == null) throw new ArgumentNullException(nameof(notification)); - - try - { - // Send notifications to CHES. - var response = await SendAsync(new Model.Email() - { - To = notification.To.Split(";").Select(v => v.Trim()), - Cc = notification.Cc?.Split(";").Select(v => v.Trim()), - Bcc = notification.Bcc?.Split(";").Select(v => v.Trim()), - Encoding = (Model.EmailEncodings)Enum.Parse(typeof(Model.EmailEncodings), notification.Encoding.ToString()), - BodyType = (Model.EmailBodyTypes)Enum.Parse(typeof(Model.EmailBodyTypes), notification.BodyType.ToString()), - Priority = (Model.EmailPriorities)Enum.Parse(typeof(Model.EmailPriorities), notification.Priority.ToString()), - Subject = notification.Subject, - Body = notification.Body, - SendOn = this.Options?.SendAllNow ?? false ? DateTime.UtcNow : notification.SendOn, - Tag = notification.Tag, - }); - notification.ChesTransactionId = response.TransactionId; - notification.ChesMessageId = response.Messages.First().MessageId; - } - catch (HttpClientRequestException ex) - { - notification.Status = Entity.NotificationStatus.Failed; - var data = await ex.Response.Content.ReadAsStringAsync(); - _logger.LogError(ex, $"Failed to send email to CHES - Template:{notification.TemplateId}{Environment.NewLine}CHES StatusCode:{ex.StatusCode}{Environment.NewLine}{ex.Message}{Environment.NewLine}{data}"); - throw; - } - catch (Exception ex) - { - notification.Status = Entity.NotificationStatus.Failed; - _logger.LogError(ex, $"Failed to send email to CHES - notification:{notification.Id}, template:{notification.TemplateId}{Environment.NewLine}{ex.Message}"); - throw; - } - } - - /// - /// Send the specified array of 'notifications' to CHES. - /// - /// - /// - public async Task SendAsync(IEnumerable notifications) - { - if (notifications == null) throw new ArgumentNullException(nameof(notifications)); - - foreach (var notification in notifications) - { - await SendAsync(notification); - } - } - - /// - /// Generate the specified 'notification' Subject and Body based on the Template and specified 'model'. - /// Modifies the 'notification.Subject' and 'notification.Body' values by building the Razor template. - /// - /// - /// - /// - public void Generate(Entity.NotificationQueue notification, TModel model) - { - var email = new Model.EmailTemplate() - { - Subject = notification.Template.Subject, - BodyType = (Model.EmailBodyTypes)Enum.Parse(typeof(Model.EmailBodyTypes), notification.Template.BodyType.ToString()), - Body = notification.Template.Body, - }; - Build($"{notification.TemplateId}-{notification.Template.RowVersion.ConvertRowVersion()}", email, model); - notification.Subject = email.Subject; - notification.Body = email.Body; - } - - /// - /// Cancel the specified 'notification' so that it will not be sent. - /// - /// - /// - public async Task CancelAsync(Entity.NotificationQueue notification) - { - if (notification == null) throw new ArgumentNullException(nameof(notification)); - if (!notification.ChesMessageId.HasValue) throw new InvalidOperationException("Notification does not exist in CHES."); - - try - { - var response = await CancelAsync(notification.ChesMessageId.Value); - notification.Status = (Entity.NotificationStatus)Enum.Parse(typeof(Entity.NotificationStatus), response.Status, true); - } - catch (HttpClientRequestException ex) - { - // Ignore 409 - as these have already been cancelled. - if (ex.StatusCode != System.Net.HttpStatusCode.Conflict) - throw; - - notification.Status = Entity.NotificationStatus.Cancelled; - } - } - - /// - /// Cancel the specified 'notifications' so that they will not be sent. - /// - /// - /// - public async Task CancelAsync(IEnumerable notifications) - { - if (notifications == null) throw new ArgumentNullException(nameof(notifications)); - - foreach (var notification in notifications.Where(n => n.ChesMessageId.HasValue)) - { - try - { - await CancelAsync(notification); - } - catch (HttpClientRequestException ex) - { - // CHES returns a 404 when a message doesn't exist. This isn't a good practice, but now I have to assume 404's are successful and I'm sending invalid message Ids. - if (ex.StatusCode != HttpStatusCode.NotFound) throw; - // TODO: All requests should be sent and the aggregate of the error should be returned as a collection of errors. - // The present implementation will abort after a single failure. - // A cut off on the number of errors allowed before aborting should also be implemented. - } - } - } - #endregion - - /// - /// Build the specified 'template' and merge the specified 'model'. - /// Mutate the specified 'template' Subject and Body properties. - /// - /// - /// - /// - /// - public void Build(string templateKey, Model.IEmailTemplate template, TModel model) - { - if (String.IsNullOrWhiteSpace(templateKey)) throw new ArgumentException("Argument is required and cannot be null, empty or whitespace.", nameof(templateKey)); - if (template == null) throw new ArgumentNullException(nameof(template)); - - CompileTemplate(templateKey, template); - - Merge(templateKey, template, model); - } - - /// - /// Build the specified 'email' templates and merge the specified 'model'. - /// Mutate the specified 'email' Subject and Body properties. - /// Send the notification to CHES. - /// - /// - /// - /// - /// - /// - public async Task SendAsync(string templateKey, Model.IEmail email, TModel model) - { - Build(templateKey, email, model); - return await SendAsync(email); - } - - /// - /// Send the specified 'notification' to CHES. - /// - /// - /// - public async Task SendAsync(Model.IEmail email) - { - if (email == null) throw new ArgumentNullException(nameof(email)); - if (email.To == null || !email.To.Any()) throw new ArgumentNullException(nameof(email.To)); - - var response = await this.Ches.SendEmailAsync(new Ches.Models.EmailModel() - { - From = email.From, - To = email.To, - Cc = email.Cc, - Bcc = email.Bcc, - Encoding = email.Encoding.ConvertTo(), - Priority = email.Priority.ConvertTo(), - BodyType = email.BodyType.ConvertTo(), - Subject = email.Subject, - Body = email.Body, - Tag = email.Tag, - SendOn = this.Options?.SendAllNow ?? false ? DateTime.UtcNow : email.SendOn, - }); - - return new Model.EmailResponse(response); - } - - /// - /// Send all the specified 'notifications' as a single transaction to CHES. - /// Note that the first notification will govern the following properties for all other notifications (From, Encoding, Priority, BodyType). - /// - /// - /// - public async Task SendAsync(IEnumerable notifications) - { - if (notifications == null) throw new ArgumentNullException(nameof(notifications)); - - var primary = notifications.First(); - var merge = new Ches.Models.EmailMergeModel() - { - From = primary.From, - Encoding = primary.Encoding.ConvertTo(), - Priority = primary.Priority.ConvertTo(), - BodyType = primary.BodyType.ConvertTo(), - Subject = "{{ subject }}", - Body = "{{ body }}", - Contexts = notifications.Select(n => new Ches.Models.EmailContextModel() - { - To = n.To, - Cc = n.Cc, - Bcc = n.Bcc, - Tag = n.Tag, - SendOn = this.Options?.SendAllNow ?? false ? DateTime.UtcNow : n.SendOn, - Context = new - { - subject = n.Subject, - body = n.Body - } - }) - }; - - var response = await this.Ches.SendEmailAsync(merge); - - return new Model.EmailResponse(response); - } - - /// - /// Get the status of the message for the specified 'messageId'. - /// - /// - /// - public async Task GetStatusAsync(Guid messageId) - { - var response = await this.Ches.GetStatusAsync(messageId); - return new Model.StatusResponse(response); - } - - /// - /// Get the status of the message for the specified 'messageId'. - /// - /// - /// - public async Task CancelAsync(Guid messageId) - { - var response = await this.Ches.CancelEmailAsync(messageId); - return new Model.StatusResponse(response); - } - #endregion - - #region Helpers - /// - /// Compile the templates before running them. - /// - /// - private void CompileTemplate(string templateKey, Model.IEmailTemplate template) - { - var subjectKey = String.Format(SUBJECT_TEMPLATE_KEY, templateKey); - var type = typeof(TModel) == typeof(object) || typeof(TModel).IsAnonymousType() ? null : typeof(TModel); - if (!_cache.ContainsKey(subjectKey)) - { - Engine.Razor.Compile(template.Subject, subjectKey, type); - _cache.Add(subjectKey, template); - } - - var bodyKey = String.Format(BODY_TEMPLATE_KEY, templateKey); - if (!_cache.ContainsKey(bodyKey)) - { - Engine.Razor.Compile(template.Body, bodyKey, type); - _cache.Add(bodyKey, template); - } - } - - /// - /// Run the template - /// - /// - /// - /// - /// - /// - private void Merge(string templateKey, Model.IEmailTemplate template, TModel model) - { - var type = typeof(TModel) == typeof(object) || typeof(TModel).IsAnonymousType() ? null : typeof(TModel); - template.Subject = Engine.Razor.Run(String.Format(SUBJECT_TEMPLATE_KEY, templateKey), type, model); - template.Body = Engine.Razor.Run(String.Format(BODY_TEMPLATE_KEY, templateKey), type, model); - } - #endregion - } -} diff --git a/backend/notifications/Pims.Notifications.csproj b/backend/notifications/Pims.Notifications.csproj deleted file mode 100644 index 457e58eefb..0000000000 --- a/backend/notifications/Pims.Notifications.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - - net7.0 - Library - 1.0.0.0 - 1.0.0.0 - 3942CAF2-93CE-45BC-A734-3247D266ECE6 - - - - - - - - - - - - - - - - - - - - diff --git a/backend/tests/.gitignore b/backend/tests/.gitignore deleted file mode 100644 index 6f8065e677..0000000000 --- a/backend/tests/.gitignore +++ /dev/null @@ -1,46 +0,0 @@ -# Environment variables -.env -# Build -.obj - -*.swp -*.*~ -project.lock.json -.DS_Store -*.pyc -nupkg/ - -# IDE - VSCode -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json - -# Rider -.idea - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -build/ -bld/ -[Bb]in/ -[Oo]bj/ -[Oo]ut/ -msbuild.log -msbuild.err -msbuild.wrn - -# Visual Studio 2015 -.vs/ diff --git a/backend/tests/README.md b/backend/tests/README.md deleted file mode 100644 index 1d8e0facc1..0000000000 --- a/backend/tests/README.md +++ /dev/null @@ -1,91 +0,0 @@ -# Test Coverage - -In software testing, we use test coverage to define the percent of executed tests. -Test coverage is a measurement in Software Testing that shows the percentage of product functionality which is tested and defines the amount of the entire testing circle. -It determines which branches of the program were examined and which conditions and setting were considered. - -Software testing is an essential activity in the software development and maintenance life cycles. -It is a practice often used to decide and improve software quality. - -Development is more systematic nowadays and organizations seek measures of testing completeness and effectiveness to show test completion criteria. -Of them all, coverage is considered especially valuable. - -> Simply put, coverage is “What are we testing and How much are we testing?” - -## Related Links and Tutorials - -- [.NET Core Tools](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools#what-could-go-wrong) -- [Coverlet](https://github.com/tonerdo/coverlet) -- [ReportGenerator](https://danielpalme.github.io/ReportGenerator/) -- [DZone](https://dzone.com/articles/code-coverage-reports-for-aspnet-core) - -## Generating Coverage Files - ---- - -The first step required is to generate coverage files during the execution of tests. - -### Coverlet - -Coverlet is a cross platform code coverage framework for .NET, with support for line, branch and method coverage. It works with .NET Framework on Windows and .NET Core on all supported platforms. - -- [Documentation](https://github.com/tonerdo/coverlet/blob/master/Documentation/GlobalTool.md) - -Install the Coverlet globally. - -```bash -dotnet tool install -g coverlet.console -``` - -Create a coverage file requires generating a file for each test project and merging them together. - -```bash -coverlet ./tests/unit/api/bin/Debug/netcoreapp3.1/Pims.Api.Test.dll --target "dotnet" --targetargs "test ./ --no-build" -o "./tests/TestResults/coverage.json" --exclude "[*.Test]*" --exclude "[*]*Model" --exclude-by-attribute "CompilerGenerated" -f json - -coverlet ./tests/unit/dal/bin/Debug/netcoreapp3.1/Pims.Dal.Test.dll --target "dotnet" --targetargs "test ./ --no-build" -o "./tests/TestResults/coverage.xml" --exclude "[*.Test]*" --exclude "[*]*Model" --exclude-by-attribute "CompilerGenerated" --merge-with "tests/TestResults/coverage.json" -f cobertura -``` - -### DotNet - -You can also generate coverage files with dotnet, however you have less control with the output. -The problem with this is that it will create separate folders with GUID names for each test project. - -Create a coverage file, based on the type. - -```bash -dotnet test --collect:"Code Coverage" --results-directory:./tests/TestResults - -dotnet test --collect:"XPlat Code Coverage" --results-directory:./tests/TestResults -``` - -## Generating Reports - ---- - -ReportGenerator converts coverage reports generated by -OpenCover, dotCover, Visual Studio, NCover, Cobertura, JaCoCo, Clover, gcov or lcov -into human readable reports in various formats - -[Documentation](https://danielpalme.github.io/ReportGenerator/usage.html) - -Install ReportGenerator globally. - -```bash -dotnet tool install -g dotnet-reportgenerator-globaltool -``` - -To generate the report files. - -```bash -reportgenerator "-reports:./tests/TestResults/coverage.xml" "-targetdir:./tests/TestResults/Coverage" -reporttypes:Html - -start ./tests/TestResults/Coverage/index.htm -``` - -Or if you want to only generate a summary report. - -```bash -reportgenerator "-reports:./tests/TestResults/coverage.xml" "-targetdir:./tests/TestResults/Coverage" -reporttypes:HtmlSummary - -start ./tests/TestResults/Coverage/summary.htm -``` diff --git a/backend/tests/core/ControllerHelper.cs b/backend/tests/core/ControllerHelper.cs deleted file mode 100644 index 4490c13550..0000000000 --- a/backend/tests/core/ControllerHelper.cs +++ /dev/null @@ -1,148 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Options; -using Pims.Dal; -using Pims.Dal.Security; -using System; -using System.Diagnostics.CodeAnalysis; -using System.Security.Claims; - -namespace Pims.Core.Test -{ - /// - /// ControllerHelper static class, provides helper functions for setting up tests for controllers. - /// - [ExcludeFromCodeCoverage] - public static class ControllerHelper - { - #region Methods - /// - /// Creates an instance of a controller of the specified 'T' type and initializes it with the specified 'user'. - /// Will use any 'args' passed in instead of generating defaults. - /// Once you create a controller you can no longer add to the services collection. - /// - /// - /// - /// - /// - /// - public static T CreateController(this TestHelper helper, ClaimsPrincipal user, params object[] args) where T : ControllerBase - { - return helper.CreateController(user, null, args); - } - - /// - /// Creates an instance of a controller of the specified 'T' type and initializes it with a user with the specified 'permission'. - /// Will use any 'args' passed in instead of generating defaults. - /// Once you create a controller you can no longer add to the services collection. - /// - /// - /// - /// - /// - /// - /// - public static T CreateController(this TestHelper helper, Permissions permission, params object[] args) where T : ControllerBase - { - var user = PrincipalHelper.CreateForPermission(permission); - return helper.CreateController(user, null, args); - } - - /// - /// Creates an instance of a controller of the specified 'T' type and initializes it with a user with the specified 'permission'. - /// Will use any 'args' passed in instead of generating defaults. - /// Once you create a controller you can no longer add to the services collection. - /// - /// - /// - /// - /// - /// - /// - public static T CreateController(this TestHelper helper, Permissions permission, Uri uri, params object[] args) where T : ControllerBase - { - var user = PrincipalHelper.CreateForPermission(permission); - return helper.CreateController(user, uri, args); - } - - /// - /// Creates an instance of a controller of the specified 'T' type and initializes it with the specified 'user'. - /// Will use any 'args' passed in instead of generating defaults. - /// Once you create a controller you can no longer add to the services collection. - /// - /// - /// - /// - /// - /// - /// - public static T CreateController(this TestHelper helper, ClaimsPrincipal user, Uri uri, params object[] args) where T : ControllerBase - { - helper.MockConstructorArguments(args); - var context = helper.CreateControllerContext(user, uri); - - helper.BuildServiceProvider(); - var controller = helper.CreateInstance(); - controller.ControllerContext = context; - - return controller; - } - - /// - /// Provides a quick way to create a ControllerContext with the specified user. - /// - /// - /// - /// - public static ControllerContext CreateControllerContext(this TestHelper helper, ClaimsPrincipal user, Uri uri = null) - { - return new ControllerContext() - { - HttpContext = helper.CreateHttpContext(user, uri) - }; - } - - /// - /// Creates a default pims configuration options. - /// - /// - public static IOptions CreateDefaultPimsOptions() - { - return Options.Create(new PimsOptions() - { - Project = CreateDefaultProjectOptions().Value, - Environment = new EnvironmentOptions() - { - Uri = new Uri("http://localhost:3000"), - Name = "Testing", - Title = "Property Inventory Management System" - } - }); - } - - /// - /// Creates a default pims configuration options. - /// - /// - /// - [SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "This just makes it easier to reference.")] - public static IOptions CreateDefaultPimsOptions(this TestHelper helper) - { - return CreateDefaultPimsOptions(); - } - - /// - /// Creates a default project configuration options. - /// - /// - public static IOptions CreateDefaultProjectOptions() - { - return Options.Create(new ProjectOptions() - { - DraftFormat = "DRAFT-{0:00000}", - NumberFormat = "SPP-{0:00000}", - DraftWorkflows = new[] { "SUBMIT-DISPOSAL" } - }); - } - #endregion - } -} diff --git a/backend/tests/core/DatabaseHelper.cs b/backend/tests/core/DatabaseHelper.cs deleted file mode 100644 index 06b30db15b..0000000000 --- a/backend/tests/core/DatabaseHelper.cs +++ /dev/null @@ -1,276 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Diagnostics; -using Microsoft.Extensions.Options; -using Moq; -using Pims.Core.Helpers; -using Pims.Dal; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Security.Claims; -using System.Text.Json; - -namespace Pims.Core.Test -{ - /// - /// DatabaseHelper static class, provides helper functions for the TestHelper when interacting with a Database. - /// - [ExcludeFromCodeCoverage] - public static class DatabaseHelper - { - #region Methods - /// - /// Creates an instance of a PimsContext and initializes it with the specified 'permission'. - /// Uses an InMemoryDatabase instead of relational. - /// - /// - /// - /// - /// - public static PimsContext CreatePimsContext(this TestHelper helper, Permissions permission, bool ensureDeleted = false) - { - return helper.CreatePimsContext(StringHelper.Generate(10), permission, ensureDeleted); - } - - - /// - /// Creates an instance of a PimsContext and initializes it with the specified 'user'. - /// Uses an InMemoryDatabase instead of relational. - /// - /// - /// - /// - /// - public static PimsContext CreatePimsContext(this TestHelper helper, ClaimsPrincipal user, bool ensureDeleted = false) - { - return helper.CreatePimsContext(StringHelper.Generate(10), user, ensureDeleted); - } - - /// - /// Creates an instance of a PimsContext and initializes it with the specified 'permission'. - /// Uses an InMemoryDatabase instead of relational. - /// - /// - /// - /// - /// - /// - public static PimsContext CreatePimsContext(this TestHelper helper, string dbName, Permissions permission, bool ensureDeleted = false) - { - var user = PrincipalHelper.CreateForPermission(permission); - return helper.CreatePimsContext(dbName, user, ensureDeleted); - } - - /// - /// Creates an instance of a PimsContext and initializes it with the specified 'user'. - /// Uses an InMemoryDatabase instead of relational. - /// - /// - /// - /// - /// - /// - public static PimsContext CreatePimsContext(this TestHelper helper, string dbName, ClaimsPrincipal user, bool ensureDeleted = false) - { - // Generate a randome database name. - if (String.IsNullOrWhiteSpace(dbName)) dbName = StringHelper.Generate(10); - - helper.AddSingleton(user); - var options = new DbContextOptionsBuilder() - .UseInMemoryDatabase(databaseName: dbName) - .EnableSensitiveDataLogging() - .ConfigureWarnings(m => m.Ignore(InMemoryEventId.TransactionIgnoredWarning)) - .Options; - - var contextAccessor = new Mock(); - var httpContext = helper.CreateHttpContext(user); - contextAccessor.Setup(m => m.HttpContext).Returns(httpContext); - - var serializerOptions = new Mock>(); - helper.AddSingleton(serializerOptions); - - var context = new PimsContext(options, contextAccessor.Object, serializerOptions.Object); - - if (ensureDeleted) context.Database.EnsureDeleted(); - helper.AddSingleton(context); - - return context; - } - - /// - /// Initialize the PimsContext with the specified data in 'entities'. - /// Initializes the database with default data to support other tables. - /// - /// - /// - /// - public static PimsContext InitializeDatabase(this TestHelper helper, ClaimsPrincipal user) - { - return helper.InitializeDatabase(StringHelper.Generate(15), user); - } - - /// - /// Initialize the PimsContext with the specified data in 'entities'. - /// Initializes the database with default data to support other tables. - /// - /// - /// - /// - /// - public static PimsContext InitializeDatabase(this TestHelper helper, string dbName, ClaimsPrincipal user) - { - var context = helper.CreatePimsContext(dbName, user, true); - context.AddRange(EntityHelper.CreateUser("sresfm")); - context.AddRange(EntityHelper.CreateDefaultPropertyClassifications()); - context.AddRange(EntityHelper.CreateDefaultProvinces()); - context.AddRange(EntityHelper.CreateDefaultAdministrativeAreas()); - context.AddRange(EntityHelper.CreateDefaultRoles()); - context.AddRange(EntityHelper.CreateDefaultBuildingPredominateUses()); - context.AddRange(EntityHelper.CreateDefaultBuildingConstructionTypes()); - context.AddRange(EntityHelper.CreateDefaultBuildingOccupantTypes()); - context.AddRange(EntityHelper.CreateDefaultAgencies()); - context.AddRange(EntityHelper.CreateDefaultTierLevels()); - context.AddRange(EntityHelper.CreateDefaultProjectRisks()); - context.SaveChanges(); - return context; - } - - /// - /// Saves current changes to data context. - /// This will only work if the service provider has been built. - /// - /// - /// - public static PimsContext SaveChanges(this TestHelper helper) - { - var context = helper.GetService(); - context.SaveChanges(); - return context; - } - - /// - /// Add to the PimsContext 'context' with the specified data in 'entities'. - /// - /// - /// - /// - /// - public static PimsContext AddAndSaveChanges(this TestHelper helper, params T[] entity) - where T : class - { - var context = helper.GetService(); - context.Set().AddRange(entity); - context.SaveChanges(); - return context; - } - - /// - /// Add to the PimsContext 'context' with the specified data in 'entities'. - /// - /// - /// - /// - /// - public static PimsContext AddAndSaveRange(this TestHelper helper, IEnumerable entities) - where T : class - { - var context = helper.GetService(); - context.Set().AddRange(entities); - context.SaveChanges(); - return context; - } - - /// - /// Save the changes that are in memory context to the datasource. - /// - /// - /// - public static PimsContext SaveChanges(this PimsContext context) - { - context.SaveChanges(); - return context; - } - - /// - /// Add to the PimsContext 'context' with the specified data in 'entities'. - /// - /// - /// - /// - /// - public static PimsContext UpdateAndSaveChanges(this PimsContext context, params T[] entity) - where T : class - { - context.Set().UpdateRange(entity); - context.SaveChanges(); - return context; - } - - /// - /// Add to the PimsContext 'context' with the specified data in 'entities'. - /// - /// - /// - /// - /// - public static PimsContext UpdateAndSaveRange(this PimsContext context, IEnumerable entities) - where T : class - { - context.Set().UpdateRange(entities); - context.SaveChanges(); - return context; - } - - /// - /// Add to the PimsContext 'context' with the specified data in 'entities'. - /// - /// - /// - /// - /// - public static PimsContext AddAndSaveChanges(this PimsContext context, params T[] entity) - where T : class - { - context.Set().AddRange(entity); - context.SaveChanges(); - return context; - } - - /// - /// Add to the PimsContext 'context' with the specified data in 'entities'. - /// - /// - /// - /// - /// - public static PimsContext AddAndSaveRange(this PimsContext context, IEnumerable entities) - where T : class - { - context.Set().AddRange(entities); - context.SaveChanges(); - return context; - } - - /// - /// Ensure the database has been deleted. - /// - /// - public static void EnsureDeleted(this PimsContext context) - { - context.Database.EnsureDeleted(); - } - - /// - /// Ensure the database has been deleted. - /// - /// - public static void EnsureDeleted(this TestHelper helper) - { - var context = helper.GetService(); - context.EnsureDeleted(); - } - #endregion - } -} diff --git a/backend/tests/core/Entities/AccessRequestHelper.cs b/backend/tests/core/Entities/AccessRequestHelper.cs deleted file mode 100644 index 3c611c2b21..0000000000 --- a/backend/tests/core/Entities/AccessRequestHelper.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using System.Diagnostics.CodeAnalysis; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - [ExcludeFromCodeCoverage] - public static partial class EntityHelper - { - /// - /// Create a new instance of an AccessRequest for a default user. - /// - /// - public static Entity.AccessRequest CreateAccessRequest() - { - return CreateAccessRequest(1); - } - - /// - /// Create a new instance of an AccessRequest for a default user. - /// - /// - /// - public static Entity.AccessRequest CreateAccessRequest(int id) - { - var user = EntityHelper.CreateUser("test"); - return CreateAccessRequest(id, user); - } - - /// - /// Create a new instance of an AccessRequest for the specified user. - /// - /// - /// - /// - public static Entity.AccessRequest CreateAccessRequest(int id, Entity.User user) - { - var accessRequest = new Entity.AccessRequest() - { - Id = id, - UserId = user.Id, - User = user - }; - - accessRequest.Agencies.Add(new Entity.AccessRequestAgency() - { - AgencyId = 1, - Agency = new Entity.Agency() - { - Id = 1 - }, - AccessRequestId = id - }); - - var roleId = Guid.NewGuid(); - accessRequest.Roles.Add(new Entity.AccessRequestRole() - { - RoleId = roleId, - Role = new Entity.Role() - { - Id = roleId - }, - AccessRequestId = id - }); - - return accessRequest; - } - } -} diff --git a/backend/tests/core/Entities/AddressHelper.cs b/backend/tests/core/Entities/AddressHelper.cs deleted file mode 100644 index 098586c313..0000000000 --- a/backend/tests/core/Entities/AddressHelper.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Pims.Dal; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of an Address. - /// - /// - /// - /// - /// - /// - /// - /// - public static Entity.Address CreateAddress(int id, string address1, string address2, string administrativeArea, Entity.Province province, string postal) - { - return new Entity.Address(address1, address2, administrativeArea, province, postal) - { - Id = id, - RowVersion = new byte[] { 12, 13, 14 } - }; - } - - /// - /// Create a new instance of an Address. - /// - /// - /// - /// - /// - /// - public static Entity.Address CreateAddress(int id, string address1, string address2, string postal, Entity.Province province = null) - { - if (province == null) - { - province = EntityHelper.CreateProvince("BC", "British Columbia"); - } - return new Entity.Address(address1, address2, "Victoria", province, postal) - { - Id = id, - RowVersion = new byte[] { 12, 13, 14 } - }; - } - - /// - /// Create a new instance of an Address. - /// - /// - /// - /// - /// - /// - public static Entity.Address CreateAddress(this PimsContext context, int id, string address1, string address2, string postal) - { - var province = context.Provinces.Find("BC") ?? EntityHelper.CreateProvince("BC", "British Columbia"); - return new Entity.Address(address1, address2, "Victoria", province, postal) - { - Id = id, - RowVersion = new byte[] { 12, 13, 14 } - }; - } - } -} - diff --git a/backend/tests/core/Entities/AdministrativeAreaHelper.cs b/backend/tests/core/Entities/AdministrativeAreaHelper.cs deleted file mode 100644 index de92431dd8..0000000000 --- a/backend/tests/core/Entities/AdministrativeAreaHelper.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.Collections.Generic; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of a AdministrativeArea. - /// - /// - /// - /// - public static Entity.AdministrativeArea CreateAdministrativeArea(string name, string abbreviation) - { - return new Entity.AdministrativeArea(name) - { - Id = 1, - Abbreviation = abbreviation, - RowVersion = new byte[] { 12, 13, 14 } - }; - } - - /// - /// Creates a default list of AdministrativeArea. - /// - /// - public static List CreateDefaultAdministrativeAreas() - { - return new List() - { - new Entity.AdministrativeArea("Abbotsford") { Id = 100, Abbreviation = "ABB", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.AdministrativeArea("Agassiz") { Id = 101, Abbreviation = "AGA", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.AdministrativeArea("Ahousaht") { Id = 102, Abbreviation = "AHO", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.AdministrativeArea("Albert Canyon") { Id = 103, Abbreviation = "ACA", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.AdministrativeArea("Vancouver") { Id = 104, Abbreviation = "VAN", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.AdministrativeArea("Victoria") { Id = 105, Abbreviation = "VIC", RowVersion = new byte[] { 12, 13, 14 } } - }; - } - } -} diff --git a/backend/tests/core/Entities/AgencyHelper.cs b/backend/tests/core/Entities/AgencyHelper.cs deleted file mode 100644 index b16b6d699a..0000000000 --- a/backend/tests/core/Entities/AgencyHelper.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.Collections.Generic; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of a Parcel. - /// - /// - /// - /// - /// - public static Entity.Agency CreateAgency(int id = 3, string code = "AG", string name = "Agency") - { - var agency = new Entity.Agency(code, name) - { - Id = id, - RowVersion = new byte[] { 12, 13, 14 } - }; - - return agency; - } - - /// - /// Creates a default list of Agency. - /// - /// - public static List CreateDefaultAgencies() - { - return new List() - { - // Parent agencies - // commenting out agency id's for 1 & 3 to avoid System.InvalidOperationException : The instance of entity type 'Agency' cannot be tracked because another instance with the key value '{Id: 1}' is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached. - //new Entity.Agency("AEST", "Ministry of Advanced Education, Skills & Training") { Id = 1, RowVersion = new byte[] { 12, 13, 14 } }, - //new Entity.Agency("CITZ", "Ministry of Citizens Service") { Id = 2, RowVersion = new byte[] { 12, 13, 14 } }, - //new Entity.Agency("CSNR", "Ministry of Corporate Services for the Natural Resources Sector") { Id = 3, RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Agency("EDUC", "Ministry of Education") { Id = 4, RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Agency("FIN", "Ministry of Financ") { Id = 5, RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Agency("FLNR", "Ministry of Forests, Lands, Natural Resources") { Id = 6 }, - new Entity.Agency("HLTH", "Ministry of Health") { Id = 7, RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Agency("MAH", "Ministry of Municipal Affairs & Housing") { Id = 8, RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Agency("TRAN", "Ministry of Transportation and Infrastructure") { Id = 9, RowVersion = new byte[] { 12, 13, 14 } }, - - // Sub-agencies - new Entity.Agency("LEAD", "Ministry Lead") { Id = 10, ParentId = 7, RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Agency("ADM", "Acting Deputy Minister") { Id = 11, ParentId = 7, RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Agency("ED", "Executive Director") { Id = 12, ParentId = 7, RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Agency("FHA", "Fraser Health Authority") { Id = 13, ParentId = 7, RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Agency("IHA", "Interior Health Authority") { Id = 14, ParentId = 7, RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Agency("NHA", "Northern Health Authority") { Id = 15, ParentId = 7, RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Agency("PHSA", "Provincial Health Services Authority") { Id = 16, ParentId = 7, RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Agency("VCHA", "Vancouver Coastal Health Authority") { Id = 17, ParentId = 7, RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Agency("VIHA", "Vancouver Island Health Authority") { Id = 18, ParentId = 7, RowVersion = new byte[] { 12, 13, 14 } } - }; - } - } -} - diff --git a/backend/tests/core/Entities/BuildingContructionTypeHelper.cs b/backend/tests/core/Entities/BuildingContructionTypeHelper.cs deleted file mode 100644 index 4c03272f23..0000000000 --- a/backend/tests/core/Entities/BuildingContructionTypeHelper.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.Collections.Generic; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of a BuildingConstructionType. - /// - /// - /// - /// - public static Entity.BuildingConstructionType CreateBuildingConstructionType(int id, string name) - { - return new Entity.BuildingConstructionType(id, name) { RowVersion = new byte[] { 12, 13, 14 } }; - } - - /// - /// Create a new instance of a BuildingConstructionType. - /// - /// - /// - public static Entity.BuildingConstructionType CreateBuildingConstructionType(string name) - { - return new Entity.BuildingConstructionType(1, name) { RowVersion = new byte[] { 12, 13, 14 } }; - } - - /// - /// Creates a default list of BuildingConstructionType. - /// - /// - public static List CreateDefaultBuildingConstructionTypes() - { - return new List() - { - new Entity.BuildingConstructionType(0, "Concrete") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.BuildingConstructionType(1, "Masonry") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.BuildingConstructionType(2, "Mixed") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.BuildingConstructionType(3, "Steel") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.BuildingConstructionType(4, "Wood") { RowVersion = new byte[] { 12, 13, 14 } } - }; - } - } -} diff --git a/backend/tests/core/Entities/BuildingEvaluationHelper.cs b/backend/tests/core/Entities/BuildingEvaluationHelper.cs deleted file mode 100644 index ec5350c42d..0000000000 --- a/backend/tests/core/Entities/BuildingEvaluationHelper.cs +++ /dev/null @@ -1,126 +0,0 @@ -using Pims.Dal; -using System; -using System.Collections.Generic; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of a BuildingEvaluations. - /// - /// - /// - /// - /// - /// - public static Entity.BuildingEvaluation CreateEvaluation(Entity.Building building, DateTime date, Entity.EvaluationKeys key = Entity.EvaluationKeys.Assessed, decimal value = 1) - { - return new Entity.BuildingEvaluation() - { - BuildingId = building.Id, - Building = building, - Date = date, - Key = key, - Value = value, - CreatedById = Guid.NewGuid(), - CreatedOn = DateTime.UtcNow, - RowVersion = new byte[] { 12, 13, 14 } - }; - } - - /// - /// Create a new List with new instances of BuildingEvaluations. - /// - /// - /// - /// - /// - /// - /// - public static List CreateEvaluations(Entity.Building building, DateTime startDate, int count, Entity.EvaluationKeys key = Entity.EvaluationKeys.Assessed, decimal value = 1) - { - for (var i = 0; i < count; i++) - { - building.Evaluations.Add(CreateEvaluation(building, startDate.AddYears(i), key, value)); - } - return building.Evaluations as List; - } - - /// - /// Create a new List with new instances of BuildingEvaluations. - /// - /// - /// - /// - /// - /// - public static List CreateEvaluations(Entity.Building building, DateTime[] dates, Entity.EvaluationKeys key = Entity.EvaluationKeys.Assessed, decimal value = 1) - { - foreach (var date in dates) - { - building.Evaluations.Add(CreateEvaluation(building, date, key, value)); - } - return building.Evaluations as List; - } - - /// - /// Create a new instance of a BuildingEvaluations. - /// - /// - /// - /// - /// - /// - /// - public static Entity.BuildingEvaluation CreateEvaluation(this PimsContext context, Entity.Building building, DateTime date, Entity.EvaluationKeys key = Entity.EvaluationKeys.Assessed, decimal value = 1) - { - var evaluation = CreateEvaluation(building, date, key, value); - context.BuildingEvaluations.Add(evaluation); - return evaluation; - } - - /// - /// Create a new List with new instances of BuildingEvaluations. - /// - /// - /// - /// - /// - /// - /// - /// - public static List CreateEvaluations(this PimsContext context, Entity.Building building, DateTime startDate, int count, Entity.EvaluationKeys key = Entity.EvaluationKeys.Assessed, decimal value = 1) - { - var evaluations = new List(count); - for (var i = 0; i < count; i++) - { - evaluations.Add(context.CreateEvaluation(building, startDate.AddYears(i), key, value)); - } - return evaluations; - } - - /// - /// Create a new List with new instances of BuildingEvaluations. - /// - /// - /// - /// - /// - /// - /// - public static List CreateEvaluations(this PimsContext context, Entity.Building building, DateTime[] dates, Entity.EvaluationKeys key = Entity.EvaluationKeys.Assessed, decimal value = 1) - { - var evaluations = new List(dates.Length); - foreach (var date in dates) - { - evaluations.Add(context.CreateEvaluation(building, date, key, value)); - } - return evaluations; - } - } -} diff --git a/backend/tests/core/Entities/BuildingFiscalHelper.cs b/backend/tests/core/Entities/BuildingFiscalHelper.cs deleted file mode 100644 index 45da00621f..0000000000 --- a/backend/tests/core/Entities/BuildingFiscalHelper.cs +++ /dev/null @@ -1,126 +0,0 @@ -using Pims.Dal; -using System; -using System.Collections.Generic; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of a BuildingFiscals. - /// - /// - /// - /// - /// - /// - public static Entity.BuildingFiscal CreateFiscal(Entity.Building building, int fiscalYear, Entity.FiscalKeys key = Entity.FiscalKeys.Market, decimal value = 1) - { - return new Entity.BuildingFiscal() - { - BuildingId = building.Id, - Building = building, - FiscalYear = fiscalYear, - Key = key, - Value = value, - CreatedById = Guid.NewGuid(), - CreatedOn = DateTime.UtcNow, - RowVersion = new byte[] { 12, 13, 14 } - }; - } - - /// - /// Create a new List with new instances of BuildingFiscals. - /// - /// - /// - /// - /// - /// - /// - public static List CreateFiscals(Entity.Building building, int startFiscalYear, int count, Entity.FiscalKeys key = Entity.FiscalKeys.Market, decimal value = 1) - { - for (var i = startFiscalYear; i < (startFiscalYear + count); i++) - { - building.Fiscals.Add(CreateFiscal(building, i, key, value)); - } - return building.Fiscals as List; - } - - /// - /// Create a new List with new instances of BuildingFiscals. - /// - /// - /// - /// - /// - /// - public static List CreateFiscals(Entity.Building building, int[] fiscalYears, Entity.FiscalKeys key = Entity.FiscalKeys.Market, decimal value = 1) - { - foreach (var fiscalYear in fiscalYears) - { - building.Fiscals.Add(CreateFiscal(building, fiscalYear, key, value)); - } - return building.Fiscals as List; - } - - /// - /// Create a new instance of a BuildingFiscals. - /// - /// - /// - /// - /// - /// - /// - public static Entity.BuildingFiscal CreateFiscal(this PimsContext context, Entity.Building building, int fiscalYear, Entity.FiscalKeys key = Entity.FiscalKeys.Market, decimal value = 1) - { - var fiscal = CreateFiscal(building, fiscalYear, key, value); - context.BuildingFiscals.Add(fiscal); - return fiscal; - } - - /// - /// Create a new List with new instances of BuildingFiscals. - /// - /// - /// - /// - /// - /// - /// - /// - public static List CreateFiscals(this PimsContext context, Entity.Building building, int startFiscalYear, int count, Entity.FiscalKeys key = Entity.FiscalKeys.Market, decimal value = 1) - { - var evaluations = new List(count); - for (var i = startFiscalYear; i < (startFiscalYear + count); i++) - { - evaluations.Add(context.CreateFiscal(building, i, key, value)); - } - return evaluations; - } - - /// - /// Create a new List with new instances of BuildingFiscals. - /// - /// - /// - /// - /// - /// - /// - public static List CreateFiscals(this PimsContext context, Entity.Building building, int[] fiscalYears, Entity.FiscalKeys key = Entity.FiscalKeys.Market, decimal value = 1) - { - var evaluations = new List(fiscalYears.Length); - foreach (var fiscalYear in fiscalYears) - { - evaluations.Add(context.CreateFiscal(building, fiscalYear, key, value)); - } - return evaluations; - } - } -} diff --git a/backend/tests/core/Entities/BuildingHelper.cs b/backend/tests/core/Entities/BuildingHelper.cs deleted file mode 100644 index c6c78e15f4..0000000000 --- a/backend/tests/core/Entities/BuildingHelper.cs +++ /dev/null @@ -1,183 +0,0 @@ -using Pims.Dal; -using System; -using System.Collections.Generic; -using System.Linq; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Creates a new instance of a Building. - /// - /// - /// - /// - /// - /// - /// - public static Entity.Building CreateBuilding(int id, string projectNumber = null, string name = null, int lat = 0, int lng = 0, Entity.Agency agency = null) - { - return CreateBuilding(id, projectNumber, name, lat, lng, agency); - } - - /// - /// Creates a new instance of a Building. - /// - /// - /// - /// - /// - /// - /// - /// - /// - public static Entity.Building CreateBuilding(Entity.Parcel parcel, int id, string projectNumber = null, string name = null, int lat = 0, int lng = 0, Entity.Agency agency = null) - { - projectNumber ??= $"p{id}"; - agency ??= parcel?.Agency ?? EntityHelper.CreateAgency(id); - var address = parcel != null ? EntityHelper.CreateAddress(++parcel.AddressId, parcel.Address.Address1, parcel.Address.Address2, parcel.Address.AdministrativeArea, parcel.Address.Province, parcel.Address.Postal) : - EntityHelper.CreateAddress(id, "1234 Street", null, "V9C9C9"); - var predominateUse = EntityHelper.CreateBuildingPredominateUse("use"); - var constructionType = EntityHelper.CreateBuildingConstructionType("type"); - var occupantType = EntityHelper.CreateBuildingOccupantType("occupant"); - var classification = EntityHelper.CreatePropertyClassification("classification"); - - return new Entity.Building(parcel, lat, lng) - { - Id = id, - ProjectNumbers = $"[\"{projectNumber}\"]", - AgencyId = agency.Id, - Agency = agency, - Name = name, - AddressId = address.Id, - Address = address, - Classification = classification, - ClassificationId = classification.Id, - Description = $"description-{id}", - BuildingPredominateUse = predominateUse, - BuildingPredominateUseId = predominateUse.Id, - BuildingConstructionType = constructionType, - BuildingConstructionTypeId = constructionType.Id, - BuildingOccupantType = occupantType, - BuildingOccupantTypeId = occupantType.Id, - CreatedById = Guid.NewGuid(), - CreatedOn = DateTime.UtcNow, - UpdatedById = Guid.NewGuid(), - UpdatedOn = DateTime.UtcNow, - RowVersion = new byte[] { 12, 13, 14 }, - PropertyTypeId = 1, - }; - } - - /// - /// Create a new List with new instances of Buildings. - /// Adds the buildings to the specified 'parcel'. - /// - /// - /// - /// - /// - public static List CreateBuildings(Entity.Parcel parcel, int startId, int count) - { - for (var i = startId; i < (startId + count); i++) - { - var building = CreateBuilding(parcel, i); - parcel.Buildings.Add(new Entity.ParcelBuilding(parcel, building)); - } - return parcel.Buildings.Select(pb => pb.Building).ToList(); - } - - /// - /// Creates a new instance of a Building. - /// - /// - /// - /// - /// - /// - /// - /// - public static Entity.Building CreateBuilding(this PimsContext context, int id, string projectNumber = null, string name = null, int lat = 0, int lng = 0, Entity.Agency agency = null) - { - return CreateBuilding(context, null, id, projectNumber, name, lat, lng, agency); - } - - /// - /// Creates a new instance of a Building. - /// - /// - /// - /// - /// - /// - /// - /// - /// - public static Entity.Building CreateBuilding(this PimsContext context, Entity.Parcel parcel, int id, string projectNumber = null, string name = null, int lat = 0, int lng = 0, Entity.Agency agency = null) - { - name ??= $"l{id}"; - agency ??= parcel?.Agency ?? context.Agencies.FirstOrDefault() ?? EntityHelper.CreateAgency(id); - var address = (parcel == null ? EntityHelper.CreateAddress(context, id, "1234 Street", null, "V9C9C9") : - EntityHelper.CreateAddress(id, parcel.Address.Address1, parcel.Address.Address2, parcel.Address.AdministrativeArea, parcel.Address.Province, parcel.Address.Postal)); - var predominateUse = context.BuildingPredominateUses.FirstOrDefault(b => b.Id == 1) ?? EntityHelper.CreateBuildingPredominateUse("use"); ; - var constructionType = context.BuildingConstructionTypes.FirstOrDefault(b => b.Id == 1) ?? EntityHelper.CreateBuildingConstructionType("type"); - var occupantType = context.BuildingOccupantTypes.FirstOrDefault(b => b.Id == 1) ?? EntityHelper.CreateBuildingOccupantType("occupant"); - var classification = context.PropertyClassifications.FirstOrDefault(b => b.Id == 1) ?? EntityHelper.CreatePropertyClassification("classification"); - - var building = new Entity.Building(parcel, lat, lng) - { - Id = id, - Name = name, - ProjectNumbers = projectNumber, - AgencyId = agency.Id, - Agency = agency, - AddressId = address.Id, - Address = address, - Classification = classification, - ClassificationId = classification.Id, - Description = "description", - BuildingPredominateUse = predominateUse, - BuildingPredominateUseId = predominateUse.Id, - BuildingConstructionType = constructionType, - BuildingConstructionTypeId = constructionType.Id, - BuildingOccupantType = occupantType, - BuildingOccupantTypeId = occupantType.Id, - BuildingTenancy = "full", - CreatedById = Guid.NewGuid(), - CreatedOn = DateTime.UtcNow, - UpdatedById = Guid.NewGuid(), - UpdatedOn = DateTime.UtcNow, - RowVersion = new byte[] { 12, 13, 14 } - }; - if (parcel != null) - { - var parcelBuilding = new Entity.ParcelBuilding(parcel, building); - } - context.Buildings.Add(building); - return building; - } - - /// - /// Create a new List with new instances of Buildings. - /// Adds the buildings to the specified 'parcel'. - /// - /// - /// - /// - /// - /// - public static List CreateBuildings(this PimsContext context, Entity.Parcel parcel, int startId, int count) - { - for (var i = startId; i < (startId + count); i++) - { - context.CreateBuilding(parcel, i); - } - return parcel.Buildings.Select(pb => pb.Building).ToList(); - } - } -} diff --git a/backend/tests/core/Entities/BuildingOccupantTypeHelper.cs b/backend/tests/core/Entities/BuildingOccupantTypeHelper.cs deleted file mode 100644 index 51f0583981..0000000000 --- a/backend/tests/core/Entities/BuildingOccupantTypeHelper.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.Collections.Generic; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of a BuildingOccupantType. - /// - /// - /// - /// - public static Entity.BuildingOccupantType CreateBuildingOccupantType(int id, string name) - { - return new Entity.BuildingOccupantType(id, name) { RowVersion = new byte[] { 12, 13, 14 } }; - } - - /// - /// Create a new instance of a BuildingOccupantType. - /// - /// - /// - public static Entity.BuildingOccupantType CreateBuildingOccupantType(string name) - { - return new Entity.BuildingOccupantType(1, name) { RowVersion = new byte[] { 12, 13, 14 } }; - } - - /// - /// Creates a default list of BuildingOccupantType. - /// - /// - public static List CreateDefaultBuildingOccupantTypes() - { - return new List() - { - new Entity.BuildingOccupantType(0, "Leased") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.BuildingOccupantType(1, "Occupied By Owning Ministry") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.BuildingOccupantType(2, "Unoccupied") { RowVersion = new byte[] { 12, 13, 14 } } - }; - } - } -} diff --git a/backend/tests/core/Entities/BuildingPredominateUseHelper.cs b/backend/tests/core/Entities/BuildingPredominateUseHelper.cs deleted file mode 100644 index 5c0e14ca48..0000000000 --- a/backend/tests/core/Entities/BuildingPredominateUseHelper.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System.Collections.Generic; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of a BuildingPredominateUse. - /// - /// - /// - /// - public static Entity.BuildingPredominateUse CreateBuildingPredominateUse(int id, string name) - { - return new Entity.BuildingPredominateUse(id, name) { RowVersion = new byte[] { 12, 13, 14 } }; - } - - /// - /// Create a new instance of a BuildingPredominateUse. - /// - /// - /// - public static Entity.BuildingPredominateUse CreateBuildingPredominateUse(string name) - { - return new Entity.BuildingPredominateUse(1, name) { RowVersion = new byte[] { 12, 13, 14 } }; - } - - /// - /// Creates a default list of BuildingPredominateUse. - /// - /// - public static List CreateDefaultBuildingPredominateUses() - { - return new List() - { - new Entity.BuildingPredominateUse(0, "Religious") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.BuildingPredominateUse(1, "Research & Development Facility") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.BuildingPredominateUse(2, "Residential Detached") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.BuildingPredominateUse(3, "Residential Multi") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.BuildingPredominateUse(4, "Retail") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.BuildingPredominateUse(5, "Senior Housing (Assisted Living / Skilled Nursing)") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.BuildingPredominateUse(6, "Shelters / Orphanages / Children’s Homes / Halfway Homes") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.BuildingPredominateUse(7, "Social Assistance Housing") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.BuildingPredominateUse(8, "Storage") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.BuildingPredominateUse(9, "Storage Vehicle") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.BuildingPredominateUse(10, "Trailer Office") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.BuildingPredominateUse(11, "Trailer Other") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.BuildingPredominateUse(12, "Training Center") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.BuildingPredominateUse(13, "Transportation (Airport / Rail / Bus station)") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.BuildingPredominateUse(14, "University / Collect") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.BuildingPredominateUse(15, "Warehouse") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.BuildingPredominateUse(16, "Weigh Station") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.BuildingPredominateUse(17, "Marina") { RowVersion = new byte[] { 12, 13, 14 } } - }; - } - } -} - diff --git a/backend/tests/core/Entities/NotificationQueueHelper.cs b/backend/tests/core/Entities/NotificationQueueHelper.cs deleted file mode 100644 index 996d17492a..0000000000 --- a/backend/tests/core/Entities/NotificationQueueHelper.cs +++ /dev/null @@ -1,159 +0,0 @@ -using Pims.Dal; -using System; -using System.Collections.Generic; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - #region To - /// - /// Create a new instance of a NotificationQueue. - /// - /// - /// - /// - /// - /// - /// - public static Entity.NotificationQueue CreateNotificationQueue(int id, Entity.NotificationTemplate template, string to = "test@test.com", string subject = "test", string body = "test") - { - return new Entity.NotificationQueue(template, to, subject, body) - { - Id = id, - CreatedById = Guid.NewGuid(), - CreatedOn = new DateTime(2019, 1, 1, 18, 23, 22, DateTimeKind.Utc), - RowVersion = new byte[] { 12, 13, 14 } - }; - } - - /// - /// Create a new List with new instances of NotificationQueues. - /// - /// - /// - /// - /// - public static List CreateNotificationQueues(int startId, int count, Entity.NotificationTemplate template) - { - var notifications = new List(count); - for (var i = startId; i < (startId + count); i++) - { - notifications.Add(CreateNotificationQueue(i, template)); - } - return notifications; - } - - /// - /// Create a new instance of a NotificationQueue. - /// - /// - /// - /// - /// - /// - /// - /// - public static Entity.NotificationQueue CreateNotificationQueue(this PimsContext context, int id, Entity.NotificationTemplate template, string to = "test@test.com", string subject = "test", string body = "test") - { - var notification = CreateNotificationQueue(id, template, to, subject, body); - context.NotificationQueue.Add(notification); - return notification; - } - - /// - /// Create a new List with new instances of NotificationQueues. - /// - /// - /// - /// - /// - /// - public static List CreateNotificationQueues(this PimsContext context, int startId, int count, Entity.NotificationTemplate template) - { - var templates = new List(count); - for (var i = startId; i < (startId + count); i++) - { - templates.Add(context.CreateNotificationQueue(i, template)); - } - return templates; - } - #endregion - - #region Project - /// - /// Create a new instance of a NotificationQueue. - /// - /// - /// - /// - /// - public static Entity.NotificationQueue CreateNotificationQueue(int id, Entity.NotificationTemplate template, Entity.Project project, Entity.Agency agency = null) - { - return new Entity.NotificationQueue(template, project, agency ?? project.Agency, "test", "test") - { - Id = id, - CreatedById = Guid.NewGuid(), - CreatedOn = DateTime.UtcNow, - RowVersion = new byte[] { 12, 13, 14 } - }; - } - - /// - /// Create a new List with new instances of NotificationQueues. - /// - /// - /// - /// - /// - /// - public static List CreateNotificationQueues(int startId, int count, Entity.NotificationTemplate template, Entity.Project project, Entity.Agency agency = null) - { - var notifications = new List(count); - for (var i = startId; i < (startId + count); i++) - { - notifications.Add(CreateNotificationQueue(i, template, project, agency)); - } - return notifications; - } - - /// - /// Create a new instance of a NotificationQueue. - /// - /// - /// - /// - /// - /// - public static Entity.NotificationQueue CreateNotificationQueue(this PimsContext context, int id, Entity.NotificationTemplate template, Entity.Project project, Entity.Agency agency = null) - { - var notification = CreateNotificationQueue(id, template, project, agency); - context.NotificationQueue.Add(notification); - return notification; - } - - /// - /// Create a new List with new instances of NotificationQueues. - /// - /// - /// - /// - /// - /// - /// - public static List CreateNotificationQueues(this PimsContext context, int startId, int count, Entity.NotificationTemplate template, Entity.Project project, Entity.Agency agency = null) - { - var templates = new List(count); - for (var i = startId; i < (startId + count); i++) - { - templates.Add(context.CreateNotificationQueue(i, template, project, agency)); - } - return templates; - } - #endregion - } -} diff --git a/backend/tests/core/Entities/NotificationTemplateHelper.cs b/backend/tests/core/Entities/NotificationTemplateHelper.cs deleted file mode 100644 index d2564603d8..0000000000 --- a/backend/tests/core/Entities/NotificationTemplateHelper.cs +++ /dev/null @@ -1,85 +0,0 @@ -using Pims.Dal; -using System; -using System.Collections.Generic; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of a NotificationTemplate. - /// - /// - /// - /// - /// - /// - public static Entity.NotificationTemplate CreateNotificationTemplate(int id, string name, string subject = "test", string body = "test") - { - return new Entity.NotificationTemplate(name, subject, body) - { - Id = id, - Description = $"description-{id}", - CreatedById = Guid.NewGuid(), - CreatedOn = DateTime.UtcNow, - RowVersion = new byte[] { 12, 13, 14 } - }; - } - - /// - /// Create a new List with new instances of NotificationTemplates. - /// - /// - /// - /// - /// - public static List CreateNotificationTemplates(int startId, int count, string name = "test") - { - var templates = new List(count); - for (var i = startId; i < (startId + count); i++) - { - templates.Add(CreateNotificationTemplate(i, $"{name}-{i}")); - } - return templates; - } - - /// - /// Create a new instance of a NotificationTemplate. - /// - /// - /// - /// - /// - /// - /// - public static Entity.NotificationTemplate CreateNotificationTemplate(this PimsContext context, int id, string name, string subject = "test", string body = "test") - { - var template = CreateNotificationTemplate(id, name, subject, body); - context.NotificationTemplates.Add(template); - return template; - } - - /// - /// Create a new List with new instances of NotificationTemplates. - /// - /// - /// - /// - /// - /// - /// - public static List CreateNotificationTemplates(this PimsContext context, int startId, int count, string name = "test") - { - var templates = new List(count); - for (var i = startId; i < (startId + count); i++) - { - templates.Add(context.CreateNotificationTemplate(i, $"{name}-{i}")); - } - return templates; - } - } -} diff --git a/backend/tests/core/Entities/ParcelEvaluationHelper.cs b/backend/tests/core/Entities/ParcelEvaluationHelper.cs deleted file mode 100644 index c04f74cd29..0000000000 --- a/backend/tests/core/Entities/ParcelEvaluationHelper.cs +++ /dev/null @@ -1,89 +0,0 @@ -using Pims.Dal; -using System; -using System.Collections.Generic; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of a ParcelEvaluations. - /// - /// - /// - /// - /// - /// - public static Entity.ParcelEvaluation CreateEvaluation(Entity.Parcel parcel, DateTime date, Entity.EvaluationKeys key = Entity.EvaluationKeys.Assessed, decimal value = 1) - { - return new Entity.ParcelEvaluation() - { - ParcelId = parcel.Id, - Parcel = parcel, - Date = date, - Key = key, - Value = value, - CreatedById = Guid.NewGuid(), - CreatedOn = DateTime.UtcNow, - RowVersion = new byte[] { 12, 13, 14 } - }; - } - - /// - /// Create a new List with new instances of ParcelEvaluations. - /// - /// - /// - /// - /// - /// - public static List CreateEvaluations(Entity.Parcel parcel, DateTime startDate, int count, Entity.EvaluationKeys key = Entity.EvaluationKeys.Assessed, decimal value = 1) - { - for (var i = 0; i < count; i++) - { - parcel.Evaluations.Add(CreateEvaluation(parcel, startDate.AddYears(i), key, value)); - } - return parcel.Evaluations as List; - } - - /// - /// Create a new instance of a ParcelEvaluations. - /// - /// - /// - /// - /// - /// - /// - public static Entity.ParcelEvaluation CreateEvaluation(this PimsContext context, Entity.Parcel parcel, DateTime date, Entity.EvaluationKeys key = Entity.EvaluationKeys.Assessed, decimal value = 1) - { - var evaluation = CreateEvaluation(parcel, date, key, value); - context.ParcelEvaluations.Add(evaluation); - return evaluation; - } - - /// - /// Create a new List with new instances of ParcelEvaluations. - /// - /// - /// - /// - /// - /// - /// - /// - public static List CreateEvaluations(this PimsContext context, Entity.Parcel parcel, DateTime startDate, int count, Entity.EvaluationKeys key = Entity.EvaluationKeys.Assessed, decimal value = 1) - { - var evaluations = new List(count); - for (var i = 0; i < count; i++) - { - evaluations.Add(context.CreateEvaluation(parcel, startDate.AddYears(i), key, value)); - } - return evaluations; - } - } -} diff --git a/backend/tests/core/Entities/ParcelFiscalHelper.cs b/backend/tests/core/Entities/ParcelFiscalHelper.cs deleted file mode 100644 index 2d16438128..0000000000 --- a/backend/tests/core/Entities/ParcelFiscalHelper.cs +++ /dev/null @@ -1,124 +0,0 @@ -using Pims.Dal; -using System; -using System.Collections.Generic; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of a ParcelFiscal. - /// - /// - /// - /// - /// - /// - public static Entity.ParcelFiscal CreateFiscal(Entity.Parcel parcel, int fiscalYear, Entity.FiscalKeys key = Entity.FiscalKeys.Market, decimal value = 1) - { - return new Entity.ParcelFiscal() - { - ParcelId = parcel.Id, - Parcel = parcel, - FiscalYear = fiscalYear, - Key = key, - Value = value, - CreatedById = Guid.NewGuid(), - CreatedOn = DateTime.UtcNow, - RowVersion = new byte[] { 12, 13, 14 } - }; - } - - /// - /// Create a new List with new instances of ParcelFiscal. - /// - /// - /// - /// - /// - /// - public static List CreateFiscals(Entity.Parcel parcel, int startFiscalYear, int count, Entity.FiscalKeys key = Entity.FiscalKeys.Market, decimal value = 1) - { - for (var i = startFiscalYear; i < (startFiscalYear + count); i++) - { - parcel.Fiscals.Add(CreateFiscal(parcel, i, key, value)); - } - return parcel.Fiscals as List; - } - - /// - /// Create a new List with new instances of ParcelFiscal. - /// - /// - /// - /// - /// - public static List CreateFiscals(Entity.Parcel parcel, int[] fiscalYears, Entity.FiscalKeys key = Entity.FiscalKeys.Market, decimal value = 1) - { - foreach (var fiscalYear in fiscalYears) - { - parcel.Fiscals.Add(CreateFiscal(parcel, fiscalYear, key, value)); - } - return parcel.Fiscals as List; - } - - /// - /// Create a new instance of a ParcelFiscal. - /// - /// - /// - /// - /// - /// - /// - public static Entity.ParcelFiscal CreateFiscal(this PimsContext context, Entity.Parcel parcel, int fiscalYear, Entity.FiscalKeys key = Entity.FiscalKeys.Market, decimal value = 1) - { - var evaluation = CreateFiscal(parcel, fiscalYear, key, value); - context.ParcelFiscals.Add(evaluation); - return evaluation; - } - - /// - /// Create a new List with new instances of ParcelFiscal. - /// - /// - /// - /// - /// - /// - /// - /// - public static List CreateFiscals(this PimsContext context, Entity.Parcel parcel, int startFiscalYear, int count, Entity.FiscalKeys key = Entity.FiscalKeys.Market, decimal value = 1) - { - var evaluations = new List(count); - for (var i = startFiscalYear; i < (startFiscalYear + count); i++) - { - evaluations.Add(context.CreateFiscal(parcel, i, key, value)); - } - return evaluations; - } - - /// - /// Create a new List with new instances of ParcelFiscal. - /// - /// - /// - /// - /// - /// - /// - public static List CreateFiscals(this PimsContext context, Entity.Parcel parcel, int[] fiscalYears, Entity.FiscalKeys key = Entity.FiscalKeys.Market, decimal value = 1) - { - var evaluations = new List(fiscalYears.Length); - foreach (var fiscalYear in fiscalYears) - { - evaluations.Add(context.CreateFiscal(parcel, fiscalYear, key, value)); - } - return evaluations; - } - } -} diff --git a/backend/tests/core/Entities/ParcelHelper.cs b/backend/tests/core/Entities/ParcelHelper.cs deleted file mode 100644 index 62e9732617..0000000000 --- a/backend/tests/core/Entities/ParcelHelper.cs +++ /dev/null @@ -1,145 +0,0 @@ -using Pims.Dal; -using System; -using System.Collections.Generic; -using System.Linq; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of a Parcel. - /// - /// - /// - /// - /// - /// - public static Entity.Parcel CreateParcel(int pid, double lat = 0, double lng = 0, int agencyId = 1, Entity.Address address = null) - { - var agency = EntityHelper.CreateAgency(agencyId); - return CreateParcel(pid, lat, lng, agency, address); - } - - /// - /// Create a new instance of a Parcel. - /// - /// - /// - /// - /// - /// - public static Entity.Parcel CreateParcel(int pid, double lat, double lng, Entity.Agency agency, Entity.Address address = null) - { - agency ??= EntityHelper.CreateAgency(pid); - if (address == null) - { - address = EntityHelper.CreateAddress(pid, "1234 Street", null, "V9C9C9"); - } - var classification = EntityHelper.CreatePropertyClassification("classification"); - - return new Entity.Parcel(pid, lat, lng) - { - Id = pid, - Agency = agency, - AgencyId = agency.Id, - Address = address, - AddressId = address.Id, - Classification = classification, - ClassificationId = classification.Id, - Description = $"description-{pid}", - CreatedById = Guid.NewGuid(), - CreatedOn = DateTime.UtcNow, - UpdatedById = Guid.NewGuid(), - UpdatedOn = DateTime.UtcNow, - RowVersion = new byte[] { 12, 13, 14 } - }; - } - - /// - /// Create a new List with new instances of Parcels. - /// - /// - /// - /// - public static List CreateParcels(int startId, int count) - { - var parcels = new List(count); - for (var i = startId; i < (startId + count); i++) - { - parcels.Add(CreateParcel(i, 0, 0, 1)); - } - return parcels; - } - - /// - /// Create a new instance of a Parcel. - /// - /// - /// - /// - /// - public static Entity.Parcel CreateParcel(this PimsContext context, int pid, Entity.Agency agency) - { - return context.CreateParcel(pid, 0, 0, agency); - } - - /// - /// Create a new instance of a Parcel. - /// - /// - /// - /// - /// - /// - /// - public static Entity.Parcel CreateParcel(this PimsContext context, int pid, double lat = 0, double lng = 0, Entity.Agency agency = null) - { - agency ??= context.Agencies.FirstOrDefault() ?? EntityHelper.CreateAgency(pid); - var address = context.CreateAddress(pid, "1234 Street", null, "V9C9C9"); - var classification = context.PropertyClassifications.FirstOrDefault(s => s.Id == 1) ?? EntityHelper.CreatePropertyClassification("classification"); - - var parcel = new Entity.Parcel(pid, lat, lng) - { - Id = pid, - Agency = agency, - AgencyId = agency.Id, - Address = address, - AddressId = address.Id, - Classification = classification, - ClassificationId = classification.Id, - Description = $"description-{pid}", - CreatedById = Guid.NewGuid(), - CreatedOn = DateTime.UtcNow, - UpdatedById = Guid.NewGuid(), - UpdatedOn = DateTime.UtcNow, - RowVersion = new byte[] { 12, 13, 14 } - }; - context.Parcels.Add(parcel); - return parcel; - } - - /// - /// Create a new List with new instances of Parcels. - /// - /// - /// - /// - /// - public static List CreateParcels(this PimsContext context, int startId, int count) - { - var agency = context.Agencies.FirstOrDefault(a => a.Id == 1) ?? EntityHelper.CreateAgency(startId); - - var parcels = new List(count); - for (var i = startId; i < (startId + count); i++) - { - parcels.Add(context.CreateParcel(i, 0, 0, agency)); - } - return parcels; - } - } -} diff --git a/backend/tests/core/Entities/ProjectHelper.cs b/backend/tests/core/Entities/ProjectHelper.cs deleted file mode 100644 index 2a56fa1eb3..0000000000 --- a/backend/tests/core/Entities/ProjectHelper.cs +++ /dev/null @@ -1,198 +0,0 @@ -using Pims.Core.Extensions; -using Pims.Dal; -using Pims.Dal.Helpers.Extensions; -using System; -using System.Collections.Generic; -using System.Linq; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of a Project. - /// - /// - /// - /// - public static Entity.Project CreateProject(int id, int agencyId) - { - var agency = EntityHelper.CreateAgency(agencyId); - return CreateProject(id, agency); - } - - /// - /// Create a new instance of a Project. - /// - /// - /// - /// - /// - /// - public static Entity.Project CreateProject(int id, Entity.Agency agency = null, Entity.TierLevel tierLevel = null, Entity.WorkflowProjectStatus workflowStatus = null, Entity.ProjectRisk risk = null) - { - agency ??= EntityHelper.CreateAgency(id); - tierLevel ??= EntityHelper.CreateTierLevel(id, "tierLevel"); - risk ??= EntityHelper.CreateProjectRisk(id, "risk", "risk", 1); - var status = workflowStatus?.Status ?? EntityHelper.CreateProjectStatus("Draft", "DR"); - var workflow = workflowStatus?.Workflow ?? EntityHelper.CreateWorkflow(id, "Submit", "SUBMIT-DISPOSAL", new[] { status }); - - var user = CreateUser(Guid.NewGuid(), "project tester", "asasa", "asasa", null, agency); - var project = new Entity.Project($"SPP-{id:00000}", $"test-{id}", tierLevel) - { - Id = id, - ReportedFiscalYear = DateTime.UtcNow.GetFiscalYear(), - ActualFiscalYear = DateTime.UtcNow.GetFiscalYear(), - Risk = risk, - RiskId = risk.Id, - Agency = agency, - AgencyId = agency.Id, - Workflow = workflow, - WorkflowId = workflow?.Id, - Status = status, - StatusId = status.Id, - Description = $"description-{id}", - CreatedBy = user, - CreatedById = user.Id, - CreatedOn = DateTime.UtcNow, - UpdatedById = user.Id, - UpdatedBy = user, - UpdatedOn = DateTime.UtcNow, - Metadata = "{\"offerAmount\": 123}", - RowVersion = new byte[] { 12, 13, 14 } - }; - project.AddOrUpdateNote(Entity.NoteTypes.Public, $"publicNote-{id}"); - project.AddOrUpdateNote(Entity.NoteTypes.Private, $"privateNote-{id}"); - project.AddOrUpdateNote(Entity.NoteTypes.Appraisal, $"appraisedNote-{id}"); - return project; - } - - /// - /// Create a new List with new instances of Projects. - /// - /// - /// - /// - /// - /// - /// - /// - public static List CreateProjects(int startId, int count, Entity.Agency agency = null, Entity.TierLevel tierLevel = null, Entity.WorkflowProjectStatus workflowStatus = null, Entity.ProjectRisk risk = null) - { - var projects = new List(count); - for (var i = startId; i < (startId + count); i++) - { - projects.Add(CreateProject(i, agency, tierLevel, workflowStatus, risk)); - } - return projects; - } - - /// - /// Create a new instance of a Project. - /// - /// - /// - /// - /// - public static Entity.Project CreateProject(this PimsContext context, int id, int agencyId) - { - var agency = context.Agencies.Find(agencyId) ?? EntityHelper.CreateAgency(agencyId); - return context.CreateProject(id, agency); - } - - /// - /// Create a new instance of a Project. - /// - /// - /// - /// - /// - /// - /// - public static Entity.Project CreateProject(this PimsContext context, int id, Entity.Agency agency = null, Entity.WorkflowProjectStatus workflowStatus = null, Entity.ProjectRisk risk = null) - { - agency ??= context.Agencies.OrderBy(a => a.Id).FirstOrDefault() ?? EntityHelper.CreateAgency(1); - risk ??= context.ProjectRisks.FirstOrDefault() ?? EntityHelper.CreateProjectRisk(1, "risk", "risk", 1); - workflowStatus ??= context.WorkflowProjectStatus.FirstOrDefault(ws => ws.WorkflowId == 1 && ws.StatusId == 1); - if (workflowStatus == null) - { - var status = workflowStatus?.Status ?? EntityHelper.CreateProjectStatus("Draft", "DR"); - var workflow = workflowStatus?.Workflow ?? EntityHelper.CreateWorkflow(id, "Submit", "SUBMIT-DISPOSAL", new[] { status }); - workflowStatus ??= workflow.Status.First(); - } - - var tierLevel = context.TierLevels.FirstOrDefault(s => s.Id == 1) ?? EntityHelper.CreateTierLevel("tierLevel"); - - var project = EntityHelper.CreateProject(id, agency, tierLevel, workflowStatus, risk); - context.Projects.Add(project); - return project; - } - - /// - /// Create a new List with new instances of Projects. - /// - /// - /// - /// - /// - /// - /// - /// - public static List CreateProjects(this PimsContext context, int startId, int count, Entity.Agency agency = null, Entity.WorkflowProjectStatus workflowStatus = null, Entity.ProjectRisk risk = null) - { - agency ??= context.Agencies.FirstOrDefault(a => a.Id == 1) ?? EntityHelper.CreateAgency(startId); - risk ??= context.ProjectRisks.FirstOrDefault() ?? EntityHelper.CreateProjectRisk(1, "risk", "risk", 1); - workflowStatus ??= context.WorkflowProjectStatus.FirstOrDefault(ws => ws.WorkflowId == 1 && ws.StatusId == 1); - if (workflowStatus == null) - { - var status = workflowStatus?.Status ?? EntityHelper.CreateProjectStatus("Draft", "DR"); - var workflow = workflowStatus?.Workflow ?? EntityHelper.CreateWorkflow(startId, "Submit", "SUBMIT-DISPOSAL", new[] { status }); - workflowStatus ??= workflow.Status.First(); - } - - var projects = new List(count); - for (var i = startId; i < (startId + count); i++) - { - projects.Add(context.CreateProject(i, agency, workflowStatus, risk)); - } - return projects; - } - - /// - /// Set the project workflow and status to the specified 'workflowStatus'. - /// - /// - /// - /// - public static Entity.Project SetStatus(this Entity.Project project, Entity.WorkflowProjectStatus workflowStatus) - { - project.Workflow = workflowStatus.Workflow; - project.WorkflowId = workflowStatus.WorkflowId; - project.Status = workflowStatus.Status; - project.StatusId = workflowStatus.StatusId; - return project; - } - - /// - /// Set the project workflow and status to the specified 'workflow' and 'status'. - /// If the status is not part of the specified workflow it will throw an exception. - /// - /// - /// - /// - /// - /// - public static PimsContext SetStatus(this PimsContext context, Entity.Project project, string workflowCode, string statusCode) - { - var workflow = context.Workflows.First(w => w.Code == workflowCode); - var status = workflow.Status.First(s => s.Status.Code == statusCode); - project.SetStatus(status); - - return context; - } - } -} diff --git a/backend/tests/core/Entities/ProjectReportHelper.cs b/backend/tests/core/Entities/ProjectReportHelper.cs deleted file mode 100644 index b88b1c239a..0000000000 --- a/backend/tests/core/Entities/ProjectReportHelper.cs +++ /dev/null @@ -1,118 +0,0 @@ -using Pims.Dal; -using Pims.Dal.Entities; -using System; -using System.Collections.Generic; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of a Project Report. - /// - /// - /// - /// - public static Entity.ProjectReport CreateProjectReport(int id, string name) - { - return CreateProjectReport(id, name, DateTime.Now, DateTime.Now.AddDays(-1), false); - } - - /// - /// Create a new instance of a Project Report. - /// - /// - /// - /// - /// - /// - /// - public static Entity.ProjectReport CreateProjectReport(int id, string name = null, DateTime? toDate = null, DateTime? fromDate = null, bool isFinal = false, Agency agency = null) - { - var user = CreateUser(Guid.NewGuid(), "project tester", "asasa", "asasa", null, agency); - return new Entity.ProjectReport() - { - Id = id, - Name = name, - To = DateTime.UtcNow.Date, - From = fromDate, - IsFinal = isFinal, - ReportType = 0, - CreatedBy = user, - CreatedById = user.Id, - CreatedOn = DateTime.UtcNow, - UpdatedById = user.Id, - UpdatedBy = user, - UpdatedOn = DateTime.UtcNow, - RowVersion = new byte[] { 12, 13, 14 } - }; - } - - /// - /// Create a new List with new instances of Project Reports. - /// - /// - /// - /// - public static List CreateProjectReports(int startId, int count) - { - var projects = new List(count); - for (var i = startId; i < (startId + count); i++) - { - projects.Add(CreateProjectReport(i, "projectreport" + i)); - } - return projects; - } - - /// - /// Create a new instance of a Project Report. - /// - /// - /// - /// - /// - public static Entity.ProjectReport CreateProjectReport(this PimsContext context, int id, string name) - { - return context.CreateProjectReport(id, name); - } - - /// - /// Create a new instance of a Project Reports. - /// - /// - /// - /// - /// - /// - /// - /// - public static Entity.ProjectReport CreateProjectReport(this PimsContext context, int id, string name = null, DateTime? toDate = null, DateTime? fromDate = null, bool isFinal = false, Agency agency = null) - { - var projectReport = EntityHelper.CreateProjectReport(id, name, toDate, fromDate, isFinal, agency); - context.ProjectReports.Add(projectReport); - return projectReport; - } - - /// - /// Create a new List with new instances of Project Reports. - /// - /// - /// - /// - /// - public static List CreateProjectReports(this PimsContext context, int startId, int count) - { - - var projectReports = new List(count); - for (var i = startId; i < (startId + count); i++) - { - projectReports.Add(context.CreateProjectReport(i, "projectReport" + i)); - } - return projectReports; - } - } -} diff --git a/backend/tests/core/Entities/ProjectRiskHelper.cs b/backend/tests/core/Entities/ProjectRiskHelper.cs deleted file mode 100644 index f0b3e99ac5..0000000000 --- a/backend/tests/core/Entities/ProjectRiskHelper.cs +++ /dev/null @@ -1,101 +0,0 @@ -using Pims.Core.Helpers; -using Pims.Dal; -using System.Collections.Generic; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of a ProjectRisk. - /// - /// - /// - /// - /// - public static Entity.ProjectRisk CreateProjectRisk(string name, string code, int sortOrder) - { - return CreateProjectRisk(1, name, code, sortOrder); - } - - /// - /// Create a new instance of a ProjectRisk. - /// - /// - /// - /// - /// - /// - public static Entity.ProjectRisk CreateProjectRisk(int id, string name, string code, int sortOrder) - { - return new Entity.ProjectRisk(name, code, sortOrder) { Id = id, RowVersion = new byte[] { 12, 13, 14 } }; - } - - /// - /// Creates a random list of ProjectRisk. - /// - /// - /// - /// - /// - public static List CreateProjectRisks(int startId, int quantity, int sortOrder) - { - var risk = new List(); - - for (var i = startId; i < quantity; i++) - { - var name = StringHelper.Generate(10); - risk.Add(new Entity.ProjectRisk(name, name, sortOrder) { Id = i, RowVersion = new byte[] { 12, 13, 14 } }); - } - - return risk; - } - - /// - /// Creates a default list of ProjectRisk. - /// - /// - public static List CreateDefaultProjectRisks() - { - return new List() - { - new Entity.ProjectRisk("Copmplete", "COMP", 1) { Id = 1, RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.ProjectRisk("Green", "GREEN", 2) { Id = 2, RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.ProjectRisk("Yellow", "YELLOW", 3) { Id = 3, RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.ProjectRisk("Red", "RED", 4) { Id = 4, RowVersion = new byte[] { 12, 13, 14 } }, - }; - } - - /// - /// Create a default list of project risk and add them to 'context'. - /// - /// - /// - public static List CreateDefaultProjectRisks(this PimsContext context) - { - var risk = CreateDefaultProjectRisks(); - context.ProjectRisks.AddRange(risk); - return risk; - } - - /// - /// Creates a new project risk and adds it to the 'context'. - /// - /// - /// - /// - /// - /// - /// - public static Entity.ProjectRisk CreateProjectRisks(this PimsContext context, int id, string name, string code, int sortOrder) - { - var risk = CreateProjectRisk(id, name, code, sortOrder); - context.ProjectRisks.Add(risk); - return risk; - } - } -} diff --git a/backend/tests/core/Entities/ProjectSnapshotHelper.cs b/backend/tests/core/Entities/ProjectSnapshotHelper.cs deleted file mode 100644 index cc3be58586..0000000000 --- a/backend/tests/core/Entities/ProjectSnapshotHelper.cs +++ /dev/null @@ -1,112 +0,0 @@ -using Pims.Dal; -using Pims.Dal.Entities; -using System; -using System.Collections.Generic; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of a Project Snapshot. - /// - /// - /// - /// - public static Entity.ProjectSnapshot CreateProjectSnapshot(int id, DateTime snapshotOn) - { - return CreateProjectSnapshot(id, 0, snapshotOn); - } - - /// - /// Create a new instance of a Project Snapshot. - /// - /// - /// - /// /// - /// - public static Entity.ProjectSnapshot CreateProjectSnapshot(int id, int projectId = 0, DateTime? snapshotOn = null, Agency agency = null) - { - var user = CreateUser(Guid.NewGuid(), "project tester", "asasa", "asasa", agency: agency); - return new Entity.ProjectSnapshot() - { - Id = id, - ProjectId = projectId, - SnapshotOn = snapshotOn ?? DateTime.UtcNow, - CreatedBy = user, - CreatedById = user.Id, - CreatedOn = DateTime.UtcNow, - UpdatedById = user.Id, - UpdatedBy = user, - UpdatedOn = DateTime.UtcNow, - RowVersion = new byte[] { 12, 13, 14 } - }; - } - - /// - /// Create a new List with new instances of Project Snapshots. - /// - /// - /// - /// - /// - /// - public static List CreateProjectSnapshots(int startId, int count, int projectId = 0, DateTime? snapshotOn = null, Agency agency = null) - { - var projectSnapshots = new List(count); - for (var i = startId; i < (startId + count); i++) - { - projectSnapshots.Add(CreateProjectSnapshot(i, projectId, snapshotOn)); - } - return projectSnapshots; - } - - /// - /// Create a new instance of a Project Snapshot. - /// - /// - /// - /// - public static Entity.ProjectSnapshot CreateProjectSnapshot(this PimsContext context, int id) - { - return context.CreateProjectSnapshot(id, 0, DateTime.UtcNow); - } - - /// - /// Create a new instance of a Project Snapshot. - /// - /// - /// - /// - /// - /// - public static Entity.ProjectSnapshot CreateProjectSnapshot(this PimsContext context, int id, int projectId = 0, DateTime? snapshotOn = null, Agency agency = null) - { - var projectSnapshot = EntityHelper.CreateProjectSnapshot(id, projectId, snapshotOn, agency); - context.ProjectSnapshots.Add(projectSnapshot); - return projectSnapshot; - } - - /// - /// Create a new List with new instances of Project Snapshots. - /// - /// - /// - /// - /// - /// - public static List CreateProjectSnapshots(this PimsContext context, int startId, int count, int projectId = 0, DateTime? snapshotOn = null) - { - var projectSnapshots = new List(count); - for (var i = startId; i < (startId + count); i++) - { - projectSnapshots.Add(context.CreateProjectSnapshot(i, projectId, snapshotOn)); - } - return projectSnapshots; - } - } -} diff --git a/backend/tests/core/Entities/ProjectStatusHelper.cs b/backend/tests/core/Entities/ProjectStatusHelper.cs deleted file mode 100644 index f70031e617..0000000000 --- a/backend/tests/core/Entities/ProjectStatusHelper.cs +++ /dev/null @@ -1,138 +0,0 @@ -using Pims.Core.Extensions; -using Pims.Core.Helpers; -using Pims.Dal; -using System.Collections.Generic; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of a ProjectStatus. - /// - /// - /// - /// - public static Entity.ProjectStatus CreateProjectStatus(string name, string code) - { - return CreateProjectStatus(1, name, code); - } - - /// - /// Create a new instance of a ProjectStatus. - /// - /// - /// - /// - /// - public static Entity.ProjectStatus CreateProjectStatus(int id, string name, string code) - { - return new Entity.ProjectStatus(name, code) { Id = id, RowVersion = new byte[] { 12, 13, 14 } }; - } - - /// - /// Creates a random list of ProjectStatus. - /// - /// - /// - /// - public static List CreateProjectStatus(int startId, int quantity) - { - var status = new List(); - - for (var i = startId; i < quantity; i++) - { - var name = StringHelper.Generate(10); - status.Add(new Entity.ProjectStatus(name, name) { Id = i, SortOrder = 0, RowVersion = new byte[] { 12, 13, 14 } }); - } - - return status; - } - - /// - /// Creates a default list of ProjectStatus. - /// - /// - public static List CreateDefaultProjectStatus() - { - return new List() - { - new Entity.ProjectStatus("Draft", "DR") { Id = 1, SortOrder = 0, Route = "{DR}", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.ProjectStatus("Select Properties", "DR-P") { Id = 2, SortOrder = 1, Route = "{DR}", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.ProjectStatus("Update Information", "DR-I") { Id = 3, SortOrder = 2, Route = "{DR}", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.ProjectStatus("Required Documentation", "DR-D") { Id = 4, SortOrder = 3, Route = "{DR}", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.ProjectStatus("Approval", "DR-A") { Id = 5, SortOrder = 4, Route = "{DR}", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.ProjectStatus("Review", "DR-RE") { Id = 6, SortOrder = 5, Route = "{DR}", RowVersion = new byte[] { 12, 13, 14 } }, - - new Entity.ProjectStatus("Submitted", "AS-I") { Id = 7, SortOrder = 6, IsMilestone = true, Route = "{AS}", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.ProjectStatus("Submitted Exemption", "AS-EXE") { Id = 8, SortOrder = 6, IsMilestone = true, Route = "{AS-EX}", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.ProjectStatus("Document Review", "AS-D") { Id = 10, SortOrder = 7, Route = "{AS}", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.ProjectStatus("Appraisal Review", "AS-AP") { Id = 11, SortOrder = 8, Route = "{AS}", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.ProjectStatus("First Nations Consultation", "AS-FNC") { Id = 12, SortOrder = 9, Route = "{AS}", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.ProjectStatus("Exemption Review", "AS-EXP") { Id = 13, SortOrder = 10, Route = "{AS-EX}", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.ProjectStatus("Approved for ERP", "AP-ERP") { Id = 14, SortOrder = 11, IsMilestone = true, Route = "{AS}", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.ProjectStatus("Approved for Exemption", "AP-EXE") { Id = 15, SortOrder = 11, IsMilestone = true, Route = "{AS-EX}", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.ProjectStatus("Denied", "DE") { Id = 16, SortOrder = 11, IsMilestone = true, Route = "{AS}, {AS-EX}", RowVersion = new byte[] { 12, 13, 14 } }, - - new Entity.ProjectStatus("Transferred within GRE", "T-GRE") { Id = 20, SortOrder = 21, IsMilestone = true, Route = "{EX}, {ERP}", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.ProjectStatus("Approved for SPL", "AP-SPL") { Id = 21, SortOrder = 21, IsMilestone = true, Route = "{EX}, {ERP}", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.ProjectStatus("Not in SPL", "AP-!SPL") { Id = 22, SortOrder = 21, IsMilestone = true, Route = "{EX}, {ERP}", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.ProjectStatus("Cancelled", "CA") { Id = 23, SortOrder = 21, IsMilestone = true, Route = "{EX}, {ERP}, {SPL}", RowVersion = new byte[] { 12, 13, 14 } }, - - new Entity.ProjectStatus("In ERP", "ERP-ON") { Id = 30, SortOrder = 1, Route = "{ERP}", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.ProjectStatus("On Hold", "ERP-OH") { Id = 31, SortOrder = 2, Route = "{ERP}", RowVersion = new byte[] { 12, 13, 14 } }, - - new Entity.ProjectStatus("Disposed", "DIS") { Id = 32, SortOrder = 21, IsMilestone = true, Route = "{EX}, {ERP}", RowVersion = new byte[] { 12, 13, 14 } }, - - new Entity.ProjectStatus("Pre-Marketing", "SPL-PM") { Id = 40, SortOrder = 18, Route = "{SPL}", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.ProjectStatus("Marketing", "SPL-M") { Id = 41, SortOrder = 19, Route = "{SPL}", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.ProjectStatus("Contract in Place - Conditional", "SPL-CIP-C") { Id = 42, SortOrder = 20, Route = "{SPL}", RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.ProjectStatus("Contract in Place - Unconditional", "SPL-CIP-U") { Id = 43, SortOrder = 21, Route = "{SPL}", RowVersion = new byte[] { 12, 13, 14 } } - }; - } - - /// - /// Create a default list of project status and add them to 'context'. - /// - /// - /// - public static List CreateDefaultProjectStatus(this PimsContext context) - { - var status = CreateDefaultProjectStatus(); - context.ProjectStatus.AddRange(status); - return status; - } - - /// - /// Creates a new project status and adds it to the 'context'. - /// - /// - /// - /// - /// - /// - public static Entity.ProjectStatus CreateProjectStatus(this PimsContext context, int id, string name, string code) - { - var status = CreateProjectStatus(id, name, code); - context.ProjectStatus.Add(status); - return status; - } - - /// - /// Add the specified 'status' to the specified 'workflow'. - /// - /// - /// - /// - /// - public static PimsContext AddStatusToWorkflow(this PimsContext context, Entity.Workflow workflow, IEnumerable status) - { - status.ForEach(s => workflow.Status.Add(new Entity.WorkflowProjectStatus(workflow, s))); - return context; - } - } -} diff --git a/backend/tests/core/Entities/PropertyClassificationHelper.cs b/backend/tests/core/Entities/PropertyClassificationHelper.cs deleted file mode 100644 index 0ae3e5e860..0000000000 --- a/backend/tests/core/Entities/PropertyClassificationHelper.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Collections.Generic; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of a PropertyClassification. - /// - /// - /// - /// - /// - public static Entity.PropertyClassification CreatePropertyClassification(int id, string name, bool isVisible = true) - { - return new Entity.PropertyClassification(id, name, isVisible) { RowVersion = new byte[] { 12, 13, 14 } }; - } - - /// - /// Create a new instance of a PropertyClassification. - /// - /// - /// - /// - public static Entity.PropertyClassification CreatePropertyClassification(string name, bool isVisible = true) - { - return new Entity.PropertyClassification(1, name, isVisible) { RowVersion = new byte[] { 12, 13, 14 } }; - } - - /// - /// Creates a default list of PropertyClassification. - /// - /// - public static List CreateDefaultPropertyClassifications() - { - return new List() - { - new Entity.PropertyClassification(0, "Core Operational") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.PropertyClassification(1, "Core Strategic") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.PropertyClassification(2, "Surplus Active") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.PropertyClassification(3, "Surplus Encumbered") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.PropertyClassification(4, "Disposed", false) { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.PropertyClassification(5, "Demolished", false) { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.PropertyClassification(6, "Subdivided", false) { RowVersion = new byte[] { 12, 13, 14 } } - }; - } - } -} diff --git a/backend/tests/core/Entities/PropertyHelper.cs b/backend/tests/core/Entities/PropertyHelper.cs deleted file mode 100644 index 14909864cf..0000000000 --- a/backend/tests/core/Entities/PropertyHelper.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Pims.Core.Test.Entities -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - } -} diff --git a/backend/tests/core/Entities/ProvinceHelper.cs b/backend/tests/core/Entities/ProvinceHelper.cs deleted file mode 100644 index ddddda50b9..0000000000 --- a/backend/tests/core/Entities/ProvinceHelper.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Collections.Generic; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of a Province. - /// - /// - /// - /// - public static Entity.Province CreateProvince(string id, string name) - { - return new Entity.Province(id, name) { RowVersion = new byte[] { 12, 13, 14 } }; - } - - /// - /// Creates a default list of Province. - /// - /// - public static List CreateDefaultProvinces() - { - return new List() - { - new Entity.Province("ON", "Ontario") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Province("BC", "British Columbia") { RowVersion = new byte[] { 12, 13, 14 } }, - }; - } - } -} diff --git a/backend/tests/core/Entities/RoleHelper.cs b/backend/tests/core/Entities/RoleHelper.cs deleted file mode 100644 index 0f99b0a3a0..0000000000 --- a/backend/tests/core/Entities/RoleHelper.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Collections.Generic; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of an AccessRequest for a default user. - /// - /// - /// - public static Entity.Role CreateRole(string name) - { - return CreateRole(Guid.NewGuid(), name); - } - - /// - /// Create a new instance of an AccessRequest for a default user. - /// - /// - /// - /// - public static Entity.Role CreateRole(Guid id, string name) - { - return new Entity.Role(id, name) - { - RowVersion = new byte[] { 12, 13, 14 } - }; - } - - /// - /// Creates a default list of Role. - /// - /// - public static List CreateDefaultRoles() - { - return new List() - { - new Entity.Role(Guid.Parse("bbf27108-a0dc-4782-8025-7af7af711335"), "System Administrator") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Role(Guid.Parse("6ae8448d-5f0a-4607-803a-df0bc4efdc0f"), "Agency Administrator") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Role(Guid.Parse("aad8c03d-892c-4cc3-b992-5b41c4f2392c"), "Real Estate Manager") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Role(Guid.Parse("7a7b2549-ae85-4ad6-a8d3-3a5f8d4f9ca5"), "Real Estate Analyst") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Role(Guid.Parse("fbe5fc86-f69e-4610-a746-0113d29e04cd"), "Assistant Deputy Minister") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Role(Guid.Parse("c9fb2167-d675-455f-96ff-fb0c416246aa"), "Assistant Deputy Minister Assistant") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Role(Guid.Parse("6cdfeb00-6f67-4457-b46a-85bbbc97066c"), "Executive Director") { RowVersion = new byte[] { 12, 13, 14 } } - }; - } - } -} diff --git a/backend/tests/core/Entities/TaskHelper.cs b/backend/tests/core/Entities/TaskHelper.cs deleted file mode 100644 index 505b4f0b8e..0000000000 --- a/backend/tests/core/Entities/TaskHelper.cs +++ /dev/null @@ -1,83 +0,0 @@ -using Pims.Dal; -using System; -using System.Collections.Generic; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of a Task. - /// - /// - /// - /// - /// - /// - public static Entity.Task CreateTask(int id, string name, Entity.ProjectStatus status = null, bool isOptional = false) - { - return new Entity.Task(name, status, isOptional) { Id = id, RowVersion = new byte[] { 12, 13, 14 } }; - } - - /// - /// Create a new instance of a Task. - /// - /// - /// - /// - /// - public static Entity.Task CreateTask(string name, Entity.ProjectStatus status = null, bool isOptional = false) - { - return new Entity.Task(name, status, isOptional) { Id = 1, RowVersion = new byte[] { 12, 13, 14 } }; - } - - /// - /// Creates a default list of tasks. - /// - /// - /// - public static List CreateDefaultTasks(Entity.ProjectStatus status = null) - { - return new List() - { - new Entity.Task("Task 1", status) { Id = 1, RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Task("Task 2", status) { Id = 2, RowVersion = new byte[] { 12, 13, 14 } } - }; - } - - /// - /// Create a new instance of a Task. - /// - /// - /// - /// - /// - /// - /// - public static Entity.Task CreateTask(this PimsContext context, int id, string name, Entity.ProjectStatus status = null, bool isOptional = false) - { - var task = new Entity.Task(name, status, isOptional) - { - Id = id, - CreatedById = Guid.NewGuid(), - CreatedOn = DateTime.UtcNow, - UpdatedById = Guid.NewGuid(), - UpdatedOn = DateTime.UtcNow, - IsOptional = false, - RowVersion = new byte[] { 12, 13, 14 } - }; - - if (status != null) - { - context.ProjectStatus.Update(status); - } - - context.Tasks.Add(task); - return task; - } - } -} diff --git a/backend/tests/core/Entities/TierLevelHelper.cs b/backend/tests/core/Entities/TierLevelHelper.cs deleted file mode 100644 index 70a0319972..0000000000 --- a/backend/tests/core/Entities/TierLevelHelper.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.Collections.Generic; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of a TierLevel. - /// - /// - /// - /// - public static Entity.TierLevel CreateTierLevel(int id, string name) - { - return new Entity.TierLevel(id, name) { RowVersion = new byte[] { 12, 13, 14 } }; - } - - /// - /// Create a new instance of a TierLevel. - /// - /// - /// - public static Entity.TierLevel CreateTierLevel(string name) - { - return new Entity.TierLevel(1, name) { RowVersion = new byte[] { 12, 13, 14 } }; - } - - /// - /// Creates a default list of TierLevel. - /// - /// - public static List CreateDefaultTierLevels() - { - return new List() - { - new Entity.TierLevel(1, "Tier 1") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.TierLevel(2, "Tier 2") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.TierLevel(3, "Tier 3") { RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.TierLevel(4, "Tier 4") { RowVersion = new byte[] { 12, 13, 14 } }, - }; - } - } -} diff --git a/backend/tests/core/Entities/UserHelper.cs b/backend/tests/core/Entities/UserHelper.cs deleted file mode 100644 index 98f0693a07..0000000000 --- a/backend/tests/core/Entities/UserHelper.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of an AccessRequest for a default user. - /// - /// - /// - public static Entity.User CreateUser(string username) - { - return CreateUser(Guid.NewGuid(), username); - } - - /// - /// Create a new instance of an AccessRequest for a default user. - /// - /// - /// - /// - /// - /// - /// - /// - public static Entity.User CreateUser(Guid id, string username, string firstName = "given name", string lastName = "surname", Entity.Role role = null, Entity.Agency agency = null) - { - var user = new Entity.User(id, username, $"{firstName}.{lastName}@email.com", firstName, lastName) - { - DisplayName = $"{lastName}, {firstName}", - RowVersion = new byte[] { 12, 13, 14 } - }; - - user.Roles.Add(new Entity.UserRole(user, role ?? EntityHelper.CreateRole("Real Estate Manager"))); - user.Agencies.Add(new Entity.UserAgency(user, agency ?? EntityHelper.CreateAgency())); - - return user; - } - } -} diff --git a/backend/tests/core/Entities/WorkflowHelper.cs b/backend/tests/core/Entities/WorkflowHelper.cs deleted file mode 100644 index 5867a8eb0f..0000000000 --- a/backend/tests/core/Entities/WorkflowHelper.cs +++ /dev/null @@ -1,154 +0,0 @@ -using Pims.Core.Extensions; -using Pims.Dal; -using Pims.Dal.Helpers.Extensions; -using System.Collections.Generic; -using System.Linq; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// EntityHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new instance of a Workflow. - /// - /// - /// - /// - /// - /// - public static Entity.Workflow CreateWorkflow(int id, string name, string code = null, IEnumerable status = null) - { - var workflow = new Entity.Workflow(name, code ?? name) { Id = id, RowVersion = new byte[] { 12, 13, 14 } }; - workflow.Description = "test workflow"; - if (status?.Any() == true) - { - var i = 1; - status.ForEach(s => workflow.Status.Add(new Entity.WorkflowProjectStatus(workflow, s, i++))); - } - return workflow; - } - - /// - /// Creates a default list of Workflow. - /// - /// - public static List CreateDefaultWorkflows() - { - return new List() - { - new Entity.Workflow("Submit", "SUBMIT-DISPOSAL") { Id = 1, SortOrder = 1, RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Workflow("Access", "ASSESS-DISPOSAL") { Id = 2, SortOrder = 2, RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Workflow("Access Exemption", "ASSESS-EXEMPTION") { Id = 3, SortOrder = 3, RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Workflow("Access", "ASSESS-EX-DISPOSAL") { Id = 4, SortOrder = 4, RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Workflow("Enhanced Referral Program", "ERP") { Id = 5, SortOrder = 5, RowVersion = new byte[] { 12, 13, 14 } }, - new Entity.Workflow("Surplus Property List", "SPL") { Id = 6, SortOrder = 6, RowVersion = new byte[] { 12, 13, 14 } } - }; - } - - /// - /// Creates a default list of Workflow. - /// - /// - public static List CreateDefaultWorkflowsWithStatus() - { - var status = EntityHelper.CreateDefaultProjectStatus(); - var workflows = CreateDefaultWorkflows(); - - // Add project status to workflow and transitions. - var draft = workflows.First(w => w.Code == "SUBMIT-DISPOSAL"); - var assess = workflows.First(w => w.Code == "ASSESS-DISPOSAL"); - var exempt = workflows.First(w => w.Code == "ASSESS-EXEMPTION"); - var asExempt = workflows.First(w => w.Code == "ASSESS-EX-DISPOSAL"); - var erp = workflows.First(w => w.Code == "ERP"); - var spl = workflows.First(w => w.Code == "SPL"); - - // SUBMIT-DISPOSE - var start = draft.AddStatus(status.First(s => s.Code == "DR"), 0); - var select = start.AddTransition("Select Properties", draft, status.First(s => s.Code == "DR-P"), 1); - var update = select.AddTransition("Update Information", draft, status.First(s => s.Code == "DR-I"), 2); - var docs = update.AddTransition("Provide Documentation", draft, status.First(s => s.Code == "DR-D"), 3); - var approval = docs.AddTransition("Gain Approval", draft, status.First(s => s.Code == "DR-A"), 4); - var preSubmit = approval.AddTransition("Review", draft, status.First(s => s.Code == "DR-RE"), 5); - - // ASSESS-DISPOSE - var submitted = assess.AddStatus(status.First(s => s.Code == "AS-I"), 1); - preSubmit.AddTransition("Submit", submitted); - var rDocs = submitted.AddTransition("Review Documentation", assess, status.First(s => s.Code == "AS-D"), 2); - var rAppraisal = rDocs.AddTransition("Review Appraisal", assess, status.First(s => s.Code == "AS-AP"), 3); - var rFnc = rAppraisal.AddTransition("Begin First Nation Consultation", assess, status.First(s => s.Code == "AS-FNC"), 4); - rFnc.AddTransition("Deny", assess, status.First(s => s.Code == "DE"), 5); - - // ASSESS-EXEMPTION - var subExe = exempt.AddStatus(status.First(s => s.Code == "AS-EXE"), 1); - preSubmit.AddTransition("Submit with Exemption", subExe); - var rDocsExe = subExe.AddTransition("Review Documentation", exempt, status.First(s => s.Code == "AS-D"), 2); - var rApprasialExe = rDocsExe.AddTransition("Review Appraisal", exempt, status.First(s => s.Code == "AS-AP"), 3); - var rFncExe = rApprasialExe.AddTransition("Begin First Nation Consultation", exempt, status.First(s => s.Code == "AS-FNC"), 4); - var exReview = rFncExe.AddTransition("Review Exemption", exempt, status.First(s => s.Code == "AS-EXP"), 5); - exReview.AddTransition("Deny", exempt, status.First(s => s.Code == "DE"), 6); - - // ASSESS-EX-DISPOSAL - var aEx = asExempt.AddStatus(status.First(s => s.Code == "AP-EXE"), 1); - exReview.AddTransition("Approve Exemption", aEx); - aEx.AddTransition("Transfer within GRE", asExempt, status.First(s => s.Code == "T-GRE"), 6); - var aNotSpl = aEx.AddTransition("Approve not included in SPL", asExempt, status.First(s => s.Code == "AP-!SPL"), 7); - aNotSpl.AddTransition("Dispose Properties", asExempt, status.First(s => s.Code == "DIS"), 9); - aEx.AddTransition("Cancel Project", asExempt, status.First(s => s.Code == "CA"), 8); - - // ERP - var aErp = erp.AddStatus(status.First(s => s.Code == "AP-ERP"), 1); - rFnc.AddTransition("Approve for ERP", aErp); - var erpBegin = aErp.AddTransition("Begin ERP", erp, status.First(s => s.Code == "ERP-ON"), 2); - var erpOnHold = erpBegin.AddTransition("Place on Hold", erp, status.First(s => s.Code == "ERP-OH"), 3); - erpBegin.AddTransition("Transfer within GRE", erp, status.First(s => s.Code == "T-GRE"), 4); - erpOnHold.AddTransition("Transfer within GRE", erp, status.First(s => s.Code == "T-GRE"), 4); - var aErpNotSpl = erpBegin.AddTransition("Approve not included in SPL", erp, status.First(s => s.Code == "AP-!SPL"), 5); - aErpNotSpl.AddTransition("Dispose Properties", erp, status.First(s => s.Code == "DIS"), 7); - var aErpNotSplOh = erpOnHold.AddTransition("Approve not included in SPL", erp, status.First(s => s.Code == "AP-!SPL"), 5); - aErpNotSplOh.AddTransition("Dispose Properties", erp, status.First(s => s.Code == "DIS"), 7); - erpBegin.AddTransition("Cancel Project", erp, status.First(s => s.Code == "CA"), 6); - erpOnHold.AddTransition("Cancel Project", erp, status.First(s => s.Code == "CA"), 6); - - // SPL - var aSpl = spl.AddStatus(status.First(s => s.Code == "AP-SPL"), 1); - exReview.AddTransition("Approve for SPL", aSpl); - erpBegin.AddTransition("Approve for SPL", aSpl); - erpOnHold.AddTransition("Approve for SPL", aSpl); - var SplPm = aSpl.AddTransition("Begin Pre-Marketing", spl, status.First(s => s.Code == "SPL-PM"), 2); - var SplM = SplPm.AddTransition("Begin Marketing", spl, status.First(s => s.Code == "SPL-M"), 3); - var splContractInPlace = SplM.AddTransition("Contract in Place - Conditional", spl, status.First(s => s.Code == "SPL-CIP-C"), 4); - splContractInPlace.AddTransition("Dispose Properties", spl, status.First(s => s.Code == "DIS"), 5); - splContractInPlace.AddTransition("Cancel Project", spl, status.First(s => s.Code == "CA"), 6); - - return workflows; - } - - /// - /// Creates a default list of workflows and adds them to the specified 'context'. - /// - /// - /// - public static List CreateDefaultWorkflows(this PimsContext context) - { - var workflows = CreateDefaultWorkflows(); - context.Workflows.AddRange(workflows); - return workflows; - } - - /// - /// Creates a default list of workflows, project status, their relationship and tansitions and adds them to the specified 'context'. - /// - /// - /// - public static List CreateDefaultWorkflowsWithStatus(this PimsContext context) - { - var workflows = CreateDefaultWorkflowsWithStatus(); - context.Workflows.AddRange(workflows); - return workflows; - } - } -} diff --git a/backend/tests/core/Http/FakeHttpMessageHandler.cs b/backend/tests/core/Http/FakeHttpMessageHandler.cs deleted file mode 100644 index 6da353276f..0000000000 --- a/backend/tests/core/Http/FakeHttpMessageHandler.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; - -namespace Pims.Core.Test.Http -{ - /// - /// FakeHttpMessageHandler class, provides a way to create a fake HTTP message handler to mock an HTTP request. - /// - public class FakeHttpMessageHandler : DelegatingHandler - { - #region Variables - private readonly HttpResponseMessage _fakeResponse; - #endregion - - #region Constructors - /// - /// Creates a new instance of a FakeHttpMessageHandler, initializes with the response that will be returned by SendAsync(...). - /// - /// - public FakeHttpMessageHandler(HttpResponseMessage response) - { - _fakeResponse = response; - } - #endregion - - #region Methods - /// - /// Always returns the initialized response. - /// - /// - /// - /// - protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) - { - return await Task.FromResult(_fakeResponse); - } - #endregion - } -} diff --git a/backend/tests/core/HttpClientHelper.cs b/backend/tests/core/HttpClientHelper.cs deleted file mode 100644 index 5ca2691430..0000000000 --- a/backend/tests/core/HttpClientHelper.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Moq; -using Pims.Core.Test.Http; -using System.Net.Http; - -namespace Pims.Core.Test -{ - /// - /// HttpClientHelper static class, provides extension methods for the TestHelper for HttpClient objects. - /// - public static class HttpClientHelper - { - /// - /// Mock a new HttpClientFactory and configure the response. - /// - /// - /// - /// - public static IHttpClientFactory CreateHttpClientFactory(this TestHelper helper, HttpResponseMessage response) - { - var mock = new Mock(); - var fake = new FakeHttpMessageHandler(response); - var client = new HttpClient(fake); - mock.Setup(m => m.CreateClient(It.IsAny())).Returns(client); - - helper.AddSingleton(mock); - helper.AddSingleton(mock.Object); - - return mock.Object; - } - } -} diff --git a/backend/tests/core/HttpContextHelper.cs b/backend/tests/core/HttpContextHelper.cs deleted file mode 100644 index 755e85ba89..0000000000 --- a/backend/tests/core/HttpContextHelper.cs +++ /dev/null @@ -1,138 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Http.Features; -using Microsoft.IdentityModel.Tokens; -using Moq; -using System; -using System.Diagnostics.CodeAnalysis; -using System.IdentityModel.Tokens.Jwt; -using System.IO; -using System.Security.Claims; - -namespace Pims.Core.Test -{ - /// - /// HttpContextHelper static class, provides helper functions for the TestHelper when interacting with HttpContext. - /// - [ExcludeFromCodeCoverage] - public static class HttpContextHelper - { - #region Variables - private static readonly string _issuer = Guid.NewGuid().ToString(); - private static readonly SecurityKey _securityKey; - private static readonly SigningCredentials _signingCredentials; - private static readonly byte[] _key = new byte[32]; - #endregion - - #region constructors - static HttpContextHelper() - { - _securityKey = new SymmetricSecurityKey(_key) { KeyId = Guid.NewGuid().ToString() }; - _signingCredentials = new SigningCredentials(_securityKey, SecurityAlgorithms.HmacSha256); - } - #endregion - - /// - /// Provides a quick way to create a new HttpContext and initialize it with the specified properties. - /// - /// - /// - /// - public static HttpContext CreateHttpContext(this TestHelper helper, ClaimsPrincipal user, Uri uri = null) - { - var request = new Mock(); - helper.AddSingleton(request); - request.Setup(m => m.Scheme).Returns(uri?.Scheme ?? "http"); - request.Setup(m => m.Host).Returns(String.IsNullOrWhiteSpace(uri?.Host) ? new HostString("localhost") : new HostString(uri.Host)); - request.Setup(m => m.Path).Returns(String.IsNullOrWhiteSpace(uri?.AbsolutePath) ? new PathString("/test") : new PathString(uri.AbsolutePath)); - request.Setup(m => m.PathBase).Returns(new PathString("/")); - request.Setup(m => m.Body).Returns(new MemoryStream()); - request.Setup(m => m.QueryString).Returns(String.IsNullOrWhiteSpace(uri?.Query) ? new QueryString("?") : new QueryString(uri.Query)); - - var header = new Mock(); - helper.AddSingleton(header); - header.Setup(m => m["device-id"]).Returns("20317"); - header.Setup(m => m["X-RequestedWith"]).Returns("XMLHttpRequest"); - request.Setup(m => m.Headers).Returns(header.Object); - - var features = new Mock(); - helper.AddSingleton(features); - features.Setup(m => m.Get()).Returns(request.Object); - features.Setup(m => m.Get()).Returns(user); - - var context = new Mock(); - context.Setup(m => m.Features).Returns(features.Object); - context.Setup(m => m.Request).Returns(request.Object); - context.Setup(m => m.RequestServices).Returns(helper.Provider); - - var contextAccess = new Mock(); - helper.AddSingleton(contextAccess); - contextAccess.Setup(m => m.HttpContext).Returns(context.Object); - - return context.Object; - } - - /// - /// Generate a JWT access token for the specified 'identity'. - /// - /// - /// - /// - public static string GenerateAccessToken(this TestHelper helper, ClaimsIdentity identity) - { - var tokenHandler = helper.GetService(); - var token = helper.GenerateJwtToken(identity); - return tokenHandler.WriteToken(token); - } - - /// - /// Generate a JWT access token for the current user. - /// - /// - /// - public static string GenerateAccessToken(this TestHelper helper) - { - var user = helper.GetService(); - return helper.GenerateAccessToken(user.Identity as ClaimsIdentity); - } - - /// - /// Generate a JWT token for the specified 'identity'. - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public static JwtSecurityToken GenerateJwtToken(this TestHelper helper, ClaimsIdentity identity, string issuer = null, string audience = null, DateTime? notBefore = null, DateTime? expires = null, DateTime? issuedAt = null, SigningCredentials signingCredentials = null) - { - var tokenHandler = helper.GetService(); - return tokenHandler.CreateJwtSecurityToken(issuer: issuer ?? _issuer, audience: audience ?? _issuer, subject: identity, notBefore: notBefore ?? DateTime.UtcNow, expires: expires ?? DateTime.UtcNow.AddMinutes(20), issuedAt: issuedAt, signingCredentials: signingCredentials ?? _signingCredentials); - } - - /// - /// Generate a JWT token for the specified 'user'. - /// - /// - /// - /// - public static JwtSecurityToken GenerateJwtToken(this TestHelper helper, ClaimsPrincipal user) - { - return helper.GenerateJwtToken(user.Identity as ClaimsIdentity); - } - - /// - /// Generate a JWT token for the current user. - /// - /// - /// - public static JwtSecurityToken GenerateJwtToken(this TestHelper helper) - { - var user = helper.GetService(); - return helper.GenerateJwtToken(user); - } - } -} diff --git a/backend/tests/core/OptionsHelper.cs b/backend/tests/core/OptionsHelper.cs deleted file mode 100644 index d39205d3ee..0000000000 --- a/backend/tests/core/OptionsHelper.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Microsoft.Extensions.Options; -using Moq; -using Pims.Keycloak.Configuration; - -namespace Pims.Core.Test -{ - /// - /// OptionsHelper static class, provides helpers to generate default options. - /// - public static class OptionsHelper - { - /// - /// Creates default CreateDefaultKeycloakOptions options. - /// - /// - public static KeycloakOptions CreateDefaultKeycloakOptions() - { - return new KeycloakOptions() - { - Authority = "https://keycloak", - Audience = "pims", - Client = "pims", - Admin = new KeycloakAdminOptions() - { - Authority = "https://keycloak/admin", - Users = "/users" - }, - OpenIdConnect = new Pims.Core.Http.Configuration.OpenIdConnectOptions() - { - Login = "/protocol/openid-connect/auth", - Logout = "/protocol/openid-connect/logout", - Register = "/protocol/openid-connect/registrations", - Token = "/protocol/openid-connect/token", - TokenIntrospect = "/protocol/openid-connect/token/introspect", - UserInfo = "/protocol/openid-connect/userinfo" - }, - ServiceAccount = new KeycloakServiceAccountOptions() - { - Audience = "pims-service-account", - Secret = "[USE SECRETS]", - Client = "pims-service-account" - } - }; - } - - /// - /// Creates default CreateDefaultKeycloakOptions options and adds them to the helper service. - /// - /// - /// - public static IOptions CreateDefaultKeycloakOptions(this TestHelper helper) - { - var options = Options.Create(CreateDefaultKeycloakOptions()); - helper.AddSingleton(options); - return options; - } - - /// - /// Creates default CreateDefaultKeycloakOptions options and adds them to the helper service. - /// - /// - /// - public static IOptionsMonitor CreateDefaultKeycloakOptionsMonitor(this TestHelper helper) - { - var monitor = new Mock>(); - monitor.Setup(m => m.CurrentValue).Returns(CreateDefaultKeycloakOptions()); - helper.AddSingleton(monitor); - helper.AddSingleton(monitor.Object); - return monitor.Object; - } - } -} diff --git a/backend/tests/core/Pims.Core.Test.csproj b/backend/tests/core/Pims.Core.Test.csproj deleted file mode 100644 index 623befa325..0000000000 --- a/backend/tests/core/Pims.Core.Test.csproj +++ /dev/null @@ -1,33 +0,0 @@ - - - - net7.0 - false - Library - 1.0.0.0 - 1.0.0.0 - 5A83C636-741A-4795-8588-70F033E79B5A - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - diff --git a/backend/tests/core/PimsAssert.cs b/backend/tests/core/PimsAssert.cs deleted file mode 100644 index be0bc5e5cb..0000000000 --- a/backend/tests/core/PimsAssert.cs +++ /dev/null @@ -1,244 +0,0 @@ -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Routing; -using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; -using Pims.Api.Policies; -using Pims.Core.Comparers; -using Pims.Dal.Entities.Models; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Reflection; -using Xunit; - -namespace Pims.Core.Test -{ - /// - /// PimsAssert static class, provides extension methods for asserting. - /// - [ExcludeFromCodeCoverage] - public static class PimsAssert - { - /// - /// Assert that the specified 'attribute' contains the specified 'permissions'. - /// - /// - /// - public static void HasPermissions(this HasPermissionAttribute attribute, params Permissions[] permissions) - { - var attr = attribute.Arguments.First(); - if (attr is Permissions[] aperms) - Assert.Equal(permissions.Select(p => p).ToArray(), aperms); - else if (attr is Permissions aperm) - Assert.Equal(permissions.Select(p => p).ToArray(), new Permissions[] { aperm }); - else - Assert.True(false, "Invalid filter argument type"); - } - - /// - /// Assert that the route template matches the specified 'template'. - /// - /// - /// - public static void HasTemplate(this RouteAttribute attribute, string template) - { - Assert.Equal(template, attribute.Template); - } - - /// - /// Assert that the HTTP method template matches the specified 'template'. - /// - /// - /// - public static void HasTemplate(this HttpMethodAttribute attribute, string template = null) - { - if (template == null) - Assert.Null(attribute.Template); - else - Assert.Equal(template, attribute.Template); - } - - /// - /// Assert the specified 'controller' has the the authorize attribute. - /// - /// - public static void HasAuthorize(this Type controller) - { - var authorize = controller.GetCustomAttribute(); - Assert.NotNull(authorize); - } - - /// - /// Assert that the specified 'controller' has the specified 'permissions'. - /// - /// - /// - public static void HasPermissions(this Type controller, params Permissions[] permissions) - { - var attribute = controller?.GetCustomAttribute(); - Assert.NotNull(attribute); - attribute?.HasPermissions(permissions); - } - - /// - /// Assert the specified 'controller' has the specified route 'template'. - /// - /// - /// - public static void HasRoute(this Type controller, string template) - { - var routes = controller.GetCustomAttributes(); - Assert.NotEmpty(routes); - Assert.Contains(routes, r => template == null ? r.Template == null : r.Template == template); - } - - /// - /// Assert the specified 'controller' has the specified 'version'. - /// - /// - /// - public static void HasApiVersion(this Type controller, params string[] versions) - { - var attrs = controller.GetCustomAttributes(); - Assert.NotEmpty(attrs); - Assert.Contains(attrs, a => versions.All(v => a.Versions.Any(av => av.ToString() == v))); - } - - /// - /// Assert the specified 'controller' has the specified 'areaName'. - /// - /// - /// - public static void HasArea(this Type controller, string areaName) - { - var attr = controller.GetCustomAttribute(); - Assert.NotNull(attr); - Assert.Equal(attr.RouteValue, areaName); - } - - /// - /// Assert the specified 'endpoint' has the specified method 'template'. - /// - /// - /// - public static void HasMethod(this MethodInfo endpoint, HttpMethod method, string template) - { - HttpMethodAttribute attribute = method switch - { - HttpMethod.Post => endpoint.GetCustomAttribute(), - HttpMethod.Put => endpoint.GetCustomAttribute(), - HttpMethod.Delete => endpoint.GetCustomAttribute(), - HttpMethod.Get => endpoint.GetCustomAttribute(), - _ => endpoint.GetCustomAttribute() - }; - Assert.NotNull(attribute); - attribute.HasTemplate(template); - } - - /// - /// Assert the specified 'endpoint' has the specified method 'template'. - /// - /// - /// - public static void HasGet(this MethodInfo endpoint, string template = null) - { - endpoint.HasMethod(HttpMethod.Get, template); - } - - /// - /// Assert the specified 'endpoint' has the specified method 'template'. - /// - /// - /// - public static void HasPost(this MethodInfo endpoint, string template = null) - { - endpoint.HasMethod(HttpMethod.Post, template); - } - - /// - /// Assert the specified 'endpoint' has the specified method 'template'. - /// - /// - /// - public static void HasPut(this MethodInfo endpoint, string template = null) - { - endpoint.HasMethod(HttpMethod.Put, template); - } - - /// - /// Assert the specified 'endpoint' has the specified method 'template'. - /// - /// - /// - public static void HasDelete(this MethodInfo endpoint, string template = null) - { - endpoint.HasMethod(HttpMethod.Delete, template); - } - - /// - /// Assert that the specified 'endpoint' has the specified 'permissions'. - /// - /// - /// - public static void HasPermissions(this MethodInfo endpoint, params Permissions[] permissions) - { - var attribute = endpoint?.GetCustomAttribute(); - Assert.NotNull(attribute); - attribute?.HasPermissions(permissions); - } - - /// - /// Does a deep compare of the two objects public properties. - /// - /// - /// - /// - public static void DeepPropertyEqual(T expected, T actual) - { - Assert.Equal(expected, actual, new DeepPropertyCompare()); - } - - /// - /// Does a shallow compare of the two objects public properties. - /// - /// - /// - /// - public static void ShallowPropertyEqual(T expected, T actual) - { - Assert.Equal(expected, actual, new ShallowPropertyCompare()); - } - - /// - /// Check if the specified 'obj' is of the specified Paged[T] type. - /// Use this method to verify anonymous types returned from endpoints. - /// The reason anonymous types are returned is because serialization will return an array if we simply return the paged object itself. - /// - /// - /// - /// - public static Paged IsPaged(object obj) - { - var type = obj.GetType(); - var itemsProp = type.GetProperty("Items"); - if (itemsProp == null) Assert.True(false, $"The object is not of the specified type '{typeof(Paged).Name}'."); - - var items = itemsProp.GetValue(obj) as IEnumerable; - if (items == null) Assert.True(false, $"The object is not of the specified type '{typeof(Paged).Name}'."); - - var pageProp = type.GetProperty("Page"); - var page = (int)pageProp.GetValue(obj); - - var quantityProp = type.GetProperty("Quantity"); - var quantity = (int)quantityProp.GetValue(obj); - - var totalProp = type.GetProperty("Total"); - var total = (int)totalProp.GetValue(obj); - - return new Paged(items, page, quantity, total); - - } - } -} diff --git a/backend/tests/core/PrincipalHelper.cs b/backend/tests/core/PrincipalHelper.cs deleted file mode 100644 index 0c0a60926d..0000000000 --- a/backend/tests/core/PrincipalHelper.cs +++ /dev/null @@ -1,134 +0,0 @@ -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Security.Claims; - -namespace Pims.Core.Test -{ - /// - /// Principal static class, provides helper functions for principal identities. - /// - [ExcludeFromCodeCoverage] - public static class PrincipalHelper - { - /// - /// Create a ClaimsPrincipal for the specified role. - /// - /// - /// - public static ClaimsPrincipal CreateForRole(params string[] role) - { - role ??= new string[0]; - - var claims = new List - { - new Claim(ClaimTypes.NameIdentifier, Guid.NewGuid().ToString()) - }; - - foreach (var claim in role) - { - claims.Add(new Claim("client_roles", claim ?? "none")); - } - var user = new ClaimsPrincipal(new ClaimsIdentity(claims, "mock")); - - return user; - } - - /// - /// Create a ClaimsPrincipal for the specified roles. - /// Add it to the service collection in the test helper. - /// - /// - /// - /// - public static ClaimsPrincipal CreateForRole(this TestHelper helper, params string[] role) - { - var user = CreateForRole(role); - helper.AddSingleton(user); - return user; - } - - /// - /// Create a ClaimsPrincipal for the specified permissions. - /// - /// - /// - public static ClaimsPrincipal CreateForPermission(params Permissions[] permission) - { - permission ??= new Permissions[0]; - - var claims = new List - { - new Claim(ClaimTypes.NameIdentifier, Guid.NewGuid().ToString()), - new Claim(ClaimTypes.Email, "test@test.com"), - new Claim("test_username", "sresfm"), - new Claim("Id", "6C384423-C113-46C5-B23A-14680F4E7B78"), - new Claim("identity_provider", "unit_testing") - }; - - foreach (var claim in permission) - { - claims.Add(new Claim("client_roles", claim.GetName())); - claims.Add(new Claim("identity_provider", "testIDP")); - } - var user = new ClaimsPrincipal(new ClaimsIdentity(claims, "mock")); - - return user; - } - - /// - /// Create a ClaimsPrincipal for the specified permission. - /// Add it to the service collection in the test helper. - /// - /// - /// - /// - public static ClaimsPrincipal CreateForPermission(this TestHelper helper, params Permissions[] permission) - { - var user = CreateForPermission(permission); - helper.AddSingleton(user); - return user; - } - - /// - /// Add a claim to the specified 'user'. - /// This will create a new user that has the claim. - /// - /// - /// - /// - /// - public static ClaimsPrincipal AddClaim(this ClaimsPrincipal user, string type, string value) - { - var identity = new ClaimsIdentity(user.Identity); - identity.AddClaim(new Claim(type, value)); - - return new ClaimsPrincipal(identity); - } - - /// - /// Add the claim 'agencies' to the specified 'user'. - /// - /// - /// - /// - public static ClaimsPrincipal AddAgency(this ClaimsPrincipal user, params int[] agencyId) - { - var agencies = String.Join(",", agencyId); - return user.AddClaim("agencies", agencies); - } - - /// - /// Add the claim 'agencies' to the specified 'user'. - /// - /// - /// - /// - public static ClaimsPrincipal AddAgency(this ClaimsPrincipal user, IEnumerable agencyIds) - { - return user.AddClaim("agencies", String.Join(",", agencyIds)); - } - } -} diff --git a/backend/tests/core/ProjectAgencyResponseHelper.cs b/backend/tests/core/ProjectAgencyResponseHelper.cs deleted file mode 100644 index b322a6068a..0000000000 --- a/backend/tests/core/ProjectAgencyResponseHelper.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Pims.Dal; -using System; -using System.Collections.Generic; -using Entity = Pims.Dal.Entities; - -namespace Pims.Core.Test -{ - /// - /// ProjectAgencyResponseHelper static class, provides helper methods to create test entities. - /// - public static partial class EntityHelper - { - /// - /// Create a new Project Agency Response - /// - /// - /// - /// - public static Entity.ProjectAgencyResponse CreateResponse(int projectId, int agencyId) - { - return new Entity.ProjectAgencyResponse() - { - ProjectId = projectId, - AgencyId = agencyId, - Note = "NOTE", - ReceivedOn = DateTime.UtcNow, - Response = Entity.NotificationResponses.Watch, - }; - } - - /// - /// Creates a default list of responses. - /// - /// - /// - /// - public static List CreateDefaultResponses(int projectId, int agencyId) - { - return new List() - { - CreateResponse(projectId, agencyId) - }; - } - - /// - /// Create a new instance of a ProjectAgencyResponse. - /// - /// - /// - /// - /// - public static Entity.ProjectAgencyResponse CreateResponse(this PimsContext context, int projectId, int agencyId) - { - var response = new Entity.ProjectAgencyResponse() - { - ProjectId = projectId, - AgencyId = agencyId, - Note = "NOTE", - ReceivedOn = DateTime.UtcNow, - Response = Entity.NotificationResponses.Subscribe, - CreatedById = Guid.NewGuid(), - CreatedOn = DateTime.UtcNow, - UpdatedById = Guid.NewGuid(), - UpdatedOn = DateTime.UtcNow, - RowVersion = new byte[] { 12, 13, 14 } - }; - - context.ProjectAgencyResponses.Add(response); - return response; - } - } -} diff --git a/backend/tests/core/ServiceHelper.cs b/backend/tests/core/ServiceHelper.cs deleted file mode 100644 index 03c6c6ac5f..0000000000 --- a/backend/tests/core/ServiceHelper.cs +++ /dev/null @@ -1,187 +0,0 @@ -using Pims.Core.Helpers; -using Pims.Dal; -using Pims.Dal.Security; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Security.Claims; - -namespace Pims.Core.Test -{ - /// - /// ServiceHelper static class, provides helper functions for TestHelper when interacting with services. - /// - [ExcludeFromCodeCoverage] - public static class ServiceHelper - { - #region Methods - /// - /// Creates an instance of a service of the specified 'T' type and initializes it with a user with the specified 'permission'. - /// Will use any 'args' passed in instead of generating defaults. - /// Once you create a service you can no longer add to the services collection. - /// - /// - /// - /// - /// - /// - public static T CreateService(this TestHelper helper, Permissions permission, params object[] args) where T : IService - { - var user = PrincipalHelper.CreateForPermission(permission); - return helper.CreateService(user, args); - } - - /// - /// Creates an instance of a service of the specified 'T' type and initializes it with a user with the specified 'permission'. - /// Will use any 'args' passed in instead of generating defaults. - /// Once you create a service you can no longer add to the services collection. - /// - /// - /// - /// - /// - /// - /// - public static T CreateService(this TestHelper helper, string dbName, Permissions permission, params object[] args) where T : IService - { - var user = PrincipalHelper.CreateForPermission(permission); - return helper.CreateService(dbName, user, args); - } - - /// - /// Creates an instance of a service of the specified 'T' type and initializes it with the specified 'user'. - /// If the 'PimsContext' already has been added as a service it will use it, otherwise it will create a new random context. - /// Will use any 'args' passed in instead of generating defaults. - /// Once you create a service you can no longer add to the services collection. - /// - /// - /// - /// - /// - /// - public static T CreateService(this TestHelper helper, ClaimsPrincipal user, params object[] args) where T : IService - { - if (!helper.Services.Any(s => s.ServiceType == typeof(PimsContext))) - { - var dbName = StringHelper.Generate(10); - return helper.CreateService(helper.CreatePimsContext(dbName, user, false), args); - } - - return helper.CreateService(args); - } - - /// - /// Creates an instance of a service of the specified 'T' type and initializes it with the specified 'user'. - /// Will use any 'args' passed in instead of generating defaults. - /// Once you create a service you can no longer add to the services collection. - /// - /// - /// - /// - /// - /// - /// - public static T CreateService(this TestHelper helper, string dbName, ClaimsPrincipal user, params object[] args) where T : IService - { - return helper.CreateService(helper.CreatePimsContext(dbName, user, false), args); - } - - /// - /// Creates an instance of a service of the specified 'T' type and initializes it with the specified 'user'. - /// Will use any 'args' passed in instead of generating defaults. - /// Once you create a service you can no longer add to the services collection. - /// - /// - /// - /// - /// - /// - public static T CreateService(this TestHelper helper, PimsContext context, params object[] args) where T : IService - { - helper.MockConstructorArguments(args); - helper.AddSingleton(context); - - helper.BuildServiceProvider(); - var service = helper.CreateInstance(); - - return service; - } - - /// - /// Creates an instance of a service of the specified 'T' type and initializes it with the specified arguments. - /// Will use any 'args' passed in instead of generating defaults. - /// Once you create a service you can no longer add to the services collection. - /// - /// - /// - /// - /// - public static T CreateService(this TestHelper helper, params object[] args) where T : IService - { - helper.MockConstructorArguments(args); - - helper.BuildServiceProvider(); - var service = helper.CreateInstance(); - - return service; - } - - /// - /// Creates an instance of a service of the specified 'T' type and initializes it with the specified arguments. - /// Will use any 'args' passed in instead of generating defaults. - /// Once you create a service you can no longer add to the services collection. - /// - /// - /// - /// - /// - public static T Create(this TestHelper helper, params object[] args) where T : class - { - helper.MockConstructorArguments(args); - helper.BuildServiceProvider(); - var service = helper.CreateInstance(); - - return service; - } - - /// - /// Creates an instance of an object of the specified 'T' type and initializes it with the specified arguments. - /// Will use any 'args' passed in instead of generating defaults. - /// This will add the new instance to the ServiceCollection, so that you can continue to configure your ServiceCollection before building it. - /// - /// - /// - /// - /// - public static T Add(this TestHelper helper, params object[] args) where T : class - { - var types = helper.MockConstructorArguments(args); - var con = typeof(T).GetConstructor(types.Select(t => t.Key).ToArray()); - var values = types.Select(t => t.Value).ToArray(); - var result = (T)con.Invoke(values); - helper.AddSingleton(result); - return result; - } - - /// - /// Creates an instance of an object of the specified 'T' type and initializes it with the specified arguments. - /// Will use any 'args' passed in instead of generating defaults. - /// This will add the new instance to the ServiceCollection, so that you can continue to configure your ServiceCollection before building it. - /// - /// - /// - /// - /// - /// - public static TService Add(this TestHelper helper, params object[] args) - where TService : class - where TImplementation : class, TService - { - var types = helper.MockConstructorArguments(args); - var con = typeof(TImplementation).GetConstructor(types.Select(t => t.Key).ToArray()); - var result = (TImplementation)con.Invoke(types.Select(t => t.Value).ToArray()); - helper.AddSingleton(result); - return result; - } - #endregion - } -} diff --git a/backend/tests/core/TestHelper.cs b/backend/tests/core/TestHelper.cs deleted file mode 100644 index 914257a0dd..0000000000 --- a/backend/tests/core/TestHelper.cs +++ /dev/null @@ -1,186 +0,0 @@ -using Mapster; -using MapsterMapper; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; -using Moq; -using Pims.Dal.Configuration.Generators; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Reflection; -using System.Text.Json; - -namespace Pims.Core.Test -{ - /// - /// TestHelper class, provides a way to simplify the Arrange part of a test. - /// - [ExcludeFromCodeCoverage] - public class TestHelper - { - #region Properties - /// - /// get - The service provider. - /// - /// - public IServiceProvider Provider { get; private set; } - - /// - /// get - The services collection. - /// - /// - public IServiceCollection Services { get; } = new ServiceCollection(); - #endregion - - #region Constructors - /// - /// Creates a new instance of a TestHelper class. - /// - public TestHelper() - { - var config = new TypeAdapterConfig(); - var assemblies = AppDomain.CurrentDomain.GetAssemblies().Where(a => a.FullName.StartsWith("Pims")); - - // TODO: Use Singleton pattern to speed up initialization of this. - var serializerOptions = Options.Create(new JsonSerializerOptions()); - var registers = assemblies.Select(assembly => assembly.GetTypes() - .Where(x => typeof(IRegister).GetTypeInfo().IsAssignableFrom(x.GetTypeInfo()) && x.GetTypeInfo().IsClass && !x.GetTypeInfo().IsAbstract)) - .SelectMany(registerTypes => - registerTypes.Select(registerType => - registerType.GetConstructor(Type.EmptyTypes) == null - ? (IRegister)Activator.CreateInstance(registerType, new[] { serializerOptions }) - : (IRegister)Activator.CreateInstance(registerType))).ToList(); - - config.Apply(registers); - - config.Default.IgnoreNonMapped(true); - config.Default.IgnoreNullValues(true); - config.AllowImplicitDestinationInheritance = true; - config.AllowImplicitSourceInheritance = true; - config.Default.UseDestinationValue(member => - member.SetterModifier == AccessModifier.None && - member.Type.IsGenericType && - member.Type.GetGenericTypeDefinition() == typeof(ICollection<>)); - - Services.AddSingleton(); - Services.AddSingleton(config); - Services.AddSingleton(); - } - #endregion - - #region Methods - /// - /// Build the required services for the provider. - /// Once this is called you can no longer add additional services to the provider. - /// - /// - public IServiceProvider BuildServiceProvider() - { - if (Provider == null) - { - Provider = Services.BuildServiceProvider(); - } - return Provider; - } - - /// - /// Add a singleton service to the provider, and include the mock. - /// - /// - public Mock AddSingletonWithMock() where T : class - { - if (Provider != null) throw new InvalidOperationException("Cannot add to the service collection once the provider has been built."); - var mock = new Mock(); - Services.AddSingleton(mock.Object).AddSingleton(mock); - return mock; - } - - /// - /// Add a singleton service to the provider. - /// - /// - public IServiceCollection AddSingleton() where T : class - { - if (Provider != null) throw new InvalidOperationException("Cannot add to the service collection once the provider has been built."); - return Services.AddSingleton(); - } - - /// - /// Add a singleton service to the provider. - /// - /// - /// - public IServiceCollection AddSingleton(T item) where T : class - { - if (Provider != null) throw new InvalidOperationException("Cannot add to the service collection once the provider has been built."); - return Services.AddSingleton(item); - } - - /// - /// Add a singleton service to the provider. - /// - /// - /// - /// - public IServiceCollection AddSingleton(TImplementation item) - where TService : class - where TImplementation : class, TService - { - if (Provider != null) throw new InvalidOperationException("Cannot add to the service collection once the provider has been built."); - return Services.AddSingleton((p) => item); - } - - /// - /// Add a singleton service to the provider. - /// - /// - /// - /// - public IServiceCollection AddSingleton(Type type, object item) - { - if (Provider != null) throw new InvalidOperationException("Cannot add to the service collection once the provider has been built."); - return Services.AddSingleton(type, item); - } - - /// - /// Get the service for the specified 'T' type. - /// - /// - /// - public T GetService() - { - return this.BuildServiceProvider().GetService(); - } - - /// - /// Get the mocked service for the specified 'T' type. - /// - /// - /// - public Mock GetMock() where T : class - { - return this.BuildServiceProvider().GetService>(); - } - - /// - /// Get the mapper from the service collection. - /// - /// - public IMapper GetMapper() - { - return this.BuildServiceProvider().GetService(); - } - - /// - /// Creates an instance of the specified type 'T', using dependency injection for any constructor arguments. - /// - /// - /// - public T CreateInstance() - { - return (T)ActivatorUtilities.CreateInstance(Provider, typeof(T)); - } - #endregion - } -} diff --git a/backend/tests/core/TestHelperExtensions.cs b/backend/tests/core/TestHelperExtensions.cs deleted file mode 100644 index 73372a26a1..0000000000 --- a/backend/tests/core/TestHelperExtensions.cs +++ /dev/null @@ -1,74 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Moq; -using Pims.Core.Extensions; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; - -namespace Pims.Core.Test -{ - /// - /// TestHelperExtensions static class, provides extension methods for TestHelper. - /// - [ExcludeFromCodeCoverage] - public static class TestHelperExtensions - { - #region Methods - - /// - /// Mock all constructor arguments of the specified type of 'T'. - /// Will only work with a type that has a single constructor. - /// Will use any 'args' passed in instead of generating defaults. - /// - /// - /// - /// - /// - public static KeyValuePair[] MockConstructorArguments(this TestHelper helper, params object[] args) - { - var type = typeof(T); - var constructors = type.GetCachedConstructors(); - var ci = constructors.SingleOrDefault() ?? throw new ArgumentException($"The type '{type.Name}' must only have one constructor."); - - var tempProvider = helper.Services.BuildServiceProvider(); - - var types = new List>(); - var gmock = typeof(Mock<>); - var cargs = ci.GetParameters(); - foreach (var carg in cargs) - { - var exists = tempProvider.GetService(carg.ParameterType);// helper.Services.FirstOrDefault(sd => sd.ServiceType == carg.ParameterType); - if (exists != null) - { - types.Add(new KeyValuePair(carg.ParameterType, exists)); - continue; - } - - // If an 'args' type matches, use it for the mock. - var arg = args.FirstOrDefault(a => a.GetType() == carg.ParameterType); - if (arg == null) arg = args.FirstOrDefault(a => carg.ParameterType.IsAssignableFrom(a.GetType())); - if (arg != null) - { - // Add the supplied argument to services. - helper.AddSingleton(carg.ParameterType, arg); - types.Add(new KeyValuePair(carg.ParameterType, arg)); - continue; - } - - var gmake = gmock.MakeGenericType(carg.ParameterType); - var mockObjectProp = gmock.GetCachedProperties().FirstOrDefault(p => p.Name == nameof(Mock.Object) && !p.PropertyType.IsGenericParameter) ?? throw new InvalidOperationException($"The mocked type '{type.Name}' was unable to determine the correct 'Object' property."); - - // Create a Mock and add it and the Object to services. - var mock = Activator.CreateInstance(gmake); - var result = mockObjectProp.GetValue(mock); - helper.AddSingleton(gmake, mock); - helper.AddSingleton(carg.ParameterType, result); - types.Add(new KeyValuePair(carg.ParameterType, result)); - } - - return types.ToArray(); - } - #endregion - } -} diff --git a/backend/tests/unit/api/Controllers/Admin/AccessRequestControllerTest.cs b/backend/tests/unit/api/Controllers/Admin/AccessRequestControllerTest.cs deleted file mode 100644 index 92876f9dbb..0000000000 --- a/backend/tests/unit/api/Controllers/Admin/AccessRequestControllerTest.cs +++ /dev/null @@ -1,112 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Areas.Admin.Controllers; -using Pims.Api.Models; -using Pims.Core.Comparers; -using Pims.Core.Test; -using Pims.Dal.Entities.Models; -using Pims.Dal.Security; -using Pims.Dal.Services.Admin; -using Xunit; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.User; - -namespace PimsApi.Test.Admin.Controllers -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "admin")] - [Trait("group", "accessRequest")] - public class AccessRequestControllerTest - { - #region Constructors - public AccessRequestControllerTest() - { - } - #endregion - - #region Tests - [Fact] - public void GetAccessRequests_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.AdminUsers); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var accessRequest1 = EntityHelper.CreateAccessRequest(1); - var accessRequest2 = EntityHelper.CreateAccessRequest(2); - var accessRequests = new[] { accessRequest1, accessRequest2 }; - var paged = new Entity.Models.Paged(accessRequests); - - service.Setup(m => m.User.GetAccessRequests(It.IsAny())).Returns(paged); - - // Act - var result = controller.GetPage(1, 10, null, null, null, null, Entity.AccessRequestStatus.OnHold); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType>(actionResult.Value); - Assert.Equal(mapper.Map(accessRequests), actualResult.Items, new DeepPropertyCompare()); - service.Verify(m => m.User.GetAccessRequests(It.IsAny()), Times.Once()); - } - - [Fact] - public void GetAccessRequests_PageMin_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.AdminUsers); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var accessRequest1 = EntityHelper.CreateAccessRequest(1); - var accessRequest2 = EntityHelper.CreateAccessRequest(2); - var accessRequests = new[] { accessRequest1, accessRequest2 }; - var paged = new Entity.Models.Paged(accessRequests); - service.Setup(m => m.User.GetAccessRequests(It.IsAny())).Returns(paged); - - // Act - var result = controller.GetPage(-1, -10); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType>(actionResult.Value); - Assert.Equal(mapper.Map(accessRequests), actualResult.Items, - new DeepPropertyCompare()); - service.Verify(m => m.User.GetAccessRequests(It.IsAny()), Times.Once()); - } - - [Fact] - public void GetAccessRequests_PageMax_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.AdminUsers); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var accessRequest1 = EntityHelper.CreateAccessRequest(1); - var accessRequest2 = EntityHelper.CreateAccessRequest(2); - var accessRequests = new[] { accessRequest1, accessRequest2 }; - var paged = new Entity.Models.Paged(accessRequests); - service.Setup(m => m.User.GetAccessRequests(It.IsAny())).Returns(paged); - - // Act - var result = controller.GetPage(2, 100); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType>(actionResult.Value); - Assert.Equal(mapper.Map(accessRequests), actualResult.Items, new DeepPropertyCompare()); - service.Verify(m => m.User.GetAccessRequests(It.IsAny()), Times.Once()); - } - #endregion - } -} - diff --git a/backend/tests/unit/api/Controllers/Admin/RoleControllerTest.cs b/backend/tests/unit/api/Controllers/Admin/RoleControllerTest.cs deleted file mode 100644 index cd6f13af81..0000000000 --- a/backend/tests/unit/api/Controllers/Admin/RoleControllerTest.cs +++ /dev/null @@ -1,185 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Areas.Admin.Controllers; -using Pims.Core.Comparers; -using Pims.Core.Test; -using Pims.Dal.Security; -using Pims.Dal.Services.Admin; -using System; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.Role; - -namespace PimsApi.Test.Admin.Controllers -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "admin")] - [Trait("group", "role")] - [ExcludeFromCodeCoverage] - public class RoleControllerTest - { - #region Constructors - public RoleControllerTest() - { - } - #endregion - - #region Tests - #region GetRoles - [Fact] - public void GetRoles_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.AdminRoles); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var roles = new Entity.Role[] { EntityHelper.CreateRole("role1"), EntityHelper.CreateRole("role2") }; - var paged = new Entity.Models.Paged(roles); - service.Setup(m => m.Role.Get(It.IsAny(), It.IsAny(), It.IsAny())).Returns(paged); - - // Act - var result = controller.GetRoles(1, 10); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType>(actionResult.Value); - Assert.Equal(mapper.Map(roles), actualResult.Items, new DeepPropertyCompare()); - service.Verify(m => m.Role.Get(1, 10, null), Times.Once()); - } - - [Fact] - public void GetRoles_Filtered_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.AdminRoles); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var roles = new Entity.Role[] { EntityHelper.CreateRole("role1"), EntityHelper.CreateRole("role2") }; - var paged = new Entity.Models.Paged(roles); - service.Setup(m => m.Role.Get(It.IsAny(), It.IsAny(), It.IsAny())).Returns(paged); - - // Act - var result = controller.GetRoles(1, 10, "test"); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType>(actionResult.Value); - Assert.Equal(mapper.Map(roles), actualResult.Items, new DeepPropertyCompare()); - service.Verify(m => m.Role.Get(1, 10, "test"), Times.Once()); - } - #endregion - - #region GetRole - [Fact] - public void GetRole() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.AdminRoles); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var role = EntityHelper.CreateRole("role1"); - service.Setup(m => m.Role.Get(It.IsAny())).Returns(role); - - // Act - var result = controller.GetRole(role.Id); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(mapper.Map(role), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.Role.Get(role.Id), Times.Once()); - } - #endregion - - #region AddRole - [Fact] - public void AddRole() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.AdminRoles); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var role = EntityHelper.CreateRole("role1"); - service.Setup(m => m.Role.Add(It.IsAny())); - var model = mapper.Map(role); - - // Act - var result = controller.AddRole(model); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Equal(201, actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(mapper.Map(role), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.Role.Add(It.IsAny()), Times.Once()); - } - #endregion - - #region UpdateRole - [Fact] - public void UpdateRole() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.AdminRoles); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var role = EntityHelper.CreateRole("role1"); - service.Setup(m => m.Role.Update(It.IsAny())); - var model = mapper.Map(role); - - // Act - var result = controller.UpdateRole(role.Id, model); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(mapper.Map(role), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.Role.Update(It.IsAny()), Times.Once()); - } - #endregion - - #region DeleteRole - [Fact] - public void DeleteRole() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.AdminRoles); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var role = EntityHelper.CreateRole("role1"); - service.Setup(m => m.Role.Remove(It.IsAny())); - var model = mapper.Map(role); - - // Act - var result = controller.DeleteRole(role.Id, model); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(mapper.Map(role), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.Role.Remove(It.IsAny()), Times.Once()); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/api/Controllers/Admin/UserControllerTest.cs b/backend/tests/unit/api/Controllers/Admin/UserControllerTest.cs deleted file mode 100644 index 78eccc6166..0000000000 --- a/backend/tests/unit/api/Controllers/Admin/UserControllerTest.cs +++ /dev/null @@ -1,239 +0,0 @@ -using FluentAssertions; -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Areas.Admin.Controllers; -using Pims.Api.Areas.Admin.Models.GoldUser; -using Pims.Core.Comparers; -using Pims.Core.Test; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using Pims.Dal.Services.Admin; -using System; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Xunit; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Admin.Models.User; - -namespace PimsApi.Test.Admin.Controllers -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "admin")] - [Trait("group", "user")] - [ExcludeFromCodeCoverage] - public class UserControllerTest - { - #region Constructors - public UserControllerTest() - { - } - #endregion - - #region Tests - #region GetUsers - [Fact] - public void GetUsers_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.AdminUsers); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var users = new Entity.User[] { EntityHelper.CreateUser("user1"), EntityHelper.CreateUser("user2") }; - var paged = new Entity.Models.Paged(users); - service.Setup(m => m.User.Get(It.IsAny())).Returns(paged); - - // Act - var result = controller.GetUsers(); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType>(actionResult.Value); - Assert.Equal(mapper.Map(users), actualResult.Items, new DeepPropertyCompare()); - service.Verify(m => m.User.Get(It.IsAny()), Times.Once()); - } - - [Fact] - public void GetUsers_Filtered_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.AdminUsers); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var users = new Entity.User[] { EntityHelper.CreateUser("user1"), EntityHelper.CreateUser("user2") }; - var paged = new Entity.Models.Paged(users); - var filter = new Entity.Models.UserFilter(1, 1, "test", "test", - "test", "test", "test", "test", false, "test", "test", null); - service.Setup(m => m.User.Get(It.IsAny())).Returns(paged); - - // Act - var result = controller.GetUsers(filter); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType>(actionResult.Value); - Assert.Equal(mapper.Map(users), actualResult.Items, new DeepPropertyCompare()); - service.Verify(m => m.User.Get(It.IsAny()), Times.Once()); - } - #endregion - - #region GetMyUsers - [Fact] - public void GetMyUsers_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.AdminUsers); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var users = new Entity.User[] { EntityHelper.CreateUser("user1"), EntityHelper.CreateUser("user2") }; - var paged = new Entity.Models.Paged(users); - var filter = new Entity.Models.UserFilter(1, 1, "test", "test", - "test", "test", "test", "test", false, "test", "test", null); - service.Setup(m => m.User.Get(It.IsAny())).Returns(paged); - - // Act - var result = controller.GetMyUsers(filter); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType>(actionResult.Value); - Assert.Equal(mapper.Map(users), actualResult.Items, new DeepPropertyCompare()); - service.Verify(m => m.User.Get(It.IsAny()), Times.Once()); - } - #endregion - - #region GetUser - [Fact(Skip = "keycloak changes how roles are retrieved - TODO fix sometime in the future")] - public void GetUser() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.AdminUsers); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var user = EntityHelper.CreateUser("user1") as Pims.Dal.Entities.GoldUser; - service.Setup(m => m.User.Get(It.IsAny())).Returns(user); - - // Act - var result = controller.GetUser(user.Id); - - // Assert - var actionResult = Assert.IsType(result); - //Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - //Assert.Equal(mapper.Map(user), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.User.Get(user.Id), Times.Once()); - } - #endregion - - #region AddUser - [Fact] - public void AddUser() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.AdminUsers); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var user = EntityHelper.CreateUser("user1"); - service.Setup(m => m.User.Add(It.IsAny())).Callback(u => u.Agencies.First().Agency = user.Agencies.First().Agency); - var model = mapper.Map(user); - - // Act - var result = controller.AddUser(model); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Equal(201, actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - actualResult.DisplayName.Should().Be(user.DisplayName); - actualResult.Email.Should().Be(user.Email); - actualResult.EmailVerified.Should().Be(user.EmailVerified); - actualResult.FirstName.Should().Be(user.FirstName); - actualResult.LastName.Should().Be(user.LastName); - actualResult.MiddleName.Should().Be(user.MiddleName); - actualResult.Note.Should().Be(user.Note); - actualResult.Position.Should().Be(user.Position); - actualResult.RowVersion.Should().Be(user.RowVersion.ConvertRowVersion()); - actualResult.UpdatedOn.Should().Be(user.UpdatedOn); - actualResult.Username.Should().Be(user.Username); - service.Verify(m => m.User.Add(It.IsAny()), Times.Once()); - } - #endregion - - #region UpdateUser - [Fact] - public void UpdateUser() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.AdminUsers); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var user = EntityHelper.CreateUser("user1"); - service.Setup(m => m.User.Update(It.IsAny())); - var model = mapper.Map(user); - - // Act - var result = controller.UpdateUser(user.Id, model); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - actualResult.DisplayName.Should().Be(user.DisplayName); - actualResult.Email.Should().Be(user.Email); - actualResult.EmailVerified.Should().Be(user.EmailVerified); - actualResult.FirstName.Should().Be(user.FirstName); - actualResult.LastName.Should().Be(user.LastName); - actualResult.MiddleName.Should().Be(user.MiddleName); - actualResult.Note.Should().Be(user.Note); - actualResult.Position.Should().Be(user.Position); - actualResult.RowVersion.Should().Be(user.RowVersion.ConvertRowVersion()); - actualResult.UpdatedOn.Should().Be(user.UpdatedOn); - actualResult.Username.Should().Be(user.Username); - service.Verify(m => m.User.Update(It.IsAny()), Times.Once()); - } - #endregion - - #region DeleteUser - [Fact] - public void DeleteUser() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.AdminUsers); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var user = EntityHelper.CreateUser("user1"); - service.Setup(m => m.User.Remove(It.IsAny())); - var model = mapper.Map(user); - - // Act - var result = controller.DeleteUser(user.Id, model); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(mapper.Map(user), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.User.Remove(It.IsAny()), Times.Once()); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/api/Controllers/BuildingControllerTest.cs b/backend/tests/unit/api/Controllers/BuildingControllerTest.cs deleted file mode 100644 index 6965b1281c..0000000000 --- a/backend/tests/unit/api/Controllers/BuildingControllerTest.cs +++ /dev/null @@ -1,222 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Areas.Property.Controllers; -using Pims.Core.Comparers; -using Pims.Core.Test; -using Pims.Dal; -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Property.Models.Building; - -namespace Pims.Api.Test.Controllers -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("group", "building")] - [ExcludeFromCodeCoverage] - public class BuildingControllerTest - { - #region Variables - public static IEnumerable BuildingFilters = new List() - { - new [] { new BuildingFilter(50, 25, 50, 20) }, - new [] { new BuildingFilter(0, 25, 50, 25) }, - new [] { new BuildingFilter() { Agencies = new int[] { 3 } } }, - new [] { new BuildingFilter() { PredominateUseId = 2 } }, - new [] { new BuildingFilter() { ConstructionTypeId = 3 } }, - new [] { new BuildingFilter() { Tenancy = "test" } }, - new [] { new BuildingFilter() { FloorCount = 1 } }, - new [] { new BuildingFilter() { MinRentableArea = 1 } }, - new [] { new BuildingFilter() { MaxRentableArea = 1 } } - }; - - public static IEnumerable QueryFilters = new List() - { - new [] { new Uri("http://host/api/buildings?Agencies=1,2") }, - new [] { new Uri("http://host/api/buildings?StatusId=2") }, - new [] { new Uri("http://host/api/buildings?ClassificationId=1") }, - new [] { new Uri("http://host/api/buildings?Address=Address") }, - new [] { new Uri("http://host/api/buildings?ProjectNumber=ProjectNumber") } - }; - #endregion - - #region Constructors - public BuildingControllerTest() - { - } - #endregion - - #region Tests - #region GetBuilding - [Fact] - public void GetBuilding_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var expectedTestBuilding = new Entity.Building(); - service.Setup(m => m.Building.Get(It.IsAny())).Returns(expectedTestBuilding); - int expectedBuildingId = 1; - - // Act - var result = controller.GetBuilding(expectedBuildingId); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(mapper.Map(expectedTestBuilding), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.Building.Get(expectedBuildingId), Times.Once()); - } - #endregion - - #region AddBuilding - [Fact] - public void AddBuilding_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyAdd); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - var expectedTestBuilding = EntityHelper.CreateBuilding(parcel, 1, "1234", "name", 50, 50); - var user = EntityHelper.CreateUser("Tester"); - expectedTestBuilding.UpdatedBy = user; - expectedTestBuilding.CreatedBy = user; - - // Mocking the .Add method. If passed any type of Building, returns that building. - service.Setup(m => m.Building.Add(It.IsAny())).Returns((Building building) => building); - - - // Act - var building = mapper.Map(expectedTestBuilding); - var result = controller.AddBuilding(building); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(building.Name, actualResult.Name); - Assert.Equal(building.Id, actualResult.Id); - Assert.Equal(building.ProjectNumbers, actualResult.ProjectNumbers, new DeepPropertyCompare()); - Assert.Equal(building.Latitude, actualResult.Latitude); - Assert.Equal(building.Longitude, actualResult.Longitude); - Assert.Null(actualResult.Agency); - } - #endregion - - #region UpdateBuilding - [Fact] - public void UpdateBuilding_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyEdit); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - var expectedTestBuilding = EntityHelper.CreateBuilding(parcel, 1, "1", "name", 50, 50); - - // Mocking the .Update method. If passed any type of Building, returns that building. - service.Setup(m => m.Building.Update(It.IsAny())).Returns((Building building) => building); - - // Act - var building = mapper.Map(expectedTestBuilding); - - var result = controller.UpdateBuilding(1, building); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(building.Name, actualResult.Name); - Assert.Equal(building.Id, actualResult.Id); - Assert.Equal(building.ProjectNumbers, actualResult.ProjectNumbers, new DeepPropertyCompare()); - Assert.Equal(building.Latitude, actualResult.Latitude); - Assert.Equal(building.Longitude, actualResult.Longitude); - } - #endregion - - #region UpdateBuildingFinancials - [Fact] - public void UpdateBuildingFinancials_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyEdit); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - var expectedTestBuilding = EntityHelper.CreateBuilding(parcel, 1, "1", "name", 50, 50); - expectedTestBuilding.ClassificationId = 1; - - // Mocking the .UpdateFinancials method. If passed any type of Building, returns that building. - service.Setup(m => m.Building.UpdateFinancials(It.IsAny())).Returns((Building building) => building); - - // Act - var building = mapper.Map(expectedTestBuilding); - - var result = controller.UpdateBuildingFinancials(1, building); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(building.Name, actualResult.Name); - Assert.Equal(building.Id, actualResult.Id); - Assert.Equal(building.ProjectNumbers, actualResult.ProjectNumbers, new DeepPropertyCompare()); - Assert.Equal(building.Latitude, actualResult.Latitude); - Assert.Equal(building.Longitude, actualResult.Longitude); - Assert.Equal(building.ClassificationId, actualResult.ClassificationId); - } - #endregion - - #region DeleteBuilding - [Fact] - public void DeleteBuilding_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectDelete); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - var expectedTestBuilding = EntityHelper.CreateBuilding(parcel, 1, "1", "name", 50, 50); - - // Mocking the .Remove method. If passed any type of Building, returns that building. - service.Setup(m => m.Building.Remove(It.IsAny())); - - // Act - var building = mapper.Map(expectedTestBuilding); - - var result = controller.DeleteBuilding(1, building); - - // Assert - // Deletion just returns the original model. - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(building.Name, actualResult.Name); - Assert.Equal(building.Id, actualResult.Id); - Assert.Equal(building.ProjectNumbers, actualResult.ProjectNumbers, new DeepPropertyCompare()); - Assert.Equal(building.Latitude, actualResult.Latitude); - Assert.Equal(building.Longitude, actualResult.Longitude); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/api/Controllers/Keycloak/RoleControllerTest.cs b/backend/tests/unit/api/Controllers/Keycloak/RoleControllerTest.cs deleted file mode 100644 index 55de1b70ad..0000000000 --- a/backend/tests/unit/api/Controllers/Keycloak/RoleControllerTest.cs +++ /dev/null @@ -1,142 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Areas.Keycloak.Controllers; -using Pims.Core.Comparers; -using Pims.Core.Test; -using Pims.Dal.Keycloak; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Threading.Tasks; -using Xunit; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Keycloak.Models.Role; - -namespace PimsApi.Test.Keycloak.Controllers -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "keycloak")] - [Trait("group", "role")] - [ExcludeFromCodeCoverage] - public class RoleControllerTest - { - #region Variables - #endregion - - #region Constructors - public RoleControllerTest() - { - } - #endregion - - #region Tests - #region SyncRolesAsync - [Fact] - public async void SyncRolesAsync_Success() - { - // Arrange - var user = PrincipalHelper.CreateForRole("admin-users"); - var helper = new TestHelper(); - var controller = helper.CreateController(user); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var erole = new Entity.Role(Guid.NewGuid(), "test"); - var eroles = new[] { erole }; - service.Setup(m => m.SyncRolesAsync()).Returns(Task.FromResult((IEnumerable)eroles)); - - // Act - var result = await controller.SyncRolesAsync(); - - // Assert - var actionResult = Assert.IsType(result); - var data = Assert.IsType(actionResult.Value); - Assert.Equal(mapper.Map(eroles), data, new DeepPropertyCompare()); - service.Verify(m => m.SyncRolesAsync(), Times.Once()); - } - #endregion - - #region GetRolesAsync - [Fact] - public async void GetRolesAsync_Success() - { - // Arrange - var user = PrincipalHelper.CreateForRole("admin-users"); - var helper = new TestHelper(); - var controller = helper.CreateController(user); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var erole = new Entity.Role(Guid.NewGuid(), "test"); - var eroles = new[] { erole }; - service.Setup(m => m.GetRolesAsync(It.IsAny(), It.IsAny(), It.IsAny())).Returns(Task.FromResult((IEnumerable)eroles)); - - // Act - var result = await controller.GetRolesAsync(1, 10); - - // Assert - var actionResult = Assert.IsType(result); - var data = Assert.IsType(actionResult.Value); - Assert.Equal(mapper.Map(eroles), data, new DeepPropertyCompare()); - service.Verify(m => m.GetRolesAsync(1, 10, It.IsAny()), Times.Once()); - } - #endregion - - #region GetRoleAsync - [Fact] - public async void GetRoleAsync_Success() - { - // Arrange - var user = PrincipalHelper.CreateForRole("admin-users"); - var helper = new TestHelper(); - var controller = helper.CreateController(user); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var erole = new Entity.Role(Guid.NewGuid(), "test"); - service.Setup(m => m.GetRoleAsync(It.IsAny())).Returns(Task.FromResult(erole)); - - // Act - var result = await controller.GetRoleAsync(erole.Id); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(mapper.Map(erole), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.GetRoleAsync(It.IsAny()), Times.Once()); - } - #endregion - - #region UpdateRoleAsync - [Fact] - public async void UpdateRoleAsync_Success() - { - // Arrange - var user = PrincipalHelper.CreateForRole("admin-users"); - var helper = new TestHelper(); - var controller = helper.CreateController(user); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var erole = new Entity.Role(Guid.NewGuid(), "test") { Description = "description" }; - service.Setup(m => m.UpdateRoleAsync(It.IsAny())).Returns(Task.FromResult(erole)); - var model = mapper.Map(erole); - - // Act - var result = await controller.UpdateRoleAsync(erole.Id, model); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - var expectedResult = mapper.Map(erole); - Assert.Equal(expectedResult.Id, actualResult.Id); - Assert.Equal(expectedResult.Name, actualResult.Name); - Assert.Equal(expectedResult.Description, actualResult.Description); - service.Verify(m => m.UpdateRoleAsync(It.IsAny()), Times.Once()); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/api/Controllers/Keycloak/UserControllerTest.cs b/backend/tests/unit/api/Controllers/Keycloak/UserControllerTest.cs deleted file mode 100644 index ef0e12315e..0000000000 --- a/backend/tests/unit/api/Controllers/Keycloak/UserControllerTest.cs +++ /dev/null @@ -1,180 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Areas.Keycloak.Controllers; -using Pims.Core.Comparers; -using Pims.Core.Test; -using Pims.Dal.Keycloak; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Threading.Tasks; -using Xunit; -using AdminModels = Pims.Api.Areas.Admin.Models.User; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Keycloak.Models.User; - -namespace PimsApi.Test.Keycloak.Controllers -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "keycloak")] - [Trait("group", "user")] - [ExcludeFromCodeCoverage] - public class UserControllerTest - { - #region Variables - #endregion - - #region Constructors - public UserControllerTest() - { - } - #endregion - - #region Tests - #region SyncUserAsync - [Fact] - public async void SyncUserAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.AdminUsers); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var user = new Entity.User(Guid.NewGuid(), "test", "test@test.com"); - service.Setup(m => m.SyncUserAsync(It.IsAny())).Returns(Task.FromResult(user)); - - // Act - var result = await controller.SyncUserAsync(user.Id); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var data = Assert.IsType(actionResult.Value); - Assert.Equal(mapper.Map(user), data, new DeepPropertyCompare()); - service.Verify(m => m.SyncUserAsync(It.IsAny()), Times.Once()); - } - #endregion - - #region GetUsersAsync - [Fact] - public async void GetUsersAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.AdminUsers); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var user = new Entity.User(Guid.NewGuid(), "test", "test@test.com"); - var users = new[] { user }; - service.Setup(m => m.GetUsersAsync(It.IsAny(), It.IsAny(), It.IsAny())).Returns(Task.FromResult((IEnumerable)users)); - - // Act - var result = await controller.GetUsersAsync(1, 10); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var data = Assert.IsType(actionResult.Value); - Assert.Equal(mapper.Map(users), data, new DeepPropertyCompare()); - service.Verify(m => m.GetUsersAsync(1, 10, It.IsAny()), Times.Once()); - } - #endregion - - #region GetUserAsync - [Fact] - public async void GetUserAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.AdminUsers); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var user = new Entity.User(Guid.NewGuid(), "test", "test@test.com"); - service.Setup(m => m.GetUserAsync(It.IsAny())).Returns(Task.FromResult(user)); - - // Act - var result = await controller.GetUserAsync(user.Id); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var data = Assert.IsType(actionResult.Value); - Assert.Equal(mapper.Map(user), data, new DeepPropertyCompare()); - service.Verify(m => m.GetUserAsync(It.IsAny()), Times.Once()); - } - #endregion - - #region UpdateUserAsync - [Fact] - public async void UpdateUserAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.AdminUsers); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var user = new Entity.User(Guid.NewGuid(), "test", "test@test.com"); - service.Setup(m => m.UpdateUserAsync(It.IsAny())).Returns(Task.FromResult(user)); - var model = mapper.Map(user); - - // Act - var result = await controller.UpdateUserAsync(user.Id, model); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - var expectedResult = mapper.Map(user); - Assert.Equal(expectedResult.Id, actualResult.Id); - Assert.Equal(expectedResult.DisplayName, actualResult.DisplayName); - Assert.Equal(expectedResult.FirstName, actualResult.FirstName); - Assert.Equal(expectedResult.MiddleName, actualResult.MiddleName); - Assert.Equal(expectedResult.LastName, actualResult.LastName); - Assert.Equal(expectedResult.Username, actualResult.Username); - Assert.Equal(expectedResult.Email, actualResult.Email); - Assert.Equal(expectedResult.IsDisabled, actualResult.IsDisabled); - Assert.Equal(expectedResult.EmailVerified, actualResult.EmailVerified); - Assert.Equal(expectedResult.Position, actualResult.Position); - Assert.Equal(expectedResult.Note, actualResult.Note); - Assert.Equal(expectedResult.Agencies, actualResult.Agencies, new DeepPropertyCompare()); - Assert.Equal(expectedResult.Roles, actualResult.Roles, new DeepPropertyCompare()); - service.Verify(m => m.UpdateUserAsync(It.IsAny()), Times.Once()); - } - #endregion - - #region UpdateUserAsync - [Fact] - public async void UpdateAccessRequestAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.AdminUsers); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var accessRequest = EntityHelper.CreateAccessRequest(); - service.Setup(m => m.UpdateAccessRequestAsync(It.IsAny())).Returns(Task.FromResult(accessRequest)); - var model = mapper.Map(accessRequest); - - // Act - var result = await controller.UpdateAccessRequestAsync(model); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - var expectedResult = mapper.Map(accessRequest); - Assert.Equal(expectedResult, actualResult, new DeepPropertyCompare()); - service.Verify(m => m.UpdateAccessRequestAsync(It.IsAny()), Times.Once()); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/api/Controllers/LookupControllerTest.cs b/backend/tests/unit/api/Controllers/LookupControllerTest.cs deleted file mode 100644 index d9e09f835d..0000000000 --- a/backend/tests/unit/api/Controllers/LookupControllerTest.cs +++ /dev/null @@ -1,191 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Controllers; -using Pims.Core.Comparers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Xunit; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Models.Lookup; - -namespace Pims.Api.Test.Controllers -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("group", "lookup")] - [ExcludeFromCodeCoverage] - public class LookupControllerTest - { - #region Variables - #endregion - - #region Constructors - public LookupControllerTest() - { - } - #endregion - - #region Tests - [Fact] - public void GetAgencyCodes() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var agency = new Entity.Agency - { - Code = "MOH", - Name = "Ministry of Health", - Description = "The Ministry of Health" - }; - service.Setup(m => m.Lookup.GetAgencies()).Returns(new[] { agency }); - - // Act - var result = controller.GetAgencies(); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType[]>(actionResult.Value); - Assert.Equal(new[] { mapper.Map>(agency) }, actualResult, new DeepPropertyCompare()); - service.Verify(m => m.Lookup.GetAgencies(), Times.Once()); - } - - [Fact] - public void GetPropertyClassificationCodes() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var propertyClassification = new Entity.PropertyClassification - { - Name = "Surplus Active", - }; - service.Setup(m => m.Lookup.GetPropertyClassifications()).Returns(new[] { propertyClassification }); - - // Act - var result = controller.GetPropertyClassifications(); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType[]>(actionResult.Value); - Assert.Equal(new[] { mapper.Map>(propertyClassification) }, actualResult, new DeepPropertyCompare()); - service.Verify(m => m.Lookup.GetPropertyClassifications(), Times.Once()); - } - - [Fact] - public void GetRoleCodes() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var role = new Entity.Role - { - Id = Guid.NewGuid(), - Name = "Ministry of Health", - Description = "The Ministry of Health" - }; - service.Setup(m => m.Lookup.GetRoles()).Returns(new[] { role }); - - // Act - var result = controller.GetRoles(); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(new[] { mapper.Map(role) }, actualResult, new DeepPropertyCompare()); - service.Verify(m => m.Lookup.GetRoles(), Times.Once()); - } - - [Fact] - public void GetTierLevels() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var tierLevels = EntityHelper.CreateDefaultTierLevels().ToArray(); - service.Setup(m => m.Lookup.GetTierLevels()).Returns(tierLevels); - - // Act - var result = controller.GetTierLevels(); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType[]>(actionResult.Value); - Assert.Equal(tierLevels.Select(t => mapper.Map>(t)).ToArray(), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.Lookup.GetTierLevels(), Times.Once()); - } - - [Fact] - public void GetAll() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var mapper = helper.GetService(); - var service = helper.GetService>(); - var role = EntityHelper.CreateRole("admin"); - service.Setup(m => m.Lookup.GetRoles()).Returns(new[] { role }); - - var agency = EntityHelper.CreateAgency(); - service.Setup(m => m.Lookup.GetAgencies()).Returns(new[] { agency }); - - var propertyClassification = EntityHelper.CreatePropertyClassification("class", true); - service.Setup(m => m.Lookup.GetPropertyClassifications()).Returns(new[] { propertyClassification }); - - var province = EntityHelper.CreateProvince("BC", "British Columbia"); - service.Setup(m => m.Lookup.GetProvinces()).Returns(new[] { province }); - - var administrativeArea = EntityHelper.CreateAdministrativeArea("VIC", "Victoria"); - service.Setup(m => m.Lookup.GetAdministrativeAreas()).Returns(new[] { administrativeArea }); - - var buildingConstructionType = EntityHelper.CreateBuildingConstructionType("type"); - service.Setup(m => m.Lookup.GetBuildingConstructionTypes()).Returns(new[] { buildingConstructionType }); - - var buildingPredominateUse = EntityHelper.CreateBuildingPredominateUse("use"); - service.Setup(m => m.Lookup.GetBuildingPredominateUses()).Returns(new[] { buildingPredominateUse }); - - var buildingOccupantType = EntityHelper.CreateBuildingOccupantType("occupant"); - service.Setup(m => m.Lookup.GetBuildingOccupantTypes()).Returns(new[] { buildingOccupantType }); - - var tierLevel = EntityHelper.CreateTierLevel("tierlevel"); - service.Setup(m => m.Lookup.GetTierLevels()).Returns(new[] { tierLevel }); - - // Act - var result = controller.GetAll(); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsAssignableFrom>(actionResult.Value); - Assert.Equal(mapper.Map(role), actualResult.First(), new ShallowPropertyCompare()); - Assert.Equal(mapper.Map>(agency), actualResult.Next(1), new ShallowPropertyCompare()); - Assert.Equal(mapper.Map>(propertyClassification), actualResult.Next(2), new ShallowPropertyCompare()); - Assert.Equal(mapper.Map>(province), actualResult.Next(3), new ShallowPropertyCompare()); - Assert.Equal(mapper.Map>(administrativeArea), actualResult.Next(4), new ShallowPropertyCompare()); - Assert.Equal(mapper.Map>(buildingConstructionType), actualResult.Next(5), new ShallowPropertyCompare()); - Assert.Equal(mapper.Map>(buildingPredominateUse), actualResult.Next(6), new ShallowPropertyCompare()); - Assert.Equal(mapper.Map>(buildingOccupantType), actualResult.Next(7), new ShallowPropertyCompare()); - Assert.Equal(mapper.Map>(tierLevel), actualResult.Next(8), new ShallowPropertyCompare()); - } - #endregion - } -} diff --git a/backend/tests/unit/api/Controllers/Notification/QueueControllerTest.cs b/backend/tests/unit/api/Controllers/Notification/QueueControllerTest.cs deleted file mode 100644 index 096a804ad8..0000000000 --- a/backend/tests/unit/api/Controllers/Notification/QueueControllerTest.cs +++ /dev/null @@ -1,303 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Areas.Notification.Controllers; -using Pims.Api.Helpers.Exceptions; -using Pims.Core.Comparers; -using Pims.Core.Test; -using Pims.Dal; -using Pims.Dal.Entities.Models; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Notification.Models.Queue; - -namespace Pims.Api.Test.Controllers -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("group", "notifications")] - [ExcludeFromCodeCoverage] - public class QueueControllerTest - { - #region Data - public static IEnumerable NotificationFilters = new List() - { - new object [] { new NotificationQueueFilter() { AgencyId = 1 } }, - new object [] { new NotificationQueueFilter() { Status = Entity.NotificationStatus.Accepted } }, - new object [] { new NotificationQueueFilter() { ProjectId = 1 } }, - new object [] { new NotificationQueueFilter() { ProjectNumber = "test" } }, - new object [] { new NotificationQueueFilter() { To = "test" } }, - new object [] { new NotificationQueueFilter() { Subject = "test" } }, - new object [] { new NotificationQueueFilter() { Body = "test" } }, - new object [] { new NotificationQueueFilter() { Tag = "test" } }, - new object [] { new NotificationQueueFilter() { Key = Guid.NewGuid() } }, - new object [] { new NotificationQueueFilter() { MinSendOn = DateTime.MinValue } }, - new object [] { new NotificationQueueFilter() { MaxSendOn = DateTime.MaxValue } }, - new object [] { new NotificationQueueFilter() { ProjectNumber = "test" } }, - }; - - public static IEnumerable NotificationQueryFilters = new List() - { - new object [] { new Uri("http://host/api/notifications/queue?agencyId=1") }, - new object [] { new Uri("http://host/api/notifications/queue?status=1") }, - new object [] { new Uri("http://host/api/notifications/queue?projectId=1") }, - new object [] { new Uri("http://host/api/notifications/queue?to=test") }, - new object [] { new Uri("http://host/api/notifications/queue?subject=test") }, - new object [] { new Uri("http://host/api/notifications/queue?body=test") }, - new object [] { new Uri("http://host/api/notifications/queue?tag=test") }, - new object [] { new Uri("http://host/api/notifications/queue?key=8d1a35b3-6280-4103-93f5-792f8954bef8") }, - new object [] { new Uri("http://host/api/notifications/queue?minSendOn=2020-01-01") }, - new object [] { new Uri("http://host/api/notifications/queue?maxSendOn=2020-01-01") }, - new object [] { new Uri("http://host/api/notifications/queue?maxSendOn=fakedate") }, - new object [] { new Uri("http://host/api/notifications/queue?projectNumber=test") }, - }; - #endregion - - #region Constructors - public QueueControllerTest() - { - } - #endregion - - #region Tests - #region GetNotificationsPage - [Theory] - [MemberData(nameof(NotificationFilters))] - public void GetNotificationsPage_Success(NotificationQueueFilter filter) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var template = EntityHelper.CreateNotificationTemplate(1, "test"); - var notifications = EntityHelper.CreateNotificationQueues(1, 2, template); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var page = new Paged(notifications, filter.Page, filter.Quantity); - service.Setup(m => m.NotificationQueue.GetPage(It.IsAny())).Returns(page); - - // Act - var result = controller.GetNotificationsPage(filter); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType>(actionResult.Value); - service.Verify(m => m.NotificationQueue.GetPage(It.IsAny()), Times.Once()); - } - - /// - /// Make a successful request that passes the filter in the query string. - /// - [Theory] - [MemberData(nameof(NotificationQueryFilters))] - public void GetNotificationsPage_Query_Success(Uri uri) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin, uri); - - var template = EntityHelper.CreateNotificationTemplate(1, "test"); - var notifications = EntityHelper.CreateNotificationQueues(1, 2, template); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var page = new Paged(notifications); - service.Setup(m => m.NotificationQueue.GetPage(It.IsAny())).Returns(page); - - // Act - var result = controller.GetNotificationsPage(); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType>(actionResult.Value); - service.Verify(m => m.NotificationQueue.GetPage(It.IsAny()), Times.Once()); - } - - /// - /// Make a failed request because the query doesn't contain filter values. - /// - [Fact] - public void GetNotificationsPage_Query_NoFilter_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - var request = helper.GetService>(); - request.Setup(m => m.QueryString).Returns(new QueryString("?page=0")); - - var service = helper.GetService>(); - - // Act - // Assert - Assert.Throws(() => controller.GetNotificationsPage()); - service.Verify(m => m.NotificationQueue.GetPage(It.IsAny()), Times.Never()); - } - - /// - /// Make a failed request because the body doesn't contain a fitler object. - /// - [Fact] - public void GetNotificationsPage_NoFilter_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var service = helper.GetService>(); - - // Act - // Assert - Assert.Throws(() => controller.GetNotificationsPage(null)); - service.Verify(m => m.NotificationQueue.GetPage(It.IsAny()), Times.Never()); - } - #endregion - - #region GetNotificationQueue - [Fact] - public void GetNotificationQueue_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var template = EntityHelper.CreateNotificationTemplate(1, "test"); - var notification = EntityHelper.CreateNotificationQueue(1, template); - service.Setup(m => m.NotificationQueue.Get(It.IsAny())).Returns(notification); - - // Act - var result = controller.GetNotificationQueue(notification.Id); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Null(actionResult.StatusCode); - Assert.Equal(mapper.Map(notification), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.NotificationQueue.Get(notification.Id), Times.Once()); - } - - [Fact] - public void GetNotificationQueue_Model() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectView); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var template = EntityHelper.CreateNotificationTemplate(1, "test"); - var notification = EntityHelper.CreateNotificationQueue(1, template); - - service.Setup(m => m.NotificationQueue.Get(It.IsAny())).Returns(notification); - - // Act - var result = controller.GetNotificationQueue(notification.Id); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(notification.Key, actualResult.Key); - Assert.Equal(notification.To, actualResult.To); - Assert.Equal(notification.Cc, actualResult.Cc); - Assert.Equal(notification.Bcc, actualResult.Bcc); - Assert.Equal(notification.Status, actualResult.Status); - Assert.Equal(notification.Encoding, actualResult.Encoding); - Assert.Equal(notification.BodyType, actualResult.BodyType); - Assert.Equal(notification.Subject, actualResult.Subject); - Assert.Equal(notification.Body, actualResult.Body); - Assert.Equal(notification.Tag, actualResult.Tag); - Assert.Equal(notification.SendOn, actualResult.SendOn); - Assert.Equal(notification.ChesMessageId, actualResult.ChesMessageId); - Assert.Equal(notification.ChesTransactionId, actualResult.ChesTransactionId); - Assert.Equal(notification.CreatedOn, actualResult.CreatedOn); - Assert.Equal(notification.UpdatedOn, actualResult.UpdatedOn); - Assert.Equal(notification.ToAgencyId, actualResult.ToAgencyId); - Assert.Equal(notification.ProjectId, actualResult.ProjectId); - } - #endregion - - #region UpdateNotificationStatusAsync - [Fact] - public async void UpdateNotificationStatusAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var template = EntityHelper.CreateNotificationTemplate(1, "test"); - var notification = EntityHelper.CreateNotificationQueue(1, template); - notification.ChesMessageId = Guid.NewGuid(); - service.Setup(m => m.NotificationQueue.Get(It.IsAny())).Returns(notification); - service.Setup(m => m.NotificationQueue.Update(It.IsAny())); - var notifyService = helper.GetService>(); - notifyService.Setup(m => m.GetStatusAsync(It.IsAny())).ReturnsAsync(new Pims.Notifications.Models.StatusResponse() { Status = "Completed" }); - - // Act - var result = await controller.UpdateNotificationStatusAsync(notification.Id); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Null(actionResult.StatusCode); - Assert.Equal(mapper.Map(notification), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.NotificationQueue.Get(notification.Id), Times.Once()); - service.Verify(m => m.NotificationQueue.Update(notification), Times.Once()); - notifyService.Verify(m => m.GetStatusAsync(It.IsAny()), Times.Once()); - } - - [Fact] - public async void UpdateNotificationStatusAsync_Model() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectView); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var template = EntityHelper.CreateNotificationTemplate(1, "test"); - var notification = EntityHelper.CreateNotificationQueue(1, template); - notification.ChesMessageId = Guid.NewGuid(); - service.Setup(m => m.NotificationQueue.Get(It.IsAny())).Returns(notification); - service.Setup(m => m.NotificationQueue.Update(It.IsAny())); - var notifyService = helper.GetService>(); - notifyService.Setup(m => m.GetStatusAsync(It.IsAny())).ReturnsAsync(new Pims.Notifications.Models.StatusResponse() { Status = "Completed" }); - - // Act - var result = await controller.UpdateNotificationStatusAsync(notification.Id); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(notification.Key, actualResult.Key); - Assert.Equal(notification.To, actualResult.To); - Assert.Equal(notification.Cc, actualResult.Cc); - Assert.Equal(notification.Bcc, actualResult.Bcc); - Assert.Equal(notification.Status, actualResult.Status); - Assert.Equal(notification.Encoding, actualResult.Encoding); - Assert.Equal(notification.BodyType, actualResult.BodyType); - Assert.Equal(notification.Subject, actualResult.Subject); - Assert.Equal(notification.Body, actualResult.Body); - Assert.Equal(notification.Tag, actualResult.Tag); - Assert.Equal(notification.SendOn, actualResult.SendOn); - Assert.Equal(notification.ChesMessageId, actualResult.ChesMessageId); - Assert.Equal(notification.ChesTransactionId, actualResult.ChesTransactionId); - Assert.Equal(notification.CreatedOn, actualResult.CreatedOn); - Assert.Equal(notification.UpdatedOn, actualResult.UpdatedOn); - Assert.Equal(notification.ToAgencyId, actualResult.ToAgencyId); - Assert.Equal(notification.ProjectId, actualResult.ProjectId); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/api/Controllers/Notification/TemplateControllerTest.cs b/backend/tests/unit/api/Controllers/Notification/TemplateControllerTest.cs deleted file mode 100644 index a4bd5af085..0000000000 --- a/backend/tests/unit/api/Controllers/Notification/TemplateControllerTest.cs +++ /dev/null @@ -1,228 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Areas.Notification.Controllers; -using Pims.Core.Comparers; -using Pims.Core.Test; -using Pims.Dal; -using Pims.Dal.Security; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Xunit; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Notification.Models.Template; - -namespace Pims.Api.Test.Controllers -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("group", "notifications")] - [ExcludeFromCodeCoverage] - public class TemplateControllerTest - { - #region Data - #endregion - - #region Constructors - public TemplateControllerTest() - { - } - #endregion - - #region Tests - #region GetNotificationTemplates - [Fact] - public void GetNotificationTemplates_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var templates = EntityHelper.CreateNotificationTemplates(1, 10); - service.Setup(m => m.NotificationTemplate.Get()).Returns(templates); - - // Act - var result = controller.GetNotificationTemplates(); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsAssignableFrom>(actionResult.Value); - Assert.Null(actionResult.StatusCode); - Assert.Equal(mapper.Map(templates), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.NotificationTemplate.Get(), Times.Once()); - } - - #endregion - - #region GetNotificationTemplate - [Fact] - public void GetNotificationTemplate_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var template = EntityHelper.CreateNotificationTemplate(1, "test"); - service.Setup(m => m.NotificationTemplate.Get(It.IsAny())).Returns(template); - - // Act - var result = controller.GetNotificationTemplate(template.Id); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Null(actionResult.StatusCode); - Assert.Equal(mapper.Map(template), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.NotificationTemplate.Get(template.Id), Times.Once()); - } - - [Fact] - public void GetNotificationTemplate_Model() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectView); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var template = EntityHelper.CreateNotificationTemplate(1, "test"); - - service.Setup(m => m.NotificationTemplate.Get(It.IsAny())).Returns(template); - - // Act - var result = controller.GetNotificationTemplate(template.Id); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(template.Name, actualResult.Name); - Assert.Equal(template.Description, actualResult.Description); - Assert.Equal(template.Audience, actualResult.Audience); - Assert.Equal(template.To, actualResult.To); - Assert.Equal(template.Cc, actualResult.Cc); - Assert.Equal(template.Bcc, actualResult.Bcc); - Assert.Equal(template.Encoding, actualResult.Encoding); - Assert.Equal(template.BodyType, actualResult.BodyType); - Assert.Equal(template.Subject, actualResult.Subject); - Assert.Equal(template.Body, actualResult.Body); - Assert.Equal(template.Tag, actualResult.Tag); - Assert.Equal(template.IsDisabled, actualResult.IsDisabled); - Assert.Equal(template.CreatedOn, actualResult.CreatedOn); - Assert.Equal(template.UpdatedOn, actualResult.UpdatedOn); - Assert.Equal(template.Status.Count(), actualResult.Status.Count()); - } - #endregion - - #region AddNotificationTemplate - [Fact] - public void AddNotificationTemplate_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var template = EntityHelper.CreateNotificationTemplate(1, "test"); - service.Setup(m => m.NotificationTemplate.Add(It.IsAny())).Returns(template); - - // Act - var result = controller.AddNotificationTemplate(mapper.Map(template)); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsAssignableFrom(actionResult.Value); - Assert.Equal(201, actionResult.StatusCode); - Assert.Equal(mapper.Map(template), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.NotificationTemplate.Add(It.IsAny()), Times.Once()); - } - #endregion - - #region UpdateNotificationTemplate - [Fact] - public void UpdateNotificationTemplate_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var template = EntityHelper.CreateNotificationTemplate(1, "test"); - service.Setup(m => m.NotificationTemplate.Update(It.IsAny())).Returns(template); - - // Act - var result = controller.UpdateNotificationTemplate(mapper.Map(template)); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Null(actionResult.StatusCode); - Assert.Equal(mapper.Map(template), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.NotificationTemplate.Update(It.IsAny()), Times.Once()); - } - #endregion - - #region DeleteNotificationTemplate - [Fact] - public void DeleteNotificationTemplate_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var template = EntityHelper.CreateNotificationTemplate(1, "test"); - service.Setup(m => m.NotificationTemplate.Remove(It.IsAny())); - - // Act - var result = controller.DeleteNotificationTemplate(mapper.Map(template)); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Null(actionResult.StatusCode); - Assert.Equal(mapper.Map(template), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.NotificationTemplate.Remove(It.IsAny()), Times.Once()); - } - #endregion - - #region SendNotificationAsync - [Fact] - public async void SendNotificationAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var options = helper.CreateDefaultPimsOptions(); - var controller = helper.CreateController(Permissions.SystemAdmin, options); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var template = EntityHelper.CreateNotificationTemplate(1, "test"); - var notification = EntityHelper.CreateNotificationQueue(1, template); - var project = EntityHelper.CreateProject(1); - service.Setup(m => m.NotificationTemplate.SendNotificationAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(notification); - service.Setup(m => m.Project.Get(It.IsAny())).Returns(project); - - // Act - var result = await controller.SendProjectNotificationAsync(template.Id, "test@test.com", null, null, project.Id); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(201, actionResult.StatusCode); - Assert.Equal(mapper.Map(notification), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.NotificationTemplate.SendNotificationAsync(template.Id, "test@test.com", null), Times.Never()); - service.Verify(m => m.Project.Get(project.Id), Times.Once()); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/api/Controllers/ParcelControllerTest.cs b/backend/tests/unit/api/Controllers/ParcelControllerTest.cs deleted file mode 100644 index 06d5841225..0000000000 --- a/backend/tests/unit/api/Controllers/ParcelControllerTest.cs +++ /dev/null @@ -1,264 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Areas.Property.Controllers; -using Pims.Core.Comparers; -using Pims.Core.Http.Models; -using Pims.Core.Test; -using Pims.Dal; -using Pims.Dal.Entities.Models; -using Pims.Dal.Security; -using Pims.Ltsa; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Xunit; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Property.Models.Parcel; - -namespace Pims.Api.Test.Controllers -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("group", "parcel")] - [ExcludeFromCodeCoverage] - public class ParcelControllerTest - { - #region Data - public static IEnumerable ParcelFilters => - new List - { - new object[] { new ParcelFilter(50, 25, 50, 20) }, - new object[] { new ParcelFilter(50, 25, 50, 25) }, - new object[] { new ParcelFilter() { Agencies = new int[] { 3 } } }, - new object[] { new ParcelFilter() { ClassificationId = 2 } }, - new object[] { new ParcelFilter() { Description = "test" } }, - new object[] { new ParcelFilter() { AdministrativeArea = "test" } }, - new object[] { new ParcelFilter() { Zoning = "test" } }, - new object[] { new ParcelFilter() { ZoningPotential = "test" } }, - new object[] { new ParcelFilter() { ProjectNumber = "test" } } - }; - - public static IEnumerable ParcelQueries => - new List - { - new object[] { new Uri("http://host/api/parcels?Agencies=1,2") }, - new object[] { new Uri("http://host/api/parcels?Address=test") }, - new object[] { new Uri("http://host/api/parcels?ProjectNumber=test") }, - new object[] { new Uri("http://host/api/parcels?Description=test") }, - new object[] { new Uri("http://host/api/parcels?AdministrativeArea=test") }, - new object[] { new Uri("http://host/api/parcels?Zoning=test") }, - new object[] { new Uri("http://host/api/parcels?ZoningPotential=test") }, - new object[] { new Uri("http://host/api/parcels?ClassificationId=1") }, - new object[] { new Uri("http://host/api/parcels?StatusId=1") } - }; - #endregion - - #region Constructors - public ParcelControllerTest() - { - } - #endregion - - #region Tests - #region GetParcel - [Fact] - public void GetParcel_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var expectedTestParcel = new Entity.Parcel(1, 45, 45); - service.Setup(m => m.Parcel.Get(It.IsAny())).Returns(expectedTestParcel); - int expectedParcelId = 1; - - // Act - var result = controller.GetParcel(expectedParcelId); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(mapper.Map(expectedTestParcel), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.Parcel.Get(expectedParcelId), Times.Once()); - } - - [Fact] - public void GetParcel_Model() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - parcel.PIN = 3; - parcel.Description = "Description"; - parcel.LandArea = 3434.34f; - parcel.LandLegalDescription = "LandLegalDescription"; - parcel.Zoning = "Zoning"; - parcel.ZoningPotential = "ZoningPotential"; - parcel.IsSensitive = false; - service.Setup(m => m.Parcel.Get(It.IsAny())).Returns(parcel); - int expectedParcelId = 1; - - // Act - var result = controller.GetParcel(expectedParcelId); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(parcel.Id, actualResult.Id); - Assert.Equal(parcel.ParcelIdentity, actualResult.PID); - Assert.Equal(parcel.PIN, actualResult.PIN); - Assert.Equal(parcel.ClassificationId, actualResult.ClassificationId); - Assert.Equal(parcel.AgencyId, actualResult.AgencyId); - Assert.Equal(parcel.Description, actualResult.Description); - Assert.Equal(parcel.AddressId, actualResult.Address.Id); - Assert.Equal(parcel.Location.Y, actualResult.Latitude); - Assert.Equal(parcel.Location.X, actualResult.Longitude); - Assert.Equal(parcel.LandArea, actualResult.LandArea); - Assert.Equal(parcel.LandLegalDescription, actualResult.LandLegalDescription); - Assert.Equal(parcel.Zoning, actualResult.Zoning); - Assert.Equal(parcel.ZoningPotential, actualResult.ZoningPotential); - Assert.Equal(parcel.IsSensitive, actualResult.IsSensitive); - Assert.Equal(parcel.Buildings.Count(), actualResult.Buildings.Count()); - Assert.Equal(parcel.Evaluations.Count(), actualResult.Evaluations.Count()); - } - #endregion - - #region AddParcel - [Fact] - public void AddParcel_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyAdd); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var parcel = EntityHelper.CreateParcel(1); - service.Setup(m => m.Parcel.Add(It.IsAny())).Returns(parcel); - var model = mapper.Map(parcel); - - // Act - var result = controller.AddParcel(model); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Equal(201, actionResult.StatusCode); - var actualParcel = Assert.IsType(actionResult.Value); - service.Verify(m => m.Parcel.Add(It.IsAny()), Times.Once()); - } - #endregion - - #region UpdateParcel - [Fact] - public void UpdateParcel_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyEdit); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var parcel = EntityHelper.CreateParcel(1); - service.Setup(m => m.Parcel.Update(It.IsAny())).Returns(parcel); - var model = mapper.Map(parcel); - - // Act - var result = controller.UpdateParcel(parcel.Id, model); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - service.Verify(m => m.Parcel.Update(It.IsAny()), Times.Once()); - } - #endregion - - #region DeleteParcel - [Fact] - public void DeleteParcel_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyDelete); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var parcel = EntityHelper.CreateParcel(1); - service.Setup(m => m.Parcel.Remove(It.IsAny())); - var modelToDelete = mapper.Map(parcel); - - // Act - var result = controller.DeleteParcel(parcel.Id, modelToDelete); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(mapper.Map(parcel), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.Parcel.Remove(It.IsAny()), Times.Once()); - } - #endregion - - #region Check if PID is available - [Fact] - public void IsPidAvailable_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var service = helper.GetService>(); - var expectedResults = new Model.CheckPidAvailabilityResponseModel { Available = true }; - service.Setup(m => m.Parcel.IsPidAvailable(It.IsAny(), It.IsAny())) - .Returns(true); - - // Act - var result = controller.IsPidAvailable(1, 1); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(expectedResults, actualResult, new DeepPropertyCompare()); - service.Verify(m => m.Parcel.IsPidAvailable(1, 1), Times.Once()); - } - #endregion - - #region Check if PIN is available - [Fact] - public void IsPinAvailable_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var service = helper.GetService>(); - var expectedResults = new Model.CheckPidAvailabilityResponseModel { Available = true }; - service.Setup(m => m.Parcel.IsPinAvailable(It.IsAny(), It.IsAny())) - .Returns(true); - - // Act - var result = controller.IsPinAvailable(1, 1); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(expectedResults, actualResult, new DeepPropertyCompare()); - service.Verify(m => m.Parcel.IsPinAvailable(1, 1), Times.Once()); - } - #endregion - - #endregion - } -} diff --git a/backend/tests/unit/api/Controllers/Project/DisposeControllerTest.cs b/backend/tests/unit/api/Controllers/Project/DisposeControllerTest.cs deleted file mode 100644 index 3826742c04..0000000000 --- a/backend/tests/unit/api/Controllers/Project/DisposeControllerTest.cs +++ /dev/null @@ -1,379 +0,0 @@ -using FluentAssertions; -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Areas.Project.Controllers; -using Pims.Core.Comparers; -using Pims.Core.Test; -using Pims.Dal; -using Pims.Dal.Entities.Models; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Text.Json; -using System.Threading.Tasks; -using Xunit; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Project.Models.Dispose; - -namespace Pims.Api.Test.Controllers -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("group", "project")] - [ExcludeFromCodeCoverage] - public class DisposeControllerTest - { - #region Data - public static IEnumerable ProjectFilters => - new List - { - new object[] { new ProjectFilter() { Agencies = new int[] { 3 } } }, - new object[] { new ProjectFilter() { ProjectNumber = "ProjectNumber" } }, - new object[] { new ProjectFilter() { Name = "Name" } }, - new object[] { new ProjectFilter() { StatusId = new[] { 1 } } }, - new object[] { new ProjectFilter() { TierLevelId = 2 } } - }; - - public static IEnumerable ProjectQueries => - new List - { - new object[] { new Uri("http://host/api/projects?Agencies=1,2") }, - new object[] { new Uri("http://host/api/projects?ProjectNumber=ProjectNumber") }, - new object[] { new Uri("http://host/api/projects?Name=Name") }, - new object[] { new Uri("http://host/api/projects?StatusId=1") }, - new object[] { new Uri("http://host/api/projects?TierLevelId=1") } - }; - - public static IEnumerable WorkflowCodes => - new List - { - new object[] { "", "" }, - new object[] { null, "" }, - new object[] { null, null }, - new object[] { "", null }, - new object[] { " ", "" }, - new object[] { " ", " " }, - new object[] { "", " " }, - new object[] { "code", "" }, - new object[] { "code", " " }, - new object[] { "code", null }, - new object[] { "", "code" }, - new object[] { " ", "code" }, - new object[] { null, "code" } - }; - - public static IEnumerable WorkflowIds => - new List - { - new object[] { "", 1 }, - new object[] { " ", 1 }, - new object[] { null, 1 } - }; - #endregion - - #region Constructors - public DisposeControllerTest() - { - } - #endregion - - #region Tests - #region GetProject - [Fact] - public void GetProject_ByNumber_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectView); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var project = EntityHelper.CreateProject(1, 1); - service.Setup(m => m.Project.Get(It.IsAny())).Returns(project); - - // Act - var result = controller.GetProject(project.ProjectNumber); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Null(actionResult.StatusCode); - Assert.Equal(mapper.Map(project), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.Project.Get(project.ProjectNumber), Times.Once()); - } - - [Fact] - public void GetProject_ById_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectView); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var project = EntityHelper.CreateProject(1, 1); - service.Setup(m => m.Project.Get(It.IsAny())).Returns(project); - - // Act - var result = controller.GetProject(project.Id); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Null(actionResult.StatusCode); - Assert.Equal(mapper.Map(project), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.Project.Get(project.Id), Times.Once()); - } - - [Fact] - public void GetProject_Model() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectView); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var project = EntityHelper.CreateProject(1, 1); - project.ProjectNumber = "ProjectNumber"; - project.Name = "ProjectName"; - project.Description = "ProjectDescription"; - project.TierLevelId = 1; - project.StatusId = 1; - project.AgencyId = 1; - - var parcel = EntityHelper.CreateParcel(1, 1, 1, project.Agency); - var building = EntityHelper.CreateBuilding(parcel, 1, project.ProjectNumber, "local", 1, 1, project.Agency); - project.AddProperty(parcel); - project.AddProperty(building); - - service.Setup(m => m.Project.Get(It.IsAny())).Returns(project); - - // Act - var result = controller.GetProject(project.ProjectNumber); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(project.ProjectNumber, actualResult.ProjectNumber); - Assert.Equal(project.Description, actualResult.Description); - Assert.Equal(project.Name, actualResult.Name); - Assert.Equal(project.StatusId, actualResult.StatusId); - Assert.Equal(project.TierLevelId, actualResult.TierLevelId); - Assert.Equal(project.AgencyId, actualResult.AgencyId); - Assert.Equal(project.Properties.Count(), actualResult.Properties.Count()); - actualResult.OfferAmount.Should().Be(JsonSerializer.Deserialize(project.Metadata).OfferAmount); - } - #endregion - - #region AddProject - [Fact] - public async void AddProject_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectAdd); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var project = EntityHelper.CreateProject(1); - service.Setup(m => m.Project.AddAsync(It.IsAny())).ReturnsAsync(project); - var model = mapper.Map(project); - - // Act - var result = await controller.AddProjectAsync(model); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Equal(201, actionResult.StatusCode); - var actualProject = Assert.IsType(actionResult.Value); - actualProject.OfferAmount.Should().Be(JsonSerializer.Deserialize(project.Metadata).OfferAmount); - service.Verify(m => m.Project.AddAsync(It.IsAny()), Times.Once()); - } - #endregion - - #region UpdateProject - [Fact] - public async void UpdateProject_SuccessAsync() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectEdit); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var project = EntityHelper.CreateProject(1); - service.Setup(m => m.Project.UpdateAsync(It.IsAny())).ReturnsAsync(project); - var model = mapper.Map(project); - - // Act - var result = await controller.UpdateProjectAsync(project.ProjectNumber, model); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - actualResult.OfferAmount.Should().Be(JsonSerializer.Deserialize(project.Metadata).OfferAmount); - service.Verify(m => m.Project.UpdateAsync(It.IsAny()), Times.Once()); - } - #endregion - - #region DeleteProject - [Fact] - public async void DeleteProject_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectDelete); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var project = EntityHelper.CreateProject(1); - service.Setup(m => m.Project.RemoveAsync(It.IsAny())).Returns(Task.FromResult(project)); - var modelToDelete = mapper.Map(project); - - // Act - var result = await controller.DeleteProjectAsync(project.ProjectNumber, modelToDelete); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - actualResult.OfferAmount.Should().Be(JsonSerializer.Deserialize(project.Metadata).OfferAmount); - Assert.Equal(mapper.Map(project), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.Project.RemoveAsync(It.IsAny()), Times.Once()); - } - #endregion - - #region SetStatus - [Fact] - public async void SetStatus_WithId_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectDelete); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var project = EntityHelper.CreateProject(1); - var workflow = EntityHelper.CreateWorkflow(1, "test", "TEST", new[] { project.Status }); - service.Setup(m => m.Workflow.Get(It.IsAny())).Returns(workflow); - service.Setup(m => m.Project.SetStatusAsync(It.IsAny(), It.IsAny(), true)).ReturnsAsync(project); - service.Setup(m => m.ProjectStatus.Get(It.IsAny())).Returns(project.Status); - var model = mapper.Map(project); - - // Act - var result = await controller.SetStatusAsync(workflow.Code, project.StatusId, model); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(mapper.Map(project), actualResult, new DeepPropertyCompare()); - actualResult.WorkflowId.Should().Be(1); - actualResult.StatusId.Should().Be(1); - actualResult.OfferAmount.Should().Be(JsonSerializer.Deserialize(project.Metadata).OfferAmount); - service.Verify(m => m.Workflow.Get(workflow.Code), Times.Once()); - service.Verify(m => m.Project.SetStatusAsync(It.IsAny(), workflow, true), Times.Once()); - } - - [Theory] - [MemberData(nameof(WorkflowIds))] - public async void SetStatus_WithId_ArgumentException(string workflowCode, int statusId) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectDelete); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var project = EntityHelper.CreateProject(1); - service.Setup(m => m.Project.SetStatusAsync(It.IsAny(), It.IsAny())).ReturnsAsync(project); - var model = mapper.Map(project); - - // Act - // Assert - await Assert.ThrowsAsync(() => controller.SetStatusAsync(workflowCode, statusId, model)); - } - - [Fact] - public async void SetStatus_InvalidStatus_KeyNotFoundException() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectDelete); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var project = EntityHelper.CreateProject(1); - var workflow = EntityHelper.CreateWorkflow(1, "DRAFT", "code"); - var status = EntityHelper.CreateProjectStatus("DRAFT", "code"); - workflow.Status.Add(new Entity.WorkflowProjectStatus(workflow, status)); - service.Setup(m => m.Workflow.Get(It.IsAny())).Returns(workflow); - service.Setup(m => m.Project.SetStatusAsync(It.IsAny(), It.IsAny())).ReturnsAsync(project); - var model = mapper.Map(project); - var workflowCode = "code"; - var statusCode = "test"; - - // Act - // Assert - await Assert.ThrowsAsync(() => controller.SetStatusAsync(workflowCode, statusCode, model)); - } - - [Fact] - public async void SetStatus_WithCode_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectDelete); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var project = EntityHelper.CreateProject(1); - var workflow = EntityHelper.CreateWorkflow(1, "DRAFT", "code"); - var status = EntityHelper.CreateProjectStatus("DRAFT", "code"); - workflow.Status.Add(new Entity.WorkflowProjectStatus(workflow, status)); - service.Setup(m => m.Workflow.Get(It.IsAny())).Returns(workflow); - service.Setup(m => m.Project.SetStatusAsync(It.IsAny(), It.IsAny(), true)).ReturnsAsync(project); - var model = mapper.Map(project); - var workflowCode = "code"; - var statusCode = "code"; - - // Act - var result = await controller.SetStatusAsync(workflowCode, statusCode, model); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(mapper.Map(project), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.Project.SetStatusAsync(It.IsAny(), workflow, true), Times.Once()); - } - - [Theory] - [MemberData(nameof(WorkflowCodes))] - public async void SetStatus_WithCode_ArgumentException(string workflowCode, string statusCode) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectDelete); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var project = EntityHelper.CreateProject(1); - service.Setup(m => m.Project.SetStatusAsync(It.IsAny(), It.IsAny())).ReturnsAsync(project); - var model = mapper.Map(project); - - // Act - // Assert - await Assert.ThrowsAsync(() => controller.SetStatusAsync(workflowCode, statusCode, model)); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/api/Controllers/Project/ReportControllerTest.cs b/backend/tests/unit/api/Controllers/Project/ReportControllerTest.cs deleted file mode 100644 index 788ff4ab8c..0000000000 --- a/backend/tests/unit/api/Controllers/Project/ReportControllerTest.cs +++ /dev/null @@ -1,239 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Areas.Project.Controllers; -using Pims.Core.Comparers; -using Pims.Core.Test; -using Pims.Dal; -using Pims.Dal.Entities; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Project.Models.Report; - -namespace Pims.Api.Test.Controllers -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("group", "project")] - [ExcludeFromCodeCoverage] - public class ReportControllerTest - { - #region Data - #endregion - - #region Constructors - public ReportControllerTest() - { - } - #endregion - - #region Tests - #region GetProject - [Fact] - public void GetReport_ById_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ReportsSpl); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var projectReport = EntityHelper.CreateProjectReport(1, "test project report"); - service.Setup(m => m.ProjectReport.Get(It.IsAny())).Returns(projectReport); - - // Act - var result = controller.GetProjectReport(projectReport.Id); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Null(actionResult.StatusCode); - Assert.Equal(mapper.Map(projectReport), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.ProjectReport.Get(projectReport.Id), Times.Once()); - } - - [Fact] - public void GetReports_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ReportsSpl); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var projectReports = EntityHelper.CreateProjectReports(1, 2); - service.Setup(m => m.ProjectReport.GetAll()).Returns(projectReports); - - // Act - var result = controller.GetProjectReports(); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsAssignableFrom>(actionResult.Value); - Assert.Null(actionResult.StatusCode); - Assert.Equal(mapper.Map(projectReports), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.ProjectReport.GetAll(), Times.Once()); - } - - [Fact] - public void GetReport_Model() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ReportsSpl); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var projectReport = EntityHelper.CreateProjectReport(1, "test"); - projectReport.To = DateTime.Now; - projectReport.From = DateTime.Now.AddDays(-1); - projectReport.IsFinal = true; - - service.Setup(m => m.ProjectReport.Get(It.IsAny())).Returns(projectReport); - - // Act - var result = controller.GetProjectReport(projectReport.Id); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(projectReport.Id, actualResult.Id); - Assert.Equal(projectReport.Name, actualResult.Name); - Assert.Equal(projectReport.To, actualResult.To); - Assert.Equal(projectReport.From, actualResult.From); - Assert.Equal(projectReport.IsFinal, actualResult.IsFinal); - } - #endregion - - #region GetProjectReportSnapshots - [Fact] - public void GetReportSnapshots_ById_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ReportsSpl); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var projectSnapshots = EntityHelper.CreateProjectSnapshots(1, 2); - service.Setup(m => m.ProjectReport.GetSnapshots(It.IsAny())).Returns(projectSnapshots); - - // Act - var result = controller.GetProjectReportSnapshots(1); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsAssignableFrom>(actionResult.Value); - Assert.Null(actionResult.StatusCode); - Assert.Equal(mapper.Map(projectSnapshots), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.ProjectReport.GetSnapshots(1), Times.Once()); - } - - [Fact] - public void GetReportSnapshots_ByReport_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ReportsSpl); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var projectSnapshots = EntityHelper.CreateProjectSnapshots(1, 2); - var projectReport = EntityHelper.CreateProjectReport(1); - service.Setup(m => m.ProjectReport.GetSnapshots(It.IsAny())).Returns(projectSnapshots); - - // Act - var result = controller.GetProjectReportSnapshots(1, mapper.Map(projectReport)); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsAssignableFrom>(actionResult.Value); - Assert.Null(actionResult.StatusCode); - Assert.Equal(mapper.Map(projectSnapshots), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.ProjectReport.GetSnapshots(It.IsAny()), Times.Once()); - } - #endregion - - #region AddReport - [Fact] - public void AddReport_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ReportsSpl); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var projectReport = EntityHelper.CreateProjectReport(1); - service.Setup(m => m.ProjectReport.Add(It.IsAny())).Returns(projectReport); - var model = mapper.Map(projectReport); - - // Act - var result = controller.AddProjectReport(model); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Equal(201, actionResult.StatusCode); - var actualProject = Assert.IsType(actionResult.Value); - service.Verify(m => m.ProjectReport.Add(It.IsAny()), Times.Once()); - } - #endregion - - #region UpdateReport - [Fact] - public void UpdateReport_SuccessAsync() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ReportsSpl); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var projectReport = EntityHelper.CreateProjectReport(1); - service.Setup(m => m.ProjectReport.Update(It.IsAny())).Returns(projectReport); - var model = mapper.Map(projectReport); - - // Act - var result = controller.UpdateProjectReport(projectReport.Id, model); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - service.Verify(m => m.ProjectReport.Update(It.IsAny()), Times.Once()); - } - #endregion - - #region DeleteReport - [Fact] - public void DeleteReport_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ReportsSpl); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var projectReport = EntityHelper.CreateProjectReport(1); - service.Setup(m => m.ProjectReport.Remove(It.IsAny())); - var modelToDelete = mapper.Map(projectReport); - - // Act - var result = controller.DeleteProjectReport(projectReport.Id, modelToDelete); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Null(actionResult.StatusCode); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(mapper.Map(projectReport), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.ProjectReport.Remove(It.IsAny()), Times.Once()); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/api/Controllers/Project/SearchControllerTest.cs b/backend/tests/unit/api/Controllers/Project/SearchControllerTest.cs deleted file mode 100644 index 40dda1b83e..0000000000 --- a/backend/tests/unit/api/Controllers/Project/SearchControllerTest.cs +++ /dev/null @@ -1,174 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Areas.Project.Controllers; -using Pims.Api.Areas.Project.Models.Search; -using Pims.Api.Helpers.Exceptions; -using Pims.Core.Comparers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal; -using Pims.Dal.Entities.Models; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Test.Controllers.Project -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("group", "project")] - [ExcludeFromCodeCoverage] - public class SearchControllerTest - { - #region Variables - public static IEnumerable ProjectsFilters = new List() - { - new object [] { new ProjectFilter() { ProjectNumber = "ProjectNumber" } }, - new object [] { new ProjectFilter() { Name = "Name" } }, - new object [] { new ProjectFilter() { Agencies = new [] { 1 } } }, - new object [] { new ProjectFilter() { StatusId = new[] { 1 } } }, - new object [] { new ProjectFilter() { TierLevelId = 1 } } - }; - - public static IEnumerable ProjectQueryFilters = new List() - { - new object [] { new Uri("http://host/api/projects?Agencies=1,2") }, - new object [] { new Uri("http://host/api/projects?StatusId=2") }, - new object [] { new Uri("http://host/api/projects?TierLevelId=1") }, - new object [] { new Uri("http://host/api/projects?Name=Name") }, - new object [] { new Uri("http://host/api/projects?ProjectNumber=ProjectNumber") } - }; - #endregion - - #region Constructors - public SearchControllerTest() - { - } - #endregion - - #region Tests - #region GetProjectsPage - /// - /// Make a successful request with a filter. - /// - [Theory] - [MemberData(nameof(ProjectsFilters))] - public void GetProjectsPage_Success(ProjectFilter filter) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectView); - - var projects = EntityHelper.CreateProjects(1, 20); - var parcels = EntityHelper.CreateParcels(1, 2); - var buildings1 = EntityHelper.CreateBuildings(parcels.Next(0), 1, 5); - var buildings2 = EntityHelper.CreateBuildings(parcels.Next(1), 6, 5); - - projects.Next(0).AddProperty(parcels.Next(0)); - projects.Next(0).AddProperty(buildings1.ToArray()); - - projects.Next(1).AddProperty(parcels.Next(1)); - projects.Next(1).AddProperty(buildings2.ToArray()); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var page = new Entity.Models.Paged(projects, filter.Page, filter.Quantity); - service.Setup(m => m.Project.GetPage(It.IsAny())).Returns(page); - - // Act - var result = controller.GetProjectsPage(filter); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType>(actionResult.Value); - var expectedResult = mapper.Map(projects); - Assert.Equal(expectedResult, actualResult.Items.ToArray(), new ShallowPropertyCompare()); - service.Verify(m => m.Project.GetPage(It.IsAny()), Times.Once()); - } - - /// - /// Make a successful request with a query filter. - /// - [Theory] - [MemberData(nameof(ProjectQueryFilters))] - public void GetProjectsPage_Query_Success(Uri uri) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectView, uri); - - var projects = EntityHelper.CreateProjects(1, 20); - var parcels = EntityHelper.CreateParcels(1, 2); - var buildings1 = EntityHelper.CreateBuildings(parcels.Next(0), 1, 5); - var buildings2 = EntityHelper.CreateBuildings(parcels.Next(1), 6, 5); - - projects.Next(0).AddProperty(parcels.Next(0)); - projects.Next(0).AddProperty(buildings1.ToArray()); - - projects.Next(1).AddProperty(parcels.Next(1)); - projects.Next(1).AddProperty(buildings2.ToArray()); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var page = new Entity.Models.Paged(projects); - service.Setup(m => m.Project.GetPage(It.IsAny())).Returns(page); - - // Act - var result = controller.GetProjectsPage(); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType>(actionResult.Value); - var expectedResult = mapper.Map(projects); - Assert.Equal(expectedResult, actualResult.Items.ToArray(), new ShallowPropertyCompare()); - service.Verify(m => m.Project.GetPage(It.IsAny()), Times.Once()); - } - - /// - /// Make a failed request because the query doesn't contain filter values. - /// - [Fact] - public void GetProjectsPage_Query_NoFilter_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectView); - var request = helper.GetService>(); - request.Setup(m => m.QueryString).Returns(new QueryString("?page=0")); - - var service = helper.GetService>(); - - // Act - // Assert - Assert.Throws(() => controller.GetProjectsPage()); - service.Verify(m => m.Project.GetPage(It.IsAny()), Times.Never()); - } - - /// - /// Make a failed request because the body doesn't contain a fitler object. - /// - [Fact] - public void GetProjectsPage_NoFilter_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectView); - - var service = helper.GetService>(); - - // Act - // Assert - Assert.Throws(() => controller.GetProjectsPage(null)); - service.Verify(m => m.Project.GetPage(It.IsAny()), Times.Never()); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/api/Controllers/Project/StatusControllerTest.cs b/backend/tests/unit/api/Controllers/Project/StatusControllerTest.cs deleted file mode 100644 index 5787272161..0000000000 --- a/backend/tests/unit/api/Controllers/Project/StatusControllerTest.cs +++ /dev/null @@ -1,107 +0,0 @@ -using FluentAssertions; -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Areas.Project.Controllers; -using Pims.Core.Comparers; -using Pims.Core.Test; -using Pims.Dal; -using Pims.Dal.Security; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Model = Pims.Api.Areas.Project.Models.Status; - -namespace Pims.Api.Test.Controllers -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("group", "project")] - [ExcludeFromCodeCoverage] - public class StatusControllerTest - { - #region Constructors - public StatusControllerTest() - { - } - #endregion - - #region Tests - #region GetStatus - [Fact] - public void GetStatus_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectView); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var status = EntityHelper.CreateDefaultProjectStatus(); - service.Setup(m => m.ProjectStatus.Get()).Returns(status); - - // Act - var result = controller.GetStatus(); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Null(actionResult.StatusCode); - var expectedResult = mapper.Map(status); - actualResult.Should().HaveCount(26); - service.Verify(m => m.ProjectStatus.Get(), Times.Once()); - } - #endregion - - #region GetTasksForStatus - [Fact] - public void GetTasksForStatus_Code_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectView); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var status0 = EntityHelper.CreateProjectStatus(0, "DRAFT", "DRAFT"); - var tasks = EntityHelper.CreateDefaultTasks(status0); - service.Setup(m => m.Task.GetForStatus(It.IsAny())).Returns(tasks); - - // Act - var result = controller.GetTasksForStatus(status0.Code); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Null(actionResult.StatusCode); - Assert.Equal(mapper.Map(tasks), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.Task.GetForStatus(status0.Code), Times.Once()); - } - - [Fact] - public void GetTasksForStatus_Id_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectView); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var status0 = EntityHelper.CreateProjectStatus(0, "DRAFT", "DRAFT"); - var tasks = EntityHelper.CreateDefaultTasks(status0); - service.Setup(m => m.Task.GetForStatus(It.IsAny())).Returns(tasks); - - // Act - var result = controller.GetTasksForStatus(status0.Id); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Null(actionResult.StatusCode); - Assert.Equal(mapper.Map(tasks), actualResult, new DeepPropertyCompare()); - service.Verify(m => m.Task.GetForStatus(status0.Id), Times.Once()); - } - #endregion - - #endregion - } -} diff --git a/backend/tests/unit/api/Controllers/Project/WorkfowControllerTest.cs b/backend/tests/unit/api/Controllers/Project/WorkfowControllerTest.cs deleted file mode 100644 index f36275e867..0000000000 --- a/backend/tests/unit/api/Controllers/Project/WorkfowControllerTest.cs +++ /dev/null @@ -1,117 +0,0 @@ -using FluentAssertions; -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Areas.Project.Controllers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Model = Pims.Api.Areas.Project.Models.Workflow; - -namespace Pims.Api.Test.Controllers -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("group", "project")] - [ExcludeFromCodeCoverage] - public class WorkflowControllerTest - { - #region Variables - public static IEnumerable BadWorkflow = new List( - new[] { - new object[] { null }, - new object[] { "" }, - new object[] { " " } - }); - #endregion - - #region Constructors - public WorkflowControllerTest() - { - } - #endregion - - #region Tests - #region GetWorkflowStatus - [Fact] - public void GetWorkflowStatus_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectView); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var status = EntityHelper.CreateProjectStatus(0, 6); - var workflow = EntityHelper.CreateWorkflow(0, "Submit", "SUBMIT", status); - service.Setup(m => m.Workflow.Get(It.IsAny())).Returns(workflow); - - // Act - var result = controller.GetWorkflowStatus("SUBMIT"); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Null(actionResult.StatusCode); - var expectedResult = mapper.Map(workflow.Status); - actualResult.Should().HaveCount(6); - actualResult.Should().BeEquivalentTo(expectedResult, m => m - .Excluding(o => o.UpdatedOn) - .Excluding(o => o.CreatedOn)); - service.Verify(m => m.Workflow.Get("SUBMIT"), Times.Once()); - } - - [Theory] - [MemberData(nameof(BadWorkflow))] - public void GetWorkflowStatus_ArgumentException(string workflowCode) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectView); - - var service = helper.GetService>(); - - // Act - // Assert - Assert.Throws(() => controller.GetWorkflowStatus(workflowCode)); - } - #endregion - - #region GetWorkflowTasks - [Fact] - public void GetWorkflowTasks_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.ProjectView); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var status = EntityHelper.CreateProjectStatus(0, 6); - var workflow = EntityHelper.CreateWorkflow(0, "Submit", "SUBMIT", status); - var tasks = new[] - { - EntityHelper.CreateTask("task 1", status.Next(0)), - EntityHelper.CreateTask("task 2", status.Next(2)) - }; - service.Setup(m => m.Task.GetForWorkflow(It.IsAny())).Returns(tasks); - - // Act - var result = controller.GetWorkflowTasks("SUBMIT"); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Null(actionResult.StatusCode); - actualResult.Should().HaveCount(2); - service.Verify(m => m.Task.GetForWorkflow("SUBMIT"), Times.Once()); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/api/Controllers/Property/SearchControllerTest.cs b/backend/tests/unit/api/Controllers/Property/SearchControllerTest.cs deleted file mode 100644 index a0599c96e0..0000000000 --- a/backend/tests/unit/api/Controllers/Property/SearchControllerTest.cs +++ /dev/null @@ -1,384 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Areas.Property.Controllers; -using SModel = Pims.Api.Areas.Property.Models.Search; -using Pims.Api.Helpers.Exceptions; -using Pims.Core.Comparers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal; -using Pims.Dal.Entities.Models; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Test.Controllers.Property -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("group", "property")] - [ExcludeFromCodeCoverage] - public class SearchControllerTest - { - #region Variables - public static IEnumerable AllPropertiesFilters = new List() - { - new object [] { new SModel.PropertyFilterModel(100, 0, 0, 0), false, false }, - new object [] { new SModel.PropertyFilterModel(0, 100, 0, 0), false, false }, - new object [] { new SModel.PropertyFilterModel(0, 0, 10, 0), false, false }, - new object [] { new SModel.PropertyFilterModel(0, 0, 0, 10), false, false }, - new object [] { new SModel.PropertyFilterModel(0, 0, 0, 10) { Address = "Address" }, false, false }, - new object [] { new SModel.PropertyFilterModel(0, 0, 0, 10) { Agencies = new [] { 1 } }, false, false }, - new object [] { new SModel.PropertyFilterModel(0, 0, 0, 10) { StatusId = 1 }, true, true }, - new object [] { new SModel.PropertyFilterModel(0, 0, 0, 10) { ClassificationId = 1 }, true, true }, - new object [] { new SModel.PropertyFilterModel(0, 0, 0, 10) { ProjectNumber = "ProjectNumber" }, true, true }, - new object [] { new SModel.PropertyFilterModel(0, 0, 0, 10) { AdministrativeArea = "AdministrativeArea" }, true, true } - }; - - public static IEnumerable ParcelOnlyFilters = new List() - { - new [] { new SModel.PropertyFilterModel(100, 100, 0, 0) { MinLotArea = 1 } }, - new [] { new SModel.PropertyFilterModel(100, 100, 0, 0) { MaxLotArea = 1 } }, - new [] { new SModel.PropertyFilterModel(100, 100, 0, 0) { MinLandArea = 1 } }, - new [] { new SModel.PropertyFilterModel(100, 100, 0, 0) { MaxLandArea = 1 } } - }; - - public static IEnumerable BuildingOnlyFilters = new List() - { - new [] { new SModel.PropertyFilterModel(100, 100, 0, 0) { ConstructionTypeId = 1 } }, - new [] { new SModel.PropertyFilterModel(100, 100, 0, 0) { PredominateUseId = 1 } }, - new [] { new SModel.PropertyFilterModel(100, 100, 0, 0) { FloorCount = 1 } }, - new [] { new SModel.PropertyFilterModel(100, 100, 0, 0) { Tenancy = "Tenancy" } }, - new [] { new SModel.PropertyFilterModel(100, 100, 0, 0) { MinRentableArea = 1 } }, - new [] { new SModel.PropertyFilterModel(100, 100, 0, 0) { MaxRentableArea = 1 } } - }; - - public static IEnumerable PropertyQueryFilters = new List() - { - new object [] { new Uri("http://host/api/properties?Agencies=1,2"), true, true }, - new object [] { new Uri("http://host/api/properties?StatusId=2"), true, true }, - new object [] { new Uri("http://host/api/properties?InSurplusPropertyProgram=true"), true, true }, - new object [] { new Uri("http://host/api/properties?ClassificationId=1"), true, true }, - new object [] { new Uri("http://host/api/properties?Address=Address"), true, true }, - new object [] { new Uri("http://host/api/properties?ProjectNumber=ProjectNumber"), true, true }, - new object [] { new Uri("http://host/api/properties?MinLotArea=1"), true, true }, - new object [] { new Uri("http://host/api/properties?MaxLotArea=1"), true, true }, - new object [] { new Uri("http://host/api/properties?MinLandArea=1"), true, false }, - new object [] { new Uri("http://host/api/properties?MaxLandArea=1"), true, false }, - new object [] { new Uri("http://host/api/properties?ConstructionTypeId=1"), false, true }, - new object [] { new Uri("http://host/api/properties?PredominateUseId=1"), false, true }, - new object [] { new Uri("http://host/api/properties?FloorCount=1"), false, true }, - new object [] { new Uri("http://host/api/properties?Tenancy=Tenancy"), false, true }, - new object [] { new Uri("http://host/api/properties?MinRentableArea=1"), false, true }, - new object [] { new Uri("http://host/api/properties?MaxRentableArea=1"), false, true } - }; - #endregion - - #region Constructors - public SearchControllerTest() - { - } - #endregion - - #region Tests - #region GetProperties - /// - /// Make a successful request that includes the latitude. - /// - [Theory] - [MemberData(nameof(AllPropertiesFilters))] - public void GetProperties_All_Success(SModel.PropertyFilterModel filter, bool includeParcels, bool includeBuildings) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var parcel = new Entity.Parcel(1, 51, 25); - var parcels = new[] { parcel }; - var building = new Entity.Building(parcel, 51, 25) - { - PropertyTypeId = 1 - }; - var buildings = new[] { building }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - - var items = parcels.Select(p => new Entity.Views.Property(p)) - .Concat(buildings.Select(b => new Entity.Views.Property(b))).Select(x => new ProjectProperty(x)); - service.Setup(m => m.Property.Get(It.IsAny())).Returns(items); - - // Act - var result = controller.GetProperties(filter); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - var expectedResult = mapper.Map(parcels).Concat(mapper.Map(buildings)); - Assert.Equal(expectedResult, actualResult, new DeepPropertyCompare()); - service.Verify(m => m.Property.Get(It.IsAny()), Times.Once()); - Assert.Equal(includeParcels, filter.IncludeParcels); - Assert.Equal(includeBuildings, filter.IncludeBuildings); - } - - /// - /// Make a successful request that only returns parcels. - /// - [Theory] - [MemberData(nameof(ParcelOnlyFilters))] - public void GetProperties_OnlyParcels_Success(SModel.PropertyFilterModel filter) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var parcel1 = new Entity.Parcel(1, 51, 25) { Id = 1 }; - var parcel2 = new Entity.Parcel(2, 51, 26) { Id = 2 }; - var parcels = new[] { parcel1, parcel2 }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - - var items = parcels.Select(p => new ProjectProperty(new Entity.Views.Property(p))); - service.Setup(m => m.Property.Get(It.IsAny())).Returns(items); - - // Act - var result = controller.GetProperties(filter); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - var expectedResult = mapper.Map(parcels); - Assert.Equal(expectedResult, actualResult, new DeepPropertyCompare()); - service.Verify(m => m.Property.Get(It.IsAny()), Times.Once()); - } - - /// - /// Make a successful request that only returns buildings. - /// - [Theory] - [MemberData(nameof(BuildingOnlyFilters))] - public void GetProperties_OnlyBuildings_Success(SModel.PropertyFilterModel filter) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var building1 = new Entity.Building() { Id = 1, PropertyTypeId = 1 }; - var building2 = new Entity.Building() { Id = 2, PropertyTypeId = 1 }; - var buildings = new[] { building1, building2 }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - - var items = buildings.Select(p => new ProjectProperty(new Entity.Views.Property(p))); - service.Setup(m => m.Property.Get(It.IsAny())).Returns(items); - - // Act - var result = controller.GetProperties(filter); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - var expectedResult = mapper.Map(buildings); - Assert.Equal(expectedResult, actualResult, new DeepPropertyCompare()); - service.Verify(m => m.Property.Get(It.IsAny()), Times.Once()); - } - - /// - /// Make a successful request that passes the filter in the query string. - /// - [Theory] - [MemberData(nameof(PropertyQueryFilters))] - [SuppressMessage("Usage", "xUnit1026:Theory methods should use all of their parameters", Justification = "Not required for this test.")] - [SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Not required for this test.")] - public void GetProperties_Query_Success(Uri uri, bool includeParcels, bool includeBuildings) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView, uri); - - var parcel1 = EntityHelper.CreateParcel(1, 1, 1); - var parcel2 = EntityHelper.CreateParcel(2, 1, 1); - var parcels = new[] { parcel1, parcel2 }; - - var building1 = EntityHelper.CreateBuilding(parcel1, 10); - var building2 = EntityHelper.CreateBuilding(parcel1, 11); - var buildings = new[] { building1, building2 }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - - var items = parcels.Select(p => new ProjectProperty(new Entity.Views.Property(p))) - .Concat(buildings.Select(b => new ProjectProperty(new Entity.Views.Property(b)))); - service.Setup(m => m.Property.Get(It.IsAny())).Returns(items); - - // Act - var result = controller.GetProperties(); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - var expectedResult = mapper.Map(items); - Assert.Equal(expectedResult, actualResult, new DeepPropertyCompare()); - service.Verify(m => m.Property.Get(It.IsAny()), Times.Once()); - } - - /// - /// Make a failed request because the query doesn't contain filter values. - /// - [Fact] - public void GetProperties_Query_NoFilter_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - var request = helper.GetService>(); - request.Setup(m => m.QueryString).Returns(new QueryString("?page=0")); - - var service = helper.GetService>(); - - // Act - // Assert - Assert.Throws(() => controller.GetProperties()); - service.Verify(m => m.Parcel.Get(It.IsAny()), Times.Never()); - service.Verify(m => m.Building.Get(It.IsAny()), Times.Never()); - } - - /// - /// Make a failed request because the body doesn't contain a fitler object. - /// - [Fact] - public void GetProperties_NoFilter_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var service = helper.GetService>(); - - // Act - // Assert - Assert.Throws(() => controller.GetProperties(null)); - service.Verify(m => m.Parcel.Get(It.IsAny()), Times.Never()); - service.Verify(m => m.Building.Get(It.IsAny()), Times.Never()); - } - #endregion - - #region GetPropertiesPage - /// - /// Make a successful request that includes the latitude. - /// - [Theory] - [MemberData(nameof(AllPropertiesFilters))] - [SuppressMessage("Usage", "xUnit1026:Theory methods should use all of their parameters", Justification = "Not Required")] - [SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Not Required")] - public void GetPropertiesPage_Success(SModel.PropertyFilterModel filter, bool includeParcels, bool includeBuildings) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var parcel = EntityHelper.CreateParcel(1, 51, 25); - var parcels = new[] { parcel }; - var building = EntityHelper.CreateBuilding(parcel, 51, "p1", "l1"); - var buildings = new[] { building }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var items = parcels.Select(p => new Entity.Views.Property(p)).Concat(buildings.Select(b => new Entity.Views.Property(b))); - var page = new Paged(items, filter.Page, filter.Quantity); - service.Setup(m => m.Property.GetPage(It.IsAny())).Returns(page); - - // Act - var result = controller.GetPropertiesPage(filter); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType>(actionResult.Value); - var expectedResult = mapper.Map(parcels).JoinAll(mapper.Map(buildings)); - Assert.Equal(expectedResult, actualResult.Items, new ShallowPropertyCompare()); - service.Verify(m => m.Property.GetPage(It.IsAny()), Times.Once()); - } - - /// - /// Make a successful request that passes the filter in the query string. - /// - [Theory] - [MemberData(nameof(PropertyQueryFilters))] - [SuppressMessage("Usage", "xUnit1026:Theory methods should use all of their parameters", Justification = "Not Required")] - [SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Not Required")] - public void GetPropertiesPage_Query_Success(Uri uri, bool includeParcels, bool includeBuildings) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView, uri); - - var parcel1 = EntityHelper.CreateParcel(1, 51, 25); - var parcel2 = EntityHelper.CreateParcel(2, 51, 26); - var parcels = new[] { parcel1, parcel2 }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var items = parcels.Select(p => new Entity.Views.Property(p)); - var page = new Paged(items); - service.Setup(m => m.Property.GetPage(It.IsAny())).Returns(page); - - // Act - var result = controller.GetPropertiesPage(); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType>(actionResult.Value); - var expectedResult = mapper.Map(parcels); - Assert.Equal(expectedResult, actualResult.Items, new ShallowPropertyCompare()); - service.Verify(m => m.Property.GetPage(It.IsAny()), Times.Once()); - } - - /// - /// Make a failed request because the query doesn't contain filter values. - /// - [Fact] - public void GetPropertiesPage_Query_NoFilter_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - var request = helper.GetService>(); - request.Setup(m => m.QueryString).Returns(new QueryString("?page=0")); - - var service = helper.GetService>(); - - // Act - // Assert - Assert.Throws(() => controller.GetPropertiesPage()); - service.Verify(m => m.Property.GetPage(It.IsAny()), Times.Never()); - } - - /// - /// Make a failed request because the body doesn't contain a fitler object. - /// - [Fact] - public void GetPropertiesPage_NoFilter_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var service = helper.GetService>(); - - // Act - // Assert - Assert.Throws(() => controller.GetPropertiesPage(null)); - service.Verify(m => m.Property.GetPage(It.IsAny()), Times.Never()); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/api/Controllers/Reports/ProjectControllerTest.cs b/backend/tests/unit/api/Controllers/Reports/ProjectControllerTest.cs deleted file mode 100644 index a09cf1e0dd..0000000000 --- a/backend/tests/unit/api/Controllers/Reports/ProjectControllerTest.cs +++ /dev/null @@ -1,272 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Areas.Reports.Controllers; -using Pims.Api.Helpers.Constants; -using Pims.Api.Helpers.Exceptions; -using Pims.Core.Test; -using Pims.Dal; -using Pims.Dal.Entities.Models; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Test.Controllers.Reports -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("group", "report")] - [Trait("group", "property")] - [ExcludeFromCodeCoverage] - public class ProjectControllerTest - { - #region Variables - public static IEnumerable AllPropertiesFilters = new List() - { - new object [] { new ProjectFilter() }, - new object [] { new ProjectFilter() { ProjectNumber = "username" } }, - new object [] { new ProjectFilter() { Name = "firstname, lastname" } }, - new object [] { new ProjectFilter() { StatusId = new[] { 1 } } }, - new object [] { new ProjectFilter() { TierLevelId = 1 } }, - new object [] { new ProjectFilter() { CreatedByMe = true } }, - new object [] { new ProjectFilter() { SPLWorkflow = true } }, - new object [] { new ProjectFilter() { Active = true } }, - new object [] { new ProjectFilter() { Agencies = new[] { 1 } } }, - new object [] { new ProjectFilter() { Workflows = new[] { "SUBMIT-DISPOSAL" } } }, - new object [] { new ProjectFilter() { ReportId = 1 } }, - new object [] { new ProjectFilter() { FiscalYear = 2020 } }, - }; - - public static IEnumerable PropertyQueryFilters = new List() - { - new object [] { new Uri("http://host/api/users?Username=test") }, - new object [] { new Uri("http://host/api/users?DisplayName=test") }, - new object [] { new Uri("http://host/api/users?FirstName=test") }, - new object [] { new Uri("http://host/api/users?LastName=test") }, - new object [] { new Uri("http://host/api/users?LastName=test") }, - new object [] { new Uri("http://host/api/users?Email=test") }, - new object [] { new Uri("http://host/api/users?IsDisabled=false") }, - new object [] { new Uri("http://host/api/users?Position=test") }, - new object [] { new Uri("http://host/api/users?Role=test") }, - }; - #endregion - - #region Constructors - public ProjectControllerTest() - { - } - #endregion - - #region Tests - #region ExportProjects - /// - /// Make a successful request that includes the latitude. - /// - [Theory] - [MemberData(nameof(AllPropertiesFilters))] - public void ExportProjects_Csv_Success(ProjectFilter filter) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - var headers = helper.GetService>(); - headers.Setup(m => m["Accept"]).Returns(ContentTypes.CONTENT_TYPE_CSV); - var agency = EntityHelper.CreateAgency(1); - - var project = new Entity.Project() { Agency = agency, ActualFiscalYear = 2021, ReportedFiscalYear = 2021 }; - var projects = new[] { project }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var page = new Entity.Models.Paged(projects, filter.Page, filter.Quantity); - service.Setup(m => m.Project.GetExcelPage(It.IsAny())).Returns(page); - - // Act - var result = controller.ExportProjects(filter); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Content); - Assert.Equal(ContentTypes.CONTENT_TYPE_CSV, actionResult.ContentType); - service.Verify(m => m.Project.GetExcelPage(It.IsAny()), Times.Once()); - } - - /// - /// Make a successful request that passes the filter in the query string. - /// - [Fact] - public void ExportProjects_Csv_Query_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - var headers = helper.GetService>(); - headers.Setup(m => m["Accept"]).Returns(ContentTypes.CONTENT_TYPE_CSV); - var agency = EntityHelper.CreateAgency(1); - - var project = new Entity.Project() { Agency = agency, ActualFiscalYear = 2021, ReportedFiscalYear = 2021 }; - var projects = new[] { project }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var page = new Paged(projects); - service.Setup(m => m.Project.GetExcelPage(It.IsAny())).Returns(page); - - // Act - var result = controller.ExportProjects(); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Content); - Assert.Equal(ContentTypes.CONTENT_TYPE_CSV, actionResult.ContentType); - service.Verify(m => m.Project.GetExcelPage(It.IsAny()), Times.Once()); - } - - /// - /// Make a successful request that includes the latitude. - /// - [Theory] - [MemberData(nameof(AllPropertiesFilters))] - public void ExportProjects_ExcelX_Success(ProjectFilter filter) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - var headers = helper.GetService>(); - headers.Setup(m => m["Accept"]).Returns(ContentTypes.CONTENT_TYPE_EXCELX); - var agency = EntityHelper.CreateAgency(1); - - var project = new Entity.Project() { Agency = agency, ActualFiscalYear = 2021, ReportedFiscalYear = 2021 }; - var projects = new[] { project }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var page = new Paged(projects, filter.Page, filter.Quantity); - service.Setup(m => m.Project.GetExcelPage(It.IsAny())).Returns(page); - - // Act - var result = controller.ExportProjects(filter); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Equal(ContentTypes.CONTENT_TYPE_EXCELX, actionResult.ContentType); - Assert.NotNull(actionResult.FileDownloadName); - Assert.True(actionResult.FileStream.Length > 0); - service.Verify(m => m.Project.GetExcelPage(It.IsAny()), Times.Once()); - } - - /// - /// Make a successful request that passes the filter in the query string. - /// - [Theory] - [MemberData(nameof(PropertyQueryFilters))] - public void ExportProjects_ExcelX_Query_Success(Uri uri) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView, uri); - var headers = helper.GetService>(); - headers.Setup(m => m["Accept"]).Returns(ContentTypes.CONTENT_TYPE_EXCELX); - var agency = EntityHelper.CreateAgency(1); - - var project = new Entity.Project() { Agency = agency, ActualFiscalYear = 2021, ReportedFiscalYear = 2021 }; - var projects = new[] { project }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var page = new Paged(projects); - service.Setup(m => m.Project.GetExcelPage(It.IsAny())).Returns(page); - - // Act - var result = controller.ExportProjects(); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Equal(ContentTypes.CONTENT_TYPE_EXCELX, actionResult.ContentType); - Assert.NotNull(actionResult.FileDownloadName); - Assert.True(actionResult.FileStream.Length > 0); - service.Verify(m => m.Project.GetExcelPage(It.IsAny()), Times.Once()); - } - - /// - /// Make a failed request because the query doesn't contain filter values. - /// - [Fact] - public void ExportProjects_Query_NoFilter_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var service = helper.GetService>(); - - // Act - // Assert - Assert.Throws(() => controller.ExportProjects()); - service.Verify(m => m.Project.GetPage(It.IsAny()), Times.Never()); - } - - /// - /// Make a failed request because the body doesn't contain a filter object. - /// - [Fact] - public void ExportProjects_NoFilter_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var service = helper.GetService>(); - - // Act - // Assert - Assert.Throws(() => controller.ExportProjects(null)); - service.Verify(m => m.Project.GetPage(It.IsAny()), Times.Never()); - } - - /// - /// Make a failed request because the body doesn't contain a valid accept header. - /// - [Fact] - public void ExportProjects_NoAcceptHeader_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var service = helper.GetService>(); - var filter = new ProjectFilter() { }; - - // Act - // Assert - Assert.Throws(() => controller.ExportProjects(filter)); - service.Verify(m => m.Project.GetPage(It.IsAny()), Times.Never()); - } - - /// - /// Make a failed request because the body doesn't contain a valid accept header. - /// - [Fact] - public void ExportProjects_InvalidAcceptHeader_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var service = helper.GetService>(); - var headers = helper.GetService>(); - headers.Setup(m => m["Accept"]).Returns("invalid"); - var filter = new ProjectFilter() { }; - - // Act - // Assert - Assert.Throws(() => controller.ExportProjects(filter)); - service.Verify(m => m.Project.GetPage(It.IsAny()), Times.Never()); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/api/Controllers/Reports/PropertyControllerTest.cs b/backend/tests/unit/api/Controllers/Reports/PropertyControllerTest.cs deleted file mode 100644 index a8dc96a839..0000000000 --- a/backend/tests/unit/api/Controllers/Reports/PropertyControllerTest.cs +++ /dev/null @@ -1,518 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Areas.Property.Models.Search; -using Pims.Api.Areas.Reports.Controllers; -using Pims.Api.Helpers.Constants; -using Pims.Api.Helpers.Exceptions; -using Pims.Core.Test; -using Pims.Dal; -using Pims.Dal.Entities.Models; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Test.Controllers.Reports -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("group", "report")] - [Trait("group", "property")] - [ExcludeFromCodeCoverage] - public class PropertyControllerTest - { - #region Variables - public static IEnumerable AllPropertiesFilters = new List() - { - new object [] { new PropertyFilterModel(100, 0, 0, 0) }, - new object [] { new PropertyFilterModel(0, 100, 0, 0) }, - new object [] { new PropertyFilterModel(0, 0, 10, 0) }, - new object [] { new PropertyFilterModel(0, 0, 0, 10) }, - new object [] { new PropertyFilterModel(0, 0, 0, 10) { Address = "Address" } }, - new object [] { new PropertyFilterModel(0, 0, 0, 10) { Agencies = new [] { 1 } } }, - new object [] { new PropertyFilterModel(0, 0, 0, 10) { StatusId = 1 } }, - new object [] { new PropertyFilterModel(0, 0, 0, 10) { ClassificationId = 1 } }, - new object [] { new PropertyFilterModel(0, 0, 0, 10) { ProjectNumber = "ProjectNumber" } }, - new object [] { new PropertyFilterModel(0, 0, 0, 10) { AdministrativeArea = "AdministrativeArea" } } - }; - - public static IEnumerable ParcelOnlyFilters = new List() - { - new [] { new PropertyFilterModel(100, 100, 0, 0) { MinLotArea = 1 } }, - new [] { new PropertyFilterModel(100, 100, 0, 0) { MaxLotArea = 1 } }, - new [] { new PropertyFilterModel(100, 100, 0, 0) { MinLandArea = 1 } }, - new [] { new PropertyFilterModel(100, 100, 0, 0) { MaxLandArea = 1 } } - }; - - public static IEnumerable BuildingOnlyFilters = new List() - { - new [] { new PropertyFilterModel(100, 100, 0, 0) { ConstructionTypeId = 1 } }, - new [] { new PropertyFilterModel(100, 100, 0, 0) { PredominateUseId = 1 } }, - new [] { new PropertyFilterModel(100, 100, 0, 0) { FloorCount = 1 } }, - new [] { new PropertyFilterModel(100, 100, 0, 0) { Tenancy = "Tenancy" } }, - new [] { new PropertyFilterModel(100, 100, 0, 0) { MinRentableArea = 1 } }, - new [] { new PropertyFilterModel(100, 100, 0, 0) { MaxRentableArea = 1 } } - }; - - public static IEnumerable PropertyQueryFilters = new List() - { - new object [] { new Uri("http://host/api/properties?Agencies=1,2") }, - new object [] { new Uri("http://host/api/properties?StatusId=2") }, - new object [] { new Uri("http://host/api/properties?ClassificationId=1") }, - new object [] { new Uri("http://host/api/properties?Address=Address") }, - new object [] { new Uri("http://host/api/properties?ProjectNumber=ProjectNumber") }, - new object [] { new Uri("http://host/api/properties?MinLotArea=1") }, - new object [] { new Uri("http://host/api/properties?MaxLotArea=1") }, - new object [] { new Uri("http://host/api/properties?MinLandArea=1") }, - new object [] { new Uri("http://host/api/properties?MaxLandArea=1") }, - new object [] { new Uri("http://host/api/properties?ConstructionTypeId=1") }, - new object [] { new Uri("http://host/api/properties?PredominateUseId=1") }, - new object [] { new Uri("http://host/api/properties?FloorCount=1") }, - new object [] { new Uri("http://host/api/properties?Tenancy=Tenancy") }, - new object [] { new Uri("http://host/api/properties?MinRentableArea=1") }, - new object [] { new Uri("http://host/api/properties?MaxRentableArea=1") } - }; - #endregion - - #region Constructors - public PropertyControllerTest() - { - } - #endregion - - #region Tests - #region ExportProperties - /// - /// Make a successful request that includes the latitude. - /// - [Theory] - [MemberData(nameof(AllPropertiesFilters))] - public void ExportProperties_Csv_Success(PropertyFilterModel filter) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - var headers = helper.GetService>(); - headers.Setup(m => m["Accept"]).Returns(ContentTypes.CONTENT_TYPE_CSV); - - var parcel = new Entity.Parcel(1, 51, 25); - var parcels = new[] { parcel }; - var building = new Entity.Building(parcel, 51, 25); - var buildings = new[] { building }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var items = parcels.Select(p => new Entity.Views.Property(p)).Concat(buildings.Select(b => new Entity.Views.Property(b))); - var page = new Paged(items, filter.Page, filter.Quantity); - service.Setup(m => m.Property.GetPage(It.IsAny())).Returns(page); - - // Act - var result = controller.ExportProperties(filter); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Content); - Assert.Equal(ContentTypes.CONTENT_TYPE_CSV, actionResult.ContentType); - service.Verify(m => m.Property.GetPage(It.IsAny()), Times.Once()); - } - - /// - /// Make a successful request that passes the filter in the query string. - /// - [Theory] - [MemberData(nameof(PropertyQueryFilters))] - public void ExportProperties_Csv_Query_Success(Uri uri) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView, uri); - var headers = helper.GetService>(); - headers.Setup(m => m["Accept"]).Returns(ContentTypes.CONTENT_TYPE_CSV); - - var parcel1 = new Entity.Parcel(1, 51, 25) { Id = 1 }; - var parcel2 = new Entity.Parcel(2, 51, 26) { Id = 2 }; - var parcels = new[] { parcel1, parcel2 }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var items = parcels.Select(p => new Entity.Views.Property(p)); - var page = new Paged(items); - service.Setup(m => m.Property.GetPage(It.IsAny())).Returns(page); - - // Act - var result = controller.ExportProperties(); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Content); - Assert.Equal(ContentTypes.CONTENT_TYPE_CSV, actionResult.ContentType); - service.Verify(m => m.Property.GetPage(It.IsAny()), Times.Once()); - } - - /// - /// Make a successful request that includes the latitude. - /// - [Theory] - [MemberData(nameof(AllPropertiesFilters))] - public void ExportProperties_Excel_Success(PropertyFilterModel filter) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - var headers = helper.GetService>(); - headers.Setup(m => m["Accept"]).Returns(ContentTypes.CONTENT_TYPE_EXCEL); - - var parcel = new Entity.Parcel(1, 51, 25); - var parcels = new[] { parcel }; - var building = new Entity.Building(parcel, 51, 25); - var buildings = new[] { building }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var items = parcels.Select(p => new Entity.Views.Property(p)).Concat(buildings.Select(b => new Entity.Views.Property(b))); - var page = new Paged(items, filter.Page, filter.Quantity); - service.Setup(m => m.Property.GetPage(It.IsAny())).Returns(page); - - // Act - var result = controller.ExportProperties(filter); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Equal(ContentTypes.CONTENT_TYPE_EXCELX, actionResult.ContentType); - Assert.NotNull(actionResult.FileDownloadName); - Assert.True(actionResult.FileStream.Length > 0); - service.Verify(m => m.Property.GetPage(It.IsAny()), Times.Once()); - } - - /// - /// Make a successful request that passes the filter in the query string. - /// - [Theory] - [MemberData(nameof(PropertyQueryFilters))] - public void ExportProperties_Excel_Query_Success(Uri uri) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView, uri); - var headers = helper.GetService>(); - headers.Setup(m => m["Accept"]).Returns(ContentTypes.CONTENT_TYPE_EXCEL); - - var parcel1 = new Entity.Parcel(1, 51, 25) { Id = 1 }; - var parcel2 = new Entity.Parcel(2, 51, 26) { Id = 2 }; - var parcels = new[] { parcel1, parcel2 }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var items = parcels.Select(p => new Entity.Views.Property(p)); - var page = new Paged(items); - service.Setup(m => m.Property.GetPage(It.IsAny())).Returns(page); - - // Act - var result = controller.ExportProperties(); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Equal(ContentTypes.CONTENT_TYPE_EXCELX, actionResult.ContentType); - Assert.NotNull(actionResult.FileDownloadName); - Assert.True(actionResult.FileStream.Length > 0); - service.Verify(m => m.Property.GetPage(It.IsAny()), Times.Once()); - } - - /// - /// Make a successful request that includes the latitude. - /// - [Theory] - [MemberData(nameof(AllPropertiesFilters))] - public void ExportProperties_ExcelX_Success(PropertyFilterModel filter) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - var headers = helper.GetService>(); - headers.Setup(m => m["Accept"]).Returns(ContentTypes.CONTENT_TYPE_EXCELX); - - var parcel = new Entity.Parcel(1, 51, 25); - var parcels = new[] { parcel }; - var building = new Entity.Building(parcel, 51, 25); - var buildings = new[] { building }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var items = parcels.Select(p => new Entity.Views.Property(p)).Concat(buildings.Select(b => new Entity.Views.Property(b))); - var page = new Paged(items, filter.Page, filter.Quantity); - service.Setup(m => m.Property.GetPage(It.IsAny())).Returns(page); - - // Act - var result = controller.ExportProperties(filter); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Equal(ContentTypes.CONTENT_TYPE_EXCELX, actionResult.ContentType); - Assert.NotNull(actionResult.FileDownloadName); - Assert.True(actionResult.FileStream.Length > 0); - service.Verify(m => m.Property.GetPage(It.IsAny()), Times.Once()); - } - - /// - /// Make a successful request that passes the filter in the query string. - /// - [Theory] - [MemberData(nameof(PropertyQueryFilters))] - public void ExportProperties_ExcelX_Query_Success(Uri uri) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView, uri); - var headers = helper.GetService>(); - headers.Setup(m => m["Accept"]).Returns(ContentTypes.CONTENT_TYPE_EXCELX); - - var parcel1 = new Entity.Parcel(1, 51, 25) { Id = 1 }; - var parcel2 = new Entity.Parcel(2, 51, 26) { Id = 2 }; - var parcels = new[] { parcel1, parcel2 }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var items = parcels.Select(p => new Entity.Views.Property(p)); - var page = new Paged(items); - service.Setup(m => m.Property.GetPage(It.IsAny())).Returns(page); - - // Act - var result = controller.ExportProperties(); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Equal(ContentTypes.CONTENT_TYPE_EXCELX, actionResult.ContentType); - Assert.NotNull(actionResult.FileDownloadName); - Assert.True(actionResult.FileStream.Length > 0); - service.Verify(m => m.Property.GetPage(It.IsAny()), Times.Once()); - } - - /// - /// Make a failed request because the query doesn't contain filter values. - /// - [Fact] - public void ExportProperties_Query_NoFilter_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var service = helper.GetService>(); - - // Act - // Assert - Assert.Throws(() => controller.ExportProperties()); - service.Verify(m => m.Property.GetPage(It.IsAny()), Times.Never()); - } - - /// - /// Make a failed request because the body doesn't contain a filter object. - /// - [Fact] - public void ExportProperties_NoFilter_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var service = helper.GetService>(); - - // Act - // Assert - Assert.Throws(() => controller.ExportProperties(null)); - service.Verify(m => m.Property.GetPage(It.IsAny()), Times.Never()); - } - - /// - /// Make a failed request because the body doesn't contain a valid accept header. - /// - [Fact] - public void ExportProperties_NoAcceptHeader_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var service = helper.GetService>(); - var filter = new PropertyFilterModel(100, 0, 0, 0) { StatusId = 1 }; - - // Act - // Assert - Assert.Throws(() => controller.ExportProperties(filter)); - service.Verify(m => m.Property.GetPage(It.IsAny()), Times.Never()); - } - - /// - /// Make a failed request because the body doesn't contain a valid accept header. - /// - [Fact] - public void ExportProperties_InvalidAcceptHeader_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var service = helper.GetService>(); - var headers = helper.GetService>(); - headers.Setup(m => m["Accept"]).Returns("invalid"); - var filter = new PropertyFilterModel(100, 0, 0, 0) { StatusId = 1 }; - - // Act - // Assert - Assert.Throws(() => controller.ExportProperties(filter)); - service.Verify(m => m.Property.GetPage(It.IsAny()), Times.Never()); - } - #endregion - #region ExportAllProperties - /// - /// Make a successful request that includes the latitude. - /// - [Theory] - [MemberData(nameof(AllPropertiesFilters))] - public void ExportPropertiesAllFields_ExcelX_Success(PropertyFilterModel filter) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - var headers = helper.GetService>(); - headers.Setup(m => m["Accept"]).Returns(ContentTypes.CONTENT_TYPE_EXCELX); - - var parcel = new Entity.Parcel(1, 51, 25); - var parcels = new[] { parcel }; - var building = new Entity.Building(parcel, 51, 25); - var buildings = new[] { building }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var items = parcels.Select(p => new Entity.Views.Property(p)).Concat(buildings.Select(b => new Entity.Views.Property(b))); - var page = new Paged(items, filter.Page, filter.Quantity); - service.Setup(m => m.Property.GetPage(It.IsAny())).Returns(page); - - // Act - var result = controller.ExportPropertiesAllFields(filter); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Equal(ContentTypes.CONTENT_TYPE_EXCELX, actionResult.ContentType); - Assert.NotNull(actionResult.FileDownloadName); - Assert.True(actionResult.FileStream.Length > 0); - service.Verify(m => m.Property.GetPage(It.IsAny()), Times.Once()); - } - - /// - /// Make a successful request that passes the filter in the query string. - /// - [Theory] - [MemberData(nameof(PropertyQueryFilters))] - public void ExportPropertiesAllFields_ExcelX_Query_Success(Uri uri) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView, uri); - var headers = helper.GetService>(); - headers.Setup(m => m["Accept"]).Returns(ContentTypes.CONTENT_TYPE_EXCELX); - - var parcel1 = new Entity.Parcel(1, 51, 25) { Id = 1 }; - var parcel2 = new Entity.Parcel(2, 51, 26) { Id = 2 }; - var parcels = new[] { parcel1, parcel2 }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var items = parcels.Select(p => new Entity.Views.Property(p)); - var page = new Paged(items); - service.Setup(m => m.Property.GetPage(It.IsAny())).Returns(page); - - // Act - var result = controller.ExportPropertiesAllFields(); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Equal(ContentTypes.CONTENT_TYPE_EXCELX, actionResult.ContentType); - Assert.NotNull(actionResult.FileDownloadName); - Assert.True(actionResult.FileStream.Length > 0); - service.Verify(m => m.Property.GetPage(It.IsAny()), Times.Once()); - } - - /// - /// Make a failed request because the query doesn't contain filter values. - /// - [Fact] - public void ExportPropertiesAllFields_Query_NoFilter_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var service = helper.GetService>(); - - // Act - // Assert - Assert.Throws(() => controller.ExportPropertiesAllFields()); - service.Verify(m => m.Property.GetPage(It.IsAny()), Times.Never()); - } - - /// - /// Make a failed request because the body doesn't contain a filter object. - /// - [Fact] - public void ExportPropertiesAllFields_NoFilter_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var service = helper.GetService>(); - - // Act - // Assert - Assert.Throws(() => controller.ExportPropertiesAllFields(null)); - service.Verify(m => m.Property.GetPage(It.IsAny()), Times.Never()); - } - - /// - /// Make a failed request because the body doesn't contain a valid accept header. - /// - [Fact] - public void EExportPropertiesAllFields_NoAcceptHeader_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var service = helper.GetService>(); - var filter = new PropertyFilterModel(100, 0, 0, 0) { StatusId = 1 }; - - // Act - // Assert - Assert.Throws(() => controller.ExportPropertiesAllFields(filter)); - service.Verify(m => m.Property.GetPage(It.IsAny()), Times.Never()); - } - - /// - /// Make a failed request because the body doesn't contain a valid accept header. - /// - [Fact] - public void ExportPropertiesAllFields_InvalidAcceptHeader_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var service = helper.GetService>(); - var headers = helper.GetService>(); - headers.Setup(m => m["Accept"]).Returns("invalid"); - var filter = new PropertyFilterModel(100, 0, 0, 0) { StatusId = 1 }; - - // Act - // Assert - Assert.Throws(() => controller.ExportPropertiesAllFields(filter)); - service.Verify(m => m.Property.GetPage(It.IsAny()), Times.Never()); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/api/Controllers/Reports/UserControllerTest.cs b/backend/tests/unit/api/Controllers/Reports/UserControllerTest.cs deleted file mode 100644 index 4e06312454..0000000000 --- a/backend/tests/unit/api/Controllers/Reports/UserControllerTest.cs +++ /dev/null @@ -1,329 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Areas.Reports.Controllers; -using Pims.Api.Helpers.Constants; -using Pims.Api.Helpers.Exceptions; -using Pims.Core.Test; -using Pims.Dal.Entities.Models; -using Pims.Dal.Security; -using Pims.Dal.Services.Admin; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Test.Controllers.Reports -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("group", "report")] - [Trait("group", "property")] - [ExcludeFromCodeCoverage] - public class UserControllerTest - { - #region Variables - public static IEnumerable AllPropertiesFilters = new List() - { - new object [] { new UserFilter(1, 100) }, - new object [] { new UserFilter(1, 100) { Username = "username" } }, - new object [] { new UserFilter(1, 100) { DisplayName = "firstname, lastname" } }, - new object [] { new UserFilter(1, 100) { FirstName = "firstname" } }, - new object [] { new UserFilter(1, 100) { LastName = "lastname" } }, - new object [] { new UserFilter(1, 100) { Email = "email" } }, - new object [] { new UserFilter(1, 100) { IsDisabled = false } }, - new object [] { new UserFilter(1, 100) { Position = "position" } }, - new object [] { new UserFilter(1, 100) { Role = "role" } }, - }; - - public static IEnumerable PropertyQueryFilters = new List() - { - new object [] { new Uri("http://host/api/users?Username=test") }, - new object [] { new Uri("http://host/api/users?DisplayName=test") }, - new object [] { new Uri("http://host/api/users?FirstName=test") }, - new object [] { new Uri("http://host/api/users?LastName=test") }, - new object [] { new Uri("http://host/api/users?LastName=test") }, - new object [] { new Uri("http://host/api/users?Email=test") }, - new object [] { new Uri("http://host/api/users?IsDisabled=false") }, - new object [] { new Uri("http://host/api/users?Position=test") }, - new object [] { new Uri("http://host/api/users?Role=test") }, - }; - #endregion - - #region Constructors - public UserControllerTest() - { - } - #endregion - - #region Tests - #region ExportUsers - /// - /// Make a successful request that includes the latitude. - /// - [Theory] - [MemberData(nameof(AllPropertiesFilters))] - public void ExportUsers_Csv_Success(UserFilter filter) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - var headers = helper.GetService>(); - headers.Setup(m => m["Accept"]).Returns(ContentTypes.CONTENT_TYPE_CSV); - - var user = new Entity.User(Guid.NewGuid(), "username", "email", "firstname", "lastname"); - var users = new[] { user }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var page = new Paged(users, filter.Page, filter.Quantity); - service.Setup(m => m.User.Get(It.IsAny())).Returns(page); - - // Act - var result = controller.ExportUsers(filter); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Content); - Assert.Equal(ContentTypes.CONTENT_TYPE_CSV, actionResult.ContentType); - service.Verify(m => m.User.Get(It.IsAny()), Times.Once()); - } - - /// - /// Make a successful request that passes the filter in the query string. - /// - [Fact] - public void ExportUsers_Csv_Query_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - var headers = helper.GetService>(); - headers.Setup(m => m["Accept"]).Returns(ContentTypes.CONTENT_TYPE_CSV); - - var user = new Entity.User(Guid.NewGuid(), "username", "email", "firstname", "lastname"); - var users = new[] { user }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var page = new Paged(users); - service.Setup(m => m.User.Get(It.IsAny())).Returns(page); - - // Act - var result = controller.ExportUsers(); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Content); - Assert.Equal(ContentTypes.CONTENT_TYPE_CSV, actionResult.ContentType); - service.Verify(m => m.User.Get(It.IsAny()), Times.Once()); - } - - /// - /// Make a successful request that includes the latitude. - /// - [Theory] - [MemberData(nameof(AllPropertiesFilters))] - public void ExportUsers_Excel_Success(UserFilter filter) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - var headers = helper.GetService>(); - headers.Setup(m => m["Accept"]).Returns(ContentTypes.CONTENT_TYPE_EXCEL); - - var user = new Entity.User(Guid.NewGuid(), "username", "email", "firstname", "lastname"); - var users = new[] { user }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var page = new Paged(users, filter.Page, filter.Quantity); - service.Setup(m => m.User.Get(It.IsAny())).Returns(page); - - // Act - var result = controller.ExportUsers(filter); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Equal(ContentTypes.CONTENT_TYPE_EXCELX, actionResult.ContentType); - Assert.NotNull(actionResult.FileDownloadName); - Assert.True(actionResult.FileStream.Length > 0); - service.Verify(m => m.User.Get(It.IsAny()), Times.Once()); - } - - /// - /// Make a successful request that passes the filter in the query string. - /// - [Theory] - [MemberData(nameof(PropertyQueryFilters))] - public void ExportUsers_Excel_Query_Success(Uri uri) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView, uri); - var headers = helper.GetService>(); - headers.Setup(m => m["Accept"]).Returns(ContentTypes.CONTENT_TYPE_EXCEL); - - var user = new Entity.User(Guid.NewGuid(), "username", "email", "firstname", "lastname"); - var users = new[] { user }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var page = new Paged(users); - service.Setup(m => m.User.Get(It.IsAny())).Returns(page); - - // Act - var result = controller.ExportUsers(); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Equal(ContentTypes.CONTENT_TYPE_EXCELX, actionResult.ContentType); - Assert.NotNull(actionResult.FileDownloadName); - Assert.True(actionResult.FileStream.Length > 0); - service.Verify(m => m.User.Get(It.IsAny()), Times.Once()); - } - - /// - /// Make a successful request that includes the latitude. - /// - [Theory] - [MemberData(nameof(AllPropertiesFilters))] - public void ExportUsers_ExcelX_Success(UserFilter filter) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - var headers = helper.GetService>(); - headers.Setup(m => m["Accept"]).Returns(ContentTypes.CONTENT_TYPE_EXCELX); - - var user = new Entity.User(Guid.NewGuid(), "username", "email", "firstname", "lastname"); - var users = new[] { user }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var page = new Paged(users, filter.Page, filter.Quantity); - service.Setup(m => m.User.Get(It.IsAny())).Returns(page); - - // Act - var result = controller.ExportUsers(filter); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Equal(ContentTypes.CONTENT_TYPE_EXCELX, actionResult.ContentType); - Assert.NotNull(actionResult.FileDownloadName); - Assert.True(actionResult.FileStream.Length > 0); - service.Verify(m => m.User.Get(It.IsAny()), Times.Once()); - } - - /// - /// Make a successful request that passes the filter in the query string. - /// - [Theory] - [MemberData(nameof(PropertyQueryFilters))] - public void ExportUsers_ExcelX_Query_Success(Uri uri) - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView, uri); - var headers = helper.GetService>(); - headers.Setup(m => m["Accept"]).Returns(ContentTypes.CONTENT_TYPE_EXCELX); - - var user = new Entity.User(Guid.NewGuid(), "username", "email", "firstname", "lastname"); - var users = new[] { user }; - - var service = helper.GetService>(); - var mapper = helper.GetService(); - var page = new Paged(users); - service.Setup(m => m.User.Get(It.IsAny())).Returns(page); - - // Act - var result = controller.ExportUsers(); - - // Assert - var actionResult = Assert.IsType(result); - Assert.Equal(ContentTypes.CONTENT_TYPE_EXCELX, actionResult.ContentType); - Assert.NotNull(actionResult.FileDownloadName); - Assert.True(actionResult.FileStream.Length > 0); - service.Verify(m => m.User.Get(It.IsAny()), Times.Once()); - } - - /// - /// Make a failed request because the query doesn't contain filter values. - /// - [Fact] - public void ExportUsers_Query_NoFilter_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var service = helper.GetService>(); - - // Act - // Assert - Assert.Throws(() => controller.ExportUsers()); - service.Verify(m => m.User.Get(It.IsAny()), Times.Never()); - } - - /// - /// Make a failed request because the body doesn't contain a filter object. - /// - [Fact] - public void ExportUsers_NoFilter_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var service = helper.GetService>(); - - // Act - // Assert - Assert.Throws(() => controller.ExportUsers(null)); - service.Verify(m => m.User.Get(It.IsAny()), Times.Never()); - } - - /// - /// Make a failed request because the body doesn't contain a valid accept header. - /// - [Fact] - public void ExportUsers_NoAcceptHeader_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var service = helper.GetService>(); - var filter = new UserFilter() { }; - - // Act - // Assert - Assert.Throws(() => controller.ExportUsers(filter)); - service.Verify(m => m.User.Get(It.IsAny()), Times.Never()); - } - - /// - /// Make a failed request because the body doesn't contain a valid accept header. - /// - [Fact] - public void ExportUsers_InvalidAcceptHeader_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var service = helper.GetService>(); - var headers = helper.GetService>(); - headers.Setup(m => m["Accept"]).Returns("invalid"); - var filter = new UserFilter() { }; - - // Act - // Assert - Assert.Throws(() => controller.ExportUsers(filter)); - service.Verify(m => m.User.Get(It.IsAny()), Times.Never()); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/api/Controllers/Tools/ChesControllerTest.cs b/backend/tests/unit/api/Controllers/Tools/ChesControllerTest.cs deleted file mode 100644 index d31e4f33e6..0000000000 --- a/backend/tests/unit/api/Controllers/Tools/ChesControllerTest.cs +++ /dev/null @@ -1,145 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Areas.Tools.Controllers; -using Pims.Ches; -using Pims.Core.Test; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Model = Pims.Ches.Models; - -namespace Pims.Api.Test.Controllers.Tools -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "tools")] - [Trait("group", "geocoder")] - [ExcludeFromCodeCoverage] - public class ChesControllerTest - { - #region Variables - #endregion - - #region Constructors - public ChesControllerTest() { } - #endregion - - #region Tests - #region GetStatusAsync - [Fact] - public async void GetStatusAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyEdit); - - var response = new Model.StatusResponseModel() - { - TransactionId = Guid.NewGuid(), - MessageId = Guid.NewGuid(), - CreatedOn = DateTime.UtcNow, - Status = "pending", - SendOn = DateTime.UtcNow - }; - - var service = helper.GetService>(); - service.Setup(m => m.GetStatusAsync(It.IsAny())).ReturnsAsync(response); - - // Act - var result = await controller.GetStatusAsync(response.MessageId); - - // Assert - JsonResult actionResult = Assert.IsType(result); - var results = Assert.IsAssignableFrom(actionResult.Value); - } - - [Fact] - public async void GetStatusAsync_Post_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyEdit); - - var filter = new Model.StatusModel(); - var response = new[] { - new Model.StatusResponseModel() - { - TransactionId = Guid.NewGuid(), - MessageId = Guid.NewGuid(), - CreatedOn = DateTime.UtcNow, - Status = "pending", - SendOn = DateTime.UtcNow - } - }; - - var service = helper.GetService>(); - service.Setup(m => m.GetStatusAsync(It.IsAny())).ReturnsAsync(response); - - // Act - var result = await controller.GetStatusAsync(filter); - - // Assert - JsonResult actionResult = Assert.IsType(result); - var results = Assert.IsAssignableFrom>(actionResult.Value); - } - #endregion - - #region CancelEmailAsync - [Fact] - public async void CancelEmailAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyEdit); - - var response = new Model.StatusResponseModel() - { - TransactionId = Guid.NewGuid(), - MessageId = Guid.NewGuid(), - Status = "cancelled" - }; - - var service = helper.GetService>(); - service.Setup(m => m.CancelEmailAsync(It.IsAny())).ReturnsAsync(response); - - // Act - var result = await controller.CancelEmailAsync(response.MessageId); - - // Assert - JsonResult actionResult = Assert.IsType(result); - var results = Assert.IsAssignableFrom(actionResult.Value); - } - - [Fact] - public async void CancelEmailAsync_Post_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyEdit); - - var filter = new Model.StatusModel(); - var response = new[] { - new Model.StatusResponseModel() - { - TransactionId = Guid.NewGuid(), - MessageId = Guid.NewGuid(), - Status = "cancelled" - } - }; - - var service = helper.GetService>(); - service.Setup(m => m.CancelEmailAsync(It.IsAny())).ReturnsAsync(response); - - // Act - var result = await controller.CancelEmailAsync(filter); - - // Assert - JsonResult actionResult = Assert.IsType(result); - var results = Assert.IsAssignableFrom>(actionResult.Value); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/api/Controllers/Tools/GeocoderControllerTest.cs b/backend/tests/unit/api/Controllers/Tools/GeocoderControllerTest.cs deleted file mode 100644 index 1b3cbac3d1..0000000000 --- a/backend/tests/unit/api/Controllers/Tools/GeocoderControllerTest.cs +++ /dev/null @@ -1,116 +0,0 @@ -using FluentAssertions; -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Areas.Tools.Controllers; -using Pims.Core.Test; -using Pims.Dal.Security; -using Pims.Geocoder; -using Pims.Geocoder.Models; -using Pims.Geocoder.Parameters; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Xunit; -using Model = Pims.Api.Areas.Tools.Models.Geocoder; - -namespace Pims.Api.Test.Controllers.Tools -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "tools")] - [Trait("group", "geocoder")] - [ExcludeFromCodeCoverage] - public class GeocoderControllerTest - { - #region Variables - #endregion - - #region Constructors - public GeocoderControllerTest() { } - #endregion - - #region Tests - #region FindAddressesAsync - [Fact] - public async void FindAddressesAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyEdit); - - var addresses = new FeatureCollectionModel() - { - Features = new[] - { - new FeatureModel() - { - Properties = new PropertyModel() - { - Score = 1, - SiteID = "test", - FullAddress = "test", - ProvinceCode = "test", - CivicNumber = "test", - StreetName = "test", - LocalityName = "test", - LocalityType = "City" - }, - Geometry = new GeometryModel() { Coordinates = new [] { 2d, 1d } } - } - } - }; - - var service = helper.GetService>(); - service.Setup(m => m.GetSiteAddressesAsync(It.IsAny(), It.IsAny())).ReturnsAsync(addresses); - - // Act - var result = await controller.FindAddressesAsync("test"); - - // Assert - JsonResult actionResult = Assert.IsType(result); - var results = Assert.IsAssignableFrom>(actionResult.Value); - results.Should().HaveCount(1); - var first = results.First(); - first.Score.Should().Be(1); - first.SiteId.Should().Be("test"); - first.FullAddress.Should().Be("test"); - first.ProvinceCode.Should().Be("test"); - first.Address1.Should().Be("test test"); - first.Latitude.Should().Be(1d); - first.Longitude.Should().Be(2d); - } - #endregion - - # region FindPidsAsync - [Fact] - public async void FindPidsAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyEdit); - - var testSiteId = Guid.NewGuid(); - var response = new SitePidsResponseModel() - { - SiteID = testSiteId, - Pids = "test1,test2" - }; - - var service = helper.GetService>(); - service.Setup(m => m.GetPids(It.IsAny(), It.IsAny())).ReturnsAsync(response); - - // Act - var result = await controller.FindPidsAsync(testSiteId); - - // Assert - JsonResult actionResult = Assert.IsType(result); - var results = Assert.IsAssignableFrom(actionResult.Value); - results.SiteId.Should().Be(testSiteId); - results.Pids.Should().HaveCount(2); - results.Pids.First().Should().Be("test1"); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/api/Controllers/Tools/ImportControllerTest.cs b/backend/tests/unit/api/Controllers/Tools/ImportControllerTest.cs deleted file mode 100644 index a62997e85b..0000000000 --- a/backend/tests/unit/api/Controllers/Tools/ImportControllerTest.cs +++ /dev/null @@ -1,2157 +0,0 @@ -using FluentAssertions; -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Areas.Tools.Controllers; -using Pims.Core.Extensions; -using Pims.Core.Helpers; -using Pims.Core.Test; -using Pims.Dal; -using Pims.Dal.Entities; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using Pims.Dal.Services.Admin; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Text.Json; -using Xunit; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Areas.Tools.Models.Import; - -namespace Pims.Api.Test.Controllers.Tools -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "tools")] - [Trait("group", "import")] - [ExcludeFromCodeCoverage] - public class ImportControllerTest - { - #region Variables - #endregion - - #region Constructors - public ImportControllerTest() { } - #endregion - - #region Tests - #region ImportPropertyFinancials - [Fact] - public void ImportPropertyFinancials_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var property = new[] - { - new Model.ImportPropertyModel() - { - ParcelId = "123-123-123", - PID = "123-123-123", - LocalId = "test", - PropertyType = "Land", - AgencyCode = "AEST", - SubAgency = "School", - FiscalYear = 2020, - Assessed = 400000.00M, - Classification = "Classification", - Status = "Active", - CivicAddress = "test", - City = "test", - Postal = "T9T9T9", - LandArea = 45.55f, - NetBook = 333000.00M - } - }; - - var property2 = new[] - { - new Model.ImportPropertyModel() - { - ParcelId = "123-123-123", - PID = "123-123-123", - LocalId = "test", - PropertyType = "Building", - AgencyCode = "AEST", - SubAgency = "School", - FiscalYear = 2020, - Assessed = 150000.00M, - Classification = "Classification", - Status = "Active", - CivicAddress = "test", - City = "test", - Postal = "T9T9T9", - LandArea = 40.55f, - NetBook = 103000.00M - } - }; - - var parcel = new Entity.Parcel() - { - Id = 123123123 - }; - - var building = new Entity.Building() { Id = 1, PropertyTypeId = 1 }; - - var service = helper.GetService>(); - service.Setup(m => m.BuildingConstructionType.GetAll()).Returns(new Entity.BuildingConstructionType[0]); - service.Setup(m => m.BuildingPredominateUse.GetAll()).Returns(new Entity.BuildingPredominateUse[0]); - service.Setup(m => m.PropertyClassification.GetAll()).Returns(new[] { new Entity.PropertyClassification(1, "Classification") }); - service.Setup(m => m.Agency.GetAll()).Returns(new[] { new Entity.Agency("AEST", "Advanced Education, Skills & Training") }); - service.Setup(m => m.Parcel.GetByPid(It.IsAny())).Returns(parcel); service.Setup(m => m.Building.GetByPid(It.IsAny(), It.IsAny())) - .Returns((int pid, string name) => new List { building }); - service.Setup(m => m.AdministrativeArea.Get(It.IsAny())).Returns(new Entity.AdministrativeArea("test")); - - // Act - var result = controller.ImportPropertyFinancials(property); - var result2 = controller.ImportPropertyFinancials(property2); - - // Assert - JsonResult actionResult = Assert.IsType(result); - var parcelData = Assert.IsAssignableFrom(actionResult.Value); - var buildingData = Assert.IsAssignableFrom(actionResult.Value); - Assert.Equal(parcel.Evaluations.First().Value, parcelData[0].Evaluations.First().Value); - Assert.Equal(parcel.Evaluations.First().Value, parcelData[0].Evaluations.First().Value); - } - - #endregion - - - - #region ImportProperties - [Fact] - public void ImportProperties_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var properties = Enumerable.Range(0, 101).Select(i => new Model.ImportPropertyModel()).ToArray(); - - // Act - var result = controller.ImportProperties(properties); - - // Assert - Assert.NotNull(result); - var actionResult = Assert.IsType(result); - } - - [Fact] - public void ImportProperties_UpdateParcel_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var properties = new[] - { - new Model.ImportPropertyModel() - { - ParcelId = "123-123-123", - PID = "123-123-123", - LocalId = "test", - PropertyType = "Land", - AgencyCode = "AEST", - SubAgency = "", - FiscalYear = 2020, - Assessed = 0, - Classification = "Classification", - Status = "Active", - CivicAddress = "test", - City = "test", - Postal = "T9T9T9", - LandArea = 45.55f - } - }; - - var parcel = new Entity.Parcel() - { - Id = 123123123 - }; - - var service = helper.GetService>(); - service.Setup(m => m.BuildingConstructionType.GetAll()).Returns(new Entity.BuildingConstructionType[0]); - service.Setup(m => m.BuildingPredominateUse.GetAll()).Returns(new Entity.BuildingPredominateUse[0]); - service.Setup(m => m.PropertyClassification.GetAll()).Returns(new[] { new Entity.PropertyClassification(1, "Classification") }); - service.Setup(m => m.Agency.GetAll()).Returns(new[] { new Entity.Agency("AEST", "Advanced Education, Skills & Training") }); - service.Setup(m => m.Parcel.GetByPidWithoutTracking(It.IsAny())).Returns(parcel); - service.Setup(m => m.AdministrativeArea.Get(It.IsAny())).Returns(new Entity.AdministrativeArea("test")); - service.Setup(m => m.Parcel.IsPidAvailable(It.IsAny())).Returns(true); - - // Act - var result = controller.ImportProperties(properties); - - // Assert - JsonResult actionResult = Assert.IsType(result); - var data = Assert.IsAssignableFrom>(actionResult.Value); - Assert.True(data.First().Added); - Assert.False(data.First().Updated); - Assert.Equal(properties.First().ParcelId, data.First().PID); - service.Verify(m => m.BuildingConstructionType.GetAll(), Times.Once()); - service.Verify(m => m.BuildingPredominateUse.GetAll(), Times.Once()); - service.Verify(m => m.PropertyClassification.GetAll(), Times.Once()); - service.Verify(m => m.AdministrativeArea.Get(It.IsAny()), Times.Once()); - service.Verify(m => m.Agency.GetAll(), Times.Once()); - service.Verify(m => m.Parcel.Update(It.IsAny()), Times.Once()); - } - - [Fact] - public void ImportProperties_InvalidAgency_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var properties = new[] - { - new Model.ImportPropertyModel() - { - ParcelId = "123-123-123", - PID = "123-123-123", - LocalId = "test", - PropertyType = "Land", - AgencyCode = "AESTT", - SubAgency = "School", - FiscalYear = 2020, - Assessed = 0, - Classification = "Classification", - Status = "Active", - CivicAddress = "test", - City = "test", - Postal = "T9T9T9", - LandArea = 45.55f - } - }; - - var parcel = new Entity.Parcel() - { - Id = 123123123 - }; - - var service = helper.GetService>(); - service.Setup(m => m.BuildingConstructionType.GetAll()).Returns(new Entity.BuildingConstructionType[0]); - service.Setup(m => m.BuildingPredominateUse.GetAll()).Returns(new Entity.BuildingPredominateUse[0]); - service.Setup(m => m.PropertyClassification.GetAll()).Returns(new[] { new Entity.PropertyClassification(1, "Classification") }); - service.Setup(m => m.Agency.GetAll()).Returns(new[] { new Entity.Agency("AEST", "Advanced Education, Skills & Training") }); - service.Setup(m => m.Parcel.GetByPidWithoutTracking(It.IsAny())).Returns(parcel); - service.Setup(m => m.AdministrativeArea.Get(It.IsAny())).Returns(new Entity.AdministrativeArea("test")); - service.Setup(m => m.Parcel.IsPidAvailable(It.IsAny())).Returns(true); - - var result = controller.ImportProperties(properties); - JsonResult actionResult = Assert.IsType(result); - var data = Assert.IsAssignableFrom>(actionResult.Value); - Assert.False(data.First().Added); - Assert.False(data.First().Updated); - Assert.True(data.First().Error != null); - } - - [Fact] - public void ImportProperties_Parcel_InvalidPID_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var properties = new[] - { - new Model.ImportPropertyModel() - { - ParcelId = "", - PID = "", - LocalId = "test", - PropertyType = "Land", - AgencyCode = "AEST", - SubAgency = "School", - FiscalYear = 2020, - Assessed = 0, - Classification = "Classification", - Status = "Active", - CivicAddress = "test", - City = "test", - Postal = "T9T9T9", - LandArea = 45.55f - } - }; - - var parcel = new Entity.Parcel() - { - Id = 123123123 - }; - - var service = helper.GetService>(); - service.Setup(m => m.BuildingConstructionType.GetAll()).Returns(new Entity.BuildingConstructionType[0]); - service.Setup(m => m.BuildingPredominateUse.GetAll()).Returns(new Entity.BuildingPredominateUse[0]); - service.Setup(m => m.PropertyClassification.GetAll()).Returns(new[] { new Entity.PropertyClassification(1, "Classification") }); - service.Setup(m => m.Agency.GetAll()).Returns(new[] { new Entity.Agency("AEST", "Advanced Education, Skills & Training") }); - service.Setup(m => m.AdministrativeArea.Get(It.IsAny())).Returns(new Entity.AdministrativeArea("test")); - - // Act - var result = controller.ImportProperties(properties); - - // Assert - JsonResult actionResult = Assert.IsType(result); - var data = Assert.IsAssignableFrom>(actionResult.Value); - Assert.Contains("Invalid or missing PID", data.First().Error.ToString()); - Assert.False(data.First().Added); - Assert.False(data.First().Updated); - } - - [Fact] - public void ImportProperties_Building_InvalidPID_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var properties = new[] - { - new Model.ImportPropertyModel() - { - ParcelId = "", - PID = "abcd", - LocalId = "test", - PropertyType = "Building", - AgencyCode = "AEST", - SubAgency = "School", - FiscalYear = 2020, - Assessed = 0, - Classification = "Classification", - Status = "Active", - CivicAddress = "test", - City = "test", - Postal = "T9T9T9", - LandArea = 45.55f - } - }; - - var service = helper.GetService>(); - service.Setup(m => m.BuildingConstructionType.GetAll()).Returns(new Entity.BuildingConstructionType[0]); - service.Setup(m => m.BuildingPredominateUse.GetAll()).Returns(new Entity.BuildingPredominateUse[0]); - service.Setup(m => m.PropertyClassification.GetAll()).Returns(new[] { new Entity.PropertyClassification(1, "Classification") }); - service.Setup(m => m.Agency.GetAll()).Returns(new[] { new Entity.Agency("AEST", "Advanced Education, Skills & Training") }); - service.Setup(m => m.AdministrativeArea.Get(It.IsAny())).Returns(new Entity.AdministrativeArea("test")); - - // Act - var result = controller.ImportProperties(properties); - - // Assert - JsonResult actionResult = Assert.IsType(result); - var data = Assert.IsAssignableFrom>(actionResult.Value); - Assert.Contains("Invalid or missing PID", data.First().Error.ToString()); - Assert.False(data.First().Added); - Assert.False(data.First().Updated); - } - - [Fact] - public void ImportProperties_AddBuilding_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var properties = new[] - { - new Model.ImportPropertyModel() - { - LocalId = "test", - PropertyType = "Building", - AgencyCode = "AEST", - SubAgency = "", - FiscalYear = 2020, - Assessed = 0, - BuildingPredominateUse = "School", - BuildingConstructionType = "Concrete", - Classification = "Surplus Active", - Status = "Active", - CivicAddress = "123 test st", - City = "test", - Postal = "T9T9T9", - LandArea = 45.55f, - Latitude = 49.11539986447944, - Longitude = 49.21539986447944, - Name = "test" - } - }; - - var building = new Entity.Building() { Id = 1, PropertyTypeId = 1 }; - - var service = helper.GetService>(); - service.Setup(m => m.BuildingConstructionType.GetAll()).Returns(new[] { new Entity.BuildingConstructionType(1, "Concrete") }); - service.Setup(m => m.BuildingPredominateUse.GetAll()).Returns(new[] { new Entity.BuildingPredominateUse(1, "School") }); - service.Setup(m => m.PropertyClassification.GetAll()).Returns(new[] { new Entity.PropertyClassification(1, "Surplus Active") }); - service.Setup(m => m.Agency.GetAll()).Returns(new[] { new Entity.Agency("AEST", "Advanced Education, Skills & Training") }); - service.Setup(m => m.Building.GetByNameAddressWithoutTracking(It.IsAny(), It.IsAny())) - .Returns((string name, string address) => new List - { }); - service.Setup(m => m.AdministrativeArea.Get(It.IsAny())).Returns(new Entity.AdministrativeArea("test")); - - // Act - var result = controller.ImportProperties(properties); - - // Assert - JsonResult actionResult = Assert.IsType(result); - var data = Assert.IsAssignableFrom>(actionResult.Value); - Assert.Equal(properties.First().ParcelId, data.First().PID); - Assert.True(data.First().Added); - Assert.False(data.First().Updated); - service.Verify(m => m.BuildingConstructionType.GetAll(), Times.Once()); - service.Verify(m => m.BuildingPredominateUse.GetAll(), Times.Once()); - service.Verify(m => m.PropertyClassification.GetAll(), Times.Once()); - service.Verify(m => m.Agency.GetAll(), Times.Once()); - service.Verify(m => m.Building.Add(It.IsAny()), Times.Once()); - } - - [Fact] - public void ImportProperties_AddBuildingException_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var properties = new[] - { - new Model.ImportPropertyModel() - { - LocalId = "test", - PropertyType = "Building", - AgencyCode = "AEST", - FiscalYear = 2020, - Assessed = 0, - BuildingPredominateUse = "School", - BuildingConstructionType = "Concrete", - Classification = "Surplus Active", - Status = "Active", - CivicAddress = "123 test st", - City = "test", - Postal = "T9T9T9", - LandArea = 45.55f, - Latitude = 49.11539986447944, - Longitude = 49.21539986447944, - Name = "test", - PID = "1234" - } - }; - - var building = new Entity.Building() { Id = 1, PropertyTypeId = 1 }; - - var service = helper.GetService>(); - service.Setup(m => m.BuildingConstructionType.GetAll()).Returns(new[] { new Entity.BuildingConstructionType(1, "Concrete") }); - service.Setup(m => m.BuildingPredominateUse.GetAll()).Returns(new[] { new Entity.BuildingPredominateUse(1, "School") }); - service.Setup(m => m.PropertyClassification.GetAll()).Returns(new[] { new Entity.PropertyClassification(1, "Surplus Active") }); - service.Setup(m => m.Agency.GetAll()).Returns(new[] { new Entity.Agency("AEST", "Advanced Education, Skills & Training") }); - service.Setup(m => m.Building.GetByPidNameWithoutTracking(It.IsAny(), It.IsAny())) - .Returns((int pid, string name) => Enumerable.Range(1, 10).Select(_ => new Building - { - Name = "test", - Address = new Entity.Address("123 test st", null, "BC", "1", "T9T9T9"), - Description = "A hospital", - }).ToList()); - - service.Setup(m => m.AdministrativeArea.Get(It.IsAny())).Returns(new Entity.AdministrativeArea("BC")); - - // Act - var result = controller.ImportProperties(properties); - - // Assert - JsonResult actionResult = Assert.IsType(result); - var data = Assert.IsAssignableFrom>(actionResult.Value); - Assert.Contains("buildings were found with the same PID and name", data.First().Error); - Assert.False(data.First().Added); - Assert.False(data.First().Updated); - } - - #endregion - - #region ImportProjects - #region Bad Request - [Fact] - public void ImportProjects_BadRequest() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var projects = Enumerable.Range(0, 101).Select(i => new Model.ImportProjectModel()).ToArray(); - - // Act - var result = controller.ImportProjects(projects, false); - - // Assert - Assert.NotNull(result); - var actionResult = Assert.IsType(result); - } - #endregion - - #region Success - [Fact] - public void ImportProjects_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin, Permissions.PropertyAdd, Permissions.AdminProperties); - - var project = new Entity.Project(); - - var pimsService = helper.GetService>(); - pimsService.Setup(m => m.Task.GetForWorkflow(It.IsAny())).Returns(new Entity.Task[0]); - pimsService.Setup(m => m.ProjectReport.GetAll()).Returns(Array.Empty().ToArray()); - - var agency = new Entity.Agency("Agency", "Agency"); - var tier = new Entity.TierLevel(1, "TierLevel"); - var risk = new Entity.ProjectRisk("Risk", "Risk", 1); - var status = new Entity.ProjectStatus("Status", "Status"); - var workflow = new Entity.Workflow("Workflow", "Workflow"); - - var service = helper.GetService>(); - service.Setup(m => m.Project.Get(It.IsAny())).Returns(project); - service.Setup(m => m.Project.Add(It.IsAny>())); - service.Setup(m => m.Workflow.GetAll()).Returns(new[] { workflow }); - service.Setup(m => m.ProjectStatus.GetAll()).Returns(new[] { status }); - service.Setup(m => m.ProjectRisk.GetAll()).Returns(new[] { risk }); - service.Setup(m => m.Agency.GetAll()).Returns(new[] { agency }); - service.Setup(m => m.TierLevel.GetAll()).Returns(new[] { tier }); - service.Setup(m => m.Agency.Get(It.IsAny())).Returns(agency); - service.Setup(m => m.TierLevel.Get(It.IsAny())).Returns(tier); - service.Setup(m => m.ProjectRisk.Get(It.IsAny())).Returns(risk); - service.Setup(m => m.ProjectStatus.Get(It.IsAny())).Returns(status); - service.Setup(m => m.Workflow.Get(It.IsAny())).Returns(workflow); - - var projects = new[] - { - new Model.ImportProjectModel() - { - ProjectNumber = "TEST-00001", - Workflow = "Workflow", - Activity = "Activity", - Status = "Status", - ActualFiscalYear = 2020, - ReportedFiscalYear = 2021, - Agency = "Agency", - Risk = "Risk", - Manager = "Manager", - Description = "Description", - InterestedReceivedOn = DateTime.UtcNow.AddDays(1), - CompletedOn = DateTime.UtcNow.AddDays(2), - MarketedOn = DateTime.UtcNow.AddDays(3), - Notes = new [] { new KeyValuePair("Private", "Note"), new KeyValuePair("Financial", "Note") }, - NetBook = 1, - Market = 2, - ProgramCost = 3, - SalesCost = 4, - InterestComponent = 5, - NetProceeds = 6, - PriorNetProceeds = 7, - Variance = 8, - GainLoss = 9, - OcgFinancialStatement = 10, - SaleWithLeaseInPlace = true - } - }; - - // Act - var result = controller.ImportProjects(projects, false, DateTime.UtcNow); - - // Assert - Assert.NotNull(result); - JsonResult actionResult = Assert.IsType(result); - var data = Assert.IsAssignableFrom>(actionResult.Value); - service.Verify(m => m.Project.Get(projects.First().ProjectNumber), Times.Once()); - service.Verify(m => m.Project.Add(It.IsAny>()), Times.Once()); - service.Verify(m => m.Workflow.GetAll(), Times.Once()); - service.Verify(m => m.ProjectStatus.GetAll(), Times.Once()); - service.Verify(m => m.ProjectRisk.GetAll(), Times.Once()); - service.Verify(m => m.Agency.GetAll(), Times.Once()); - service.Verify(m => m.TierLevel.GetAll(), Times.Once()); - pimsService.Verify(m => m.Task.GetForWorkflow(It.IsAny()), Times.Exactly(4)); - data.Should().HaveCount(1); - var expectedResult = projects.First(); - var first = data.First(); - first.ProjectNumber.Should().Be(expectedResult.ProjectNumber); - first.WorkflowCode.Should().Be(expectedResult.Workflow); - first.Status.Should().Be(expectedResult.Status); - first.StatusCode.Should().Be(expectedResult.Status); - first.ActualFiscalYear.Should().Be(expectedResult.ActualFiscalYear); - first.ReportedFiscalYear.Should().Be(expectedResult.ReportedFiscalYear); - first.Agency.Should().Be(expectedResult.Agency); - first.AgencyCode.Should().Be(expectedResult.Agency); - first.Manager.Should().Be(expectedResult.Manager); - first.Name.Should().Be(expectedResult.Description); - first.Description.Should().Be(expectedResult.Description); - first.CompletedOn.Should().Be(expectedResult.CompletedOn); - first.MarketedOn.Should().Be(null); - first.NetBook.Should().Be(expectedResult.NetBook); - first.Market.Should().Be(expectedResult.Market); - first.ProgramCost.Should().Be(expectedResult.ProgramCost); - first.SalesCost.Should().Be(expectedResult.SalesCost); - first.InterestComponent.Should().Be(expectedResult.InterestComponent); - first.NetProceeds.Should().Be(expectedResult.NetProceeds); - first.GainLoss.Should().Be(expectedResult.GainLoss); - first.OcgFinancialStatement.Should().Be(expectedResult.OcgFinancialStatement); - first.Notes.Should().HaveCount(2); - first.Notes.First().NoteType.Should().Be(Entity.NoteTypes.Private); - first.PrivateNote.Should().Be(expectedResult.Notes.FirstOrDefault(n => n.Key == "Private").Value); - first.Notes.Last().Note.Should().Be(expectedResult.Notes.FirstOrDefault(n => n.Key == "Financial").Value); - first.Responses.Should().HaveCount(1); - first.Responses.First().Response.Should().Be(Entity.NotificationResponses.Watch); - first.Responses.First().ReceivedOn.Should().Be(expectedResult.InterestedReceivedOn.Value); - project.Snapshots.Should().HaveCount(1); - - var metadata = JsonSerializer.Deserialize(project.Snapshots.First().Metadata); - metadata.NetProceeds.Should().Be(expectedResult.PriorNetProceeds); - project.Tasks.Should().BeEmpty(); - } - - [Fact] - public void ImportProjects_NoPriorNetProceeds_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin, Permissions.PropertyAdd, Permissions.AdminProperties); - - var project = new Entity.Project(); - - var pimsService = helper.GetService>(); - pimsService.Setup(m => m.Task.GetForWorkflow(It.IsAny())).Returns(new Entity.Task[0]); - - var agency = new Entity.Agency("Agency", "Agency"); - var tier = new Entity.TierLevel(1, "TierLevel"); - var risk = new Entity.ProjectRisk("Risk", "Risk", 1); - var status = new Entity.ProjectStatus("Status", "Status"); - var workflow = new Entity.Workflow("Workflow", "Workflow"); - - var service = helper.GetService>(); - service.Setup(m => m.Project.Get(It.IsAny())).Returns(project); - service.Setup(m => m.Project.Add(It.IsAny>())); - service.Setup(m => m.Workflow.GetAll()).Returns(new[] { workflow }); - service.Setup(m => m.ProjectStatus.GetAll()).Returns(new[] { status }); - service.Setup(m => m.ProjectRisk.GetAll()).Returns(new[] { risk }); - service.Setup(m => m.Agency.GetAll()).Returns(new[] { agency }); - service.Setup(m => m.TierLevel.GetAll()).Returns(new[] { tier }); - service.Setup(m => m.Agency.Get(It.IsAny())).Returns(agency); - service.Setup(m => m.TierLevel.Get(It.IsAny())).Returns(tier); - service.Setup(m => m.ProjectRisk.Get(It.IsAny())).Returns(risk); - service.Setup(m => m.ProjectStatus.Get(It.IsAny())).Returns(status); - service.Setup(m => m.Workflow.Get(It.IsAny())).Returns(workflow); - - var projects = new[] - { - new Model.ImportProjectModel() - { - ProjectNumber = "TEST-00001", - Workflow = "Workflow", - Activity = "Activity", - Status = "Status", - ActualFiscalYear = 2020, - ReportedFiscalYear = 2021, - Agency = "Agency", - Risk = "Risk", - Manager = "Manager", - Description = "Description", - InterestedReceivedOn = DateTime.UtcNow.AddDays(1), - CompletedOn = DateTime.UtcNow.AddDays(2), - MarketedOn = DateTime.UtcNow.AddDays(3), - Notes = new [] { new KeyValuePair("Financial", "Note"), new KeyValuePair("Private", "Note") }, - NetBook = 1, - Market = 2, - ProgramCost = 3, - SalesCost = 4, - InterestComponent = 5, - NetProceeds = 6, - Variance = 8, - GainLoss = 9, - OcgFinancialStatement = 10, - SaleWithLeaseInPlace = true - } - }; - - // Act - var result = controller.ImportProjects(projects, false); - - // Assert - Assert.NotNull(result); - JsonResult actionResult = Assert.IsType(result); - var data = Assert.IsAssignableFrom>(actionResult.Value); - data.Should().HaveCount(1); - var expectedResult = projects.First(); - var first = data.First(); - first.ProjectNumber.Should().Be(expectedResult.ProjectNumber); - first.WorkflowCode.Should().Be(expectedResult.Workflow); - first.Status.Should().Be(expectedResult.Status); - first.StatusCode.Should().Be(expectedResult.Status); - first.ActualFiscalYear.Should().Be(expectedResult.ActualFiscalYear); - first.ReportedFiscalYear.Should().Be(expectedResult.ReportedFiscalYear); - first.Agency.Should().Be(expectedResult.Agency); - first.AgencyCode.Should().Be(expectedResult.Agency); - first.Manager.Should().Be(expectedResult.Manager); - first.Name.Should().Be(expectedResult.Description); - first.Description.Should().Be(expectedResult.Description); - first.CompletedOn.Should().Be(expectedResult.CompletedOn); - first.MarketedOn.Should().Be(null); - first.NetBook.Should().Be(expectedResult.NetBook); - first.Market.Should().Be(expectedResult.Market); - first.ProgramCost.Should().Be(expectedResult.ProgramCost); - first.SalesCost.Should().Be(expectedResult.SalesCost); - first.InterestComponent.Should().Be(expectedResult.InterestComponent); - first.NetProceeds.Should().Be(expectedResult.NetProceeds); - first.GainLoss.Should().Be(expectedResult.GainLoss); - first.OcgFinancialStatement.Should().Be(expectedResult.OcgFinancialStatement); - first.Notes.Should().HaveCount(2); - first.Notes.First().NoteType.Should().Be(Entity.NoteTypes.Financial); - first.PrivateNote.Should().Be(expectedResult.Notes.FirstOrDefault(n => n.Key == "Private").Value); - first.Notes.First().Note.Should().Be(expectedResult.Notes.FirstOrDefault(n => n.Key == "Financial").Value); - first.Responses.Should().HaveCount(1); - first.Responses.First().Response.Should().Be(Entity.NotificationResponses.Watch); - first.Responses.First().ReceivedOn.Should().Be(expectedResult.InterestedReceivedOn.Value); - project.Snapshots.Should().BeEmpty(); - project.Tasks.Should().BeEmpty(); - } - - [Fact] - public void ImportProjects_WithPriorResponse_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin, Permissions.PropertyAdd, Permissions.AdminProperties); - - var agency = new Entity.Agency("Agency", "Agency"); - var tier = new Entity.TierLevel(1, "FirstTier"); - var project = new Entity.Project("RAEG-0001", "Name", tier); - project.Responses.Add(new Entity.ProjectAgencyResponse(project, agency, Entity.NotificationResponses.Unsubscribe, DateTime.UtcNow.AddDays(-1))); - - var pimsService = helper.GetService>(); - pimsService.Setup(m => m.Task.GetForWorkflow(It.IsAny())).Returns(new Entity.Task[0]); - - var risk = new Entity.ProjectRisk("Risk", "Risk", 1); - var status = new Entity.ProjectStatus("Status", "Status"); - var workflow = new Entity.Workflow("Workflow", "Workflow"); - - var service = helper.GetService>(); - service.Setup(m => m.Project.Get(It.IsAny())).Returns(project); - service.Setup(m => m.Project.Add(It.IsAny>())); - service.Setup(m => m.Workflow.GetAll()).Returns(new[] { workflow }); - service.Setup(m => m.ProjectStatus.GetAll()).Returns(new[] { status }); - service.Setup(m => m.ProjectRisk.GetAll()).Returns(new[] { risk }); - service.Setup(m => m.Agency.GetAll()).Returns(new[] { agency }); - service.Setup(m => m.TierLevel.GetAll()).Returns(new[] { tier, new Entity.TierLevel(2, "TierLevel") }); - service.Setup(m => m.Agency.Get(It.IsAny())).Returns(agency); - service.Setup(m => m.TierLevel.Get(It.IsAny())).Returns(tier); - service.Setup(m => m.ProjectRisk.Get(It.IsAny())).Returns(risk); - service.Setup(m => m.ProjectStatus.Get(It.IsAny())).Returns(status); - service.Setup(m => m.Workflow.Get(It.IsAny())).Returns(workflow); - - var projects = new[] - { - new Model.ImportProjectModel() - { - ProjectNumber = "TEST-00001", - Workflow = "Workflow", - Activity = "Activity", - Status = "Status", - ActualFiscalYear = 2020, - ReportedFiscalYear = 2021, - Agency = "Agency", - Risk = "Risk", - Manager = "Manager", - Description = "Description", - InterestedReceivedOn = DateTime.UtcNow.AddDays(1), - CompletedOn = DateTime.UtcNow.AddDays(2), - MarketedOn = DateTime.UtcNow.AddDays(3), - Notes = new [] { new KeyValuePair("Financial", "Note"), new KeyValuePair("Private", "Note") }, - NetBook = 1, - Market = 2, - ProgramCost = 3, - SalesCost = 4, - InterestComponent = 5, - NetProceeds = 6, - Variance = 8, - GainLoss = 9, - OcgFinancialStatement = 10, - SaleWithLeaseInPlace = true - } - }; - - // Act - var result = controller.ImportProjects(projects, false); - - // Assert - Assert.NotNull(result); - JsonResult actionResult = Assert.IsType(result); - var data = Assert.IsAssignableFrom>(actionResult.Value); - data.Should().HaveCount(1); - var expectedResult = projects.First(); - var first = data.First(); - first.ProjectNumber.Should().Be(expectedResult.ProjectNumber); - first.WorkflowCode.Should().Be(expectedResult.Workflow); - first.Status.Should().Be(expectedResult.Status); - first.StatusCode.Should().Be(expectedResult.Status); - first.ActualFiscalYear.Should().Be(expectedResult.ActualFiscalYear); - first.ReportedFiscalYear.Should().Be(expectedResult.ReportedFiscalYear); - first.Agency.Should().Be(expectedResult.Agency); - first.AgencyCode.Should().Be(expectedResult.Agency); - first.Manager.Should().Be(expectedResult.Manager); - first.Name.Should().Be(expectedResult.Description); - first.Description.Should().Be(expectedResult.Description); - first.CompletedOn.Should().Be(expectedResult.CompletedOn); - first.MarketedOn.Should().Be(null); - first.NetBook.Should().Be(expectedResult.NetBook); - first.Market.Should().Be(expectedResult.Market); - first.ProgramCost.Should().Be(expectedResult.ProgramCost); - first.SalesCost.Should().Be(expectedResult.SalesCost); - first.InterestComponent.Should().Be(expectedResult.InterestComponent); - first.NetProceeds.Should().Be(expectedResult.NetProceeds); - first.GainLoss.Should().Be(expectedResult.GainLoss); - first.OcgFinancialStatement.Should().Be(expectedResult.OcgFinancialStatement); - first.Notes.Should().HaveCount(2); - first.Notes.First().NoteType.Should().Be(Entity.NoteTypes.Financial); - first.PrivateNote.Should().Be(expectedResult.Notes.FirstOrDefault(n => n.Key == "Private").Value); - first.Notes.First().Note.Should().Be(expectedResult.Notes.FirstOrDefault(n => n.Key == "Financial").Value); - first.Responses.Should().HaveCount(1); - first.Responses.First().Response.Should().Be(Entity.NotificationResponses.Watch); - first.Responses.First().ReceivedOn.Should().Be(expectedResult.InterestedReceivedOn.Value); - project.Snapshots.Should().BeEmpty(); - project.Tasks.Should().BeEmpty(); - } - - [Fact] - public void ImportProjects_NoResponse_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin, Permissions.PropertyAdd, Permissions.AdminProperties); - - var agency = new Entity.Agency("Agency", "Agency"); - var tier = new Entity.TierLevel(1, "FirstTier"); - var project = new Entity.Project("RAEG-0001", "Name", tier); - - var pimsService = helper.GetService>(); - pimsService.Setup(m => m.Task.GetForWorkflow(It.IsAny())).Returns(new Entity.Task[0]); - - var risk = new Entity.ProjectRisk("Risk", "Risk", 1); - var status = new Entity.ProjectStatus("Status", "Status"); - var workflow = new Entity.Workflow("Workflow", "Workflow"); - - var service = helper.GetService>(); - service.Setup(m => m.Project.Get(It.IsAny())).Returns(project); - service.Setup(m => m.Project.Add(It.IsAny>())); - service.Setup(m => m.Workflow.GetAll()).Returns(new[] { workflow }); - service.Setup(m => m.ProjectStatus.GetAll()).Returns(new[] { status }); - service.Setup(m => m.ProjectRisk.GetAll()).Returns(new[] { risk }); - service.Setup(m => m.Agency.GetAll()).Returns(new[] { agency }); - service.Setup(m => m.TierLevel.GetAll()).Returns(new[] { tier, new Entity.TierLevel(2, "TierLevel") }); - service.Setup(m => m.Agency.Get(It.IsAny())).Returns(agency); - service.Setup(m => m.TierLevel.Get(It.IsAny())).Returns(tier); - service.Setup(m => m.ProjectRisk.Get(It.IsAny())).Returns(risk); - service.Setup(m => m.ProjectStatus.Get(It.IsAny())).Returns(status); - service.Setup(m => m.Workflow.Get(It.IsAny())).Returns(workflow); - - var projects = new[] - { - new Model.ImportProjectModel() - { - ProjectNumber = "TEST-00001", - Workflow = "Workflow", - Activity = "Activity", - Status = "Status", - ActualFiscalYear = 2020, - ReportedFiscalYear = 2021, - Agency = "Agency", - Risk = "Risk", - Manager = "Manager", - Description = "Description", - CompletedOn = DateTime.UtcNow.AddDays(2), - MarketedOn = DateTime.UtcNow.AddDays(3), - Notes = new [] { new KeyValuePair("Financial", "Note"), new KeyValuePair("Private", "Note") }, - NetBook = 1, - Market = 2, - ProgramCost = 3, - SalesCost = 4, - InterestComponent = 5, - NetProceeds = 6, - Variance = 8, - GainLoss = 9, - OcgFinancialStatement = 10, - SaleWithLeaseInPlace = true - } - }; - - // Act - var result = controller.ImportProjects(projects, false); - - // Assert - Assert.NotNull(result); - JsonResult actionResult = Assert.IsType(result); - var data = Assert.IsAssignableFrom>(actionResult.Value); - data.Should().HaveCount(1); - var expectedResult = projects.First(); - var first = data.First(); - first.ProjectNumber.Should().Be(expectedResult.ProjectNumber); - first.WorkflowCode.Should().Be(expectedResult.Workflow); - first.Status.Should().Be(expectedResult.Status); - first.StatusCode.Should().Be(expectedResult.Status); - first.ActualFiscalYear.Should().Be(expectedResult.ActualFiscalYear); - first.ReportedFiscalYear.Should().Be(expectedResult.ReportedFiscalYear); - first.Agency.Should().Be(expectedResult.Agency); - first.AgencyCode.Should().Be(expectedResult.Agency); - first.Manager.Should().Be(expectedResult.Manager); - first.Name.Should().Be(expectedResult.Description); - first.Description.Should().Be(expectedResult.Description); - first.CompletedOn.Should().Be(expectedResult.CompletedOn); - first.MarketedOn.Should().Be(null); - first.NetBook.Should().Be(expectedResult.NetBook); - first.Market.Should().Be(expectedResult.Market); - first.ProgramCost.Should().Be(expectedResult.ProgramCost); - first.SalesCost.Should().Be(expectedResult.SalesCost); - first.InterestComponent.Should().Be(expectedResult.InterestComponent); - first.NetProceeds.Should().Be(expectedResult.NetProceeds); - first.GainLoss.Should().Be(expectedResult.GainLoss); - first.OcgFinancialStatement.Should().Be(expectedResult.OcgFinancialStatement); - first.Notes.Should().HaveCount(2); - first.Notes.First().NoteType.Should().Be(Entity.NoteTypes.Financial); - first.PrivateNote.Should().Be(expectedResult.Notes.FirstOrDefault(n => n.Key == "Private").Value); - first.Notes.First().Note.Should().Be(expectedResult.Notes.FirstOrDefault(n => n.Key == "Financial").Value); - first.Responses.Should().BeEmpty(); - project.Snapshots.Should().BeEmpty(); - project.Tasks.Should().BeEmpty(); - } - - [Fact] - public void ImportProjects_WithPriorNote_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin, Permissions.PropertyAdd, Permissions.AdminProperties); - - var agency = new Entity.Agency("Agency", "Agency"); - var tier = new Entity.TierLevel(1, "FirstTier"); - var project = new Entity.Project("RAEG-0001", "Name", tier); - project.Notes.Add(new Entity.ProjectNote(project, Entity.NoteTypes.Financial, "some note")); - - var pimsService = helper.GetService>(); - pimsService.Setup(m => m.Task.GetForWorkflow(It.IsAny())).Returns(new Entity.Task[0]); - - var risk = new Entity.ProjectRisk("Risk", "Risk", 1); - var status = new Entity.ProjectStatus("Status", "Status"); - var workflow = new Entity.Workflow("Workflow", "Workflow"); - - var service = helper.GetService>(); - service.Setup(m => m.Project.Get(It.IsAny())).Returns(project); - service.Setup(m => m.Project.Add(It.IsAny>())); - service.Setup(m => m.Workflow.GetAll()).Returns(new[] { workflow }); - service.Setup(m => m.ProjectStatus.GetAll()).Returns(new[] { status }); - service.Setup(m => m.ProjectRisk.GetAll()).Returns(new[] { risk }); - service.Setup(m => m.Agency.GetAll()).Returns(new[] { agency }); - service.Setup(m => m.TierLevel.GetAll()).Returns(new[] { tier, new Entity.TierLevel(2, "TierLevel") }); - service.Setup(m => m.Agency.Get(It.IsAny())).Returns(agency); - service.Setup(m => m.TierLevel.Get(It.IsAny())).Returns(tier); - service.Setup(m => m.ProjectRisk.Get(It.IsAny())).Returns(risk); - service.Setup(m => m.ProjectStatus.Get(It.IsAny())).Returns(status); - service.Setup(m => m.Workflow.Get(It.IsAny())).Returns(workflow); - - var projects = new[] - { - new Model.ImportProjectModel() - { - ProjectNumber = "TEST-00001", - Workflow = "Workflow", - Activity = "Activity", - Status = "Status", - ActualFiscalYear = 2020, - ReportedFiscalYear = 2021, - Agency = "Agency", - Risk = "Risk", - Manager = "Manager", - Description = "Description", - CompletedOn = DateTime.UtcNow.AddDays(2), - MarketedOn = DateTime.UtcNow.AddDays(3), - Notes = new [] { new KeyValuePair("Private", "Note"), new KeyValuePair("Financial", "Note") }, - NetBook = 1, - Market = 2, - ProgramCost = 3, - SalesCost = 4, - InterestComponent = 5, - NetProceeds = 6, - Variance = 8, - GainLoss = 9, - OcgFinancialStatement = 10, - SaleWithLeaseInPlace = true - } - }; - - // Act - var result = controller.ImportProjects(projects, false); - - // Assert - Assert.NotNull(result); - JsonResult actionResult = Assert.IsType(result); - var data = Assert.IsAssignableFrom>(actionResult.Value); - data.Should().HaveCount(1); - var expectedResult = projects.First(); - var first = data.First(); - first.ProjectNumber.Should().Be(expectedResult.ProjectNumber); - first.WorkflowCode.Should().Be(expectedResult.Workflow); - first.Status.Should().Be(expectedResult.Status); - first.StatusCode.Should().Be(expectedResult.Status); - first.ActualFiscalYear.Should().Be(expectedResult.ActualFiscalYear); - first.ReportedFiscalYear.Should().Be(expectedResult.ReportedFiscalYear); - first.Agency.Should().Be(expectedResult.Agency); - first.AgencyCode.Should().Be(expectedResult.Agency); - first.Manager.Should().Be(expectedResult.Manager); - first.Name.Should().Be(expectedResult.Description); - first.Description.Should().Be(expectedResult.Description); - first.CompletedOn.Should().Be(expectedResult.CompletedOn); - first.MarketedOn.Should().Be(null); - first.NetBook.Should().Be(expectedResult.NetBook); - first.Market.Should().Be(expectedResult.Market); - first.ProgramCost.Should().Be(expectedResult.ProgramCost); - first.SalesCost.Should().Be(expectedResult.SalesCost); - first.InterestComponent.Should().Be(expectedResult.InterestComponent); - first.NetProceeds.Should().Be(expectedResult.NetProceeds); - first.GainLoss.Should().Be(expectedResult.GainLoss); - first.OcgFinancialStatement.Should().Be(expectedResult.OcgFinancialStatement); - first.Notes.Should().HaveCount(2); - first.Notes.First().NoteType.Should().Be(Entity.NoteTypes.Financial); - first.PrivateNote.Should().Be(expectedResult.Notes.FirstOrDefault(n => n.Key == "Private").Value); - var expectedFinancialNote = expectedResult.Notes.FirstOrDefault(n => n.Key == "Financial"); - first.Notes.First().Note.Should().Be($"some note{Environment.NewLine}{Environment.NewLine}{expectedFinancialNote.Key}{Environment.NewLine}{expectedFinancialNote.Value}"); - first.Responses.Should().BeEmpty(); - project.Snapshots.Should().BeEmpty(); - project.Tasks.Should().BeEmpty(); - } - - [Fact] - public void ImportProjects_WithNoNote_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin, Permissions.PropertyAdd, Permissions.AdminProperties); - - var agency = new Entity.Agency("Agency", "Agency"); - var tier = new Entity.TierLevel(1, "FirstTier"); - var project = new Entity.Project("RAEG-0001", "Name", tier); - - var pimsService = helper.GetService>(); - pimsService.Setup(m => m.Task.GetForWorkflow(It.IsAny())).Returns(new Entity.Task[0]); - - var risk = new Entity.ProjectRisk("Risk", "Risk", 1); - var status = new Entity.ProjectStatus("Status", "Status"); - var workflow = new Entity.Workflow("Workflow", "Workflow"); - - var service = helper.GetService>(); - service.Setup(m => m.Project.Get(It.IsAny())).Returns(project); - service.Setup(m => m.Project.Add(It.IsAny>())); - service.Setup(m => m.Workflow.GetAll()).Returns(new[] { workflow }); - service.Setup(m => m.ProjectStatus.GetAll()).Returns(new[] { status }); - service.Setup(m => m.ProjectRisk.GetAll()).Returns(new[] { risk }); - service.Setup(m => m.Agency.GetAll()).Returns(new[] { agency }); - service.Setup(m => m.TierLevel.GetAll()).Returns(new[] { tier, new Entity.TierLevel(2, "TierLevel") }); - service.Setup(m => m.Agency.Get(It.IsAny())).Returns(agency); - service.Setup(m => m.TierLevel.Get(It.IsAny())).Returns(tier); - service.Setup(m => m.ProjectRisk.Get(It.IsAny())).Returns(risk); - service.Setup(m => m.ProjectStatus.Get(It.IsAny())).Returns(status); - service.Setup(m => m.Workflow.Get(It.IsAny())).Returns(workflow); - - var projects = new[] - { - new Model.ImportProjectModel() - { - ProjectNumber = "TEST-00001", - Workflow = "Workflow", - Activity = "Activity", - Status = "Status", - ActualFiscalYear = 2020, - ReportedFiscalYear = 2021, - Agency = "Agency", - Risk = "Risk", - Manager = "Manager", - Description = "Description", - CompletedOn = DateTime.UtcNow.AddDays(2), - MarketedOn = DateTime.UtcNow.AddDays(3), - NetBook = 1, - Market = 2, - ProgramCost = 3, - SalesCost = 4, - InterestComponent = 5, - NetProceeds = 6, - Variance = 8, - GainLoss = 9, - OcgFinancialStatement = 10, - SaleWithLeaseInPlace = true - } - }; - - // Act - var result = controller.ImportProjects(projects, false); - - // Assert - Assert.NotNull(result); - JsonResult actionResult = Assert.IsType(result); - var data = Assert.IsAssignableFrom>(actionResult.Value); - data.Should().HaveCount(1); - var expectedResult = projects.First(); - var first = data.First(); - first.ProjectNumber.Should().Be(expectedResult.ProjectNumber); - first.WorkflowCode.Should().Be(expectedResult.Workflow); - first.Status.Should().Be(expectedResult.Status); - first.StatusCode.Should().Be(expectedResult.Status); - first.ActualFiscalYear.Should().Be(expectedResult.ActualFiscalYear); - first.ReportedFiscalYear.Should().Be(expectedResult.ReportedFiscalYear); - first.Agency.Should().Be(expectedResult.Agency); - first.AgencyCode.Should().Be(expectedResult.Agency); - first.Manager.Should().Be(expectedResult.Manager); - first.Name.Should().Be(expectedResult.Description); - first.Description.Should().Be(expectedResult.Description); - first.CompletedOn.Should().Be(expectedResult.CompletedOn); - first.MarketedOn.Should().Be(null); - first.NetBook.Should().Be(expectedResult.NetBook); - first.Market.Should().Be(expectedResult.Market); - first.ProgramCost.Should().Be(expectedResult.ProgramCost); - first.SalesCost.Should().Be(expectedResult.SalesCost); - first.InterestComponent.Should().Be(expectedResult.InterestComponent); - first.NetProceeds.Should().Be(expectedResult.NetProceeds); - first.GainLoss.Should().Be(expectedResult.GainLoss); - first.OcgFinancialStatement.Should().Be(expectedResult.OcgFinancialStatement); - first.Notes.Should().BeEmpty(); - first.Responses.Should().BeEmpty(); - project.Snapshots.Should().BeEmpty(); - project.Tasks.Should().BeEmpty(); - } - - - public static IEnumerable ProjectActivity => - new List - { - new object[] { "Completed Deal", "SPL" }, - new object[] { "Contract in Place", "SPL" }, - new object[] { "On Market", "SPL" }, - new object[] { "Pre-Market", "SPL" }, - new object[] { "GET LAST ONE", "SPL" }, - new object[] { "", "SPL" }, - new object[] { null, "SPL" } - }; - - /// - /// Based on the specified 'Activity' determine the appropriate Workflow. - /// - /// - /// - [Theory] - [MemberData(nameof(ProjectActivity))] - public void ImportProjects_ActivityToWorkflow(string activity, string expectedWorkflow) - { - // Arrange - var helper = new TestHelper(); - var user = helper.CreateForPermission(Permissions.SystemAdmin, Permissions.PropertyAdd, Permissions.AdminProperties); - var controller = helper.CreateController(user); - - var agency = EntityHelper.CreateAgency(1, "TEST"); - var tier = EntityHelper.CreateTierLevel(1, "TIER"); - var workflows = new[] { EntityHelper.CreateWorkflow(1, "ERP"), EntityHelper.CreateWorkflow(2, "SPL") }; - workflows[0].SortOrder = 1; - workflows[1].SortOrder = 2; - var status = EntityHelper.CreateProjectStatus("STATUS", "TEST"); - workflows[0].AddStatus(status, 1); - workflows[1].AddStatus(status, 2); - var risk = EntityHelper.CreateProjectRisk("Green", "GREEN", 0); - - var model1 = new Model.ImportProjectModel() - { - ProjectNumber = "TEST-00001", - Description = "Model 1", - Agency = "TEST", - Activity = activity, - Status = "TEST", - Risk = "GREEN", - ReportedFiscalYear = 2020, - }; - - var adminServiceMock = helper.GetService>(); - adminServiceMock.Setup(m => m.Workflow.GetAll()).Returns(workflows); - adminServiceMock.Setup(m => m.Workflow.Get(It.IsAny())).Returns(id => workflows.First(w => w.Id == id)); - adminServiceMock.Setup(m => m.Workflow.GetForStatus(It.IsAny())).Returns(workflows); - adminServiceMock.Setup(m => m.ProjectStatus.GetAll()).Returns(new[] { status }); - adminServiceMock.Setup(m => m.ProjectStatus.Get(It.IsAny())).Returns(status); - adminServiceMock.Setup(m => m.ProjectRisk.GetAll()).Returns(new[] { risk }); - adminServiceMock.Setup(m => m.ProjectRisk.Get(It.IsAny())).Returns(risk); - adminServiceMock.Setup(m => m.Agency.GetAll()).Returns(new[] { agency }); - adminServiceMock.Setup(m => m.Agency.Get(It.IsAny())).Returns(agency); - adminServiceMock.Setup(m => m.TierLevel.GetAll()).Returns(new[] { tier }); - adminServiceMock.Setup(m => m.TierLevel.Get(It.IsAny())).Returns(tier); - adminServiceMock.Setup(m => m.Project.Get(It.IsAny())).Returns(null); - - var serviceMock = helper.GetService>(); - serviceMock.Setup(m => m.Task).Returns(helper.GetService()); - serviceMock.Setup(m => m.Task.GetForWorkflow(It.IsAny())).Returns(new Entity.Task[0]); - - // Act - var result = controller.ImportProjects(new[] { model1 }, false); - - // Assert - Assert.NotNull(result); - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsAssignableFrom(actionResult.Value); - actualResult.Should().HaveCount(1); - actualResult.First().WorkflowCode.Should().Be(expectedWorkflow); - adminServiceMock.Verify(m => m.Project.Add(It.IsAny>()), Times.Once); - adminServiceMock.Verify(m => m.Project.Update(It.IsAny>()), Times.Once); - } - #endregion - - #region Defaults - [Fact] - public void ImportProjects_Defaults_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin, Permissions.PropertyAdd, Permissions.AdminProperties); - - var project = new Entity.Project(); - - var pimsService = helper.GetService>(); - pimsService.Setup(m => m.Task.GetForWorkflow(It.IsAny())).Returns(new[] { new Entity.Task("test") }); - pimsService.Setup(m => m.ProjectReport.GetAll()).Returns(Array.Empty().ToArray()); - - var agency = new Entity.Agency("Agency", "Agency"); - var tier = new Entity.TierLevel(1, "TierLevel"); - var risk = new Entity.ProjectRisk("Risk", "Risk", 1); - var status = new Entity.ProjectStatus("Status", "Status"); - var workflow = new Entity.Workflow("Workflow", "Workflow"); - - var service = helper.GetService>(); - service.Setup(m => m.Project.Get(It.IsAny())).Returns(project); - service.Setup(m => m.Project.Add(It.IsAny>())); - service.Setup(m => m.Project.Update(It.IsAny>())); - service.Setup(m => m.Workflow.GetAll()).Returns(new[] { workflow }); - service.Setup(m => m.ProjectStatus.GetAll()).Returns(new[] { status }); - service.Setup(m => m.ProjectRisk.GetAll()).Returns(new[] { risk }); - service.Setup(m => m.Agency.GetAll()).Returns(new[] { agency }); - service.Setup(m => m.TierLevel.GetAll()).Returns(new[] { tier }); - service.Setup(m => m.Agency.Get(It.IsAny())).Returns(agency); - service.Setup(m => m.TierLevel.Get(It.IsAny())).Returns(tier); - service.Setup(m => m.ProjectRisk.Get(It.IsAny())).Returns(risk); - service.Setup(m => m.ProjectStatus.Get(It.IsAny())).Returns(status); - service.Setup(m => m.Workflow.Get(It.IsAny())).Returns(workflow); - - var projects = new[] - { - new Model.ImportProjectModel() - { - ProjectNumber = "TEST-00001", - Activity = "Activity", - ActualFiscalYear = 2020, - ReportedFiscalYear = 2021, - Manager = "Manager", - Description = "Description", - InterestedReceivedOn = DateTime.UtcNow.AddDays(1), - CompletedOn = DateTime.UtcNow.AddDays(2), - MarketedOn = DateTime.UtcNow.AddDays(3), - Notes = new [] { new KeyValuePair("Financial", "Note"), new KeyValuePair("Private", "Note") }, - NetBook = 1, - ProgramCost = 3, - SalesCost = 4, - InterestComponent = 5, - NetProceeds = 6, - PriorNetProceeds = 7, - Variance = 8, - GainLoss = 9, - OcgFinancialStatement = 10, - SaleWithLeaseInPlace = true - } - }; - - // Act - var result = controller.ImportProjects(projects, false, DateTime.UtcNow, "Risk=Risk;Status=Status;Workflow=Workflow;Agency=Agency;Market=100000"); - - // Assert - Assert.NotNull(result); - JsonResult actionResult = Assert.IsType(result); - var data = Assert.IsAssignableFrom>(actionResult.Value); - data.Should().HaveCount(1); - var expectedResult = projects.First(); - var first = data.First(); - first.ProjectNumber.Should().Be(expectedResult.ProjectNumber); - first.WorkflowCode.Should().Be(expectedResult.Workflow); - first.Status.Should().Be(expectedResult.Status); - first.StatusCode.Should().Be(expectedResult.Status); - first.ActualFiscalYear.Should().Be(expectedResult.ActualFiscalYear); - first.ReportedFiscalYear.Should().Be(expectedResult.ReportedFiscalYear); - first.Agency.Should().Be(expectedResult.Agency); - first.AgencyCode.Should().Be(expectedResult.Agency); - first.Manager.Should().Be(expectedResult.Manager); - first.Name.Should().Be(expectedResult.Description); - first.Description.Should().Be(expectedResult.Description); - first.CompletedOn.Should().Be(expectedResult.CompletedOn); - first.MarketedOn.Should().Be(null); - first.NetBook.Should().Be(expectedResult.NetBook); - first.Market.Should().Be(expectedResult.Market); - first.ProgramCost.Should().Be(expectedResult.ProgramCost); - first.SalesCost.Should().Be(expectedResult.SalesCost); - first.InterestComponent.Should().Be(expectedResult.InterestComponent); - first.NetProceeds.Should().Be(expectedResult.NetProceeds); - first.GainLoss.Should().Be(expectedResult.GainLoss); - first.OcgFinancialStatement.Should().Be(expectedResult.OcgFinancialStatement); - first.Notes.Should().HaveCount(2); - first.Notes.First().NoteType.Should().Be(Entity.NoteTypes.Financial); - first.PrivateNote.Should().Be(expectedResult.Notes.FirstOrDefault(n => n.Key == "Private").Value); - first.Notes.First().Note.Should().Be(expectedResult.Notes.FirstOrDefault(n => n.Key == "Financial").Value); - first.Responses.Should().HaveCount(1); - first.Responses.First().Response.Should().Be(Entity.NotificationResponses.Watch); - first.Responses.First().ReceivedOn.Should().Be(expectedResult.InterestedReceivedOn.Value); - project.Snapshots.Should().HaveCount(1); - - var metadata = JsonSerializer.Deserialize(project.Snapshots.First().Metadata); - metadata.NetProceeds.Should().Be(expectedResult.PriorNetProceeds); - project.Tasks.Should().HaveCount(1); - } - #endregion - - #region KeyNotFoundExceptions - [Fact] - public void ImportProjects_Workflow_KeyNotFoundException() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var project = new Entity.Project(); - - var agency = new Entity.Agency("Agency", "Agency"); - var tier = new Entity.TierLevel(1, "TierLevel"); - var risk = new Entity.ProjectRisk("Risk", "Risk", 1); - var status = new Entity.ProjectStatus("Status", "Status"); - var workflow = new Entity.Workflow("Workflow", "Workflow"); - - var service = helper.GetService>(); - service.Setup(m => m.Project.Get(It.IsAny())).Returns(project); - service.Setup(m => m.Project.Add(It.IsAny>())); - service.Setup(m => m.Workflow.GetAll()).Returns(new Entity.Workflow[0]); - service.Setup(m => m.ProjectStatus.GetAll()).Returns(new[] { status }); - service.Setup(m => m.ProjectRisk.GetAll()).Returns(new[] { risk }); - service.Setup(m => m.Agency.GetAll()).Returns(new[] { agency }); - service.Setup(m => m.TierLevel.GetAll()).Returns(new[] { tier }); - service.Setup(m => m.Agency.Get(It.IsAny())).Returns(agency); - service.Setup(m => m.TierLevel.Get(It.IsAny())).Returns(tier); - service.Setup(m => m.ProjectRisk.Get(It.IsAny())).Returns(risk); - service.Setup(m => m.ProjectStatus.Get(It.IsAny())).Returns(status); - service.Setup(m => m.Workflow.Get(It.IsAny())).Returns(workflow); - - var projects = new[] - { - new Model.ImportProjectModel() - { - ProjectNumber = "TEST-00001", - Workflow = "Workflow", - Activity = "Activity", - Status = "Status", - ActualFiscalYear = 2020, - ReportedFiscalYear = 2021, - Agency = "Agency", - Risk = "Risk", - Manager = "Manager", - Description = "Description", - InterestedReceivedOn = DateTime.UtcNow.AddDays(1), - CompletedOn = DateTime.UtcNow.AddDays(2), - MarketedOn = DateTime.UtcNow.AddDays(3), - Notes = new [] { new KeyValuePair("Private", "Note"), new KeyValuePair("Financial", "Note") }, - NetBook = 1, - Market = 2, - ProgramCost = 3, - SalesCost = 4, - InterestComponent = 5, - NetProceeds = 6, - PriorNetProceeds = 7, - Variance = 8, - GainLoss = 9, - OcgFinancialStatement = 10, - SaleWithLeaseInPlace = true - } - }; - - // Act - // Assert - Assert.Throws(() => controller.ImportProjects(projects, true)); - } - - [Fact] - public void ImportProjects_Status_KeyNotFoundException() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var project = new Entity.Project(); - - var agency = new Entity.Agency("Agency", "Agency"); - var tier = new Entity.TierLevel(1, "TierLevel"); - var risk = new Entity.ProjectRisk("Risk", "Risk", 1); - var status = new Entity.ProjectStatus("Status", "Status"); - var workflow = new Entity.Workflow("Workflow", "Workflow"); - - var service = helper.GetService>(); - service.Setup(m => m.Project.Get(It.IsAny())).Returns(project); - service.Setup(m => m.Project.Add(It.IsAny>())); - service.Setup(m => m.ProjectStatus.GetAll()).Returns(new Entity.ProjectStatus[0]); - service.Setup(m => m.Workflow.GetAll()).Returns(new[] { workflow }); - service.Setup(m => m.ProjectRisk.GetAll()).Returns(new[] { risk }); - service.Setup(m => m.Agency.GetAll()).Returns(new[] { agency }); - service.Setup(m => m.TierLevel.GetAll()).Returns(new[] { tier }); - service.Setup(m => m.Agency.Get(It.IsAny())).Returns(agency); - service.Setup(m => m.TierLevel.Get(It.IsAny())).Returns(tier); - service.Setup(m => m.ProjectRisk.Get(It.IsAny())).Returns(risk); - service.Setup(m => m.ProjectStatus.Get(It.IsAny())).Returns(status); - service.Setup(m => m.Workflow.Get(It.IsAny())).Returns(workflow); - - var projects = new[] - { - new Model.ImportProjectModel() - { - ProjectNumber = "TEST-00001", - Workflow = "Workflow", - Activity = "Activity", - Status = "Status", - ActualFiscalYear = 2020, - ReportedFiscalYear = 2021, - Agency = "Agency", - Risk = "Risk", - Manager = "Manager", - Description = "Description", - InterestedReceivedOn = DateTime.UtcNow.AddDays(1), - CompletedOn = DateTime.UtcNow.AddDays(2), - MarketedOn = DateTime.UtcNow.AddDays(3), - Notes = new [] { new KeyValuePair("Private", "Note"), new KeyValuePair("Financial", "Note") }, - NetBook = 1, - Market = 2, - ProgramCost = 3, - SalesCost = 4, - InterestComponent = 5, - NetProceeds = 6, - PriorNetProceeds = 7, - Variance = 8, - GainLoss = 9, - OcgFinancialStatement = 10, - SaleWithLeaseInPlace = true - } - }; - - // Act - // Assert - Assert.Throws(() => controller.ImportProjects(projects, true)); - } - - [Fact] - public void ImportProjects_Risk_KeyNotFoundException() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var project = new Entity.Project(); - - var agency = new Entity.Agency("Agency", "Agency"); - var tier = new Entity.TierLevel(1, "TierLevel"); - var risk = new Entity.ProjectRisk("Risk", "Risk", 1); - var status = new Entity.ProjectStatus("Status", "Status"); - var workflow = new Entity.Workflow("Workflow", "Workflow"); - - var service = helper.GetService>(); - service.Setup(m => m.Project.Get(It.IsAny())).Returns(project); - service.Setup(m => m.Project.Add(It.IsAny>())); - service.Setup(m => m.Workflow.GetAll()).Returns(new[] { workflow }); - service.Setup(m => m.ProjectStatus.GetAll()).Returns(new[] { status }); - service.Setup(m => m.Agency.GetAll()).Returns(new[] { agency }); - service.Setup(m => m.ProjectRisk.GetAll()).Returns(new Entity.ProjectRisk[0]); - service.Setup(m => m.TierLevel.GetAll()).Returns(new[] { tier }); - service.Setup(m => m.Agency.Get(It.IsAny())).Returns(agency); - service.Setup(m => m.TierLevel.Get(It.IsAny())).Returns(tier); - service.Setup(m => m.ProjectRisk.Get(It.IsAny())).Returns(risk); - service.Setup(m => m.ProjectStatus.Get(It.IsAny())).Returns(status); - service.Setup(m => m.Workflow.Get(It.IsAny())).Returns(workflow); - - var projects = new[] - { - new Model.ImportProjectModel() - { - ProjectNumber = "TEST-00001", - Workflow = "Workflow", - Activity = "Activity", - Status = "Status", - ActualFiscalYear = 2020, - ReportedFiscalYear = 2021, - Agency = "Agency", - Risk = "Risk", - Manager = "Manager", - Description = "Description", - InterestedReceivedOn = DateTime.UtcNow.AddDays(1), - CompletedOn = DateTime.UtcNow.AddDays(2), - MarketedOn = DateTime.UtcNow.AddDays(3), - Notes = new [] { new KeyValuePair("Private", "Note"), new KeyValuePair("Financial", "Note") }, - NetBook = 1, - Market = 2, - ProgramCost = 3, - SalesCost = 4, - InterestComponent = 5, - NetProceeds = 6, - PriorNetProceeds = 7, - Variance = 8, - GainLoss = 9, - OcgFinancialStatement = 10, - SaleWithLeaseInPlace = true - } - }; - - // Act - // Assert - Assert.Throws(() => controller.ImportProjects(projects, true)); - } - - [Fact] - public void ImportProjects_Agency_KeyNotFoundException() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var project = new Entity.Project(); - - var agency = new Entity.Agency("Agency", "Agency"); - var tier = new Entity.TierLevel(1, "TierLevel"); - var risk = new Entity.ProjectRisk("Risk", "Risk", 1); - var status = new Entity.ProjectStatus("Status", "Status"); - var workflow = new Entity.Workflow("Workflow", "Workflow"); - - var service = helper.GetService>(); - service.Setup(m => m.Project.Get(It.IsAny())).Returns(project); - service.Setup(m => m.Project.Add(It.IsAny>())); - service.Setup(m => m.Workflow.GetAll()).Returns(new[] { workflow }); - service.Setup(m => m.ProjectStatus.GetAll()).Returns(new[] { status }); - service.Setup(m => m.ProjectRisk.GetAll()).Returns(new[] { risk }); - service.Setup(m => m.Agency.GetAll()).Returns(new Entity.Agency[0]); - service.Setup(m => m.TierLevel.GetAll()).Returns(new[] { tier }); - service.Setup(m => m.Agency.Get(It.IsAny())).Returns(agency); - service.Setup(m => m.TierLevel.Get(It.IsAny())).Returns(tier); - service.Setup(m => m.ProjectRisk.Get(It.IsAny())).Returns(risk); - service.Setup(m => m.ProjectStatus.Get(It.IsAny())).Returns(status); - service.Setup(m => m.Workflow.Get(It.IsAny())).Returns(workflow); - - var projects = new[] - { - new Model.ImportProjectModel() - { - ProjectNumber = "TEST-00001", - Workflow = "Workflow", - Activity = "Activity", - Status = "Status", - ActualFiscalYear = 2020, - ReportedFiscalYear = 2021, - Agency = "Agency", - Risk = "Risk", - Manager = "Manager", - Description = "Description", - InterestedReceivedOn = DateTime.UtcNow.AddDays(1), - CompletedOn = DateTime.UtcNow.AddDays(2), - MarketedOn = DateTime.UtcNow.AddDays(3), - Notes = new [] { new KeyValuePair("Private", "Note"), new KeyValuePair("Financial", "Note") }, - NetBook = 1, - Market = 2, - ProgramCost = 3, - SalesCost = 4, - InterestComponent = 5, - NetProceeds = 6, - PriorNetProceeds = 7, - Variance = 8, - GainLoss = 9, - OcgFinancialStatement = 10, - SaleWithLeaseInPlace = true - } - }; - - // Act - // Assert - Assert.Throws(() => controller.ImportProjects(projects, true)); - } - #endregion - - #region Remove invalid foreign keys - [Fact] - public void ImportProjects_InvalidRisk_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var agency = new Entity.Agency("Agency", "Agency"); - var tiers = new[] { new Entity.TierLevel(1, "FirstTier"), new Entity.TierLevel(2, "TierLevel") }; - var project = new Entity.Project("RAEG-0001", "Name", tiers.First()); - - var risk = new Entity.ProjectRisk("Risk", "Risk", 1); - var status = new Entity.ProjectStatus("Status", "Status"); - var workflow = new Entity.Workflow("Workflow", "Workflow"); - - var service = helper.GetService>(); - service.Setup(m => m.Project.Get(It.IsAny())).Returns(project); - service.Setup(m => m.Project.Add(It.IsAny>())); - service.Setup(m => m.Workflow.GetAll()).Returns(new[] { workflow }); - service.Setup(m => m.ProjectStatus.GetAll()).Returns(new[] { status }); - service.Setup(m => m.Agency.GetAll()).Returns(new[] { agency }); - service.Setup(m => m.ProjectRisk.GetAll()).Returns(new Entity.ProjectRisk[0]); - service.Setup(m => m.TierLevel.GetAll()).Returns(tiers); - service.Setup(m => m.Agency.Get(It.IsAny())).Returns(agency); - service.Setup(m => m.TierLevel.Get(It.IsAny())).Returns(tiers.Last()); - service.Setup(m => m.ProjectRisk.Get(It.IsAny())).Returns(risk); - service.Setup(m => m.ProjectStatus.Get(It.IsAny())).Returns(status); - service.Setup(m => m.Workflow.Get(It.IsAny())).Returns(workflow); - - var projects = new[] - { - new Model.ImportProjectModel() - { - ProjectNumber = "TEST-00001", - Workflow = "Workflow", - Activity = "Activity", - Status = "Status", - ActualFiscalYear = 2020, - ReportedFiscalYear = 2021, - Agency = "Agency", - Risk = "Risk", - Manager = "Manager", - Description = "Description", - CompletedOn = DateTime.UtcNow.AddDays(2), - MarketedOn = DateTime.UtcNow.AddDays(3), - Notes = new [] { new KeyValuePair("Private", "Note"), new KeyValuePair("Financial", "Note") }, - NetBook = 1, - Market = 2, - ProgramCost = 3, - SalesCost = 4, - InterestComponent = 5, - NetProceeds = 6, - Variance = 8, - GainLoss = 9, - OcgFinancialStatement = 10, - SaleWithLeaseInPlace = true - } - }; - - // Act - var result = controller.ImportProjects(projects, false); - - // Assert - Assert.NotNull(result); - JsonResult actionResult = Assert.IsType(result); - var data = Assert.IsAssignableFrom>(actionResult.Value); - data.Should().BeEmpty(); - } - - [Fact] - public void ImportProjects_InvalidStatus_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var agency = new Entity.Agency("Agency", "Agency"); - var tiers = new[] { new Entity.TierLevel(1, "FirstTier"), new Entity.TierLevel(2, "TierLevel") }; - var project = new Entity.Project("RAEG-0001", "Name", tiers.First()); - - var risk = new Entity.ProjectRisk("Risk", "Risk", 1); - var status = new Entity.ProjectStatus("Status", "Status"); - var workflow = new Entity.Workflow("Workflow", "Workflow"); - - var service = helper.GetService>(); - service.Setup(m => m.Project.Get(It.IsAny())).Returns(project); - service.Setup(m => m.Project.Add(It.IsAny>())); - service.Setup(m => m.ProjectStatus.GetAll()).Returns(new Entity.ProjectStatus[0]); - service.Setup(m => m.Workflow.GetAll()).Returns(new[] { workflow }); - service.Setup(m => m.ProjectRisk.GetAll()).Returns(new[] { risk }); - service.Setup(m => m.Agency.GetAll()).Returns(new[] { agency }); - service.Setup(m => m.TierLevel.GetAll()).Returns(tiers); - service.Setup(m => m.Agency.Get(It.IsAny())).Returns(agency); - service.Setup(m => m.TierLevel.Get(It.IsAny())).Returns(tiers.Last()); - service.Setup(m => m.ProjectRisk.Get(It.IsAny())).Returns(risk); - service.Setup(m => m.ProjectStatus.Get(It.IsAny())).Returns(status); - service.Setup(m => m.Workflow.Get(It.IsAny())).Returns(workflow); - - var projects = new[] - { - new Model.ImportProjectModel() - { - ProjectNumber = "TEST-00001", - Workflow = "Workflow", - Activity = "Activity", - Status = "Status", - ActualFiscalYear = 2020, - ReportedFiscalYear = 2021, - Agency = "Agency", - Risk = "Risk", - Manager = "Manager", - Description = "Description", - CompletedOn = DateTime.UtcNow.AddDays(2), - MarketedOn = DateTime.UtcNow.AddDays(3), - Notes = new [] { new KeyValuePair("Private", "Note"), new KeyValuePair("Financial", "Note") }, - NetBook = 1, - Market = 2, - ProgramCost = 3, - SalesCost = 4, - InterestComponent = 5, - NetProceeds = 6, - Variance = 8, - GainLoss = 9, - OcgFinancialStatement = 10, - SaleWithLeaseInPlace = true - } - }; - - // Act - var result = controller.ImportProjects(projects, false); - - // Assert - Assert.NotNull(result); - JsonResult actionResult = Assert.IsType(result); - var data = Assert.IsAssignableFrom>(actionResult.Value); - data.Should().BeEmpty(); - } - - [Fact] - public void ImportProjects_InvalidWorkflow_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var agency = new Entity.Agency("Agency", "Agency"); - var tiers = new[] { new Entity.TierLevel(1, "FirstTier"), new Entity.TierLevel(2, "TierLevel") }; - var project = new Entity.Project("RAEG-0001", "Name", tiers.First()); - - var risk = new Entity.ProjectRisk("Risk", "Risk", 1); - var status = new Entity.ProjectStatus("Status", "Status"); - var workflow = new Entity.Workflow("Workflow", "Workflow"); - - var service = helper.GetService>(); - service.Setup(m => m.Project.Get(It.IsAny())).Returns(project); - service.Setup(m => m.Project.Add(It.IsAny>())); - service.Setup(m => m.Workflow.GetAll()).Returns(new Entity.Workflow[0]); - service.Setup(m => m.ProjectStatus.GetAll()).Returns(new[] { status }); - service.Setup(m => m.ProjectRisk.GetAll()).Returns(new[] { risk }); - service.Setup(m => m.Agency.GetAll()).Returns(new[] { agency }); - service.Setup(m => m.TierLevel.GetAll()).Returns(tiers); - service.Setup(m => m.Agency.Get(It.IsAny())).Returns(agency); - service.Setup(m => m.TierLevel.Get(It.IsAny())).Returns(tiers.Last()); - service.Setup(m => m.ProjectRisk.Get(It.IsAny())).Returns(risk); - service.Setup(m => m.ProjectStatus.Get(It.IsAny())).Returns(status); - service.Setup(m => m.Workflow.Get(It.IsAny())).Returns(workflow); - - var projects = new[] - { - new Model.ImportProjectModel() - { - ProjectNumber = "TEST-00001", - Workflow = "Workflow", - Activity = "Activity", - Status = "Status", - ActualFiscalYear = 2020, - ReportedFiscalYear = 2021, - Agency = "Agency", - Risk = "Risk", - Manager = "Manager", - Description = "Description", - CompletedOn = DateTime.UtcNow.AddDays(2), - MarketedOn = DateTime.UtcNow.AddDays(3), - Notes = new [] { new KeyValuePair("Private", "Note"), new KeyValuePair("Financial", "Note") }, - NetBook = 1, - Market = 2, - ProgramCost = 3, - SalesCost = 4, - InterestComponent = 5, - NetProceeds = 6, - Variance = 8, - GainLoss = 9, - OcgFinancialStatement = 10, - SaleWithLeaseInPlace = true - } - }; - - // Act - var result = controller.ImportProjects(projects, false); - - // Assert - Assert.NotNull(result); - JsonResult actionResult = Assert.IsType(result); - var data = Assert.IsAssignableFrom>(actionResult.Value); - data.Should().BeEmpty(); - } - - [Fact] - public void ImportProjects_InvalidAgency_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin); - - var agency = new Entity.Agency("Agency", "Agency"); - var tiers = new[] { new Entity.TierLevel(1, "FirstTier"), new Entity.TierLevel(2, "TierLevel") }; - var project = new Entity.Project("RAEG-0001", "Name", tiers.First()); - - var risk = new Entity.ProjectRisk("Risk", "Risk", 1); - var status = new Entity.ProjectStatus("Status", "Status"); - var workflow = new Entity.Workflow("Workflow", "Workflow"); - - var service = helper.GetService>(); - service.Setup(m => m.Project.Get(It.IsAny())).Returns(project); - service.Setup(m => m.Project.Add(It.IsAny>())); - service.Setup(m => m.Workflow.GetAll()).Returns(new[] { workflow }); - service.Setup(m => m.ProjectStatus.GetAll()).Returns(new[] { status }); - service.Setup(m => m.ProjectRisk.GetAll()).Returns(new[] { risk }); - service.Setup(m => m.Agency.GetAll()).Returns(new Entity.Agency[0]); - service.Setup(m => m.TierLevel.GetAll()).Returns(tiers); - service.Setup(m => m.Agency.Get(It.IsAny())).Returns(agency); - service.Setup(m => m.TierLevel.Get(It.IsAny())).Returns(tiers.Last()); - service.Setup(m => m.ProjectRisk.Get(It.IsAny())).Returns(risk); - service.Setup(m => m.ProjectStatus.Get(It.IsAny())).Returns(status); - service.Setup(m => m.Workflow.Get(It.IsAny())).Returns(workflow); - - var projects = new[] - { - new Model.ImportProjectModel() - { - ProjectNumber = "TEST-00001", - Workflow = "Workflow", - Activity = "Activity", - Status = "Status", - ActualFiscalYear = 2020, - ReportedFiscalYear = 2021, - Agency = "Agency", - Risk = "Risk", - Manager = "Manager", - Description = "Description", - CompletedOn = DateTime.UtcNow.AddDays(2), - MarketedOn = DateTime.UtcNow.AddDays(3), - Notes = new [] { new KeyValuePair("Private", "Note"), new KeyValuePair("Financial", "Note") }, - NetBook = 1, - Market = 2, - ProgramCost = 3, - SalesCost = 4, - InterestComponent = 5, - NetProceeds = 6, - Variance = 8, - GainLoss = 9, - OcgFinancialStatement = 10, - SaleWithLeaseInPlace = true - } - }; - - // Act - var result = controller.ImportProjects(projects, false); - - // Assert - Assert.NotNull(result); - JsonResult actionResult = Assert.IsType(result); - var data = Assert.IsAssignableFrom>(actionResult.Value); - data.Should().BeEmpty(); - } - #endregion - - #region Tiers - [Fact] - public void ImportProjects_Tier1_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin, Permissions.PropertyAdd, Permissions.AdminProperties); - - var agency = new Entity.Agency("Agency", "Agency"); - var tiers = new[] { new Entity.TierLevel(1, "FirstTier"), new Entity.TierLevel(2, "TierLevel") }; - var project = new Entity.Project("RAEG-0001", "Name", tiers.First()); - - var pimsService = helper.GetService>(); - pimsService.Setup(m => m.Task.GetForWorkflow(It.IsAny())).Returns(new Entity.Task[0]); - - var risk = new Entity.ProjectRisk("Risk", "Risk", 1); - var status = new Entity.ProjectStatus("Status", "Status"); - var workflow = new Entity.Workflow("Workflow", "Workflow"); - - var service = helper.GetService>(); - service.Setup(m => m.Project.Get(It.IsAny())).Returns(project); - service.Setup(m => m.Project.Add(It.IsAny>())); - service.Setup(m => m.Workflow.GetAll()).Returns(new[] { workflow }); - service.Setup(m => m.ProjectStatus.GetAll()).Returns(new[] { status }); - service.Setup(m => m.ProjectRisk.GetAll()).Returns(new[] { risk }); - service.Setup(m => m.Agency.GetAll()).Returns(new[] { agency }); - service.Setup(m => m.TierLevel.GetAll()).Returns(tiers); - service.Setup(m => m.Agency.Get(It.IsAny())).Returns(agency); - service.Setup(m => m.TierLevel.Get(It.IsAny())).Returns(tiers.First()); - service.Setup(m => m.ProjectRisk.Get(It.IsAny())).Returns(risk); - service.Setup(m => m.ProjectStatus.Get(It.IsAny())).Returns(status); - service.Setup(m => m.Workflow.Get(It.IsAny())).Returns(workflow); - - var projects = new[] - { - new Model.ImportProjectModel() - { - ProjectNumber = "TEST-00001", - Workflow = "Workflow", - Activity = "Activity", - Status = "Status", - ActualFiscalYear = 2020, - ReportedFiscalYear = 2021, - Agency = "Agency", - Risk = "Risk", - Manager = "Manager", - Description = "Description", - CompletedOn = DateTime.UtcNow.AddDays(2), - MarketedOn = DateTime.UtcNow.AddDays(3), - Notes = new [] { new KeyValuePair("Private", "Note"), new KeyValuePair("Financial", "Note") }, - NetBook = 1, - Market = 2, - ProgramCost = 3, - SalesCost = 4, - InterestComponent = 5, - NetProceeds = 6, - Variance = 8, - GainLoss = 9, - OcgFinancialStatement = 10, - SaleWithLeaseInPlace = true - } - }; - - // Act - var result = controller.ImportProjects(projects, false); - - // Assert - Assert.NotNull(result); - JsonResult actionResult = Assert.IsType(result); - var data = Assert.IsAssignableFrom>(actionResult.Value); - data.First().TierLevelId.Should().Be(1); - project.Tasks.Should().BeEmpty(); - } - - [Fact] - public void ImportProjects_Tier2_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin, Permissions.PropertyAdd, Permissions.AdminProperties); - - var agency = new Entity.Agency("Agency", "Agency"); - var tiers = new[] { new Entity.TierLevel(1, "FirstTier"), new Entity.TierLevel(2, "TierLevel") }; - var project = new Entity.Project("RAEG-0001", "Name", tiers.First()); - - var pimsService = helper.GetService>(); - pimsService.Setup(m => m.Task.GetForWorkflow(It.IsAny())).Returns(new Entity.Task[0]); - - var risk = new Entity.ProjectRisk("Risk", "Risk", 1); - var status = new Entity.ProjectStatus("Status", "Status"); - var workflow = new Entity.Workflow("Workflow", "Workflow"); - - var service = helper.GetService>(); - service.Setup(m => m.Project.Get(It.IsAny())).Returns(project); - service.Setup(m => m.Project.Add(It.IsAny>())); - service.Setup(m => m.Workflow.GetAll()).Returns(new[] { workflow }); - service.Setup(m => m.ProjectStatus.GetAll()).Returns(new[] { status }); - service.Setup(m => m.ProjectRisk.GetAll()).Returns(new[] { risk }); - service.Setup(m => m.Agency.GetAll()).Returns(new[] { agency }); - service.Setup(m => m.TierLevel.GetAll()).Returns(tiers); - service.Setup(m => m.Agency.Get(It.IsAny())).Returns(agency); - service.Setup(m => m.TierLevel.Get(It.IsAny())).Returns(tiers.Last()); - service.Setup(m => m.ProjectRisk.Get(It.IsAny())).Returns(risk); - service.Setup(m => m.ProjectStatus.Get(It.IsAny())).Returns(status); - service.Setup(m => m.Workflow.Get(It.IsAny())).Returns(workflow); - - var projects = new[] - { - new Model.ImportProjectModel() - { - ProjectNumber = "TEST-00001", - Workflow = "Workflow", - Activity = "Activity", - Status = "Status", - ActualFiscalYear = 2020, - ReportedFiscalYear = 2021, - Agency = "Agency", - Risk = "Risk", - Manager = "Manager", - Description = "Description", - CompletedOn = DateTime.UtcNow.AddDays(2), - MarketedOn = DateTime.UtcNow.AddDays(3), - Notes = new [] { new KeyValuePair("Private", "Note"), new KeyValuePair("Financial", "Note") }, - NetBook = 1, - Market = 1000000, - ProgramCost = 3, - SalesCost = 4, - InterestComponent = 5, - NetProceeds = 6, - Variance = 8, - GainLoss = 9, - OcgFinancialStatement = 10, - SaleWithLeaseInPlace = true - } - }; - - // Act - var result = controller.ImportProjects(projects, false); - - // Assert - Assert.NotNull(result); - JsonResult actionResult = Assert.IsType(result); - var data = Assert.IsAssignableFrom>(actionResult.Value); - data.First().TierLevelId.Should().Be(2); - project.Tasks.Should().BeEmpty(); - } - - [Fact] - public void ImportProjects_Tier3_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin, Permissions.PropertyAdd, Permissions.AdminProperties); - - var agency = new Entity.Agency("Agency", "Agency"); - var tiers = new[] { new Entity.TierLevel(1, "FirstTier"), new Entity.TierLevel(2, "TierLevel"), new Entity.TierLevel(3, "TierLevel"), new Entity.TierLevel(4, "TierLevel") }; - var project = new Entity.Project("RAEG-0001", "Name", tiers.First()); - - var pimsService = helper.GetService>(); - pimsService.Setup(m => m.Task.GetForWorkflow(It.IsAny())).Returns(new Entity.Task[0]); - - var risk = new Entity.ProjectRisk("Risk", "Risk", 1); - var status = new Entity.ProjectStatus("Status", "Status"); - var workflow = new Entity.Workflow("Workflow", "Workflow"); - - var service = helper.GetService>(); - service.Setup(m => m.Project.Get(It.IsAny())).Returns(project); - service.Setup(m => m.Project.Add(It.IsAny>())); - service.Setup(m => m.Workflow.GetAll()).Returns(new[] { workflow }); - service.Setup(m => m.ProjectStatus.GetAll()).Returns(new[] { status }); - service.Setup(m => m.ProjectRisk.GetAll()).Returns(new[] { risk }); - service.Setup(m => m.Agency.GetAll()).Returns(new[] { agency }); - service.Setup(m => m.TierLevel.GetAll()).Returns(tiers); - service.Setup(m => m.Agency.Get(It.IsAny())).Returns(agency); - service.Setup(m => m.TierLevel.Get(It.IsAny())).Returns(tiers.Next(2)); - service.Setup(m => m.ProjectRisk.Get(It.IsAny())).Returns(risk); - service.Setup(m => m.ProjectStatus.Get(It.IsAny())).Returns(status); - service.Setup(m => m.Workflow.Get(It.IsAny())).Returns(workflow); - - var projects = new[] - { - new Model.ImportProjectModel() - { - ProjectNumber = "TEST-00001", - Workflow = "Workflow", - Activity = "Activity", - Status = "Status", - ActualFiscalYear = 2020, - ReportedFiscalYear = 2021, - Agency = "Agency", - Risk = "Risk", - Manager = "Manager", - Description = "Description", - CompletedOn = DateTime.UtcNow.AddDays(2), - MarketedOn = DateTime.UtcNow.AddDays(3), - Notes = new [] { new KeyValuePair("Private", "Note"), new KeyValuePair("Financial", "Note") }, - NetBook = 1, - Market = 10000000, - ProgramCost = 3, - SalesCost = 4, - InterestComponent = 5, - NetProceeds = 6, - Variance = 8, - GainLoss = 9, - OcgFinancialStatement = 10, - SaleWithLeaseInPlace = true - } - }; - - // Act - var result = controller.ImportProjects(projects, false); - - // Assert - Assert.NotNull(result); - JsonResult actionResult = Assert.IsType(result); - var actualResult = Assert.IsAssignableFrom>(actionResult.Value); - actualResult.First().TierLevelId.Should().Be(3); - project.Tasks.Should().BeEmpty(); - } - - [Fact] - public void ImportProjects_Tier4_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.SystemAdmin, Permissions.PropertyAdd, Permissions.AdminProperties); - - var agency = new Entity.Agency("Agency", "Agency"); - var tiers = new[] { new Entity.TierLevel(1, "FirstTier"), new Entity.TierLevel(2, "TierLevel"), new Entity.TierLevel(3, "TierLevel"), new Entity.TierLevel(4, "TierLevel") }; - var project = new Entity.Project("RAEG-0001", "Name", tiers.First()); - project.AddProperty(EntityHelper.CreateParcel(1)); - project.AddProperty(EntityHelper.CreateParcel(2)); - - var pimsService = helper.GetService>(); - pimsService.Setup(m => m.Task.GetForWorkflow(It.IsAny())).Returns(new Entity.Task[0]); - - var risk = new Entity.ProjectRisk("Risk", "Risk", 1); - var status = new Entity.ProjectStatus("Status", "Status"); - var workflow = new Entity.Workflow("Workflow", "Workflow"); - - var adminService = helper.GetService>(); - adminService.Setup(m => m.Project.Get(It.IsAny())).Returns(project); - adminService.Setup(m => m.Project.Add(It.IsAny>())); - adminService.Setup(m => m.Workflow.GetAll()).Returns(new[] { workflow }); - adminService.Setup(m => m.ProjectStatus.GetAll()).Returns(new[] { status }); - adminService.Setup(m => m.ProjectRisk.GetAll()).Returns(new[] { risk }); - adminService.Setup(m => m.Agency.GetAll()).Returns(new[] { agency }); - adminService.Setup(m => m.TierLevel.GetAll()).Returns(tiers); - adminService.Setup(m => m.Agency.Get(It.IsAny())).Returns(agency); - adminService.Setup(m => m.TierLevel.Get(It.IsAny())).Returns(tiers.Last()); - adminService.Setup(m => m.ProjectRisk.Get(It.IsAny())).Returns(risk); - adminService.Setup(m => m.ProjectStatus.Get(It.IsAny())).Returns(status); - adminService.Setup(m => m.Workflow.Get(It.IsAny())).Returns(workflow); - adminService.Setup(m => m.Parcel.Find(1)).Returns(project.Properties.First().Parcel); - adminService.Setup(m => m.Parcel.Find(2)).Returns(project.Properties.Last().Parcel); - - var service = helper.GetService>(); - service.Setup(m => m.Parcel.Get(1)).Returns(project.Properties.First().Parcel); - service.Setup(m => m.Parcel.Get(2)).Returns(project.Properties.Last().Parcel); - - var projects = new[] - { - new Model.ImportProjectModel() - { - ProjectNumber = "TEST-00001", - Workflow = "Workflow", - Activity = "Activity", - Status = "Status", - ActualFiscalYear = 2020, - ReportedFiscalYear = 2021, - Agency = "Agency", - Risk = "Risk", - Manager = "Manager", - Description = "Description", - CompletedOn = DateTime.UtcNow.AddDays(2), - MarketedOn = DateTime.UtcNow.AddDays(3), - Notes = new [] { new KeyValuePair("Private", "Note"), new KeyValuePair("Financial", "Note") }, - NetBook = 1, - Market = 10000000, - ProgramCost = 3, - SalesCost = 4, - InterestComponent = 5, - NetProceeds = 6, - Variance = 8, - GainLoss = 9, - OcgFinancialStatement = 10, - SaleWithLeaseInPlace = true - } - }; - - // Act - var result = controller.ImportProjects(projects, false); - - // Assert - Assert.NotNull(result); - JsonResult actionResult = Assert.IsType(result); - var data = Assert.IsAssignableFrom>(actionResult.Value); - data.First().TierLevelId.Should().Be(4); - project.Tasks.Should().BeEmpty(); - } - #endregion - #endregion - #endregion - } -} diff --git a/backend/tests/unit/api/Controllers/Tools/LtsaControllerTest.cs b/backend/tests/unit/api/Controllers/Tools/LtsaControllerTest.cs deleted file mode 100644 index 6ad7cc375d..0000000000 --- a/backend/tests/unit/api/Controllers/Tools/LtsaControllerTest.cs +++ /dev/null @@ -1,155 +0,0 @@ -using System.Threading.Tasks; -using FluentAssertions; -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Areas.Tools.Controllers; -using Pims.Core.Http.Models; -using Pims.Ltsa; -using LtsaModel = Pims.Core.Http.Models; -using Xunit; -using Pims.Dal.Security; -using Pims.Core.Test; -using System.Collections.Generic; -using System; - -namespace Pims.Api.Test.Controllers.Tools -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "tools")] - [Trait("group", "ltsa")] - public class LtsaControllerTest - { - - public LtsaControllerTest() { } - - [Fact] - public async Task GetLandTitleInfo_WithValidPid_ReturnsOkResultWithLandTitle() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyEdit); - // Arrange - - var pid = "005-666-767"; - var response = new LtsaOrderModel - { - Order = new LtsaOrder - { - ProductType = "title", - FileReference = "test", - ProductOrderParameters = new LtsaProductOrderParameters - { - TitleNumber = "CA2998256", - LandTitleDistrictCode = "NW", - IncludeCancelledInfo = false - }, - OrderId = Guid.NewGuid(), - Status = "Processing", - BillingInfo = new LtsaBillingInfo - { - BillingModel = "PROV", - ProductName = "Searches", - ProductCode = "Search", - FeeExempted = true, - ProductFee = 0, - ServiceCharge = 0.0, - SubtotalFee = 0.0, - ProductFeeTax = 0, - ServiceChargeTax = 0.0, - TotalTax = 0.0, - TotalFee = 0.0 - }, - OrderedProduct = new LtsaOrderedProduct - { - FieldedData = new LtsaFieldedData - { - TitleStatus = "REGISTERED", - TitleIdentifier = new LtsaTitleIdentifier - { - TitleNumber = "CA2998256", - LandTitleDistrict = "NEW WESTMINSTER" - }, - Tombstone = new LtsaTombstone - { - ApplicationReceivedDate = DateTime.Parse("2013-02-19T00:31:57Z"), - EnteredDate = DateTime.Parse("2013-03-12T17:43:20Z"), - TitleRemarks = "", - RootOfTitle = "ROAD", - MarketValueAmount = "834750", - FromTitles = new List(), - NatureOfTransfers = new List - { - new LtsaNatureOfTransfer - { - TransferReason = "SEE DOCUMENTATION" - } - } - }, - OwnershipGroups = new List - { - new LtsaOwnershipGroup - { - JointTenancyIndication = false, - InterestFractionNumerator = "1", - InterestFractionDenominator = "1", - OwnershipRemarks = "", - TitleOwners = new List - { - new LtsaTitleOwner - { - LastNameOrCorpName1 = "BC TRANSPORTATION FINANCING AUTHORITY", - GivenName = "", - IncorporationNumber = "", - OccupationDescription = "", - Address = new LtsaAddress - { - AddressLine1 = "P.O. BOX 9580, STN PROV GOVT", - AddressLine2 = "", - City = "VICTORIA", - Province = "BC", - ProvinceName = "BC", - Country = "CANADA", - PostalCode = "V8W 9T5" - } - } - } - } - }, - TaxAuthorities = new List - { - new LtsaTaxAuthority - { - AuthorityName = "Delta, City of" - } - }, - DescriptionsOfLand = new List - { - new LtsaDescriptionOfLand - { - ParcelIdentifier = "029-020-174", - FullLegalDescription = "THAT PART OF THE NORTHWEST 1/4 OF SECTION 25 TOWNSHIP 5 \nNEW WESTMINSTER DISTRICT SHOWN ON PLAN EPP67641 \n", - ParcelStatus = "ACTIVE" - } - }, - LegalNotationsOnTitle = new List(), - DuplicateCertificatesOfTitle = new List(), - TitleTransfersOrDispositions = new List() - } - } - } - }; - - - var service = helper.GetService>(); - service.Setup(m => m.ProcessLTSARequest(pid)).ReturnsAsync(response); - - // Act - var result = await controller.GetLandTitleInfo(pid); - - // Assert - JsonResult actionResult = Assert.IsType(result); - var ltsaOrder = Assert.IsAssignableFrom(actionResult.Value); - } - } -} diff --git a/backend/tests/unit/api/Controllers/UserControllerTest.cs b/backend/tests/unit/api/Controllers/UserControllerTest.cs deleted file mode 100644 index a31bca49ae..0000000000 --- a/backend/tests/unit/api/Controllers/UserControllerTest.cs +++ /dev/null @@ -1,459 +0,0 @@ -using MapsterMapper; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Options; -using Moq; -using Pims.Api.Controllers; -using Pims.Api.Helpers.Exceptions; -using Pims.Core.Comparers; -using Pims.Core.Http; -using Pims.Core.Http.Configuration; -using Pims.Core.Test; -using Pims.Dal; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Net; -using System.Net.Http; -using System.Threading.Tasks; -using Xunit; -using Entity = Pims.Dal.Entities; -using KModel = Pims.Keycloak.Models; -using Model = Pims.Api.Models.User; - -namespace PimsApi.Test.Controllers -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("group", "user")] - [ExcludeFromCodeCoverage] - public class UserControllerTest - { - #region Constructors - public UserControllerTest() - { - } - #endregion - - #region Tests - #region UserInfo - [Fact] - public async Task UserInfo_Success() - { - // Arrange - var user = PrincipalHelper.CreateForRole(); - var helper = new TestHelper(); - var options = new Pims.Keycloak.Configuration.KeycloakOptions() - { - Authority = "test", - Audience = "test", - Client = "test", - OpenIdConnect = new OpenIdConnectOptions() - { - Token = "test", - UserInfo = "test" - } - }; - var optionsMonitor = new Mock>(); - optionsMonitor.Setup(m => m.CurrentValue).Returns(options); - var controller = helper.CreateController(user, optionsMonitor.Object); - - var service = helper.GetService>(); - var model = new KModel.UserInfoModel() - { - Id = Guid.NewGuid() - }; - var response = new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(model)) - }; - service.Setup(m => m.ProxyGetAsync(It.IsAny(), It.IsAny())).Returns(Task.FromResult(response)); - - // Act - var result = await controller.UserInfoAsync(); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(model, actualResult, new ShallowPropertyCompare()); - service.Verify(m => m.ProxyGetAsync(It.IsAny(), It.IsAny()), Times.Once()); - } - #endregion - - #region GetAccessRequest - [Fact] - public void GetAccessRequest_Current_Success() - { - // Arrange - var user = PrincipalHelper.CreateForRole(); - var helper = new TestHelper(); - var controller = helper.CreateController(user); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - - var accessRequest = EntityHelper.CreateAccessRequest(); - service.Setup(m => m.User.GetAccessRequest()).Returns(accessRequest); - var model = mapper.Map(accessRequest); - - // Act - var result = controller.GetAccessRequest(); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(model, actualResult, new ShallowPropertyCompare()); - Assert.Equal(model.Agencies, actualResult.Agencies, new DeepPropertyCompare()); - Assert.Equal(model.Roles, actualResult.Roles, new DeepPropertyCompare()); - Assert.Equal(model.User.Id, actualResult.User.Id); - service.Verify(m => m.User.GetAccessRequest(), Times.Once()); - } - - [Fact] - public void GetAccessRequest_Current_NoContent() - { - // Arrange - var user = PrincipalHelper.CreateForRole(); - var helper = new TestHelper(); - var controller = helper.CreateController(user); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - - service.Setup(m => m.User.GetAccessRequest()); - - // Act - var result = controller.GetAccessRequest(); - - // Assert - var actionResult = Assert.IsType(result); - service.Verify(m => m.User.GetAccessRequest(), Times.Once()); - } - - [Fact] - public void GetAccessRequest_Success() - { - // Arrange - var user = PrincipalHelper.CreateForRole(); - var helper = new TestHelper(); - var controller = helper.CreateController(user); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - - var accessRequest = EntityHelper.CreateAccessRequest(); - service.Setup(m => m.User.GetAccessRequest(It.IsAny())).Returns(accessRequest); - var model = mapper.Map(accessRequest); - - // Act - var result = controller.GetAccessRequest(1); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(model, actualResult, new ShallowPropertyCompare()); - Assert.Equal(model.Agencies, actualResult.Agencies, new DeepPropertyCompare()); - Assert.Equal(model.Roles, actualResult.Roles, new DeepPropertyCompare()); - Assert.Equal(model.User.Id, actualResult.User.Id); - service.Verify(m => m.User.GetAccessRequest(1), Times.Once()); - } - #endregion - - #region AddAccessRequest - [Fact] - public async void AddAccessRequest_Success() - { - // Arrange - var user = PrincipalHelper.CreateForRole(); - var helper = new TestHelper(); - var controller = helper.CreateController(user); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - service.Setup(m => m.User.AddAccessRequest(It.IsAny())); - - var accessRequest = EntityHelper.CreateAccessRequest(); - var model = mapper.Map(accessRequest); - - // Act - var result = await controller.AddAccessRequestAsync(model); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(model, actualResult, new ShallowPropertyCompare()); - Assert.Equal(model.Agencies, actualResult.Agencies, new DeepPropertyCompare()); - Assert.Equal(model.Roles, actualResult.Roles, new DeepPropertyCompare()); - Assert.Equal(model.User.Id, actualResult.User.Id); - service.Verify(m => m.User.AddAccessRequest(It.IsAny()), Times.Once()); - } - - [Fact] - public async void AddAccessRequestAsync_Null_BadRequest() - { - // Arrange - var user = PrincipalHelper.CreateForRole(); - var helper = new TestHelper(); - var controller = helper.CreateController(user); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - service.Setup(m => m.User.AddAccessRequest(It.IsAny())); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await controller.AddAccessRequestAsync(null)); - service.Verify(m => m.User.AddAccessRequest(It.IsAny()), Times.Never()); - } - - [Fact] - public async void AddAccessRequestAsync_NullAgencies_BadRequest() - { - // Arrange - var user = PrincipalHelper.CreateForRole(); - var helper = new TestHelper(); - var controller = helper.CreateController(user); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - service.Setup(m => m.User.AddAccessRequest(It.IsAny())); - - var accessRequest = new Model.AccessRequestModel() - { - Agencies = null, - Roles = new List() - }; - var model = mapper.Map(accessRequest); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await controller.AddAccessRequestAsync(model)); - service.Verify(m => m.User.AddAccessRequest(It.IsAny()), Times.Never()); - } - - [Fact] - public async void AddAccessRequestAsync_NullRoles_BadRequest() - { - // Arrange - var user = PrincipalHelper.CreateForRole(); - var helper = new TestHelper(); - var controller = helper.CreateController(user); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - service.Setup(m => m.User.AddAccessRequest(It.IsAny())); - - var accessRequest = new Model.AccessRequestModel() - { - Agencies = new List(), - Roles = null - }; - var model = mapper.Map(accessRequest); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await controller.AddAccessRequestAsync(model)); - service.Verify(m => m.User.AddAccessRequest(It.IsAny()), Times.Never()); - } - - [Fact] - public async void AddAccessRequestAsync_InvalidRoles_BadRequest() - { - // Arrange - var user = PrincipalHelper.CreateForRole(); - var helper = new TestHelper(); - var controller = helper.CreateController(user); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - service.Setup(m => m.User.AddAccessRequest(It.IsAny())); - - var accessRequest = new Model.AccessRequestModel() - { - Agencies = new List(new[] { new Model.AccessRequestAgencyModel() }), - Roles = new List() - }; - var model = mapper.Map(accessRequest); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await controller.AddAccessRequestAsync(model)); - service.Verify(m => m.User.AddAccessRequest(It.IsAny()), Times.Never()); - } - - [Fact] - public async void AddAccessRequestAsync_InvalidAgencies_BadRequest() - { - // Arrange - var user = PrincipalHelper.CreateForRole(); - var helper = new TestHelper(); - var controller = helper.CreateController(user); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - service.Setup(m => m.User.AddAccessRequest(It.IsAny())); - - var accessRequest = new Model.AccessRequestModel() - { - Agencies = new List(), - Roles = new List(new[] { new Model.AccessRequestRoleModel() }) - }; - var model = mapper.Map(accessRequest); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await controller.AddAccessRequestAsync(model)); - service.Verify(m => m.User.AddAccessRequest(It.IsAny()), Times.Never()); - } - #endregion - - #region UpdateAccessRequest - [Fact] - public void UpdateAccessRequest_Success() - { - // Arrange - var user = PrincipalHelper.CreateForRole(); - var helper = new TestHelper(); - var controller = helper.CreateController(user); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - service.Setup(m => m.User.UpdateAccessRequest(It.IsAny())); - - var accessRequest = EntityHelper.CreateAccessRequest(); - var model = mapper.Map(accessRequest); - - // Act - var result = controller.UpdateAccessRequest(model.Id, model); - - // Assert - var actionResult = Assert.IsType(result); - var actualResult = Assert.IsType(actionResult.Value); - Assert.Equal(model, actualResult, new ShallowPropertyCompare()); - Assert.Equal(model.Agencies, actualResult.Agencies, new DeepPropertyCompare()); - Assert.Equal(model.Roles, actualResult.Roles, new DeepPropertyCompare()); - Assert.Equal(model.User.Id, actualResult.User.Id); - service.Verify(m => m.User.UpdateAccessRequest(It.IsAny()), Times.Once()); - } - - [Fact] - public void UpdateAccessRequest_Null_BadRequest() - { - // Arrange - var user = PrincipalHelper.CreateForRole(); - var helper = new TestHelper(); - var controller = helper.CreateController(user); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - service.Setup(m => m.User.UpdateAccessRequest(It.IsAny())); - - // Act - // Assert - Assert.Throws(() => controller.UpdateAccessRequest(1, null)); - service.Verify(m => m.User.UpdateAccessRequest(It.IsAny()), Times.Never()); - } - - [Fact] - public void UpdateAccessRequest_NullAgencies_BadRequest() - { - // Arrange - var user = PrincipalHelper.CreateForRole(); - var helper = new TestHelper(); - var controller = helper.CreateController(user); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - service.Setup(m => m.User.UpdateAccessRequest(It.IsAny())); - - var accessRequest = new Model.AccessRequestModel() - { - Agencies = null, - Roles = new List() - }; - var model = mapper.Map(accessRequest); - - // Act - // Assert - Assert.Throws(() => controller.UpdateAccessRequest(model.Id, model)); - service.Verify(m => m.User.UpdateAccessRequest(It.IsAny()), Times.Never()); - } - - [Fact] - public void UpdateAccessRequest_NullRoles_BadRequest() - { - // Arrange - var user = PrincipalHelper.CreateForRole(); - var helper = new TestHelper(); - var controller = helper.CreateController(user); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - service.Setup(m => m.User.UpdateAccessRequest(It.IsAny())); - - var accessRequest = new Model.AccessRequestModel() - { - Agencies = new List(), - Roles = null - }; - var model = mapper.Map(accessRequest); - - // Act - // Assert - Assert.Throws(() => controller.UpdateAccessRequest(model.Id, model)); - service.Verify(m => m.User.UpdateAccessRequest(It.IsAny()), Times.Never()); - } - - [Fact] - public void UpdateAccessRequest_InvalidRoles_BadRequest() - { - // Arrange - var user = PrincipalHelper.CreateForRole(); - var helper = new TestHelper(); - var controller = helper.CreateController(user); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - service.Setup(m => m.User.UpdateAccessRequest(It.IsAny())); - - var accessRequest = new Model.AccessRequestModel() - { - Agencies = new List(new[] { new Model.AccessRequestAgencyModel() }), - Roles = new List() - }; - var model = mapper.Map(accessRequest); - - // Act - // Assert - Assert.Throws(() => controller.UpdateAccessRequest(model.Id, model)); - service.Verify(m => m.User.UpdateAccessRequest(It.IsAny()), Times.Never()); - } - - [Fact] - public void UpdateAccessRequest_InvalidAgencies_BadRequest() - { - // Arrange - var user = PrincipalHelper.CreateForRole(); - var helper = new TestHelper(); - var controller = helper.CreateController(user); - - var service = helper.GetService>(); - var mapper = helper.GetService(); - service.Setup(m => m.User.UpdateAccessRequest(It.IsAny())); - - var accessRequest = new Model.AccessRequestModel() - { - Agencies = new List(), - Roles = new List(new[] { new Model.AccessRequestRoleModel() }) - }; - var model = mapper.Map(accessRequest); - - // Act - // Assert - Assert.Throws(() => controller.UpdateAccessRequest(model.Id, model)); - service.Verify(m => m.User.UpdateAccessRequest(It.IsAny()), Times.Never()); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/api/Helpers/ExceptionExtensionsTest.cs b/backend/tests/unit/api/Helpers/ExceptionExtensionsTest.cs deleted file mode 100644 index b6b4c76ec4..0000000000 --- a/backend/tests/unit/api/Helpers/ExceptionExtensionsTest.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Pims.Api.Helpers.Exceptions; -using Pims.Api.Helpers.Extensions; -using System; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Test.Helpers -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("category", "function")] - [ExcludeFromCodeCoverage] - public class ExceptionExtensionsTest - { - #region Tests - [Fact] - public void ThrowBadRequestIfNull_WithNull() - { - // Arrange - Entity.Parcel parcel = null; - - // Act - // Assert - Assert.Throws(() => parcel.ThrowBadRequestIfNull("test")); - } - - [Theory] - [InlineData(null)] - [InlineData("")] - [InlineData(" ")] - public void ThrowBadRequestIfNull_ArgumentException(string message) - { - // Arrange - Entity.Parcel parcel = null; - - // Act - // Assert - Assert.Throws(() => parcel.ThrowBadRequestIfNull(message)); - } - - [Fact] - public void ThrowBadRequestIfNull_WithObject() - { - // Arrange - var parcel = new Entity.Parcel(); - - // Act - parcel.ThrowBadRequestIfNull("test"); - - // Assert - Assert.NotNull(parcel); - } - #endregion - } -} diff --git a/backend/tests/unit/api/Helpers/HttpResponseMessageExtensionsTest.cs b/backend/tests/unit/api/Helpers/HttpResponseMessageExtensionsTest.cs deleted file mode 100644 index 605fcf1b99..0000000000 --- a/backend/tests/unit/api/Helpers/HttpResponseMessageExtensionsTest.cs +++ /dev/null @@ -1,124 +0,0 @@ -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Mvc; -using Moq; -using Pims.Api.Helpers.Extensions; -using Pims.Core.Comparers; -using Pims.Core.Test; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Net; -using System.Net.Http; -using System.Threading.Tasks; -using Xunit; -using Model = Pims.Api.Models.Parcel; - -namespace Pims.Api.Test.Helpers -{ - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("category", "function")] - [ExcludeFromCodeCoverage] - public class HttpResponseMessageExtensionsTest - { - #region Data - public static IEnumerable SuccessCodes = - new List - { - new object[] { HttpStatusCode.OK }, - new object[] { HttpStatusCode.Created } - }; - - public static IEnumerable FailureCodes = - new List - { - new object[] { HttpStatusCode.BadRequest, new Exception("BadRequest") }, - new object[] { HttpStatusCode.InternalServerError, new Exception("InternalServerError") }, - new object[] { HttpStatusCode.Unauthorized, new Exception("Unauthorized") }, - new object[] { HttpStatusCode.NotFound, new Exception("NotFound") }, - new object[] { HttpStatusCode.Forbidden, new Exception("Forbidden") } - }; - #endregion - - #region Tests - [Theory] - [MemberData(nameof(SuccessCodes))] - public async Task HandleResponseAsync_Success(HttpStatusCode code) - { - // Arrange - var helper = new TestHelper(); - var mapper = helper.GetMapper(); - var model = mapper.Map(EntityHelper.CreateParcel(1)); - var json = System.Text.Json.JsonSerializer.Serialize(model); - var response = new HttpResponseMessage - { - StatusCode = code, - Content = new StringContent(json) - }; - - // Act - var actionResult = await response.HandleResponseAsync(); - - // Assert - var jsonResult = Assert.IsType(actionResult); - Assert.Equal((int)code, jsonResult.StatusCode); - var actualResult = Assert.IsType(jsonResult.Value); - Assert.Equal(model, actualResult, new DeepPropertyCompare()); - } - - [Theory] - [MemberData(nameof(FailureCodes))] - public async Task HandleResponseAsync_Failure(HttpStatusCode code, Exception exception) - { - // Arrange - var env = new Mock(); - env.Setup(m => m.EnvironmentName).Returns("Development"); - var model = new Models.ErrorResponseModel(env.Object, exception); - var json = System.Text.Json.JsonSerializer.Serialize(model); - var response = new HttpResponseMessage - { - StatusCode = code, - Content = new StringContent(json) - }; - - // Act - var actionResult = await response.HandleResponseAsync(); - - // Assert - var jsonResult = Assert.IsType(actionResult); - Assert.Equal((int)code, jsonResult.StatusCode); - var actualResult = Assert.IsType(jsonResult.Value); - Assert.Equal(json, actualResult.Error); - } - - [Theory] - [MemberData(nameof(FailureCodes))] - public async Task HandleResponseAsync_JsonFailure(HttpStatusCode code, Exception exception) - { - // Arrange - var env = new Mock(); - env.Setup(m => m.EnvironmentName).Returns("Development"); - var model = new Models.ErrorResponseModel(env.Object, exception); - var json = System.Text.Json.JsonSerializer.Serialize(model); - var response = new HttpResponseMessage - { - StatusCode = code, - Content = new StringContent(json) - }; - response.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json"); - - // Act - var actionResult = await response.HandleResponseAsync(); - - // Assert - var jsonResult = Assert.IsType(actionResult); - Assert.Equal((int)code, jsonResult.StatusCode); - var actualResult = Assert.IsType(jsonResult.Value); - Assert.Equal($"{model.Error}", $"{actualResult.GetProperty(nameof(Models.ErrorResponseModel.Error))}"); - Assert.Equal($"{model.Details}", $"{actualResult.GetProperty(nameof(Models.ErrorResponseModel.Details))}"); - Assert.Equal($"{model.Type}", $"{actualResult.GetProperty(nameof(Models.ErrorResponseModel.Type))}"); - Assert.Equal($"{model.StackTrace}", $"{actualResult.GetProperty(nameof(Models.ErrorResponseModel.StackTrace))}"); - } - #endregion - } -} diff --git a/backend/tests/unit/api/Mapping/BuildingControllerMapTest.cs b/backend/tests/unit/api/Mapping/BuildingControllerMapTest.cs deleted file mode 100644 index 3b1a51d0c2..0000000000 --- a/backend/tests/unit/api/Mapping/BuildingControllerMapTest.cs +++ /dev/null @@ -1,52 +0,0 @@ -using Pims.Core.Test; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Model = Pims.Api.Models.Building; - -namespace PimsApi.Test.Controllers -{ - [Trait("category", "unit")] - [Trait("category", "mapping")] - [Trait("group", "building")] - [ExcludeFromCodeCoverage] - public class BuildingControllerMapTest - { - #region Constructors - public BuildingControllerMapTest() - { - } - #endregion - - #region Tests - #region UserInfo - [Fact] - public void BuildingModelMapping() - { - // Arrange - var helper = new TestHelper(); - var mapper = helper.GetMapper(); - var parcel = EntityHelper.CreateParcel(99); - var building = EntityHelper.CreateBuilding(parcel, 99); - building.Location.Y = 1; - building.Location.X = 1; - - // Act - var result = mapper.Map(building); - - // Assert - Assert.Equal(99, result.Id); - Assert.Equal(99, result.ParcelId); - Assert.Equal(1, result.Latitude); - Assert.Equal(1, result.Longitude); - Assert.Equal("description-99", result.Description); - Assert.Equal(1, result.ClassificationId); - Assert.Equal(1, result.AgencyId); - Assert.Equal(1, result.BuildingConstructionTypeId); - Assert.Equal(1, result.BuildingOccupantTypeId); - Assert.Equal(1, result.BuildingPredominateUseId); - // TODO: test all other properties. - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/api/Mapping/ParcelControllerMapTest.cs b/backend/tests/unit/api/Mapping/ParcelControllerMapTest.cs deleted file mode 100644 index e4c119c5a4..0000000000 --- a/backend/tests/unit/api/Mapping/ParcelControllerMapTest.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Pims.Core.Test; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Model = Pims.Api.Models.Parcel; - -namespace PimsApi.Test.Controllers -{ - [Trait("category", "unit")] - [Trait("category", "mapping")] - [Trait("group", "parcel")] - [ExcludeFromCodeCoverage] - public class ParcelControllerMapTest - { - #region Constructors - public ParcelControllerMapTest() - { - } - #endregion - - #region Tests - #region UserInfo - [Fact] - public void ParcelModelMapping() - { - // Arrange - var helper = new TestHelper(); - var mapper = helper.GetMapper(); - var parcel = EntityHelper.CreateParcel(99); - parcel.Location.Y = 1; - parcel.Location.X = 1; - - // Act - var result = mapper.Map(parcel); - - // Assert - Assert.Equal(99, result.Id); - Assert.Equal(1, result.Latitude); - Assert.Equal(1, result.Longitude); - Assert.Equal("description-99", result.Description); - Assert.Equal(1, result.ClassificationId); - Assert.Equal(1, result.AgencyId); - // TODO: test all other properties. - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/api/Pims.Api.Test.csproj b/backend/tests/unit/api/Pims.Api.Test.csproj deleted file mode 100644 index e55b1f0ae7..0000000000 --- a/backend/tests/unit/api/Pims.Api.Test.csproj +++ /dev/null @@ -1,32 +0,0 @@ - - - - net7.0 - false - 1F4E301C-F03B-4A31-A6F2-6A77384A74DA - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - diff --git a/backend/tests/unit/api/Routes/Admin/AccessRequestControllerTest.cs b/backend/tests/unit/api/Routes/Admin/AccessRequestControllerTest.cs deleted file mode 100644 index 4500ad2fb8..0000000000 --- a/backend/tests/unit/api/Routes/Admin/AccessRequestControllerTest.cs +++ /dev/null @@ -1,68 +0,0 @@ -using Pims.Api.Areas.Admin.Controllers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Entities; -using Pims.Dal.Security; -using Xunit; - -namespace Pims.Api.Test.Routes.Admin -{ - /// - /// AccessRequestControllerTest class, provides a way to test endpoint routes. - /// - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "admin")] - [Trait("group", "accessRequest")] - [Trait("group", "route")] - public class AccessRequestControllerTest - { - #region Constructors - public AccessRequestControllerTest() - { - } - #endregion - - #region Tests - [Fact] - public void AccessRequests_Route() - { - // Arrange - // Act - // Assert - var type = typeof(AccessRequestController); - type.HasPermissions(Permissions.AdminUsers); - type.HasArea("admin"); - type.HasRoute("[area]/access/requests"); - type.HasRoute("v{version:apiVersion}/[area]/access/requests"); - type.HasApiVersion("1.0"); - } - - [Fact] - public void GetPage_Route() - { - // Arrange - var endpoint = typeof(AccessRequestController).FindMethod(nameof(AccessRequestController.GetPage), - typeof(int), typeof(int), typeof(string), typeof(string), - typeof(string), typeof(string), typeof(AccessRequestStatus)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet(); - } - - [Fact] - public void Delete_Route() - { - // Arrange - var endpoint = typeof(AccessRequestController).FindMethod(nameof(AccessRequestController.Delete), typeof(int), typeof(Pims.Api.Areas.Admin.Models.User.AccessRequestModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasDelete("{id}"); - } - #endregion - } -} diff --git a/backend/tests/unit/api/Routes/Admin/ClaimControllerTest.cs b/backend/tests/unit/api/Routes/Admin/ClaimControllerTest.cs deleted file mode 100644 index 949d1c1da2..0000000000 --- a/backend/tests/unit/api/Routes/Admin/ClaimControllerTest.cs +++ /dev/null @@ -1,108 +0,0 @@ -using Pims.Api.Areas.Admin.Controllers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Security; -using System; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Model = Pims.Api.Areas.Admin.Models.Claim; - -namespace Pims.Api.Test.Routes.Admin -{ - /// - /// ClaimControllerTest class, provides a way to test endpoint routes. - /// - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "admin")] - [Trait("group", "claim")] - [Trait("group", "route")] - [ExcludeFromCodeCoverage] - public class ClaimControllerTest - { - #region Variables - #endregion - - #region Constructors - public ClaimControllerTest() - { - } - #endregion - - #region Tests - [Fact] - public void Claim_Route() - { - // Arrange - // Act - // Assert - var type = typeof(ClaimController); - type.HasPermissions(Permissions.SystemAdmin); - type.HasArea("admin"); - type.HasRoute("[area]/claims"); - type.HasRoute("v{version:apiVersion}/[area]/claims"); - type.HasApiVersion("1.0"); - } - - [Fact] - public void GetClaims_Route() - { - // Arrange - var endpoint = typeof(ClaimController).FindMethod(nameof(ClaimController.GetClaims), typeof(int), typeof(int), typeof(string)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet(); - } - - [Fact] - public void GetClaim_Route() - { - // Arrange - var endpoint = typeof(ClaimController).FindMethod(nameof(ClaimController.GetClaim), typeof(Guid)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet("{id}"); - } - - [Fact] - public void AddClaim_Route() - { - // Arrange - var endpoint = typeof(ClaimController).FindMethod(nameof(ClaimController.AddClaim), typeof(Model.ClaimModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPost(); - } - - [Fact] - public void UpdateClaim_Route() - { - // Arrange - var endpoint = typeof(ClaimController).FindMethod(nameof(ClaimController.UpdateClaim), typeof(Guid), typeof(Model.ClaimModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPut("{id}"); - } - - [Fact] - public void DeleteClaim_Route() - { - // Arrange - var endpoint = typeof(ClaimController).FindMethod(nameof(ClaimController.DeleteClaim), typeof(Guid), typeof(Model.ClaimModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasDelete("{id}"); - } - #endregion - } -} diff --git a/backend/tests/unit/api/Routes/Admin/RoleControllerTest.cs b/backend/tests/unit/api/Routes/Admin/RoleControllerTest.cs deleted file mode 100644 index 3d270677d9..0000000000 --- a/backend/tests/unit/api/Routes/Admin/RoleControllerTest.cs +++ /dev/null @@ -1,120 +0,0 @@ -using Pims.Api.Areas.Admin.Controllers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Security; -using System; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Model = Pims.Api.Areas.Admin.Models.Role; - -namespace Pims.Api.Test.Routes.Admin -{ - /// - /// RoleControllerTest class, provides a way to test endpoint routes. - /// - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "admin")] - [Trait("group", "role")] - [Trait("group", "route")] - [ExcludeFromCodeCoverage] - public class RoleControllerTest - { - #region Variables - #endregion - - #region Constructors - public RoleControllerTest() - { - } - #endregion - - #region Tests - [Fact] - public void Role_Route() - { - // Arrange - // Act - // Assert - var type = typeof(RoleController); - type.HasPermissions(Permissions.AdminRoles); - type.HasArea("admin"); - type.HasRoute("[area]/roles"); - type.HasRoute("v{version:apiVersion}/[area]/roles"); - type.HasApiVersion("1.0"); - } - - [Fact] - public void GetRoles_Route() - { - // Arrange - var endpoint = typeof(RoleController).FindMethod(nameof(RoleController.GetRoles), typeof(int), typeof(int), typeof(string)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet(); - } - - [Fact] - public void GetRole_Route() - { - // Arrange - var endpoint = typeof(RoleController).FindMethod(nameof(RoleController.GetRole), typeof(Guid)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet("{id}"); - } - - [Fact] - public void GetRoleByName_Route() - { - // Arrange - var endpoint = typeof(RoleController).FindMethod(nameof(RoleController.GetRoleByName), typeof(string)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet("name/{name}"); - } - - [Fact] - public void AddRole_Route() - { - // Arrange - var endpoint = typeof(RoleController).FindMethod(nameof(RoleController.AddRole), typeof(Model.RoleModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPost(); - } - - [Fact] - public void UpdateRole_Route() - { - // Arrange - var endpoint = typeof(RoleController).FindMethod(nameof(RoleController.UpdateRole), typeof(Guid), typeof(Model.RoleModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPut("{id}"); - } - - [Fact] - public void DeleteRole_Route() - { - // Arrange - var endpoint = typeof(RoleController).FindMethod(nameof(RoleController.DeleteRole), typeof(Guid), typeof(Model.RoleModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasDelete("{id}"); - } - #endregion - } -} diff --git a/backend/tests/unit/api/Routes/Admin/UserControllerTest.cs b/backend/tests/unit/api/Routes/Admin/UserControllerTest.cs deleted file mode 100644 index 9ad545e356..0000000000 --- a/backend/tests/unit/api/Routes/Admin/UserControllerTest.cs +++ /dev/null @@ -1,121 +0,0 @@ -using Pims.Api.Areas.Admin.Controllers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Entities.Models; -using Pims.Dal.Security; -using System; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Model = Pims.Api.Areas.Admin.Models.User; - -namespace Pims.Api.Test.Routes.Admin -{ - /// - /// UserControllerTest class, provides a way to test endpoint routes. - /// - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "admin")] - [Trait("group", "user")] - [Trait("group", "route")] - [ExcludeFromCodeCoverage] - public class UserControllerTest - { - #region Variables - #endregion - - #region Constructors - public UserControllerTest() - { - } - #endregion - - #region Tests - [Fact] - public void User_Route() - { - // Arrange - // Act - // Assert - var type = typeof(UserController); - type.HasPermissions(Permissions.AdminUsers); - type.HasArea("admin"); - type.HasRoute("[area]/users"); - type.HasRoute("v{version:apiVersion}/[area]/users"); - type.HasApiVersion("1.0"); - } - - [Fact] - public void GetUsers_Query_Route() - { - // Arrange - var endpoint = typeof(UserController).FindMethod(nameof(UserController.GetUsers)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet(); - } - - [Fact] - public void GetUsers_Route() - { - // Arrange - var endpoint = typeof(UserController).FindMethod(nameof(UserController.GetUsers), typeof(UserFilter)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPost("filter"); - } - - [Fact] - public void GetMyUsers_Route() - { - // Arrange - var endpoint = typeof(UserController).FindMethod(nameof(UserController.GetMyUsers), typeof(UserFilter)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPost("my/agency"); - } - - [Fact] - public void AddUser_Route() - { - // Arrange - var endpoint = typeof(UserController).FindMethod(nameof(UserController.AddUser), typeof(Model.UserModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPost(); - } - - [Fact] - public void UpdateUser_Route() - { - // Arrange - var endpoint = typeof(UserController).FindMethod(nameof(UserController.UpdateUser), typeof(Guid), typeof(Model.UserModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPut("{id}"); - } - - [Fact] - public void DeleteUser_Route() - { - // Arrange - var endpoint = typeof(UserController).FindMethod(nameof(UserController.DeleteUser), typeof(Guid), typeof(Model.UserModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasDelete("{id}"); - } - #endregion - } -} diff --git a/backend/tests/unit/api/Routes/Keycloak/RoleControllerTest.cs b/backend/tests/unit/api/Routes/Keycloak/RoleControllerTest.cs deleted file mode 100644 index b4df314d2e..0000000000 --- a/backend/tests/unit/api/Routes/Keycloak/RoleControllerTest.cs +++ /dev/null @@ -1,99 +0,0 @@ -using Pims.Api.Areas.Keycloak.Controllers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Security; -using System; -using System.Diagnostics.CodeAnalysis; -using Xunit; - -namespace Pims.Api.Test.Routes.Keycloak -{ - /// - /// RoleControllerTest class, provides a way to test endpoint routes. - /// - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "keycloak")] - [Trait("group", "role")] - [Trait("group", "route")] - [ExcludeFromCodeCoverage] - public class RoleControllerTest - { - #region Variables - #endregion - - #region Constructors - public RoleControllerTest() - { - } - #endregion - - #region Tests - [Fact] - public void Role_Route() - { - // Arrange - // Act - // Assert - var type = typeof(RoleController); - type.HasPermissions(Permissions.AdminRoles); - type.HasArea("keycloak"); - type.HasRoute("[area]/roles"); - type.HasRoute("v{version:apiVersion}/[area]/roles"); - type.HasApiVersion("1.0"); - } - - [Fact] - public void SyncRolesAsync_Route() - { - // Arrange - var endpoint = typeof(RoleController).FindMethod(nameof(RoleController.SyncRolesAsync)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPost("sync"); - endpoint.HasPermissions(Permissions.AdminRoles); - } - - [Fact] - public void GetRolesAsync_Route() - { - // Arrange - var endpoint = typeof(RoleController).FindMethod(nameof(RoleController.GetRolesAsync), typeof(int), typeof(int), typeof(string)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet(); - endpoint.HasPermissions(Permissions.AdminRoles); - } - - [Fact] - public void GetRoleAsync_Route() - { - // Arrange - var endpoint = typeof(RoleController).FindMethod(nameof(RoleController.GetRoleAsync), typeof(Guid)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet("{id}"); - endpoint.HasPermissions(Permissions.AdminRoles); - } - - [Fact] - public void UpdateRoleAsync_Route() - { - // Arrange - var endpoint = typeof(RoleController).FindMethod(nameof(RoleController.UpdateRoleAsync), typeof(Guid), typeof(Areas.Keycloak.Models.Role.Update.RoleModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPut("{id}"); - endpoint.HasPermissions(Permissions.AdminRoles); - } - #endregion - } -} diff --git a/backend/tests/unit/api/Routes/Keycloak/UserControllerTest.cs b/backend/tests/unit/api/Routes/Keycloak/UserControllerTest.cs deleted file mode 100644 index 6b65f0054c..0000000000 --- a/backend/tests/unit/api/Routes/Keycloak/UserControllerTest.cs +++ /dev/null @@ -1,114 +0,0 @@ -using Pims.Api.Areas.Keycloak.Controllers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Security; -using System; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using AdminModels = Pims.Api.Areas.Admin.Models.User; -using Model = Pims.Api.Areas.Keycloak.Models.User; - -namespace Pims.Api.Test.Routes.Keycloak -{ - /// - /// UserControllerTest class, provides a way to test endpoint routes. - /// - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "keycloak")] - [Trait("group", "user")] - [Trait("group", "route")] - [ExcludeFromCodeCoverage] - public class UserControllerTest - { - #region Variables - #endregion - - #region Constructors - public UserControllerTest() - { - } - #endregion - - #region Tests - [Fact] - public void User_Route() - { - // Arrange - // Act - // Assert - var type = typeof(UserController); - type.HasPermissions(Permissions.AdminUsers); - type.HasArea("keycloak"); - type.HasRoute("[area]/users"); - type.HasRoute("v{version:apiVersion}/[area]/users"); - type.HasApiVersion("1.0"); - } - - [Fact] - public void SyncUserAsync_Route() - { - // Arrange - var endpoint = typeof(UserController).FindMethod(nameof(UserController.SyncUserAsync), typeof(Guid)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPost("sync/{id}"); - endpoint.HasPermissions(Permissions.AdminUsers); - } - - [Fact] - public void GetUsersAsync_Route() - { - // Arrange - var endpoint = typeof(UserController).FindMethod(nameof(UserController.GetUsersAsync), typeof(int), typeof(int), typeof(string)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet(); - endpoint.HasPermissions(Permissions.AdminUsers); - } - - [Fact] - public void GetUserAsync_Route() - { - // Arrange - var endpoint = typeof(UserController).FindMethod(nameof(UserController.GetUserAsync), typeof(Guid)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet("{id}"); - endpoint.HasPermissions(Permissions.AdminUsers); - } - - [Fact] - public void UpdateUserAsync_Route() - { - // Arrange - var endpoint = typeof(UserController).FindMethod(nameof(UserController.UpdateUserAsync), typeof(Guid), typeof(AdminModels.UserModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPut("{id}"); - endpoint.HasPermissions(Permissions.AdminUsers); - } - - [Fact] - public void UpdateAccessRequestAsync_Route() - { - // Arrange - var endpoint = typeof(UserController).FindMethod(nameof(UserController.UpdateAccessRequestAsync), typeof(Model.AccessRequestModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPut("access/request"); - endpoint.HasPermissions(Permissions.AdminUsers); - } - #endregion - } -} diff --git a/backend/tests/unit/api/Routes/Notification/QueueControllerTest.cs b/backend/tests/unit/api/Routes/Notification/QueueControllerTest.cs deleted file mode 100644 index 4afc188681..0000000000 --- a/backend/tests/unit/api/Routes/Notification/QueueControllerTest.cs +++ /dev/null @@ -1,125 +0,0 @@ -using Pims.Api.Areas.Notification.Controllers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Entities.Models; -using Pims.Dal.Security; -using System.Diagnostics.CodeAnalysis; -using Xunit; - -namespace Pims.Api.Test.Routes.Project -{ - /// - /// QueueControllerTest class, provides a way to test endpoint routes. - /// - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "notifications")] - [Trait("group", "queue")] - [Trait("group", "route")] - [ExcludeFromCodeCoverage] - public class QueueControllerTest - { - #region Variables - #endregion - - #region Constructors - public QueueControllerTest() - { - } - #endregion - - #region Tests - [Fact] - public void Queue_Route() - { - // Arrange - // Act - // Assert - var type = typeof(QueueController); - type.HasArea("notifications"); - type.HasRoute("[area]/queue"); - type.HasRoute("v{version:apiVersion}/[area]/queue"); - type.HasApiVersion("1.0"); - type.HasAuthorize(); - } - - [Fact] - public void GetNotificationsPage_Query_Route() - { - // Arrange - var endpoint = typeof(QueueController).FindMethod(nameof(QueueController.GetNotificationsPage)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet(); - endpoint.HasPermissions(Permissions.SystemAdmin); - } - - [Fact] - public void GetNotificationsPage_Route() - { - // Arrange - var endpoint = typeof(QueueController).FindMethod(nameof(QueueController.GetNotificationsPage), typeof(NotificationQueueFilter)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPost("filter"); - endpoint.HasPermissions(Permissions.SystemAdmin); - } - - [Fact] - public void GetNotificationQueue_Route() - { - // Arrange - var endpoint = typeof(QueueController).FindMethod(nameof(QueueController.GetNotificationQueue), typeof(int)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet("{id}"); - endpoint.HasPermissions(Permissions.SystemAdmin); - } - - [Fact] - public void UpdateNotificationStatusAsync_Route() - { - // Arrange - var endpoint = typeof(QueueController).FindMethod(nameof(QueueController.UpdateNotificationStatusAsync), typeof(int)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPut("{id}"); - endpoint.HasPermissions(Permissions.SystemAdmin); - } - - [Fact] - public void ResendNotificationStatusAsync_Route() - { - // Arrange - var endpoint = typeof(QueueController).FindMethod(nameof(QueueController.ResendNotificationAsync), typeof(int)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPut("{id}/resend"); - endpoint.HasPermissions(Permissions.SystemAdmin); - } - - [Fact] - public void CancelNotificationAsync_Route() - { - // Arrange - var endpoint = typeof(QueueController).FindMethod(nameof(QueueController.CancelNotificationAsync), typeof(int)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPut("{id}/cancel"); - endpoint.HasPermissions(Permissions.SystemAdmin); - } - #endregion - } -} diff --git a/backend/tests/unit/api/Routes/Notification/TemplateControllerTest.cs b/backend/tests/unit/api/Routes/Notification/TemplateControllerTest.cs deleted file mode 100644 index 6186e3cfba..0000000000 --- a/backend/tests/unit/api/Routes/Notification/TemplateControllerTest.cs +++ /dev/null @@ -1,125 +0,0 @@ -using Pims.Api.Areas.Notification.Controllers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Security; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Model = Pims.Api.Areas.Notification.Models.Template; - -namespace Pims.Api.Test.Routes.Project -{ - /// - /// TemplateControllerTest class, provides a way to test endpoint routes. - /// - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "notifications")] - [Trait("group", "templates")] - [Trait("group", "route")] - [ExcludeFromCodeCoverage] - public class TemplateControllerTest - { - #region Variables - #endregion - - #region Constructors - public TemplateControllerTest() - { - } - #endregion - - #region Tests - [Fact] - public void Template_Route() - { - // Arrange - // Act - // Assert - var type = typeof(TemplateController); - type.HasArea("notifications"); - type.HasRoute("[area]/templates"); - type.HasRoute("v{version:apiVersion}/[area]/templates"); - type.HasApiVersion("1.0"); - type.HasAuthorize(); - } - - [Fact] - public void GetNotificationTemplates_Route() - { - // Arrange - var endpoint = typeof(TemplateController).FindMethod(nameof(TemplateController.GetNotificationTemplates)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet(); - endpoint.HasPermissions(Permissions.SystemAdmin); - } - - [Fact] - public void GetNotificationTemplate_Route() - { - // Arrange - var endpoint = typeof(TemplateController).FindMethod(nameof(TemplateController.GetNotificationTemplate), typeof(int)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet("{id}"); - endpoint.HasPermissions(Permissions.SystemAdmin); - } - - [Fact] - public void AddNotificationTemplate_Route() - { - // Arrange - var endpoint = typeof(TemplateController).FindMethod(nameof(TemplateController.AddNotificationTemplate), typeof(Model.NotificationTemplateModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPost(); - endpoint.HasPermissions(Permissions.SystemAdmin); - } - - [Fact] - public void UpdateNotificationTemplate_Route() - { - // Arrange - var endpoint = typeof(TemplateController).FindMethod(nameof(TemplateController.UpdateNotificationTemplate), typeof(Model.NotificationTemplateModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPut("{id}"); - endpoint.HasPermissions(Permissions.SystemAdmin); - } - - [Fact] - public void DeleteNotificationTemplate_Route() - { - // Arrange - var endpoint = typeof(TemplateController).FindMethod(nameof(TemplateController.DeleteNotificationTemplate), typeof(Model.NotificationTemplateModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasDelete("{id}"); - endpoint.HasPermissions(Permissions.SystemAdmin); - } - - [Fact] - public void SendNotificationAsync_Route() - { - // Arrange - var endpoint = typeof(TemplateController).FindMethod(nameof(TemplateController.SendProjectNotificationAsync), typeof(int), typeof(string), typeof(string), typeof(string), typeof(int)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPost("{templateId}/projects/{projectId}"); - endpoint.HasPermissions(Permissions.SystemAdmin); - } - #endregion - } -} diff --git a/backend/tests/unit/api/Routes/Project/DisposeControllerTest.cs b/backend/tests/unit/api/Routes/Project/DisposeControllerTest.cs deleted file mode 100644 index ad20eefa1b..0000000000 --- a/backend/tests/unit/api/Routes/Project/DisposeControllerTest.cs +++ /dev/null @@ -1,177 +0,0 @@ -using Pims.Api.Areas.Project.Controllers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Security; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Model = Pims.Api.Areas.Project.Models.Dispose; - -namespace Pims.Api.Test.Routes.Project -{ - /// - /// DisposeControllerTest class, provides a way to test endpoint routes. - /// - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "projects")] - [Trait("group", "project")] - [Trait("group", "route")] - [ExcludeFromCodeCoverage] - public class DisposeControllerTest - { - #region Variables - #endregion - - #region Constructors - public DisposeControllerTest() - { - } - #endregion - - #region Tests - [Fact] - public void Dispose_Route() - { - // Arrange - // Act - // Assert - var type = typeof(DisposeController); - type.HasArea("projects"); - type.HasRoute("[area]/disposal"); - type.HasRoute("v{version:apiVersion}/[area]/disposal"); - type.HasApiVersion("1.0"); - type.HasAuthorize(); - } - - [Fact] - public void GetProject_Route() - { - // Arrange - var endpoint = typeof(DisposeController).FindMethod(nameof(DisposeController.GetProject), typeof(string)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet("{projectNumber}"); - endpoint.HasPermissions(Permissions.ProjectView); - } - - [Fact] - public void AddProject_Route() - { - // Arrange - var endpoint = typeof(DisposeController).FindMethod(nameof(DisposeController.AddProjectAsync), typeof(Model.ProjectModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPost(); - endpoint.HasPermissions(Permissions.ProjectAdd); - } - - [Fact] - public void UpdateProject_Route() - { - // Arrange - var endpoint = typeof(DisposeController).FindMethod(nameof(DisposeController.UpdateProjectAsync), typeof(string), typeof(Model.ProjectModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPut("{projectNumber}"); - endpoint.HasPermissions(Permissions.ProjectEdit); - } - - [Fact] - public void DeleteProject_Route() - { - // Arrange - var endpoint = typeof(DisposeController).FindMethod(nameof(DisposeController.DeleteProjectAsync), typeof(string), typeof(Model.ProjectModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasDelete("{projectNumber}"); - endpoint.HasPermissions(Permissions.ProjectDelete); - } - - [Fact] - public void SetStatus_Route() - { - // Arrange - var endpoint = typeof(DisposeController).FindMethod(nameof(DisposeController.SetStatusAsync), typeof(Model.ProjectModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPut("workflows"); - endpoint.HasPermissions(Permissions.ProjectEdit); - } - - [Fact] - public void SetStatus_WithStatusId_Route() - { - // Arrange - var endpoint = typeof(DisposeController).FindMethod(nameof(DisposeController.SetStatusAsync), typeof(string), typeof(int), typeof(Model.ProjectModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPut("workflows/{workflowCode}/{statusId:int}"); - endpoint.HasPermissions(Permissions.ProjectEdit); - } - - [Fact] - public void SetStatus_WithStatusCode_Route() - { - // Arrange - var endpoint = typeof(DisposeController).FindMethod(nameof(DisposeController.SetStatusAsync), typeof(string), typeof(string), typeof(Model.ProjectModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPut("workflows/{workflowCode}/{statusCode}"); - endpoint.HasPermissions(Permissions.ProjectEdit); - } - - [Fact] - public void GetProjectNotificationsAsync_AsQuery_Route() - { - // Arrange - var endpoint = typeof(DisposeController).FindMethod(nameof(DisposeController.GetProjectNotificationsAsync), typeof(int)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet("{id}/notifications"); - endpoint.HasPermissions(Permissions.ProjectView); - } - - [Fact] - public void GetProjectNotificationsAsync_Route() - { - // Arrange - var endpoint = typeof(DisposeController).FindMethod(nameof(DisposeController.GetProjectNotificationsAsync), typeof(Pims.Dal.Entities.Models.ProjectNotificationFilter)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPost("notifications"); - endpoint.HasPermissions(Permissions.ProjectView); - } - - [Fact] - public void CancelProjectNotificationsAsync_Route() - { - // Arrange - var endpoint = typeof(DisposeController).FindMethod(nameof(DisposeController.CancelProjectNotificationsAsync), typeof(int)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPut("{id}/notifications/cancel"); - endpoint.HasPermissions(Permissions.ProjectEdit); - } - #endregion - } -} diff --git a/backend/tests/unit/api/Routes/Project/SearchControllerTest.cs b/backend/tests/unit/api/Routes/Project/SearchControllerTest.cs deleted file mode 100644 index 3b3d55aa25..0000000000 --- a/backend/tests/unit/api/Routes/Project/SearchControllerTest.cs +++ /dev/null @@ -1,73 +0,0 @@ -using Pims.Api.Areas.Project.Controllers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Entities.Models; -using Pims.Dal.Security; -using System.Diagnostics.CodeAnalysis; -using Xunit; - -namespace Pims.Api.Test.Routes.Project -{ - /// - /// SearchControllerTest class, provides a way to test endpoint routes. - /// - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "projects")] - [Trait("group", "project")] - [Trait("group", "route")] - [ExcludeFromCodeCoverage] - public class SearchControllerTest - { - #region Variables - #endregion - - #region Constructors - public SearchControllerTest() - { - } - #endregion - - #region Tests - [Fact] - public void Search_Route() - { - // Arrange - // Act - // Assert - var type = typeof(SearchController); - type.HasArea("projects"); - type.HasRoute("[area]/search"); - type.HasRoute("v{version:apiVersion}/[area]/search"); - type.HasApiVersion("1.0"); - type.HasAuthorize(); - } - - [Fact] - public void GetProjectsPage_Query_Route() - { - // Arrange - var endpoint = typeof(SearchController).FindMethod(nameof(SearchController.GetProjectsPage)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet("page"); - endpoint.HasPermissions(Permissions.ProjectView); - } - - [Fact] - public void GetProjectsPage_Route() - { - // Arrange - var endpoint = typeof(SearchController).FindMethod(nameof(SearchController.GetProjectsPage), typeof(ProjectFilter)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPost("page"); - endpoint.HasPermissions(Permissions.ProjectView); - } - #endregion - } -} diff --git a/backend/tests/unit/api/Routes/Project/StatusControllerTest.cs b/backend/tests/unit/api/Routes/Project/StatusControllerTest.cs deleted file mode 100644 index 10fa260125..0000000000 --- a/backend/tests/unit/api/Routes/Project/StatusControllerTest.cs +++ /dev/null @@ -1,85 +0,0 @@ -using Pims.Api.Areas.Project.Controllers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Security; -using System.Diagnostics.CodeAnalysis; -using Xunit; - -namespace Pims.Api.Test.Routes.Project -{ - /// - /// StatusControllerTest class, provides a way to test endpoint routes. - /// - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "projects")] - [Trait("group", "status")] - [Trait("group", "route")] - [ExcludeFromCodeCoverage] - public class StatusControllerTest - { - #region Variables - #endregion - - #region Constructors - public StatusControllerTest() - { - } - #endregion - - #region Tests - [Fact] - public void Status_Route() - { - // Arrange - // Act - // Assert - var type = typeof(StatusController); - type.HasArea("projects"); - type.HasRoute("[area]/status"); - type.HasRoute("v{version:apiVersion}/[area]/status"); - type.HasApiVersion("1.0"); - type.HasAuthorize(); - } - - [Fact] - public void GetStatus_Route() - { - // Arrange - var endpoint = typeof(StatusController).FindMethod(nameof(StatusController.GetStatus)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet(); - endpoint.HasPermissions(Permissions.ProjectView); - } - - [Fact] - public void GetTasksForStatus_Id_Route() - { - // Arrange - var endpoint = typeof(StatusController).FindMethod(nameof(StatusController.GetTasksForStatus), typeof(int)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet("{statusId:int}/tasks"); - endpoint.HasPermissions(Permissions.ProjectView); - } - - [Fact] - public void GetTasksForStatus_Code_Route() - { - // Arrange - var endpoint = typeof(StatusController).FindMethod(nameof(StatusController.GetTasksForStatus), typeof(string)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet("{statusCode}/tasks"); - endpoint.HasPermissions(Permissions.ProjectView); - } - #endregion - } -} diff --git a/backend/tests/unit/api/Routes/Project/WorkflowControllerTest.cs b/backend/tests/unit/api/Routes/Project/WorkflowControllerTest.cs deleted file mode 100644 index 4964c43017..0000000000 --- a/backend/tests/unit/api/Routes/Project/WorkflowControllerTest.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Pims.Api.Areas.Project.Controllers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Security; -using System.Diagnostics.CodeAnalysis; -using Xunit; - -namespace Pims.Api.Test.Routes.Project -{ - /// - /// WorkflowControllerTest class, provides a way to test endpoint routes. - /// - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "projects")] - [Trait("group", "project")] - [Trait("group", "route")] - [ExcludeFromCodeCoverage] - public class WorkflowControllerTest - { - #region Variables - #endregion - - #region Constructors - public WorkflowControllerTest() - { - } - #endregion - - #region Tests - [Fact] - public void Workflow_Route() - { - // Arrange - // Act - // Assert - var type = typeof(WorkflowController); - type.HasArea("projects"); - type.HasRoute("[area]/workflows"); - type.HasRoute("v{version:apiVersion}/[area]/workflows"); - type.HasApiVersion("1.0"); - type.HasAuthorize(); - } - - [Fact] - public void GetWorkflow_Route() - { - // Arrange - var endpoint = typeof(WorkflowController).FindMethod(nameof(WorkflowController.GetWorkflowStatus), typeof(string)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet("{workflowCode}/status"); - endpoint.HasPermissions(Permissions.ProjectView); - } - - [Fact] - public void GetTasksForWorkflow_Code_Route() - { - // Arrange - var endpoint = typeof(WorkflowController).FindMethod(nameof(WorkflowController.GetWorkflowTasks), typeof(string)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet("{workflowCode}/tasks"); - endpoint.HasPermissions(Permissions.ProjectView); - } - #endregion - } -} diff --git a/backend/tests/unit/api/Routes/Property/BuildingControllerTest.cs b/backend/tests/unit/api/Routes/Property/BuildingControllerTest.cs deleted file mode 100644 index 37b92adfa2..0000000000 --- a/backend/tests/unit/api/Routes/Property/BuildingControllerTest.cs +++ /dev/null @@ -1,113 +0,0 @@ -using Pims.Api.Areas.Property.Controllers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Security; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Model = Pims.Api.Areas.Property.Models.Building; - - -namespace Pims.Api.Test.Routes -{ - /// - /// BuildingControllerTest class, provides a way to test endpoint routes. - /// - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("group", "property")] - [Trait("group", "building")] - [Trait("group", "route")] - [ExcludeFromCodeCoverage] - public class BuildingControllerTest - { - #region Variables - #endregion - - #region Constructors - public BuildingControllerTest() - { - } - #endregion - - #region Tests - [Fact] - public void Building_Route() - { - // Arrange - // Act - // Assert - var type = typeof(BuildingController); - type.HasAuthorize(); - type.HasArea("properties"); - type.HasRoute("[area]/buildings"); - type.HasRoute("v{version:apiVersion}/[area]/buildings"); - type.HasApiVersion("1.0"); - } - - [Fact] - public void GetBuilding_Route() - { - // Arrange - var endpoint = typeof(BuildingController).FindMethod(nameof(BuildingController.GetBuilding), typeof(int)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet("{id}"); - endpoint.HasPermissions(Permissions.PropertyView); - } - - [Fact] - public void AddBuilding_Route() - { - // Arrange - var endpoint = typeof(BuildingController).FindMethod(nameof(BuildingController.AddBuilding), typeof(Model.BuildingModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPost(); - endpoint.HasPermissions(Permissions.PropertyAdd); - } - - [Fact] - public void UpdateBuilding_Route() - { - // Arrange - var endpoint = typeof(BuildingController).FindMethod(nameof(BuildingController.UpdateBuilding), typeof(int), typeof(Model.BuildingModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPut("{id}"); - endpoint.HasPermissions(Permissions.PropertyEdit); - } - - [Fact] - public void UpdateBuildingFinancials_Route() - { - // Arrange - var endpoint = typeof(BuildingController).FindMethod(nameof(BuildingController.UpdateBuildingFinancials), typeof(int), typeof(Model.BuildingModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPut("{id}/financials"); - endpoint.HasPermissions(Permissions.PropertyEdit); - } - - [Fact] - public void DeleteBuilding_Route() - { - // Arrange - var endpoint = typeof(BuildingController).FindMethod(nameof(BuildingController.DeleteBuilding), typeof(int), typeof(Model.BuildingModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasDelete("{id}"); - endpoint.HasPermissions(Permissions.PropertyDelete); - } - #endregion - } -} diff --git a/backend/tests/unit/api/Routes/Property/ParcelControllerTest.cs b/backend/tests/unit/api/Routes/Property/ParcelControllerTest.cs deleted file mode 100644 index 7bacbf9efa..0000000000 --- a/backend/tests/unit/api/Routes/Property/ParcelControllerTest.cs +++ /dev/null @@ -1,99 +0,0 @@ -using Pims.Api.Areas.Property.Controllers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Security; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Model = Pims.Api.Areas.Property.Models.Parcel; - -namespace Pims.Api.Test.Routes -{ - /// - /// ParcelControllerTest class, provides a way to test endpoint routes. - /// - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("group", "property")] - [Trait("group", "parcel")] - [Trait("group", "route")] - [ExcludeFromCodeCoverage] - public class ParcelControllerTest - { - #region Variables - #endregion - - #region Constructors - public ParcelControllerTest() - { - } - #endregion - - #region Tests - [Fact] - public void Parcel_Route() - { - // Arrange - // Act - // Assert - var type = typeof(ParcelController); - type.HasAuthorize(); - type.HasArea("properties"); - type.HasRoute("[area]/parcels"); - type.HasRoute("v{version:apiVersion}/[area]/parcels"); - type.HasApiVersion("1.0"); - } - - [Fact] - public void GetParcel_Route() - { - // Arrange - var endpoint = typeof(ParcelController).FindMethod(nameof(ParcelController.GetParcel), typeof(int)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet("{id}"); - endpoint.HasPermissions(Permissions.PropertyView); - } - - [Fact] - public void AddParcel_Route() - { - // Arrange - var endpoint = typeof(ParcelController).FindMethod(nameof(ParcelController.AddParcel), typeof(Model.ParcelModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPost(); - endpoint.HasPermissions(Permissions.PropertyAdd); - } - - [Fact] - public void UpdateParcel_Route() - { - // Arrange - var endpoint = typeof(ParcelController).FindMethod(nameof(ParcelController.UpdateParcel), typeof(int), typeof(Model.ParcelModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPut("{id}"); - endpoint.HasPermissions(Permissions.PropertyEdit); - } - - [Fact] - public void DeleteParcel_Route() - { - // Arrange - var endpoint = typeof(ParcelController).FindMethod(nameof(ParcelController.DeleteParcel), typeof(int), typeof(Model.ParcelModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasDelete("{id}"); - endpoint.HasPermissions(Permissions.PropertyDelete, Permissions.PropertyEdit); - } - #endregion - } -} diff --git a/backend/tests/unit/api/Routes/Property/SearchControllerTest.cs b/backend/tests/unit/api/Routes/Property/SearchControllerTest.cs deleted file mode 100644 index 66162b141c..0000000000 --- a/backend/tests/unit/api/Routes/Property/SearchControllerTest.cs +++ /dev/null @@ -1,97 +0,0 @@ -using Pims.Api.Areas.Property.Controllers; -using Pims.Api.Areas.Property.Models.Search; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Security; -using System.Diagnostics.CodeAnalysis; -using Xunit; - -namespace Pims.Api.Test.Routes -{ - /// - /// SearchControllerTest class, provides a way to test endpoint routes. - /// - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("group", "property")] - [Trait("group", "route")] - [ExcludeFromCodeCoverage] - public class SearchControllerTest - { - #region Variables - #endregion - - #region Constructors - public SearchControllerTest() - { - } - #endregion - - #region Tests - [Fact] - public void Property_Route() - { - // Arrange - // Act - // Assert - var type = typeof(SearchController); - type.HasAuthorize(); - type.HasArea("properties"); - type.HasRoute("[area]/search"); - type.HasRoute("v{version:apiVersion}/[area]/search"); - } - - [Fact] - public void GetProperties_Query_Route() - { - // Arrange - var endpoint = typeof(SearchController).FindMethod(nameof(SearchController.GetProperties)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet(); - endpoint.HasPermissions(Permissions.PropertyView); - } - - [Fact] - public void GetProperties_Filter_Route() - { - // Arrange - var endpoint = typeof(SearchController).FindMethod(nameof(SearchController.GetProperties), typeof(PropertyFilterModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPost("filter"); - endpoint.HasPermissions(Permissions.PropertyView); - } - - [Fact] - public void GetPropertiesPage_Query_Route() - { - // Arrange - var endpoint = typeof(SearchController).FindMethod(nameof(SearchController.GetPropertiesPage)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet("page"); - endpoint.HasPermissions(Permissions.PropertyView); - } - - [Fact] - public void GetPropertiesPage_Filter_Route() - { - // Arrange - var endpoint = typeof(SearchController).FindMethod(nameof(SearchController.GetPropertiesPage), typeof(PropertyFilterModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPost("page/filter"); - endpoint.HasPermissions(Permissions.PropertyView); - } - #endregion - } -} diff --git a/backend/tests/unit/api/Routes/Reports/PropertyControllerTest.cs b/backend/tests/unit/api/Routes/Reports/PropertyControllerTest.cs deleted file mode 100644 index 8fa866a319..0000000000 --- a/backend/tests/unit/api/Routes/Reports/PropertyControllerTest.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Pims.Api.Areas.Property.Models.Search; -using Pims.Api.Areas.Reports.Controllers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Security; -using System.Diagnostics.CodeAnalysis; -using Xunit; - -namespace Pims.Api.Test.Routes.Reports -{ - /// - /// ReportControllerTest class, provides a way to test endpoint routes. - /// - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("group", "report")] - [Trait("group", "property")] - [Trait("group", "route")] - [ExcludeFromCodeCoverage] - public class PropertyControllerTest - { - #region Variables - #endregion - - #region Constructors - public PropertyControllerTest() - { - } - #endregion - - #region Tests - [Fact] - public void Property_Route() - { - // Arrange - // Act - // Assert - var type = typeof(PropertyController); - type.HasAuthorize(); - type.HasArea("reports"); - type.HasRoute("[area]/properties"); - type.HasRoute("v{version:apiVersion}/[area]/properties"); - } - - [Fact] - public void ExportProperties_Query_Route() - { - // Arrange - var endpoint = typeof(PropertyController).FindMethod(nameof(PropertyController.ExportProperties), typeof(bool)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet(); - endpoint.HasPermissions(Permissions.PropertyView); - } - - [Fact] - public void ExportProperties_Filter_Route() - { - // Arrange - var endpoint = typeof(PropertyController).FindMethod(nameof(PropertyController.ExportProperties), typeof(PropertyFilterModel), typeof(bool)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPost("filter"); - endpoint.HasPermissions(Permissions.PropertyView); - } - #endregion - } -} diff --git a/backend/tests/unit/api/Routes/Tools/ChesControllerTest.cs b/backend/tests/unit/api/Routes/Tools/ChesControllerTest.cs deleted file mode 100644 index 85deeb62e3..0000000000 --- a/backend/tests/unit/api/Routes/Tools/ChesControllerTest.cs +++ /dev/null @@ -1,100 +0,0 @@ -using Pims.Api.Areas.Tools.Controllers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Security; -using System; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Model = Pims.Ches.Models; - -namespace Pims.Api.Test.Routes.Project -{ - /// - /// ChesControllerTest class, provides a way to test endpoint routes. - /// - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "tools")] - [Trait("group", "ches")] - [Trait("group", "route")] - [ExcludeFromCodeCoverage] - public class ChesControllerTest - { - #region Variables - #endregion - - #region Constructors - public ChesControllerTest() - { - } - #endregion - - #region Tests - [Fact] - public void Ches_Route() - { - // Arrange - // Act - // Assert - var type = typeof(ChesController); - type.HasAuthorize(); - type.HasArea("tools"); - type.HasRoute("[area]/ches"); - type.HasRoute("v{version:apiVersion}/[area]/ches"); - type.HasApiVersion("1.0"); - } - - [Fact] - public void GetStatusAsync_Route() - { - // Arrange - var endpoint = typeof(ChesController).FindMethod(nameof(ChesController.GetStatusAsync), typeof(Guid)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet("status/{messageId}"); - endpoint.HasPermissions(Permissions.AdminProjects); - } - - [Fact] - public void GetStatusAsync_Post_Route() - { - // Arrange - var endpoint = typeof(ChesController).FindMethod(nameof(ChesController.GetStatusAsync), typeof(Model.StatusModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPost("status"); - endpoint.HasPermissions(Permissions.AdminProjects); - } - - [Fact] - public void CancelEmailAsync_Route() - { - // Arrange - var endpoint = typeof(ChesController).FindMethod(nameof(ChesController.CancelEmailAsync), typeof(Guid)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasDelete("cancel/{messageId}"); - endpoint.HasPermissions(Permissions.AdminProjects); - } - - [Fact] - public void CancelEmailAsync_Post_Route() - { - // Arrange - var endpoint = typeof(ChesController).FindMethod(nameof(ChesController.CancelEmailAsync), typeof(Model.StatusModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasDelete("cancel"); - endpoint.HasPermissions(Permissions.AdminProjects); - } - #endregion - } -} diff --git a/backend/tests/unit/api/Routes/Tools/GeocoderControllerTest.cs b/backend/tests/unit/api/Routes/Tools/GeocoderControllerTest.cs deleted file mode 100644 index fd81a2f728..0000000000 --- a/backend/tests/unit/api/Routes/Tools/GeocoderControllerTest.cs +++ /dev/null @@ -1,73 +0,0 @@ -using Pims.Api.Areas.Tools.Controllers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Security; -using System; -using System.Diagnostics.CodeAnalysis; -using Xunit; - -namespace Pims.Api.Test.Routes.Project -{ - /// - /// GeocoderControllerTest class, provides a way to test endpoint routes. - /// - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "tools")] - [Trait("group", "geocoder")] - [Trait("group", "route")] - [ExcludeFromCodeCoverage] - public class GeocoderControllerTest - { - #region Variables - #endregion - - #region Constructors - public GeocoderControllerTest() - { - } - #endregion - - #region Tests - [Fact] - public void Geocoder_Route() - { - // Arrange - // Act - // Assert - var type = typeof(GeocoderController); - type.HasAuthorize(); - type.HasArea("tools"); - type.HasRoute("[area]/geocoder"); - type.HasRoute("v{version:apiVersion}/[area]/geocoder"); - type.HasApiVersion("1.0"); - } - - [Fact] - public void FindAddressesAsync_Route() - { - // Arrange - var endpoint = typeof(GeocoderController).FindMethod(nameof(GeocoderController.FindAddressesAsync), typeof(string)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet("addresses"); - endpoint.HasPermissions(Permissions.PropertyEdit); - } - - [Fact] - public void FindPidsAsync_Route() - { - // Arrange - var endpoint = typeof(GeocoderController).FindMethod(nameof(GeocoderController.FindPidsAsync), typeof(Guid)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet("parcels/pids/{siteId}"); - endpoint.HasPermissions(Permissions.PropertyEdit); - } - #endregion - } -} diff --git a/backend/tests/unit/api/Routes/Tools/ImportControllerTest.cs b/backend/tests/unit/api/Routes/Tools/ImportControllerTest.cs deleted file mode 100644 index ece300a363..0000000000 --- a/backend/tests/unit/api/Routes/Tools/ImportControllerTest.cs +++ /dev/null @@ -1,90 +0,0 @@ -using Pims.Api.Areas.Tools.Controllers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Security; -using System; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Model = Pims.Api.Areas.Tools.Models.Import; - -namespace Pims.Api.Test.Routes.Project -{ - /// - /// ImportControllerTest class, provides a way to test endpoint routes. - /// - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("area", "tools")] - [Trait("group", "route")] - [ExcludeFromCodeCoverage] - public class ImportControllerTest - { - #region Variables - #endregion - - #region Constructors - public ImportControllerTest() - { - } - #endregion - - #region Tests - [Fact] - public void Import_Route() - { - // Arrange - // Act - // Assert - var type = typeof(ImportController); - type.HasPermissions(Permissions.SystemAdmin); - type.HasArea("tools"); - type.HasRoute("[area]/import"); - type.HasRoute("v{version:apiVersion}/[area]/import"); - type.HasApiVersion("1.0"); - } - - #region Properties - [Fact] - public void ImportProperties_Route() - { - // Arrange - var endpoint = typeof(ImportController).FindMethod(nameof(ImportController.ImportProperties), typeof(Model.ImportPropertyModel[])); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPost("properties"); - endpoint.HasPermissions(Permissions.SystemAdmin); - } - - [Fact] - public void ImportPropertyFinancials_Route() - { - // Arrange - var endpoint = typeof(ImportController).FindMethod(nameof(ImportController.ImportPropertyFinancials), typeof(Model.ImportPropertyModel[])); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPost("properties/financials"); - endpoint.HasPermissions(Permissions.SystemAdmin); - } - #endregion - - #region Projects - [Fact] - public void ImportProjects_Route() - { - // Arrange - var endpoint = typeof(ImportController).FindMethod(nameof(ImportController.ImportProjects), typeof(Model.ImportProjectModel[]), typeof(bool), typeof(DateTime?), typeof(string)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPost("projects"); - endpoint.HasPermissions(Permissions.SystemAdmin); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/api/Routes/UserControllerTest.cs b/backend/tests/unit/api/Routes/UserControllerTest.cs deleted file mode 100644 index e63eb8d1ae..0000000000 --- a/backend/tests/unit/api/Routes/UserControllerTest.cs +++ /dev/null @@ -1,103 +0,0 @@ -using Pims.Api.Controllers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Model = Pims.Api.Models.User; - -namespace Pims.Api.Test.Routes -{ - /// - /// UserControllerTest class, provides a way to test endpoint routes. - /// - [Trait("category", "unit")] - [Trait("category", "api")] - [Trait("group", "user")] - [Trait("group", "route")] - [ExcludeFromCodeCoverage] - public class UserControllerTest - { - #region Variables - #endregion - - #region Constructors - public UserControllerTest() - { - } - #endregion - - #region Tests - [Fact] - public void User_Route() - { - // Arrange - // Act - // Assert - var type = typeof(UserController); - type.HasAuthorize(); - type.HasRoute("users"); - type.HasRoute("v{version:apiVersion}/users"); - } - - [Fact] - public void UserInfo_Route() - { - // Arrange - var endpoint = typeof(UserController).FindMethod(nameof(UserController.UserInfoAsync)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet("info"); - } - - [Fact] - public void GetAccessRequest_Current_Route() - { - // Arrange - var endpoint = typeof(UserController).FindMethod(nameof(UserController.GetAccessRequest)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet("access/requests"); - } - - [Fact] - public void GetAccessRequest_Route() - { - // Arrange - var endpoint = typeof(UserController).FindMethod(nameof(UserController.GetAccessRequest), typeof(int)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasGet("access/requests/{id}"); - } - - [Fact] - public void AddAccessRequest_Route() - { - // Arrange - var endpoint = typeof(UserController).FindMethod(nameof(UserController.AddAccessRequestAsync), typeof(Model.AccessRequestModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPost("access/requests"); - } - - [Fact] - public void UpdateAccessRequest_Route() - { - // Arrange - var endpoint = typeof(UserController).FindMethod(nameof(UserController.UpdateAccessRequest), typeof(int), typeof(Model.AccessRequestModel)); - - // Act - // Assert - Assert.NotNull(endpoint); - endpoint.HasPut("access/requests/{id}"); - } - #endregion - } -} diff --git a/backend/tests/unit/api/coverlet.runsettings b/backend/tests/unit/api/coverlet.runsettings deleted file mode 100644 index cfc731c882..0000000000 --- a/backend/tests/unit/api/coverlet.runsettings +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - json,opencover - [*.Test]*,[*]*Model,[*]*Migrations* - Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute - false - true - false - - - - - diff --git a/backend/tests/unit/dal/Core/Comparers/DeepPropertyCompareTest.cs b/backend/tests/unit/dal/Core/Comparers/DeepPropertyCompareTest.cs deleted file mode 100644 index c1e4b3ca19..0000000000 --- a/backend/tests/unit/dal/Core/Comparers/DeepPropertyCompareTest.cs +++ /dev/null @@ -1,128 +0,0 @@ -using Pims.Core.Comparers; -using Pims.Core.Test; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Test.Helpers -{ - [Trait("category", "unit")] - [Trait("category", "core")] - [Trait("category", "function")] - [ExcludeFromCodeCoverage] - public class DeepPropertyCompareTest - { - #region Tests - [Fact] - public void Equal_Identical() - { - // Arrange - var parcel1 = EntityHelper.CreateParcel(1); - - var comparer = new DeepPropertyCompare(); - - // Act - var result = comparer.Equals(parcel1, parcel1); - - // Assert - Assert.True(result); - } - - [Fact] - public void Equal() - { - // Arrange - var o1 = new { Id = 1, Name = "test", Items = new[] { new { Id = 2 } } }; - var o2 = new { Id = 1, Name = "test", Items = new[] { new { Id = 2 } } }; - - var comparer = new DeepPropertyCompare(); - - // Act - var result = comparer.Equals(o1, o2); - - // Assert - Assert.True(result); - } - - [Fact] - public void Not_Equal() - { - // Arrange - var parcel1 = EntityHelper.CreateParcel(1); - var parcel2 = EntityHelper.CreateParcel(1); - - var comparer = new DeepPropertyCompare(); - - // Act - var result = comparer.Equals(parcel1, parcel2); - - // Assert - Assert.False(result); - } - - [Fact] - public void Not_Equal_DifferentObjects() - { - // Arrange - var o1 = EntityHelper.CreatePropertyClassification("test"); - var o2 = new { Id = 1, Name = "test", IsDisabled = false, SortOrder = 0, o1.CreatedById, o1.CreatedOn, o1.UpdatedById, o1.UpdatedOn, o1.RowVersion }; - - var comparer = new DeepPropertyCompare(); - - // Act - var result = comparer.Equals(o1, o2); - - // Assert - Assert.False(result); - } - - [Fact] - public void Not_Equal_Null1() - { - // Arrange - Entity.Parcel parcel1 = null; - var parcel2 = EntityHelper.CreateParcel(1); - - var comparer = new DeepPropertyCompare(); - - // Act - var result = comparer.Equals(parcel1, parcel2); - - // Assert - Assert.False(result); - } - - [Fact] - public void Not_Equal_Null2() - { - // Arrange - var parcel1 = EntityHelper.CreateParcel(1); - Entity.Parcel parcel2 = null; - - var comparer = new DeepPropertyCompare(); - - // Act - var result = comparer.Equals(parcel1, parcel2); - - // Assert - Assert.False(result); - } - - [Fact] - public void Not_Equal_Collection() - { - // Arrange - var o1 = new { Id = 1, Name = "test", Items = new[] { new { Id = 2 }, new { Id = 3 } } }; - var o2 = new { Id = 1, Name = "test", Items = new[] { new { Id = 2 } } }; - - var comparer = new DeepPropertyCompare(); - - // Act - var result = comparer.Equals(o1, o2); - - // Assert - Assert.False(result); - } - #endregion - } -} diff --git a/backend/tests/unit/dal/Core/Comparers/DeepPropertyCompareTest`.cs b/backend/tests/unit/dal/Core/Comparers/DeepPropertyCompareTest`.cs deleted file mode 100644 index a9e3650251..0000000000 --- a/backend/tests/unit/dal/Core/Comparers/DeepPropertyCompareTest`.cs +++ /dev/null @@ -1,128 +0,0 @@ -using Pims.Core.Comparers; -using Pims.Core.Test; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Test.Helpers -{ - [Trait("category", "unit")] - [Trait("category", "core")] - [Trait("category", "function")] - [ExcludeFromCodeCoverage] - public class DeepPropertyCompareTest_Generic - { - #region Tests - [Fact] - public void Equal_Identical() - { - // Arrange - var parcel1 = EntityHelper.CreateParcel(1); - - var comparer = new DeepPropertyCompare(); - - // Act - var result = comparer.Equals(parcel1, parcel1); - - // Assert - Assert.True(result); - } - - [Fact] - public void Equal() - { - // Arrange - var o1 = new { Id = 1, Name = "test", Items = new[] { new { Id = 2 } } }; - var o2 = new { Id = 1, Name = "test", Items = new[] { new { Id = 2 } } }; - - var comparer = new DeepPropertyCompare(); - - // Act - var result = comparer.Equals(o1, o2); - - // Assert - Assert.True(result); - } - - [Fact] - public void Not_Equal() - { - // Arrange - var parcel1 = EntityHelper.CreateParcel(1); - var parcel2 = EntityHelper.CreateParcel(1); - - var comparer = new DeepPropertyCompare(); - - // Act - var result = comparer.Equals(parcel1, parcel2); - - // Assert - Assert.False(result); - } - - [Fact] - public void Not_Equal_DifferentObjects() - { - // Arrange - var o1 = EntityHelper.CreatePropertyClassification("test"); - var o2 = new { Id = 1, Name = "test", IsDisabled = false, SortOrder = 0, o1.CreatedById, o1.CreatedOn, o1.UpdatedById, o1.UpdatedOn, o1.RowVersion }; - - var comparer = new DeepPropertyCompare(); - - // Act - var result = comparer.Equals(o1, o2); - - // Assert - Assert.False(result); - } - - [Fact] - public void Not_Equal_Null1() - { - // Arrange - Entity.Parcel parcel1 = null; - var parcel2 = EntityHelper.CreateParcel(1); - - var comparer = new DeepPropertyCompare(); - - // Act - var result = comparer.Equals(parcel1, parcel2); - - // Assert - Assert.False(result); - } - - [Fact] - public void Not_Equal_Null2() - { - // Arrange - var parcel1 = EntityHelper.CreateParcel(1); - Entity.Parcel parcel2 = null; - - var comparer = new DeepPropertyCompare(); - - // Act - var result = comparer.Equals(parcel1, parcel2); - - // Assert - Assert.False(result); - } - - [Fact] - public void Not_Equal_Collection() - { - // Arrange - var o1 = new { Id = 1, Name = "test", Items = new[] { new { Id = 2 }, new { Id = 3 } } }; - var o2 = new { Id = 1, Name = "test", Items = new[] { new { Id = 2 } } }; - - var comparer = new DeepPropertyCompare(); - - // Act - var result = comparer.Equals(o1, o2); - - // Assert - Assert.False(result); - } - #endregion - } -} diff --git a/backend/tests/unit/dal/Core/Comparers/ShallowPropertyCompareTest.cs b/backend/tests/unit/dal/Core/Comparers/ShallowPropertyCompareTest.cs deleted file mode 100644 index 037a232a53..0000000000 --- a/backend/tests/unit/dal/Core/Comparers/ShallowPropertyCompareTest.cs +++ /dev/null @@ -1,128 +0,0 @@ -using Pims.Core.Comparers; -using Pims.Core.Test; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Test.Helpers -{ - [Trait("category", "unit")] - [Trait("category", "core")] - [Trait("category", "function")] - [ExcludeFromCodeCoverage] - public class ShallowPropertyCompareTest - { - #region Tests - [Fact] - public void Equal_Identical() - { - // Arrange - var parcel1 = EntityHelper.CreateParcel(1); - - var comparer = new ShallowPropertyCompare(); - - // Act - var result = comparer.Equals(parcel1, parcel1); - - // Assert - Assert.True(result); - } - - [Fact] - public void Equal() - { - // Arrange - var o1 = new { Id = 1, Name = "test", Items = new[] { new { Id = 2 } } }; - var o2 = new { Id = 1, Name = "test", Items = new[] { new { Id = 2 } } }; - - var comparer = new ShallowPropertyCompare(); - - // Act - var result = comparer.Equals(o1, o2); - - // Assert - Assert.True(result); - } - - [Fact] - public void Equal_DifferentObjects() - { - // Arrange - var o1 = EntityHelper.CreatePropertyClassification("test"); - var o2 = new { Id = 1, Name = "test", IsVisible = true, IsDisabled = false, SortOrder = 0, o1.CreatedById, o1.CreatedOn, o1.UpdatedById, o1.UpdatedOn, o1.RowVersion }; - - var comparer = new ShallowPropertyCompare(); - - // Act - var result = comparer.Equals(o1, o2); - - // Assert - Assert.True(result); - } - - [Fact] - public void Not_Equal() - { - // Arrange - var parcel1 = EntityHelper.CreateParcel(1); - var parcel2 = EntityHelper.CreateParcel(1); - - var comparer = new ShallowPropertyCompare(); - - // Act - var result = comparer.Equals(parcel1, parcel2); - - // Assert - Assert.False(result); - } - - [Fact] - public void Not_Equal_Null1() - { - // Arrange - Entity.Parcel parcel1 = null; - var parcel2 = EntityHelper.CreateParcel(1); - - var comparer = new ShallowPropertyCompare(); - - // Act - var result = comparer.Equals(parcel1, parcel2); - - // Assert - Assert.False(result); - } - - [Fact] - public void Not_Equal_Null2() - { - // Arrange - var parcel1 = EntityHelper.CreateParcel(1); - Entity.Parcel parcel2 = null; - - var comparer = new ShallowPropertyCompare(); - - // Act - var result = comparer.Equals(parcel1, parcel2); - - // Assert - Assert.False(result); - } - - [Fact] - public void Equal_WithDifferentCollection() - { - // Arrange - var o1 = new { Id = 1, Name = "test", Items = new[] { new { Id = 2 }, new { Id = 3 } } }; - var o2 = new { Id = 1, Name = "test", Items = new[] { new { Id = 2 } } }; - - var comparer = new ShallowPropertyCompare(); - - // Act - var result = comparer.Equals(o1, o2); - - // Assert - Assert.True(result); - } - #endregion - } -} diff --git a/backend/tests/unit/dal/Core/Comparers/ShallowPropertyCompareTest`.cs b/backend/tests/unit/dal/Core/Comparers/ShallowPropertyCompareTest`.cs deleted file mode 100644 index 2836e9051b..0000000000 --- a/backend/tests/unit/dal/Core/Comparers/ShallowPropertyCompareTest`.cs +++ /dev/null @@ -1,128 +0,0 @@ -using Pims.Core.Comparers; -using Pims.Core.Test; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Test.Helpers -{ - [Trait("category", "unit")] - [Trait("category", "core")] - [Trait("category", "function")] - [ExcludeFromCodeCoverage] - public class ShallowPropertyCompareTest_Generic - { - #region Tests - [Fact] - public void Equal_Identical() - { - // Arrange - var parcel1 = EntityHelper.CreateParcel(1); - - var comparer = new ShallowPropertyCompare(); - - // Act - var result = comparer.Equals(parcel1, parcel1); - - // Assert - Assert.True(result); - } - - [Fact] - public void Equal() - { - // Arrange - var o1 = new { Id = 1, Name = "test", Items = new[] { new { Id = 2 } } }; - var o2 = new { Id = 1, Name = "test", Items = new[] { new { Id = 2 } } }; - - var comparer = new ShallowPropertyCompare(); - - // Act - var result = comparer.Equals(o1, o2); - - // Assert - Assert.True(result); - } - - [Fact] - public void Equal_DifferentObjects() - { - // Arrange - var o1 = EntityHelper.CreatePropertyClassification("test"); - var o2 = new { Id = 1, Name = "test", IsVisible = true, IsDisabled = false, SortOrder = 0, o1.CreatedById, o1.CreatedOn, o1.UpdatedById, o1.UpdatedOn, o1.RowVersion }; - - var comparer = new ShallowPropertyCompare(); - - // Act - var result = comparer.Equals(o1, o2); - - // Assert - Assert.True(result); - } - - [Fact] - public void Not_Equal() - { - // Arrange - var parcel1 = EntityHelper.CreateParcel(1); - var parcel2 = EntityHelper.CreateParcel(1); - - var comparer = new ShallowPropertyCompare(); - - // Act - var result = comparer.Equals(parcel1, parcel2); - - // Assert - Assert.False(result); - } - - [Fact] - public void Not_Equal_Null1() - { - // Arrange - Entity.Parcel parcel1 = null; - var parcel2 = EntityHelper.CreateParcel(1); - - var comparer = new ShallowPropertyCompare(); - - // Act - var result = comparer.Equals(parcel1, parcel2); - - // Assert - Assert.False(result); - } - - [Fact] - public void Not_Equal_Null2() - { - // Arrange - var parcel1 = EntityHelper.CreateParcel(1); - Entity.Parcel parcel2 = null; - - var comparer = new ShallowPropertyCompare(); - - // Act - var result = comparer.Equals(parcel1, parcel2); - - // Assert - Assert.False(result); - } - - [Fact] - public void Equal_WithDifferentCollection() - { - // Arrange - var o1 = new { Id = 1, Name = "test", Items = new[] { new { Id = 2 }, new { Id = 3 } } }; - var o2 = new { Id = 1, Name = "test", Items = new[] { new { Id = 2 } } }; - - var comparer = new ShallowPropertyCompare(); - - // Act - var result = comparer.Equals(o1, o2); - - // Assert - Assert.True(result); - } - #endregion - } -} diff --git a/backend/tests/unit/dal/Core/Converters/BooleanJsonConverterTest.cs b/backend/tests/unit/dal/Core/Converters/BooleanJsonConverterTest.cs deleted file mode 100644 index 88daf84c70..0000000000 --- a/backend/tests/unit/dal/Core/Converters/BooleanJsonConverterTest.cs +++ /dev/null @@ -1,97 +0,0 @@ -using Pims.Core.Converters; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.IO; -using System.Text; -using System.Text.Json; -using Xunit; - -namespace Pims.Dal.Test.Core.Converters -{ - [Trait("category", "unit")] - [Trait("category", "core")] - [Trait("category", "function")] - [ExcludeFromCodeCoverage] - public class BooleanJsonConverterTest - { - #region Data - public static IEnumerable WriteData = new List() - { - new object[] { true, "{\"test\":\"true\"}" }, - new object[] { false, "{\"test\":\"false\"}" } - }; - - public static IEnumerable ReadData = new List() - { - new object[] { "true", true }, - new object[] { "True", true }, - new object[] { "TRUE", true }, - new object[] { "false", false }, - new object[] { "False", false }, - new object[] { "FALSE", false } - }; - #endregion - - #region Tests - [Fact] - public void CanConvert() - { - // Arrange - var converter = new BooleanJsonConverter(); - - // Act - var result = converter.CanConvert(typeof(bool)); - - // Assert - Assert.True(result); - } - - [Theory] - [MemberData(nameof(WriteData))] - public void Write(bool value, string expectedResult) - { - // Arrange - var options = new JsonSerializerOptions(); - using var stream = new MemoryStream(); - using var writer = new Utf8JsonWriter(stream); - var converter = new BooleanJsonConverter(); - - writer.WriteStartObject(); - writer.WritePropertyName("test"); - - // Act - converter.Write(writer, value, options); - - // Assert - writer.WriteEndObject(); - writer.Flush(); - var result = Encoding.UTF8.GetString(stream.ToArray()); - Assert.Equal(expectedResult, result); - } - - [Theory] - [MemberData(nameof(ReadData))] - public void Read(string value, bool expectedResult) - { - // Arrange - var options = new JsonSerializerOptions(); - - var jsonUtf8Bytes = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(value, options); - var reader = new Utf8JsonReader(jsonUtf8Bytes); - var converter = new BooleanJsonConverter(); - - while (reader.Read()) - { - if (reader.TokenType == JsonTokenType.String) - break; - } - - // Act - var result = converter.Read(ref reader, typeof(bool), options); - - // Assert - Assert.Equal(expectedResult, result); - } - #endregion - } -} diff --git a/backend/tests/unit/dal/Core/Converters/EnumValueJsonConverterTest.cs b/backend/tests/unit/dal/Core/Converters/EnumValueJsonConverterTest.cs deleted file mode 100644 index a403fa1b93..0000000000 --- a/backend/tests/unit/dal/Core/Converters/EnumValueJsonConverterTest.cs +++ /dev/null @@ -1,99 +0,0 @@ -using Pims.Core.Converters; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.IO; -using System.Text; -using System.Text.Json; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Dal.Test.Core.Converters -{ - [Trait("category", "unit")] - [Trait("category", "core")] - [Trait("category", "function")] - [ExcludeFromCodeCoverage] - public class EnumValueJsonConverterTest - { - #region Data - public static IEnumerable WriteData = new List() - { - new object[] { Entity.NotificationEncodings.Utf8, "{\"test\":\"utf-8\"}" }, - new object[] { Entity.NotificationEncodings.Base64, "{\"test\":\"base64\"}" } - }; - - public static IEnumerable ReadData = new List() - { - new object[] { "utf-8", Entity.NotificationEncodings.Utf8 }, - new object[] { "utf8", Entity.NotificationEncodings.Utf8 }, - new object[] { "Utf8", Entity.NotificationEncodings.Utf8 }, - new object[] { "UTF8", Entity.NotificationEncodings.Utf8 }, - new object[] { "base64", Entity.NotificationEncodings.Base64 }, - new object[] { "Base64", Entity.NotificationEncodings.Base64 }, - new object[] { "BASE64", Entity.NotificationEncodings.Base64 }, - }; - #endregion - - #region Tests - [Fact] - public void CanConvert() - { - // Arrange - var converter = new EnumValueJsonConverter(); - - // Act - var result = converter.CanConvert(typeof(Entity.NotificationEncodings)); - - // Assert - Assert.True(result); - } - - [Theory] - [MemberData(nameof(WriteData))] - public void Write(Entity.NotificationEncodings value, string expectedResult) - { - // Arrange - var options = new JsonSerializerOptions(); - using var stream = new MemoryStream(); - using var writer = new Utf8JsonWriter(stream); - var converter = new EnumValueJsonConverter(); - - writer.WriteStartObject(); - writer.WritePropertyName("test"); - - // Act - converter.Write(writer, value, options); - - // Assert - writer.WriteEndObject(); - writer.Flush(); - var result = Encoding.UTF8.GetString(stream.ToArray()); - Assert.Equal(expectedResult, result); - } - - [Theory] - [MemberData(nameof(ReadData))] - public void Read(string value, Entity.NotificationEncodings expectedResult) - { - // Arrange - var options = new JsonSerializerOptions(); - - var jsonUtf8Bytes = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(value, options); - var reader = new Utf8JsonReader(jsonUtf8Bytes); - var converter = new EnumValueJsonConverter(); - - while (reader.Read()) - { - if (reader.TokenType == JsonTokenType.String) - break; - } - - // Act - var result = converter.Read(ref reader, typeof(bool), options); - - // Assert - Assert.Equal(expectedResult, result); - } - #endregion - } -} diff --git a/backend/tests/unit/dal/Core/Converters/Int32JsonConverterTest.cs b/backend/tests/unit/dal/Core/Converters/Int32JsonConverterTest.cs deleted file mode 100644 index 5cbfa8b646..0000000000 --- a/backend/tests/unit/dal/Core/Converters/Int32JsonConverterTest.cs +++ /dev/null @@ -1,100 +0,0 @@ -using Pims.Core.Converters; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.IO; -using System.Text; -using System.Text.Json; -using Xunit; - -namespace Pims.Dal.Test.Core.Converters -{ - [Trait("category", "unit")] - [Trait("category", "core")] - [Trait("category", "function")] - [ExcludeFromCodeCoverage] - public class Int32ToStringJsonConverterTest - { - #region Data - public static IEnumerable WriteData = new List() - { - new object[] { 1, "{\"test\":\"1\"}" }, - new object[] { null, "{\"test\":null}" } - }; - - public static IEnumerable ReadData = new List() - { - new object[] { JsonTokenType.String, "1", "1" }, - new object[] { JsonTokenType.String, "", "" }, - new object[] { JsonTokenType.String, "test", "test" }, - new object[] { JsonTokenType.String, null, null }, - new object[] { JsonTokenType.Number, null, null }, - new object[] { JsonTokenType.Number, 1, "1" }, - new object[] { JsonTokenType.Number, 0.34, "" }, - new object[] { JsonTokenType.True, true, null }, - new object[] { JsonTokenType.False, false, null }, - }; - #endregion - - #region Tests - [Fact] - public void CanConvert() - { - // Arrange - var converter = new Int32ToStringJsonConverter(); - - // Act - var result = converter.CanConvert(typeof(string)); - - // Assert - Assert.True(result); - } - - [Theory] - [MemberData(nameof(WriteData))] - public void Write(string value, string expectedResult) - { - // Arrange - var options = new JsonSerializerOptions(); - using var stream = new MemoryStream(); - using var writer = new Utf8JsonWriter(stream); - var converter = new Int32ToStringJsonConverter(); - - writer.WriteStartObject(); - writer.WritePropertyName("test"); - - // Act - converter.Write(writer, value, options); - - // Assert - writer.WriteEndObject(); - writer.Flush(); - var result = Encoding.UTF8.GetString(stream.ToArray()); - Assert.Equal(expectedResult, result); - } - - [Theory] - [MemberData(nameof(ReadData))] - public void Read(JsonTokenType type, object value, string expectedResult) - { - // Arrange - var options = new JsonSerializerOptions(); - - var jsonUtf8Bytes = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(value, options); - var reader = new Utf8JsonReader(jsonUtf8Bytes); - var converter = new Int32ToStringJsonConverter(); - - while (reader.Read()) - { - if (reader.TokenType == type) - break; - } - - // Act - var result = converter.Read(ref reader, typeof(bool), options); - - // Assert - Assert.Equal(expectedResult, result); - } - #endregion - } -} diff --git a/backend/tests/unit/dal/Core/Converters/MicrosecondEpochJsonConverterTest.cs b/backend/tests/unit/dal/Core/Converters/MicrosecondEpochJsonConverterTest.cs deleted file mode 100644 index 8791b72215..0000000000 --- a/backend/tests/unit/dal/Core/Converters/MicrosecondEpochJsonConverterTest.cs +++ /dev/null @@ -1,105 +0,0 @@ -using FluentAssertions.Extensions; -using Pims.Core.Converters; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.IO; -using System.Text; -using System.Text.Json; -using Xunit; - -namespace Pims.Dal.Test.Core.Converters -{ - [Trait("category", "unit")] - [Trait("category", "core")] - [Trait("category", "function")] - [ExcludeFromCodeCoverage] - public class MicrosecondEpochJsonConverterTest - { - #region Data - private static readonly long DATE = new DateTimeOffset(DateTime.MaxValue.AsUtc().AddDays(-2)).ToUnixTimeMilliseconds(); - private static readonly long MIN_DATE = new DateTimeOffset(DateTime.MinValue.AsUtc()).ToUnixTimeMilliseconds(); - - public static IEnumerable WriteData = new List() - { - new object[] { DateTimeOffset.UnixEpoch.AddMilliseconds(MIN_DATE).UtcDateTime, $"{{\"test\":0}}" }, - new object[] { DateTimeOffset.UnixEpoch.AddMilliseconds(DATE).UtcDateTime, $"{{\"test\":{DATE}}}" }, - new object[] { null, $"{{\"test\":0}}" } - }; - - public static IEnumerable ReadData = new List() - { - new object[] { JsonTokenType.String, $"{DATE}", DateTimeOffset.UnixEpoch.AddMilliseconds(DATE).UtcDateTime }, - new object[] { JsonTokenType.String, "", DateTimeOffset.UnixEpoch }, - new object[] { JsonTokenType.String, "test", DateTimeOffset.UnixEpoch }, - new object[] { JsonTokenType.String, null, DateTimeOffset.UnixEpoch }, - new object[] { JsonTokenType.Number, null, DateTimeOffset.UnixEpoch }, - new object[] { JsonTokenType.Number, DATE, DateTimeOffset.UnixEpoch.AddMilliseconds(DATE).UtcDateTime }, - new object[] { JsonTokenType.True, true, DateTimeOffset.UnixEpoch }, - new object[] { JsonTokenType.False, false, DateTimeOffset.UnixEpoch }, - }; - #endregion - - #region Tests - [Fact] - public void CanConvert() - { - // Arrange - var converter = new MicrosecondEpochJsonConverter(); - - // Act - var result = converter.CanConvert(typeof(DateTime)); - - // Assert - Assert.True(result); - } - - [Theory] - [MemberData(nameof(WriteData))] - public void Write(DateTime value, string expectedResult) - { - // Arrange - var options = new JsonSerializerOptions(); - using var stream = new MemoryStream(); - using var writer = new Utf8JsonWriter(stream); - var converter = new MicrosecondEpochJsonConverter(); - - writer.WriteStartObject(); - writer.WritePropertyName("test"); - - // Act - converter.Write(writer, value, options); - - // Assert - writer.WriteEndObject(); - writer.Flush(); - var result = Encoding.UTF8.GetString(stream.ToArray()); - Assert.Equal(expectedResult, result); - } - - [Theory] - [MemberData(nameof(ReadData))] - public void Read(JsonTokenType type, object value, DateTimeOffset expectedResult) - { - // Arrange - var options = new JsonSerializerOptions(); - - var jsonUtf8Bytes = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(value, options); - var reader = new Utf8JsonReader(jsonUtf8Bytes); - var converter = new MicrosecondEpochJsonConverter(); - - while (reader.Read()) - { - if (reader.TokenType == type) - break; - } - - // Act - var result = converter.Read(ref reader, typeof(bool), options); - - // Assert - Assert.Equal(expectedResult, result); - } - #endregion - } -} diff --git a/backend/tests/unit/dal/Core/Extensions/ArrayExtensionsTest.cs b/backend/tests/unit/dal/Core/Extensions/ArrayExtensionsTest.cs deleted file mode 100644 index c12e290660..0000000000 --- a/backend/tests/unit/dal/Core/Extensions/ArrayExtensionsTest.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Pims.Core.Extensions; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Xunit; - -namespace Pims.Api.Test.Core.Extensions -{ - [Trait("category", "unit")] - [Trait("category", "core")] - [Trait("category", "function")] - [ExcludeFromCodeCoverage] - public class ArrayExtensionsTest - { - #region Tests - [Fact] - public void JoinAll() - { - // Arrange - var items1 = new[] { new { Id = 1, Name = "test1" }, new { Id = 2, Name = "test2" }, new { Id = 3, Name = "test3" } }; - var items2 = new[] { new { Id = 4, Name = "test4" } }; - var items3 = new[] { new { Id = 5, Name = "test5" } }; - - // Act - var result = items1.JoinAll(items2, items3); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - Assert.Equal(5, result.Count()); - } - #endregion - } -} diff --git a/backend/tests/unit/dal/Core/Extensions/CollectionExtensionsTest.cs b/backend/tests/unit/dal/Core/Extensions/CollectionExtensionsTest.cs deleted file mode 100644 index e7f8fc7366..0000000000 --- a/backend/tests/unit/dal/Core/Extensions/CollectionExtensionsTest.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Pims.Core.Extensions; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Xunit; - -namespace Pims.Api.Test.Core.Extensions -{ - [Trait("category", "unit")] - [Trait("category", "core")] - [Trait("category", "function")] - [ExcludeFromCodeCoverage] - public class CollectionExtensionsTest - { - #region Tests - [Fact] - public void JoinAll() - { - // Arrange - var items = new Collection { new { Id = 1, Name = "test1" }, new { Id = 2, Name = "test2" }, new { Id = 3, Name = "test3" } }; - - // Act - var result = items.RemoveAll(i => i.Id == 1); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - Assert.Equal(2, result.Count()); - Assert.True(result.First().Id == 2); - Assert.Equal(result, items); - } - #endregion - } -} diff --git a/backend/tests/unit/dal/Core/Extensions/DateExtensionsTest.cs b/backend/tests/unit/dal/Core/Extensions/DateExtensionsTest.cs deleted file mode 100644 index 8c1feef9e1..0000000000 --- a/backend/tests/unit/dal/Core/Extensions/DateExtensionsTest.cs +++ /dev/null @@ -1,42 +0,0 @@ -using FluentAssertions; -using Pims.Core.Extensions; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using Xunit; - -namespace Pims.Api.Test.Core.Extensions -{ - [Trait("category", "unit")] - [Trait("category", "core")] - [Trait("category", "function")] - [ExcludeFromCodeCoverage] - public class DateExtensionsTest - { - #region Data - public static IEnumerable DateData = new List() - { - new object[] { new DateTime(2019, 12, 31), 2020 }, - new object[] { new DateTime(2020, 1, 1), 2020 }, - new object[] { new DateTime(2020, 3, 30), 2020 }, - new object[] { new DateTime(2020, 4, 1), 2021 } - }; - #endregion - - #region Tests - #region GetFiscalYear - [Theory] - [MemberData(nameof(DateData))] - public void Date_GetFiscalYear(DateTime value, int expectedResult) - { - // Arrange - // Act - var result = value.GetFiscalYear(); - - // Assert - result.Should().Be(expectedResult); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Core/Extensions/DictionaryExtensionsTest.cs b/backend/tests/unit/dal/Core/Extensions/DictionaryExtensionsTest.cs deleted file mode 100644 index 57c8307e79..0000000000 --- a/backend/tests/unit/dal/Core/Extensions/DictionaryExtensionsTest.cs +++ /dev/null @@ -1,999 +0,0 @@ -using Pims.Core.Extensions; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Test.Core.Extensions -{ - [Trait("category", "unit")] - [Trait("category", "core")] - [Trait("category", "function")] - [ExcludeFromCodeCoverage] - public class DictionaryExtensionsTest - { - #region Tests - #region GetIntValue - [Fact] - public void GetIntValue() - { - // Arrange - var dict = new Dictionary() { { "Id", "1" } }; - - // Act - var result = dict.GetIntValue("Id"); - - // Assert - Assert.Equal(1, result); - Assert.IsType(result); - } - - [Fact] - public void GetIntValue_Default() - { - // Arrange - var dict = new Dictionary() { { "Id", "test" } }; - - // Act - var result = dict.GetIntValue("Id"); - - // Assert - Assert.Equal(0, result); - Assert.IsType(result); - } - - [Fact] - public void GetIntValue_WithDefault() - { - // Arrange - var dict = new Dictionary() { { "Name", "1" } }; - - // Act - var result = dict.GetIntValue("Id", 1); - - // Assert - Assert.Equal(1, result); - Assert.IsType(result); - } - - [Fact] - public void GetIntNullValue() - { - // Arrange - var dict = new Dictionary() { { "Id", "1" } }; - - // Act - var result = dict.GetIntNullValue("Id"); - - // Assert - Assert.Equal(1, result); - Assert.IsType(result); - } - - [Fact] - public void GetIntNullValue_Null() - { - // Arrange - var dict = new Dictionary() { { "Name", "1" } }; - - // Act - var result = dict.GetIntNullValue("Id"); - - // Assert - Assert.Null(result); - } - - [Fact] - public void GetIntNullValue_Default() - { - // Arrange - var dict = new Dictionary() { { "Name", "1" } }; - - // Act - var result = dict.GetIntNullValue("Id"); - - // Assert - Assert.Null(result); - } - - [Fact] - public void GetIntNullValue_WithDefault() - { - // Arrange - var dict = new Dictionary() { { "Name", "1" } }; - - // Act - var result = dict.GetIntNullValue("Id", 1); - - // Assert - Assert.Equal(1, result); - Assert.IsType(result); - } - - [Fact] - public void GetIntArrayValue() - { - // Arrange - var dict = new Dictionary() { { "Ids", "1,2,3,4,5" } }; - - // Act - var result = dict.GetIntArrayValue("Ids"); - - // Assert - Assert.Equal(new[] { 1, 2, 3, 4, 5 }, result); - Assert.IsType(result); - } - - [Fact] - public void GetIntArrayValue_Separator() - { - // Arrange - var dict = new Dictionary() { { "Ids", "1;2;3;4;5" } }; - - // Act - var result = dict.GetIntArrayValue("Ids", ";"); - - // Assert - Assert.Equal(new[] { 1, 2, 3, 4, 5 }, result); - Assert.IsType(result); - } - - [Fact] - public void GetIntArrayValue_Empty() - { - // Arrange - var dict = new Dictionary() { { "Ids", "" } }; - - // Act - var result = dict.GetIntArrayValue("Ids"); - - // Assert - Assert.Equal(new int[0], result); - Assert.IsType(result); - } - - [Fact] - public void GetIntArrayValue_InvalidValues() - { - // Arrange - var dict = new Dictionary() { { "Ids", "1,,test,2" } }; - - // Act - var result = dict.GetIntArrayValue("Ids"); - - // Assert - Assert.Equal(new[] { 1, 2 }, result); - Assert.IsType(result); - } - - [Fact] - public void GetIntArrayValue_NotFound() - { - // Arrange - var dict = new Dictionary() { { "Name", "Value" } }; - - // Act - var result = dict.GetIntArrayValue("Ids"); - - // Assert - Assert.Equal(new int[0], result); - Assert.IsType(result); - } - #endregion - - #region GetFloatValue - [Fact] - public void GetFloatValue() - { - // Arrange - var dict = new Dictionary() { { "Id", "1.2" } }; - - // Act - var result = dict.GetFloatValue("Id"); - - // Assert - Assert.Equal(1.2f, result); - Assert.IsType(result); - } - - [Fact] - public void GetFloatValue_Default() - { - // Arrange - var dict = new Dictionary() { { "Name", "1.2" } }; - - // Act - var result = dict.GetFloatValue("Id"); - - // Assert - Assert.Equal(0f, result); - Assert.IsType(result); - } - - [Fact] - public void GetFloatValue_WithDefault() - { - // Arrange - var dict = new Dictionary() { { "Name", "1.2" } }; - - // Act - var result = dict.GetFloatValue("Id", 1.2f); - - // Assert - Assert.Equal(1.2f, result); - Assert.IsType(result); - } - - [Fact] - public void GetFloatNullValue() - { - // Arrange - var dict = new Dictionary() { { "Id", "1.2" } }; - - // Act - var result = dict.GetFloatNullValue("Id"); - - // Assert - Assert.Equal(1.2f, result); - Assert.IsType(result); - } - - [Fact] - public void GetFloatNullValue_Null() - { - // Arrange - var dict = new Dictionary() { { "Name", "1.2" } }; - - // Act - var result = dict.GetFloatNullValue("Id"); - - // Assert - Assert.Null(result); - } - - [Fact] - public void GetFloatNullValue_Default() - { - // Arrange - var dict = new Dictionary() { { "Name", "1.2" } }; - - // Act - var result = dict.GetFloatNullValue("Id"); - - // Assert - Assert.Null(result); - } - - [Fact] - public void GetFloatNullValue_WithDefault() - { - // Arrange - var dict = new Dictionary() { { "Name", "1.2" } }; - - // Act - var result = dict.GetFloatNullValue("Id", 1.2f); - - // Assert - Assert.Equal(1.2f, result); - Assert.IsType(result); - } - #endregion - - #region GetDecimalValue - [Fact] - public void GetDecimalValue() - { - // Arrange - var dict = new Dictionary() { { "Id", "1.2" } }; - - // Act - var result = dict.GetDecimalValue("Id"); - - // Assert - Assert.Equal(1.2m, result); - Assert.IsType(result); - } - - [Fact] - public void GetDecimalValue_Default() - { - // Arrange - var dict = new Dictionary() { { "Name", "1.2" } }; - - // Act - var result = dict.GetDecimalValue("Id"); - - // Assert - Assert.Equal(0m, result); - Assert.IsType(result); - } - - [Fact] - public void GetDecimalValue_WithDefault() - { - // Arrange - var dict = new Dictionary() { { "Name", "1.2" } }; - - // Act - var result = dict.GetDecimalValue("Id", 1.2m); - - // Assert - Assert.Equal(1.2m, result); - Assert.IsType(result); - } - - [Fact] - public void GetDecimalNullValue() - { - // Arrange - var dict = new Dictionary() { { "Id", "1.2" } }; - - // Act - var result = dict.GetDecimalNullValue("Id"); - - // Assert - Assert.Equal(1.2m, result); - Assert.IsType(result); - } - - [Fact] - public void GetDecimalNullValue_Null() - { - // Arrange - var dict = new Dictionary() { { "Name", "1.2" } }; - - // Act - var result = dict.GetDecimalNullValue("Id"); - - // Assert - Assert.Null(result); - } - - [Fact] - public void GetDecimalNullValue_Default() - { - // Arrange - var dict = new Dictionary() { { "Name", "1.2" } }; - - // Act - var result = dict.GetDecimalNullValue("Id"); - - // Assert - Assert.Null(result); - } - - [Fact] - public void GetDecimalNullValue_WithDefault() - { - // Arrange - var dict = new Dictionary() { { "Name", "1.2" } }; - - // Act - var result = dict.GetDecimalNullValue("Id", 1.2m); - - // Assert - Assert.Equal(1.2m, result); - Assert.IsType(result); - } - #endregion - - #region GetDoubleValue - [Fact] - public void GetDoubleValue() - { - // Arrange - var dict = new Dictionary() { { "Id", "1.2" } }; - - // Act - var result = dict.GetDoubleValue("Id"); - - // Assert - Assert.Equal(1.2d, result); - Assert.IsType(result); - } - - [Fact] - public void GetDoubleValue_Default() - { - // Arrange - var dict = new Dictionary() { { "Name", "1.2" } }; - - // Act - var result = dict.GetDoubleValue("Id"); - - // Assert - Assert.Equal(0d, result); - Assert.IsType(result); - } - - [Fact] - public void GetDoubleValue_WithDefault() - { - // Arrange - var dict = new Dictionary() { { "Name", "1.2" } }; - - // Act - var result = dict.GetDoubleValue("Id", 1.2d); - - // Assert - Assert.Equal(1.2d, result); - Assert.IsType(result); - } - - [Fact] - public void GetDoubleNullValue() - { - // Arrange - var dict = new Dictionary() { { "Id", "1.2" } }; - - // Act - var result = dict.GetDoubleNullValue("Id"); - - // Assert - Assert.Equal(1.2d, result); - Assert.IsType(result); - } - - [Fact] - public void GetDoubleNullValue_Null() - { - // Arrange - var dict = new Dictionary() { { "Name", "1.2" } }; - - // Act - var result = dict.GetDoubleNullValue("Id"); - - // Assert - Assert.Null(result); - } - - [Fact] - public void GetDoubleNullValue_Default() - { - // Arrange - var dict = new Dictionary() { { "Name", "1.2" } }; - - // Act - var result = dict.GetDoubleNullValue("Id"); - - // Assert - Assert.Null(result); - } - - [Fact] - public void GetDoubleNullValue_WithDefault() - { - // Arrange - var dict = new Dictionary() { { "Name", "1.2" } }; - - // Act - var result = dict.GetDoubleNullValue("Id", 1.2d); - - // Assert - Assert.Equal(1.2d, result); - Assert.IsType(result); - } - #endregion - - #region GetStringValue - [Fact] - public void GetStringValue() - { - // Arrange - var dict = new Dictionary() { { "Id", "1.2" } }; - - // Act - var result = dict.GetStringValue("Id"); - - // Assert - Assert.Equal("1.2", result); - Assert.IsType(result); - } - - [Fact] - public void GetStringValue_Default() - { - // Arrange - var dict = new Dictionary() { { "Name", "1.2" } }; - - // Act - var result = dict.GetStringValue("Id"); - - // Assert - Assert.Null(result); - } - - [Fact] - public void GetStringValue_WithDefault() - { - // Arrange - var dict = new Dictionary() { { "Name", "1.2" } }; - - // Act - var result = dict.GetStringValue("Id", "1.2"); - - // Assert - Assert.Equal("1.2", result); - Assert.IsType(result); - } - - [Fact] - public void GetStringArrayValue() - { - // Arrange - var dict = new Dictionary() { { "Ids", "1,2,3,4,5" } }; - - // Act - var result = dict.GetStringArrayValue("Ids"); - - // Assert - Assert.Equal(new[] { "1", "2", "3", "4", "5" }, result); - Assert.IsType(result); - } - - [Fact] - public void GetStringArrayValue_Separator() - { - // Arrange - var dict = new Dictionary() { { "Ids", "1;2;3;4;5" } }; - - // Act - var result = dict.GetStringArrayValue("Ids", ";"); - - // Assert - Assert.Equal(new[] { "1", "2", "3", "4", "5" }, result); - Assert.IsType(result); - } - - [Fact] - public void GetStringArrayValue_Empty() - { - // Arrange - var dict = new Dictionary() { { "Ids", "" } }; - - // Act - var result = dict.GetStringArrayValue("Ids"); - - // Assert - Assert.Equal(new[] { "" }, result); - Assert.IsType(result); - } - - [Fact] - public void GetStringArrayValue_InvalidValues() - { - // Arrange - var dict = new Dictionary() { { "Ids", "1,,test,2" } }; - - // Act - var result = dict.GetStringArrayValue("Ids"); - - // Assert - Assert.Equal(new[] { "1", "", "test", "2" }, result); - Assert.IsType(result); - } - - [Fact] - public void GetStringArrayValue_NotFound() - { - // Arrange - var dict = new Dictionary() { { "Name", "Value" } }; - - // Act - var result = dict.GetStringArrayValue("Ids"); - - // Assert - Assert.Equal(new string[0], result); - Assert.IsType(result); - } - #endregion - - #region GetValue - [Fact] - public void GetValue_Int() - { - // Arrange - var dict = new Dictionary() { { "Id", "1" } }; - - // Act - var result = dict.GetValue("Id"); - - // Assert - Assert.Equal(1, result); - Assert.IsType(result); - } - - [Fact] - public void GetValue_Int_Default() - { - // Arrange - var dict = new Dictionary() { { "Id", "test" } }; - - // Act - var result = dict.GetValue("Id"); - - // Assert - Assert.Equal(0, result); - Assert.IsType(result); - } - - [Fact] - public void GetValue_Int_WithDefault() - { - // Arrange - var dict = new Dictionary() { { "Name", "1" } }; - - // Act - var result = dict.GetValue("Id", 1); - - // Assert - Assert.Equal(1, result); - Assert.IsType(result); - } - - [Fact] - public void GetValue_NullableBoolean() - { - // Arrange - var dict = new Dictionary() { { "Id", "true" } }; - - // Act - var result = dict.GetValue("Id"); - - // Assert - Assert.True(result); - Assert.IsType(result); - } - - [Fact] - public void GetValue_NullableBoolean_Default() - { - // Arrange - var dict = new Dictionary() { { "Name", "true" } }; - - // Act - var result = dict.GetValue("Id"); - - // Assert - Assert.Null(result); - } - - [Fact] - public void GetValue_NullableBoolean_WithDefault() - { - // Arrange - var dict = new Dictionary() { { "Name", "true" } }; - - // Act - var result = dict.GetValue("Id", true); - - // Assert - Assert.True(result); - Assert.IsType(result); - } - #endregion - - #region GetGuidValue - [Fact] - public void GetGuidValue() - { - // Arrange - var dict = new Dictionary() { { "Id", "8d1a35b3-6280-4103-93f5-792f8954bef8" } }; - - // Act - var result = dict.GetGuidValue("Id"); - - // Assert - Assert.Equal(new Guid("8d1a35b3-6280-4103-93f5-792f8954bef8"), result); - Assert.IsType(result); - } - - [Fact] - public void GetGuidValue_Default() - { - // Arrange - var dict = new Dictionary() { { "Name", "8d1a35b3-6280-4103-93f5-792f8954bef8" } }; - - // Act - var result = dict.GetGuidValue("Id"); - - // Assert - Assert.Equal(Guid.Empty, result); - Assert.IsType(result); - } - - [Fact] - public void GetGuidValue_WithDefault() - { - // Arrange - var dict = new Dictionary() { { "Name", "8d1a35b3-6280-4103-93f5-792f8954bef8" } }; - - // Act - var result = dict.GetGuidValue("Id", new Guid("8d1a35b3-6280-4103-93f5-792f8954bef2")); - - // Assert - Assert.Equal(new Guid("8d1a35b3-6280-4103-93f5-792f8954bef2"), result); - Assert.IsType(result); - } - - [Fact] - public void GetGuidNullValue() - { - // Arrange - var dict = new Dictionary() { { "Id", "8d1a35b3-6280-4103-93f5-792f8954bef8" } }; - - // Act - var result = dict.GetGuidNullValue("Id"); - - // Assert - Assert.Equal(new Guid("8d1a35b3-6280-4103-93f5-792f8954bef8"), result); - Assert.IsType(result); - } - - [Fact] - public void GetGuidNullValue_Null() - { - // Arrange - var dict = new Dictionary() { { "Name", "8d1a35b3-6280-4103-93f5-792f8954bef8" } }; - - // Act - var result = dict.GetGuidNullValue("Id"); - - // Assert - Assert.Null(result); - } - - [Fact] - public void GetGuidNullValue_Default() - { - // Arrange - var dict = new Dictionary() { { "Name", "8d1a35b3-6280-4103-93f5-792f8954bef8" } }; - - // Act - var result = dict.GetGuidNullValue("Id"); - - // Assert - Assert.Null(result); - } - - [Fact] - public void GetGuidNullValue_WithDefault() - { - // Arrange - var dict = new Dictionary() { { "Name", "8d1a35b3-6280-4103-93f5-792f8954bef8" } }; - - // Act - var result = dict.GetGuidNullValue("Id", new Guid("8d1a35b3-6280-4103-93f5-792f8954bef2")); - - // Assert - Assert.Equal(new Guid("8d1a35b3-6280-4103-93f5-792f8954bef2"), result); - Assert.IsType(result); - } - #endregion - - #region GetDateTimeValue - [Fact] - public void GetDateTimeValue() - { - // Arrange - var dict = new Dictionary() { { "Id", "2020-01-30" } }; - - // Act - var result = dict.GetDateTimeValue("Id"); - - // Assert - Assert.Equal(DateTime.Parse("2020-01-30"), result); - Assert.IsType(result); - } - - [Fact] - public void GetDateTimeValue_Default() - { - // Arrange - var dict = new Dictionary() { { "Name", "2020-01-30" } }; - - // Act - var result = dict.GetDateTimeValue("Id"); - - // Assert - Assert.Equal(DateTime.MinValue, result); - Assert.IsType(result); - } - - [Fact] - public void GetDateTimeValue_WithDefault() - { - // Arrange - var dict = new Dictionary() { { "Name", "2020-01-30" } }; - - // Act - var result = dict.GetDateTimeValue("Id", DateTime.Parse("2019-12-31")); - - // Assert - Assert.Equal(DateTime.Parse("2019-12-31"), result); - Assert.IsType(result); - } - - [Fact] - public void GetDateTimeNullValue() - { - // Arrange - var dict = new Dictionary() { { "Id", "2020-01-30" } }; - - // Act - var result = dict.GetDateTimeNullValue("Id"); - - // Assert - Assert.Equal(DateTime.Parse("2020-01-30"), result); - Assert.IsType(result); - } - - [Fact] - public void GetDateTimeNullValue_Null() - { - // Arrange - var dict = new Dictionary() { { "Name", "2020-01-30" } }; - - // Act - var result = dict.GetDateTimeNullValue("Id"); - - // Assert - Assert.Null(result); - } - - [Fact] - public void GetDateTimeNullValue_Default() - { - // Arrange - var dict = new Dictionary() { { "Name", "2020-01-30" } }; - - // Act - var result = dict.GetDateTimeNullValue("Id"); - - // Assert - Assert.Null(result); - } - - [Fact] - public void GetDateTimeNullValue_WithDefault() - { - // Arrange - var dict = new Dictionary() { { "Name", "2020-01-30" } }; - - // Act - var result = dict.GetDateTimeNullValue("Id", DateTime.Parse("2019-12-31")); - - // Assert - Assert.Equal(DateTime.Parse("2019-12-31"), result); - Assert.IsType(result); - } - #endregion - - #region GetEnumValue - [Fact] - public void GetEnumValue() - { - // Arrange - var dict = new Dictionary() { { "Id", "Utf8" } }; - - // Act - var result = dict.GetEnumValue("Id"); - - // Assert - Assert.Equal(Entity.NotificationEncodings.Utf8, result); - Assert.IsType(result); - } - - [Fact] - public void GetEnumValue_Case() - { - // Arrange - var dict = new Dictionary() { { "Id", "utf8" } }; - - // Act - var result = dict.GetEnumValue("Id", false, Entity.NotificationEncodings.Base64); - - // Assert - Assert.Equal(Entity.NotificationEncodings.Base64, result); - Assert.IsType(result); - } - - [Fact] - public void GetEnumValue_Default() - { - // Arrange - var dict = new Dictionary() { { "Name", "Utf8" } }; - - // Act - var result = dict.GetEnumValue("Id"); - - // Assert - Assert.Equal(Entity.NotificationEncodings.Utf8, result); - Assert.IsType(result); - } - - [Fact] - public void GetEnumValue_WithDefault() - { - // Arrange - var dict = new Dictionary() { { "Name", "Utf8" } }; - - // Act - var result = dict.GetEnumValue("Id", false, Entity.NotificationEncodings.Binary); - - // Assert - Assert.Equal(Entity.NotificationEncodings.Binary, result); - Assert.IsType(result); - } - - [Fact] - public void GetEnumNullValue() - { - // Arrange - var dict = new Dictionary() { { "Id", "Utf8" } }; - - // Act - var result = dict.GetEnumNullValue("Id"); - - // Assert - Assert.Equal(Entity.NotificationEncodings.Utf8, result); - Assert.IsType(result); - } - - [Fact] - public void GetEnumNullValue_Case() - { - // Arrange - var dict = new Dictionary() { { "Id", "utf8" } }; - - // Act - var result = dict.GetEnumNullValue("Id", false); - - // Assert - Assert.Null(result); - } - - [Fact] - public void GetEnumNullValue_Null() - { - // Arrange - var dict = new Dictionary() { { "Name", "Utf8" } }; - - // Act - var result = dict.GetEnumNullValue("Id"); - - // Assert - Assert.Null(result); - } - - [Fact] - public void GetEnumNullValue_Default() - { - // Arrange - var dict = new Dictionary() { { "Name", "Utf8" } }; - - // Act - var result = dict.GetEnumNullValue("Id"); - - // Assert - Assert.Null(result); - } - - [Fact] - public void GetEnumNullValue_WithDefault() - { - // Arrange - var dict = new Dictionary() { { "Name", "Utf8" } }; - - // Act - var result = dict.GetEnumNullValue("Id", false, Entity.NotificationEncodings.Binary); - - // Assert - Assert.Equal(Entity.NotificationEncodings.Binary, result); - Assert.IsType(result); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Core/Extensions/EnumExtensionsTest.cs b/backend/tests/unit/dal/Core/Extensions/EnumExtensionsTest.cs deleted file mode 100644 index 1ff65a7efb..0000000000 --- a/backend/tests/unit/dal/Core/Extensions/EnumExtensionsTest.cs +++ /dev/null @@ -1,74 +0,0 @@ -using FluentAssertions; -using Pims.Core.Extensions; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using CModel = Pims.Ches.Models; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Test.Core.Extensions -{ - [Trait("category", "unit")] - [Trait("category", "core")] - [Trait("category", "function")] - [ExcludeFromCodeCoverage] - public class EnumExtensionsTest - { - #region Data - public static IEnumerable EnumInData = new List() - { - new object[] { Entity.NotificationEncodings.Utf8, new[] { Entity.NotificationEncodings.Utf8, Entity.NotificationEncodings.Hex }, true }, - new object[] { Entity.NotificationEncodings.Utf8, new[] { Entity.NotificationEncodings.Utf8 }, true }, - new object[] { Entity.NotificationEncodings.Utf8, new[] { Entity.NotificationEncodings.Binary, Entity.NotificationEncodings.Hex }, false }, - new object[] { Entity.NotificationEncodings.Utf8, new[] { Entity.NotificationEncodings.Binary }, false }, - new object[] { Entity.NotificationEncodings.Utf8, new Entity.NotificationEncodings[0], false }, - }; - #endregion - - #region Tests - #region ToLower - [Fact] - public void Enum_ToLower() - { - // Arrange - var encoding = Entity.NotificationEncodings.Utf8; - - // Act - var result = encoding.ToLower(); - - // Assert - result.Should().Be("utf8"); - } - #endregion - - #region In - [Theory] - [MemberData(nameof(EnumInData))] - public void Enum_In(Entity.NotificationEncodings value, Entity.NotificationEncodings[] inValues, bool expectedResult) - { - // Arrange - // Act - var result = value.In(inValues); - - // Assert - result.Should().Be(expectedResult); - } - #endregion - - #region ConvertTo - [Fact] - public void Enum_ConvertTo() - { - // Arrange - var encoding = Entity.NotificationEncodings.Utf8; - - // Act - var result = encoding.ConvertTo(); - - // Assert - result.Should().Be(CModel.EmailEncodings.Utf8); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Core/Extensions/EnumerableExtensionsTest.cs b/backend/tests/unit/dal/Core/Extensions/EnumerableExtensionsTest.cs deleted file mode 100644 index cad715d88c..0000000000 --- a/backend/tests/unit/dal/Core/Extensions/EnumerableExtensionsTest.cs +++ /dev/null @@ -1,178 +0,0 @@ -using FluentAssertions; -using Pims.Core.Extensions; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Xunit; - -namespace Pims.Api.Test.Core.Extensions -{ - [Trait("category", "unit")] - [Trait("category", "core")] - [Trait("category", "function")] - [ExcludeFromCodeCoverage] - public class EnumerableExtensionsTest - { - #region Data - public static IEnumerable NextData = new List() - { - new object[] { 0, 1 }, - new object[] { 1, 2 }, - new object[] { 2, 3 } - }; - #endregion - - #region Tests - #region ForEach - [Fact] - public void Enumerable_ForEach() - { - // Arrange - var list = new[] { 1, 2, 3 }; - - // Act - var result = 0; - var iterations = 0; - list.ForEach(v => - { - result += v; - iterations++; - }); - - // Assert - result.Should().Be(6); - iterations.Should().Be(list.Length); - } - - [Fact] - public void Enumerable_ForEach_WithIndex() - { - // Arrange - var list = new[] { 1, 2, 3 }; - - // Act - var result = 0; - var iterations = 0; - var insideIndex = 0; - list.ForEach((v, i) => - { - result += v; - iterations++; - insideIndex = i; - }); - - // Assert - result.Should().Be(6); - iterations.Should().Be(list.Length); - insideIndex.Should().Be(list.Length - 1); - } - #endregion - - #region Next - [Theory] - [MemberData(nameof(NextData))] - public void Enumerable_Next(int index, int expectedResult) - { - // Arrange - var list = new[] { 1, 2, 3 }; - - // Act - var result = list.Next(index); - - // Assert - result.Should().Be(expectedResult); - } - - [Fact] - public void Enumerable_Next_IndexTooLow() - { - // Arrange - var list = new[] { 1, 2, 3 }; - - // Act - // Assert - Assert.Throws(() => list.Next(-1)); - } - - [Fact] - public void Enumerable_Next_IndexTooHigh() - { - // Arrange - var list = new[] { 1, 2, 3 }; - - // Act - // Assert - Assert.Throws(() => list.Next(4)); - } - - [Fact] - public void Enumerable_Next_Take() - { - // Arrange - var list = new[] { 1, 2, 3 }; - - // Act - var results = list.Next(1, 2); - - // Assert - Assert.IsAssignableFrom>(results); - results.Should().HaveCount(2); - results.First().Should().Be(2); - } - - [Fact] - public void Enumerable_Next_Take_IndexTooLow() - { - // Arrange - var list = new[] { 1, 2, 3 }; - - // Act - // Assert - Assert.Throws(() => list.Next(-1, 1)); - } - - [Fact] - public void Enumerable_Next_Take_TakeTooLow() - { - // Arrange - var list = new[] { 1, 2, 3 }; - - // Act - // Assert - Assert.Throws(() => list.Next(1, 0)); - } - - [Fact] - public void Enumerable_Next_TakeTooHigh() - { - // Arrange - var list = new[] { 1, 2, 3 }; - - // Act - var results = list.Next(1, 4); - - // Assert - Assert.IsAssignableFrom>(results); - results.Should().HaveCount(2); - results.First().Should().Be(2); - } - #endregion - - #region NotNull - [Fact] - public void Enumerable_NotNull() - { - // Arrange - var list = new int?[] { 1, 2, null, 3 }; - - // Act - var results = list.NotNull(); - - // Assert - results.Should().HaveCount(3); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Core/Helpers/CsvHelperTest.cs b/backend/tests/unit/dal/Core/Helpers/CsvHelperTest.cs deleted file mode 100644 index f9b49369c3..0000000000 --- a/backend/tests/unit/dal/Core/Helpers/CsvHelperTest.cs +++ /dev/null @@ -1,131 +0,0 @@ -using Pims.Core.Helpers; -using Pims.Dal.Security; -using System; -using System.Collections.Generic; -using System.Data; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Test.Helpers -{ - [Trait("category", "unit")] - [Trait("category", "core")] - [Trait("category", "function")] - [ExcludeFromCodeCoverage] - public class CsvHelperTest - { - #region Data - public static IEnumerable DataWithoutDelimiter => - new List - { - new object[] { new[] { new { Id = 1, Name = "test1" }, new { Id = 2, Name = "test2" } }, "Id,Name\r\n1,test1\r\n2,test2\r\n" }, - new object[] { new[] { new { Id = 1, Name = "test,1" }, new { Id = 2, Name = "test,2" } }, "Id,Name\r\n1,\"test,1\"\r\n2,\"test,2\"\r\n" }, - new object[] - { - new[] { new Entity.TierLevel(1, "test1") { CreatedOn = new DateTime(2020, 1, 1) }, new Entity.TierLevel(2, "test2") { CreatedOn = new DateTime(2020, 1, 1) } }, - "Description,Id,Name,IsDisabled,SortOrder,CreatedById,Id,KeycloakUserId,Username,DisplayName,FirstName,MiddleName,LastName,Email,Position,IsDisabled,EmailVerified,Note,IsSystem,LastLogin,ApprovedById,Id,KeycloakUserId,Username,DisplayName,FirstName,MiddleName,LastName,Email,Position,IsDisabled,EmailVerified,Note,IsSystem,LastLogin,ApprovedById,ApprovedOn,CreatedById,CreatedOn,UpdatedById,UpdatedOn,RowVersion,ApprovedOn,CreatedById,Id,KeycloakUserId,Username,DisplayName,FirstName,MiddleName,LastName,Email,Position,IsDisabled,EmailVerified,Note,IsSystem,LastLogin,ApprovedById,ApprovedOn,CreatedById,CreatedOn,UpdatedById,UpdatedOn,RowVersion,CreatedOn,UpdatedById,Id,KeycloakUserId,Username,DisplayName,FirstName,MiddleName,LastName,Email,Position,IsDisabled,EmailVerified,Note,IsSystem,LastLogin,ApprovedById,ApprovedOn,CreatedById,CreatedOn,UpdatedById,UpdatedOn,RowVersion,UpdatedOn,RowVersion,CreatedOn,UpdatedById,Id,KeycloakUserId,Username,DisplayName,FirstName,MiddleName,LastName,Email,Position,IsDisabled,EmailVerified,Note,IsSystem,LastLogin,ApprovedById,Id,KeycloakUserId,Username,DisplayName,FirstName,MiddleName,LastName,Email,Position,IsDisabled,EmailVerified,Note,IsSystem,LastLogin,ApprovedById,ApprovedOn,CreatedById,CreatedOn,UpdatedById,UpdatedOn,RowVersion,ApprovedOn,CreatedById,Id,KeycloakUserId,Username,DisplayName,FirstName,MiddleName,LastName,Email,Position,IsDisabled,EmailVerified,Note,IsSystem,LastLogin,ApprovedById,ApprovedOn,CreatedById,CreatedOn,UpdatedById,UpdatedOn,RowVersion,CreatedOn,UpdatedById,Id,KeycloakUserId,Username,DisplayName,FirstName,MiddleName,LastName,Email,Position,IsDisabled,EmailVerified,Note,IsSystem,LastLogin,ApprovedById,ApprovedOn,CreatedById,CreatedOn,UpdatedById,UpdatedOn,RowVersion,UpdatedOn,RowVersion,UpdatedOn,RowVersion\r\n,1,test1,False,0,,00000000-0000-0000-0000-000000000000,,,,,,,,,False,False,,False,,,00000000-0000-0000-0000-000000000000,,,,,,,,,False,False,,False,,,,,01/01/0001 00:00:00,,,,,,00000000-0000-0000-0000-000000000000,,,,,,,,,False,False,,False,,,,,01/01/0001 00:00:00,,,,01/01/0001 00:00:00,,00000000-0000-0000-0000-000000000000,,,,,,,,,False,False,,False,,,,,01/01/0001 00:00:00,,,,,,01/01/2020 00:00:00,,00000000-0000-0000-0000-000000000000,,,,,,,,,False,False,,False,,,00000000-0000-0000-0000-000000000000,,,,,,,,,False,False,,False,,,,,01/01/0001 00:00:00,,,,,,00000000-0000-0000-0000-000000000000,,,,,,,,,False,False,,False,,,,,01/01/0001 00:00:00,,,,01/01/0001 00:00:00,,00000000-0000-0000-0000-000000000000,,,,,,,,,False,False,,False,,,,,01/01/0001 00:00:00,,,,,,,\r\n,2,test2,False,0,,00000000-0000-0000-0000-000000000000,,,,,,,,,False,False,,False,,,00000000-0000-0000-0000-000000000000,,,,,,,,,False,False,,False,,,,,01/01/0001 00:00:00,,,,,,00000000-0000-0000-0000-000000000000,,,,,,,,,False,False,,False,,,,,01/01/0001 00:00:00,,,,01/01/0001 00:00:00,,00000000-0000-0000-0000-000000000000,,,,,,,,,False,False,,False,,,,,01/01/0001 00:00:00,,,,,,01/01/2020 00:00:00,,00000000-0000-0000-0000-000000000000,,,,,,,,,False,False,,False,,,00000000-0000-0000-0000-000000000000,,,,,,,,,False,False,,False,,,,,01/01/0001 00:00:00,,,,,,00000000-0000-0000-0000-000000000000,,,,,,,,,False,False,,False,,,,,01/01/0001 00:00:00,,,,01/01/0001 00:00:00,,00000000-0000-0000-0000-000000000000,,,,,,,,,False,False,,False,,,,,01/01/0001 00:00:00,,,,,,,\r\n" - - } - }; - - public static IEnumerable DataWithDelimiter => - new List - { - new object[] { new[] { new { Id = 1, Name = "test1" }, new { Id = 2, Name = "test2" } }, ";", "Id;Name\r\n1;test1\r\n2;test2\r\n" }, - new object[] { new[] { new { Id = 1, Name = "test;1" }, new { Id = 2, Name = "test;2" } }, ";", "Id;Name\r\n1;\"test;1\"\r\n2;\"test;2\"\r\n" }, - new object[] - { - new[] { new Entity.TierLevel(1, "test1") { CreatedOn = new DateTime(2020, 1, 1) }, new Entity.TierLevel(2, "test2") { CreatedOn = new DateTime(2020, 1, 1) } }, - "-", - "Description-Id-Name-IsDisabled-SortOrder-CreatedById-Id-KeycloakUserId-Username-DisplayName-FirstName-MiddleName-LastName-Email-Position-IsDisabled-EmailVerified-Note-IsSystem-LastLogin-ApprovedById-Id-KeycloakUserId-Username-DisplayName-FirstName-MiddleName-LastName-Email-Position-IsDisabled-EmailVerified-Note-IsSystem-LastLogin-ApprovedById-ApprovedOn-CreatedById-CreatedOn-UpdatedById-UpdatedOn-RowVersion-ApprovedOn-CreatedById-Id-KeycloakUserId-Username-DisplayName-FirstName-MiddleName-LastName-Email-Position-IsDisabled-EmailVerified-Note-IsSystem-LastLogin-ApprovedById-ApprovedOn-CreatedById-CreatedOn-UpdatedById-UpdatedOn-RowVersion-CreatedOn-UpdatedById-Id-KeycloakUserId-Username-DisplayName-FirstName-MiddleName-LastName-Email-Position-IsDisabled-EmailVerified-Note-IsSystem-LastLogin-ApprovedById-ApprovedOn-CreatedById-CreatedOn-UpdatedById-UpdatedOn-RowVersion-UpdatedOn-RowVersion-CreatedOn-UpdatedById-Id-KeycloakUserId-Username-DisplayName-FirstName-MiddleName-LastName-Email-Position-IsDisabled-EmailVerified-Note-IsSystem-LastLogin-ApprovedById-Id-KeycloakUserId-Username-DisplayName-FirstName-MiddleName-LastName-Email-Position-IsDisabled-EmailVerified-Note-IsSystem-LastLogin-ApprovedById-ApprovedOn-CreatedById-CreatedOn-UpdatedById-UpdatedOn-RowVersion-ApprovedOn-CreatedById-Id-KeycloakUserId-Username-DisplayName-FirstName-MiddleName-LastName-Email-Position-IsDisabled-EmailVerified-Note-IsSystem-LastLogin-ApprovedById-ApprovedOn-CreatedById-CreatedOn-UpdatedById-UpdatedOn-RowVersion-CreatedOn-UpdatedById-Id-KeycloakUserId-Username-DisplayName-FirstName-MiddleName-LastName-Email-Position-IsDisabled-EmailVerified-Note-IsSystem-LastLogin-ApprovedById-ApprovedOn-CreatedById-CreatedOn-UpdatedById-UpdatedOn-RowVersion-UpdatedOn-RowVersion-UpdatedOn-RowVersion\r\n-1-test1-False-0--\"00000000-0000-0000-0000-000000000000\"---------False-False--False---\"00000000-0000-0000-0000-000000000000\"---------False-False--False-----01/01/0001 00:00:00------\"00000000-0000-0000-0000-000000000000\"---------False-False--False-----01/01/0001 00:00:00----01/01/0001 00:00:00--\"00000000-0000-0000-0000-000000000000\"---------False-False--False-----01/01/0001 00:00:00------01/01/2020 00:00:00--\"00000000-0000-0000-0000-000000000000\"---------False-False--False---\"00000000-0000-0000-0000-000000000000\"---------False-False--False-----01/01/0001 00:00:00------\"00000000-0000-0000-0000-000000000000\"---------False-False--False-----01/01/0001 00:00:00----01/01/0001 00:00:00--\"00000000-0000-0000-0000-000000000000\"---------False-False--False-----01/01/0001 00:00:00-------\r\n-2-test2-False-0--\"00000000-0000-0000-0000-000000000000\"---------False-False--False---\"00000000-0000-0000-0000-000000000000\"---------False-False--False-----01/01/0001 00:00:00------\"00000000-0000-0000-0000-000000000000\"---------False-False--False-----01/01/0001 00:00:00----01/01/0001 00:00:00--\"00000000-0000-0000-0000-000000000000\"---------False-False--False-----01/01/0001 00:00:00------01/01/2020 00:00:00--\"00000000-0000-0000-0000-000000000000\"---------False-False--False---\"00000000-0000-0000-0000-000000000000\"---------False-False--False-----01/01/0001 00:00:00------\"00000000-0000-0000-0000-000000000000\"---------False-False--False-----01/01/0001 00:00:00----01/01/0001 00:00:00--\"00000000-0000-0000-0000-000000000000\"---------False-False--False-----01/01/0001 00:00:00-------\r\n" - } - }; - #endregion - - #region Tests - [Theory] - [MemberData(nameof(DataWithoutDelimiter))] - public void ConvertToCSV(IEnumerable data, string expectedResult) - { - // Arrange - // Act - var result = data.ConvertToCSV(); - - // Assert - Assert.NotNull(result); - Assert.IsType(result); - Assert.Equal(expectedResult, result); - } - - [Theory] - [MemberData(nameof(DataWithDelimiter))] - public void ConvertToCSV_WithDelimiter(IEnumerable data, string delimiter, string expectedResult) - { - // Arrange - // Act - var result = data.ConvertToCSV(delimiter); - - // Assert - Assert.NotNull(result); - Assert.IsType(result); - Assert.Equal(expectedResult, result); - } - - [Fact] - public void ConvertToDataTable() - { - // Arrange - var items = new[] { new { Id = 1, Name = "test1" }, new { Id = 2, Name = "test2" } }; - - // Act - var result = items.ConvertToDataTable("test"); - - // Assert - Assert.NotNull(result); - Assert.IsType(result); - Assert.Equal(2, result.Columns.Count); - Assert.Equal(2, result.Rows.Count); - Assert.Equal("test", result.TableName); - } - - [Fact] - public void ConvertToDataTable_Enums() - { - // Arrange - var items = new[] { new { Id = 1, Name = "test1", Permission = Permissions.AdminProperties }, new { Id = 2, Name = "test2", Permission = Permissions.AdminRoles } }; - - // Act - var result = items.ConvertToDataTable("test"); - - // Assert - Assert.NotNull(result); - Assert.IsType(result); - Assert.Equal(3, result.Columns.Count); - Assert.Equal(2, result.Rows.Count); - Assert.Equal(typeof(string), result.Columns[2].DataType); - Assert.Equal($"{Permissions.AdminProperties}", result.Rows[0][2]); - } - - [Fact] - public void ConvertToDataTable_NullableType() - { - // Arrange - var items = new[] { new { Id = (int?)1, Name = "test1" }, new { Id = (int?)null, Name = "test2" } }; - - // Act - var result = items.ConvertToDataTable("test"); - - // Assert - Assert.NotNull(result); - Assert.IsType(result); - Assert.Equal(2, result.Columns.Count); - Assert.Equal(2, result.Rows.Count); - Assert.Equal(typeof(int), result.Columns[0].DataType); - Assert.Equal(DBNull.Value, result.Rows[1][0]); - Assert.True(result.Columns[0].AllowDBNull); - Assert.True(result.Columns[1].AllowDBNull); - } - #endregion - } -} diff --git a/backend/tests/unit/dal/Core/Helpers/ExceptionHelper.cs b/backend/tests/unit/dal/Core/Helpers/ExceptionHelper.cs deleted file mode 100644 index 22966947c2..0000000000 --- a/backend/tests/unit/dal/Core/Helpers/ExceptionHelper.cs +++ /dev/null @@ -1,120 +0,0 @@ -using Pims.Core.Helpers; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Test.Helpers -{ - [Trait("category", "unit")] - [Trait("category", "core")] - [Trait("category", "function")] - [ExcludeFromCodeCoverage] - public class ExceptionHelperTest - { - #region Data - public static IEnumerable Data => - new List - { - new object[] { new[] { new { Id = 1, Name = "test1" }, new { Id = 2, Name = "test2" } }, 2 }, - new object[] { new[] { new Entity.TierLevel(1, "test1"), new Entity.TierLevel(2, "test2") }, 10 } - }; - #endregion - - #region Tests - [Fact] - public void HandleKeyNotFound() - { - // Arrange - static bool get() => throw new KeyNotFoundException(); - - // Act - var result = ExceptionHelper.HandleKeyNotFound(get); - - // Assert - Assert.False(result); - } - - [Fact] - public void HandleKeyNotFound_Nullable() - { - // Arrange - static bool? get() => throw new KeyNotFoundException(); - - // Act - var result = ExceptionHelper.HandleKeyNotFound(get); - - // Assert - Assert.Null(result); - } - - [Fact] - public void HandleKeyNotFound_Object() - { - // Arrange - static Entity.Parcel get() => throw new KeyNotFoundException(); - - // Act - var result = ExceptionHelper.HandleKeyNotFound(get); - - // Assert - Assert.Null(result); - } - - [Fact] - public void HandleKeyNotFound_WithSetter() - { - // Arrange - static bool get() => throw new KeyNotFoundException(); - static bool set() => true; - - // Act - var result = ExceptionHelper.HandleKeyNotFound(get, set); - - // Assert - Assert.True(result); - } - - [Fact] - public void HandleKeyNotFound_WithDefault() - { - // Arrange - static bool get() => throw new KeyNotFoundException(); - - // Act - var result = ExceptionHelper.HandleKeyNotFound(get, true); - - // Assert - Assert.True(result); - } - - [Fact] - public void HandleKeyNotFound_WithDefaultInstance() - { - // Arrange - static Entity.Parcel get() => throw new KeyNotFoundException(); - - // Act - var result = ExceptionHelper.HandleKeyNotFoundWithDefault(get); - - // Assert - Assert.NotNull(result); - Assert.IsType(result); - } - - [Fact] - public void HandleKeyNotFound_WithDefaultInstance_Primitive() - { - // Arrange - static bool get() => throw new KeyNotFoundException(); - - // Act - var result = ExceptionHelper.HandleKeyNotFoundWithDefault(get); - - // Assert - Assert.False(result); - Assert.IsType(result); - } - #endregion - } -} diff --git a/backend/tests/unit/dal/Core/Helpers/StringHelperTest.cs b/backend/tests/unit/dal/Core/Helpers/StringHelperTest.cs deleted file mode 100644 index 8f51739a2d..0000000000 --- a/backend/tests/unit/dal/Core/Helpers/StringHelperTest.cs +++ /dev/null @@ -1,66 +0,0 @@ -using Pims.Core.Helpers; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using Xunit; - -namespace Pims.Api.Test.Helpers -{ - [Trait("category", "unit")] - [Trait("category", "core")] - [Trait("category", "function")] - [ExcludeFromCodeCoverage] - public class StringHelperTest - { - #region Data - public static IEnumerable Data => - new List - { - new object[] { 10 }, - new object[] { 15 } - }; - #endregion - - #region Tests - [Theory] - [MemberData(nameof(Data))] - public void Generate(int length) - { - // Arrange - // Act - var result = StringHelper.Generate(length); - - // Assert - Assert.NotNull(result); - Assert.IsType(result); - Assert.Equal(length, result.Length); - } - - [Theory] - [MemberData(nameof(Data))] - public void Generate_NoDuplicate(int length) - { - // Arrange - // Act - var result1 = StringHelper.Generate(length); - var result2 = StringHelper.Generate(length); - - // Assert - Assert.NotNull(result1); - Assert.NotNull(result2); - Assert.Equal(length, result1.Length); - Assert.Equal(length, result2.Length); - Assert.NotEqual(result1, result2); - } - - [Fact] - public void Generate_ArgumentException() - { - // Arrange - // Act - // Assert - Assert.Throws(() => StringHelper.Generate(1)); - } - #endregion - } -} diff --git a/backend/tests/unit/dal/Core/Helpers/XmlHelperTest.cs b/backend/tests/unit/dal/Core/Helpers/XmlHelperTest.cs deleted file mode 100644 index 1ed11e8967..0000000000 --- a/backend/tests/unit/dal/Core/Helpers/XmlHelperTest.cs +++ /dev/null @@ -1,53 +0,0 @@ -using ClosedXML.Excel; -using Pims.Core.Helpers; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Api.Test.Helpers -{ - [Trait("category", "unit")] - [Trait("category", "core")] - [Trait("category", "function")] - [ExcludeFromCodeCoverage] - public class XmlHelperTest - { - #region Data - public static IEnumerable Data => - new List - { - new object[] { new[] { new { Id = 1, Name = "test1" }, new { Id = 2, Name = "test2" } }, 2 }, - new object[] - { - new[] { - new Entity.TierLevel(1, "test1") { CreatedOn = DateTime.UtcNow }, - new Entity.TierLevel(2, "test2") { CreatedOn = DateTime.UtcNow } - }, - 9 - } - }; - #endregion - - #region Tests - [Theory] - [MemberData(nameof(Data))] - public void ConvertToXLWorkbook(IEnumerable data, int expectedColumns) - { - // Arrange - var datatable = data.ConvertToDataTable("test"); - - // Act - var result = datatable.ConvertToXLWorkbook(); - - // Assert - Assert.NotNull(result); - Assert.IsType(result); - Assert.Equal(1, result.Worksheets.Count); - Assert.Equal(expectedColumns, result.Worksheets.First().Columns().Count()); - } - #endregion - } -} diff --git a/backend/tests/unit/dal/Helpers/Extensions/BuildingExtensionsTest.cs b/backend/tests/unit/dal/Helpers/Extensions/BuildingExtensionsTest.cs deleted file mode 100644 index abeaae2853..0000000000 --- a/backend/tests/unit/dal/Helpers/Extensions/BuildingExtensionsTest.cs +++ /dev/null @@ -1,90 +0,0 @@ -using FluentAssertions; -using Pims.Dal.Entities; -using Pims.Dal.Helpers.Extensions; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Xunit; - -namespace Pims.Dal.Test.Helpers.Extensions -{ - [Trait("category", "unit")] - [Trait("category", "dal")] - [Trait("category", "extensions")] - [Trait("group", "building")] - [ExcludeFromCodeCoverage] - public class BuildingExtensionsTest - { - #region Tests - [Fact] - public void Get_BuildingZoning() - { - // Arrange - var zone = "Zoning"; - var parcel = new Parcel - { - Zoning = zone - }; - var building = new Building(); - building.Parcels.Add(new ParcelBuilding(parcel, building)); - - // Act - var zoning = building.GetZoning(); - - // Assert - Assert.NotNull(zoning); - Assert.IsAssignableFrom>(zoning); - zoning.Should().HaveCount(1); - zoning.First().Should().Be(zone); - } - - [Fact] - public void Get_BuildingZoning_NoParcel() - { - // Arrange - var building = new Building(); - - // Act - var zoning = building.GetZoning(); - - // Assert - Assert.Empty(zoning); - } - - [Fact] - public void Get_BuildingZoningPotential() - { - // Arrange - var zonePotential = "ZoningPotential"; - var parcel = new Parcel - { - ZoningPotential = zonePotential - }; - var building = new Building(); - building.Parcels.Add(new ParcelBuilding(parcel, building)); - - // Act - var zoningPotential = building.GetZoningPotential(); - - // Assert - Assert.NotNull(zoningPotential); - Assert.IsAssignableFrom>(zoningPotential); - zoningPotential.Should().HaveCount(1); - zoningPotential.First().Should().Be(zonePotential); - } - - [Fact] - public void Get_BuildingZoningPotential_NoParcel() - { - // Arrange - var building = new Building(); - - // Act - var zoningPotential = building.GetZoningPotential(); - - // Assert - Assert.Empty(zoningPotential); - } - #endregion - } -} diff --git a/backend/tests/unit/dal/Helpers/Extensions/ProjectExtensionsTest.cs b/backend/tests/unit/dal/Helpers/Extensions/ProjectExtensionsTest.cs deleted file mode 100644 index 0d890b7157..0000000000 --- a/backend/tests/unit/dal/Helpers/Extensions/ProjectExtensionsTest.cs +++ /dev/null @@ -1,89 +0,0 @@ -using FluentAssertions; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Xunit; - -namespace Pims.Dal.Test.Helpers.Extensions -{ - [Trait("category", "unit")] - [Trait("category", "dal")] - [Trait("category", "extensions")] - [Trait("group", "project")] - [ExcludeFromCodeCoverage] - public class ProjectExtensionsTest - { - #region Tests - #region GetProjectFinancialDate - [Fact] - public void GetProjectFinancialDate_NoEvaluations() - { - // Arrange - var project = EntityHelper.CreateProject(1); - var parcel = EntityHelper.CreateParcel(1); - var buildings = EntityHelper.CreateBuildings(parcel, 1, 10); - buildings.ForEach(b => project.AddProperty(b)); - - // Act - var result = project.GetProjectFinancialDate(); - - // Assert - result.Should().NotBeAfter(DateTime.UtcNow); - } - - [Fact] - public void GetProjectFinancialDate() - { - // Arrange - var project = EntityHelper.CreateProject(1); - var parcel = EntityHelper.CreateParcel(1); - var buildings = EntityHelper.CreateBuildings(parcel, 1, 10); - var evaluations = EntityHelper.CreateEvaluations(buildings.Next(0), new DateTime(2015, 1, 1), 5); - buildings.ForEach(b => project.AddProperty(b)); - - // Act - var result = project.GetProjectFinancialDate(); - - // Assert - Assert.Equal(new DateTime(2019, 1, 1), result); - } - #endregion - - #region SetProjectPropertiesVisiblity - [Fact] - public void SetProjectPropertiesVisiblity() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var context = helper.InitializeDatabase(user); - var project = context.CreateProject(1); - var parcel = context.CreateParcel(1); - project.AddProperty(parcel); - - // Act - context.SetProjectPropertiesVisiblity(project, false); - - // Assert - var properties = project.Properties.ToArray(); - foreach (var property in properties) - { - if (property.BuildingId.HasValue) - { - property.Building.IsVisibleToOtherAgencies.Should().BeFalse(); - } - else if (property.ParcelId.HasValue) - { - property.Parcel.IsVisibleToOtherAgencies.Should().BeFalse(); - } - } - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Helpers/Extensions/PropertyExtensionsTest.cs b/backend/tests/unit/dal/Helpers/Extensions/PropertyExtensionsTest.cs deleted file mode 100644 index 2ccde96d2f..0000000000 --- a/backend/tests/unit/dal/Helpers/Extensions/PropertyExtensionsTest.cs +++ /dev/null @@ -1,122 +0,0 @@ -using FluentAssertions; -using Pims.Core.Test; -using Pims.Dal.Entities; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using System; -using System.Diagnostics.CodeAnalysis; -using Xunit; - -namespace Pims.Dal.Test.Helpers.Extensions -{ - [Trait("category", "unit")] - [Trait("category", "dal")] - [Trait("category", "extensions")] - [Trait("group", "project")] - [ExcludeFromCodeCoverage] - public class PropertyExtensionsTest - { - #region Tests - - [Fact] - public void RemoveEvaluationsWithinOneYear_ParcelEvaluations() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var context = helper.InitializeDatabase(user); - var parcel = context.CreateParcel(1); - var updatedParcel = context.CreateParcel(2); - var olderThenOneYear = new Entities.ParcelEvaluation() - { - Date = DateTime.Now.AddYears(1).AddDays(1), - Value = 1, - Key = EvaluationKeys.Appraised, - }; - var toRemove = new Entities.ParcelEvaluation() - { - Date = DateTime.Now.AddDays(1), - Value = 2, - Key = EvaluationKeys.Appraised, - }; - var toNotRemove = new Entities.ParcelEvaluation() - { - Date = DateTime.Now.AddDays(-1), - Value = 3, - Key = EvaluationKeys.Appraised, - }; - parcel.Evaluations.Add(olderThenOneYear); - parcel.Evaluations.Add(toRemove); - parcel.Evaluations.Add(toNotRemove); - - var eval = new Entities.ParcelEvaluation() - { - Date = DateTime.Now, - Value = 1, - Key = EvaluationKeys.Appraised, - }; - updatedParcel.Evaluations.Add(eval); - - // Act - parcel.RemoveEvaluationsWithinOneYear(updatedParcel); - - // Assert - parcel.Evaluations.Should().Contain(toNotRemove); - parcel.Evaluations.Should().Contain(olderThenOneYear); - parcel.Evaluations.Should().NotContain(toRemove); - } - - [Fact] - public void RemoveEvaluationsWithinOneYear_BuildingEvaluations() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var context = helper.InitializeDatabase(user); - var parcel = context.CreateParcel(1); - var building = context.CreateBuilding(parcel, 2); - var updatedParcel = context.CreateParcel(3); - var updatedBuilding = context.CreateBuilding(updatedParcel, 4); - var olderThenOneYear = new Entities.BuildingEvaluation() - { - Date = DateTime.Now.AddYears(1).AddDays(1), - Value = 1, - Key = EvaluationKeys.Appraised, - }; - var toRemove = new Entities.BuildingEvaluation() - { - Date = DateTime.Now.AddDays(1), - Value = 2, - Key = EvaluationKeys.Appraised, - }; - var toNotRemove = new Entities.BuildingEvaluation() - { - Date = DateTime.Now.AddDays(-1), - Value = 3, - Key = EvaluationKeys.Appraised, - }; - building.Evaluations.Add(olderThenOneYear); - building.Evaluations.Add(toRemove); - building.Evaluations.Add(toNotRemove); - - var eval = new Entities.BuildingEvaluation() - { - Date = DateTime.Now, - Value = 1, - Key = EvaluationKeys.Appraised, - }; - updatedBuilding.Evaluations.Add(eval); - - // Act - building.RemoveEvaluationsWithinOneYear(updatedBuilding); - - // Assert - building.Evaluations.Should().Contain(toNotRemove); - building.Evaluations.Should().Contain(olderThenOneYear); - building.Evaluations.Should().NotContain(toRemove); - } - #endregion - } -} diff --git a/backend/tests/unit/dal/Libraries/Ches/ChesExceptionTest.cs b/backend/tests/unit/dal/Libraries/Ches/ChesExceptionTest.cs deleted file mode 100644 index 363cf2af1c..0000000000 --- a/backend/tests/unit/dal/Libraries/Ches/ChesExceptionTest.cs +++ /dev/null @@ -1,144 +0,0 @@ -using FluentAssertions; -using Pims.Core.Exceptions; -using Pims.Core.Http; -using Pims.Core.Test; -using Pims.Ches.Models; -using Moq; -using System.Diagnostics.CodeAnalysis; -using System.Net; -using Xunit; -using Pims.Core.Http.Models; -using Microsoft.Extensions.Options; -using Pims.Ches.Configuration; -using Pims.Ches; -using System.Linq; -using System.Net.Http; - -namespace Pims.Dal.Test.Libraries.Ches -{ - [Trait("category", "unit")] - [Trait("category", "ches")] - [Trait("group", "notification")] - [ExcludeFromCodeCoverage] - public class ChesExceptionTest - { - - #region Tests - #region ChesException Constructors - [Fact] - public void ChesExceptionClientModel_Success() - { - // Arrange - var message = "test2"; - var status = HttpStatusCode.OK; - var helper = new TestHelper(); - - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com", - EmailEnabled = true, - EmailAuthorized = true, - BccUser = true - }); - var service = helper.Create(options, user); - - var token = new TokenModel() - { - AccessToken = "test" - }; - - var exception = new HttpClientRequestException(message, status); - var client = helper.GetService>().Object; - var model = new ErrorResponseModel(); - - // Act - var chesException = new ChesException(exception, client, model); - - // Assert - Assert.NotNull(chesException.Message); - chesException.Message.Should().Be(message + System.Environment.NewLine); - chesException.Client.Should().Be(client); - chesException.StatusCode.Should().Be(status); - chesException.Detail.Should().Be(model.Title + System.Environment.NewLine + model.Detail + System.Environment.NewLine + model.Type + System.Environment.NewLine + System.String.Join(System.Environment.NewLine, model.Errors.Select(e => $"\t{e.Message}"))); - } - - [Fact] - public void ChesException_Success() - { - // Arrange - var message = "test"; - var status = HttpStatusCode.OK; - - // Act - var exception = new ChesException(message, status); - - // Assert - Assert.NotNull(exception); - exception.Message.Should().Be(message); - exception.StatusCode.Should().Be(status); - } - - [Fact] - public void ChesExceptionMessageInnerExceptionStatus_Success() - { - // Arrange - var message = "test for inner exception 2"; - var status = HttpStatusCode.OK; - - var innerException = new HttpClientRequestException(message, status); - new HttpResponseMessage(status) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Post, "https://test") - }; - var chesException = new ChesException(message, innerException, status); - - // Assert - Assert.NotNull(chesException); - chesException.Message.Should().Be(message); - chesException.InnerException.Should().Be(innerException); - chesException.StatusCode.Should().Be(status); - } - - - [Fact] - public void ChesExceptionResponse_Success() - { - // Arrange - var status = HttpStatusCode.OK; - var response = new HttpResponseMessage(status) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Post, "https://test") - }; - var exception = new ChesException(response); - - // Assert - Assert.NotNull(exception); - exception.Response.Should().Be(response); - exception.StatusCode.Should().Be(status); - } - - [Fact] - public void ChesExceptionResponseInnerException_Success() - { - // Arrange - var message = "test for inner exception"; - var status = HttpStatusCode.OK; - - var innerException = new HttpClientRequestException(message, status); - var response = new HttpResponseMessage(status) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Post, "https://test") - }; - var chesException = new ChesException(response, innerException); - - // Assert - Assert.NotNull(chesException); - chesException.Response.Should().Be(response); - chesException.InnerException.Should().Be(innerException); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Libraries/Ches/ChesServiceCollectionTest.cs b/backend/tests/unit/dal/Libraries/Ches/ChesServiceCollectionTest.cs deleted file mode 100644 index 7c97dbcdf1..0000000000 --- a/backend/tests/unit/dal/Libraries/Ches/ChesServiceCollectionTest.cs +++ /dev/null @@ -1,85 +0,0 @@ -using FluentAssertions; -using Pims.Core.Http; -using Pims.Core.Test; -using Moq; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Microsoft.Extensions.Options; -using Pims.Ches.Configuration; -using Pims.Ches; -using System.Net.Http; -using Microsoft.Extensions.Configuration; -using System.Text.Json; -using System.IdentityModel.Tokens.Jwt; -using Microsoft.Extensions.Logging; -using System.IO; -using System.Text; - -namespace Pims.Dal.Test.Libraries.Ches -{ - [Trait("category", "unit")] - [Trait("category", "ches")] - [Trait("group", "notification")] - [ExcludeFromCodeCoverage] - public class ChesServiceCollectionTest - { - public IConfiguration Configuration { get; } - - #region Tests - #region ChesServiceCollection - [Fact] - public void ChesServiceCollection_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - helper.AddSingleton(user); - - var builder = new ConfigurationBuilder(); - var options = new ChesOptions() - { - AuthUrl = "a mocked value", - EmailEnabled = true, - EmailAuthorized = true - }; - var chesJson = JsonSerializer.Serialize(new { Ches = options }); - IConfigurationRoot chesConfig; - using (var io = new MemoryStream(Encoding.UTF8.GetBytes(chesJson))) - { - builder.AddJsonStream(io); - chesConfig = builder.Build(); - } - - var mockClientFactory = new Mock(); - var mockIOptionsMonitor = new Mock>(); - var mockIlogger = new Mock>(); - var mockIChesService = new Mock>(); - - helper.AddSingleton(mockClientFactory.Object); - helper.AddSingleton(mockIOptionsMonitor.Object); - helper.AddSingleton(mockIlogger.Object); - helper.AddSingleton(mockIChesService.Object); - - // Act - _ = helper.Services.AddChesService(section: chesConfig.GetSection("Ches")); - - var chesOptions = helper.GetService>(); - var chesService = helper.GetService(); - var httpRequestClient = helper.GetService(); - var jwtSecurityTokenHandler = helper.GetService(); - - // Assert - Assert.NotNull(chesService); - Assert.NotNull(httpRequestClient); - Assert.NotNull(jwtSecurityTokenHandler); - Assert.NotNull(chesOptions); - - chesOptions.Value.AuthUrl.Should().Be(options.AuthUrl); - chesOptions.Value.EmailEnabled.Should().Be(options.EmailEnabled); - chesOptions.Value.EmailAuthorized.Should().Be(options.EmailAuthorized); - - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Libraries/Ches/ChesServiceTest.cs b/backend/tests/unit/dal/Libraries/Ches/ChesServiceTest.cs deleted file mode 100644 index 9392fb2a4e..0000000000 --- a/backend/tests/unit/dal/Libraries/Ches/ChesServiceTest.cs +++ /dev/null @@ -1,1190 +0,0 @@ -using FluentAssertions; -using Microsoft.Extensions.Options; -using Moq; -using Pims.Ches; -using Pims.Ches.Configuration; -using Pims.Ches.Models; -using Pims.Core.Exceptions; -using Pims.Core.Http; -using Pims.Core.Http.Models; -using Pims.Core.Test; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.IdentityModel.Tokens.Jwt; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Net.Http.Headers; -using System.Text; -using System.Web; -using Xunit; - -namespace Pims.Dal.Test.Libraries.Ches -{ - [Trait("category", "unit")] - [Trait("category", "ches")] - [Trait("group", "notification")] - [ExcludeFromCodeCoverage] - public class ChesServiceTest - { - - #region Tests - #region GetTokenAsync - [Fact] - public async void GetTokenAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com" - }); - var service = helper.Create(options, user); - - var token = new TokenModel(); - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(token); - - var username = "test"; - var password = "password"; - - // Act - var result = await service.GetTokenAsync(username, password); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - client.Verify(m => m.SendAsync(options.Value.AuthUrl, HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Basic" && a.GetValues("ContentType").First() == "application/x-www-form-urlencoded"), - It.IsAny(), null), Times.Once); - } - - [Fact] - public async void GetTokenAsync_ChesExeption() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com" - }); - var service = helper.Create(options, user); - - var response = new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Post, "https://test") - }; - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ThrowsAsync(new HttpClientRequestException(response)); - client.Setup(m => m.DeserializeAsync(It.IsAny())).ReturnsAsync(new ErrorResponseModel()); - - var username = "test"; - var password = "password"; - - // Act - // Assert - var result = await Assert.ThrowsAsync(async () => await service.GetTokenAsync(username, password)); - - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - client.Verify(m => m.SendAsync(options.Value.AuthUrl, HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Basic" && a.GetValues("ContentType").First() == "application/x-www-form-urlencoded"), - It.IsAny(), null), Times.Once); - client.Verify(m => m.DeserializeAsync(It.IsAny()), Times.Once()); - } - #endregion - - #region SendEmailAsync - [Fact] - public async void SendEmailAsync_EmailNotEnabled() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com", - From = "from@test.com" - }); - var service = helper.Create(options, user); - - var email = new EmailModel() - { - To = new[] { "remove@test.com", null }, - Cc = new[] { "remove@test.com", null }, - Bcc = new[] { "remove@test.com", null } - }; - - var client = helper.GetService>(); - - // Act - var result = await service.SendEmailAsync(email); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - client.Verify(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>()), Times.Never); - client.Verify(m => m.SendJsonAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>()), Times.Never()); - email.From.Should().Be(options.Value.From); - email.To.Should().HaveCount(1); - email.To.Should().Contain("test@test.com"); - email.Cc.Should().Contain("test@test.com"); - email.Bcc.Should().BeEmpty(); - } - - [Fact] - public async void SendEmailAsync_EmailAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com", - HostUri = "https://host", - EmailEnabled = true, - EmailAuthorized = true - }); - var service = helper.Create(options, user); - - var token = new TokenModel() - { - AccessToken = "test" - }; - var email = new EmailModel() - { - To = new[] { "keep@test.com", null }, - Cc = new[] { "keep@test.com", null }, - Bcc = new[] { "keep@test.com", null } - }; - var response = new EmailResponseModel(); - - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(token); - client.Setup(m => m.SendJsonAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(response); - - // Act - var result = await service.SendEmailAsync(email); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - client.Verify(m => m.SendAsync(options.Value.AuthUrl, HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Basic" && a.GetValues("ContentType").First() == "application/x-www-form-urlencoded"), - It.IsAny(), null), Times.Once); - client.Verify(m => m.SendJsonAsync($"{options.Value.HostUri}/email", HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Bearer" && a.Authorization.Parameter == token.AccessToken), - email, null), Times.Once()); - email.To.Should().HaveCount(1); - email.To.Should().Contain("keep@test.com"); - email.Cc.Should().HaveCount(1); - email.Cc.Should().Contain("keep@test.com"); - email.Bcc.Should().HaveCount(1); - email.Bcc.Should().Contain("keep@test.com"); - } - - [Fact] - public async void SendEmailAsync_EmailNotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com", - EmailEnabled = true - }); - var service = helper.Create(options, user); - - var token = new TokenModel() - { - AccessToken = "test" - }; - var email = new EmailModel() - { - To = new[] { "remove@test.com", null }, - Cc = new[] { "remove@test.com", null }, - Bcc = new[] { "remove@test.com", null } - }; - var response = new EmailResponseModel(); - - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(token); - client.Setup(m => m.SendJsonAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(response); - - // Act - var result = await service.SendEmailAsync(email); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - client.Verify(m => m.SendAsync(options.Value.AuthUrl, HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Basic" && a.GetValues("ContentType").First() == "application/x-www-form-urlencoded"), - It.IsAny(), null), Times.Once); - client.Verify(m => m.SendJsonAsync("/email", HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Bearer" && a.Authorization.Parameter == token.AccessToken), - email, null), Times.Once()); - email.To.Should().HaveCount(1); - email.To.Should().Contain("test@test.com"); - email.Cc.Should().Contain("test@test.com"); - email.Bcc.Should().BeEmpty(); - } - - [Fact] - public async void SendEmailAsync_OverrideTo() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com", - EmailEnabled = true, - OverrideTo = "test.1@test.com; test.2@test.com" - }); - var service = helper.Create(options, user); - - var token = new TokenModel() - { - AccessToken = "test" - }; - var email = new EmailModel() - { - To = new[] { "remove@test.com", null }, - Cc = new[] { "remove@test.com", null }, - Bcc = new[] { "remove@test.com", null } - }; - var response = new EmailResponseModel(); - - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(token); - client.Setup(m => m.SendJsonAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(response); - - // Act - var result = await service.SendEmailAsync(email); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - client.Verify(m => m.SendAsync(options.Value.AuthUrl, HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Basic" && a.GetValues("ContentType").First() == "application/x-www-form-urlencoded"), - It.IsAny(), null), Times.Once); - client.Verify(m => m.SendJsonAsync("/email", HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Bearer" && a.Authorization.Parameter == token.AccessToken), - email, null), Times.Once()); - email.To.Should().HaveCount(2); - email.To.Should().Contain("test.1@test.com").And.Contain("test.2@test.com"); - email.Cc.Should().Contain("test@test.com"); - email.Bcc.Should().BeEmpty(); - } - - [Fact] - public async void SendEmailAsync_BccUser() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com", - EmailEnabled = true, - EmailAuthorized = true, - BccUser = true - }); - var service = helper.Create(options, user); - - var token = new TokenModel() - { - AccessToken = "test" - }; - var email = new EmailModel() - { - To = new[] { "keep@test.com", null }, - Cc = new[] { "keep@test.com", null }, - Bcc = new[] { "keep@test.com", null } - }; - var response = new EmailResponseModel(); - - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(token); - client.Setup(m => m.SendJsonAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(response); - - // Act - var result = await service.SendEmailAsync(email); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - client.Verify(m => m.SendAsync(options.Value.AuthUrl, HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Basic" && a.GetValues("ContentType").First() == "application/x-www-form-urlencoded"), - It.IsAny(), null), Times.Once); - client.Verify(m => m.SendJsonAsync("/email", HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Bearer" && a.Authorization.Parameter == token.AccessToken), - email, null), Times.Once()); - email.To.Should().HaveCount(1); - email.To.Should().Contain("keep@test.com"); - email.Cc.Should().HaveCount(1); - email.Cc.Should().Contain("keep@test.com"); - email.Bcc.Should().HaveCount(2); - email.Bcc.Should().Contain("test@test.com").And.Contain("keep@test.com"); - } - - [Fact] - public async void SendEmailAsync_BccUser_WithNoEmailBcc() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com", - EmailEnabled = true, - EmailAuthorized = true, - BccUser = true - }); - var service = helper.Create(options, user); - - var token = new TokenModel() - { - AccessToken = "test" - }; - var email = new EmailModel() - { - To = new[] { "keep@test.com", null }, - Cc = new[] { "keep@test.com", null }, - Bcc = null - }; - var response = new EmailResponseModel(); - - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(token); - client.Setup(m => m.SendJsonAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(response); - - // Act - var result = await service.SendEmailAsync(email); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - client.Verify(m => m.SendAsync(options.Value.AuthUrl, HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Basic" && a.GetValues("ContentType").First() == "application/x-www-form-urlencoded"), - It.IsAny(), null), Times.Once); - client.Verify(m => m.SendJsonAsync("/email", HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Bearer" && a.Authorization.Parameter == token.AccessToken), - email, null), Times.Once()); - email.To.Should().HaveCount(1); - email.To.Should().Contain("keep@test.com"); - email.Cc.Should().HaveCount(1); - email.Cc.Should().Contain("keep@test.com"); - email.Bcc.Should().HaveCount(1); - email.Bcc.Should().Contain("test@test.com"); - } - - [Fact] - public async void SendEmailAsync_AlwaysBcc() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com", - EmailEnabled = true, - EmailAuthorized = true, - AlwaysBcc = "test.1@test.com ; test.2@test.com" - }); - var service = helper.Create(options, user); - - var token = new TokenModel() - { - AccessToken = "test" - }; - var email = new EmailModel() - { - To = new[] { "keep@test.com", null }, - Cc = new[] { "keep@test.com", null }, - Bcc = new[] { "keep@test.com", null } - }; - var response = new EmailResponseModel(); - - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(token); - client.Setup(m => m.SendJsonAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(response); - - // Act - var result = await service.SendEmailAsync(email); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - client.Verify(m => m.SendAsync(options.Value.AuthUrl, HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Basic" && a.GetValues("ContentType").First() == "application/x-www-form-urlencoded"), - It.IsAny(), null), Times.Once); - client.Verify(m => m.SendJsonAsync("/email", HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Bearer" && a.Authorization.Parameter == token.AccessToken), - email, null), Times.Once()); - email.To.Should().HaveCount(1); - email.To.Should().Contain("keep@test.com"); - email.Cc.Should().HaveCount(1); - email.Cc.Should().Contain("keep@test.com"); - email.Bcc.Should().HaveCount(3); - email.Bcc.Should().Contain("keep@test.com").And.Contain("test.1@test.com").And.Contain("test.2@test.com"); - } - #endregion - - #region SendEmailAsync MailMerge - [Fact] - public async void SendEmailAsync_MailMerge_EmailNotEnabled() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com", - From = "from@test.com" - }); - var service = helper.Create(options, user); - - var email = new EmailMergeModel() - { - Contexts = new[] - { - new EmailContextModel() - { - To = new[] { "remove@test.com", null }, - Cc = new[] { "remove@test.com", null }, - Bcc = new[] { "remove@test.com", null } - } - } - }; - - var client = helper.GetService>(); - - // Act - var result = await service.SendEmailAsync(email); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - client.Verify(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>()), Times.Never); - client.Verify(m => m.SendJsonAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>()), Times.Never()); - email.From.Should().Be(options.Value.From); - email.Contexts.First().To.Should().HaveCount(1); - email.Contexts.First().To.Should().Contain("test@test.com"); - email.Contexts.First().Cc.Should().BeEmpty(); - email.Contexts.First().Bcc.Should().BeEmpty(); - } - - [Fact] - public async void SendEmailAsync_MailMerge_EmailAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com", - HostUri = "https://host", - EmailEnabled = true, - EmailAuthorized = true - }); - var service = helper.Create(options, user); - - var token = new TokenModel() - { - AccessToken = "test" - }; - var email = new EmailMergeModel() - { - Contexts = new[] - { - new EmailContextModel() - { - To = new[] { "keep@test.com", null }, - Cc = new[] { "keep@test.com", null }, - Bcc = new[] { "keep@test.com", null } - } - } - }; - var response = new EmailResponseModel(); - - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(token); - client.Setup(m => m.SendJsonAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(response); - - // Act - var result = await service.SendEmailAsync(email); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - client.Verify(m => m.SendAsync(options.Value.AuthUrl, HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Basic" && a.GetValues("ContentType").First() == "application/x-www-form-urlencoded"), - It.IsAny(), null), Times.Once); - client.Verify(m => m.SendJsonAsync($"{options.Value.HostUri}/emailMerge", HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Bearer" && a.Authorization.Parameter == token.AccessToken), - email, null), Times.Once()); - email.Contexts.First().To.Should().HaveCount(1); - email.Contexts.First().To.Should().Contain("keep@test.com"); - email.Contexts.First().Cc.Should().HaveCount(1); - email.Contexts.First().Cc.Should().Contain("keep@test.com"); - email.Contexts.First().Bcc.Should().HaveCount(1); - email.Contexts.First().Bcc.Should().Contain("keep@test.com"); - } - - [Fact] - public async void SendEmailAsync_MailMerge_EmailNotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com", - EmailEnabled = true - }); - var service = helper.Create(options, user); - - var token = new TokenModel() - { - AccessToken = "test" - }; - var email = new EmailMergeModel() - { - Contexts = new[] - { - new EmailContextModel() - { - To = new[] { "remove@test.com", null }, - Cc = new[] { "remove@test.com", null }, - Bcc = new[] { "remove@test.com", null } - } - } - }; - var response = new EmailResponseModel(); - - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(token); - client.Setup(m => m.SendJsonAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(response); - - // Act - var result = await service.SendEmailAsync(email); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - client.Verify(m => m.SendAsync(options.Value.AuthUrl, HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Basic" && a.GetValues("ContentType").First() == "application/x-www-form-urlencoded"), - It.IsAny(), null), Times.Once); - client.Verify(m => m.SendJsonAsync("/emailMerge", HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Bearer" && a.Authorization.Parameter == token.AccessToken), - email, null), Times.Once()); - email.Contexts.First().To.Should().HaveCount(1); - email.Contexts.First().To.Should().Contain("test@test.com"); - email.Contexts.First().Cc.Should().BeEmpty(); - email.Contexts.First().Bcc.Should().BeEmpty(); - } - - [Fact] - public async void SendEmailAsync_MailMerge_OverrideTo() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com", - EmailEnabled = true, - OverrideTo = "test.1@test.com; test.2@test.com" - }); - var service = helper.Create(options, user); - - var token = new TokenModel() - { - AccessToken = "test" - }; - var email = new EmailMergeModel() - { - Contexts = new[] - { - new EmailContextModel() - { - To = new[] { "remove@test.com", null }, - Cc = new[] { "remove@test.com", null }, - Bcc = new[] { "remove@test.com", null } - } - } - }; - var response = new EmailResponseModel(); - - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(token); - client.Setup(m => m.SendJsonAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(response); - - // Act - var result = await service.SendEmailAsync(email); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - client.Verify(m => m.SendAsync(options.Value.AuthUrl, HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Basic" && a.GetValues("ContentType").First() == "application/x-www-form-urlencoded"), - It.IsAny(), null), Times.Once); - client.Verify(m => m.SendJsonAsync("/emailMerge", HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Bearer" && a.Authorization.Parameter == token.AccessToken), - email, null), Times.Once()); - email.Contexts.First().To.Should().HaveCount(2); - email.Contexts.First().To.Should().Contain("test.1@test.com").And.Contain("test.2@test.com"); - email.Contexts.First().Cc.Should().BeEmpty(); - email.Contexts.First().Bcc.Should().BeEmpty(); - } - - [Fact] - public async void SendEmailAsync_MailMerge_BccUser() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com", - EmailEnabled = true, - EmailAuthorized = true, - BccUser = true - }); - var service = helper.Create(options, user); - - var token = new TokenModel() - { - AccessToken = "test" - }; - var email = new EmailMergeModel() - { - Contexts = new[] - { - new EmailContextModel() - { - To = new[] { "keep@test.com", null }, - Cc = new[] { "keep@test.com", null }, - Bcc = new[] { "keep@test.com", null } - } - } - }; - var response = new EmailResponseModel(); - - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(token); - client.Setup(m => m.SendJsonAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(response); - - // Act - var result = await service.SendEmailAsync(email); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - client.Verify(m => m.SendAsync(options.Value.AuthUrl, HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Basic" && a.GetValues("ContentType").First() == "application/x-www-form-urlencoded"), - It.IsAny(), null), Times.Once); - client.Verify(m => m.SendJsonAsync("/emailMerge", HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Bearer" && a.Authorization.Parameter == token.AccessToken), - email, null), Times.Once()); - email.Contexts.First().To.Should().HaveCount(1); - email.Contexts.First().To.Should().Contain("keep@test.com"); - email.Contexts.First().Cc.Should().HaveCount(1); - email.Contexts.First().Cc.Should().Contain("keep@test.com"); - email.Contexts.First().Bcc.Should().HaveCount(2); - email.Contexts.First().Bcc.Should().Contain("test@test.com").And.Contain("keep@test.com"); - } - - [Fact] - public async void SendEmailAsync_MailMerge_BccUser_WithNoEmailBcc() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com", - EmailEnabled = true, - EmailAuthorized = true, - BccUser = true - }); - var service = helper.Create(options, user); - - var token = new TokenModel() - { - AccessToken = "test" - }; - var email = new EmailMergeModel() - { - Contexts = new[] - { - new EmailContextModel() - { - To = new[] { "keep@test.com", null }, - Cc = new[] { "keep@test.com", null }, - Bcc = null - } - } - }; - var response = new EmailResponseModel(); - - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(token); - client.Setup(m => m.SendJsonAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(response); - - // Act - var result = await service.SendEmailAsync(email); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - client.Verify(m => m.SendAsync(options.Value.AuthUrl, HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Basic" && a.GetValues("ContentType").First() == "application/x-www-form-urlencoded"), - It.IsAny(), null), Times.Once); - client.Verify(m => m.SendJsonAsync("/emailMerge", HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Bearer" && a.Authorization.Parameter == token.AccessToken), - email, null), Times.Once()); - email.Contexts.First().To.Should().HaveCount(1); - email.Contexts.First().To.Should().Contain("keep@test.com"); - email.Contexts.First().Cc.Should().HaveCount(1); - email.Contexts.First().Cc.Should().Contain("keep@test.com"); - email.Contexts.First().Bcc.Should().HaveCount(1); - email.Contexts.First().Bcc.Should().Contain("test@test.com"); - } - - [Fact] - public async void SendEmailAsync_MailMerge_AlwaysBcc() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com", - EmailEnabled = true, - EmailAuthorized = true, - AlwaysBcc = "test.1@test.com ; test.2@test.com" - }); - var service = helper.Create(options, user); - - var token = new TokenModel() - { - AccessToken = "test" - }; - var email = new EmailMergeModel() - { - Contexts = new[] - { - new EmailContextModel() - { - To = new[] { "keep@test.com", null }, - Cc = new[] { "keep@test.com", null }, - Bcc = new[] { "keep@test.com", null } - } - } - }; - var response = new EmailResponseModel(); - - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(token); - client.Setup(m => m.SendJsonAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(response); - - // Act - var result = await service.SendEmailAsync(email); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - client.Verify(m => m.SendAsync(options.Value.AuthUrl, HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Basic" && a.GetValues("ContentType").First() == "application/x-www-form-urlencoded"), - It.IsAny(), null), Times.Once); - client.Verify(m => m.SendJsonAsync("/emailMerge", HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Bearer" && a.Authorization.Parameter == token.AccessToken), - email, null), Times.Once()); - email.Contexts.First().To.Should().HaveCount(1); - email.Contexts.First().To.Should().Contain("keep@test.com"); - email.Contexts.First().Cc.Should().HaveCount(1); - email.Contexts.First().Cc.Should().Contain("keep@test.com"); - email.Contexts.First().Bcc.Should().HaveCount(3); - email.Contexts.First().Bcc.Should().Contain("keep@test.com").And.Contain("test.1@test.com").And.Contain("test.2@test.com"); - } - #endregion - - #region GetStatusAsync - [Fact] - public async void GetStatusAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com", - HostUri = "https://host" - }); - var service = helper.Create(options, user); - - var token = new TokenModel() - { - AccessToken = "test" - }; - var response = new StatusResponseModel(); - - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(token); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(response); - - var messageId = Guid.NewGuid(); - - // Act - var result = await service.GetStatusAsync(messageId); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - client.Verify(m => m.SendAsync(options.Value.AuthUrl, HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Basic" && a.GetValues("ContentType").First() == "application/x-www-form-urlencoded"), - It.IsAny(), null), Times.Once); - client.Verify(m => m.SendAsync($"{options.Value.HostUri}/status/{messageId}", HttpMethod.Get, - It.Is(a => a.Authorization.Scheme == "Bearer" && a.Authorization.Parameter == token.AccessToken), null, null), Times.Once()); - } - - [Fact] - public async void GetStatusAsync_WithFilter_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com", - HostUri = "https://host" - }); - var service = helper.Create(options, user); - - var token = new TokenModel() - { - AccessToken = "test" - }; - var response = new[] { new StatusResponseModel() }; - - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(token); - client.Setup(m => m.SendAsync>(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(response); - - var filter = new StatusModel() - { - MessageId = Guid.NewGuid(), - Status = "Pending space", - Tag = "tag space&", - TransactionId = Guid.NewGuid() - }; - - // Act - var result = await service.GetStatusAsync(filter); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - client.Verify(m => m.SendAsync(options.Value.AuthUrl, HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Basic" && a.GetValues("ContentType").First() == "application/x-www-form-urlencoded"), - It.IsAny(), null), Times.Once); - var expectedResult = $"{options.Value.HostUri}/status?msgId={HttpUtility.UrlEncode($"{filter.MessageId}")}&status={HttpUtility.UrlEncode(filter.Status)}&tag={HttpUtility.UrlEncode(filter.Tag)}&txId={HttpUtility.UrlEncode($"{filter.TransactionId}")}"; - client.Verify(m => m.SendAsync>(expectedResult, HttpMethod.Get, - It.Is(a => a.Authorization.Scheme == "Bearer" && a.Authorization.Parameter == token.AccessToken), null, null), Times.Once()); - } - - [Fact] - public async void GetStatusAsync_NoFilter_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com", - HostUri = "https://host" - }); - var service = helper.Create(options, user); - - var token = new TokenModel() - { - AccessToken = "test" - }; - var response = new[] { new StatusResponseModel() }; - - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(token); - client.Setup(m => m.SendAsync>(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(response); - - var filter = new StatusModel() - { - Status = "Pending space", - }; - - // Act - var result = await service.GetStatusAsync(filter); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - client.Verify(m => m.SendAsync(options.Value.AuthUrl, HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Basic" && a.GetValues("ContentType").First() == "application/x-www-form-urlencoded"), - It.IsAny(), null), Times.Once); - var expectedResult = $"{options.Value.HostUri}/status?status={HttpUtility.UrlEncode(filter.Status)}"; - client.Verify(m => m.SendAsync>(expectedResult, HttpMethod.Get, - It.Is(a => a.Authorization.Scheme == "Bearer" && a.Authorization.Parameter == token.AccessToken), null, null), Times.Once()); - } - - [Fact] - public async void GetStatusAsync_NoFilter_ArgumentException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com", - HostUri = "https://host" - }); - var service = helper.Create(options, user); - - var token = new TokenModel() - { - AccessToken = "test" - }; - var response = new[] { new StatusResponseModel() }; - - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(token); - client.Setup(m => m.SendAsync>(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(response); - - var filter = new StatusModel(); - - // Act - // Assert - var result = await Assert.ThrowsAsync(async () => await service.GetStatusAsync(filter)); - - client.Verify(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), null), Times.Never); - client.Verify(m => m.SendAsync>(It.IsAny(), It.IsAny(), It.IsAny(), null, null), Times.Never()); - } - #endregion - - #region CancelEmailAsync - [Fact] - public async void CancelEmailAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com", - HostUri = "https://host" - }); - var tokenHandler = new JwtSecurityTokenHandler(); - var service = helper.Create(options, user, tokenHandler); - - var token = new TokenModel() - { - AccessToken = helper.GenerateAccessToken() - }; - var response = new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent("{}", Encoding.UTF8, "application/json") - }; - var status = new StatusResponseModel() - { - Status = "pending" - }; - - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(token); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(response); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(status); - - var messageId = Guid.NewGuid(); - - // Act - var result = await service.CancelEmailAsync(messageId); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - client.Verify(m => m.SendAsync(options.Value.AuthUrl, HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Basic" && a.GetValues("ContentType").First() == "application/x-www-form-urlencoded"), - It.IsAny(), null), Times.Once); - client.Verify(m => m.SendAsync($"{options.Value.HostUri}/cancel/{messageId}", HttpMethod.Delete, - It.Is(a => a.Authorization.Scheme == "Bearer" && a.Authorization.Parameter == token.AccessToken), null), Times.Once()); - client.Verify(m => m.SendAsync($"{options.Value.HostUri}/status/{messageId}", HttpMethod.Get, - It.Is(a => a.Authorization.Scheme == "Bearer" && a.Authorization.Parameter == token.AccessToken), null, null), Times.Once()); - } - - [Fact] - public async void CancelEmailAsync_WithFilter_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com", - HostUri = "https://host" - }); - var tokenHandler = new JwtSecurityTokenHandler(); - var service = helper.Create(options, user, tokenHandler); - - var token = new TokenModel() - { - AccessToken = helper.GenerateAccessToken() - }; - var response = new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent("{}", Encoding.UTF8, "application/json") - }; - var status = new[] { new StatusResponseModel() }; - - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(token); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(response); - client.Setup(m => m.SendAsync>(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(status); - - var filter = new StatusModel() - { - MessageId = Guid.NewGuid(), - Status = "Pending space", - Tag = "tag space&", - TransactionId = Guid.NewGuid() - }; - - // Act - var result = await service.CancelEmailAsync(filter); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - client.Verify(m => m.SendAsync(options.Value.AuthUrl, HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Basic" && a.GetValues("ContentType").First() == "application/x-www-form-urlencoded"), - It.IsAny(), null), Times.Once); - var expectedQuery = $"msgId={HttpUtility.UrlEncode($"{filter.MessageId}")}&status={HttpUtility.UrlEncode(filter.Status)}&tag={HttpUtility.UrlEncode(filter.Tag)}&txId={HttpUtility.UrlEncode($"{filter.TransactionId}")}"; - client.Verify(m => m.SendAsync($"{options.Value.HostUri}/cancel?{expectedQuery}", HttpMethod.Delete, - It.Is(a => a.Authorization.Scheme == "Bearer" && a.Authorization.Parameter == token.AccessToken), null), Times.Once()); - client.Verify(m => m.SendAsync>($"{options.Value.HostUri}/status?{expectedQuery}", HttpMethod.Get, - It.Is(a => a.Authorization.Scheme == "Bearer" && a.Authorization.Parameter == token.AccessToken), null, null), Times.Once()); - } - - [Fact] - public async void CancelEmailAsync_NoFilter_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com", - HostUri = "https://host" - }); - var tokenHandler = new JwtSecurityTokenHandler(); - var service = helper.Create(options, user, tokenHandler); - - var token = new TokenModel() - { - AccessToken = helper.GenerateAccessToken() - }; - var response = new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent("{}", Encoding.UTF8, "application/json") - }; - var status = new[] { new StatusResponseModel() }; - - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(token); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(response); - client.Setup(m => m.SendAsync>(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(status); - - var filter = new StatusModel() - { - Status = "Pending space", - }; - - // Act - var result = await service.CancelEmailAsync(filter); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - client.Verify(m => m.SendAsync(options.Value.AuthUrl, HttpMethod.Post, - It.Is(a => a.Authorization.Scheme == "Basic" && a.GetValues("ContentType").First() == "application/x-www-form-urlencoded"), - It.IsAny(), null), Times.Once); - var expectedQuery = $"status={HttpUtility.UrlEncode(filter.Status)}"; - client.Verify(m => m.SendAsync($"{options.Value.HostUri}/cancel?{expectedQuery}", HttpMethod.Delete, - It.Is(a => a.Authorization.Scheme == "Bearer" && a.Authorization.Parameter == token.AccessToken), null), Times.Once()); - client.Verify(m => m.SendAsync>($"{options.Value.HostUri}/status?{expectedQuery}", HttpMethod.Get, - It.Is(a => a.Authorization.Scheme == "Bearer" && a.Authorization.Parameter == token.AccessToken), null, null), Times.Once()); - } - - [Fact] - public async void CancelEmailAsync_NoFilter_ArgumentException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new ChesOptions() - { - AuthUrl = "https:/test.com", - HostUri = "https://host" - }); - var service = helper.Create(options, user); - - var token = new TokenModel() - { - AccessToken = "test" - }; - var response = new[] { new StatusResponseModel() }; - - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(token); - client.Setup(m => m.SendAsync>(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(response); - - var filter = new StatusModel(); - - // Act - // Assert - var result = await Assert.ThrowsAsync(async () => await service.CancelEmailAsync(filter)); - - client.Verify(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), null), Times.Never); - client.Verify(m => m.SendAsync>(It.IsAny(), It.IsAny(), It.IsAny(), null, null), Times.Never()); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Libraries/Geocoder/GeocoderServiceTest.cs b/backend/tests/unit/dal/Libraries/Geocoder/GeocoderServiceTest.cs deleted file mode 100644 index 2765fceda5..0000000000 --- a/backend/tests/unit/dal/Libraries/Geocoder/GeocoderServiceTest.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using Xunit; - -namespace Pims.Dal.Test.Libraries.Ches -{ - [Trait("category", "unit")] - [Trait("category", "geocoder")] - [Trait("group", "geocoder")] - [ExcludeFromCodeCoverage] - public class GeocoderServiceTest - { - #region Tests - #endregion - } -} diff --git a/backend/tests/unit/dal/Libraries/Keycloak/KeycloakServiceGroupsTest.cs b/backend/tests/unit/dal/Libraries/Keycloak/KeycloakServiceGroupsTest.cs deleted file mode 100644 index 4e990a591f..0000000000 --- a/backend/tests/unit/dal/Libraries/Keycloak/KeycloakServiceGroupsTest.cs +++ /dev/null @@ -1,593 +0,0 @@ -using FluentAssertions; -using Moq; -using Pims.Core.Exceptions; -using Pims.Core.Http; -using Pims.Core.Test; -using Pims.Keycloak; -using Pims.Keycloak.Models; -using System; -using System.Linq; -using System.Net; -using System.Net.Http; -using Xunit; - -namespace Pims.Dal.Test.Libraries.Keycloak -{ - [Trait("category", "unit")] - [Trait("category", "keycloak")] - [Trait("group", "keycloak")] - public partial class KeycloakServiceGroupsTest - { - #region Tests - #region GetGroupCountAsync - [Fact] - public async void GetGroupCountAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent("{\"Count\":1}") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - - // Act - var result = await service.GetGroupCountAsync(); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/groups/count"), Times.Once()); - result.Should().Be(1); - } - - [Fact] - public async void GetGroupCountAsync_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - - // Act - await Assert.ThrowsAsync(async () => await service.GetGroupCountAsync()); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/groups/count"), Times.Once()); - } - #endregion - - #region GetGroupsAsync - [Fact] - public async void GetGroupsAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var groups = new[] { - new GroupModel() - { - Id = Guid.NewGuid(), - Name = "name", - Path = "path", - Attributes = new System.Collections.Generic.Dictionary() - { - { "attr1", new [] { "attribute" } } - }, - ClientRoles = new System.Collections.Generic.Dictionary() - { - { "attr1", new [] { "clientRole" } } - }, - RealmRoles = new[] { "role" } - } - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(groups)) - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var first = 1; - var max = 10; - var search = "search"; - - // Act - var result = await service.GetGroupsAsync(first, max, search); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/groups?first={first}&max={max}&search={search}"), Times.Once()); - result.Should().HaveCount(1); - result.First().Id.Should().Be(groups.First().Id); - result.First().Name.Should().Be(groups.First().Name); - result.First().Path.Should().Be(groups.First().Path); - } - - [Fact] - public async void GetGroupsAsync_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var first = 1; - var max = 10; - var search = "search"; - - // Act - await Assert.ThrowsAsync(async () => await service.GetGroupsAsync(first, max, search)); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/groups?first={first}&max={max}&search={search}"), Times.Once()); - } - #endregion - - #region GetGroupAsync - [Fact] - public async void GetGroupAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var group = new GroupModel() - { - Id = Guid.NewGuid(), - Name = "name", - Path = "path", - Attributes = new System.Collections.Generic.Dictionary() - { - { "attr1", new [] { "attribute" } } - }, - ClientRoles = new System.Collections.Generic.Dictionary() - { - { "attr1", new [] { "clientRole" } } - }, - RealmRoles = new[] { "role" } - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(group)) - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - - // Act - var result = await service.GetGroupAsync(group.Id); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/groups/{group.Id}"), Times.Once()); - result.Id.Should().Be(group.Id); - result.Name.Should().Be(group.Name); - result.Path.Should().Be(group.Path); - } - - [Fact] - public async void GetGroupAsync_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var id = Guid.NewGuid(); - - // Act - await Assert.ThrowsAsync(async () => await service.GetGroupAsync(id)); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/groups/{id}"), Times.Once()); - } - #endregion - - #region CreateGroupAsync - [Fact] - public async void CreateGroupAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var group = new GroupModel() - { - Id = Guid.NewGuid(), - Name = "name", - Path = "path", - Attributes = new System.Collections.Generic.Dictionary() - { - { "attr1", new [] { "attribute" } } - }, - ClientRoles = new System.Collections.Generic.Dictionary() - { - { "attr1", new [] { "clientRole" } } - }, - RealmRoles = new[] { "role" } - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.PostAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(group)) - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - - // Act - var result = await service.CreateGroupAsync(group); - - // Assert - openIdConnect.Verify(m => m.PostAsync($"{options.Value.Admin.Authority}/groups", It.IsAny()), Times.Once()); - result.Id.Should().Be(group.Id); - result.Name.Should().Be(group.Name); - result.Path.Should().Be(group.Path); - } - - [Fact] - public async void CreateGroupAsync_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.PostAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - - // Act - await Assert.ThrowsAsync(async () => await service.CreateGroupAsync(new GroupModel())); - - // Assert - openIdConnect.Verify(m => m.PostAsync($"{options.Value.Admin.Authority}/groups", It.IsAny()), Times.Once()); - } - #endregion - - #region CreateSubGroupAsync - [Fact] - public async void CreateSubGroupAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var group = new GroupModel() - { - Id = Guid.NewGuid(), - Name = "name", - Path = "path", - Attributes = new System.Collections.Generic.Dictionary() - { - { "attr1", new [] { "attribute" } } - }, - ClientRoles = new System.Collections.Generic.Dictionary() - { - { "attr1", new [] { "clientRole" } } - }, - RealmRoles = new[] { "role" } - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.PostAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(group)) - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var parentId = Guid.NewGuid(); - - // Act - var result = await service.CreateSubGroupAsync(parentId, group); - - // Assert - openIdConnect.Verify(m => m.PostAsync($"{options.Value.Admin.Authority}/groups/{parentId}/children", It.IsAny()), Times.Once()); - result.Id.Should().Be(group.Id); - result.Name.Should().Be(group.Name); - result.Path.Should().Be(group.Path); - } - - [Fact] - public async void CreateSubGroupAsync_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.PostAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var parentId = Guid.NewGuid(); - - // Act - await Assert.ThrowsAsync(async () => await service.CreateSubGroupAsync(parentId, new GroupModel())); - - // Assert - openIdConnect.Verify(m => m.PostAsync($"{options.Value.Admin.Authority}/groups/{parentId}/children", It.IsAny()), Times.Once()); - } - #endregion - - #region UpdateGroupAsync - [Fact] - public async void UpdateGroupAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var group = new GroupModel() - { - Id = Guid.NewGuid(), - Name = "name", - Path = "path", - Attributes = new System.Collections.Generic.Dictionary() - { - { "attr1", new [] { "attribute" } } - }, - ClientRoles = new System.Collections.Generic.Dictionary() - { - { "attr1", new [] { "clientRole" } } - }, - RealmRoles = new[] { "role" } - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.PutAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(group)) - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - - // Act - var result = await service.UpdateGroupAsync(group); - - // Assert - openIdConnect.Verify(m => m.PutAsync($"{options.Value.Admin.Authority}/groups/{group.Id}", It.IsAny()), Times.Once()); - result.Id.Should().Be(group.Id); - result.Name.Should().Be(group.Name); - result.Path.Should().Be(group.Path); - } - - [Fact] - public async void UpdateGroupAsync_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.PutAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var group = new GroupModel() - { - Id = Guid.NewGuid() - }; - - // Act - await Assert.ThrowsAsync(async () => await service.UpdateGroupAsync(group)); - - // Assert - openIdConnect.Verify(m => m.PutAsync($"{options.Value.Admin.Authority}/groups/{group.Id}", It.IsAny()), Times.Once()); - } - #endregion - - #region DeleteGroupAsync - [Fact] - public async void DeleteGroupAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.DeleteAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK)); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var id = Guid.NewGuid(); - - // Act - var result = await service.DeleteGroupAsync(id); - - // Assert - openIdConnect.Verify(m => m.DeleteAsync($"{options.Value.Admin.Authority}/groups/{id}", null), Times.Once()); - result.Should().Be(id); - } - - [Fact] - public async void DeleteGroupAsync_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.DeleteAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var id = Guid.NewGuid(); - - // Act - await Assert.ThrowsAsync(async () => await service.DeleteGroupAsync(id)); - - // Assert - openIdConnect.Verify(m => m.DeleteAsync($"{options.Value.Admin.Authority}/groups/{id}", null), Times.Once()); - } - #endregion - - #region GetGroupMembersAsync - [Fact] - public async void GetGroupMembersAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var users = new[] { - new UserModel() - { - Id = Guid.NewGuid(), - Email = "email", - EmailVerified = false, - Enabled = true, - FirstName = "first", - LastName = "last", - Username = "user", - Attributes = new System.Collections.Generic.Dictionary() - { - { "attr1", new [] { "attribute" } } - }, - RealmRoles = new[] { "role" }, - Groups = new[] { "group" }, - } - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(users)) - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var id = Guid.NewGuid(); - var first = 1; - var max = 10; - - // Act - var result = await service.GetGroupMembersAsync(id, first, max); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/groups/{id}/members?first={first}&max={max}"), Times.Once()); - result.Should().HaveCount(1); - result.First().Id.Should().Be(users.First().Id); - result.First().Email.Should().Be(users.First().Email); - result.First().EmailVerified.Should().Be(users.First().EmailVerified); - result.First().Enabled.Should().Be(users.First().Enabled); - result.First().FirstName.Should().Be(users.First().FirstName); - result.First().LastName.Should().Be(users.First().LastName); - result.First().Username.Should().Be(users.First().Username); - } - - [Fact] - public async void GetGroupMembersAsync_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var id = Guid.NewGuid(); - var first = 1; - var max = 10; - - // Act - await Assert.ThrowsAsync(async () => await service.GetGroupMembersAsync(id, first, max)); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/groups/{id}/members?first={first}&max={max}"), Times.Once()); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Libraries/Keycloak/KeycloakServiceRolesTest.cs b/backend/tests/unit/dal/Libraries/Keycloak/KeycloakServiceRolesTest.cs deleted file mode 100644 index b2c72d1467..0000000000 --- a/backend/tests/unit/dal/Libraries/Keycloak/KeycloakServiceRolesTest.cs +++ /dev/null @@ -1,1158 +0,0 @@ -using FluentAssertions; -using Moq; -using Pims.Core.Exceptions; -using Pims.Core.Http; -using Pims.Core.Test; -using Pims.Keycloak; -using Pims.Keycloak.Models; -using System; -using System.Net; -using System.Net.Http; -using Xunit; - -namespace Pims.Dal.Test.Libraries.Keycloak -{ - [Trait("category", "unit")] - [Trait("category", "keycloak")] - [Trait("group", "keycloak")] - [Trait("group", "role")] - public partial class KeycloakServiceRolesTest - { - #region Tests - #region ById - #region GetRoleAsync - [Fact] - public async void GetRoleAsync_ById_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var role = new RoleModel() - { - Id = Guid.NewGuid() - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(role)) - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var id = Guid.NewGuid(); - - // Act - var result = await service.GetRoleAsync(id); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/roles-by-id/{id}"), Times.Once()); - result.Id.Should().Be(role.Id); - } - - [Fact] - public async void GetRoleAsync_ById_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var id = Guid.NewGuid(); - - // Act - await Assert.ThrowsAsync(async () => await service.GetRoleAsync(id)); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/roles-by-id/{id}"), Times.Once()); - } - #endregion - - #region UpdateRoleAsync - [Fact] - public async void UpdateRoleAsync_ById_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var role = new RoleModel() - { - Id = Guid.NewGuid() - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.PutAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(role)) - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - - // Act - var result = await service.UpdateRoleAsync(role); - - // Assert - openIdConnect.Verify(m => m.PutAsync($"{options.Value.Admin.Authority}/roles-by-id/{role.Id}", It.IsAny()), Times.Once()); - result.Id.Should().Be(role.Id); - } - - [Fact] - public async void UpdateRoleAsync_ById_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var role = new RoleModel() - { - Id = Guid.NewGuid() - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.PutAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - - // Act - await Assert.ThrowsAsync(async () => await service.UpdateRoleAsync(role)); - - // Assert - openIdConnect.Verify(m => m.PutAsync($"{options.Value.Admin.Authority}/roles-by-id/{role.Id}", It.IsAny()), Times.Once()); - } - #endregion - - #region DeleteRoleAsync - [Fact] - public async void DeleteRoleAsync_ById_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.DeleteAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK)); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var id = Guid.NewGuid(); - - // Act - var result = await service.DeleteRoleAsync(id); - - // Assert - openIdConnect.Verify(m => m.DeleteAsync($"{options.Value.Admin.Authority}/roles-by-id/{id}", null), Times.Once()); - } - - [Fact] - public async void DeleteRoleAsync_ById_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.DeleteAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var id = Guid.NewGuid(); - - // Act - await Assert.ThrowsAsync(async () => await service.DeleteRoleAsync(id)); - - // Assert - openIdConnect.Verify(m => m.DeleteAsync($"{options.Value.Admin.Authority}/roles-by-id/{id}", null), Times.Once()); - } - #endregion - - #region CreateCompositeRolesAsync - [Fact] - public async void CreateCompositeRolesAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var roles = new[] - { - new RoleModel() - { - Id = Guid.NewGuid() - } - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.PostAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(roles)) - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var parentId = Guid.NewGuid(); - - // Act - var result = await service.CreateCompositeRolesAsync(parentId, roles); - - // Assert - openIdConnect.Verify(m => m.PostAsync($"{options.Value.Admin.Authority}/roles-by-id/{parentId}/composites", It.IsAny()), Times.Once()); - } - - [Fact] - public async void CreateCompositeRolesAsync_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var roles = new[] - { - new RoleModel() - { - Id = Guid.NewGuid() - } - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.PostAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var parentId = Guid.NewGuid(); - - // Act - await Assert.ThrowsAsync(async () => await service.CreateCompositeRolesAsync(parentId, roles)); - - // Assert - openIdConnect.Verify(m => m.PostAsync($"{options.Value.Admin.Authority}/roles-by-id/{parentId}/composites", It.IsAny()), Times.Once()); - } - #endregion - - #region GetCompositeRolesAsync - [Fact] - public async void GetCompositeRolesAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var roles = new[] - { - new RoleModel() - { - Id = Guid.NewGuid() - } - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(roles)) - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var parentId = Guid.NewGuid(); - - // Act - var result = await service.GetCompositeRolesAsync(parentId); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/roles-by-id/{parentId}/composites"), Times.Once()); - } - - [Fact] - public async void GetCompositeRolesAsync_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var parentId = Guid.NewGuid(); - - // Act - await Assert.ThrowsAsync(async () => await service.GetCompositeRolesAsync(parentId)); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/roles-by-id/{parentId}/composites"), Times.Once()); - } - #endregion - - #region DeleteCompositeRolesAsync - [Fact] - public async void DeleteCompositeRolesAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var roles = new[] - { - new RoleModel() - { - Id = Guid.NewGuid() - } - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.DeleteAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(roles)) - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var parentId = Guid.NewGuid(); - - // Act - var result = await service.DeleteCompositeRolesAsync(parentId, roles); - - // Assert - openIdConnect.Verify(m => m.DeleteAsync($"{options.Value.Admin.Authority}/roles-by-id/{parentId}/composites", It.IsAny()), Times.Once()); - } - - [Fact] - public async void DeleteCompositeRolesAsync_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var roles = new[] - { - new RoleModel() - { - Id = Guid.NewGuid() - } - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.DeleteAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var parentId = Guid.NewGuid(); - - // Act - await Assert.ThrowsAsync(async () => await service.DeleteCompositeRolesAsync(parentId, roles)); - - // Assert - openIdConnect.Verify(m => m.DeleteAsync($"{options.Value.Admin.Authority}/roles-by-id/{parentId}/composites", It.IsAny()), Times.Once()); - } - #endregion - - #region GetClientCompositeRolesAsync - [Fact] - public async void GetClientCompositeRolesAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var roles = new[] - { - new RoleModel() - { - Id = Guid.NewGuid() - } - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(roles)) - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var parentId = Guid.NewGuid(); - var clientName = "client"; - - // Act - var result = await service.GetClientCompositeRolesAsync(parentId, clientName); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/roles-by-id/{parentId}/composites/clients/{clientName}"), Times.Once()); - } - - [Fact] - public async void GetClientCompositeRolesAsync_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var parentId = Guid.NewGuid(); - var clientName = "client"; - - // Act - await Assert.ThrowsAsync(async () => await service.GetClientCompositeRolesAsync(parentId, clientName)); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/roles-by-id/{parentId}/composites/clients/{clientName}"), Times.Once()); - } - #endregion - - #region GetRealmCompositeRolesAsync - [Fact] - public async void GetRealmCompositeRolesAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var roles = new[] - { - new RoleModel() - { - Id = Guid.NewGuid() - } - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(roles)) - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var parentId = Guid.NewGuid(); - - // Act - var result = await service.GetRealmCompositeRolesAsync(parentId); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/roles-by-id/{parentId}/composites/realm"), Times.Once()); - } - - [Fact] - public async void GetRealmCompositeRolesAsync_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var parentId = Guid.NewGuid(); - - // Act - await Assert.ThrowsAsync(async () => await service.GetRealmCompositeRolesAsync(parentId)); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/roles-by-id/{parentId}/composites/realm"), Times.Once()); - } - #endregion - #endregion - - #region Realm - #region GetRolesAsync - [Fact] - public async void GetRolesAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var roles = new[] - { - new RoleModel() - { - Id = Guid.NewGuid() - } - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(roles)) - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - - // Act - var result = await service.GetRolesAsync(); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/roles"), Times.Once()); - } - - [Fact] - public async void GetRolesAsync_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - - // Act - await Assert.ThrowsAsync(async () => await service.GetRolesAsync()); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/roles"), Times.Once()); - } - #endregion - - #region GetRoleAsync - [Fact] - public async void GetRoleAsync_ByName_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var role = new RoleModel() - { - Id = Guid.NewGuid(), - Name = "name", - Description = "description", - Composite = false, - ContainerId = "container" - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(role)) - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - - // Act - var result = await service.GetRoleAsync(role.Name); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/roles/{role.Name}"), Times.Once()); - } - - [Fact] - public async void GetRoleAsync_ByName_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var name = "name"; - - // Act - await Assert.ThrowsAsync(async () => await service.GetRoleAsync(name)); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/roles/{name}"), Times.Once()); - } - #endregion - - #region CreateRoleAsync - [Fact] - public async void CreateRoleAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var role = new RoleModel() - { - Id = Guid.NewGuid() - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.PostAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(role)) - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var parentId = Guid.NewGuid(); - - // Act - var result = await service.CreateRoleAsync(role); - - // Assert - openIdConnect.Verify(m => m.PostAsync($"{options.Value.Admin.Authority}/roles", It.IsAny()), Times.Once()); - } - - [Fact] - public async void CreateRoleAsync_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var role = new RoleModel() - { - Id = Guid.NewGuid() - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.PostAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var parentId = Guid.NewGuid(); - - // Act - await Assert.ThrowsAsync(async () => await service.CreateRoleAsync(role)); - - // Assert - openIdConnect.Verify(m => m.PostAsync($"{options.Value.Admin.Authority}/roles", It.IsAny()), Times.Once()); - } - #endregion - - #region UpdateRoleAsync - [Fact] - public async void UpdateRoleAsync_ByName_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var role = new RoleModel() - { - Id = Guid.NewGuid(), - Name = "name" - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.PutAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(role)) - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - - // Act - var result = await service.UpdateRoleAsync(role.Name, role); - - // Assert - openIdConnect.Verify(m => m.PutAsync($"{options.Value.Admin.Authority}/roles/{role.Name}", It.IsAny()), Times.Once()); - result.Id.Should().Be(role.Id); - } - - [Fact] - public async void UpdateRoleAsync_ByName_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var role = new RoleModel() - { - Id = Guid.NewGuid(), - Name = "name" - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.PutAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - - // Act - await Assert.ThrowsAsync(async () => await service.UpdateRoleAsync(role.Name, role)); - - // Assert - openIdConnect.Verify(m => m.PutAsync($"{options.Value.Admin.Authority}/roles/{role.Name}", It.IsAny()), Times.Once()); - } - #endregion - - #region DeleteRoleAsync - [Fact] - public async void DeleteRoleAsync_ByName_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.DeleteAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK)); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var name = "name"; - - // Act - var result = await service.DeleteRoleAsync(name); - - // Assert - openIdConnect.Verify(m => m.DeleteAsync($"{options.Value.Admin.Authority}/roles/{name}", null), Times.Once()); - } - - [Fact] - public async void DeleteRoleAsync_ByName_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.DeleteAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var name = "name"; - - // Act - await Assert.ThrowsAsync(async () => await service.DeleteRoleAsync(name)); - - // Assert - openIdConnect.Verify(m => m.DeleteAsync($"{options.Value.Admin.Authority}/roles/{name}", null), Times.Once()); - } - #endregion - - #region CreateCompositeRoleAsync - [Fact] - public async void CreateCompositeRoleAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var role = new RoleModel() - { - Id = Guid.NewGuid() - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.PostAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(role)) - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var parentName = "name"; - - // Act - var result = await service.CreateCompositeRoleAsync(parentName, role); - - // Assert - openIdConnect.Verify(m => m.PostAsync($"{options.Value.Admin.Authority}/roles/{parentName}/composites", It.IsAny()), Times.Once()); - } - - [Fact] - public async void CreateCompositeRoleAsync_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var role = new RoleModel() - { - Id = Guid.NewGuid() - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.PostAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var parentName = "name"; - - // Act - await Assert.ThrowsAsync(async () => await service.CreateCompositeRoleAsync(parentName, role)); - - // Assert - openIdConnect.Verify(m => m.PostAsync($"{options.Value.Admin.Authority}/roles/{parentName}/composites", It.IsAny()), Times.Once()); - } - #endregion - - #region DeleteCompositeRolesAsync - [Fact] - public async void DeleteCompositeRolesAsync_ByName_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var roles = new[] - { - new RoleModel() - { - Id = Guid.NewGuid() - } - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.DeleteAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(roles)) - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var parentName = "name"; - - // Act - var result = await service.DeleteCompositeRolesAsync(parentName, roles); - - // Assert - openIdConnect.Verify(m => m.DeleteAsync($"{options.Value.Admin.Authority}/roles/{parentName}/composites", It.IsAny()), Times.Once()); - } - - [Fact] - public async void DeleteCompositeRolesAsync_ByName_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var roles = new[] - { - new RoleModel() - { - Id = Guid.NewGuid() - } - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.DeleteAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var parentName = "name"; - - // Act - await Assert.ThrowsAsync(async () => await service.DeleteCompositeRolesAsync(parentName, roles)); - - // Assert - openIdConnect.Verify(m => m.DeleteAsync($"{options.Value.Admin.Authority}/roles/{parentName}/composites", It.IsAny()), Times.Once()); - } - #endregion - - #region GetClientCompositeRolesAsync - [Fact] - public async void GetClientCompositeRolesAsync_ByName_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var roles = new[] - { - new RoleModel() - { - Id = Guid.NewGuid() - } - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(roles)) - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var parentName = "name"; - var clientName = "client"; - - // Act - var result = await service.GetClientCompositeRolesAsync(parentName, clientName); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/roles/{parentName}/composites/clients/{clientName}"), Times.Once()); - } - - [Fact] - public async void GetClientCompositeRolesAsync_ByName_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var parentName = "name"; - var clientName = "client"; - - // Act - await Assert.ThrowsAsync(async () => await service.GetClientCompositeRolesAsync(parentName, clientName)); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/roles/{parentName}/composites/clients/{clientName}"), Times.Once()); - } - #endregion - - #region GetRealmCompositeRolesAsync - [Fact] - public async void GetRealmCompositeRolesAsync_ByName_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var roles = new[] - { - new RoleModel() - { - Id = Guid.NewGuid() - } - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(roles)) - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var parentName = "name"; - - // Act - var result = await service.GetRealmCompositeRolesAsync(parentName); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/roles/{parentName}/composites/realm"), Times.Once()); - } - - [Fact] - public async void GetRealmCompositeRolesAsync_ByName_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var parentName = "name"; - - // Act - await Assert.ThrowsAsync(async () => await service.GetRealmCompositeRolesAsync(parentName)); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/roles/{parentName}/composites/realm"), Times.Once()); - } - #endregion - - #region GetRoleMembersAsync - [Fact] - public async void GetRoleMembersAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var roles = new[] - { - new RoleModel() - { - Id = Guid.NewGuid() - } - }; - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(roles)) - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var name = "name"; - var first = 1; - var max = 10; - - // Act - var result = await service.GetRoleMembersAsync(name, first, max); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/roles/{name}/users?first={first}&max={max}"), Times.Once()); - } - - [Fact] - public async void GetRoleMembersAsync_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.GetAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Get, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - var name = "name"; - var first = 1; - var max = 10; - - // Act - await Assert.ThrowsAsync(async () => await service.GetRoleMembersAsync(name, first, max)); - - // Assert - openIdConnect.Verify(m => m.GetAsync($"{options.Value.Admin.Authority}/roles/{name}/users?first={first}&max={max}"), Times.Once()); - } - #endregion - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Libraries/Keycloak/KeycloakServiceTest.cs b/backend/tests/unit/dal/Libraries/Keycloak/KeycloakServiceTest.cs deleted file mode 100644 index 888d9d4829..0000000000 --- a/backend/tests/unit/dal/Libraries/Keycloak/KeycloakServiceTest.cs +++ /dev/null @@ -1,431 +0,0 @@ -using FluentAssertions; -using Microsoft.Extensions.Options; -using Moq; -using Pims.Core.Exceptions; -using Pims.Core.Http; -using Pims.Core.Test; -using Pims.Keycloak; -using Pims.Keycloak.Configuration; -using System.Diagnostics.CodeAnalysis; -using System.Net; -using System.Net.Http; -using Xunit; - -namespace Pims.Dal.Test.Libraries.Keycloak -{ - [Trait("category", "unit")] - [Trait("category", "keycloak")] - [Trait("group", "keycloak")] - [ExcludeFromCodeCoverage] - public partial class KeycloakServiceTest - { - #region Tests - #region CreateKeycloakService - [Fact] - public void CreateKeycloakService_NoAuthority() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new KeycloakOptions()); - - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.DeleteAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK)); - helper.AddSingleton(openIdConnect.Object); - - // Act - // Assert - var result = Assert.Throws(() => helper.Create(options, user)); - result.Message.Should().Be("The configuration for Keycloak:Authority is invalid or missing."); - } - - [Fact] - public void CreateKeycloakService_NoAudience() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new KeycloakOptions() - { - Authority = "https://keycloak", - }); - - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.DeleteAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK)); - helper.AddSingleton(openIdConnect.Object); - - // Act - // Assert - var result = Assert.Throws(() => helper.Create(options, user)); - result.Message.Should().Be("The configuration for Keycloak:Audience is invalid or missing."); - } - - [Fact] - public void CreateKeycloakService_NoClient() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new KeycloakOptions() - { - Authority = "https://keycloak", - Audience = "pims", - }); - - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.DeleteAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK)); - helper.AddSingleton(openIdConnect.Object); - - // Act - // Assert - var result = Assert.Throws(() => helper.Create(options, user)); - result.Message.Should().Be("The configuration for Keycloak:Client is invalid or missing."); - } - - [Fact] - public void CreateKeycloakService_NoAdminAuthority() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new KeycloakOptions() - { - Authority = "https://keycloak", - Audience = "pims", - Client = "pims", - Admin = new KeycloakAdminOptions() - }); - - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.DeleteAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK)); - helper.AddSingleton(openIdConnect.Object); - - // Act - // Assert - var result = Assert.Throws(() => helper.Create(options, user)); - result.Message.Should().Be("The configuration for Keycloak:Admin:Authority is invalid or missing."); - } - - [Fact] - public void CreateKeycloakService_NoAdminUsers() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new KeycloakOptions() - { - Authority = "https://keycloak", - Audience = "pims", - Client = "pims", - Admin = new KeycloakAdminOptions() - { - Authority = "https://keycloak/admin" - } - }); - - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.DeleteAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK)); - helper.AddSingleton(openIdConnect.Object); - - // Act - // Assert - var result = Assert.Throws(() => helper.Create(options, user)); - result.Message.Should().Be("The configuration for Keycloak:Admin:Users is invalid or missing."); - } - - [Fact] - public void CreateKeycloakService_NoOpenIdConnectToken() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new KeycloakOptions() - { - Authority = "https://keycloak", - Audience = "pims", - Client = "pims", - Admin = new KeycloakAdminOptions() - { - Authority = "https://keycloak/admin", - Users = "/users" - }, - OpenIdConnect = new Pims.Core.Http.Configuration.OpenIdConnectOptions(), - }); - - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.DeleteAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK)); - helper.AddSingleton(openIdConnect.Object); - - // Act - // Assert - var result = Assert.Throws(() => helper.Create(options, user)); - result.Message.Should().Be("The configuration for Keycloak:OpenIdConnect:Token is invalid or missing."); - } - - [Fact] - public void CreateKeycloakService_NoOpenIdConnectUserInfo() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new KeycloakOptions() - { - Authority = "https://keycloak", - Audience = "pims", - Client = "pims", - Admin = new KeycloakAdminOptions() - { - Authority = "https://keycloak/admin", - Users = "/users" - }, - OpenIdConnect = new Pims.Core.Http.Configuration.OpenIdConnectOptions() - { - Token = "/protocol/openid-connect/token", - }, - }); - - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.DeleteAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK)); - helper.AddSingleton(openIdConnect.Object); - - // Act - // Assert - var result = Assert.Throws(() => helper.Create(options, user)); - result.Message.Should().Be("The configuration for Keycloak:OpenIdConnect:UserInfo is invalid or missing."); - } - - [Fact] - public void CreateKeycloakService_NoServiceAccountClient() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new KeycloakOptions() - { - Authority = "https://keycloak", - Audience = "pims", - Client = "pims", - Admin = new KeycloakAdminOptions() - { - Authority = "https://keycloak/admin", - Users = "/users" - }, - OpenIdConnect = new Pims.Core.Http.Configuration.OpenIdConnectOptions() - { - Token = "/protocol/openid-connect/token", - UserInfo = "/protocol/openid-connect/userinfo" - }, - ServiceAccount = new KeycloakServiceAccountOptions() - }); - - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.DeleteAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK)); - helper.AddSingleton(openIdConnect.Object); - - // Act - // Assert - var result = Assert.Throws(() => helper.Create(options, user)); - result.Message.Should().Be("The configuration for Keycloak:ServiceAccount:Client is invalid or missing."); - } - - [Fact] - public void CreateKeycloakService_NoServiceAccountSecret() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new KeycloakOptions() - { - Authority = "https://keycloak", - Audience = "pims", - Client = "pims", - Admin = new KeycloakAdminOptions() - { - Authority = "https://keycloak/admin", - Users = "/users" - }, - OpenIdConnect = new Pims.Core.Http.Configuration.OpenIdConnectOptions() - { - Token = "/protocol/openid-connect/token", - UserInfo = "/protocol/openid-connect/userinfo" - }, - ServiceAccount = new KeycloakServiceAccountOptions() - { - Client = "pims-service-account" - } - }); - - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.DeleteAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK)); - helper.AddSingleton(openIdConnect.Object); - - // Act - // Assert - var result = Assert.Throws(() => helper.Create(options, user)); - result.Message.Should().Be("The configuration for Keycloak:ServiceAccount:Secret is invalid or missing."); - } - - [Fact] - public void CreateKeycloakService() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new KeycloakOptions() - { - Authority = "https://keycloak", - Audience = "pims", - Client = "pims", - Admin = new KeycloakAdminOptions() - { - Authority = "https://keycloak/admin", - Users = "/users" - }, - OpenIdConnect = new Pims.Core.Http.Configuration.OpenIdConnectOptions() - { - Token = "/protocol/openid-connect/token", - UserInfo = "/protocol/openid-connect/userinfo" - }, - ServiceAccount = new KeycloakServiceAccountOptions() - { - Client = "pims-service-account", - Secret = "[USE SECRETS]", - } - }); - - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.DeleteAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK)); - helper.AddSingleton(openIdConnect.Object); - - // Act - var service = helper.Create(options, user); - - // Assert - openIdConnect.Object.AuthClientOptions.Audience.Should().Be(options.Value.Audience); - openIdConnect.Object.AuthClientOptions.Authority.Should().Be(options.Value.Authority); - openIdConnect.Object.AuthClientOptions.Client.Should().Be(options.Value.ServiceAccount.Client); - openIdConnect.Object.AuthClientOptions.Secret.Should().Be(options.Value.ServiceAccount.Secret); - } - - [Fact] - public void CreateKeycloakService_ServiceAccount() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new KeycloakOptions() - { - Authority = "https://keycloak", - Audience = "pims", - Client = "pims", - Admin = new KeycloakAdminOptions() - { - Authority = "https://keycloak/admin", - Users = "/users" - }, - OpenIdConnect = new Pims.Core.Http.Configuration.OpenIdConnectOptions() - { - Token = "/protocol/openid-connect/token", - UserInfo = "/protocol/openid-connect/userinfo" - }, - ServiceAccount = new KeycloakServiceAccountOptions() - { - Authority = "https://serviceaccount", - Audience = "serviceaccount", - Client = "pims-service-account", - Secret = "[USE SECRETS]", - } - }); - - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.DeleteAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK)); - helper.AddSingleton(openIdConnect.Object); - - // Act - var service = helper.Create(options, user); - - // Assert - openIdConnect.Object.AuthClientOptions.Audience.Should().Be(options.Value.ServiceAccount.Audience); - openIdConnect.Object.AuthClientOptions.Authority.Should().Be(options.Value.ServiceAccount.Authority); - openIdConnect.Object.AuthClientOptions.Client.Should().Be(options.Value.ServiceAccount.Client); - openIdConnect.Object.AuthClientOptions.Secret.Should().Be(options.Value.ServiceAccount.Secret); - } - #endregion - - #region DeleteAttackDetectionAsync - [Fact] - public async void DeleteAttackDetectionAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.DeleteAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK)); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - - // Act - await service.DeleteAttackDetectionAsync(); - - // Assert - openIdConnect.Verify(m => m.DeleteAsync($"{options.Value.Admin.Authority}/attack-detection/brute-force/users", null), Times.Once()); - } - - [Fact] - public async void DeleteAttackDetectionAsync_Failed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = helper.CreateDefaultKeycloakOptions(); - - var openIdConnect = new Mock(); - openIdConnect.Setup(m => m.AuthClientOptions).Returns(new Pims.Core.Http.Configuration.AuthClientOptions()); - openIdConnect.Setup(m => m.DeleteAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Delete, "http://keycloak") - }); - helper.AddSingleton(openIdConnect.Object); - - var service = helper.Create(); - - // Act - var result = await Assert.ThrowsAsync(async () => await service.DeleteAttackDetectionAsync()); - - // Assert - openIdConnect.Verify(m => m.DeleteAsync($"{options.Value.Admin.Authority}/attack-detection/brute-force/users", null), Times.Once()); - result.StatusCode.Should().Be(HttpStatusCode.BadRequest); - } - - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Libraries/Keycloak/PimsKeycloakUserServiceTest.cs b/backend/tests/unit/dal/Libraries/Keycloak/PimsKeycloakUserServiceTest.cs deleted file mode 100644 index d25c06de0a..0000000000 --- a/backend/tests/unit/dal/Libraries/Keycloak/PimsKeycloakUserServiceTest.cs +++ /dev/null @@ -1,220 +0,0 @@ -using FluentAssertions; -using Moq; -using Pims.Core.Test; -using Pims.Dal.Keycloak; -using Entity = Pims.Dal.Entities; -using System; -using System.Linq; -using System.Threading.Tasks; -using Xunit; -using System.Collections.Generic; - -namespace Pims.Dal.Test.Libraries.Keycloak -{ - [Trait("category", "unit")] - [Trait("category", "keycloak")] - [Trait("group", "keycloak")] - [Trait("group", "user")] - public partial class PimsKeycloakUserServiceTest - { - #region UpdateUserAsync - /// - /// Validate that the user properties are updated, the keycloak groups are added and removed. - /// - /// - [Fact] - public async Task UpdateUserAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var service = helper.Create(); - - var euser = EntityHelper.CreateUser("test"); - var removeRole = euser.Roles.First().Role; - removeRole.KeycloakGroupId = Guid.NewGuid(); - - var keycloakServiceMock = helper.GetMock(); - var kuser = new Pims.Keycloak.Models.UserModel() - { - Id = euser.Id, - Username = euser.Username, - Groups = new string[] { removeRole.KeycloakGroupId.ToString() } - }; - keycloakServiceMock.Setup(m => m.GetUserAsync(It.IsAny())).ReturnsAsync(kuser); - keycloakServiceMock.Setup(m => m.GetUserGroupsAsync(euser.Id)) - .ReturnsAsync(kuser.Groups.Select(g => new Pims.Keycloak.Models.GroupModel() - { - Id = new Guid(g) - }).ToArray()); - keycloakServiceMock.Setup(m => m.UpdateUserAsync(It.IsAny())); - - var pimsAdminServiceMock = helper.GetMock(); - pimsAdminServiceMock.Setup(m => m.User.GetForKeycloakUserId(It.IsAny())).Returns(euser); - pimsAdminServiceMock.Setup(m => m.Role.Find(removeRole.Id)).Returns(removeRole); - - var user = EntityHelper.CreateUser(euser.Id, euser.Username, "new first name", "new last name"); - var addRole = user.Roles.First().Role; - addRole.KeycloakGroupId = Guid.NewGuid(); - pimsAdminServiceMock.Setup(m => m.Role.Find(addRole.Id)).Returns(addRole); - - var pimsServiceMock = helper.GetMock(); - pimsServiceMock.Setup(m => m.User.GetAgencies(It.IsAny())).Returns(euser.Agencies.Select(a => a.AgencyId)); - - // Act - var result = await service.UpdateUserAsync(user); - - // Assert - result.Id.Should().Be(user.Id); - result.Username.Should().Be(user.Username); - result.FirstName.Should().Be(user.FirstName); - result.LastName.Should().Be(user.LastName); - result.Agencies.Count().Should().Be(euser.Agencies.Count()); - result.Roles.Count().Should().Be(1); - result.Roles.First().Role.KeycloakGroupId.Should().Be(user.Roles.First().Role.KeycloakGroupId); - - keycloakServiceMock.Verify(m => m.GetUserGroupsAsync(euser.Id), Times.Once); - keycloakServiceMock.Verify(m => m.RemoveGroupFromUserAsync(euser.Id, new Guid(kuser.Groups.First())), Times.Once); - keycloakServiceMock.Verify(m => m.AddGroupToUserAsync(euser.Id, addRole.KeycloakGroupId.Value), Times.Once); - pimsAdminServiceMock.Verify(m => m.User.Update(It.IsAny()), Times.Once); - pimsServiceMock.Verify(m => m.User.GetAgencies(It.IsAny()), Times.Once); - keycloakServiceMock.Verify(m => m.UpdateUserAsync(It.IsAny()), Times.Once); - } - - /// - /// Validate when user does not exist in keycloak. - /// - /// - [Fact] - public async Task UpdateUserAsync_MissingKeycloakUser() - { - // Arrange - var helper = new TestHelper(); - var service = helper.Create(); - - var euser = EntityHelper.CreateUser("test"); - - var keycloakServiceMock = helper.GetMock(); - keycloakServiceMock.Setup(m => m.GetUserAsync(It.IsAny())).ReturnsAsync((Pims.Keycloak.Models.UserModel)null); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.UpdateUserAsync(euser)); - } - - /// - /// Validate that the keycloak user matches PIMS. - /// - /// - [Fact] - public async Task UpdateUserAsync_KeycloakUserDoesNotMatch() - { - // Arrange - var helper = new TestHelper(); - var service = helper.Create(); - - var euser = EntityHelper.CreateUser("test"); - - var keycloakServiceMock = helper.GetMock(); - var kuser = new Pims.Keycloak.Models.UserModel() - { - Id = euser.Id, - Username = "different name" - }; - keycloakServiceMock.Setup(m => m.GetUserAsync(It.IsAny())).ReturnsAsync(kuser); - - var pimsAdminServiceMock = helper.GetMock(); - pimsAdminServiceMock.Setup(m => m.User.GetForKeycloakUserId(It.IsAny())).Returns(euser); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.UpdateUserAsync(euser)); - } - - /// - /// Validate that the role added to the user exists in PIMS. - /// - /// - [Fact] - public async Task UpdateUserAsync_AddRoleDoesNotExistInPims() - { - // Arrange - var helper = new TestHelper(); - var service = helper.Create(); - - var euser = EntityHelper.CreateUser("test"); - var removeRole = euser.Roles.First().Role; - removeRole.KeycloakGroupId = Guid.NewGuid(); - - var keycloakServiceMock = helper.GetMock(); - var kuser = new Pims.Keycloak.Models.UserModel() - { - Id = euser.Id, - Username = euser.Username, - Groups = new string[] { removeRole.KeycloakGroupId.ToString() } - }; - keycloakServiceMock.Setup(m => m.GetUserAsync(It.IsAny())).ReturnsAsync(kuser); - keycloakServiceMock.Setup(m => m.GetUserGroupsAsync(euser.Id)) - .ReturnsAsync(kuser.Groups.Select(g => new Pims.Keycloak.Models.GroupModel() - { - Id = new Guid(g) - }).ToArray()); - - var pimsAdminServiceMock = helper.GetMock(); - pimsAdminServiceMock.Setup(m => m.User.GetForKeycloakUserId(It.IsAny())).Returns(euser); - - var user = EntityHelper.CreateUser(euser.Id, euser.Username, "new first name", "new last name"); - var addRole = user.Roles.First().Role; - addRole.KeycloakGroupId = Guid.NewGuid(); - pimsAdminServiceMock.Setup(m => m.Role.Find(addRole.Id)).Returns(null); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.UpdateUserAsync(euser)); - } - - /// - /// Validate that the role removed from the user exists in PIMS. - /// - /// - [Fact] - public async Task UpdateUserAsync_RemoveRoleDoesNotExistInPims() - { - // Arrange - var helper = new TestHelper(); - var service = helper.Create(); - - var euser = EntityHelper.CreateUser("test"); - var removeRole = euser.Roles.First().Role; - removeRole.KeycloakGroupId = Guid.NewGuid(); - - var keycloakServiceMock = helper.GetMock(); - var kuser = new Pims.Keycloak.Models.UserModel() - { - Id = euser.Id, - Username = euser.Username, - Groups = new string[] { removeRole.KeycloakGroupId.ToString() } - }; - keycloakServiceMock.Setup(m => m.GetUserAsync(It.IsAny())).ReturnsAsync(kuser); - keycloakServiceMock.Setup(m => m.GetUserGroupsAsync(euser.Id)) - .ReturnsAsync(kuser.Groups.Select(g => new Pims.Keycloak.Models.GroupModel() - { - Id = new Guid(g) - }).ToArray()); - keycloakServiceMock.Setup(m => m.UpdateUserAsync(It.IsAny())); - - var pimsAdminServiceMock = helper.GetMock(); - pimsAdminServiceMock.Setup(m => m.User.GetForKeycloakUserId(It.IsAny())).Returns(euser); - pimsAdminServiceMock.Setup(m => m.Role.Find(removeRole.Id)).Returns(null); - - var user = EntityHelper.CreateUser(euser.Id, euser.Username, "new first name", "new last name"); - var addRole = user.Roles.First().Role; - addRole.KeycloakGroupId = Guid.NewGuid(); - pimsAdminServiceMock.Setup(m => m.Role.Find(addRole.Id)).Returns(addRole); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.UpdateUserAsync(euser)); - } - #endregion - } -} diff --git a/backend/tests/unit/dal/Libraries/Ltsa/LtsaServiceCollectionTest.cs b/backend/tests/unit/dal/Libraries/Ltsa/LtsaServiceCollectionTest.cs deleted file mode 100644 index 09cd5d8787..0000000000 --- a/backend/tests/unit/dal/Libraries/Ltsa/LtsaServiceCollectionTest.cs +++ /dev/null @@ -1,91 +0,0 @@ -using FluentAssertions; -using Pims.Core.Http; -using Pims.Core.Test; -using Moq; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Microsoft.Extensions.Options; -using Pims.Ltsa.Configuration; -using Pims.Ltsa; -using System.Net.Http; -using Microsoft.Extensions.Configuration; -using System.Text.Json; -using System.IdentityModel.Tokens.Jwt; -using Microsoft.Extensions.Logging; -using System.IO; -using System.Text; - -namespace Pims.Dal.Test.Libraries.Ltsa -{ - [Trait("category", "unit")] - [Trait("category", "ltsa")] - [Trait("group", "notification")] - [ExcludeFromCodeCoverage] - public class LtsaServiceCollectionTest - { - public IConfiguration Configuration { get; } - - #region Tests - #region LtsaServiceCollection - [Fact] - public void LtsaServiceCollection_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - helper.AddSingleton(user); - - var builder = new ConfigurationBuilder(); - var options = new LtsaOptions() - { - AuthUrl = "https://test.com", - HostUri = "https://host.com", - IntegratorPassword = "password", - IntegratorUsername = "username", - UserName = "user", - UserPassword = "password" - }; - var ltsaJson = JsonSerializer.Serialize(new { Ltsa = options }); - IConfigurationRoot ltsaConfig; - using (var io = new MemoryStream(Encoding.UTF8.GetBytes(ltsaJson))) - { - builder.AddJsonStream(io); - ltsaConfig = builder.Build(); - } - - var mockClientFactory = new Mock(); - var mockIOptionsMonitor = new Mock>(); - var mockIlogger = new Mock>(); - var mockILtsaService = new Mock>(); - - helper.AddSingleton(mockClientFactory.Object); - helper.AddSingleton(mockIOptionsMonitor.Object); - helper.AddSingleton(mockIlogger.Object); - helper.AddSingleton(mockILtsaService.Object); - - // Act - _ = helper.Services.AddLtsaService(section: ltsaConfig.GetSection("Ltsa")); - - var ltsaOptions = helper.GetService>(); - var ltsaService = helper.GetService(); - var httpRequestClient = helper.GetService(); - var jwtSecurityTokenHandler = helper.GetService(); - - // Assert - Assert.NotNull(ltsaService); - Assert.NotNull(httpRequestClient); - Assert.NotNull(jwtSecurityTokenHandler); - Assert.NotNull(ltsaOptions); - - ltsaOptions.Value.AuthUrl.Should().Be(options.AuthUrl); - ltsaOptions.Value.HostUri.Should().Be(options.HostUri); - ltsaOptions.Value.IntegratorPassword.Should().Be(options.IntegratorPassword); - ltsaOptions.Value.IntegratorUsername.Should().Be(options.IntegratorUsername); - ltsaOptions.Value.UserName.Should().Be(options.UserName); - ltsaOptions.Value.UserPassword.Should().Be(options.UserPassword); - - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Libraries/Ltsa/LtsaServiceTest.cs b/backend/tests/unit/dal/Libraries/Ltsa/LtsaServiceTest.cs deleted file mode 100644 index fdf8c25523..0000000000 --- a/backend/tests/unit/dal/Libraries/Ltsa/LtsaServiceTest.cs +++ /dev/null @@ -1,719 +0,0 @@ -using FluentAssertions; -using Microsoft.Extensions.Options; -using Moq; -using Pims.Ltsa; -using Pims.Ltsa.Configuration; -using Pims.Core.Exceptions; -using Pims.Core.Http; -using Pims.Core.Http.Models; -using Pims.Core.Test; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Net; -using System.Net.Http; -using System.Net.Http.Headers; -using System.Text; -using Xunit; -using Pims.Ches.Models; -using Microsoft.AspNetCore.Mvc; -using Pims.Api.Areas.Tools.Controllers; -using Pims.Dal.Security; -using System.Text.Json; -using static Pims.Ltsa.LtsaService; - -namespace Pims.Dal.Test.Libraries.Ltsa -{ - [Trait("category", "unit")] - [Trait("category", "ltsa")] - [Trait("group", "notification")] - [ExcludeFromCodeCoverage] - public class LtsaServiceTest - { - - #region Tests - #region GetTokenAsync - [Fact] - public async void GetLtsaTokenAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new LtsaOptions() - { - AuthUrl = "https://test.com", - HostUri = "https://host.com", - IntegratorPassword = "password", - IntegratorUsername = "username", - UserName = "user", - UserPassword = "password" - }); - var service = helper.Create(options, user); - - var token = new LtsaTokenModel(); - token.AccessToken = "abc123"; - token.RefreshToken = "12345"; - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(token); - - var pid = "123123123"; - - // Act - var result = await service.GetTokenAsync(pid); - - // Assert - Assert.NotNull(result); - Assert.NotNull(result.AccessToken); - Assert.NotNull(result.RefreshToken); - Assert.IsAssignableFrom(result); - //client.Verify(m => m.SendAsync(options.Value.AuthUrl, HttpMethod.Post, - // It.Is(a => a.Authorization.Scheme == "Basic" && a.GetValues("ContentType").First() == "application/x-www-form-urlencoded"), - // It.IsAny(), null), Times.Once); - } - #endregion - - - - [Fact] - public async void GetTokenAsync_LtsaExeption() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new LtsaOptions() - { - AuthUrl = "https://test.com", - HostUri = "https://host.com", - IntegratorPassword = "password", - IntegratorUsername = "username", - UserName = "user", - UserPassword = "password" - }); - var service = helper.Create(options, user); - - var response = new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Post, "https://test") - }; - var client = helper.GetService>(); - - var token = new LtsaTokenModel(); - token.AccessToken = "abc123"; - token.RefreshToken = "12345"; - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ThrowsAsync(new HttpClientRequestException(response)); - client.Setup(m => m.DeserializeAsync(It.IsAny())).ReturnsAsync(new ErrorResponseModel()); - - var pid = "123123123"; - // Act - // Assert - var result = await Assert.ThrowsAsync(async () => await service.GetTokenAsync(pid)); - - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - client.Verify(m => m.SendAsync(options.Value.AuthUrl, HttpMethod.Post, - It.IsAny(), null), Times.Once); - } - #endregion - - [Fact] - public async void GetTitleSummary_ReturnsTitleSummaryResponse() - { - // Arrange - var accessToken = "testAccessToken"; - var parcelIdentifier = "testParcelIdentifier"; - var expectedResponse = new LtsaTitleSummaryResponse - { - TitleSummaries = new List - { - new LtsaTitleSummaryModel - { - TitleNumber = "123", - LandTitleDistrictCode = "ABC", - ParcelIdentifier = "TEST", - Status = "Active", - FirstOwner = "John Doe" - } - } - }; - - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new LtsaOptions() - { - AuthUrl = "https://test.com", - HostUri = "https://host.com", - IntegratorPassword = "password", - IntegratorUsername = "username", - UserName = "user", - UserPassword = "password" - }); - var service = helper.Create(options, user); - - var token = new LtsaTokenModel(); - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), HttpMethod.Get, It.IsAny(), null, null)).ReturnsAsync(expectedResponse); - - // Act - var result = await service.GetTitleSummary(accessToken, parcelIdentifier); - - // Assert - result.Should().BeEquivalentTo(expectedResponse); - } - - #region FindPidsAsync - [Fact] - public async void FindLTSATitleAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var controller = helper.CreateController(Permissions.PropertyView); - - var pid = "005-666-767"; - var response = new LtsaOrderModel - { - Order = new LtsaOrder - { - ProductType = "title", - FileReference = "test", - ProductOrderParameters = new LtsaProductOrderParameters - { - TitleNumber = "CA2998256", - LandTitleDistrictCode = "NW", - IncludeCancelledInfo = false - }, - OrderId = Guid.NewGuid(), - Status = "Processing", - BillingInfo = new LtsaBillingInfo - { - BillingModel = "PROV", - ProductName = "Searches", - ProductCode = "Search", - FeeExempted = true, - ProductFee = 0, - ServiceCharge = 0.0, - SubtotalFee = 0.0, - ProductFeeTax = 0, - ServiceChargeTax = 0.0, - TotalTax = 0.0, - TotalFee = 0.0 - }, - OrderedProduct = new LtsaOrderedProduct - { - FieldedData = new LtsaFieldedData - { - TitleStatus = "REGISTERED", - TitleIdentifier = new LtsaTitleIdentifier - { - TitleNumber = "CA2998256", - LandTitleDistrict = "NEW WESTMINSTER" - }, - Tombstone = new LtsaTombstone - { - ApplicationReceivedDate = DateTime.Parse("2013-02-19T00:31:57Z"), - EnteredDate = DateTime.Parse("2013-03-12T17:43:20Z"), - TitleRemarks = "", - RootOfTitle = "ROAD", - MarketValueAmount = "834750", - FromTitles = new List(), - NatureOfTransfers = new List - { - new LtsaNatureOfTransfer - { - TransferReason = "SEE DOCUMENTATION" - } - } - }, - OwnershipGroups = new List - { - new LtsaOwnershipGroup - { - JointTenancyIndication = false, - InterestFractionNumerator = "1", - InterestFractionDenominator = "1", - OwnershipRemarks = "", - TitleOwners = new List - { - new LtsaTitleOwner - { - LastNameOrCorpName1 = "BC TRANSPORTATION FINANCING AUTHORITY", - GivenName = "", - IncorporationNumber = "", - OccupationDescription = "", - Address = new LtsaAddress - { - AddressLine1 = "P.O. BOX 9580, STN PROV GOVT", - AddressLine2 = "", - City = "VICTORIA", - Province = "BC", - ProvinceName = "BC", - Country = "CANADA", - PostalCode = "V8W 9T5" - } - } - } - } - }, - TaxAuthorities = new List - { - new LtsaTaxAuthority - { - AuthorityName = "Delta, City of" - } - }, - DescriptionsOfLand = new List - { - new LtsaDescriptionOfLand - { - ParcelIdentifier = "029-020-174", - FullLegalDescription = "THAT PART OF THE NORTHWEST 1/4 OF SECTION 25 TOWNSHIP 5 \nNEW WESTMINSTER DISTRICT SHOWN ON PLAN EPP67641 \n", - ParcelStatus = "ACTIVE" - } - }, - LegalNotationsOnTitle = new List(), - DuplicateCertificatesOfTitle = new List(), - TitleTransfersOrDispositions = new List() - } - } - } - }; - - - var service = helper.GetService>(); - service.Setup(m => m.ProcessLTSARequest(pid)).ReturnsAsync(response); - - // Act - var result = await controller.GetLandTitleInfo(pid); - - // Assert - JsonResult actionResult = Assert.IsType(result); - var ltsaOrder = Assert.IsAssignableFrom(actionResult.Value); - //ltsaOrder.Order.BillingInfo - } - #endregion - - - #region - [Fact] - public async void ProcessLTSARequest_Success() - { - // Arrange - var helper = new TestHelper(); - // var controller = helper.CreateController(Permissions.PropertyEdit); - - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new LtsaOptions() - { - AuthUrl = "https://test.com", - HostUri = "https://host.com/", - IntegratorPassword = "password", - IntegratorUsername = "username", - UserName = "user", - UserPassword = "password" - }); - // Arrange - - var apiUrl = "https://host.com/orders"; - var pid = "005-666-767"; - var response = new LtsaOrderModel - { - Order = new LtsaOrder - { - ProductType = "title", - FileReference = "test", - ProductOrderParameters = new LtsaProductOrderParameters - { - TitleNumber = "CA2998256", - LandTitleDistrictCode = "NW", - IncludeCancelledInfo = false - }, - OrderId = Guid.NewGuid(), - Status = "Processing", - BillingInfo = new LtsaBillingInfo - { - BillingModel = "PROV", - ProductName = "Searches", - ProductCode = "Search", - FeeExempted = true, - ProductFee = 0, - ServiceCharge = 0.0, - SubtotalFee = 0.0, - ProductFeeTax = 0, - ServiceChargeTax = 0.0, - TotalTax = 0.0, - TotalFee = 0.0 - }, - OrderedProduct = new LtsaOrderedProduct - { - FieldedData = new LtsaFieldedData - { - TitleStatus = "REGISTERED", - TitleIdentifier = new LtsaTitleIdentifier - { - TitleNumber = "CA2998256", - LandTitleDistrict = "NEW WESTMINSTER" - }, - Tombstone = new LtsaTombstone - { - ApplicationReceivedDate = DateTime.Parse("2013-02-19T00:31:57Z"), - EnteredDate = DateTime.Parse("2013-03-12T17:43:20Z"), - TitleRemarks = "", - RootOfTitle = "ROAD", - MarketValueAmount = "834750", - FromTitles = new List(), - NatureOfTransfers = new List - { - new LtsaNatureOfTransfer - { - TransferReason = "SEE DOCUMENTATION" - } - } - }, - OwnershipGroups = new List - { - new LtsaOwnershipGroup - { - JointTenancyIndication = false, - InterestFractionNumerator = "1", - InterestFractionDenominator = "1", - OwnershipRemarks = "", - TitleOwners = new List - { - new LtsaTitleOwner - { - LastNameOrCorpName1 = "BC TRANSPORTATION FINANCING AUTHORITY", - GivenName = "", - IncorporationNumber = "", - OccupationDescription = "", - Address = new LtsaAddress - { - AddressLine1 = "P.O. BOX 9580, STN PROV GOVT", - AddressLine2 = "", - City = "VICTORIA", - Province = "BC", - ProvinceName = "BC", - Country = "CANADA", - PostalCode = "V8W 9T5" - } - } - } - } - }, - TaxAuthorities = new List - { - new LtsaTaxAuthority - { - AuthorityName = "Delta, City of" - } - }, - DescriptionsOfLand = new List - { - new LtsaDescriptionOfLand - { - ParcelIdentifier = "029-020-174", - FullLegalDescription = "THAT PART OF THE NORTHWEST 1/4 OF SECTION 25 TOWNSHIP 5 \nNEW WESTMINSTER DISTRICT SHOWN ON PLAN EPP67641 \n", - ParcelStatus = "ACTIVE" - } - }, - LegalNotationsOnTitle = new List(), - DuplicateCertificatesOfTitle = new List(), - TitleTransfersOrDispositions = new List() - } - } - } - }; - - var token = new LtsaTokenModel(); - token.AccessToken = "abc123"; - token.RefreshToken = "12345"; - var titleSummaryResponse = new LtsaTitleSummaryResponse - { - TitleSummaries = new List - { - new LtsaTitleSummaryModel - { - TitleNumber = "123", - LandTitleDistrictCode = "ABC", - ParcelIdentifier = "TEST", - Status = "Active", - FirstOwner = "John Doe" - } - } - }; - - // var service = helper.GetService>(); - // service.Setup(m => m.ProcessLTSARequest(pid)).ReturnsAsync(response); - - var service = helper.Create(options, user); - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())).ReturnsAsync(token); - - - client.Setup(m => m.SendAsync(It.IsAny(), HttpMethod.Get, It.IsAny(), null, null)).ReturnsAsync(titleSummaryResponse); - - client.Setup(m => m.SendAsync(It.IsAny(), HttpMethod.Get, It.IsAny(), null, null)).ReturnsAsync(response); - - - client.Setup(m => m.SendAsync(apiUrl, HttpMethod.Post, It.IsAny(), It.IsAny(), null)).ReturnsAsync(response); - - // Act - var result = await service.ProcessLTSARequest(pid); //controller.GetLandTitleInfo(pid); - - // Assert - LtsaOrderModel actionResult = Assert.IsType(result); - var ltsaOrder = Assert.IsAssignableFrom(actionResult); - - // Assert - result.Should().NotBeNull(); - // result.Should().BeEquivalentTo(expectedOrder); - } - #endregion - #region - [Fact] - public async void CreateOrderAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new LtsaOptions() - { - AuthUrl = "https://test.com", - HostUri = "https://host.com/", - IntegratorPassword = "password", - IntegratorUsername = "username", - UserName = "user", - UserPassword = "password" - }); - var service = helper.Create(options, user); - - var accessToken = "testAccessToken"; - var titleNumber = "testTitleNumber"; - var landTitleDistrictCode = "testDistrictCode"; - - var apiUrl = "https://host.com/orders"; - var expectedOrder = new LtsaOrderModel - { - Order = new LtsaOrder - { - ProductType = "title", - FileReference = "test", - ProductOrderParameters = new LtsaProductOrderParameters - { - TitleNumber = "CA2998256", - LandTitleDistrictCode = "NW", - IncludeCancelledInfo = false - }, - OrderId = Guid.NewGuid(), - Status = "Processing", - BillingInfo = new LtsaBillingInfo - { - BillingModel = "PROV", - ProductName = "Searches", - ProductCode = "Search", - FeeExempted = true, - ProductFee = 0, - ServiceCharge = 0.0, - SubtotalFee = 0.0, - ProductFeeTax = 0, - ServiceChargeTax = 0.0, - TotalTax = 0.0, - TotalFee = 0.0 - }, - OrderedProduct = new LtsaOrderedProduct - { - FieldedData = new LtsaFieldedData - { - TitleStatus = "REGISTERED", - TitleIdentifier = new LtsaTitleIdentifier - { - TitleNumber = "CA2998256", - LandTitleDistrict = "NEW WESTMINSTER" - }, - Tombstone = new LtsaTombstone - { - ApplicationReceivedDate = DateTime.Parse("2013-02-19T00:31:57Z"), - EnteredDate = DateTime.Parse("2013-03-12T17:43:20Z"), - TitleRemarks = "", - RootOfTitle = "ROAD", - MarketValueAmount = "834750", - FromTitles = new List(), - NatureOfTransfers = new List - { - new LtsaNatureOfTransfer - { - TransferReason = "SEE DOCUMENTATION" - } - } - }, - OwnershipGroups = new List - { - new LtsaOwnershipGroup - { - JointTenancyIndication = false, - InterestFractionNumerator = "1", - InterestFractionDenominator = "1", - OwnershipRemarks = "", - TitleOwners = new List - { - new LtsaTitleOwner - { - LastNameOrCorpName1 = "BC TRANSPORTATION FINANCING AUTHORITY", - GivenName = "", - IncorporationNumber = "", - OccupationDescription = "", - Address = new LtsaAddress - { - AddressLine1 = "P.O. BOX 9580, STN PROV GOVT", - AddressLine2 = "", - City = "VICTORIA", - Province = "BC", - ProvinceName = "BC", - Country = "CANADA", - PostalCode = "V8W 9T5" - } - } - } - } - }, - TaxAuthorities = new List - { - new LtsaTaxAuthority - { - AuthorityName = "Delta, City of" - } - }, - DescriptionsOfLand = new List - { - new LtsaDescriptionOfLand - { - ParcelIdentifier = "029-020-174", - FullLegalDescription = "THAT PART OF THE NORTHWEST 1/4 OF SECTION 25 TOWNSHIP 5 \nNEW WESTMINSTER DISTRICT SHOWN ON PLAN EPP67641 \n", - ParcelStatus = "ACTIVE" - } - }, - LegalNotationsOnTitle = new List(), - DuplicateCertificatesOfTitle = new List(), - TitleTransfersOrDispositions = new List() - } - } - } - }; - - var headers = new HttpRequestMessage().Headers; - headers.Add("Accept", "application/vnd.ltsa.astra.orders+json"); - headers.Add("X-Authorization", $"Bearer {accessToken}"); - - var order = new - { - productType = "title", - fileReference = "Test", - productOrderParameters = new - { - titleNumber, - landTitleDistrictCode, - includeCancelledInfo = false - } - }; - - var requestBody = new - { - order - }; - - var json = JsonSerializer.Serialize(requestBody); - var content = new StringContent(json, Encoding.UTF8, "application/json"); - - var client = helper.GetService>(); - client.Setup(m => m.SendAsync(apiUrl, HttpMethod.Post, It.IsAny(), It.IsAny(), null)).ReturnsAsync(expectedOrder); - - - // Act - var result = await service.CreateOrderAsync(accessToken, titleNumber, landTitleDistrictCode); - - // Assert - result.Should().NotBeNull(); - result.Should().BeEquivalentTo(expectedOrder); - var mock = Mock.Get(client.Object); - var invocations = mock.Invocations; - - client.Verify(m => m.SendAsync(apiUrl, HttpMethod.Post, It.IsAny(), It.IsAny(), null), Times.Once); - } - #endregion - #region - [Fact] - public async void CreateOrderAsync_ExceptionThrown() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var options = Options.Create(new LtsaOptions() - { - AuthUrl = "https://test.com", - HostUri = "https://host.com/", - IntegratorPassword = "password", - IntegratorUsername = "username", - UserName = "user", - UserPassword = "password" - }); - var service = helper.Create(options, user); - - var accessToken = "testAccessToken"; - var titleNumber = "testTitleNumber"; - var landTitleDistrictCode = "testDistrictCode"; - - var apiUrl = "https://host.com/orders"; - var headers = new HttpRequestMessage().Headers; - headers.Add("Accept", "application/vnd.ltsa.astra.orders+json"); - headers.Add("X-Authorization", $"Bearer {accessToken}"); - - var order = new - { - productType = "title", - fileReference = "Test", - productOrderParameters = new - { - titleNumber, - landTitleDistrictCode, - includeCancelledInfo = false - } - }; - - var requestBody = new - { - order - }; - - var json = JsonSerializer.Serialize(requestBody); - var content = new StringContent(json, Encoding.UTF8, "application/json"); - - var response = new HttpResponseMessage(HttpStatusCode.BadRequest) - { - RequestMessage = new HttpRequestMessage(HttpMethod.Post, "https://host.com/orders") - }; - - var client = helper.GetService>(); - - // Set up the SendAsync method to throw a HttpRequestException - client.Setup(m => m.SendAsync(apiUrl, HttpMethod.Post, It.IsAny(), It.IsAny(), null)) - .ThrowsAsync(new HttpClientRequestException(response)); - client.Setup(m => m.DeserializeAsync(It.IsAny())).ReturnsAsync(new ErrorResponseModel()); - - // Act - - // Assert - var result = await Assert.ThrowsAsync(async () => await service.CreateOrderAsync(accessToken, titleNumber, landTitleDistrictCode)); - // Verify that an LTSAApiException is thrown - Assert.IsAssignableFrom(result); - - // Verify that the SendAsync method was called once with the expected parameters - client.Verify(m => m.SendAsync(apiUrl, HttpMethod.Post, It.IsAny(), It.IsAny(), null), Times.Once); - } - #endregion - } -} diff --git a/backend/tests/unit/dal/Libraries/Notifications/NotificationServiceTest.cs b/backend/tests/unit/dal/Libraries/Notifications/NotificationServiceTest.cs deleted file mode 100644 index 607612dbc0..0000000000 --- a/backend/tests/unit/dal/Libraries/Notifications/NotificationServiceTest.cs +++ /dev/null @@ -1,320 +0,0 @@ -using FluentAssertions; -using Moq; -using Microsoft.Extensions.Options; -using Pims.Ches; -using Pims.Ches.Models; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Entities; -using Pims.Notifications; -using Pims.Notifications.Models; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Xunit; - -namespace Pims.Dal.Test.Libraries.Notifications -{ - [Trait("category", "unit")] - [Trait("category", "notification")] - [Trait("group", "notification")] - [ExcludeFromCodeCoverage] - public class NotificationServiceTest - { - #region Data - public static IEnumerable BadBuild = new List( - new[] { - new object[] { null, new EmailTemplate(), typeof(ArgumentException) }, - new object[] { "", new EmailTemplate(), typeof(ArgumentException) }, - new object[] { " ", new EmailTemplate(), typeof(ArgumentException) }, - new object[] { "key", null, typeof(ArgumentNullException) } - }); - - public static IEnumerable BadSendNotification = new List( - new[] { - new object[] { null, new Email(), typeof(ArgumentException) }, - new object[] { "", new Email(), typeof(ArgumentException) }, - new object[] { " ", new Email(), typeof(ArgumentException) }, - new object[] { "key", null, typeof(ArgumentNullException) } - }); - #endregion - - #region Tests - #region GetTokenAsync - [Fact] - public void GetTokenAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var options = Options.Create(new Pims.Notifications.Configuration.NotificationOptions()); - var service = helper.Create(options); - - var template = new EmailTemplate() - { - Subject = "Test @Model.Id", - Body = "Test @Model.Id" - }; - var model = new { Id = 1 }; - - // Act - service.Build("key", template, model); - - // Assert - template.Subject.Should().Be("Test 1"); - template.Body.Should().Be("Test 1"); - } - - [Theory] - [MemberData(nameof(BadBuild))] - public void GetTokenAsync_ArgumentException(string key, IEmailTemplate template, Type exceptionType) - { - // Arrange - var helper = new TestHelper(); - var options = Options.Create(new Pims.Notifications.Configuration.NotificationOptions()); - var service = helper.Create(options); - var model = new { }; - - // Act - // Assert - Assert.Throws(exceptionType, () => service.Build(key, template, model)); - } - #endregion - - #region SendNotificationAsync - [Fact] - public async void SendNotificationAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var options = Options.Create(new Pims.Notifications.Configuration.NotificationOptions()); - var service = helper.Create(options); - - var email = new Email() - { - From = "from", - To = new[] { "To" }, - Cc = new[] { "Cc" }, - Bcc = new[] { "Bcc" }, - Encoding = Pims.Notifications.Models.EmailEncodings.Utf8, - Priority = Pims.Notifications.Models.EmailPriorities.High, - BodyType = Pims.Notifications.Models.EmailBodyTypes.Html, - Subject = "Test @Model.Id", - Body = "Test @Model.Id", - Tag = "tag", - SendOn = DateTime.UtcNow - }; - var model = new { Id = 1 }; - - var ches = helper.GetMock(); - ches.Setup(m => m.SendEmailAsync(It.IsAny())).ReturnsAsync(new EmailResponseModel()); - - // Act - var result = await service.SendAsync("key", email, model); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - ches.Verify(m => m.SendEmailAsync(It.Is(a => - a.From == email.From - && a.To == email.To - && a.Cc == email.Cc - && a.Bcc == email.Bcc - && a.Encoding == email.Encoding.ConvertTo() - && a.Priority == email.Priority.ConvertTo() - && a.BodyType == email.BodyType.ConvertTo() - && a.Subject == email.Subject - && a.Body == email.Body - && a.Tag == email.Tag - && a.SendOn == email.SendOn)), Times.Once()); - } - - [Theory] - [MemberData(nameof(BadSendNotification))] - public async void SendNotificationAsync_ArgumentException(string key, Pims.Notifications.Models.IEmail email, Type exceptionType) - { - // Arrange - var helper = new TestHelper(); - var service = helper.Create(); - - var model = new { }; - - // Act - // Assert - await Assert.ThrowsAsync(exceptionType, async () => await service.SendAsync(key, email, model)); - } - - [Fact] - public async void SendNotificationAsync_Simple_Success() - { - // Arrange - var helper = new TestHelper(); - var options = Options.Create(new Pims.Notifications.Configuration.NotificationOptions()); - var service = helper.Create(options); - - var email = new Email() - { - From = "from", - To = new[] { "To" }, - Cc = new[] { "Cc" }, - Bcc = new[] { "Bcc" }, - Encoding = Pims.Notifications.Models.EmailEncodings.Utf8, - Priority = Pims.Notifications.Models.EmailPriorities.High, - BodyType = Pims.Notifications.Models.EmailBodyTypes.Html, - Subject = "Test @Model.Id", - Body = "Test @Model.Id", - Tag = "tag", - SendOn = DateTime.UtcNow - }; - var model = new { Id = 1 }; - - var ches = helper.GetService>(); - ches.Setup(m => m.SendEmailAsync(It.IsAny())).ReturnsAsync(new EmailResponseModel()); - - // Act - var result = await service.SendAsync(email); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - ches.Verify(m => m.SendEmailAsync(It.Is(a => - a.From == email.From - && a.To == email.To - && a.Cc == email.Cc - && a.Bcc == email.Bcc - && a.Encoding == email.Encoding.ConvertTo() - && a.Priority == email.Priority.ConvertTo() - && a.BodyType == email.BodyType.ConvertTo() - && a.Subject == email.Subject - && a.Body == email.Body - && a.Tag == email.Tag - && a.SendOn == email.SendOn)), Times.Once()); - } - - [Fact] - public async void SendNotificationAsync_Simple_ArgumentException() - { - // Arrange - var helper = new TestHelper(); - var service = helper.Create(); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.SendAsync((NotificationQueue)null)); - } - #endregion - - #region SendNotificationsAsync - [Fact] - public async void SendNotificationsAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var options = Options.Create(new Pims.Notifications.Configuration.NotificationOptions()); - var service = helper.Create(options); - - var email = new Email() - { - From = "from", - To = new[] { "To" }, - Cc = new[] { "Cc" }, - Bcc = new[] { "Bcc" }, - Encoding = Pims.Notifications.Models.EmailEncodings.Utf8, - Priority = Pims.Notifications.Models.EmailPriorities.High, - BodyType = Pims.Notifications.Models.EmailBodyTypes.Html, - Subject = "Test @Model.Id", - Body = "Test @Model.Id", - Tag = "tag", - SendOn = DateTime.UtcNow - }; - var emails = new[] { email }; - var model = new { Id = 1 }; - - var ches = helper.GetService>(); - ches.Setup(m => m.SendEmailAsync(It.IsAny())).ReturnsAsync(new EmailResponseModel()); - - // Act - var result = await service.SendAsync(emails); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - ches.Verify(m => m.SendEmailAsync(It.Is(a => - a.From == email.From - && a.Encoding == email.Encoding.ConvertTo() - && a.Priority == email.Priority.ConvertTo() - && a.BodyType == email.BodyType.ConvertTo() - && a.Subject == "{{ subject }}" - && a.Body == "{{ body }}" - && a.Contexts.First().To == email.To - && a.Contexts.First().Cc == email.Cc - && a.Contexts.First().Bcc == email.Bcc - && a.Contexts.First().Context != null - && a.Contexts.First().Context.GetType().IsAnonymousType() - && a.Contexts.First().Tag == email.Tag - && a.Contexts.First().SendOn == email.SendOn)), Times.Once()); - } - - [Fact] - public async void SendNotificationsAsync_Multiple_ArgumentException() - { - // Arrange - var helper = new TestHelper(); - var service = helper.Create(); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.SendAsync((NotificationQueue)null)); - } - #endregion - - #region GetStatusAsync - [Fact] - public async void GetStatusAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var options = Options.Create(new Pims.Notifications.Configuration.NotificationOptions()); - var service = helper.Create(options); - - var messageId = Guid.NewGuid(); - - var ches = helper.GetService>(); - ches.Setup(m => m.GetStatusAsync(It.IsAny())).ReturnsAsync(new StatusResponseModel()); - - // Act - var result = await service.GetStatusAsync(messageId); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - ches.Verify(m => m.GetStatusAsync(messageId), Times.Once()); - } - #endregion - - #region CancelNotificationAsync - [Fact] - public async void CancelNotificationAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var options = Options.Create(new Pims.Notifications.Configuration.NotificationOptions()); - var service = helper.Create(options); - - var messageId = Guid.NewGuid(); - - var ches = helper.GetService>(); - ches.Setup(m => m.CancelEmailAsync(It.IsAny())).ReturnsAsync(new StatusResponseModel()); - - // Act - var result = await service.CancelAsync(messageId); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - ches.Verify(m => m.CancelEmailAsync(messageId), Times.Once()); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Migrations/MigrationTest.cs b/backend/tests/unit/dal/Migrations/MigrationTest.cs deleted file mode 100644 index 62651e7f89..0000000000 --- a/backend/tests/unit/dal/Migrations/MigrationTest.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Pims.Dal.Helpers.Migrations; -using Pims.Dal.Migrations; -using System.Diagnostics.CodeAnalysis; -using Xunit; - -namespace Pims.Dal.Test.Migrations -{ - [Trait("category", "unit")] - [Trait("category", "dal")] - [Trait("group", "migration")] - [ExcludeFromCodeCoverage] - public class MigrationTest - { - #region Constructors - public MigrationTest() { } - #endregion - - #region Tests - /// - /// Ensure the first migration is called 'Initial'. - /// - [Fact] - public void InitialMigration() - { - // Arrange - var initial = new Initial(); - - // Act - // Assert - Assert.NotNull(initial); - Assert.IsAssignableFrom(initial); - } - #endregion - } -} diff --git a/backend/tests/unit/dal/Pims.Dal.Test.csproj b/backend/tests/unit/dal/Pims.Dal.Test.csproj deleted file mode 100644 index 06c47b0002..0000000000 --- a/backend/tests/unit/dal/Pims.Dal.Test.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - net7.0 - false - 412BF533-2759-4FBE-B4C6-B89DB44FB6B5 - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - diff --git a/backend/tests/unit/dal/Services/Admin/BuildingServiceTest.cs b/backend/tests/unit/dal/Services/Admin/BuildingServiceTest.cs deleted file mode 100644 index 30745f80e4..0000000000 --- a/backend/tests/unit/dal/Services/Admin/BuildingServiceTest.cs +++ /dev/null @@ -1,782 +0,0 @@ -using FluentAssertions; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Options; -using Pims.Core.Comparers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using Pims.Dal.Exceptions; -using Pims.Dal.Security; -using Pims.Dal.Services.Admin; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Dal.Test.Services.Admin -{ - [Trait("category", "unit")] - [Trait("category", "dal")] - [Trait("area", "admin")] - [Trait("group", "building")] - [ExcludeFromCodeCoverage] - public class BuildingServiceTest - { - #region Constructors - public BuildingServiceTest() { } - #endregion - - #region Tests - #region Get Buildings - /// - /// User does not have 'property-view' claim. - /// - [Fact] - public void Get_Buildings_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - var filter = new BuildingFilter(50, 25, 50, 20); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Get(1, 10, null)); - } - - [Fact] - public void Get_Buildings() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(21); - var buildings = init.CreateBuildings(parcel, 1, 20); - buildings.Next(0).Location.Y = 50; - buildings.Next(0).Location.X = 25; - buildings.Next(1).Agency = init.Agencies.Find(3); - buildings.Next(1).AgencyId = 3; - buildings.Next(2).ClassificationId = 2; - buildings.Next(3).Description = "-DescriptionTest-"; - buildings.Next(5).ProjectNumbers = "[\"ProjectNumber\"]"; - init.SaveChanges(); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - var result = service.Get(1, 10, null); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - Assert.Equal(10, result.Items.Count()); - } - #endregion - - #region Get Building - /// - /// User does not have 'property-view' claim. - /// - [Fact] - public void Get_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - init.AddAndSaveChanges(building); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - // Assert - Assert.Throws(() => - service.Get(1)); - } - - /// - /// Building does not exist. - /// - [Fact] - public void Get_KeyNotFound() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - init.AddAndSaveChanges(building); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Get(12)); - } - - /// - /// Building found. - /// - [Fact] - public void Get() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - init.AddAndSaveChanges(building); - - var service = helper.CreateService(user); - - // Act - var result = service.Get(2); - - // Assert - Assert.NotNull(result); - Assert.Equal(building, result, new ShallowPropertyCompare()); - } - - /// - /// Buildings found using PID. - /// - [Fact] - public void GetByName() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2, null, "test building"); - var building2 = init.CreateBuilding(parcel, 3, null, "test building"); - init.AddAndSaveChanges(building, building2); - - var service = helper.CreateService(user); - - // Act - var results = service.GetByName(building.Name).ToList(); - - // Assert - Assert.NotNull(results); - Assert.NotEmpty(results); - Assert.Collection(results, - item => Assert.Equal(building.Name.ToString(), item.Name.ToString()), - item => Assert.Equal(building2.Name.ToString(), item.Name.ToString())); - } - - /// - /// Buildings found using PID. - /// - [Fact] - public void GetByPid() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - var building2 = init.CreateBuilding(parcel, 3); - init.AddAndSaveChanges(building, building2); - - var service = helper.CreateService(user); - - // Act - var results = service.GetByPid(parcel.PID).ToList(); - - // Assert - Assert.NotNull(results); - Assert.NotEmpty(results); - Assert.Collection(results, - item => Assert.Equal(building.Address.ToString(), item.Address.ToString()), - item => Assert.Equal(building2.Address.ToString(), item.Address.ToString())); - } - - /// - /// Buildings found using PID and building name - /// - [Fact] - public void GetByPidWithoutTracking() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2, null, "test building"); - var building2 = init.CreateBuilding(parcel, 3, null, "test building"); - init.AddAndSaveChanges(building, building2); - - var service = helper.CreateService(user); - - // Act - var results = service.GetByPidWithoutTracking(parcel.PID, building.Name); - - // Assert - Assert.NotNull(results); - Assert.NotEmpty(results); - Assert.Collection(results, - item => Assert.Equal(building.Address.ToString(), item.Address.ToString()), - item => Assert.Equal(building2.Address.ToString(), item.Address.ToString())); - } - - /// - /// Buildings found using PID and building name where pid is defined - /// - [Fact] - public void GetByPidNameWithoutTracking_WithPID() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2, null, "test building"); - var building2 = init.CreateBuilding(parcel, 3, null, "test building"); - init.AddAndSaveChanges(building, building2); - - var service = helper.CreateService(user); - - // Act - var results = service.GetByPidNameWithoutTracking(parcel.PID, building.Name); - - // Assert - Assert.NotNull(results); - Assert.NotEmpty(results); - Assert.Collection(results, - item => Assert.Equal(building.Address.ToString(), item.Address.ToString()), - item => Assert.Equal(building2.Address.ToString(), item.Address.ToString())); - } - - /// - /// Buildings found using PID and building name where pid is 0 (not defined) - /// - [Fact] - public void GetByPidNameWithoutTracking_WithoutPID() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(0); - var building = init.CreateBuilding(parcel, 2, null, "test building"); - var building2 = init.CreateBuilding(parcel, 3, null, "test building"); - init.AddAndSaveChanges(building, building2); - - var service = helper.CreateService(user); - - // Act - var results = service.GetByPidNameWithoutTracking(parcel.PID, building.Name); - - // Assert - Assert.NotNull(results); - Assert.Empty(results); - } - - /// - /// Buildings found using PID and building name - /// - [Fact] - public void GetByNameAddressWithoutTracking() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2, null, "test building"); - var building2 = init.CreateBuilding(parcel, 3, null, "test building"); - init.AddAndSaveChanges(building, building2); - - var service = helper.CreateService(user); - - // Act - var results = service.GetByNameAddressWithoutTracking(building.Name, building.Address.Address1); - - // Assert - Assert.NotNull(results); - Assert.NotEmpty(results); - Assert.Collection(results, - item => Assert.Equal(building.Address.ToString(), item.Address.ToString()), - item => Assert.Equal(building2.Address.ToString(), item.Address.ToString())); - Assert.Collection(results, - item => Assert.Equal(building.Parcels.First().ParcelId, item.Parcels.First().ParcelId), - item => Assert.Equal(building2.Parcels.First().ParcelId, item.Parcels.First().ParcelId)); - } - - /// - /// Sensitive building found. - /// - [Fact] - public void Get_Sensitive() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin, Permissions.SensitiveView).AddAgency(1); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - building.IsSensitive = true; - init.AddAndSaveChanges(building); - - var service = helper.CreateService(user); - - // Act - var result = service.Get(2); - - // Assert - Assert.NotNull(result); - Assert.Equal(building, result, new ShallowPropertyCompare()); - Assert.True(result.IsSensitive); - } - #endregion - - #region Delete Building - /// - /// Argument cannot be null. - /// - [Fact] - public void Remove_ArgumentNull() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - init.AddAndSaveChanges(building); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Remove(null)); - } - - /// - /// User does not have 'property-delete' claim. - /// - [Fact] - public void Remove_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - init.AddAndSaveChanges(building); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Remove(building)); - } - - /// - /// Building does not exist. - /// - [Fact] - public void Remove_KeyNotFound() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin, Permissions.PropertyDelete, Permissions.AdminProperties); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - var find = EntityHelper.CreateBuilding(parcel, 3); - init.AddAndSaveChanges(building); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Remove(find)); - } - - /// - /// Building found. - /// - [Fact] - public void Remove_SystemAdmin() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin, Permissions.PropertyDelete, Permissions.AdminProperties).AddAgency(1); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - init.AddAndSaveChanges(building); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - service.Remove(building); - - // Assert - Assert.Equal(EntityState.Detached, context.Entry(building).State); - } - - /// - /// Sensitive building found. - /// - [Fact] - public void Remove_Sensitive() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin, Permissions.PropertyDelete, Permissions.AdminProperties).AddAgency(1); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - building.IsSensitive = true; - init.AddAndSaveChanges(building); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - service.Remove(building); - - // Assert - Assert.Equal(EntityState.Detached, context.Entry(building).State); - Assert.True(building.IsSensitive); - } - #endregion - - #region Update Building - [Fact] - public void UpdateBuilding_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - init.AddAndSaveChanges(building); - - var options = Options.Create(new PimsOptions()); - var service = helper.CreateService(options); - - var updateBuilding = EntityHelper.CreateBuilding(parcel, 2); - var newName = "testing name is updated"; - updateBuilding.Name = newName; - - // Act - service.Update(updateBuilding); - - // Assert - building.Name.Should().Be(newName); - } - - [Fact] - public void UpdateBuildingWithNewFiscals_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - init.AddAndSaveChanges(building); - - var options = Options.Create(new PimsOptions()); - var service = helper.CreateService(options); - - var updateBuilding = EntityHelper.CreateBuilding(parcel, 2); - var newName = "testing name is updated"; - EntityHelper.CreateFiscals(updateBuilding, new[] { 2018, 2019 }, Entity.FiscalKeys.NetBook, 5000); - updateBuilding.Name = newName; - - // Act - service.Update(updateBuilding); - - // Assert - building.Name.Should().Be(newName); - building.Fiscals.Should().HaveCount(2); - building.Fiscals.Sum(f => f.Value).Should().Be(10000); - } - - [Fact] - public void UpdateBuildingWithFiscals_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - init.CreateFiscals(building, new[] { 2017, 2018 }, Entity.FiscalKeys.NetBook, 2000); - init.AddAndSaveChanges(building); - - var options = Options.Create(new PimsOptions()); - var service = helper.CreateService(options); - - var updateBuilding = EntityHelper.CreateBuilding(parcel, 2); - var newName = "testing name is updated"; - EntityHelper.CreateFiscals(updateBuilding, new[] { 2018, 2019 }, Entity.FiscalKeys.NetBook, 5000); - updateBuilding.Name = newName; - - // Act - service.Update(updateBuilding); - - // Assert - building.Name.Should().Be(newName); - building.Fiscals.Should().HaveCount(3); - building.Fiscals.Sum(f => f.Value).Should().Be(9000); - } - - [Fact] - public void UpdateBuildingWithNewEvaluations_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - init.AddAndSaveChanges(building); - - var options = Options.Create(new PimsOptions()); - var service = helper.CreateService(options); - - var updateBuilding = EntityHelper.CreateBuilding(parcel, 2); - var newName = "testing name is updated"; - EntityHelper.CreateEvaluations(updateBuilding, new DateTime(2018, 1, 1), 2, Entity.EvaluationKeys.Assessed, 5000); - updateBuilding.Name = newName; - - // Act - service.Update(updateBuilding); - - // Assert - building.Name.Should().Be(newName); - building.Evaluations.Should().HaveCount(2); - building.Evaluations.Sum(f => f.Value).Should().Be(10000); - } - - [Fact] - public void UpdateBuildingWithEvaluations_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - init.CreateEvaluations(building, new DateTime(2017, 1, 1), 2, Entity.EvaluationKeys.Assessed, 2000); - init.AddAndSaveChanges(building); - - var options = Options.Create(new PimsOptions()); - var service = helper.CreateService(options); - - var updateBuilding = EntityHelper.CreateBuilding(parcel, 2); - var newName = "testing name is updated"; - EntityHelper.CreateEvaluations(updateBuilding, new DateTime(2018, 1, 1), 2, Entity.EvaluationKeys.Assessed, 5000); - updateBuilding.Name = newName; - - // Act - service.Update(updateBuilding); - - // Assert - building.Name.Should().Be(newName); - building.Evaluations.Should().HaveCount(3); - building.Evaluations.Sum(f => f.Value).Should().Be(9000); - } - #endregion - - #region Update Building Financials - [Fact] - public void UpdateBuildingFinancials_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - var originalName = "original"; - building.Name = originalName; - init.AddAndSaveChanges(building); - - var service = helper.CreateService(); - - var updateBuilding = EntityHelper.CreateBuilding(parcel, 2); - var newName = "testing name is updated"; - updateBuilding.Name = newName; - - // Act - service.UpdateFinancials(updateBuilding); - - // Assert - building.Name.Should().Be(originalName); - } - - [Fact] - public void UpdateBuildingFinancialsWithNewFiscals_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - var originalName = "original"; - building.Name = originalName; - init.AddAndSaveChanges(building); - - var service = helper.CreateService(); - - var updateBuilding = EntityHelper.CreateBuilding(parcel, 2); - var newName = "testing name is updated"; - EntityHelper.CreateFiscals(updateBuilding, new[] { 2018, 2019 }, Entity.FiscalKeys.NetBook, 5000); - updateBuilding.Name = newName; - - // Act - service.UpdateFinancials(updateBuilding); - - // Assert - building.Name.Should().Be(originalName); - building.Fiscals.Should().HaveCount(2); - building.Fiscals.Sum(f => f.Value).Should().Be(10000); - } - - [Fact] - public void UpdateBuildingFinancialsWithFiscals_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - var originalName = "original"; - building.Name = originalName; - init.CreateFiscals(building, new[] { 2017, 2018 }, Entity.FiscalKeys.NetBook, 2000); - init.AddAndSaveChanges(building); - - var service = helper.CreateService(); - - var updateBuilding = EntityHelper.CreateBuilding(parcel, 2); - var newName = "testing name is updated"; - EntityHelper.CreateFiscals(updateBuilding, new[] { 2018, 2019 }, Entity.FiscalKeys.NetBook, 5000); - updateBuilding.Name = newName; - - // Act - service.UpdateFinancials(updateBuilding); - - // Assert - building.Name.Should().Be(originalName); - building.Fiscals.Should().HaveCount(3); - building.Fiscals.Sum(f => f.Value).Should().Be(9000); - } - - [Fact] - public void UpdateBuildingFinancialsWithNewEvaluations_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - var originalName = "original"; - building.Name = originalName; - init.AddAndSaveChanges(building); - - var service = helper.CreateService(); - - var updateBuilding = EntityHelper.CreateBuilding(parcel, 2); - var newName = "testing name is updated"; - EntityHelper.CreateEvaluations(updateBuilding, new DateTime(2018, 1, 1), 2, Entity.EvaluationKeys.Assessed, 5000); - updateBuilding.Name = newName; - - // Act - service.UpdateFinancials(updateBuilding); - - // Assert - building.Name.Should().Be(originalName); - building.Evaluations.Should().HaveCount(2); - building.Evaluations.Sum(f => f.Value).Should().Be(10000); - } - - [Fact] - public void UpdateBuildingFinancialsWithEvaluations_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - var originalName = "original"; - building.Name = originalName; - init.CreateEvaluations(building, new DateTime(2017, 1, 1), 2, Entity.EvaluationKeys.Assessed, 2000); - init.AddAndSaveChanges(building); - - var service = helper.CreateService(); - - var updateBuilding = EntityHelper.CreateBuilding(parcel, 2); - var newName = "testing name is updated"; - EntityHelper.CreateEvaluations(updateBuilding, new DateTime(2018, 1, 1), 2, Entity.EvaluationKeys.Assessed, 5000); - updateBuilding.Name = newName; - - // Act - service.UpdateFinancials(updateBuilding); - - // Assert - building.Name.Should().Be(originalName); - building.Evaluations.Should().HaveCount(3); - building.Evaluations.Sum(f => f.Value).Should().Be(9000); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Services/Admin/ParcelServiceTest.cs b/backend/tests/unit/dal/Services/Admin/ParcelServiceTest.cs deleted file mode 100644 index 069b13e074..0000000000 --- a/backend/tests/unit/dal/Services/Admin/ParcelServiceTest.cs +++ /dev/null @@ -1,588 +0,0 @@ -using FluentAssertions; -using Microsoft.EntityFrameworkCore; -using Pims.Core.Comparers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Entities.Models; -using Pims.Dal.Exceptions; -using Pims.Dal.Security; -using Pims.Dal.Services.Admin; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Dal.Test.Services.Admin -{ - [Trait("category", "unit")] - [Trait("category", "dal")] - [Trait("area", "admin")] - [Trait("group", "parcel")] - [ExcludeFromCodeCoverage] - public class ParcelServiceTest - { - #region Data - public static IEnumerable ParcelFilterData => - new List - { - new object[] { new ParcelFilter(48.571155, -123.657596, 48.492947, -123.731803), 1 }, - new object[] { new ParcelFilter(48.821333, -123.795017, 48.763431, -123.959783), 0 }, - new object[] { new ParcelFilter() { Agencies = new int[] { 3 } }, 1 }, - new object[] { new ParcelFilter() { ClassificationId = 2 }, 1 }, - new object[] { new ParcelFilter() { Description = "DescriptionTest" }, 1 }, - new object[] { new ParcelFilter() { AdministrativeArea = "AdministrativeArea" }, 1 }, - new object[] { new ParcelFilter() { ProjectNumber = "ProjectNumber" }, 1 }, - new object[] { new ParcelFilter() { Zoning = "Zoning" }, 1 }, - new object[] { new ParcelFilter() { ZoningPotential = "ZoningPotential" }, 1 } - }; - #endregion - - #region Constructors - public ParcelServiceTest() { } - #endregion - - #region Tests - #region Get Parcels - /// - /// User does not have 'property-view' claim. - /// - [Fact] - public void Get_Parcels_ArgumentNullException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Get(null)); - } - - /// - /// User does not have 'property-view' claim. - /// - [Fact] - public void Get_Parcels_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - var filter = new ParcelFilter(50, 25, 50, 20); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Get(filter)); - } - - [Theory] - [MemberData(nameof(ParcelFilterData))] - public void Get_Parcels(ParcelFilter filter, int expectedCount) - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - using var init = helper.InitializeDatabase(user); - var parcels = init.CreateParcels(1, 20); - parcels.Next(0).Location.X = -123.720810; - parcels.Next(0).Location.Y = 48.529338; - parcels.Next(1).Agency = init.Agencies.Find(3); - parcels.Next(1).AgencyId = 3; - parcels.Next(2).ClassificationId = 2; - parcels.Next(3).Description = "-DescriptionTest-"; - parcels.Next(4).Address.AdministrativeArea = "-AdministrativeArea-"; - parcels.Next(5).ProjectNumbers = "[\"ProjectNumber\"]"; - parcels.Next(6).Zoning = "-Zoning-"; - parcels.Next(7).ZoningPotential = "-ZoningPotential-"; - init.SaveChanges(); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - var result = service.Get(filter); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - Assert.Equal(expectedCount, result.Items.Count()); - } - #endregion - - #region Get Parcel - /// - /// User does not have 'property-view' claim. - /// - [Fact] - public void Get_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - // Assert - Assert.Throws(() => - service.Get(1)); - } - - /// - /// Parcel does not exist. - /// - [Fact] - public void Get_KeyNotFound() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - var parcel = EntityHelper.CreateParcel(2, 1, 1, 1); - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - // Assert - Assert.Throws(() => - service.Get(1)); - } - - /// - /// Parcel found. - /// - [Fact] - public void Get() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - var result = service.Get(1); - - // Assert - Assert.NotNull(result); - Assert.Equal(EntityState.Detached, context.Entry(result).State); - Assert.Equal(parcel, result, new ShallowPropertyCompare()); - } - - /// - /// Sensitive parcel found. - /// - [Fact] - public void Get_Sensitive() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin, Permissions.SensitiveView).AddAgency(1); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - parcel.IsSensitive = true; - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - var result = service.Get(1); - - // Assert - Assert.NotNull(result); - Assert.Equal(EntityState.Detached, context.Entry(result).State); - Assert.Equal(parcel, result, new ShallowPropertyCompare()); - Assert.True(result.IsSensitive); - } - #endregion - - #region Delete Parcel - /// - /// Argument cannot be null. - /// - [Fact] - public void Remove_ArgumentNull() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - // Assert - Assert.Throws(() => - service.Remove(null)); - } - - /// - /// User does not have 'property-delete' claim. - /// - [Fact] - public void Remove_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - // Assert - Assert.Throws(() => - service.Remove(parcel)); - } - - /// - /// Parcel does not exist. - /// - [Fact] - public void Remove_KeyNotFound() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin, Permissions.PropertyDelete, Permissions.AdminProperties); - var find = EntityHelper.CreateParcel(1, 1, 1, 1); - var parcel = EntityHelper.CreateParcel(2, 1, 1, 1); - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - // Assert - Assert.Throws(() => - service.Remove(find)); - } - - /// - /// Parcel found. - /// - [Fact] - public void Remove_SystemAdmin() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin, Permissions.PropertyDelete, Permissions.AdminProperties).AddAgency(1); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - service.Remove(parcel); - - // Assert - Assert.Equal(EntityState.Detached, context.Entry(parcel).State); - } - - /// - /// Sensitive parcel found. - /// - [Fact] - public void Remove_Sensitive() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin, Permissions.PropertyDelete, Permissions.AdminProperties).AddAgency(1); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - parcel.IsSensitive = true; - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - service.Remove(parcel); - - // Assert - Assert.Equal(EntityState.Detached, context.Entry(parcel).State); - Assert.True(parcel.IsSensitive); - } - #endregion - - #region Update Parcel - [Fact] - public void UpdateParcel_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(); - - var updateParcel = EntityHelper.CreateParcel(1, 1, 1, 1); - var newName = "testing name is updated"; - updateParcel.Name = newName; - - // Act - service.Update(updateParcel); - - // Assert - parcel.Name.Should().Be(newName); - } - - [Fact] - public void UpdateParcelWithNewFiscals_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(); - - var updateParcel = EntityHelper.CreateParcel(1, 1, 1, 1); - var newName = "testing name is updated"; - EntityHelper.CreateFiscals(updateParcel, new[] { 2018, 2019 }, Entity.FiscalKeys.NetBook, 5000); - updateParcel.Name = newName; - - // Act - service.Update(updateParcel); - - // Assert - parcel.Name.Should().Be(newName); - parcel.Fiscals.Should().HaveCount(2); - parcel.Fiscals.Sum(f => f.Value).Should().Be(10000); - } - - [Fact] - public void UpdateParcelWithFiscals_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - EntityHelper.CreateFiscals(parcel, new[] { 2017, 2018 }, Entity.FiscalKeys.NetBook, 2000); - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(); - - var updateParcel = EntityHelper.CreateParcel(1, 1, 1, 1); - var newName = "testing name is updated"; - EntityHelper.CreateFiscals(updateParcel, new[] { 2018, 2019 }, Entity.FiscalKeys.NetBook, 5000); - updateParcel.Name = newName; - - // Act - service.Update(updateParcel); - - // Assert - parcel.Name.Should().Be(newName); - parcel.Fiscals.Should().HaveCount(3); - parcel.Fiscals.Sum(f => f.Value).Should().Be(9000); - } - - [Fact] - public void UpdateParcelWithNewEvaluations_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(); - - var updateParcel = EntityHelper.CreateParcel(1, 1, 1, 1); - var newName = "testing name is updated"; - EntityHelper.CreateEvaluations(updateParcel, new DateTime(2018, 1, 1), 2, Entity.EvaluationKeys.Assessed, 5000); - updateParcel.Name = newName; - - // Act - service.Update(updateParcel); - - // Assert - parcel.Name.Should().Be(newName); - parcel.Evaluations.Should().HaveCount(2); - parcel.Evaluations.Sum(f => f.Value).Should().Be(10000); - } - - [Fact] - public void UpdateParcelWithEvaluations_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - EntityHelper.CreateEvaluations(parcel, new DateTime(2017, 1, 1), 2, Entity.EvaluationKeys.Assessed, 2000); - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(); - - var updateParcel = EntityHelper.CreateParcel(1, 1, 1, 1); - var newName = "testing name is updated"; - EntityHelper.CreateEvaluations(updateParcel, new DateTime(2018, 1, 1), 2, Entity.EvaluationKeys.Assessed, 5000); - updateParcel.Name = newName; - - // Act - service.Update(updateParcel); - - // Assert - parcel.Name.Should().Be(newName); - parcel.Evaluations.Should().HaveCount(3); - parcel.Evaluations.Sum(f => f.Value).Should().Be(9000); - } - #endregion - - #region Update Parcel Financials - [Fact] - public void UpdateParcelFinancials_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - var originalName = "original"; - parcel.Name = originalName; - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(); - - var updateParcel = EntityHelper.CreateParcel(1, 1, 1, 1); - var newName = "testing name is updated"; - updateParcel.Name = newName; - - // Act - service.UpdateFinancials(updateParcel); - - // Assert - parcel.Name.Should().Be(originalName); - } - - [Fact] - public void UpdateParcelFinancialsWithNewFiscals_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - var originalName = "original"; - parcel.Name = originalName; - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(); - - var updateParcel = EntityHelper.CreateParcel(1, 1, 1, 1); - var newName = "testing name is updated"; - EntityHelper.CreateFiscals(updateParcel, new[] { 2018, 2019 }, Entity.FiscalKeys.NetBook, 5000); - updateParcel.Name = newName; - - // Act - service.UpdateFinancials(updateParcel); - - // Assert - parcel.Name.Should().Be(originalName); - parcel.Fiscals.Should().HaveCount(2); - parcel.Fiscals.Sum(f => f.Value).Should().Be(10000); - } - - [Fact] - public void UpdateParcelFinancialsWithFiscals_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - var originalName = "original"; - parcel.Name = originalName; - EntityHelper.CreateFiscals(parcel, new[] { 2017, 2018 }, Entity.FiscalKeys.NetBook, 2000); - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(); - - var updateParcel = EntityHelper.CreateParcel(1, 1, 1, 1); - var newName = "testing name is updated"; - EntityHelper.CreateFiscals(updateParcel, new[] { 2018, 2019 }, Entity.FiscalKeys.NetBook, 5000); - updateParcel.Name = newName; - - // Act - service.UpdateFinancials(updateParcel); - - // Assert - parcel.Name.Should().Be(originalName); - parcel.Fiscals.Should().HaveCount(3); - parcel.Fiscals.Sum(f => f.Value).Should().Be(9000); - } - - [Fact] - public void UpdateParcelFinancialsWithNewEvaluations_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - var originalName = "original"; - parcel.Name = originalName; - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(); - - var updateParcel = EntityHelper.CreateParcel(1, 1, 1, 1); - var newName = "testing name is updated"; - EntityHelper.CreateEvaluations(updateParcel, new DateTime(2018, 1, 1), 2, Entity.EvaluationKeys.Assessed, 5000); - updateParcel.Name = newName; - - // Act - service.UpdateFinancials(updateParcel); - - // Assert - parcel.Name.Should().Be(originalName); - parcel.Evaluations.Should().HaveCount(2); - parcel.Evaluations.Sum(f => f.Value).Should().Be(10000); - } - - [Fact] - public void UpdateParcelFinancialsWithEvaluations_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - var originalName = "original"; - parcel.Name = originalName; - EntityHelper.CreateEvaluations(parcel, new DateTime(2017, 1, 1), 2, Entity.EvaluationKeys.Assessed, 2000); - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(); - - var updateParcel = EntityHelper.CreateParcel(1, 1, 1, 1); - var newName = "testing name is updated"; - EntityHelper.CreateEvaluations(updateParcel, new DateTime(2018, 1, 1), 2, Entity.EvaluationKeys.Assessed, 5000); - updateParcel.Name = newName; - - // Act - service.UpdateFinancials(updateParcel); - - // Assert - parcel.Name.Should().Be(originalName); - parcel.Evaluations.Should().HaveCount(3); - parcel.Evaluations.Sum(f => f.Value).Should().Be(9000); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Services/BuildingServiceTest.cs b/backend/tests/unit/dal/Services/BuildingServiceTest.cs deleted file mode 100644 index f2c648f269..0000000000 --- a/backend/tests/unit/dal/Services/BuildingServiceTest.cs +++ /dev/null @@ -1,836 +0,0 @@ -using FluentAssertions; -using MapsterMapper; -using Microsoft.EntityFrameworkCore; -using Moq; -using Pims.Core.Comparers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Entities.Models; -using Pims.Dal.Exceptions; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using Pims.Dal.Services; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Entity = Pims.Dal.Entities; -using Model = Pims.Api.Models.User; - -namespace Pims.Dal.Test.Services -{ - [Trait("category", "unit")] - [Trait("category", "dal")] - [Trait("group", "building")] - [ExcludeFromCodeCoverage] - public class BuildingServiceTest - { - #region Data - public static IEnumerable BuildingFilters => - new List - { - new object[] { new BuildingFilter(48.571155, -123.657596, 48.492947, -123.731803), 1 }, - new object[] { new BuildingFilter(48.821333, -123.795017, 48.763431, -123.959783), 0 }, - //new object[] { new BuildingFilter() { Agencies = new int[] { 3 } }, 10 }, - new object[] { new BuildingFilter() { ClassificationId = 2 }, 1 }, - new object[] { new BuildingFilter() { Description = "DescriptionTest" }, 1 }, - new object[] { new BuildingFilter() { Tenancy = "BuildingTenancy" }, 1 }, - new object[] { new BuildingFilter() { AdministrativeArea = "AdministrativeArea" }, 5 }, - new object[] { new BuildingFilter() { ConstructionTypeId = 2 }, 1 }, - new object[] { new BuildingFilter() { PredominateUseId = 2 }, 1 }, - new object[] { new BuildingFilter() { MinRentableArea = 100 }, 1 }, - new object[] { new BuildingFilter() { MinRentableArea = 50, MaxRentableArea = 50 }, 1 } - }; - #endregion - - #region Constructors - public BuildingServiceTest() { } - #endregion - - #region Tests - #region Get Buildings - /// - /// User does not have 'property-view' claim. - /// - [Fact] - public void Get_Buildings_ArgumentNullException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView); - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Get(null)); - } - - /// - /// User does not have 'property-view' claim. - /// - [Fact] - public void Get_Buildings_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - var filter = new BuildingFilter(50, 25, 50, 20); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Get(filter)); - } - - [Theory] - [MemberData(nameof(BuildingFilters))] - public void Get_Buildings(BuildingFilter filter, int expectedCount) - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView).AddAgency(1, 3); - - using var init = helper.InitializeDatabase(user); - var parcel1 = init.CreateParcel(1); - var buildings = init.CreateBuildings(parcel1, 2, 20); - buildings.Next(0).Location.X = -123.720810; - buildings.Next(0).Location.Y = 48.529338; - buildings.Next(1).Agency = init.Agencies.Find(3); - buildings.Next(1).AgencyId = 3; - buildings.Next(2).ClassificationId = 2; - buildings.Next(3).Description = "-DescriptionTest-"; - buildings.Next(4).BuildingTenancy = "-BuildingTenancy-"; - buildings.Next(5).BuildingConstructionTypeId = 2; - buildings.Next(6).BuildingPredominateUseId = 2; - buildings.Next(7).RentableArea = 100; - buildings.Next(8).RentableArea = 50; - - var parcel2 = init.CreateParcel(22); - parcel2.Address.AdministrativeArea = "-AdministrativeArea-"; - init.CreateBuildings(parcel2, 23, 5); - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - var result = service.Get(filter); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - result.Should().HaveCount(expectedCount); - } - - [Fact] - public void Get_Buildings_OnlyAgencies() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView).AddAgency(3); - - using var init = helper.InitializeDatabase(user); - var parcel1 = init.CreateParcel(1); - var buildings = init.CreateBuildings(parcel1, 2, 20); - buildings.Next(0).Location.X = -123.720810; - buildings.Next(0).Location.Y = 48.529338; - buildings.Next(1).Agency = init.Agencies.Find(3); - buildings.Next(1).AgencyId = 3; - buildings.Next(2).ClassificationId = 2; - buildings.Next(3).Description = "-DescriptionTest-"; - buildings.Next(4).BuildingTenancy = "-BuildingTenancy-"; - buildings.Next(5).BuildingConstructionTypeId = 2; - buildings.Next(6).BuildingPredominateUseId = 2; - buildings.Next(7).RentableArea = 100; - buildings.Next(8).RentableArea = 50; - - var parcel2 = init.CreateParcel(22); - parcel2.Address.AdministrativeArea = "-AdministrativeArea-"; - init.CreateBuildings(parcel2, 23, 5); - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - var result = service.Get(new BuildingFilter()); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - result.Should().HaveCount(25); - } - - [Theory] - [MemberData(nameof(BuildingFilters))] - public void Get_Buildings_AsAdmin(BuildingFilter filter, int expectedCount) - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.AdminProperties); - - using var init = helper.InitializeDatabase(user); - var parcel1 = init.CreateParcel(1); - var buildings = init.CreateBuildings(parcel1, 2, 20); - buildings.Next(0).Location.X = -123.720810; - buildings.Next(0).Location.Y = 48.529338; - buildings.Next(1).Agency = init.Agencies.Find(3); - buildings.Next(1).AgencyId = 3; - buildings.Next(2).ClassificationId = 2; - buildings.Next(3).Description = "-DescriptionTest-"; - buildings.Next(4).BuildingTenancy = "-BuildingTenancy-"; - buildings.Next(5).BuildingConstructionTypeId = 2; - buildings.Next(6).BuildingPredominateUseId = 2; - buildings.Next(7).RentableArea = 100; - buildings.Next(8).RentableArea = 50; - - var parcel2 = init.CreateParcel(22); - parcel2.Address.AdministrativeArea = "-AdministrativeArea-"; - init.CreateBuildings(parcel2, 23, 5); - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - var result = service.Get(filter); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - result.Should().HaveCount(expectedCount); - } - - [Fact] - public void Get_Buildings_AsAdmin_AllAgencies() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.AdminProperties); - - using var init = helper.InitializeDatabase(user); - var parcel1 = init.CreateParcel(1); - var buildings = init.CreateBuildings(parcel1, 2, 20); - buildings.Next(0).Location.X = -123.720810; - buildings.Next(0).Location.Y = 48.529338; - buildings.Next(1).Agency = init.Agencies.Find(3); - buildings.Next(1).AgencyId = 3; - buildings.Next(2).ClassificationId = 2; - buildings.Next(3).Description = "-DescriptionTest-"; - buildings.Next(4).BuildingTenancy = "-BuildingTenancy-"; - buildings.Next(5).BuildingConstructionTypeId = 2; - buildings.Next(6).BuildingPredominateUseId = 2; - buildings.Next(7).RentableArea = 100; - buildings.Next(8).RentableArea = 50; - - var parcel2 = init.CreateParcel(22); - parcel2.Address.AdministrativeArea = "-AdministrativeArea-"; - init.CreateBuildings(parcel2, 23, 5); - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - var result = service.Get(new BuildingFilter()); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - result.Should().HaveCount(25); - } - #endregion - - #region Get Paged Buildings - /// - /// User does not have 'property-view' claim. - /// - [Fact] - public void Get_Page_ArgumentNullException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView); - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.GetPage(null)); - } - - /// - /// User does not have 'property-view' claim. - /// - [Fact] - public void Get_Page_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - var filter = new BuildingFilter(50, 25, 50, 20); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.GetPage(filter)); - } - - [Theory] - [MemberData(nameof(BuildingFilters))] - public void Get_Page(BuildingFilter filter, int expectedCount) - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView).AddAgency(1, 3); - - using var init = helper.InitializeDatabase(user); - var parcel1 = init.CreateParcel(1); - var buildings = init.CreateBuildings(parcel1, 10, 20); - buildings.Next(0).Location.X = -123.720810; - buildings.Next(0).Location.Y = 48.529338; - buildings.Next(1).Agency = init.Agencies.Find(3); - buildings.Next(1).AgencyId = 3; - buildings.Next(2).ClassificationId = 2; - buildings.Next(3).Description = "-DescriptionTest-"; - buildings.Next(4).BuildingTenancy = "-BuildingTenancy-"; - buildings.Next(5).BuildingConstructionTypeId = 2; - buildings.Next(6).BuildingPredominateUseId = 2; - buildings.Next(7).RentableArea = 100; - buildings.Next(8).RentableArea = 50; - - var parcel2 = init.CreateParcel(2); - parcel2.Address.AdministrativeArea = "-AdministrativeArea-"; - init.CreateBuildings(parcel2, 31, 5); - - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - var result = service.GetPage(filter); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - result.Should().HaveCount(expectedCount); - } - - [Fact] - public void Get_Page_OnlyAgencies() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView).AddAgency(3); - - using var init = helper.InitializeDatabase(user); - var parcel1 = init.CreateParcel(1); - var buildings = init.CreateBuildings(parcel1, 10, 20); - buildings.Next(0).Location.X = -123.720810; - buildings.Next(0).Location.Y = 48.529338; - buildings.Next(1).Agency = init.Agencies.Find(3); - buildings.Next(1).AgencyId = 3; - buildings.Next(2).ClassificationId = 2; - buildings.Next(3).Description = "-DescriptionTest-"; - buildings.Next(4).BuildingTenancy = "-BuildingTenancy-"; - buildings.Next(5).BuildingConstructionTypeId = 2; - buildings.Next(6).BuildingPredominateUseId = 2; - buildings.Next(7).RentableArea = 100; - buildings.Next(8).RentableArea = 50; - - var parcel2 = init.CreateParcel(2); - parcel2.Address.AdministrativeArea = "-AdministrativeArea-"; - init.CreateBuildings(parcel2, 31, 5); - - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - var result = service.GetPage(new BuildingFilter()); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - result.Should().HaveCount(10); - } - - [Theory] - [MemberData(nameof(BuildingFilters))] - public void Get_Page_AsAdmin(BuildingFilter filter, int expectedCount) - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.AdminProperties); - - using var init = helper.InitializeDatabase(user); - var parcel1 = init.CreateParcel(1); - var buildings = init.CreateBuildings(parcel1, 10, 20); - buildings.Next(0).Location.X = -123.720810; - buildings.Next(0).Location.Y = 48.529338; - buildings.Next(1).Agency = init.Agencies.Find(3); - buildings.Next(1).AgencyId = 3; - buildings.Next(2).ClassificationId = 2; - buildings.Next(3).Description = "-DescriptionTest-"; - buildings.Next(4).BuildingTenancy = "-BuildingTenancy-"; - buildings.Next(5).BuildingConstructionTypeId = 2; - buildings.Next(6).BuildingPredominateUseId = 2; - buildings.Next(7).RentableArea = 100; - buildings.Next(8).RentableArea = 50; - - var parcel2 = init.CreateParcel(2); - parcel2.Address.AdministrativeArea = "-AdministrativeArea-"; - init.CreateBuildings(parcel2, 31, 5); - - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - var result = service.GetPage(filter); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - result.Should().HaveCount(expectedCount); - } - - [Fact] - public void Get_Page_AsAdmin_AllAgencies() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.AdminProperties); - - using var init = helper.InitializeDatabase(user); - var parcel1 = init.CreateParcel(1); - var buildings = init.CreateBuildings(parcel1, 10, 20); - buildings.Next(0).Location.X = -123.720810; - buildings.Next(0).Location.Y = 48.529338; - buildings.Next(1).Agency = init.Agencies.Find(3); - buildings.Next(1).AgencyId = 3; - buildings.Next(2).ClassificationId = 2; - buildings.Next(3).Description = "-DescriptionTest-"; - buildings.Next(4).BuildingTenancy = "-BuildingTenancy-"; - buildings.Next(5).BuildingConstructionTypeId = 2; - buildings.Next(6).BuildingPredominateUseId = 2; - buildings.Next(7).RentableArea = 100; - buildings.Next(8).RentableArea = 50; - - var parcel2 = init.CreateParcel(2); - parcel2.Address.AdministrativeArea = "-AdministrativeArea-"; - init.CreateBuildings(parcel2, 31, 5); - - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - var result = service.GetPage(new BuildingFilter()); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - result.Should().HaveCount(10); - result.Total.Should().Be(25); - } - #endregion - - #region Get Building - /// - /// Building does not exist. - /// - [Fact] - public void Get_KeyNotFound() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView); - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - init.SaveChanges(); - - var service = helper.CreateService(user); - - // activate the User - var userService = helper.GetService>(); - var mapper = helper.GetService(); - userService.Setup(m => m.User.Activate()); - - // Act - // Assert - Assert.Throws(() => - service.Get(1)); - } - - /// - /// User does not have 'property-view' claim. - /// - [Fact] - public void Get_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - init.SaveChanges(); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - // Assert - Assert.Throws(() => - service.Get(1)); - } - - /// - /// User does not have 'sensitive-view' claim. - /// - [Fact] - public void Get_Sensitive_KeyNotFound() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView); - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - building.IsSensitive = true; - init.SaveChanges(); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // activate the User - var userService = helper.GetService>(); - var mapper = helper.GetService(); - userService.Setup(m => m.User.Activate()); - - // Act - // Assert - Assert.Throws(() => - service.Get(1)); - } - - /// - /// User is attempting to view sensitive building from another agency. - /// - [Fact] - public void Get_Sensitive_WrongAgency() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.SensitiveView); - using var init = helper.InitializeDatabase(user); - var agency = new Entity.Agency("TEST", "Test Agency") - { - Id = 111, - RowVersion = new byte[] { 12, 13, 14 } - }; - var parcel = init.CreateParcel(1, agency); - var building = init.CreateBuilding(parcel, 2); - building.IsSensitive = true; - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Get(2)); - } - - /// - /// User is attempting to view sensitive building from another agency. - /// - [Fact] - public void Get_Sensitive_WrongAgency_AsAdmin() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.AdminProperties); - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - building.IsSensitive = true; - init.SaveChanges(); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // activate the User - var userService = helper.GetService>(); - var mapper = helper.GetService(); - userService.Setup(m => m.User.Activate()); - - // Act - var result = service.Get(2); - - // Assert - Assert.NotNull(result); - Assert.Equal(EntityState.Detached, context.Entry(result).State); - Assert.Equal(building, result, new ShallowPropertyCompare()); - Assert.NotNull(building.Address); - Assert.NotNull(building.Address.AdministrativeArea); - Assert.NotNull(building.Address.Province); - Assert.NotNull(building.Classification); - Assert.NotNull(building.Agency); - Assert.NotNull(building.Address); - Assert.NotNull(building.Address); - // TODO: Add asserts for Evaluations - // TODO: Add asserts for Fiscals - } - - /// - /// Building found. - /// - [Fact] - public void Get() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.AdminProperties); - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - init.SaveChanges(); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // activate the User - var userService = helper.GetService>(); - var mapper = helper.GetService(); - userService.Setup(m => m.User.Activate()); - - // Act - var result = service.Get(2); - - // Assert - Assert.NotNull(result); - Assert.Equal(EntityState.Detached, context.Entry(result).State); - Assert.Equal(building, result, new ShallowPropertyCompare()); - Assert.NotNull(building.Address); - Assert.NotNull(building.Address.AdministrativeArea); - Assert.NotNull(building.Address.Province); - Assert.NotNull(building.Classification); - Assert.NotNull(building.Agency); - Assert.NotNull(building.Address); - Assert.NotNull(building.Address); - // TODO: Add asserts for Evaluations - // TODO: Add asserts for Fiscals - } - - /// - /// Building found. - /// - [Fact] - public void Get_AsAdmin() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.AdminProperties); - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - init.SaveChanges(); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // activate the User - var userService = helper.GetService>(); - var mapper = helper.GetService(); - userService.Setup(m => m.User.Activate()); - //var agency = EntityHelper.CreateAgency(); - //context.Add() - //userService.Setup(m => m.Role.Update(It.IsAny())); - //var model = mapper.Map(role); - - // Act - var result = service.Get(2); - - // Assert - Assert.NotNull(result); - Assert.Equal(EntityState.Detached, context.Entry(result).State); - Assert.Equal(building, result, new ShallowPropertyCompare()); - Assert.NotNull(building.Address); - Assert.NotNull(building.Address.AdministrativeArea); - Assert.NotNull(building.Address.Province); - Assert.NotNull(building.Classification); - Assert.NotNull(building.Agency); - Assert.NotNull(building.Address); - Assert.NotNull(building.Address); - // TODO: Add asserts for Evaluations - // TODO: Add asserts for Fiscals - } - #endregion - - #region Update Building - - [Fact] - public void Update_Building_LinkedToProject_NotAllowed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyEdit).AddAgency(1); - var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1); - project.ReportedFiscalYear = 2020; - var building = init.CreateBuilding(null, 2, agency: project.Agency); - var fiscal = init.CreateFiscal(building, 2020, Entity.FiscalKeys.NetBook, 10); - project.AddProperty(building); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // activate the User - var userService = helper.GetService>(); - var mapper = helper.GetService(); - userService.Setup(m => m.User.Activate()); - - // Act - building.Name = "change"; - - // Assert, updating a building in a project should not throw an exception. - Assert.Throws(() => - service.Update(building)); - } - - [Fact] - public void Update_Building_NoPermission_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView); - var init = helper.InitializeDatabase(user); - var building = init.CreateBuilding(1); - init.SaveChanges(); - - var service = helper.CreateService(); - - // Act - // Assert - Assert.Throws(() => - service.Update(building)); - } - - [Fact] - public void Update_Building_WrongAgency_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyEdit); - var init = helper.InitializeDatabase(user); - var agency = new Entity.Agency("TEST", "Test Agency") - { - Id = 111, - RowVersion = new byte[] { 12, 13, 14 } - }; - var building = init.CreateBuilding(1, null, null, 0, 0, agency); - init.SaveChanges(); - - var service = helper.CreateService(); - - // activate the User - var userService = helper.GetService>(); - var mapper = helper.GetService(); - userService.Setup(m => m.User.Activate()); - - // Act - building.Description = "a new description."; - - // Assert - Assert.Throws(() => - service.Update(building)); - } - - //This appears to cause a stack overflow in our github action. Will try and find time to look into this. - //[Fact] - //public void Update_Building_NotFound_KeyNotFound() - //{ - // // Arrange - // var helper = new TestHelper(); - // var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyEdit); - // var init = helper.InitializeDatabase(user); - // var building = init.CreateBuilding(1); - // var searchBuilding = EntityHelper.CreateBuilding(2); - // init.SaveChanges(); - - // var service = helper.CreateService(); - - // // Act - // // Assert - // Assert.Throws(() => - // service.Update(searchBuilding)); - //} - - [Fact] - public void Update_Building_InProject_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyEdit); - var init = helper.InitializeDatabase(user); - var parcel = init.CreateBuilding(1); - init.SaveChanges(); - parcel.ProjectNumbers = "[SPP-10000]"; - init.Update(parcel); - init.SaveChanges(); - - - var service = helper.CreateService(); - - // activate the User - var userService = helper.GetService>(); - var mapper = helper.GetService(); - userService.Setup(m => m.User.Activate()); - - // Assert - Assert.Throws(() => - service.Update(parcel)); - } - - [Fact] - public void Update_BuildingFinancials() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyEdit, Permissions.AdminProperties).AddAgency(1); - var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(3); - var building = init.CreateBuilding(parcel, 4); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // activate the User - var userService = helper.GetService>(); - var mapper = helper.GetService(); - var userAgency = EntityHelper.CreateAgency(); - var model = mapper.Map(userAgency); - userService.Setup(m => m.User.Activate()); - - // Act - building.Evaluations.Add(new Entity.BuildingEvaluation(building, DateTime.Now, Entity.EvaluationKeys.Assessed, 1000)); - building.Fiscals.Add(new Entity.BuildingFiscal(building, 2021, Entity.FiscalKeys.Market, 1000)); - building.Fiscals.Add(new Entity.BuildingFiscal(building, 2021, Entity.FiscalKeys.NetBook, 2000)); - var result = service.UpdateFinancials(building); - - // Assert - Assert.NotNull(result); - Assert.Contains(result.Evaluations, e => e.Key == Entity.EvaluationKeys.Assessed && e.Value == 1000); - Assert.Contains(result.Fiscals, e => e.Key == Entity.FiscalKeys.Market && e.Value == 1000); - Assert.Contains(result.Fiscals, e => e.Key == Entity.FiscalKeys.NetBook && e.Value == 2000); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Services/NotificationQueueServiceTest.cs b/backend/tests/unit/dal/Services/NotificationQueueServiceTest.cs deleted file mode 100644 index 1600333426..0000000000 --- a/backend/tests/unit/dal/Services/NotificationQueueServiceTest.cs +++ /dev/null @@ -1,134 +0,0 @@ -using FluentAssertions; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Exceptions; -using Pims.Dal.Security; -using Pims.Dal.Services; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Dal.Test.Services -{ - [Trait("category", "unit")] - [Trait("category", "dal")] - [Trait("group", "project")] - [ExcludeFromCodeCoverage] - public class NotificationQueueServiceTest - { - #region Data - public static IEnumerable NotificationQueueFilters => - new List - { - new object[] { new Entity.Models.NotificationQueueFilter() { To = "1@1" }, 1, 1 }, - new object[] { new Entity.Models.NotificationQueueFilter() { AgencyId = 1 }, 1, 1 }, - new object[] { new Entity.Models.NotificationQueueFilter() { ProjectId = 1 }, 2, 2 }, - new object[] { new Entity.Models.NotificationQueueFilter() { ProjectNumber = "test" }, 0, 0 }, - new object[] { new Entity.Models.NotificationQueueFilter() { ProjectNumber = "test-pass" }, 2, 2 }, - new object[] { new Entity.Models.NotificationQueueFilter() { Status = Entity.NotificationStatus.Failed }, 1, 1 }, - new object[] { new Entity.Models.NotificationQueueFilter() { Key = new Guid("8d1a35b3-6280-4103-93f5-792f8954bef8") }, 1, 1 }, - new object[] { new Entity.Models.NotificationQueueFilter() { Subject = "find" }, 1, 1 }, - new object[] { new Entity.Models.NotificationQueueFilter() { Body = "find" }, 1, 1 }, - new object[] { new Entity.Models.NotificationQueueFilter() { Tag = "find" }, 1, 1 }, - new object[] { new Entity.Models.NotificationQueueFilter() { MinSendOn = new DateTime(2020, 1, 1) }, 2, 2 }, - new object[] { new Entity.Models.NotificationQueueFilter() { MaxSendOn = new DateTime(2020, 1, 1) }, 10, 19 }, - new object[] { new Entity.Models.NotificationQueueFilter() { MinSendOn = new DateTime(2020, 1, 1), MaxSendOn = new DateTime(2020, 1, 1) }, 1, 1 }, - new object[] { new Entity.Models.NotificationQueueFilter() { Status = Entity.NotificationStatus.Pending, Sort = new[] { "UpdatedOn" } }, 10, 19 }, - new object[] { new Entity.Models.NotificationQueueFilter() { Status = Entity.NotificationStatus.Pending, Sort = new[] { "UpdatedOn desc" } }, 10, 19 }, - new object[] { new Entity.Models.NotificationQueueFilter(new Dictionary(new[] { new KeyValuePair("to", "1@1") })), 1, 1 }, - new object[] { new Entity.Models.NotificationQueueFilter(new Dictionary(new[] { new KeyValuePair("agencyId", "1") })), 1, 1 }, - new object[] { new Entity.Models.NotificationQueueFilter(new Dictionary(new[] { new KeyValuePair("projectId", "1") })), 2, 2 }, - new object[] { new Entity.Models.NotificationQueueFilter(new Dictionary(new[] { new KeyValuePair("projectNumber", "test") })), 0, 0 }, - new object[] { new Entity.Models.NotificationQueueFilter(new Dictionary(new[] { new KeyValuePair("projectNumber", "test-pass") })), 2, 2 }, - new object[] { new Entity.Models.NotificationQueueFilter(new Dictionary(new[] { new KeyValuePair("status", "failed") })), 1, 1 }, - new object[] { new Entity.Models.NotificationQueueFilter(new Dictionary(new[] { new KeyValuePair("key", "8d1a35b3-6280-4103-93f5-792f8954bef8") })), 1, 1 }, - new object[] { new Entity.Models.NotificationQueueFilter(new Dictionary(new[] { new KeyValuePair("subject", "find") })), 1, 1 }, - new object[] { new Entity.Models.NotificationQueueFilter(new Dictionary(new[] { new KeyValuePair("body", "find") })), 1, 1 }, - new object[] { new Entity.Models.NotificationQueueFilter(new Dictionary(new[] { new KeyValuePair("tag", "find") })), 1, 1 }, - new object[] { new Entity.Models.NotificationQueueFilter(new Dictionary(new[] { new KeyValuePair("minSendOn", "2020-01-01") })), 2, 2 }, - new object[] { new Entity.Models.NotificationQueueFilter(new Dictionary(new[] { new KeyValuePair("maxSendOn", "2020-01-01") })), 10, 19 }, - new object[] { new Entity.Models.NotificationQueueFilter(new Dictionary(new[] { new KeyValuePair("minSendOn", "2020-01-01"), new KeyValuePair("maxSendOn", "2020-01-01") })), 1, 1 }, - new object[] { new Entity.Models.NotificationQueueFilter(new Dictionary(new[] { new KeyValuePair("status", "pending"), new KeyValuePair("sort", "UpdatedOn") })), 10, 19 }, - }; - #endregion - - #region Constructors - public NotificationQueueServiceTest() { } - #endregion - - #region Tests - #region GetPage - [Theory] - [MemberData(nameof(NotificationQueueFilters))] - public void GetQueues_Success(Entity.Models.NotificationQueueFilter filter, int expectedResult, int expectedTotal) - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - var init = helper.CreatePimsContext(user, true); - var template = init.CreateNotificationTemplate(1, "test"); - var notifications = init.CreateNotificationQueues(1, 20, template); - var project = init.CreateProject(1); - project.ProjectNumber = "test-pass"; - notifications.ForEach(n => n.SendOn = DateTime.MinValue); - notifications.Next(0).ToAgencyId = 1; - notifications.Next(1).ProjectId = 1; - notifications.Next(2).Status = Entity.NotificationStatus.Failed; - notifications.Next(3).To = "1@1.com"; - notifications.Next(4).Key = new Guid("8d1a35b3-6280-4103-93f5-792f8954bef8"); - notifications.Next(5).Subject = "-find-"; - notifications.Next(6).Body = "-find-"; - notifications.Next(6).Tag = "-find-"; - notifications.Next(7).SendOn = new DateTime(2020, 1, 1); - notifications.Next(8).SendOn = new DateTime(2020, 1, 2); - notifications.Next(9).Project = project; - notifications.Next(10).UpdatedOn = DateTime.UtcNow.AddDays(-1); - notifications.Next(11).UpdatedOn = DateTime.UtcNow.AddDays(1); - init.AddAndSaveRange(notifications); - - var service = helper.CreateService(user); - - // Act - var result = service.GetPage(filter); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - result.Should().HaveCount(expectedResult); - result.Total.Should().Be(expectedTotal); - } - - [Fact] - public void GetQueues_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => service.GetPage(null)); - } - - [Fact] - public void GetQueues_ArgumentNull() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => service.GetPage(null)); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Services/NotificationTemplateServiceTest.cs b/backend/tests/unit/dal/Services/NotificationTemplateServiceTest.cs deleted file mode 100644 index f445e929ef..0000000000 --- a/backend/tests/unit/dal/Services/NotificationTemplateServiceTest.cs +++ /dev/null @@ -1,418 +0,0 @@ -using FluentAssertions; -using Moq; -using Pims.Core.Test; -using Pims.Dal.Exceptions; -using Pims.Dal.Security; -using Pims.Dal.Services; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Dal.Test.Services -{ - [Trait("category", "unit")] - [Trait("category", "dal")] - [Trait("group", "project")] - [ExcludeFromCodeCoverage] - public class NotificationTemplateServiceTest - { - #region Data - public static IEnumerable NotificationTemplates => - new List - { - new object[] { "SUBMIT", 6 }, - new object[] { "ASSESS", 2 } - }; - #endregion - - #region Constructors - public NotificationTemplateServiceTest() { } - #endregion - - #region Tests - #region GetTemplates - [Fact] - public void GetTemplates_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - var init = helper.CreatePimsContext(user, true); - var templates = init.CreateNotificationTemplates(1, 3); - init.AddAndSaveRange(templates); - - var service = helper.CreateService(user); - - // Act - var result = service.Get(); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - result.Should().HaveCount(3); - } - - [Fact] - public void GetTemplates_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var init = helper.CreatePimsContext(user, true); - var templates = init.CreateNotificationTemplates(1, 3); - init.AddAndSaveRange(templates); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => service.Get()); - } - #endregion - - #region GetTemplate - [Fact] - public void GetTemplate_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - var init = helper.CreatePimsContext(user, true); - var templates = init.CreateNotificationTemplates(1, 3); - init.AddAndSaveRange(templates); - - var service = helper.CreateService(user); - - // Act - var result = service.Get(1); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - result.Id.Should().Be(1); - } - - [Fact] - public void GetTemplate_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var init = helper.CreatePimsContext(user, true); - var templates = init.CreateNotificationTemplates(1, 3); - init.AddAndSaveRange(templates); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => service.Get(1)); - } - - [Fact] - public void GetTemplate_KeyNotFound() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - var init = helper.CreatePimsContext(user, true); - var template = init.CreateNotificationTemplate(1, "test"); - init.AddAndSaveChanges(template); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => service.Get(4)); - } - #endregion - - #region AddTemplate - [Fact] - public void AddTemplate_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - var init = helper.CreatePimsContext(user, true); - var template = init.CreateNotificationTemplate(1, "test"); - - var service = helper.CreateService(user); - - // Act - var result = service.Add(template); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - result.Name.Should().Be("test"); - } - - [Fact] - public void AddTemplate_ArgumentNull() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => service.Add(null)); - } - - [Fact] - public void AddTemplate_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var template = EntityHelper.CreateNotificationTemplate(1, "test"); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => service.Add(template)); - } - #endregion - - #region UpdateTemplate - [Fact] - public void UpdateTemplate_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - var init = helper.CreatePimsContext(user, true); - var template = init.CreateNotificationTemplate(1, "test"); - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - template.Subject = "TESTING"; - var result = service.Update(template); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - result.Subject.Should().Be("TESTING"); - } - - [Fact] - public void UpdateTemplate_ArgumentNull() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => service.Update(null)); - } - - [Fact] - public void UpdateTemplate_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var template = EntityHelper.CreateNotificationTemplate(1, "test"); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => service.Update(template)); - } - - [Fact] - public void UpdateTemplate_KeyNotFound() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - var template = EntityHelper.CreateNotificationTemplate(1, "test"); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => service.Update(template)); - } - #endregion - - #region SendNotificationAsync - [Fact] - public async void SendNotificationAsync_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - var init = helper.CreatePimsContext(user, true); - var template = init.CreateNotificationTemplate(1, "test"); - init.SaveChanges(); - - var service = helper.CreateService(user); - var project = init.CreateProject(1); - init.SaveChanges(); - - var notifyService = helper.GetService>(); - var pimsService = helper.GetService>(); - notifyService.Setup(m => m.SendAsync(It.IsAny())); - - // Act - var result = await service.SendNotificationAsync(template.Id, "test@test.com", project); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - result.To.Should().Be("test@test.com"); - result.Cc.Should().Be(template.Cc); - result.Bcc.Should().Be(template.Bcc); - result.Encoding.Should().Be(template.Encoding); - result.BodyType.Should().Be(template.BodyType); - result.Subject.Should().Be(template.Subject); - result.Body.Should().Be(template.Body); - result.Tag.Should().Be(template.Tag); - result.SendOn.Should().BeOnOrBefore(DateTime.UtcNow); - result.Status.Should().Be(Entity.NotificationStatus.Pending); - } - - [Fact] - public async void SendNotificationAsync_Failure() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - var init = helper.CreatePimsContext(user, true); - var template = init.CreateNotificationTemplate(1, "test"); - init.SaveChanges(); - - var service = helper.CreateService(user); - - var response = new Notifications.Models.EmailResponse() - { - Messages = new[] { new Notifications.Models.MessageResponse() { MessageId = Guid.NewGuid() } }, - TransactionId = Guid.NewGuid() - }; - var project = init.CreateProject(1); - init.SaveChanges(); - - var notifyService = helper.GetService>(); - notifyService.Setup(m => m.SendAsync(It.IsAny())).ThrowsAsync(new Exception()); - - // Act - await Assert.ThrowsAsync(async () => await service.SendNotificationAsync(template.Id, "test@test.com", project)); - - // Assert - var result = init.NotificationQueue.Find(template.Id); - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - result.To.Should().Be("test@test.com"); - result.Cc.Should().Be(template.Cc); - result.Bcc.Should().Be(template.Bcc); - result.Encoding.Should().Be(template.Encoding); - result.BodyType.Should().Be(template.BodyType); - result.Subject.Should().Be(template.Subject); - result.Body.Should().Be(template.Body); - result.Tag.Should().Be(template.Tag); - result.SendOn.Should().BeOnOrBefore(DateTime.UtcNow); - result.Status.Should().Be(Entity.NotificationStatus.Failed); - result.ChesMessageId.Should().BeNull(); - result.ChesTransactionId.Should().BeNull(); - } - - [Fact] - public async void SendNotificationAsync_ArgumentException_Null() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - var service = helper.CreateService(user); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.SendNotificationAsync(1, null, 1)); - } - - [Fact] - public async void SendNotificationAsync_ArgumentException_Empty() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - var service = helper.CreateService(user); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.SendNotificationAsync(1, "", 1)); - } - - [Fact] - public async void SendNotificationAsync_ArgumentException_Whitespace() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - var service = helper.CreateService(user); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.SendNotificationAsync(1, " ", 1)); - } - - [Fact] - public async void SendNotificationAsync_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var template = EntityHelper.CreateNotificationTemplate(1, "test"); - - var service = helper.CreateService(user); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.SendNotificationAsync(1, "test", 1)); - } - - [Fact] - public async void SendNotificationAsync_KeyNotFound() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.SystemAdmin); - - var service = helper.CreateService(user); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.SendNotificationAsync(1, "test", 1)); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Services/ParcelServiceTest.cs b/backend/tests/unit/dal/Services/ParcelServiceTest.cs deleted file mode 100644 index 10b5542e50..0000000000 --- a/backend/tests/unit/dal/Services/ParcelServiceTest.cs +++ /dev/null @@ -1,1641 +0,0 @@ -using FluentAssertions; -using Microsoft.EntityFrameworkCore; -using Pims.Core.Comparers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Entities.Models; -using Pims.Dal.Exceptions; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using Pims.Dal.Services; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Dal.Test.Services -{ - [Trait("category", "unit")] - [Trait("category", "dal")] - [Trait("group", "parcel")] - [ExcludeFromCodeCoverage] - public class ParcelServiceTest - { - #region Data - public static IEnumerable ParcelFilters => - new List - { - new object[] { new ParcelFilter(48.571155, -123.657596, 48.492947, -123.731803), new[] { 1, 3 }, 1 }, - new object[] { new ParcelFilter(48.821333, -123.795017, 48.763431, -123.959783), new[] { 1, 3 }, 0 }, - new object[] { new ParcelFilter() { Agencies = new int[] { 3 } }, new[] { 1, 3 }, 7 }, - new object[] { new ParcelFilter() { ClassificationId = 2 }, new[] { 1, 3 }, 1 }, - new object[] { new ParcelFilter() { Description = "DescriptionTest" }, new[] { 1, 3 }, 1 }, - new object[] { new ParcelFilter() { AdministrativeArea = "AdministrativeArea" }, new[] { 1, 3 }, 1 }, - new object[] { new ParcelFilter() { Zoning = "Zoning" }, new[] { 1, 3 }, 1 }, - new object[] { new ParcelFilter() { ZoningPotential = "ZoningPotential" }, new[] { 1, 3 }, 1 } - }; - #endregion - - #region Constructors - public ParcelServiceTest() { } - #endregion - - #region Tests - #region Get Parcels - /// - /// User does not have 'property-view' claim. - /// - [Fact] - public void Get_Parcels_ArgumentNullException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView); - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Get(null)); - } - - /// - /// User does not have 'property-view' claim. - /// - [Fact] - public void Get_Parcels_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - var filter = new ParcelFilter(50, 25, 50, 20); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Get(filter)); - } - - [Theory] - [MemberData(nameof(ParcelFilters))] - public void Get_Parcels(ParcelFilter filter, int[] agencyIds, int expectedCount) - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView).AddAgency(agencyIds); - - using var init = helper.InitializeDatabase(user); - var parcels = init.CreateParcels(1, 20); - parcels.Next(0).Location.X = -123.720810; - parcels.Next(0).Location.Y = 48.529338; - parcels.Next(0).AgencyId = 3; - parcels.Next(1).AgencyId = 3; - parcels.Next(1).Agency = init.Agencies.Find(3); - parcels.Next(1).AgencyId = 3; - parcels.Next(2).ClassificationId = 2; - parcels.Next(2).AgencyId = 3; - parcels.Next(3).Description = "-DescriptionTest-"; - parcels.Next(3).AgencyId = 3; - parcels.Next(4).Address.AdministrativeArea = "-AdministrativeArea-"; - parcels.Next(4).AgencyId = 3; - parcels.Next(5).Zoning = "-Zoning-"; - parcels.Next(5).AgencyId = 3; - parcels.Next(6).ZoningPotential = "-ZoningPotential-"; - parcels.Next(6).AgencyId = 3; - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - var result = service.Get(filter); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - Assert.Equal(expectedCount, result.Count()); - } - - [Fact] - public void Get_Parcels_OnlyAgencies() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView).AddAgency(3); - - using var init = helper.InitializeDatabase(user); - var parcels = init.CreateParcels(1, 20); - parcels.Next(0).Location.X = -123.720810; - parcels.Next(0).Location.Y = 48.529338; - parcels.Next(1).Agency = init.Agencies.Find(3); - parcels.Next(1).AgencyId = 3; - parcels.Next(2).ClassificationId = 2; - parcels.Next(3).Description = "-DescriptionTest-"; - parcels.Next(4).Address.AdministrativeArea = "-AdministrativeArea-"; - parcels.Next(5).Zoning = "-Zoning-"; - parcels.Next(6).ZoningPotential = "-ZoningPotential-"; - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - var result = service.Get(new ParcelFilter()); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - result.Should().HaveCount(1); - } - - [Theory] - [MemberData(nameof(ParcelFilters))] - [SuppressMessage("Usage", "xUnit1026:Theory methods should use all of their parameters", Justification = "Not required for administrators.")] - [SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Not required for administrators.")] - public void Get_Parcels_AsAdmin(ParcelFilter filter, int[] agencyIds, int expectedCount) - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.AdminProperties); - - using var init = helper.InitializeDatabase(user); - var parcels = init.CreateParcels(1, 20); - parcels.Next(0).Location.X = -123.720810; - parcels.Next(0).Location.Y = 48.529338; - parcels.Next(0).AgencyId = 3; - parcels.Next(1).Agency = init.Agencies.Find(3); - parcels.Next(1).AgencyId = 3; - parcels.Next(2).ClassificationId = 2; - parcels.Next(2).AgencyId = 3; - parcels.Next(3).Description = "-DescriptionTest-"; - parcels.Next(3).AgencyId = 3; - parcels.Next(4).Address.AdministrativeArea = "-AdministrativeArea-"; - parcels.Next(4).AgencyId = 3; - parcels.Next(5).Zoning = "-Zoning-"; - parcels.Next(5).AgencyId = 3; - parcels.Next(6).ZoningPotential = "-ZoningPotential-"; - parcels.Next(6).AgencyId = 3; - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - var result = service.Get(filter); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - Assert.Equal(expectedCount, result.Count()); - } - - - [Fact] - public void Get_Parcels_AsAdmin_AllAgencies() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.AdminProperties); - - using var init = helper.InitializeDatabase(user); - var parcels = init.CreateParcels(1, 20); - parcels.Next(0).Location.X = -123.720810; - parcels.Next(0).Location.Y = 48.529338; - parcels.Next(1).Agency = init.Agencies.Find(3); - parcels.Next(1).AgencyId = 3; - parcels.Next(2).ClassificationId = 2; - parcels.Next(3).Description = "-DescriptionTest-"; - parcels.Next(4).Address.AdministrativeArea = "-AdministrativeArea-"; - parcels.Next(5).Zoning = "-Zoning-"; - parcels.Next(6).ZoningPotential = "-ZoningPotential-"; - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - var result = service.Get(new ParcelFilter()); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - Assert.Equal(20, result.Count()); - } - #endregion - - #region Get Paged Parcels - /// - /// User does not have 'property-view' claim. - /// - [Fact] - public void Get_Page_ArgumentNullException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView); - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.GetPage(null)); - } - - /// - /// User does not have 'property-view' claim. - /// - [Fact] - public void Get_Page_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - var filter = new ParcelFilter(50, 25, 50, 20); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.GetPage(filter)); - } - - [Theory] - [MemberData(nameof(ParcelFilters))] - public void Get_Page(ParcelFilter filter, int[] agencyIds, int expectedTotal) - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView).AddAgency(agencyIds); - - using var init = helper.InitializeDatabase(user); - var parcels = init.CreateParcels(1, 20); - parcels.Next(0).Location.X = -123.720810; - parcels.Next(0).Location.Y = 48.529338; - parcels.Next(0).AgencyId = 3; - parcels.Next(1).Agency = init.Agencies.Find(3); - parcels.Next(1).AgencyId = 3; - parcels.Next(2).ClassificationId = 2; - parcels.Next(2).AgencyId = 3; - parcels.Next(3).Description = "-DescriptionTest-"; - parcels.Next(3).AgencyId = 3; - parcels.Next(4).Address.AdministrativeArea = "-AdministrativeArea-"; - parcels.Next(4).AgencyId = 3; - parcels.Next(5).Zoning = "-Zoning-"; - parcels.Next(5).AgencyId = 3; - parcels.Next(6).ZoningPotential = "-ZoningPotential-"; - parcels.Next(6).AgencyId = 3; - init.SaveChanges(); - helper.CreatePimsContext(user, true).AddAndSaveRange(parcels); - - var service = helper.CreateService(user); - - // Act - var result = service.GetPage(filter); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - Assert.Equal(expectedTotal, result.Total); - } - - [Fact] - public void Get_Page_OnlyAgencies() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView).AddAgency(3); - - using var init = helper.InitializeDatabase(user); - var parcels = init.CreateParcels(1, 20); - parcels.Next(0).Location.X = -123.720810; - parcels.Next(0).Location.Y = 48.529338; - parcels.Next(1).Agency = init.Agencies.Find(3); - parcels.Next(1).AgencyId = 3; - parcels.Next(2).ClassificationId = 2; - parcels.Next(3).Description = "-DescriptionTest-"; - parcels.Next(4).Address.AdministrativeArea = "-AdministrativeArea-"; - parcels.Next(5).Zoning = "-Zoning-"; - parcels.Next(6).ZoningPotential = "-ZoningPotential-"; - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - var result = service.GetPage(new ParcelFilter()); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - Assert.Equal(1, result.Total); - } - - [Theory] - [MemberData(nameof(ParcelFilters))] - [SuppressMessage("Usage", "xUnit1026:Theory methods should use all of their parameters", Justification = "Not required for administrators.")] - [SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Not required for administrators.")] - public void Get_Page_AsAdmin(ParcelFilter filter, int[] agencyIds, int expectedTotal) - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.AdminProperties); - - using var init = helper.InitializeDatabase(user); - var parcels = init.CreateParcels(1, 20); - parcels.Next(0).Location.X = -123.720810; - parcels.Next(0).Location.Y = 48.529338; - parcels.Next(0).AgencyId = 3; - parcels.Next(1).Agency = init.Agencies.Find(3); - parcels.Next(1).AgencyId = 3; - parcels.Next(2).ClassificationId = 2; - parcels.Next(2).AgencyId = 3; - parcels.Next(3).Description = "-DescriptionTest-"; - parcels.Next(3).AgencyId = 3; - parcels.Next(4).Address.AdministrativeArea = "-AdministrativeArea-"; - parcels.Next(4).AgencyId = 3; - parcels.Next(5).Zoning = "-Zoning-"; - parcels.Next(5).AgencyId = 3; - parcels.Next(6).ZoningPotential = "-ZoningPotential-"; - parcels.Next(6).AgencyId = 3; - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - var result = service.GetPage(filter); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - Assert.Equal(expectedTotal, result.Total); - } - - [Fact] - public void Get_Page_AsAdmin_AllAgencies() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.AdminProperties); - - using var init = helper.InitializeDatabase(user); - var parcels = init.CreateParcels(1, 20); - parcels.Next(0).Location.X = -123.720810; - parcels.Next(0).Location.Y = 48.529338; - parcels.Next(1).Agency = init.Agencies.Find(3); - parcels.Next(1).AgencyId = 3; - parcels.Next(2).ClassificationId = 2; - parcels.Next(3).Description = "-DescriptionTest-"; - parcels.Next(4).Address.AdministrativeArea = "-AdministrativeArea-"; - parcels.Next(5).Zoning = "-Zoning-"; - parcels.Next(6).ZoningPotential = "-ZoningPotential-"; - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - var result = service.GetPage(new ParcelFilter()); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - Assert.Equal(20, result.Total); - } - #endregion - - #region Get Parcel - /// - /// User does not have 'property-view' claim. - /// - [Fact] - public void Get_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Get(1)); - } - - /// - /// User does not have 'sensitive-view' claim. - /// - [Fact] - public void Get_Sensitive_KeyNotFound() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - parcel.IsSensitive = true; - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Get(1)); - } - - /// - /// Parcel does not exist. - /// - [Fact] - public void Get_KeyNotFound() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView); - var parcel = EntityHelper.CreateParcel(2, 1, 1, 1); - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Get(1)); - } - - /// - /// User is attempting to view sensitive parcel from another agency. - /// - [Fact] - public void Get_Sensitive_WrongAgency() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.SensitiveView); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - parcel.IsSensitive = true; - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Get(1)); - } - - /// - /// Parcel found. - /// - [Fact] - public void Get() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - init.SaveChanges(); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - var result = service.Get(1); - - // Assert - Assert.NotNull(result); - Assert.Equal(EntityState.Detached, context.Entry(result).State); - Assert.Equal(parcel, result, new ShallowPropertyCompare()); - Assert.NotNull(parcel.Address); - Assert.NotNull(parcel.Address.AdministrativeArea); - Assert.NotNull(parcel.Address.Province); - Assert.NotNull(parcel.Classification); - Assert.NotNull(parcel.Agency); - Assert.NotNull(parcel.Address); - Assert.NotNull(parcel.Address); - Assert.NotNull(parcel.Evaluations); - Assert.NotNull(parcel.Fiscals); - Assert.NotNull(parcel.Buildings); - } - - /// - /// Parcel found. - /// - [Fact] - public void Get_AsAdmin() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.AdminProperties); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - init.SaveChanges(); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - var result = service.Get(1); - - // Assert - Assert.NotNull(result); - Assert.Equal(EntityState.Detached, context.Entry(result).State); - Assert.Equal(parcel, result, new ShallowPropertyCompare()); - Assert.NotNull(parcel.Address); - Assert.NotNull(parcel.Address.AdministrativeArea); - Assert.NotNull(parcel.Address.Province); - Assert.NotNull(parcel.Classification); - Assert.NotNull(parcel.Agency); - Assert.NotNull(parcel.Address); - Assert.NotNull(parcel.Address); - Assert.NotNull(parcel.Evaluations); - Assert.NotNull(parcel.Fiscals); - Assert.NotNull(parcel.Buildings); - } - - /// - /// Parcel found, but user does not have 'sensitive-view' claim. - /// Remove sensitive buildings. - /// - [Fact] - public void Get_RemoveSensitiveBuildings() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView).AddAgency(1); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1, 1, 1); - init.CreateBuilding(parcel, 2); - var sensitive = init.CreateBuilding(parcel, 3); - sensitive.IsSensitive = true; - init.SaveChanges(); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - var result = service.Get(1); - - // Assert - Assert.NotNull(result); - Assert.Equal(EntityState.Detached, context.Entry(result).State); - Assert.Equal(parcel, result, new ShallowPropertyCompare()); - Assert.Single(result.Buildings); - Assert.False(result.IsSensitive); - Assert.False(result.Buildings.First().Building.IsSensitive); - } - - /// - /// Sensitive parcel found. - /// - [Fact] - public void Get_Sensitive() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.SensitiveView).AddAgency(1); - - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - init.SaveChanges(); - parcel.IsSensitive = true; - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - var result = service.Get(1); - - // Assert - Assert.NotNull(result); - Assert.Equal(EntityState.Detached, context.Entry(result).State); - Assert.Equal(parcel, result, new ShallowPropertyCompare()); - Assert.True(result.IsSensitive); - } - - /// - /// Sensitive parcel found, sensitive buildings belonging to another agency are removed. - /// - [Fact] - public void Get_WithAgency_RemoveSensitiveBuildings() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.SensitiveView).AddAgency(1); - using var init = helper.InitializeDatabase(user); - var agency = init.Agencies.Find(1); - var parcel = init.CreateParcel(1, agency); - parcel.IsSensitive = true; - var building1 = init.CreateBuilding(parcel, 3); - building1.IsSensitive = true; - var building2 = init.CreateBuilding(parcel, 4, "13", "l4", 1, 1, init.Agencies.Find(2)); - building2.IsSensitive = true; - init.SaveChanges(); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - var result = service.Get(1); - - // Assert - Assert.NotNull(result); - Assert.Equal(EntityState.Detached, context.Entry(result).State); - Assert.Equal(parcel, result, new ShallowPropertyCompare()); - Assert.Equal(2, result.Buildings.Count()); - Assert.True(result.IsSensitive); - Assert.Equal(2, result.Buildings.Count(b => b.Building.IsSensitive)); - } - - /// - /// Sensitive parcel found. - /// - [Fact] - public void Get_Sensitive_AsAdmin() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.AdminProperties, Permissions.PropertyView); - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - init.SaveChanges(); - parcel.IsSensitive = true; - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - var result = service.Get(1); - - // Assert - Assert.NotNull(result); - Assert.Equal(EntityState.Detached, context.Entry(result).State); - Assert.Equal(parcel, result, new ShallowPropertyCompare()); - Assert.True(result.IsSensitive); - } - #endregion - - #region Add Parcel - [Fact] - public void Add_Parcel_NoPermission_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView); - var init = helper.InitializeDatabase(user); - init.SaveChanges(); - var parcel = EntityHelper.CreateParcel(1); - - var service = helper.CreateService(); - - // Act - // Assert - Assert.Throws(() => - service.Add(parcel)); - } - - [Fact] - public void Add_Parcel_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyEdit); - var init = helper.InitializeDatabase(user); - init.SaveChanges(); - var parcel = EntityHelper.CreateParcel(1); - - var service = helper.CreateService(); - - // Act - parcel.Description = "a new description."; - - // Assert - Assert.Throws(() => - service.Add(parcel)); - } - - [Fact] - public void Add_Parcel() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyAdd).AddAgency(10); - var init = helper.InitializeDatabase(user); - init.SaveChanges(); - var parcel = EntityHelper.CreateParcel(1); - parcel.Description = "a new description."; - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - var result = service.Add(parcel); - - // Assert - Assert.NotNull(result); - result.Description.Should().Be("a new description."); - } - - - [Fact] - public void Add_ParcelFinancials() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyAdd).AddAgency(10); - var init = helper.InitializeDatabase(user); - init.SaveChanges(); - var parcel = EntityHelper.CreateParcel(1); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - parcel.Evaluations.Add(new Entity.ParcelEvaluation(parcel, DateTime.Now, Entity.EvaluationKeys.Assessed, 1000)); - parcel.Fiscals.Add(new Entity.ParcelFiscal(parcel, 2021, Entity.FiscalKeys.Market, 1000)); - parcel.Fiscals.Add(new Entity.ParcelFiscal(parcel, 2021, Entity.FiscalKeys.NetBook, 2000)); - var result = service.Add(parcel); - - // Assert - Assert.NotNull(result); - Assert.Contains(result.Evaluations, e => e.Key == Entity.EvaluationKeys.Assessed && e.Value == 1000); - Assert.Contains(result.Fiscals, e => e.Key == Entity.FiscalKeys.Market && e.Value == 1000); - Assert.Contains(result.Fiscals, e => e.Key == Entity.FiscalKeys.NetBook && e.Value == 2000); - } - - [Fact] - public void Add_Parcel_AddAgencyAsAdmin() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.AdminProperties).AddAgency(1); - var init = helper.InitializeDatabase(user); - init.SaveChanges(); - var parcel = EntityHelper.CreateParcel(1); - parcel.Agency = null; - parcel.AgencyId = 2; - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - var result = service.Add(parcel); - - // Assert - Assert.NotNull(result); - result.AgencyId.Should().Be(2); - } - - [Fact] - public void Add_Parcel_LinkedToProject() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyAdd).AddAgency(10); - var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1); - project.ReportedFiscalYear = 2020; - init.SaveChanges(); - var parcel = EntityHelper.CreateParcel(1); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - // Assert, parcels linked to projects can now be updated as multiple associations are allowed. - service.Add(parcel); - } - - [Fact] - public void Add_Subdivision_ParcelAndSubdivisionError() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyAdd).AddAgency(1); - var init = helper.InitializeDatabase(user); - init.CreateParcel(1); - init.SaveChanges(); - var parcel = EntityHelper.CreateParcel(2); - var subdivision = new Entity.ParcelParcel() { ParcelId = 1, SubdivisionId = 2 }; - parcel.Parcels.Add(subdivision); - parcel.Subdivisions.Add(subdivision); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Assert - Assert.Throws(() => - service.Add(parcel)); - } - - [Fact] - public void Add_Subdivision_Parcel() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyAdd).AddAgency(10); - var init = helper.InitializeDatabase(user); - var originalParcel = init.CreateParcel(1); - init.SaveChanges(); - var parcel = EntityHelper.CreateParcel(2); - var subdivision = new Entity.ParcelParcel() { ParcelId = 1, SubdivisionId = 2, Parcel = originalParcel }; - parcel.Parcels.Add(subdivision); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - var result = service.Add(parcel); - - // Assert - Assert.NotNull(result); - result.Parcels.FirstOrDefault().Should().Be(subdivision); - result.Subdivisions.Should().BeEmpty(); - } - - [Fact] - public void Add_Parcel_Subdivision() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyAdd).AddAgency(10); - var init = helper.InitializeDatabase(user); - init.CreateParcel(1); - init.SaveChanges(); - var parcel = EntityHelper.CreateParcel(2); - var dividedParcel = new Entity.ParcelParcel() { ParcelId = 2, SubdivisionId = 1 }; - parcel.Subdivisions.Add(dividedParcel); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - var result = service.Add(parcel); - - // Assert - Assert.NotNull(result); - result.Subdivisions.FirstOrDefault().Should().Be(dividedParcel); - result.Parcels.Should().BeEmpty(); - } - - [Fact] - public void Add_Subdivision_UniquePin() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyAdd).AddAgency(10); - var init = helper.InitializeDatabase(user); - var originalParcel = init.CreateParcel(1); - init.SaveChanges(); - var parcel = EntityHelper.CreateParcel(2); - parcel.PID = 1; //set to the same pid as the existing parcel - var dividedParcel = new Entity.ParcelParcel() { ParcelId = 2, SubdivisionId = 1, Parcel = originalParcel }; - parcel.Parcels.Add(dividedParcel); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - var result = service.Add(parcel); - - // Assert - Assert.NotNull(result); - result.PIN.Should().Be(1); - } - - [Fact] - public void Add_Subdivision_UniqueIncrementedPin() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyAdd).AddAgency(10); - var init = helper.InitializeDatabase(user); - var originalParcel = init.CreateParcel(1); - originalParcel.PIN = 1; - init.SaveChanges(); - var parcel = EntityHelper.CreateParcel(2); - parcel.PID = 1; //set to the same pid as the existing parcel - var dividedParcel = new Entity.ParcelParcel() { ParcelId = 2, SubdivisionId = 1, Parcel = originalParcel }; - parcel.Parcels.Add(dividedParcel); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - var result = service.Add(parcel); - - // Assert - Assert.NotNull(result); - result.PIN.Should().Be(2); - } - - [Fact] - public void Add_Subdivision_TestPidReplacement() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyAdd).AddAgency(10); - var init = helper.InitializeDatabase(user); - var originalParcel = init.CreateParcel(1); - originalParcel.PIN = 1; - init.SaveChanges(); - var parcel = EntityHelper.CreateParcel(2); - var dividedParcel = new Entity.ParcelParcel() { ParcelId = 2, SubdivisionId = 1, Parcel = originalParcel }; - parcel.Parcels.Add(dividedParcel); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - var result = service.Add(parcel); - - // Assert - Assert.NotNull(result); - result.PID.Should().Be(1); - } - #endregion - - #region Update Parcel - [Fact] - public void Update_Parcel_NoPermission_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView); - var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - init.SaveChanges(); - - var service = helper.CreateService(); - - // Act - // Assert - Assert.Throws(() => - service.Update(parcel)); - } - - [Fact] - public void Update_Parcel_NotFound_KeyNotFound() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyEdit); - var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var searchParcel = EntityHelper.CreateParcel(2); - init.SaveChanges(); - - var service = helper.CreateService(); - - // Act - // Assert - Assert.Throws(() => - service.Update(searchParcel)); - } - - [Fact] - public void Update_Parcel_WrongAgency_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyEdit); - var init = helper.InitializeDatabase(user); - var agency = new Entity.Agency("TEST", "Test Agency") - { - Id = 111, - RowVersion = new byte[] { 12, 13, 14 } - }; - var parcel = init.CreateParcel(1, agency); - init.SaveChanges(); - - var service = helper.CreateService(); - - // Act - parcel.Description = "a new description."; - - // Assert - Assert.Throws(() => - service.Update(parcel)); - } - - [Fact] - public void Update_Parcel_InProject_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyEdit); - var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - init.SaveChanges(); - parcel.ProjectNumbers = "[SPP-10000]"; - init.Update(parcel); - init.SaveChanges(); - - - var service = helper.CreateService(); - - // Assert - Assert.Throws(() => - service.Update(parcel)); - } - - [Fact] - public void Update_Parcel_ChangeAgency_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyEdit).AddAgency(1); - var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - init.SaveChanges(); - - var service = helper.CreateService(); - - // Act - parcel.AgencyId = 5; - - // Assert - Assert.Throws(() => - service.Update(parcel)); - } - - [Fact] - public void Update_Parcel() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyEdit).AddAgency(1); - var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - parcel.Description = "a new description."; - var result = service.Update(parcel); - - // Assert - Assert.NotNull(result); - result.Description.Should().Be("a new description."); - } - - [Fact] - public void Update_ParcelFinancials() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyEdit).AddAgency(1); - var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - parcel.Evaluations.Add(new Entity.ParcelEvaluation(parcel, DateTime.Now, Entity.EvaluationKeys.Assessed, 1000)); - parcel.Fiscals.Add(new Entity.ParcelFiscal(parcel, 2021, Entity.FiscalKeys.Market, 1000)); - parcel.Fiscals.Add(new Entity.ParcelFiscal(parcel, 2021, Entity.FiscalKeys.NetBook, 2000)); - var result = service.UpdateFinancials(parcel); - - // Assert - Assert.NotNull(result); - Assert.Contains(result.Evaluations, e => e.Key == Entity.EvaluationKeys.Assessed && e.Value == 1000); - Assert.Contains(result.Fiscals, e => e.Key == Entity.FiscalKeys.Market && e.Value == 1000); - Assert.Contains(result.Fiscals, e => e.Key == Entity.FiscalKeys.NetBook && e.Value == 2000); - } - - [Fact] - public void Update_Parcel_UpdateAgencyAsAdmin() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.AdminProperties).AddAgency(1); - var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - parcel.AgencyId = 2; - var result = service.Update(parcel); - - // Assert - Assert.NotNull(result); - result.AgencyId.Should().Be(2); - } - - [Fact] - public void Update_Parcel_LinkedToProject_NotAllowed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyEdit).AddAgency(1); - var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1); - project.ReportedFiscalYear = 2020; - var parcel = init.CreateParcel(1); - project.AddProperty(parcel); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - // Assert, parcels linked to projects cannot be updated - Assert.Throws(() => - service.Update(parcel)); - } - - [Fact] - public void Update_Parcel_ParcelAndSubdivisionError() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyEdit).AddAgency(1); - var init = helper.InitializeDatabase(user); - init.CreateParcel(1); - init.CreateParcel(2); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - var parcelToUpdate = service.Get(1); - var divideParcel = new Entity.ParcelParcel() { ParcelId = 2, SubdivisionId = 1 }; - parcelToUpdate.Parcels.Add(divideParcel); - parcelToUpdate.Subdivisions.Add(divideParcel); - - // Assert - Assert.Throws(() => - service.Update(parcelToUpdate)); - } - - [Fact] - public void Update_Subdivision_Parcel() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyEdit).AddAgency(1); - var init = helper.InitializeDatabase(user); - var originalParcel = init.CreateParcel(1); - init.CreateParcel(2); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - var parcelToUpdate = service.Get(1); - var divideParcel = new Entity.ParcelParcel() { ParcelId = 2, SubdivisionId = 1, Parcel = originalParcel }; - parcelToUpdate.Parcels.Add(divideParcel); - var result = service.Update(parcelToUpdate); - - // Assert - Assert.NotNull(result); - result.Parcels.FirstOrDefault().ParcelId.Should().Be(2); - result.Parcels.FirstOrDefault().SubdivisionId.Should().Be(1); - result.Subdivisions.Should().BeEmpty(); - } - - [Fact] - public void Update_Subdivision_Parcel_Remove() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyAdd, Permissions.PropertyEdit, Permissions.AdminProperties).AddAgency(10); - var init = helper.InitializeDatabase(user); - var parcel = EntityHelper.CreateParcel(1); - - var originalParcel = init.CreateParcel(2); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - var subdivision = new Entity.ParcelParcel() { ParcelId = 2, SubdivisionId = 1, Parcel = originalParcel }; - parcel.Parcels.Add(subdivision); - service.Add(parcel); - - var parcelToUpdate = service.Get(1); - parcelToUpdate.Parcels.Clear(); - var result = service.Update(parcelToUpdate); - - // Assert - Assert.NotNull(result); - result.Subdivisions.Should().BeEmpty(); - result.Parcels.Should().BeEmpty(); - } - - [Fact] - public void Update_Parcel_Subdivision_Remove() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyAdd, Permissions.PropertyEdit, Permissions.AdminProperties).AddAgency(10); - var init = helper.InitializeDatabase(user); - var parcel = EntityHelper.CreateParcel(1); - - init.CreateParcel(2); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - var subdivision = new Entity.ParcelParcel() { ParcelId = 1, SubdivisionId = 2 }; - parcel.Subdivisions.Add(subdivision); - service.Add(parcel); - - var parcelToUpdate = service.Get(1); - parcelToUpdate.Subdivisions.Clear(); - var result = service.Update(parcelToUpdate); - - // Assert - Assert.NotNull(result); - result.Subdivisions.Should().BeEmpty(); - result.Parcels.Should().BeEmpty(); - } - - [Fact] - public void Update_Subdivision_TestPidReplacement() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView, Permissions.PropertyEdit, Permissions.PropertyAdd, Permissions.AdminProperties).AddAgency(10); - var init = helper.InitializeDatabase(user); - var originalParcel = init.CreateParcel(1, 3); - var updatedParcel = init.CreateParcel(3, 3); - originalParcel.PIN = 1; - init.SaveChanges(); - var parcel = EntityHelper.CreateParcel(2, 3); - var dividedParcel = new Entity.ParcelParcel() { ParcelId = 1, SubdivisionId = 2, Parcel = originalParcel }; - parcel.Parcels.Add(dividedParcel); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - service.Add(parcel); - - // Update the parcel to contain a new Parcel - var parcelToUpdate = service.Get(2); - parcelToUpdate.Parcels.Clear(); - dividedParcel = new Entity.ParcelParcel() { ParcelId = 1, SubdivisionId = 3, Parcel = updatedParcel }; - parcelToUpdate.Parcels.Add(dividedParcel); - var result = service.Update(parcelToUpdate); - - // Assert - Assert.NotNull(result); - result.PID.Should().Be(3); - } - - #endregion - - #region Delete Parcel - /// - /// Parcel does not exist. - /// - [Fact] - public void Remove_KeyNotFound() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyDelete); - var find = EntityHelper.CreateParcel(1); - var parcel = EntityHelper.CreateParcel(2, 1, 1, 1); - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Remove(find)); - } - - /// - /// User does not have 'property-delete' claim. - /// - [Fact] - public void Remove_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - init.SaveChanges(); - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Remove(parcel)); - } - - /// - /// Building is in an active project - /// - [Fact] - public void Remove_NotAuthorized_InProject() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyDelete).AddAgency(1); - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - init.SaveChanges(); - parcel.ProjectNumbers = "[SPP-10000]"; - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Remove(parcel)); - } - - /// - /// User does not have 'sensitive-delete' claim. - /// - [Fact] - public void Remove_Sensitive_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyDelete).AddAgency(1); - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - init.SaveChanges(); - parcel.IsSensitive = true; - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Remove(parcel)); - } - - /// - /// User does not have 'sensitive-delete' claim. - /// - [Fact] - public void Remove_Sensitive_AsAdmin() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyDelete, Permissions.AdminProperties).AddAgency(1); - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - init.SaveChanges(); - parcel.IsSensitive = true; - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - var context = helper.GetService(); - - // Act - service.Remove(parcel); - - // Assert - Assert.Equal(EntityState.Detached, context.Entry(parcel).State); - } - - /// - /// User is attempting to view sensitive parcel from another agency. - /// - [Fact] - public void Remove_WrongAgency_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyDelete); - using var init = helper.InitializeDatabase(user); - var differentAgency = new Entity.Agency("TEST", "Test Agency") - { - Id = 111, - RowVersion = new byte[] { 12, 13, 14 } - }; - var parcel = init.CreateParcel(1, differentAgency); - init.SaveChanges(); - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - // Assert - Assert.Throws(() => - service.Remove(parcel)); - } - - /// - /// User is attempting to view sensitive parcel from another agency. - /// - [Fact] - public void Remove_WrongAgency_AsAdmin() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyDelete, Permissions.AdminProperties); - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - init.SaveChanges(); - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - var context = helper.GetService(); - - // Act - service.Remove(parcel); - - // Assert - Assert.Equal(EntityState.Detached, context.Entry(parcel).State); - } - - /// - /// Parcel found. - /// - [Fact] - public void Remove_Sensitive() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyDelete, Permissions.SensitiveView).AddAgency(1); - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - init.SaveChanges(); - parcel.IsSensitive = true; - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - var context = helper.GetService(); - - // Act - service.Remove(parcel); - - // Assert - Assert.Equal(EntityState.Detached, context.Entry(parcel).State); - } - - /// - /// Parcel found. - /// - [Fact] - public void Remove() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyDelete).AddAgency(1); - using var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - init.SaveChanges(); - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - var context = helper.GetService(); - - // Act - service.Remove(parcel); - - // Assert - Assert.Equal(EntityState.Detached, context.Entry(parcel).State); - } - - /// - /// Parcel found. - /// - [Fact] - public void Remove_Parent_And_Subdivisions() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyDelete, Permissions.PropertyAdd, Permissions.PropertyView).AddAgency(1); - var init = helper.InitializeDatabase(user); - var parcel = init.CreateParcel(1); - var subdivision = EntityHelper.CreateParcel(2); - parcel.Subdivisions.Add(new Entity.ParcelParcel() { ParcelId = 1, SubdivisionId = 2, Subdivision = subdivision }); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - var context = helper.GetService(); - service.Add(parcel); - - // Act - service.Remove(parcel); - Assert.Throws(() => - service.Get(2)); - } - #endregion - - #region Check PID available - - /// - /// Pid is Available for use. - /// - [Fact] - public void IsPidAvailable_UsedByCurrentParcel() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - var service = helper.CreateService(user); - - // Act - var result = service.IsPidAvailable(parcel.Id, 1); - - // Assert - Assert.True(result); - } - - /// - /// Pid is not Available for use. - /// - [Fact] - public void IsPidAvailable_UsedAnotherParcel() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - var service = helper.CreateService(user); - - // Act - var result = service.IsPidAvailable(10, 1); - - // Assert - Assert.False(result); - } - #endregion - - #region Check PIN available - - /// - /// Pin is Available for use. - /// - [Fact] - public void IsPinAvailable_UsedByCurrentParcel() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - parcel.PIN = 1; - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - var service = helper.CreateService(user); - - // Act - var result = service.IsPinAvailable(parcel.Id, 1); - - // Assert - Assert.True(result); - } - - /// - /// Pin is not Available for use. - /// - [Fact] - public void IsPinAvailable_UsedAnotherParcel() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView); - var parcel = EntityHelper.CreateParcel(1, 1, 1, 1); - parcel.PIN = 1; - helper.CreatePimsContext(user, true).AddAndSaveChanges(parcel); - var service = helper.CreateService(user); - - // Act - var result = service.IsPinAvailable(10, 1); - - // Assert - Assert.False(result); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Services/ProjectNotificationServiceTest.cs b/backend/tests/unit/dal/Services/ProjectNotificationServiceTest.cs deleted file mode 100644 index 73a14f02c9..0000000000 --- a/backend/tests/unit/dal/Services/ProjectNotificationServiceTest.cs +++ /dev/null @@ -1,211 +0,0 @@ -using FluentAssertions; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Security; -using Pims.Dal.Services; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Dal.Test.Services -{ - [Trait("category", "unit")] - [Trait("category", "dal")] - [Trait("group", "project")] - [ExcludeFromCodeCoverage] - public class ProjectNotificationServiceTest - { - #region Data - public static IEnumerable ProjectNotifications => - new List - { - new object[] { "SUBMIT", 6 }, - new object[] { "ASSESS", 2 } - }; - #endregion - - #region Constructors - public ProjectNotificationServiceTest() { } - #endregion - - #region Tests - #region Get - [Fact] - public void Get_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView); - - var init = helper.CreatePimsContext(user, true); - var status = EntityHelper.CreateProjectStatus(1, 7); - init.AddAndSaveRange(status); - var template = EntityHelper.CreateNotificationTemplate(1, "test"); - var psn = new Entity.ProjectStatusNotification(template, status.Next(0), status.Next(1), Entity.NotificationDelays.None); - init.AddAndSaveChanges(psn); - - var service = helper.CreateService(user); - - // Act - var result = service.Get(psn.Id); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - result.TemplateId.Should().Be(1); - result.FromStatusId.Should().Be(1); - result.ToStatusId.Should().Be(2); - result.Priority.Should().Be(template.Priority); - result.Delay.Should().Be(Entity.NotificationDelays.None); - result.DelayDays.Should().Be(0); - result.Template.Name.Should().Be("test"); - } - - [Fact] - public void Get_FromStatus_Null_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView); - - var init = helper.CreatePimsContext(user, true); - var status = EntityHelper.CreateProjectStatus(1, 7); - init.AddAndSaveRange(status); - var template = EntityHelper.CreateNotificationTemplate(1, "test"); - var psn = new Entity.ProjectStatusNotification(template, null, status.Next(1), Entity.NotificationDelays.None); - init.AddAndSaveChanges(psn); - - var service = helper.CreateService(user); - - // Act - var result = service.Get(psn.Id); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - result.TemplateId.Should().Be(1); - result.FromStatusId.Should().BeNull(); - result.ToStatusId.Should().Be(2); - result.Priority.Should().Be(template.Priority); - result.Delay.Should().Be(Entity.NotificationDelays.None); - result.DelayDays.Should().Be(0); - result.Template.Name.Should().Be("test"); - } - - [Fact] - public void Get_KeyNotFound() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => service.Get(1)); - } - #endregion - - #region GetFor - [Fact] - public void GetFor_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView); - - var init = helper.CreatePimsContext(user, true); - var status = EntityHelper.CreateProjectStatus(1, 7); - init.AddAndSaveRange(status); - var template = EntityHelper.CreateNotificationTemplate(1, "test"); - var psn = new Entity.ProjectStatusNotification(template, status.Next(0), status.Next(1), Entity.NotificationDelays.None); - init.AddAndSaveChanges(psn); - - var service = helper.CreateService(user); - - // Act - var results = service.GetFor(status.Next(0).Id, status.Next(1).Id); - - // Assert - Assert.NotNull(results); - Assert.IsAssignableFrom>(results); - var first = results.First(); - first.TemplateId.Should().Be(1); - first.FromStatusId.Should().Be(1); - first.ToStatusId.Should().Be(2); - first.Priority.Should().Be(template.Priority); - first.Delay.Should().Be(Entity.NotificationDelays.None); - first.DelayDays.Should().Be(0); - first.Template.Name.Should().Be("test"); - } - - [Fact] - public void GetFor_FromStatus_Null_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView); - - var init = helper.CreatePimsContext(user, true); - var status = EntityHelper.CreateProjectStatus(1, 7); - init.AddAndSaveRange(status); - var template = EntityHelper.CreateNotificationTemplate(1, "test"); - var psn = new Entity.ProjectStatusNotification(template, null, status.Next(1), Entity.NotificationDelays.None); - init.AddAndSaveChanges(psn); - - var service = helper.CreateService(user); - - // Act - var results = service.GetFor(null, status.Next(1).Id); - - // Assert - Assert.NotNull(results); - Assert.IsAssignableFrom>(results); - var first = results.First(); - first.TemplateId.Should().Be(1); - first.FromStatusId.Should().BeNull(); - first.ToStatusId.Should().Be(2); - first.Priority.Should().Be(template.Priority); - first.Delay.Should().Be(Entity.NotificationDelays.None); - first.DelayDays.Should().Be(0); - first.Template.Name.Should().Be("test"); - } - - [Fact] - public void GetFor_ToStatus_Null_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView); - - var init = helper.CreatePimsContext(user, true); - var status = EntityHelper.CreateProjectStatus(1, 7); - init.AddAndSaveRange(status); - var template = EntityHelper.CreateNotificationTemplate(1, "test"); - var psn = new Entity.ProjectStatusNotification(template, status.Next(0), null, Entity.NotificationDelays.None); - init.AddAndSaveChanges(psn); - - var service = helper.CreateService(user); - - // Act - var results = service.GetFor(status.Next(0).Id, null); - - // Assert - Assert.NotNull(results); - Assert.IsAssignableFrom>(results); - var first = results.First(); - first.TemplateId.Should().Be(1); - first.FromStatusId.Should().Be(1); - first.ToStatusId.Should().BeNull(); - first.Priority.Should().Be(template.Priority); - first.Delay.Should().Be(Entity.NotificationDelays.None); - first.DelayDays.Should().Be(0); - first.Template.Name.Should().Be("test"); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Services/ProjectReportServiceTest.cs b/backend/tests/unit/dal/Services/ProjectReportServiceTest.cs deleted file mode 100644 index 3ff8ac5fb9..0000000000 --- a/backend/tests/unit/dal/Services/ProjectReportServiceTest.cs +++ /dev/null @@ -1,920 +0,0 @@ -using FluentAssertions; -using Microsoft.Extensions.Options; -using Pims.Core.Comparers; -using Pims.Core.Test; -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using Pims.Dal.Exceptions; -using Pims.Dal.Security; -using Pims.Dal.Services; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Text.Json; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Dal.Test.Services -{ - [Trait("category", "unit")] - [Trait("category", "dal")] - [Trait("group", "project")] - [ExcludeFromCodeCoverage] - public class ProjectReportServiceTest - { - #region Constructors - public ProjectReportServiceTest() { } - #endregion - - #region Tests - #region GetAll - /// - /// User does not have 'reports-spl' claim. - /// - [Fact] - public void GetAll_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - var filter = new ProjectFilter(); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.GetAll()); - } - - [Fact] - public void GetAll() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - - using var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - - init.SetStatus(project, "SPL", "AP-SPL"); - var projectReport = init.CreateProjectReport(1, "name", DateTime.UtcNow, DateTime.UtcNow.AddDays(-1), false, project.Agency); - init.SaveChanges(); - - var options = Options.Create(new PimsOptions() { }); - var service = helper.CreateService(user, options); - - // Act - var result = service.GetAll(); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - Assert.NotEmpty(result); - } - #endregion - - #region Get Project Report - /// - /// User does not have 'reports-spl' claim. - /// - [Fact] - public void Get_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - var projectReport = EntityHelper.CreateProjectReport(1); - helper.CreatePimsContext(user).AddAndSaveChanges(projectReport); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Get(1)); - } - - /// - /// Project Report does not exist. - /// - [Fact] - public void Get_KeyNotFound() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - var projectReport = EntityHelper.CreateProjectReport(1); - helper.CreatePimsContext(user).AddAndSaveChanges(projectReport); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Get(2)); - } - - /// - /// Project Report found. - /// - [Fact] - public void Get() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - - init.SetStatus(project, "SPL", "AP-SPL"); - var projectReport = init.CreateProjectReport(1, "name", DateTime.UtcNow, DateTime.UtcNow.AddDays(-1), false, project.Agency); - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - var result = service.Get(projectReport.Id); - - // Assert - Assert.NotNull(result); - Assert.Equal(projectReport, result, new ShallowPropertyCompare()); - Assert.NotNull(projectReport.From); - Assert.NotNull(projectReport.To); - Assert.NotNull(projectReport.Name); - } - #endregion - - #region Get Project Report Snapshots - /// - /// User does not have 'reports-spl' claim. - /// - [Fact] - public void GetSnapshots_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.GetSnapshots(1)); - } - - /// - /// Project Report does not exist. - /// - [Fact] - public void GetSnapshots_KeyNotFound() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.GetSnapshots(2)); - } - - /// - /// User does not have 'reports-spl' claim. - /// - [Fact] - public void GetSnapshots_ByReport_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - var projectReport = EntityHelper.CreateProjectReport(1); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.GetSnapshots(projectReport)); - } - - /// - /// Project Report does not exist. - /// - [Fact] - public void GetSnapshots_ByReport_KeyNotFound() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - - init.SetStatus(project, "SPL", "AP-SPL"); - var projectReport = init.CreateProjectReport(1, "name", DateTime.UtcNow, DateTime.UtcNow.AddDays(-1), false, project.Agency); - var snapshot = init.CreateProjectSnapshot(1, agency: project.Agency, snapshotOn: projectReport.To); - snapshot.Project = project; - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.GetSnapshots(projectReport)); - } - - /// - /// Project Report has null to date. - /// - [Fact] - public void GetSnapshots_ByReport_Throws_ArgumentNullException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - var projectReport = EntityHelper.CreateProjectReport(1); - - var service = helper.CreateService(user); - - // won't throw null exception anymore because the ProjectReport's To field will never be null - var snapshots = service.GetSnapshots(projectReport); - - // Act - // Assert - Assert.Equal(snapshots.Count(), 0); - } - - /// - /// Project Report Snapshots found. - /// - [Fact] - public void GetSnapshots_ById() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - - init.SetStatus(project, "SPL", "AP-SPL"); - var projectReport = init.CreateProjectReport(1, "name", DateTime.UtcNow, DateTime.UtcNow.AddDays(-1), false, project.Agency); - var snapshot = init.CreateProjectSnapshot(1, agency: project.Agency, snapshotOn: projectReport.To); - snapshot.Project = project; - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - var result = service.GetSnapshots(projectReport.Id); - - // Assert - Assert.NotNull(result); - Assert.Equal(snapshot, result.First(), new ShallowPropertyCompare()); - } - - /// - /// Project Report Snapshots found, and to snapshot and from snapshot used to calculate variance if project id matches. - /// - [Fact] - public void GetSnapshots_ByReport_Variance() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - - init.SetStatus(project, "SPL", "AP-SPL"); - var projectReport = init.CreateProjectReport(1, "name", DateTime.UtcNow, DateTime.UtcNow.AddDays(-1), false, project.Agency); - var toSnapshot = init.CreateProjectSnapshot(1, agency: project.Agency, snapshotOn: projectReport.To); - var fromSnapshot = init.CreateProjectSnapshot(2, agency: project.Agency, snapshotOn: projectReport.From); - toSnapshot.Project = project; - toSnapshot.ProjectId = project.Id; - var toMetadata = new Entity.Models.DisposalProjectSnapshotMetadata() - { - NetProceeds = 100 - }; - toSnapshot.Metadata = JsonSerializer.Serialize(toMetadata); - fromSnapshot.Project = project; - fromSnapshot.ProjectId = project.Id; - var fromMetadata = new Entity.Models.DisposalProjectSnapshotMetadata() - { - NetProceeds = 10 - }; - fromSnapshot.Metadata = JsonSerializer.Serialize(fromMetadata); - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - var result = service.GetSnapshots(projectReport); - - // Assert - Assert.NotNull(result); - JsonSerializer.Deserialize(result.First().Metadata).BaselineIntegrity.Should().Be(90); - } - - /// - /// Project Report Snapshots found, and to snapshot and from snapshot used to calculate variance if the project ids don't match. - /// - [Fact] - public void GetSnapshots_ByReport_NoVariance() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - var project2 = init.CreateProject(2); - - init.SetStatus(project, "SPL", "AP-SPL"); - var projectReport = init.CreateProjectReport(1, "name", DateTime.UtcNow, DateTime.UtcNow.AddDays(-1), false, project.Agency); - var toSnapshot = init.CreateProjectSnapshot(1, agency: project.Agency, snapshotOn: projectReport.To); - var fromSnapshot = init.CreateProjectSnapshot(2, agency: project.Agency, snapshotOn: projectReport.From); - toSnapshot.Project = project; - toSnapshot.ProjectId = project.Id; - fromSnapshot.Project = project2; - var toMetadata = new Entity.Models.DisposalProjectSnapshotMetadata() - { - NetProceeds = 100 - }; - toSnapshot.Metadata = JsonSerializer.Serialize(toMetadata); - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - var result = service.GetSnapshots(projectReport); - - // Assert - Assert.NotNull(result); - JsonSerializer.Deserialize(result.First().Metadata).BaselineIntegrity.Should().Be(100); - } - #endregion - - #region Refresh - /// - /// User with appropriate permission refreshes the snapshots for a report. - /// - [Fact] - public void Refresh_ProjectReport() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - - init.SetStatus(project, "SPL", "AP-SPL"); - var projectReport = init.CreateProjectReport(1, agency: project.Agency); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - var snapshots = service.Refresh(projectReport.Id); - - // Assert - Assert.NotEmpty(snapshots); - } - - [Fact] - public void Refresh_ThrowIfNotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsView); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act Assert - Assert.Throws(() => service.Refresh(1)); - } - - [Fact] - public void Refresh_KeyNotFoundException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act Assert - Assert.Throws(() => service.Refresh(1)); - } - #endregion - - #region Add - /// - /// User with appropriate permission successfully adds new project report. - /// - [Fact] - public void Add_ProjectReport() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - - init.SetStatus(project, "SPL", "AP-SPL"); - init.SaveChanges(); - - var projectReport = EntityHelper.CreateProjectReport(1, agency: project.Agency); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - var result = service.Add(projectReport); - var snapshots = service.GetSnapshots(result.Id); - - // Assert - Assert.NotNull(result); - Assert.True(result.Id > 0); - Assert.NotEmpty(snapshots); - } - - /// - /// User with appropriate permission successfully adds new project report with a non-null to date. - /// - [Fact] - public void Add_ProjectReport_ToDate() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - - init.SetStatus(project, "SPL", "AP-SPL"); - init.SaveChanges(); - - DateTime toDate = DateTime.UtcNow.Date; - var projectReport = EntityHelper.CreateProjectReport(1, toDate: toDate, agency: project.Agency); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - var result = service.Add(projectReport); - var snapshots = service.GetSnapshots(result.Id); - - // Assert - Assert.NotNull(result); - Assert.Equal(toDate, result.To); - Assert.True(result.Id > 0); - Assert.NotEmpty(snapshots); - Assert.All(snapshots, s => Assert.Equal(toDate, s.SnapshotOn)); - } - - /// - /// User with appropriate permission successfully adds new project report with a non-null from date. - /// - [Fact] - public void Add_ProjectReport_FromDate() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - DateTime fromDate = DateTime.UtcNow; - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - var snapshot = init.CreateProjectSnapshot(1, agency: project.Agency); - - init.SetStatus(project, "SPL", "AP-SPL"); - snapshot.SnapshotOn = fromDate; - snapshot.Project = project; - var metadata = new DisposalProjectSnapshotMetadata() - { - NetProceeds = 100 - }; - snapshot.Metadata = JsonSerializer.Serialize(metadata); - - init.SaveChanges(); - var projectReport = EntityHelper.CreateProjectReport(1, fromDate: fromDate, agency: project.Agency); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - var result = service.Add(projectReport); - var snapshots = service.GetSnapshots(result.Id); - - // Assert - Assert.NotNull(result); - Assert.Equal(fromDate, result.From); - Assert.True(result.Id > 0); - JsonSerializer.Deserialize(snapshots.First().Metadata).BaselineIntegrity.Should().Be(-100); - } - - /// - /// User with appropriate permission successfully adds new project report with a null from date and a previous report exists in the system. - /// - [Fact] - public void Add_ProjectReport_PreviousReport() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - var report = init.CreateProjectReport(1, agency: project.Agency); - var snapshot = init.CreateProjectSnapshot(1, agency: project.Agency); - - init.SetStatus(project, "SPL", "AP-SPL"); - report.IsFinal = true; - report.To = DateTime.UtcNow; - snapshot.SnapshotOn = report.To.Value; - var metadata = new DisposalProjectSnapshotMetadata() - { - NetProceeds = 100 - }; - snapshot.Metadata = JsonSerializer.Serialize(metadata); - snapshot.Project = project; - - init.SaveChanges(); - var projectReport = EntityHelper.CreateProjectReport(2, agency: project.Agency); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - var result = service.Add(projectReport); - var snapshots = service.GetSnapshots(result.Id); - - // Assert - Assert.NotNull(result); - Assert.True(result.Id > 0); - JsonSerializer.Deserialize(snapshots.First().Metadata).BaselineIntegrity.Should().Be(-100); - } - - [Fact] - public void Add_Permission_Throws_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsView); - var projectReport = EntityHelper.CreateProjectReport(2); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - // Assert - Assert.Throws(() => service.Add(projectReport)); - } - #endregion - - #region Update - - /// - /// User with appropriate permission successfully updates project report. - /// - [Fact] - public void Update() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - init.SetStatus(project, "SPL", "AP-SPL"); - var projectReport = init.CreateProjectReport(1, agency: project.Agency); - projectReport.To = DateTime.UtcNow; - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - var report = service.Get(projectReport.Id); - report.Name = "A new name"; - report.IsFinal = false; - report.From = DateTime.UtcNow.AddHours(-1); - var result = service.Update(report); - - // Assert - Assert.NotNull(result); - Assert.True(result.Id > 0); - result.Should().Be(report); - } - - /// - /// User with appropriate permission successfully updates project report with a new To Date. This should regenerate the snapshots for the new date. - /// - [Fact] - public void Update_NewToDate() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - init.SetStatus(project, "SPL", "AP-SPL"); - var projectReport = init.CreateProjectReport(1, agency: project.Agency, toDate: DateTime.UtcNow); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - var reportToUpdate = EntityHelper.CreateProjectReport(projectReport.Id); - reportToUpdate.To = DateTime.UtcNow.AddHours(1); - var result = service.Update(reportToUpdate); - var snapshots = service.GetSnapshots(result.Id); - - // Assert - Assert.NotNull(result); - Assert.True(result.Id > 0); - result.To.Should().Be(reportToUpdate.To.Value, DateTime.UtcNow.Date.ToString()); - Assert.NotEmpty(snapshots); - Assert.All(snapshots, s => Assert.Equal(reportToUpdate.To.Value, s.SnapshotOn)); - } - - /// - /// User with appropriate permission successfully updates project report From date. this should cause variance calculations to be re-evaluated. - /// - [Fact] - public void Update_FromDate() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - var oldReport = init.CreateProjectReport(1, agency: project.Agency); - var projectReport = init.CreateProjectReport(2, agency: project.Agency); - var snapshot = init.CreateProjectSnapshot(1, agency: project.Agency); - - init.SetStatus(project, "SPL", "AP-SPL"); - oldReport.IsFinal = true; - oldReport.To = DateTime.UtcNow; - snapshot.SnapshotOn = oldReport.To.Value; - var metadata = new DisposalProjectSnapshotMetadata() - { - NetProceeds = 100 - }; - snapshot.Metadata = JsonSerializer.Serialize(metadata); - snapshot.Project = project; - projectReport.To = DateTime.UtcNow.AddDays(1); - - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - var reportToUpdate = EntityHelper.CreateProjectReport(projectReport.Id, toDate: DateTime.UtcNow.AddDays(2)); - reportToUpdate.From = oldReport.To; - var result = service.Update(reportToUpdate); - var snapshots = service.GetSnapshots(result.Id); - - // Assert - Assert.NotNull(result); - Assert.True(result.Id > 0); - Assert.NotEmpty(snapshots); - JsonSerializer.Deserialize(snapshots.First().Metadata).BaselineIntegrity.Should().Be(-100); - } - - [Fact] - public void Update_Permission_Throws_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsView); - var projectReport = EntityHelper.CreateProjectReport(2); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - // Assert - Assert.Throws(() => service.Update(projectReport)); - } - - [Fact] - public void Update_Permission_Throws_KeyNotFoundException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - var projectReport = EntityHelper.CreateProjectReport(2); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - // Assert - Assert.Throws(() => service.Update(projectReport)); - } - - [Fact] - public void Update_NullTo_Throws_ArgumentNullException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - - init.SetStatus(project, "SPL", "AP-SPL"); - init.CreateProjectReport(1, toDate: null, agency: project.Agency); - init.SaveChanges(); - var projectReport = EntityHelper.CreateProjectReport(1, toDate: null, agency: project.Agency); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - // Assert - // this will not throw a null exception anymore, because the To field cannot be null in the test case. - // Related to PIMS-173, after upgrading to EntityFrameworkCore v7.0.4, The in-memory database throws Microsoft.EntityFrameworkCore.DbUpdateException when SaveChanges or SaveChangesAsync is called and a required property is set to null. - // Assert.Throws(() => service.Update(projectReport)); - } - - [Fact] - public void Update_IsFinal_Throws_InvalidOperationException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - - init.SetStatus(project, "SPL", "AP-SPL"); - init.CreateProjectReport(1, toDate: null, agency: project.Agency, isFinal: true); - init.SaveChanges(); - var projectReport = EntityHelper.CreateProjectReport(1, toDate: DateTime.UtcNow, agency: project.Agency, isFinal: true); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - // Assert - Assert.Throws(() => service.Update(projectReport)); - } - - [Fact] - public void Update_ToDates_Throws_InvalidOperationException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - - init.SetStatus(project, "SPL", "AP-SPL"); - var toDate = DateTime.UtcNow.Date; - var report = init.CreateProjectReport(1, toDate: toDate, fromDate: toDate, agency: project.Agency); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - // Assert - Assert.Throws(() => service.Update(report)); - } - #endregion - - #region Remove - /// - /// Project Report does not exist. - /// - [Fact] - public void Remove_KeyNotFound() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - var find = EntityHelper.CreateProjectReport(1); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Remove(find)); - } - - /// - /// User does not have 'spl-reports' claim. - /// - [Fact] - public void Remove_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsView); - var find = EntityHelper.CreateProjectReport(1); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Remove(find)); - } - - /// - /// User has permissions and removes a project report by id. - /// - [Fact] - public void Remove() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ReportsSpl); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - init.SetStatus(project, "SPL", "AP-SPL"); - var projectReport = init.CreateProjectReport(1, agency: project.Agency); - projectReport.To = DateTime.UtcNow; - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - service.Remove(projectReport); - - Assert.Throws(() => - service.Get(projectReport.Id)); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Services/ProjectServiceTest.cs b/backend/tests/unit/dal/Services/ProjectServiceTest.cs deleted file mode 100644 index ff9336fe92..0000000000 --- a/backend/tests/unit/dal/Services/ProjectServiceTest.cs +++ /dev/null @@ -1,3389 +0,0 @@ -using FluentAssertions; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Options; -using Moq; -using Pims.Core.Comparers; -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Entities; -using Pims.Dal.Entities.Models; -using Pims.Dal.Exceptions; -using Pims.Dal.Helpers.Extensions; -using Pims.Dal.Security; -using Pims.Dal.Services; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Text.Json; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Dal.Test.Services -{ - [Trait("category", "unit")] - [Trait("category", "dal")] - [Trait("group", "project")] - [ExcludeFromCodeCoverage] - public class ProjectServiceTest - { - #region Data - public static IEnumerable ProjectFilters => - new List - { - new object[] { new ProjectFilter() { ProjectNumber = "ProjectNumber" }, 1 }, - new object[] { new ProjectFilter() { Name = "Name" }, 1 }, - new object[] { new ProjectFilter() { Agencies = new int[] { 3 } }, 6 }, - new object[] { new ProjectFilter() { TierLevelId = 2 }, 1 }, - new object[] { new ProjectFilter() { StatusId = new int[] { 2 } }, 1 } - }; - - public static IEnumerable Workflows => - new List - { - new object[] { "SubmitDisposal", 6 }, - new object[] { "ReviewDisposal", 1 } - }; - #endregion - - #region Constructors - public ProjectServiceTest() { } - #endregion - - #region Tests - #region GetPage - /// - /// User does not have 'property-view' claim. - /// - [Fact] - public void GetPage_ArgumentNullException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView); - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.GetPage(null)); - } - - /// - /// User does not have 'property-view' claim. - /// - [Fact] - public void GetPage_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - var filter = new ProjectFilter(); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.GetPage(filter)); - } - - [Theory] - [MemberData(nameof(ProjectFilters))] - public void GetPage(ProjectFilter filter, int expectedCount) - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView).AddAgency(1, 3); - - using var init = helper.InitializeDatabase(user); - var projects = init.CreateProjects(1, 20); - projects.Next(0).Name = "-Name-"; - projects.Next(0).AgencyId = 3; - projects.Next(1).Agency = init.Agencies.Find(3); - projects.Next(1).AgencyId = 3; - projects.Next(2).TierLevel = init.TierLevels.Find(2); - projects.Next(2).TierLevelId = 2; - projects.Next(2).AgencyId = 3; - projects.Next(3).Description = "-Description-"; - projects.Next(3).AgencyId = 3; - projects.Next(4).Status = init.ProjectStatus.Find(2); - projects.Next(4).StatusId = 2; - projects.Next(4).AgencyId = 3; - projects.Next(5).ProjectNumber = "-ProjectNumber-"; - projects.Next(5).AgencyId = 3; - init.SaveChanges(); - - var options = Options.Create(new PimsOptions() { Project = new ProjectOptions() { DraftFormat = "TEST-{0:00000}" } }); - var service = helper.CreateService(user, options); - - // Act - var result = service.GetPage(filter); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - Assert.Equal(expectedCount, result.Total); - } - - [Theory] - [MemberData(nameof(ProjectFilters))] - public void GetPage_AsAdmin(ProjectFilter filter, int expectedCount) - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.AdminProjects); - - using var init = helper.InitializeDatabase(user); - var projects = init.CreateProjects(1, 20); - projects.Next(0).Name = "-Name-"; - projects.Next(0).AgencyId = 3; - projects.Next(1).Agency = init.Agencies.Find(3); - projects.Next(1).AgencyId = 3; - projects.Next(2).TierLevel = init.TierLevels.Find(2); - projects.Next(2).TierLevelId = 2; - projects.Next(2).AgencyId = 3; - projects.Next(3).Description = "-Description-"; - projects.Next(3).AgencyId = 3; - projects.Next(4).Status = init.ProjectStatus.Find(2); - projects.Next(4).StatusId = 2; - projects.Next(4).AgencyId = 3; - projects.Next(5).ProjectNumber = "-ProjectNumber-"; - projects.Next(5).AgencyId = 3; - init.SaveChanges(); - - var options = Options.Create(new PimsOptions() { Project = new ProjectOptions() { DraftFormat = "TEST-{0:00000}" } }); - var service = helper.CreateService(user, options); - - // Act - var result = service.GetPage(filter); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - Assert.Equal(expectedCount, result.Total); - } - #endregion - - #region Get Project - /// - /// User does not have 'property-view' claim. - /// - [Fact] - public void Get_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - var project = EntityHelper.CreateProject(1); - helper.CreatePimsContext(user).AddAndSaveChanges(project); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Get($"SPP-{1:00000}")); - } - - /// - /// Project does not exist. - /// - [Fact] - public void Get_KeyNotFound() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView); - var project = EntityHelper.CreateProject(1); - helper.CreatePimsContext(user).AddAndSaveChanges(project); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Get($"SPP-{2:00000}")); - } - - /// - /// User is attempting to view sensitive project from another agency. - /// - [Fact] - public void Get_WrongAgency_KeyNotFound() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.SensitiveView); - var project = EntityHelper.CreateProject(1); - helper.CreatePimsContext(user).AddAndSaveChanges(project); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.Get($"SPP-{1:00000}")); - } - - /// - /// Project found. - /// - [Fact] - public void Get() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView).AddAgency(1); - var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1); - project.SubmittedOn = DateTime.UtcNow; - project.ApprovedOn = DateTime.UtcNow; - project.DeniedOn = DateTime.UtcNow; - project.CancelledOn = DateTime.UtcNow; - var metadata = new DisposalProjectMetadata() - { - InitialNotificationSentOn = DateTime.UtcNow, - ThirtyDayNotificationSentOn = DateTime.UtcNow, - SixtyDayNotificationSentOn = DateTime.UtcNow, - NinetyDayNotificationSentOn = DateTime.UtcNow, - OnHoldNotificationSentOn = DateTime.UtcNow, - ClearanceNotificationSentOn = DateTime.UtcNow, - TransferredWithinGreOn = DateTime.UtcNow, - }; - project.Metadata = JsonSerializer.Serialize(metadata); - init.SaveChanges(); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - var result = service.Get($"SPP-{1:00000}"); - - // Assert - Assert.NotNull(result); - Assert.Equal(EntityState.Detached, context.Entry(result).State); - Assert.Equal(project, result, new ShallowPropertyCompare()); - Assert.NotNull(project.ProjectNumber); - Assert.NotNull(project.GetNote(NoteTypes.Private)); - Assert.NotNull(project.GetNote(NoteTypes.Public)); - Assert.NotNull(project.SubmittedOn); - Assert.NotNull(project.ApprovedOn); - Assert.NotNull(project.DeniedOn); - Assert.NotNull(project.CancelledOn); - Assert.NotNull(project.Name); - Assert.NotNull(project.Agency); - Assert.NotNull(project.Status); - Assert.NotNull(project.TierLevel); - var resultMetadata = JsonSerializer.Deserialize(project.Metadata); - Assert.NotNull(resultMetadata.InitialNotificationSentOn); - Assert.NotNull(resultMetadata.ThirtyDayNotificationSentOn); - Assert.NotNull(resultMetadata.SixtyDayNotificationSentOn); - Assert.NotNull(resultMetadata.NinetyDayNotificationSentOn); - Assert.NotNull(resultMetadata.OnHoldNotificationSentOn); - Assert.NotNull(resultMetadata.ClearanceNotificationSentOn); - Assert.NotNull(resultMetadata.TransferredWithinGreOn); - } - - /// - /// Project found. - /// - [Fact] - public void Get_AsAdmin() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.AdminProjects); - var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1); - helper.CreatePimsContext(user).AddAndSaveChanges(project); - init.SaveChanges(); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - var result = service.Get($"SPP-{1:00000}"); - - // Assert - Assert.NotNull(result); - Assert.Equal(EntityState.Detached, context.Entry(result).State); - Assert.Equal(project, result, new ShallowPropertyCompare()); - } - - /// - /// Project found, but user does not have 'sensitive-view' claim. - /// Remove sensitive buildings. - /// - [Fact] - public void Get_RemoveSensitiveBuildings() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView).AddAgency(1); - - using var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - var sensitive = init.CreateBuilding(parcel, 3); - sensitive.IsSensitive = true; - project.AddProperty(parcel); - project.AddProperty(building, sensitive); - init.SaveChanges(); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - var result = service.Get($"SPP-{1:00000}"); - - // Assert - Assert.NotNull(result); - Assert.Equal(EntityState.Detached, context.Entry(result).State); - Assert.Equal(project, result, new ShallowPropertyCompare()); - Assert.Equal(2, result.Properties.Count()); - Assert.DoesNotContain(result.Properties, p => p.Building?.IsSensitive ?? false); - } - - /// - /// Sensitive project found. - /// - [Fact] - public void Get_Sensitive() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.SensitiveView).AddAgency(1); - - using var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - var sensitive = init.CreateBuilding(parcel, 3); - sensitive.IsSensitive = true; - project.AddProperty(parcel); - project.AddProperty(building, sensitive); - init.SaveChanges(); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - var result = service.Get($"SPP-{1:00000}"); - - // Assert - Assert.NotNull(result); - Assert.Equal(EntityState.Detached, context.Entry(result).State); - Assert.Equal(project, result, new ShallowPropertyCompare()); - Assert.Equal(3, result.Properties.Count()); - Assert.Contains(result.Properties, p => p.Building?.IsSensitive ?? false); - } - - /// - /// Sensitive project found. - /// - [Fact] - public void Get_Sensitive_AsAdmin() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.AdminProjects, Permissions.ProjectView, Permissions.SensitiveView); - - using var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - var sensitive = init.CreateBuilding(parcel, 3); - sensitive.IsSensitive = true; - init.SaveChanges(); - project.AddProperty(parcel); - project.AddProperty(building, sensitive); - init.SaveChanges(); - - var service = helper.CreateService(user); - var context = helper.GetService(); - - // Act - var result = service.Get($"SPP-{1:00000}"); - - // Assert - Assert.NotNull(result); - Assert.Equal(EntityState.Detached, context.Entry(result).State); - Assert.Equal(project, result, new ShallowPropertyCompare()); - Assert.Equal(3, result.Properties.Count()); - Assert.Contains(result.Properties, p => p.Building?.IsSensitive ?? false); - } - #endregion - - #region Add - /// - /// User with appropriate permission successfully adds new project. Project Number is auto-generated. - /// - [Fact] - public async void Add_Project() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectAdd).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var agency = init.Agencies.Find(3); - var tier = init.TierLevels.Find(1); - var status = init.Workflows.Find(1).Status.First(); - var project = EntityHelper.CreateProject(1, agency, tier, status); - project.ProjectNumber = "test-generation-override"; - - var options = Options.Create(new PimsOptions() { Project = new ProjectOptions() { DraftFormat = "TEST-{0:00000}" } }); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - // Act - var result = await service.AddAsync(project); - - // Assert - Assert.NotNull(result); - Assert.NotNull(result.ProjectNumber); - Assert.Matches($"TEST-{1:00000}", result.ProjectNumber); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Once()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny()), Times.Once()); - } - - /// - /// User cannot add project to an agency that they do not belong to. - /// - [Fact] - public async void AddProject_NotInAgency() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectAdd).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - var agency = init.Agencies.Add(new Agency("CODE2", "Min Code 2")).Entity; - init.SaveChanges(); - var tier = init.TierLevels.Find(1); - var status = init.Workflows.Find(1).Status.First(); - var project = EntityHelper.CreateProject(1, agency, tier, status); - project.AgencyId = agency.Id; - project.ProjectNumber = "test-generation-override"; - - var options = Options.Create(new PimsOptions() { Project = new ProjectOptions() { DraftFormat = "TEST-{0:00000}" } }); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.AddAsync(project)); - } - - [Fact] - public async void Add_Financials() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectAdd).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - project.ReportedFiscalYear = 2020; - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - project.NetBook = 5; - project.Assessed = 5; - project.Market = 5; - - // Act - var result = await service.AddAsync(project); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - project.Market.Should().Be(5); - project.NetBook.Should().Be(5); - project.Assessed.Should().Be(5); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Once()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny()), Times.Once()); - } - - [Fact] - public async void Add_Project_SimpleFields() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectAdd, Permissions.ProjectView).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var agency = init.Agencies.Find(3); - var tier = init.TierLevels.Find(1); - var status = init.Workflows.Find(1).Status.First(); - var risk = init.ProjectRisks.Find(1); - var project = EntityHelper.CreateProject(1, agency, tier, status, risk); - project.ProjectNumber = "test-generation-override"; - project.AddOrUpdateNote(NoteTypes.Private, "private note"); - project.AddOrUpdateNote(NoteTypes.Public, "public note"); - project.AddOrUpdateNote(NoteTypes.Exemption, "Providing reasoning for exemption request"); - var metadata = new DisposalProjectMetadata() - { - ExemptionRequested = true - }; - project.Metadata = JsonSerializer.Serialize(metadata); - project.SubmittedOn = DateTime.Now; - project.DeniedOn = DateTime.Now.AddDays(1); - project.ApprovedOn = DateTime.Now.AddDays(2); - - var options = Options.Create(new PimsOptions() { Project = new ProjectOptions() { DraftFormat = "TEST-{0:00000}" } }); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - // Act - await service.AddAsync(project); - var result = service.Get(project.Id); - - // Assert - Assert.NotNull(result); - Assert.NotNull(result.ProjectNumber); - Assert.Matches($"TEST-{1:00000}", result.ProjectNumber); - Assert.Matches("private note", result.GetNote(NoteTypes.Private).Note); - Assert.Matches("public note", result.GetNote(NoteTypes.Public).Note); - Assert.Matches("Providing reasoning for exemption request", result.GetNote(NoteTypes.Exemption).Note); - Assert.True(JsonSerializer.Deserialize(result.Metadata).ExemptionRequested); - Assert.Equal(project.SubmittedOn, result.SubmittedOn); - Assert.Equal(project.DeniedOn, result.DeniedOn); - Assert.Equal(project.ApprovedOn, result.ApprovedOn); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Once()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny()), Times.Once()); - } - - [Fact] - public async void Add_DraftStatus() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectAdd).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var agency = init.Agencies.Find(3); - var tier = init.TierLevels.Find(1); - var status = init.Workflows.Find(1).Status.First(); - var risk = init.ProjectRisks.Find(1); - var project = EntityHelper.CreateProject(1, agency, tier, status, risk); - - var options = Options.Create(new PimsOptions() { Project = new ProjectOptions() { NumberFormat = "TEST-{0:00000}" } }); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - // Act - var result = await service.AddAsync(project); - - // Assert - Assert.NotNull(result); - Assert.Equal(project, result); - Assert.Equal(1, result.StatusId); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Once()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny()), Times.Once()); - } - - [Fact] - public async void Add_AddTasks() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectAdd).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var agency = init.Agencies.Find(3); - var tier = init.TierLevels.Find(1); - var status = init.Workflows.Find(1).Status.First(); - var project = EntityHelper.CreateProject(1, agency, tier, status); - - var tasks = EntityHelper.CreateDefaultTasks(); - var task = EntityHelper.CreateTask(20, "test tasks"); - init.AddAndSaveRange(tasks).AddAndSaveChanges(task); - - project.Status.Tasks.Add(task); - init.UpdateAndSaveChanges(project.Status); - - project.Tasks.Add(new Entity.ProjectTask(project, task)); - - var options = Options.Create(new PimsOptions() { Project = new ProjectOptions() { NumberFormat = "TEST-{0:00000}" } }); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - // Act - var result = await service.AddAsync(project); - - // Assert - Assert.NotNull(result); - Assert.Equal(project, result); - Assert.Equal(1, result.StatusId); - Assert.Single(result.Tasks); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Once()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void Add_DefaultTasks() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectAdd).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var agency = init.Agencies.Find(3); - var tier = init.TierLevels.Find(1); - var status = init.Workflows.Find(1).Status.First(); - var project = EntityHelper.CreateProject(1, agency, tier, status); - - var tasks = EntityHelper.CreateDefaultTasks(project.Status); - init.AddAndSaveRange(tasks); - - var options = Options.Create(new PimsOptions() { Project = new ProjectOptions() { NumberFormat = "TEST-{0:00000}" } }); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - // Act - var result = await service.AddAsync(project); - - // Assert - Assert.NotNull(result); - Assert.Equal(project, result); - Assert.Equal(1, result.StatusId); - Assert.Equal(tasks.Count(), result.Tasks.Count()); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Once()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void Add_DefaultResponses() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectAdd).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var agency = init.Agencies.Find(3); - var tier = init.TierLevels.Find(1); - var status = init.Workflows.Find(1).Status.First(); - var project = EntityHelper.CreateProject(1, agency, tier, status); - - var response = EntityHelper.CreateResponse(project.Id, project.AgencyId); - project.Responses.Add(response); - - - var options = Options.Create(new PimsOptions() { Project = new ProjectOptions() { NumberFormat = "TEST-{0:00000}" } }); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - // Act - var result = await service.AddAsync(project); - - // Assert - Assert.NotNull(result); - Assert.Equal(project, result); - Assert.Equal(1, result.StatusId); - result.Responses.Should().BeEquivalentTo(new List() { response }); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Once()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void Add_NoProject_Throws_ArgumentNullException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectAdd); - - var service = helper.CreateService(user); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.AddAsync(null)); - } - - [Fact] - public async void Add_Permission_Throws_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView); - - var init = helper.InitializeDatabase(user); - init.SaveChanges(); - var project = EntityHelper.CreateProject(1); - - helper.CreatePimsContext(user).AddAndSaveChanges(project.Agency); - - var options = Options.Create(new PimsOptions() { Project = new ProjectOptions() { NumberFormat = "TEST-{0:00000}" } }); - var service = helper.CreateService(user, options); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.AddAsync(project)); - } - - [Fact] - public async void Add_NoAgency_Throws_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectAdd); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = EntityHelper.CreateProject(1); - - var options = Options.Create(new PimsOptions() { Project = new ProjectOptions() { NumberFormat = "TEST-{0:00000}" } }); - var service = helper.CreateService(user, options); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.AddAsync(project)); - } - - [Fact] - public async void Add_Agency_Throws_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectAdd).AddAgency(2); - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = EntityHelper.CreateProject(1); - - var options = Options.Create(new PimsOptions() { Project = new ProjectOptions() { NumberFormat = "TEST-{0:00000}" } }); - var service = helper.CreateService(user, options); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.AddAsync(project)); - } - #endregion - - #region Update - [Fact] - public async void Update() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(3, 3); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - options.Value.Project.NumberFormat = "TEST-{0:00000}"; - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - // Act - var projectToUpdate = EntityHelper.CreateProject(3); - projectToUpdate.ProjectNumber = project.ProjectNumber; - projectToUpdate.Description = "A new description"; - var result = await service.UpdateAsync(projectToUpdate); - - // Assert - Assert.NotNull(result); - Assert.Equal("A new description", result.Description); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void Update_Notes() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1, 3); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - options.Value.Project.NumberFormat = "TEST-{0:00000}"; - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - // Act - var projectToUpdate = EntityHelper.CreateProject(1, 3); - projectToUpdate.ProjectNumber = project.ProjectNumber; - var projectNote = new ProjectNote() - { - Note = "test note", - NoteType = NoteTypes.LoanTerms, - }; - projectToUpdate.Notes.Add(projectNote); - await service.UpdateAsync(projectToUpdate); - var result = service.Get(projectToUpdate.Id); - - // Assert - Assert.NotNull(result); - result.Notes.Should().Contain(projectNote); - queueService.Verify(m => m.NotificationQueue.GenerateNotification(It.IsAny(), "Project Shared Note Changed"), Times.Never()); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void Update_SharedNote() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1, 3); - var template = init.CreateNotificationTemplate(1, "Project Shared Note Changed"); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotification(It.IsAny(), It.IsAny())).Returns(new NotificationQueue(template, "test@test.com", template.Subject, template.Body)); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - // Act - var projectToUpdate = EntityHelper.CreateProject(1, 3); - projectToUpdate.ProjectNumber = project.ProjectNumber; - projectToUpdate.AddOrUpdateNote(NoteTypes.Public, "changed value"); - var result = await service.UpdateAsync(projectToUpdate); - - // Assert - Assert.NotNull(result); - result.GetNote(NoteTypes.Public).Note.Should().Be(project.GetNote(NoteTypes.Public).Note); - queueService.Verify(m => m.NotificationQueue.GenerateNotification(It.IsAny(), "Project Shared Note Changed"), Times.Once()); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void Update_Financials() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - project.ReportedFiscalYear = 2020; - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - project.Market = 15; - project.Assessed = 15; - project.NetBook = 15; - // Act - var projectToUpdate = service.Get(project.Id); - await service.UpdateAsync(projectToUpdate); - var result = service.Get(projectToUpdate.Id); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - project.Market.Should().Be(15); - project.NetBook.Should().Be(15); - project.Assessed.Should().Be(15); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void Update_SimpleFields() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1, 3); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - options.Value.Project.NumberFormat = "TEST-{0:00000}"; - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - // Act - var projectToUpdate = EntityHelper.CreateProject(1, 3); - projectToUpdate.ProjectNumber = project.ProjectNumber; - projectToUpdate.Description = "A new description"; - projectToUpdate.AddOrUpdateNote(NoteTypes.Private, "private Note"); - projectToUpdate.AddOrUpdateNote(NoteTypes.Public, "public Note"); - projectToUpdate.SubmittedOn = new DateTime(); - projectToUpdate.ApprovedOn = new DateTime().AddDays(1); - projectToUpdate.DeniedOn = new DateTime().AddDays(2); - - await service.UpdateAsync(projectToUpdate); - var result = service.Get(projectToUpdate.Id); - - // Assert - Assert.NotNull(result); - Assert.Equal("A new description", result.Description); - Assert.Equal("private Note", result.GetNote(NoteTypes.Private).Note); - Assert.Equal("public Note", result.GetNote(NoteTypes.Public).Note); - Assert.Equal(projectToUpdate.SubmittedOn, result.SubmittedOn); - Assert.Equal(projectToUpdate.ApprovedOn, result.ApprovedOn); - Assert.Equal(projectToUpdate.DeniedOn, result.DeniedOn); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void Update_AsAdmin() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.AdminProjects).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - options.Value.Project.NumberFormat = "TEST-{0:00000}"; - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - // Act - var projectToUpdate = EntityHelper.CreateProject(1, 3); - projectToUpdate.ProjectNumber = project.ProjectNumber; - projectToUpdate.Description = "A new description"; - await service.UpdateAsync(projectToUpdate); - var result = service.Get(project.ProjectNumber); - - // Assert - Assert.NotNull(result); - Assert.Equal("A new description", result.Description); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void Update_Task() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1, 3); - var task = init.CreateTask(20, "testing", project.Status); - init.AddAndSaveChanges(task); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - options.Value.Project.NumberFormat = "TEST-{0:00000}"; - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - // Act - var projectToUpdate = EntityHelper.CreateProject(1, 3); - projectToUpdate.ProjectNumber = project.ProjectNumber; - projectToUpdate.AddTask(task); - var result = await service.UpdateAsync(projectToUpdate); - - // Assert - Assert.NotNull(result); - Assert.Single(result.Tasks); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void Update_AddParcel() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1, 3); - var parcel = init.CreateParcel(1, 3); - - init.AddAndSaveChanges(parcel); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - options.Value.Project.NumberFormat = "TEST-{0:00000}"; - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - // Act - var projectToUpdate = EntityHelper.CreateProject(1, 3); - projectToUpdate.ProjectNumber = project.ProjectNumber; - projectToUpdate.AddProperty(parcel); - parcel.ProjectNumbers = null; - await service.UpdateAsync(projectToUpdate); - var result = service.Get(project.ProjectNumber); - - // Assert - Assert.NotNull(result); - Assert.Single(result.Properties); - Assert.Contains(projectToUpdate.ProjectNumber, result.Properties.FirstOrDefault().Parcel.ProjectNumbers); - Assert.Equal(Entity.PropertyTypes.Land, result.Properties.First().PropertyType); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void Update_Response() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1); - var response = init.CreateResponse(project.Id, project.AgencyId); - init.AddAndSaveChanges(response); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - options.Value.Project.NumberFormat = "TEST-{0:00000}"; - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - // Act - var projectToUpdate = service.Get(project.ProjectNumber); - var result = await service.UpdateAsync(projectToUpdate); - - // Assert - Assert.NotNull(result); - result.Responses.Should().HaveCount(1); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void Update_IgnoreResponse() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1); - var response = init.CreateResponse(project.Id, project.AgencyId); - init.AddAndSaveChanges(response); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - options.Value.Project.NumberFormat = "TEST-{0:00000}"; - var service = helper.CreateService(user, options); - - var queueService = helper.GetMock(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - var mockNotificationService = helper.GetMock(); - - // Act - var projectToUpdate = service.Get(project.ProjectNumber); - projectToUpdate.Responses.First().Response = NotificationResponses.Unsubscribe; - var result = await service.UpdateAsync(projectToUpdate); - - // Assert - Assert.NotNull(result); - result.Responses.Should().HaveCount(1); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - mockNotificationService.Verify(m => m.CancelAsync(It.IsAny>()), Times.Once()); - } - - [Fact] - public async void Update_RemoveResponse() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1); - var response = init.CreateResponse(project.Id, project.AgencyId); - init.AddAndSaveChanges(response); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - options.Value.Project.NumberFormat = "TEST-{0:00000}"; - var service = helper.CreateService(user, options); - - var queueService = helper.GetMock(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - var mockNotificationService = helper.GetMock(); - - // Act - var projectToUpdate = service.Get(project.ProjectNumber); - projectToUpdate.Responses.Clear(); - var result = await service.UpdateAsync(projectToUpdate); - - // Assert - Assert.NotNull(result); - result.Responses.Should().HaveCount(0); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - mockNotificationService.Verify(m => m.CancelAsync(It.IsAny>()), Times.Once()); - } - - [Fact] - public async void Update_AddSubscribeResponse() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1, 3); - project.ApprovedOn = DateTime.UtcNow; - init.SaveChanges(); - var response = init.CreateResponse(project.Id, 3); - response.Response = NotificationResponses.Watch; - response.Agency = project.Agency; - var template = init.CreateNotificationTemplate(1, "test"); - template.Audience = NotificationAudiences.WatchingAgencies; - init.ProjectStatusNotifications.Add(new ProjectStatusNotification(template, null, project.Status, NotificationDelays.Days, 30)); - init.AddAndSaveChanges(response); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - options.Value.Project.NumberFormat = "TEST-{0:00000}"; - var service = helper.CreateService(user, options); - - var mockQueueService = helper.GetMock(); - mockQueueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - mockQueueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - // Act - var projectToUpdate = service.Get(project.ProjectNumber); - var addResponse = EntityHelper.CreateResponse(projectToUpdate.Id, 3); - addResponse.Response = NotificationResponses.Subscribe; - addResponse.Agency = projectToUpdate.Agency; - projectToUpdate.Responses.Add(addResponse); - var result = await service.UpdateAsync(projectToUpdate); - - // Assert - Assert.NotNull(result); - result.Responses.Should().HaveCount(1); - mockQueueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - mockQueueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - mockQueueService.Verify(m => m.NotificationQueue.GenerateNotification(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Once()); - } - - /** - * Only financials and classifications will be updated by the service. Other updates should be ignored. - */ - [Fact] - public async void Update_UpdateParcel_IgnoredField() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1); - var parcel = init.CreateParcel(1, project.Agency); - var updatedParcel = init.CreateParcel(2, project.Agency); - project.AddProperty(parcel); - init.AddAndSaveChanges(parcel); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - options.Value.Project.NumberFormat = "TEST-{0:00000}"; - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - // Act - var projectToUpdate = service.Get(project.ProjectNumber); - updatedParcel.Description = "updated"; - projectToUpdate.Properties.First().Parcel = updatedParcel; - await service.UpdateAsync(projectToUpdate); - var result = service.Get(project.ProjectNumber); - - // Assert - Assert.NotNull(result); - Assert.Single(result.Properties); - Assert.Equal(Entity.PropertyTypes.Land, result.Properties.First().PropertyType); - Assert.Equal("description-1", result.Properties.First().Parcel.Description); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - /** - * Classification and financials are the only supported update fields - */ - [Fact] - public async void Update_UpdateParcel_Supported() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1, 3); - var parcel = init.CreateParcel(1, project.Agency); - var parcelEvaluation = init.CreateEvaluation(parcel, DateTime.UtcNow); - project.AddProperty(parcel); - init.AddAndSaveChanges(parcel); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - options.Value.Project.NumberFormat = "TEST-{0:00000}"; - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - // Act - var projectToUpdate = EntityHelper.CreateProject(1, 3); - var parcelToUpdate = EntityHelper.CreateParcel(1, 3); - var parcelEvaluationToUpdate = EntityHelper.CreateEvaluation(parcelToUpdate, DateTime.UtcNow); - projectToUpdate.ProjectNumber = project.ProjectNumber; - projectToUpdate.AddProperty(parcelToUpdate); - projectToUpdate.Properties.First().Id = project.Properties.First().Id; - projectToUpdate.Properties.First().Parcel.ClassificationId = (int)ClassificationTypes.SurplusActive; - projectToUpdate.Properties.First().Parcel.Evaluations.Add(parcelEvaluationToUpdate); - await service.UpdateAsync(projectToUpdate); - var result = service.Get(project.ProjectNumber); - - // Assert - Assert.NotNull(result); - result.Properties.Should().HaveCount(1); - result.Properties.First().PropertyType.Should().Be(Entity.PropertyTypes.Land); - result.Properties.First().Parcel.ClassificationId.Should().Be((int)ClassificationTypes.SurplusActive); - result.Properties.First().Parcel.Evaluations.Should().HaveCount(2); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void Update_AddBuilding() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1, 3); - var parcel = init.CreateParcel(1, 3); - var building = init.CreateBuilding(parcel, 20); - init.AddAndSaveChanges(building); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - options.Value.Project.NumberFormat = "TEST-{0:00000}"; - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - // Act - var projectToUpdate = EntityHelper.CreateProject(1, 3); - projectToUpdate.ProjectNumber = project.ProjectNumber; - projectToUpdate.AddProperty(building); - building.ProjectNumbers = null; - await service.UpdateAsync(projectToUpdate); - var result = service.Get(project.ProjectNumber); - - // Assert - Assert.NotNull(result); - result.Properties.Should().HaveCount(1); - Assert.Contains(projectToUpdate.ProjectNumber, result.Properties.FirstOrDefault().Building.ProjectNumbers); - result.Properties.First().PropertyType.Should().Be(Entity.PropertyTypes.Building); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - /** - * Only financials and classifications will be updated by the service. Other updates should be ignored. - */ - [Fact] - public async void Update_UpdateBuilding_IgnoredField() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1); - var parcel = init.CreateParcel(1, project.Agency); - var building = init.CreateBuilding(parcel, 20); - var newBuilding = init.CreateBuilding(parcel, 21); - project.AddProperty(building); - init.AddAndSaveChanges(building); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - options.Value.Project.NumberFormat = "TEST-{0:00000}"; - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - // Act - var projectToUpdate = service.Get(project.ProjectNumber); - newBuilding.Description = "updated"; - projectToUpdate.Properties.First().Building = newBuilding; - await service.UpdateAsync(projectToUpdate); - var result = service.Get(project.ProjectNumber); - - // Assert - Assert.NotNull(result); - result.Properties.Should().HaveCount(1); - result.Properties.First().PropertyType.Should().Be(Entity.PropertyTypes.Building); - result.Properties.First().Building.Description.Should().Be("description"); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - /** - * Classification and financials are the only supported update fields - */ - [Fact] - public async void Update_UpdateBuilding_Supported() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1); - var parcel = init.CreateParcel(1, project.Agency); - var building = init.CreateBuilding(parcel, 20); - var newClassification = init.PropertyClassifications.Find(2); - var parcelEvaluation = init.CreateEvaluation(building, DateTime.UtcNow); - project.AddProperty(building); - init.AddAndSaveChanges(building); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - options.Value.Project.NumberFormat = "TEST-{0:00000}"; - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - // Act - var projectToUpdate = service.Get(project.ProjectNumber); - projectToUpdate.Properties.First().Building.Classification = newClassification; - projectToUpdate.Properties.First().Building.ClassificationId = (int)ClassificationTypes.SurplusActive; - projectToUpdate.Properties.First().Building.Evaluations.Add(parcelEvaluation); - await service.UpdateAsync(projectToUpdate); - var result = service.Get(project.ProjectNumber); - - // Assert - Assert.NotNull(result); - result.Properties.Should().HaveCount(1); - result.Properties.First().PropertyType.Should().Be(Entity.PropertyTypes.Building); - result.Properties.First().Building.ClassificationId.Should().Be((int)ClassificationTypes.SurplusActive); - result.Properties.First().Building.Evaluations.Should().HaveCount(2); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void Update_NoProject_Throws_ArgumentNullException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectEdit); - - var service = helper.CreateService(user); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.UpdateAsync(null)); - } - - [Fact] - public async void Update_Permission_Throws_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView); - var project = EntityHelper.CreateProject(1); - - helper.CreatePimsContext(user).AddAndSaveChanges(project.Agency); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - options.Value.Project.NumberFormat = "TEST-{0:00000}"; - var service = helper.CreateService(user, options); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.UpdateAsync(project)); - } - - [Fact] - public async void Update_NoAgency_Throws_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectEdit); - using var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - options.Value.Project.NumberFormat = "TEST-{0:00000}"; - var service = helper.CreateService(user, options); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.UpdateAsync(project)); - } - - [Fact] - public async void Update_Agency_Throws_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectEdit).AddAgency(2); - using var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1); - init.SaveChanges(); - - helper.CreatePimsContext(user).AddAndSaveChanges(project); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - options.Value.Project.NumberFormat = "TEST-{0:00000}"; - var service = helper.CreateService(user, options); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.UpdateAsync(project)); - } - - [Fact] - public async void Update_ChangeAgency_Throws_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - using var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1, 3); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - options.Value.Project.NumberFormat = "TEST-{0:00000}"; - var service = helper.CreateService(user, options); - - // Act - var projectToUpdate = service.Get(project.ProjectNumber); - projectToUpdate.AgencyId = 2; - - // Assert - await Assert.ThrowsAsync(async () => await service.UpdateAsync(projectToUpdate)); - } - - [Fact] - public async void Update_ProjectParcelAgencyMismatch_Throws_BusinessException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyEdit, Permissions.PropertyView, Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - using var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1); - var parcel = init.CreateParcel(1); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - options.Value.Project.NumberFormat = "TEST-{0:00000}"; - var service = helper.CreateService(user, options); - - // Act - parcel.AgencyId = 2; - var projectToUpdate = service.Get(project.ProjectNumber); - projectToUpdate.AddProperty(parcel); - - // Assert - await Assert.ThrowsAsync(async () => await service.UpdateAsync(projectToUpdate)); - } - - [Fact] - public async void Update_ProjectBuildingAgencyMismatch_Throws_BusinessException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyEdit, Permissions.PropertyView, Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - using var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1); - var parcel = init.CreateParcel(1); - var building = init.CreateBuilding(parcel, 2); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - options.Value.Project.NumberFormat = "TEST-{0:00000}"; - var service = helper.CreateService(user, options); - - // Act - building.AgencyId = 2; - var projectToUpdate = service.Get(project.ProjectNumber); - projectToUpdate.AddProperty(building); - - // Assert - await Assert.ThrowsAsync(async () => await service.UpdateAsync(projectToUpdate)); - } - - [Fact] - public async void Update_ParcelInProject_Allowed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyEdit, Permissions.PropertyView, Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - var newProject = init.CreateProject(2, project.Agency); - var parcel = init.CreateParcel(1, project.Agency); - parcel.UpdateProjectNumbers(project.ProjectNumber); - project.AddProperty(parcel); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - options.Value.Project.NumberFormat = "TEST-{0:00000}"; - var service = helper.CreateService(user, options); - - var mockPimsService = helper.GetMock(); - mockPimsService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - // Act - var projectToUpdate = service.Get(newProject.ProjectNumber); - projectToUpdate.AddProperty(parcel); - - // Assert - await service.UpdateAsync(projectToUpdate); - } - - [Fact] - public async void Update_BuildingInProject_Allowed() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyEdit, Permissions.PropertyView, Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - var newProject = init.CreateProject(2, project.Agency); - var parcel = init.CreateParcel(1, project.Agency); - var building = init.CreateBuilding(parcel, 2, agency: project.Agency); - building.UpdateProjectNumbers(project.ProjectNumber); - project.AddProperty(parcel); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - options.Value.Project.NumberFormat = "TEST-{0:00000}"; - var service = helper.CreateService(user, options); - - var mockPimsService = helper.GetMock(); - mockPimsService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - // Act - var projectToUpdate = service.Get(newProject.ProjectNumber); - projectToUpdate.AddProperty(building); - - // updating a building already in a project should not throw an exception. - await service.UpdateAsync(projectToUpdate); - } - #endregion - - #region Remove - /// - /// Project does not exist. - /// - [Fact] - public async void Remove_KeyNotFound() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectDelete); - var find = EntityHelper.CreateProject(1); - var project = EntityHelper.CreateProject(2); - helper.CreatePimsContext(user).AddAndSaveChanges(project); - - var service = helper.CreateService(user); - - // Act - // Assert - await Assert.ThrowsAsync(async () => - await service.RemoveAsync(find)); - } - - /// - /// User does not have 'property-delete' claim. - /// - [Fact] - public async void Remove_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - var project = EntityHelper.CreateProject(1); - helper.CreatePimsContext(user).AddAndSaveChanges(project); - - var service = helper.CreateService(user); - - // Act - // Assert - await Assert.ThrowsAsync(async () => - await service.RemoveAsync(project)); - } - - /// - /// User is attempting to view sensitive project from another agency. - /// - [Fact] - public async void Remove_WrongAgency_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectDelete); - var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1, 12); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - // Act - // Assert - await Assert.ThrowsAsync(async () => - await service.RemoveAsync(project)); - } - - /// - /// User is attempting to view sensitive project from another agency. - /// - [Fact] - public async void Remove_WrongAgency_AsAdmin() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectDelete, Permissions.AdminProjects); - var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1); - helper.CreatePimsContext(user).AddAndSaveChanges(project); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - var context = helper.GetService(); - var notifyService = helper.GetService>(); - notifyService.Setup(m => m.CancelAsync(It.IsAny>())); - - // Act - await service.RemoveAsync(project); - - // Assert - Assert.Equal(EntityState.Detached, context.Entry(project).State); - notifyService.Verify(m => m.CancelAsync(It.IsAny>()), Times.Once); - } - - /// - /// Project found. - /// - [Fact] - public async void Remove_ActiveProject_NotAuthorizedException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectDelete).AddAgency(1); - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - init.SetStatus(project, "ASSESS-DISPOSAL", "AS-I"); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - var context = helper.GetService(); - - // Act - await Assert.ThrowsAsync(async () => await service.RemoveAsync(project)); - } - - /// - /// Project found. - /// - [Fact] - public async void Remove() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectDelete).AddAgency(1); - var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1); - helper.CreatePimsContext(user).AddAndSaveChanges(project); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - var context = helper.GetService(); - var notifyService = helper.GetService>(); - notifyService.Setup(m => m.CancelAsync(It.IsAny>())); - - // Act - await service.RemoveAsync(project); - - // Assert - Assert.Equal(EntityState.Detached, context.Entry(project).State); - notifyService.Verify(m => m.CancelAsync(It.IsAny>()), Times.Once); - - } - #endregion - - #region SetStatus - [Fact] - public async void SetStatus_WithCode_InvalidWorkflow_KeyNotFoundException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var project = init.CreateProject(1, 3); - - var service = helper.CreateService(user); - - var workflowCode = "code"; - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.SetStatusAsync(project, workflowCode)); - } - - [Fact] - public async void SetStatus_WithCode_InvalidStatus_KeyNotFoundException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1, 3); - init.SaveChanges(); - project.StatusId = 999; - - var service = helper.CreateService(user); - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.SetStatusAsync(project, project.Workflow.Code)); - } - - [Fact] - public async void SetStatus_WithCode_NullProject_ArgumentNullException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultProjectStatus(); - var workflows = init.CreateDefaultWorkflows(); - init.SaveChanges(); - init.AddStatusToWorkflow(workflows.First(), init.ProjectStatus.Where(s => s.Id <= 6)).SaveChanges(); - - var service = helper.CreateService(user); - - var workflowCode = workflows.First().Code; - var statusCode = init.ProjectStatus.Find(6).Id; // Submitted Status - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.SetStatusAsync(null, workflowCode)); - } - - [Fact] - public async void SetStatus_NoProject_ArgumentNullException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflows(); - init.SaveChanges(); - init.AddStatusToWorkflow(workflows.First(), init.ProjectStatus.Where(s => s.Id <= 6)).SaveChanges(); - - var service = helper.CreateService(user); - - var workflowCode = workflows.First().Code; - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.SetStatusAsync(null, workflowCode)); - } - - [Fact] - public async void SetStatus_NoRowVersion_RowVersionMissingException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ASSESS-DISPOSAL", "AS-I"); - init.SaveChanges(); - project.RowVersion = null; - - var service = helper.CreateService(user); - - var review = init.ProjectStatus.First(s => s.Code == "AS-D"); - project.StatusId = review.Id; - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.SetStatusAsync(project, project.Workflow.Code)); - } - - [Fact] - public async void SetStatus_NoPermission_NotAuthorizedException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ASSESS-DISPOSAL", "AS-I"); - init.SaveChanges(); - - var service = helper.CreateService(user); - - var review = init.ProjectStatus.First(s => s.Code == "AS-D"); - project.StatusId = review.Id; - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.SetStatusAsync(project, project.Workflow.Code)); - } - - [Fact] - public async void SetStatus_NullWorkflow_ArgumentNullException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ASSESS-DISPOSAL", "AS-I"); - init.SaveChanges(); - - var service = helper.CreateService(user); - - var review = init.ProjectStatus.First(s => s.Code == "AS-D"); - project.StatusId = review.Id; - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.SetStatusAsync(project, (Entity.Workflow)null)); - } - - [Fact] - public async void SetStatus_InvalidProject_KeyNotFoundException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ASSESS-DISPOSAL", "AS-I"); - init.SaveChanges(); - - var service = helper.CreateService(user); - - var find = init.CreateProject(2, 1); - find.StatusId = init.ProjectStatus.Find(6).Id; // Submitted Status - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.SetStatusAsync(find, find.Workflow.Code)); - } - - [Fact] - public async void SetStatus_WrongAgency_NotAuthorizedException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectEdit).AddAgency(2); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ASSESS-DISPOSAL", "AS-I"); - init.SaveChanges(); - - var options = Options.Create(new PimsOptions() { Project = new ProjectOptions() { DraftFormat = "TEST-{0:00000}", DraftWorkflows = new[] { "TEST-WORKFLOW" } } }); - var service = helper.CreateService(user, options); - - var review = init.ProjectStatus.First(s => s.Code == "AS-D"); - project.StatusId = review.Id; - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.SetStatusAsync(project, project.Workflow.Code)); - } - - [Fact] - public async void SetStatus_InvalidTransition_InvalidOperationException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ASSESS-DISPOSAL", "AS-I"); - init.SaveChanges(); - - var service = helper.CreateService(user); - - var review = init.ProjectStatus.First(s => s.Code == "AS-AP"); - project.StatusId = review.Id; - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.SetStatusAsync(project, project.Workflow.Code)); - } - - [Fact] - public async void SetStatus_IncompleteTasks_InvalidOperationException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SaveChanges(); - var draft = init.ProjectStatus.First(s => s.Code == "DR"); - var addProperties = init.ProjectStatus.First(s => s.Code == "DR-P"); - var task = init.CreateTask(1, "Documentation", draft); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var workflowCode = workflows.First().Code; - project.StatusId = addProperties.Id; // Deny Status - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.SetStatusAsync(project, workflowCode)); - } - - [Fact] - public async void SetStatus_SharedNote() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - - var project = init.CreateProject(1); - var template = init.CreateNotificationTemplate(1, "Project Shared Note Changed"); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotification(It.IsAny(), It.IsAny())).Returns(new NotificationQueue(template, "test@test.com", template.Subject, template.Body)); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - var workflow = init.Workflows.FirstOrDefault(w => w.Code == "ASSESS-DISPOSAL"); - - // Act - var projectToUpdate = EntityHelper.CreateProject(1); - projectToUpdate.AddOrUpdateNote(NoteTypes.Public, "changed value"); - var result = await service.SetStatusAsync(projectToUpdate, workflow); - - // Assert - Assert.NotNull(result); - result.GetNote(NoteTypes.Public).Note.Should().Be(project.GetNote(NoteTypes.Public).Note); - queueService.Verify(m => m.NotificationQueue.GenerateNotification(It.IsAny(), "Project Shared Note Changed"), Times.Once()); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void SetStatus_Deny_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ASSESS-DISPOSAL", "AS-FNC"); - var parcel = init.CreateParcel(1); - project.AddProperty(parcel); - parcel.UpdateProjectNumbers(project.ProjectNumber); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - var deny = init.ProjectStatus.First(s => s.Code == "DE"); - project.StatusId = deny.Id; // Deny Status - - // Act - project.AddOrUpdateNote(NoteTypes.Public, "this is the reason"); - var result = await service.SetStatusAsync(project, project.Workflow.Code); - - // Assert - Assert.NotNull(result); - result.StatusId.Should().Be(deny.Id); - result.Status.Should().Be(deny); - result.DeniedOn.Should().NotBeNull(); - parcel.ProjectNumbers.Should().NotContain(project.ProjectNumber); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void SetStatus_Cancel_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ERP", "ERP-ON"); - var parcel = init.CreateParcel(1); - project.AddProperty(parcel); - parcel.UpdateProjectNumbers(project.ProjectNumber); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - var notifyService = helper.GetService>(); - notifyService.Setup(m => m.CancelAsync(It.IsAny>())); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - var cancel = init.ProjectStatus.First(s => s.Code == "CA"); - project.StatusId = cancel.Id; // Cancel Status - - // Act - var result = await service.SetStatusAsync(project, project.Workflow.Code); - - // Assert - Assert.NotNull(result); - result.StatusId.Should().Be(cancel.Id); - result.Status.Should().Be(cancel); - result.CancelledOn.Should().NotBeNull(); - parcel.ProjectNumbers.Should().NotContain(project.ProjectNumber); - notifyService.Verify(m => m.CancelAsync(It.IsAny>()), Times.Once); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void SetStatus_OnHold_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ERP", "ERP-ON"); - var parcel = init.CreateParcel(1); - project.AddProperty(parcel); - parcel.UpdateProjectNumbers(project.ProjectNumber); - var metadata = new DisposalProjectMetadata() - { - OnHoldNotificationSentOn = DateTime.UtcNow - }; - project.Metadata = JsonSerializer.Serialize(metadata); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - var onHold = init.ProjectStatus.First(s => s.Code == "ERP-OH"); - project.StatusId = onHold.Id; // On Hold Status - - // Act - var result = await service.SetStatusAsync(project, project.Workflow.Code); - - // Assert - Assert.NotNull(result); - result.StatusId.Should().Be(onHold.Id); - result.Status.Should().Be(onHold); - JsonSerializer.Deserialize(result.Metadata).OnHoldNotificationSentOn.Should().NotBeNull(); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void SetStatus_OnHold_InvalidOperationException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ERP", "ERP-ON"); - var parcel = init.CreateParcel(1); - project.AddProperty(parcel); - parcel.UpdateProjectNumbers(project.ProjectNumber); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var onHold = init.ProjectStatus.First(s => s.Code == "ERP-OH"); - project.StatusId = onHold.Id; // On Hold Status - - // Act - await Assert.ThrowsAsync(async () => await service.SetStatusAsync(project, project.Workflow.Code)); - } - - [Fact] - public async void SetStatus_TransferredWithinGre_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ERP", "ERP-ON"); - var parcel = init.CreateParcel(1); - project.AddProperty(parcel); - parcel.UpdateProjectNumbers(project.ProjectNumber); - var metadata = new DisposalProjectMetadata() - { - TransferredWithinGreOn = DateTime.UtcNow - }; - project.Metadata = JsonSerializer.Serialize(metadata); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - var transferredWithinGre = init.ProjectStatus.First(s => s.Code == "T-GRE"); - project.StatusId = transferredWithinGre.Id; // Transferred within GRE Status - - EntityHelper.CreateAgency(2); - parcel.AgencyId = 2; - EntityHelper.CreatePropertyClassification(2, "new classification"); - parcel.ClassificationId = (int)ClassificationTypes.SurplusActive; - project.Properties.First().Parcel = parcel; - - // Act - var result = await service.SetStatusAsync(project, project.Workflow.Code); - - // Assert - Assert.NotNull(result); - result.StatusId.Should().Be(transferredWithinGre.Id); - result.Status.Should().Be(transferredWithinGre); - JsonSerializer.Deserialize(result.Metadata).TransferredWithinGreOn.Should().NotBeNull(); - var property = result.Properties.First().Parcel; - property.ProjectNumbers.Should().Be("[]"); - property.AgencyId.Should().Be(2); - property.ClassificationId.Should().Be((int)ClassificationTypes.SurplusActive); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void SetStatus_TransferredWithinGre_Success_Subdivisions() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ERP", "ERP-ON"); - var parcel = init.CreateParcel(1); - parcel.PropertyTypeId = (int)PropertyTypes.Subdivision; - var parentParcel = init.CreateParcel(2); - parcel.Parcels.Add(new ParcelParcel() { ParcelId = 2, SubdivisionId = 1, Parcel = parentParcel }); - project.AddProperty(parcel); - parcel.UpdateProjectNumbers(project.ProjectNumber); - var metadata = new DisposalProjectMetadata() - { - TransferredWithinGreOn = DateTime.UtcNow - }; - project.Metadata = JsonSerializer.Serialize(metadata); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - var transferredWithinGre = init.ProjectStatus.First(s => s.Code == "T-GRE"); - project.StatusId = transferredWithinGre.Id; // Transferred within GRE Status - - EntityHelper.CreateAgency(2); - parcel.AgencyId = 2; - EntityHelper.CreatePropertyClassification(2, "new classification"); - parcel.ClassificationId = (int)ClassificationTypes.SurplusActive; - project.Properties.First().Parcel = parcel; - - // Act - var result = await service.SetStatusAsync(project, project.Workflow.Code); - - // Assert - Assert.NotNull(result); - result.StatusId.Should().Be(transferredWithinGre.Id); - result.Status.Should().Be(transferredWithinGre); - project.Properties.First().Parcel.PropertyTypeId.Should().Be((int)PropertyTypes.Land); - parentParcel.ClassificationId.Should().Be((int)ClassificationTypes.Subdivided); - JsonSerializer.Deserialize(result.Metadata).TransferredWithinGreOn.Should().NotBeNull(); - var property = result.Properties.First().Parcel; - property.ProjectNumbers.Should().Be("[]"); - property.AgencyId.Should().Be(2); - property.ClassificationId.Should().Be((int)ClassificationTypes.SurplusActive); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void SetStatus_TransferredWithinGre_Success_SubdivisionsParentNotTransferred() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ERP", "ERP-ON"); - var parcel = init.CreateParcel(1); - parcel.PropertyTypeId = (int)PropertyTypes.Subdivision; - var parentParcel = init.CreateParcel(2); - parcel.Parcels.Add(new ParcelParcel() { ParcelId = 2, SubdivisionId = 1, Parcel = parentParcel }); - project.AddProperty(parcel); - project.AddProperty(parentParcel); - parcel.UpdateProjectNumbers(project.ProjectNumber); - var metadata = new DisposalProjectMetadata() - { - TransferredWithinGreOn = DateTime.UtcNow - }; - project.Metadata = JsonSerializer.Serialize(metadata); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - var transferredWithinGre = init.ProjectStatus.First(s => s.Code == "T-GRE"); - project.StatusId = transferredWithinGre.Id; // Transferred within GRE Status - - EntityHelper.CreateAgency(2); - parcel.AgencyId = 2; - EntityHelper.CreatePropertyClassification(2, "new classification"); - parcel.ClassificationId = (int)ClassificationTypes.SurplusActive; - project.Properties.First().Parcel = parcel; - - // Act - var result = await service.SetStatusAsync(project, project.Workflow.Code); - - // Assert - Assert.NotNull(result); - result.StatusId.Should().Be(transferredWithinGre.Id); - result.Status.Should().Be(transferredWithinGre); - var transferredSubdivision = result.Properties.FirstOrDefault(p => p.Parcel.AgencyId == 2).Parcel; - var nonTransferredParent = result.Properties.FirstOrDefault(p => p.Parcel.AgencyId == 3).Parcel; - parentParcel.ClassificationId.Should().Be((int)ClassificationTypes.Subdivided); - JsonSerializer.Deserialize(result.Metadata).TransferredWithinGreOn.Should().NotBeNull(); - var property = result.Properties.First().Parcel; - transferredSubdivision.PropertyTypeId.Should().Be((int)PropertyTypes.Land); - transferredSubdivision.ProjectNumbers.Should().Be("[]"); - transferredSubdivision.AgencyId.Should().Be(2); - transferredSubdivision.ClassificationId.Should().Be((int)ClassificationTypes.SurplusActive); - nonTransferredParent.AgencyId.Should().Be(3); - nonTransferredParent.ClassificationId.Should().Be((int)ClassificationTypes.Subdivided); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void SetStatus_TransferredWithinGre_InvalidOperationException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ERP", "ERP-ON"); - var parcel = init.CreateParcel(1); - project.AddProperty(parcel); - parcel.UpdateProjectNumbers(project.ProjectNumber); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var transferredWithinGre = init.ProjectStatus.First(s => s.Code == "T-GRE"); - project.StatusId = transferredWithinGre.Id; // Transferred within GRE Status - - // Act - await Assert.ThrowsAsync(async () => await service.SetStatusAsync(project, project.Workflow.Code)); - } - - [Fact] - public async void SetStatus_ApprovedForSpl_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.DisposeApprove, Permissions.AdminProjects, Permissions.ProjectView).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "SPL", "AP-SPL"); - var parcel = init.CreateParcel(1); - project.AddProperty(parcel); - parcel.UpdateProjectNumbers(project.ProjectNumber); - var metadata = new DisposalProjectMetadata() - { - ClearanceNotificationSentOn = DateTime.UtcNow, - RequestForSplReceivedOn = DateTime.UtcNow, - ApprovedForSplOn = DateTime.UtcNow - }; - project.Metadata = JsonSerializer.Serialize(metadata); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - var clearanceNotificationSentOn = init.ProjectStatus.First(s => s.Code == "AP-SPL"); - project.StatusId = clearanceNotificationSentOn.Id; // Approved for SPL status - - EntityHelper.CreateAgency(2); - parcel.AgencyId = 2; - EntityHelper.CreatePropertyClassification(2, "new classification"); - parcel.ClassificationId = (int)ClassificationTypes.SurplusActive; - project.Properties.First().Parcel = parcel; - - // Act - var result = await service.SetStatusAsync(project, project.Workflow.Code); - - // Assert - Assert.NotNull(result); - result.StatusId.Should().Be(clearanceNotificationSentOn.Id); - result.Status.Should().Be(clearanceNotificationSentOn); - JsonSerializer.Deserialize(result.Metadata).ClearanceNotificationSentOn.Should().NotBeNull(); - var property = result.Properties.First().Parcel; - property.AgencyId.Should().Be(2); - property.ClassificationId.Should().Be((int)ClassificationTypes.SurplusActive); - property.IsVisibleToOtherAgencies.Should().BeFalse(); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void SetStatus_ApprovedForSpl_InvalidOperationException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.DisposeApprove, Permissions.AdminProjects, Permissions.ProjectView).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "SPL", "AP-SPL"); - var parcel = init.CreateParcel(1); - project.AddProperty(parcel); - parcel.UpdateProjectNumbers(project.ProjectNumber); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var transferredWithinGre = init.ProjectStatus.First(s => s.Code == "AP-SPL"); - project.StatusId = transferredWithinGre.Id; // Approved for SPL status. - - // Act - await Assert.ThrowsAsync(async () => await service.SetStatusAsync(project, project.Workflow.Code)); - } - - [Fact] - public async void SetStatusAsync_NotInSpl_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.DisposeApprove, Permissions.AdminProjects, Permissions.ProjectView).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ERP", "AP-!SPL"); - var parcel = init.CreateParcel(1); - project.AddProperty(parcel); - parcel.UpdateProjectNumbers(project.ProjectNumber); - var metadata = new DisposalProjectMetadata() - { - ClearanceNotificationSentOn = DateTime.UtcNow - }; - project.Metadata = JsonSerializer.Serialize(metadata); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - var clearanceNotificationSentOn = init.ProjectStatus.First(s => s.Code == "AP-!SPL"); - project.StatusId = clearanceNotificationSentOn.Id; // Not in SPL status - - EntityHelper.CreateAgency(2); - parcel.AgencyId = 2; - EntityHelper.CreatePropertyClassification(2, "new classification"); - parcel.ClassificationId = (int)ClassificationTypes.SurplusActive; - project.Properties.First().Parcel = parcel; - - // Act - var result = await service.SetStatusAsync(project, project.Workflow.Code); - - // Assert - Assert.NotNull(result); - result.StatusId.Should().Be(clearanceNotificationSentOn.Id); - result.Status.Should().Be(clearanceNotificationSentOn); - JsonSerializer.Deserialize(result.Metadata).ClearanceNotificationSentOn.Should().NotBeNull(); - var property = result.Properties.First().Parcel; - property.AgencyId.Should().Be(2); - property.ClassificationId.Should().Be((int)ClassificationTypes.SurplusActive); - property.IsVisibleToOtherAgencies.Should().BeFalse(); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void SetStatusAsync_NotInSpl_InvalidOperationException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.DisposeApprove, Permissions.AdminProjects, Permissions.ProjectView).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ERP", "ERP-ON"); - var parcel = init.CreateParcel(1); - project.AddProperty(parcel); - parcel.UpdateProjectNumbers(project.ProjectNumber); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var notInSpl = init.ProjectStatus.First(s => s.Code == "AP-!SPL"); - var updateProject = init.Projects.First(); - updateProject.StatusId = notInSpl.Id; // Not in SPL status. - - // Act - await Assert.ThrowsAsync(async () => await service.SetStatusAsync(updateProject, project.Workflow.Code)); - } - - [Fact] - public async void SetStatusAsync_PreMarketing_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.DisposeApprove, Permissions.AdminProjects, Permissions.ProjectView).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ERP", "AP-!SPL"); - var parcel = init.CreateParcel(1); - project.AddProperty(parcel); - parcel.UpdateProjectNumbers(project.ProjectNumber); - var metadata = new DisposalProjectMetadata() - { - ClearanceNotificationSentOn = DateTime.UtcNow - }; - project.Metadata = JsonSerializer.Serialize(metadata); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - var clearanceNotificationSentOn = init.ProjectStatus.First(s => s.Code == "AP-!SPL"); - project.StatusId = clearanceNotificationSentOn.Id; // Not in SPL status - - EntityHelper.CreateAgency(2); - parcel.AgencyId = 2; - EntityHelper.CreatePropertyClassification(2, "new classification"); - parcel.ClassificationId = (int)ClassificationTypes.SurplusActive; - project.Properties.First().Parcel = parcel; - - // Act - var result = await service.SetStatusAsync(project, project.Workflow.Code); - - // Assert - Assert.NotNull(result); - result.StatusId.Should().Be(clearanceNotificationSentOn.Id); - result.Status.Should().Be(clearanceNotificationSentOn); - JsonSerializer.Deserialize(result.Metadata).ClearanceNotificationSentOn.Should().NotBeNull(); - var property = result.Properties.First().Parcel; - property.AgencyId.Should().Be(2); - property.ClassificationId.Should().Be((int)ClassificationTypes.SurplusActive); - property.IsVisibleToOtherAgencies.Should().BeFalse(); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void SetStatusAsync_Marketing_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.DisposeApprove, Permissions.AdminProjects, Permissions.ProjectView).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "SPL", "SPL-M"); - var parcel = init.CreateParcel(1); - project.AddProperty(parcel); - parcel.UpdateProjectNumbers(project.ProjectNumber); - var metadata = new DisposalProjectMetadata() - { - MarketedOn = DateTime.UtcNow - }; - project.Metadata = JsonSerializer.Serialize(metadata); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - var marketed = init.ProjectStatus.First(s => s.Code == "SPL-M"); - project.StatusId = marketed.Id; // Marketed status - - EntityHelper.CreateAgency(2); - parcel.AgencyId = 2; - EntityHelper.CreatePropertyClassification(2, "new classification"); - parcel.ClassificationId = (int)ClassificationTypes.SurplusActive; - project.Properties.First().Parcel = parcel; - - // Act - var result = await service.SetStatusAsync(project, project.Workflow.Code); - - // Assert - Assert.NotNull(result); - result.StatusId.Should().Be(marketed.Id); - result.Status.Should().Be(marketed); - JsonSerializer.Deserialize(result.Metadata).MarketedOn.Should().NotBeNull(); - var property = result.Properties.First().Parcel; - property.AgencyId.Should().Be(2); - property.ClassificationId.Should().Be((int)ClassificationTypes.SurplusActive); - property.IsVisibleToOtherAgencies.Should().BeFalse(); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void SetStatusAsync_Marketing_InvalidOperationException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.DisposeApprove, Permissions.AdminProjects, Permissions.ProjectView).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "SPL", "SPL-M"); - var parcel = init.CreateParcel(1); - project.AddProperty(parcel); - parcel.UpdateProjectNumbers(project.ProjectNumber); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var marketed = init.ProjectStatus.First(s => s.Code == "SPL-M"); - project.StatusId = marketed.Id; // Marketing status. - - // Act - await Assert.ThrowsAsync(async () => await service.SetStatusAsync(project, project.Workflow.Code)); - } - - [Fact] - public async void SetStatusAsync_ContractInPlace_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.DisposeApprove, Permissions.AdminProjects, Permissions.ProjectView).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "SPL", "SPL-CIP-C"); - var parcel = init.CreateParcel(1); - project.AddProperty(parcel); - parcel.UpdateProjectNumbers(project.ProjectNumber); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - var contractInPlace = init.ProjectStatus.First(s => s.Code == "SPL-CIP-C"); - project.StatusId = contractInPlace.Id; // Contract in Place status - - EntityHelper.CreateAgency(2); - parcel.AgencyId = 2; - EntityHelper.CreatePropertyClassification(2, "new classification"); - parcel.ClassificationId = (int)ClassificationTypes.SurplusActive; - project.Properties.First().Parcel = parcel; - - // Act - var result = await service.SetStatusAsync(project, project.Workflow.Code); - - // Assert - Assert.NotNull(result); - result.StatusId.Should().Be(contractInPlace.Id); - result.Status.Should().Be(contractInPlace); - var property = result.Properties.First().Parcel; - property.AgencyId.Should().Be(2); - property.ClassificationId.Should().Be((int)ClassificationTypes.SurplusActive); - property.IsVisibleToOtherAgencies.Should().BeFalse(); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void SetStatusAsync_Disposed_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.DisposeApprove, Permissions.AdminProjects, Permissions.ProjectView).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "SPL", "DIS"); - var parcel = init.CreateParcel(1); - project.AddProperty(parcel); - parcel.UpdateProjectNumbers(project.ProjectNumber); - var metadata = new DisposalProjectMetadata() - { - DisposedOn = DateTime.UtcNow - }; - project.Metadata = JsonSerializer.Serialize(metadata); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - var disposed = init.ProjectStatus.First(s => s.Code == "DIS"); - project.StatusId = disposed.Id; // Marketed status - - EntityHelper.CreateAgency(2); - parcel.AgencyId = 2; - EntityHelper.CreatePropertyClassification(2, "new classification"); - parcel.ClassificationId = (int)ClassificationTypes.SurplusActive; - project.Properties.First().Parcel = parcel; - - // Act - var result = await service.SetStatusAsync(project, project.Workflow.Code); - - // Assert - Assert.NotNull(result); - result.StatusId.Should().Be(disposed.Id); - result.Status.Should().Be(disposed); - JsonSerializer.Deserialize(result.Metadata).DisposedOn.Should().NotBeNull(); - var property = result.Properties.First().Parcel; - property.AgencyId.Should().Be(parcel.AgencyId); - property.ClassificationId.Should().Be((int)ClassificationTypes.Disposed); - property.IsVisibleToOtherAgencies.Should().BeFalse(); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void SetStatusAsync_Disposed_Success_Subdivisions() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.DisposeApprove, Permissions.AdminProjects, Permissions.ProjectView).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "SPL", "DIS"); - var parcel = init.CreateParcel(1); - var parentParcel = init.CreateParcel(2); - project.AddProperty(parcel); - parcel.UpdateProjectNumbers(project.ProjectNumber); - parcel.Parcels.Add(new ParcelParcel() { ParcelId = parentParcel.Id, SubdivisionId = parcel.Id, Parcel = parentParcel }); - var metadata = new DisposalProjectMetadata() - { - DisposedOn = DateTime.UtcNow - }; - project.Metadata = JsonSerializer.Serialize(metadata); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - var disposed = init.ProjectStatus.First(s => s.Code == "DIS"); - project.StatusId = disposed.Id; // Marketed status - - EntityHelper.CreateAgency(2); - parcel.AgencyId = 2; - EntityHelper.CreatePropertyClassification(2, "new classification"); - parcel.ClassificationId = (int)ClassificationTypes.SurplusActive; - project.Properties.First().Parcel = parcel; - - // Act - var result = await service.SetStatusAsync(project, project.Workflow.Code); - - // Assert - Assert.NotNull(result); - result.StatusId.Should().Be(disposed.Id); - result.Status.Should().Be(disposed); - JsonSerializer.Deserialize(result.Metadata).DisposedOn.Should().NotBeNull(); - var property = result.Properties.First().Parcel; - property.AgencyId.Should().Be(parcel.AgencyId); - property.ClassificationId.Should().Be((int)ClassificationTypes.Disposed); - property.IsVisibleToOtherAgencies.Should().BeFalse(); - property.Parcels.Should().BeEmpty(); - property.PropertyTypeId.Should().Be((int)PropertyTypes.Land); - parentParcel.ClassificationId.Should().Be((int)ClassificationTypes.Subdivided); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - - } - - [Fact] - public async void SetStatusAsync_Disposed_InvalidOperationException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.DisposeApprove, Permissions.AdminProjects, Permissions.ProjectView).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "SPL", "DIS"); - var parcel = init.CreateParcel(1); - project.AddProperty(parcel); - parcel.UpdateProjectNumbers(project.ProjectNumber); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var marketed = init.ProjectStatus.First(s => s.Code == "DIS"); - project.StatusId = marketed.Id; // Marketing status. - - // Act - await Assert.ThrowsAsync(async () => await service.SetStatusAsync(project, project.Workflow.Code)); - } - - [Fact] - public async void SetStatus_Submit_NotAuthorizedException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - var erp = init.ProjectStatus.First(s => s.Code == "DR-RE"); - project.StatusId = erp.Id; // Review - project.Status = erp; - var parcel = init.CreateParcel(1); - project.AddProperty(parcel); - parcel.UpdateProjectNumbers(project.ProjectNumber); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var submit = init.ProjectStatus.First(s => s.Code == "AS-I"); - project.StatusId = submit.Id; // Submit Status - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.SetStatusAsync(project, project.Workflow.Code)); - } - - [Fact] - public async void SetStatus_Submit_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit, Permissions.DisposeRequest).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - var erp = init.ProjectStatus.First(s => s.Code == "DR-RE"); - project.StatusId = erp.Id; // Review - project.Status = erp; - project.ProjectNumber = "TEST"; - var parcel = init.CreateParcel(1); - project.AddProperty(parcel); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - var submit = init.ProjectStatus.First(s => s.Code == "AS-I"); - project.StatusId = submit.Id; // Submit Status - - // Act - var result = await service.SetStatusAsync(project, project.Workflow.Code); - - // Assert - Assert.NotNull(result); - result.StatusId.Should().Be(submit.Id); - result.Status.Should().Be(submit); - result.DeniedOn.Should().BeNull(); - result.SubmittedOn.Should().NotBeNull(); - Assert.Contains(project.ProjectNumber, parcel.ProjectNumbers); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void SetStatus_ApproveERP_NotAuthorizedException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ASSESS-DISPOSAL", "AS-FNC"); - var parcel = init.CreateParcel(1); - project.AddProperty(parcel); - parcel.UpdateProjectNumbers(project.ProjectNumber); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var approve = init.ProjectStatus.First(s => s.Code == "AP-ERP"); - project.StatusId = approve.Id; // Submit Status - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.SetStatusAsync(project, project.Workflow.Code)); - } - - [Fact] - public async void SetStatus_ApproveERP_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit, Permissions.DisposeApprove).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ASSESS-DISPOSAL", "AS-FNC"); - var parcel = init.CreateParcel(1); - parcel.IsVisibleToOtherAgencies = false; - project.AddProperty(parcel); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - var approve = init.ProjectStatus.First(s => s.Code == "AP-ERP"); - project.StatusId = approve.Id; // Submit Status - - // Act - var result = await service.SetStatusAsync(project, project.Workflow.Code); - - // Assert - Assert.NotNull(result); - result.StatusId.Should().Be(approve.Id); - result.Status.Should().Be(approve); - result.DeniedOn.Should().BeNull(); - result.ApprovedOn.Should().NotBeNull(); - parcel.IsVisibleToOtherAgencies.Should().BeTrue(); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void SetStatus_ApproveSPL_NotAuthorizedException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ERP", "ERP-OH"); - var parcel = init.CreateParcel(1); - project.AddProperty(parcel); - parcel.UpdateProjectNumbers(project.ProjectNumber); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var approve = init.ProjectStatus.First(s => s.Code == "AP-SPL"); - project.StatusId = approve.Id; // Submit Status - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.SetStatusAsync(project, project.Workflow.Code)); - } - - [Fact] - public async void SetStatus_ApproveSPL_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit, Permissions.DisposeApprove).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ERP", "ERP-OH"); - var parcel = init.CreateParcel(1); - parcel.IsVisibleToOtherAgencies = true; - project.AddProperty(parcel); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - var approve = init.ProjectStatus.First(s => s.Code == "AP-SPL"); - project.StatusId = approve.Id; // Submit Status - var metadata = new DisposalProjectMetadata() - { - ClearanceNotificationSentOn = DateTime.UtcNow, - RequestForSplReceivedOn = DateTime.UtcNow, - ApprovedForSplOn = DateTime.UtcNow - }; - project.Metadata = JsonSerializer.Serialize(metadata); - - // Act - var result = await service.SetStatusAsync(project, project.Workflow.Code); - - // Assert - Assert.NotNull(result); - result.StatusId.Should().Be(approve.Id); - result.Status.Should().Be(approve); - result.DeniedOn.Should().BeNull(); - result.ApprovedOn.Should().NotBeNull(); - parcel.IsVisibleToOtherAgencies.Should().BeFalse(); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void SetStatus_ApproveExemption_NotAuthorizedException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectEdit).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ASSESS-EXEMPTION", "AS-EXP"); - var parcel = init.CreateParcel(1); - project.AddProperty(parcel); - parcel.UpdateProjectNumbers(project.ProjectNumber); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var approve = init.ProjectStatus.First(s => s.Code == "AP-EXE"); - project.StatusId = approve.Id; // Submit Status - - // Act - // Assert - await Assert.ThrowsAsync(async () => await service.SetStatusAsync(project, project.Workflow.Code)); - } - - [Fact] - public async void SetStatus_ApproveExemption_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit, Permissions.DisposeApprove).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ASSESS-EXEMPTION", "AS-EXP"); - var parcel = init.CreateParcel(1); - parcel.IsVisibleToOtherAgencies = true; - project.AddProperty(parcel); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - var approve = init.ProjectStatus.First(s => s.Code == "AP-EXE"); - project.StatusId = approve.Id; // Submit Status - var metadata = new DisposalProjectMetadata() - { - ClearanceNotificationSentOn = DateTime.UtcNow, - ExemptionApprovedOn = DateTime.UtcNow - }; - project.Metadata = JsonSerializer.Serialize(metadata); - - // Act - var result = await service.SetStatusAsync(project, project.Workflow.Code); - - // Assert - Assert.NotNull(result); - result.StatusId.Should().Be(approve.Id); - result.Status.Should().Be(approve); - result.DeniedOn.Should().BeNull(); - result.ApprovedOn.Should().NotBeNull(); - parcel.IsVisibleToOtherAgencies.Should().BeTrue(); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void SetStatus_TransferredGreFromApprovedExemption_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit, Permissions.DisposeApprove).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ASSESS-EX-DISPOSAL", "AP-EXE"); - var parcel = init.CreateParcel(1); - parcel.IsVisibleToOtherAgencies = true; - project.AddProperty(parcel); - project.ApprovedOn = DateTime.UtcNow; - var metadata = new DisposalProjectMetadata() - { - TransferredWithinGreOn = DateTime.UtcNow - }; - project.Metadata = JsonSerializer.Serialize(metadata); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - var approve = init.ProjectStatus.First(s => s.Code == "T-GRE"); - project.StatusId = approve.Id; // Submit Status - metadata.ClearanceNotificationSentOn = DateTime.UtcNow; - project.Metadata = JsonSerializer.Serialize(metadata); - - // Act - var result = await service.SetStatusAsync(project, project.Workflow.Code); - - // Assert - Assert.NotNull(result); - result.StatusId.Should().Be(approve.Id); - result.Status.Should().Be(approve); - result.DeniedOn.Should().BeNull(); - result.ApprovedOn.Should().NotBeNull(); - parcel.IsVisibleToOtherAgencies.Should().BeTrue(); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - - [Fact] - public async void SetStatus_ExemptionAddToSpl_Success() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView, Permissions.ProjectEdit, Permissions.DisposeApprove).AddAgency(1); - - var init = helper.InitializeDatabase(user); - var workflows = init.CreateDefaultWorkflowsWithStatus(); - init.SaveChanges(); - var project = init.CreateProject(1, 3); - init.SetStatus(project, "ASSESS-EXEMPTION", "AS-EXP"); - var parcel = init.CreateParcel(1); - parcel.IsVisibleToOtherAgencies = true; - project.AddProperty(parcel); - init.SaveChanges(); - - var options = ControllerHelper.CreateDefaultPimsOptions(); - var service = helper.CreateService(user, options); - - var queueService = helper.GetService>(); - queueService.Setup(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); - queueService.Setup(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), It.IsAny())); - - var approve = init.ProjectStatus.First(s => s.Code == "AP-SPL"); - project.StatusId = approve.Id; // Submit Status - var metadata = new DisposalProjectMetadata() - { - ClearanceNotificationSentOn = DateTime.UtcNow, - RequestForSplReceivedOn = DateTime.UtcNow, - ApprovedForSplOn = DateTime.UtcNow - }; - project.Metadata = JsonSerializer.Serialize(metadata); - - // Act - var result = await service.SetStatusAsync(project, project.Workflow.Code); - - // Assert - Assert.NotNull(result); - result.StatusId.Should().Be(approve.Id); - result.Status.Should().Be(approve); - result.DeniedOn.Should().BeNull(); - result.ApprovedOn.Should().NotBeNull(); - parcel.IsVisibleToOtherAgencies.Should().BeFalse(); - queueService.Verify(m => m.NotificationQueue.GenerateNotifications(It.IsAny(), null, project.StatusId, true), Times.Never()); - queueService.Verify(m => m.NotificationQueue.SendNotificationsAsync(It.IsAny>(), true), Times.Once()); - } - #endregion - - #region Property Financials - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Services/ProjectStatusServiceTest.cs b/backend/tests/unit/dal/Services/ProjectStatusServiceTest.cs deleted file mode 100644 index 88de0d8ff8..0000000000 --- a/backend/tests/unit/dal/Services/ProjectStatusServiceTest.cs +++ /dev/null @@ -1,96 +0,0 @@ -using FluentAssertions; -using Pims.Core.Test; -using Pims.Dal.Security; -using Pims.Dal.Services; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Dal.Test.Services -{ - [Trait("category", "unit")] - [Trait("category", "dal")] - [Trait("group", "project")] - [ExcludeFromCodeCoverage] - public class ProjectStatusServiceTest - { - #region Data - public static IEnumerable ProjectStatus => - new List - { - new object[] { "SUBMIT", 6 }, - new object[] { "ASSESS", 2 } - }; - #endregion - - #region Constructors - public ProjectStatusServiceTest() { } - #endregion - - #region Tests - #region Get All - [Fact] - public void Get_All() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView); - - var init = helper.CreatePimsContext(user, true); - var workflows = EntityHelper.CreateDefaultWorkflowsWithStatus(); - init.AddAndSaveRange(workflows); - - var service = helper.CreateService(user); - - // Act - var result = service.Get(); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - result.Count().Should().Be(25); - } - #endregion - - #region Get One - [Fact] - public void Get() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView); - - var init = helper.CreatePimsContext(user, true); - init.CreateProjectStatus(1, "Draft", "DR"); - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - var result = service.Get(1); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom(result); - result.Code.Should().Be("DR"); - } - - [Fact] - public void Get_KeyNotFound() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => service.Get(1)); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Services/PropertyServiceTest.cs b/backend/tests/unit/dal/Services/PropertyServiceTest.cs deleted file mode 100644 index 0135e65880..0000000000 --- a/backend/tests/unit/dal/Services/PropertyServiceTest.cs +++ /dev/null @@ -1,323 +0,0 @@ -using Pims.Core.Extensions; -using Pims.Core.Test; -using Pims.Dal.Entities.Models; -using Pims.Dal.Exceptions; -using Pims.Dal.Security; -using Pims.Dal.Services; -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Dal.Test.Services -{ - [Trait("category", "unit")] - [Trait("category", "dal")] - [Trait("group", "property")] - [ExcludeFromCodeCoverage] - public class PropertyServiceTest - { - #region Data - public static IEnumerable ParcelFilters => - new List - { - new object[] { new AllPropertyFilter(48.571155, -123.657596, 48.492947, -123.731803) { PropertyType = Entity.PropertyTypes.Land }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter(48.821333, -123.795017, 48.763431, -123.959783) { PropertyType = Entity.PropertyTypes.Land }, new[] { 1, 3 }, 0, 0 }, - new object[] { new AllPropertyFilter() { PropertyType = Entity.PropertyTypes.Land, Agencies = new int[] { 3 } }, new[] { 1, 3 }, 7, 7 }, - new object[] { new AllPropertyFilter() { PropertyType = Entity.PropertyTypes.Land, ClassificationId = 2 }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter() { PropertyType = Entity.PropertyTypes.Land, Description = "DescriptionTest" }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter() { PropertyType = Entity.PropertyTypes.Land, AdministrativeArea = "AdministrativeArea" }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter() { PropertyType = Entity.PropertyTypes.Land, Zoning = "Zoning" }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter() { PropertyType = Entity.PropertyTypes.Land, ZoningPotential = "ZoningPotential" }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter() { PropertyType = Entity.PropertyTypes.Land }, new[] { 3 }, 7, 7 }, - }; - - public static IEnumerable BuildingFilters => - new List - { - new object[] { new AllPropertyFilter(48.571155, -123.657596, 48.492947, -123.731803) { PropertyType = Entity.PropertyTypes.Building }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter(48.821333, -123.795017, 48.763431, -123.959783) { PropertyType = Entity.PropertyTypes.Building }, new[] { 1, 3 }, 0, 0 }, - new object[] { new AllPropertyFilter() { PropertyType = Entity.PropertyTypes.Building, Agencies = new int[] { 3 } }, new[] { 1, 3 }, 10, 10 }, - new object[] { new AllPropertyFilter() { PropertyType = Entity.PropertyTypes.Building, ClassificationId = 2 }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter() { PropertyType = Entity.PropertyTypes.Building, Description = "DescriptionTest" }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter() { PropertyType = Entity.PropertyTypes.Building, AdministrativeArea = "AdministrativeArea" }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter() { Tenancy = "BuildingTenancy" }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter() { ConstructionTypeId = 2 }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter() { PredominateUseId = 2 }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter() { MinRentableArea = 100 }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter() { MinRentableArea = 50, MaxRentableArea = 50 }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter() { PropertyType = Entity.PropertyTypes.Building }, new[] { 3 }, 10, 10 }, - }; - - public static IEnumerable AllPropertyFilters => - new List - { - new object[] { new AllPropertyFilter(48.571155, -123.657596, 48.492947, -123.731803), new[] { 1, 3 }, 2, 2 }, - new object[] { new AllPropertyFilter(48.821333, -123.795017, 48.763431, -123.959783), new[] { 1, 3 }, 0, 0 }, - new object[] { new AllPropertyFilter() { Agencies = new int[] { 3 } }, new[] { 1, 3 }, 29, 10 }, - new object[] { new AllPropertyFilter() { ClassificationId = 2 }, new[] { 1, 3 }, 2, 2 }, - new object[] { new AllPropertyFilter() { Page = 1, Quantity = 10, Description = "DescriptionTest" }, new[] { 1, 3 }, 2, 2 }, - new object[] { new AllPropertyFilter() { AdministrativeArea = "AdministrativeArea" }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter() { Tenancy = "BuildingTenancy" }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter() { Zoning = "Zoning" }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter() { ZoningPotential = "ZoningPotential" }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter() { ConstructionTypeId = 2 }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter() { PredominateUseId = 2 }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter() { MinRentableArea = 100 }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter() { MinRentableArea = 50, MaxRentableArea = 50 }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter() { PropertyType = Entity.PropertyTypes.Building, ClassificationId = 3 }, new[] { 1, 3 }, 10, 10 }, - new object[] { new AllPropertyFilter() { PropertyType = Entity.PropertyTypes.Land, ClassificationId = 3 }, new[] { 1, 3 }, 1, 1 }, - new object[] { new AllPropertyFilter() { Quantity = 5, MinLandArea = 5000, MaxLandArea = 10000 }, new[] { 1, 3 }, 11, 5 }, - new object[] { new AllPropertyFilter() { Quantity = 2, ClassificationId = 3 }, new[] { 1, 3 }, 11, 2 }, - new object[] { new AllPropertyFilter(), new[] { 3 }, 29, 10 }, - }; - #endregion - - #region Constructors - public PropertyServiceTest() { } - #endregion - - #region Tests - #region Get Paged Properties - /// - /// User does not have 'property-view' claim. - /// - [Fact] - public void GetPage_Properties_ArgumentNullException() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView); - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.GetPage((AllPropertyFilter)null)); - } - - /// - /// User does not have 'property-view' claim. - /// - [Fact] - public void GetPage_Properties_NotAuthorized() - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(); - var filter = new AllPropertyFilter(50, 25, 50, 20); - - var service = helper.CreateService(user); - - // Act - // Assert - Assert.Throws(() => - service.GetPage(filter)); - } - - [Theory] - [MemberData(nameof(ParcelFilters))] - public void GetPage_ParcelProperties(AllPropertyFilter filter, int[] agencyIds, int expectedTotal, int expectedCount) - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView).AddAgency(agencyIds); - - using var init = helper.InitializeDatabase(user); - - var parcels = init.CreateParcels(1, 20); - parcels.Next(0).Location.X = -123.720810; - parcels.Next(0).Location.Y = 48.529338; - parcels.Next(0).AgencyId = 3; - parcels.Next(1).Agency = init.Agencies.Find(3); - parcels.Next(1).AgencyId = 3; - parcels.Next(2).ClassificationId = 2; - parcels.Next(2).AgencyId = 3; - parcels.Next(3).Description = "-DescriptionTest-"; - parcels.Next(3).AgencyId = 3; - parcels.Next(4).Address.AdministrativeArea = "-AdministrativeArea-"; - parcels.Next(4).AgencyId = 3; - parcels.Next(5).Zoning = "-Zoning-"; - parcels.Next(5).AgencyId = 3; - parcels.Next(6).ZoningPotential = "-ZoningPotential-"; - parcels.Next(6).AgencyId = 3; - - var buildings = init.CreateBuildings(parcels.First(), 50, 5); - buildings.Next(0).Location.X = -123.720810; - buildings.Next(0).Location.Y = 48.529338; - buildings.Next(1).Agency = init.Agencies.Find(3); - buildings.Next(1).AgencyId = 3; - buildings.Next(2).ClassificationId = 2; - buildings.Next(3).Description = "-DescriptionTest-"; - buildings.Next(4).BuildingTenancy = "-BuildingTenancy-"; - - buildings.AddRange(init.CreateBuildings(parcels.Next(1), 56, 5)); - buildings.Next(5).BuildingConstructionTypeId = 2; - buildings.Next(6).BuildingPredominateUseId = 2; - buildings.Next(7).RentableArea = 100; - buildings.Next(8).RentableArea = 50; - - buildings.AddRange(init.CreateBuildings(parcels.Next(4), 61, 10)); - - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - var result = service.GetPage(filter); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - Assert.Equal(expectedTotal, result.Total); - Assert.Equal(expectedCount, result.Count()); - Assert.True(result.All(p => p.PropertyTypeId == Entity.PropertyTypes.Land)); - } - - [Theory] - [MemberData(nameof(BuildingFilters))] - public void GetPage_BuildingProperties(AllPropertyFilter filter, int[] agencyIds, int expectedTotal, int expectedCount) - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView).AddAgency(agencyIds); - - using var init = helper.InitializeDatabase(user); - - var parcels = init.CreateParcels(1, 20); - parcels.Next(0).Location.X = -123.720810; - parcels.Next(0).Location.Y = 48.529338; - parcels.Next(1).Agency = init.Agencies.Find(3); - parcels.Next(1).AgencyId = 3; - parcels.Next(2).ClassificationId = 2; - parcels.Next(3).Description = "-DescriptionTest-"; - parcels.Next(4).Address.AdministrativeArea = "-AdministrativeArea-"; - parcels.Next(5).Zoning = "-Zoning-"; - parcels.Next(6).ZoningPotential = "-ZoningPotential-"; - - var buildings = init.CreateBuildings(parcels.First(), 50, 5); - buildings.Next(0).Location.X = -123.720810; - buildings.Next(0).Location.Y = 48.529338; - buildings.Next(0).AgencyId = 3; - buildings.Next(1).Agency = init.Agencies.Find(3); - buildings.Next(1).AgencyId = 3; - buildings.Next(2).ClassificationId = 2; - buildings.Next(2).AgencyId = 3; - buildings.Next(3).Description = "-DescriptionTest-"; - buildings.Next(3).AgencyId = 3; - buildings.Next(4).BuildingTenancy = "-BuildingTenancy-"; - buildings.Next(4).AgencyId = 3; - - buildings.AddRange(init.CreateBuildings(parcels.Next(1), 56, 5)); - buildings.Next(5).BuildingConstructionTypeId = 2; - buildings.Next(5).AgencyId = 3; - buildings.Next(6).BuildingPredominateUseId = 2; - buildings.Next(7).RentableArea = 100; - buildings.Next(8).RentableArea = 50; - buildings.Next(8).Address.AdministrativeArea = "-AdministrativeArea-"; - buildings.Next(8).AgencyId = 3; - - buildings.AddRange(init.CreateBuildings(parcels.Next(4), 61, 10)); - - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - var result = service.GetPage(filter); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - Assert.Equal(expectedTotal, result.Total); - Assert.Equal(expectedCount, result.Count()); - Assert.True(result.All(p => p.PropertyTypeId == Entity.PropertyTypes.Building)); - } - - [Theory] - [MemberData(nameof(AllPropertyFilters))] - public void GetPage_Properties(AllPropertyFilter filter, int[] agencyIds, int expectedTotal, int expectedCount) - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView).AddAgency(agencyIds); - - using var init = helper.InitializeDatabase(user); - - var parcels = init.CreateParcels(1, 20); - parcels.Next(0).Location.X = -123.720810; - parcels.Next(0).Location.Y = 48.529338; - parcels.Next(0).AgencyId = 3; - parcels.Next(1).Agency = init.Agencies.Find(3); - parcels.Next(1).AgencyId = 3; - parcels.Next(2).ClassificationId = 2; - parcels.Next(2).AgencyId = 3; - parcels.Next(3).Description = "-DescriptionTest-"; - parcels.Next(3).AgencyId = 3; - parcels.Next(4).Address.AdministrativeArea = "-AdministrativeArea-"; - parcels.Next(4).AgencyId = 3; - parcels.Next(5).Zoning = "-Zoning-"; - parcels.Next(5).AgencyId = 3; - parcels.Next(6).ZoningPotential = "-ZoningPotential-"; - parcels.Next(6).AgencyId = 3; - parcels.Next(7).LandArea = 5500.55f; - parcels.Next(7).AgencyId = 3; - - var classification = init.PropertyClassifications.Find(3); - parcels.Next(8).Classification = classification; - parcels.Next(8).AgencyId = 3; - parcels.Next(8).ClassificationId = classification.Id; - - var buildings = init.CreateBuildings(parcels.First(), 50, 5); - buildings.Next(0).Location.X = -123.720810; - buildings.Next(0).Location.Y = 48.529338; - buildings.Next(0).AgencyId = 3; - buildings.Next(1).Agency = init.Agencies.Find(3); - buildings.Next(1).AgencyId = 3; - buildings.Next(2).ClassificationId = 2; - buildings.Next(2).AgencyId = 3; - buildings.Next(3).Description = "-DescriptionTest-"; - buildings.Next(3).AgencyId = 3; - buildings.Next(4).BuildingTenancy = "-BuildingTenancy-"; - buildings.Next(4).AgencyId = 3; - - buildings.AddRange(init.CreateBuildings(parcels.Next(1), 56, 5)); - buildings.Next(5).BuildingConstructionTypeId = 2; - buildings.Next(5).AgencyId = 3; - buildings.Next(6).BuildingPredominateUseId = 2; - buildings.Next(6).AgencyId = 3; - buildings.Next(7).RentableArea = 100; - buildings.Next(7).AgencyId = 3; - buildings.Next(8).RentableArea = 50; - buildings.Next(8).AgencyId = 3; - - buildings.AddRange(init.CreateBuildings(parcels.Next(4), 61, 10)); - - var buildings01 = init.CreateBuildings(parcels.Next(7), 100, 10); - buildings01.ForEach(b => - { - b.Classification = classification; - b.ClassificationId = classification.Id; - b.AgencyId = 3; - }); - buildings.AddRange(buildings01); - - init.SaveChanges(); - - var service = helper.CreateService(user); - - // Act - var result = service.GetPage(filter); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - Assert.Equal(expectedTotal, result.Total); - Assert.Equal(expectedCount, result.Count()); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Services/TaskServiceTest.cs b/backend/tests/unit/dal/Services/TaskServiceTest.cs deleted file mode 100644 index ca6142708e..0000000000 --- a/backend/tests/unit/dal/Services/TaskServiceTest.cs +++ /dev/null @@ -1,96 +0,0 @@ -using FluentAssertions; -using Pims.Core.Test; -using Pims.Dal.Security; -using Pims.Dal.Services; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Dal.Test.Services -{ - [Trait("category", "unit")] - [Trait("category", "dal")] - [Trait("group", "task")] - [ExcludeFromCodeCoverage] - public class TaskServiceTest - { - #region Data - public static IEnumerable TasksWithId => - new List - { - new object[] { 0, 0 }, - new object[] { 1, 2 } - }; - - public static IEnumerable TasksWithCode => - new List - { - new object[] { "DRAFT", 0 }, - new object[] { "SUBMIT", 2 } - }; - #endregion - - #region Constructors - public TaskServiceTest() { } - #endregion - - #region Tests - #region GetWorkflow - [Theory] - [MemberData(nameof(TasksWithId))] - public void Get_WithId(int statusId, int expectedCount) - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView); - - var init = helper.CreatePimsContext(user, true); - var status1 = EntityHelper.CreateProjectStatus(1, "DRAFT", "DRAFT"); - var status2 = EntityHelper.CreateProjectStatus(2, "SUBMIT", "SUBMIT"); - init.AddAndSaveChanges(status1, status2); - var tasks = EntityHelper.CreateDefaultTasks(status1); - init.AddAndSaveRange(tasks); - - var service = helper.CreateService(user); - - // Act - var result = service.GetForStatus(statusId); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - result.Should().HaveCount(expectedCount); - } - - [Theory] - [MemberData(nameof(TasksWithCode))] - public void Get_WithCode(string statusCode, int expectedCount) - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.PropertyView); - - var init = helper.CreatePimsContext(user, true); - var status1 = EntityHelper.CreateProjectStatus(1, "DRAFT", "DRAFT"); - var status2 = EntityHelper.CreateProjectStatus(2, "SUBMIT", "SUBMIT"); - init.AddAndSaveChanges(status1, status2); - var tasks = EntityHelper.CreateDefaultTasks(); - init.AddAndSaveRange(tasks); - tasks.ForEach(t => status2.Tasks.Add(t)); - init.UpdateAndSaveChanges(status2); - - var service = helper.CreateService(user); - - // Act - var result = service.GetForStatus(statusCode); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result); - result.Should().HaveCount(expectedCount); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/Services/WorkflowServiceTest.cs b/backend/tests/unit/dal/Services/WorkflowServiceTest.cs deleted file mode 100644 index 0f946db184..0000000000 --- a/backend/tests/unit/dal/Services/WorkflowServiceTest.cs +++ /dev/null @@ -1,62 +0,0 @@ -using FluentAssertions; -using Pims.Core.Test; -using Pims.Dal.Security; -using Pims.Dal.Services; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Xunit; -using Entity = Pims.Dal.Entities; - -namespace Pims.Dal.Test.Services -{ - [Trait("category", "unit")] - [Trait("category", "dal")] - [Trait("group", "project")] - [ExcludeFromCodeCoverage] - public class WorkflowServiceTest - { - #region Data - public static IEnumerable Workflows => - new List - { - new object[] { "SUBMIT", 6 }, - new object[] { "ASSESS", 2 } - }; - #endregion - - #region Constructors - public WorkflowServiceTest() { } - #endregion - - #region Tests - #region Get - [Theory] - [MemberData(nameof(Workflows))] - public void Get(string code, int expectedCount) - { - // Arrange - var helper = new TestHelper(); - var user = PrincipalHelper.CreateForPermission(Permissions.ProjectView); - - var init = helper.CreatePimsContext(user, true); - var status = EntityHelper.CreateProjectStatus(1, 7); - init.AddAndSaveRange(status); - var submit = EntityHelper.CreateWorkflow(1, "Submit", "SUBMIT", status); - var access = EntityHelper.CreateWorkflow(2, "Access", "ASSESS", status.Take(2)); - init.AddAndSaveChanges(submit, access); - - var service = helper.CreateService(user); - - // Act - var result = service.Get(code); - - // Assert - Assert.NotNull(result); - Assert.IsAssignableFrom>(result.Status); - result.Status.Count().Should().Be(expectedCount); - } - #endregion - #endregion - } -} diff --git a/backend/tests/unit/dal/coverlet.runsettings b/backend/tests/unit/dal/coverlet.runsettings deleted file mode 100644 index 8ad4f55e81..0000000000 --- a/backend/tests/unit/dal/coverlet.runsettings +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - json,opencover - ../TestResults/coverage.json - [*.Test]*,[*]*Model,[*]*Migrations* - Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute - false - true - false - - - - - diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index b9c611134a..0000000000 --- a/codecov.yml +++ /dev/null @@ -1,31 +0,0 @@ -codecov: - require_ci_to_pass: true - branch: dev - -coverage: - precision: 2 - round: down - range: '75...100' - status: - project: - default: - target: 55 - patch: - default: - target: auto - -parsers: - gcov: - branch_detection: - conditional: yes - loop: yes - method: no - macro: no - -comment: - layout: 'reach,diff,flags,tree' - behavior: default - require_changes: false - -ignore: - - '*.ignore.*' diff --git a/database/.gitignore b/database/.gitignore deleted file mode 100644 index c8cd8044dc..0000000000 --- a/database/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ - -.env -.env.local -.env.development.local -.env.test.local -.env.production.local \ No newline at end of file diff --git a/database/README.md b/database/README.md deleted file mode 100644 index 7a033d4acb..0000000000 --- a/database/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# Database - -The API requires a database for storing PIMS data. Currently the choice is to use MSSQL for tighter integration with .NET Core Entity Framework. - -Refer to documentation for the database type. - -- [MSSQL](mssql/README.md) - -## Initialize Database - -To get the database running and initialized do one of the following; - -- Follow the MSSQL steps here - [README](./mssql/README.md) - -## Remoting into OpenShift Database - -When running a database within OpenShift you may need to remote into the database to debug or make changes. - -> Refer to the documentation [here](../openshift/README.md#Remote%20into%20Database) for more information. diff --git a/database/mssql/Dockerfile b/database/mssql/Dockerfile deleted file mode 100644 index 91b6735a1b..0000000000 --- a/database/mssql/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM mcr.microsoft.com/mssql/rhel/server:2022-latest - -USER root -RUN mkdir -p /usr/config -WORKDIR /usr/config -COPY . /usr/config - -# Make sure GIT has the following permissions set. -# RUN chmod +x ./entrypoint.sh -# RUN chmod +x ./setup.sh - -EXPOSE 1433 - -VOLUME ["/var/opt/mssql"] -ENTRYPOINT ["./entrypoint.sh"] diff --git a/database/mssql/README.md b/database/mssql/README.md deleted file mode 100644 index 431fe9c4ce..0000000000 --- a/database/mssql/README.md +++ /dev/null @@ -1,77 +0,0 @@ -# MSSQL DB - -## MSSQL Environment Variables - -To get the database running and initialized do the following; - -- Create a `.env` file in the `/database/mssql` folder -- Populate it with the following environment variables; - -```conf -ACCEPT_EULA=Y -MSSQL_SA_PASSWORD={password} -MSSQL_PID=Developer -TZ=America/Los_Angeles - -DB_NAME=pims -DB_USER=admin -DB_PASSWORD={password} -TIMEOUT_LENGTH=120 -``` - -| Key | Value | Description | -| ----------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | -| ACCEPT_EULA | [Y\|N] | Whether you accept the license agreement. | -| MSSQL_SA_PASSWORD | {password} | Enter the `password` you want to secure the DB with. This password needs to be complex enough to match the requirements from Microsoft (see below). | -| MSSQL_PID | Developer | The edition of the database to install [Developer\|Express\|Standard\|Enterprise\|EnterpriseCore]. | -| TZ | America/Los_Angeles | The timezone to run the database in. Bash into your container and use the command `tzselect` to manually change the timezone. | -| DB_NAME | pims | The name of the database to create when the pod is deployed. | -| DB_USER | admin | The name of the user account that pims will use to connect to the database instead of the 'sa'. | -| DB_PASSWORD | {password} | Enter the `password` you want to secure the DB with. This password needs to be complex enough to match the requirements from Microsoft (see below). | - -## Password Complexity - -As per Microsoft documentation, the `MSSQL_SA_PASSWORD` value must meet the following guidelines: - -- The password does not contain the account name of the user. -- The password is at least **eight characters** long. -- The password contains characters from **three** of the following four categories: - - Uppercase letters (A through Z) - - Lowercase letters (a through z) - - Base 10 digits (0 through 9) - - Non-alphanumeric characters such as: exclamation point (!), dollar sign (\$), number sign (#), or percent (%). - -Passwords can be up to 128 characters long. Use passwords that are as long and complex as possible. - -## Create a customized container - -If you do create your own Dockerfile, be aware of the foreground process, because this process controls the life of the container. If it exits, the container will shutdown. For example, if you want to run a script and start SQL Server, make sure that the SQL Server process is the right-most command. All other commands are run in the background. The following command illustrates this inside a Dockerfile: - -```bash -/usr/src/app/do-my-sql-commands.sh & /opt/mssql/bin/sqlservr -``` - -## Connection - -To connect manually to the database. Get the docker container Id. - -```bash -docker ps -``` - -Copy the docker container Id for the database and past it into the next command. - -```bash -docker exec -it e69e056c702d "bash" -``` - -Once inside the container, connect locally with sqlcmd. Note that sqlcmd is not in the path by default, so you have to specify the full path. - -```bash -/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P '' -``` - -## Related Information - -- Configuration details [here](https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-configure-docker?view=sql-server-ver15) -- Running Scripts remotely [here](https://portworx.com/run-ha-sql-server-red-hat-openshift/) diff --git a/database/mssql/entrypoint.sh b/database/mssql/entrypoint.sh deleted file mode 100755 index 354c0127bf..0000000000 --- a/database/mssql/entrypoint.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# Start SQL Server -echo "Start MS SQL Server and run scripts" - -if ! whoami &> /dev/null; then - if [ -w /etc/passwd ]; then - echo "${USER_NAME:-sqlservr}:x:$(id -u):0:${USER_NAME:-sqlservr} user:${HOME}:/sbin/nologin" >> /etc/passwd - fi -fi -# exec "$@" - -/usr/config/setup.sh & /opt/mssql/bin/sqlservr diff --git a/database/mssql/scripts/clear-objects.sql b/database/mssql/scripts/clear-objects.sql deleted file mode 100644 index c825657a44..0000000000 --- a/database/mssql/scripts/clear-objects.sql +++ /dev/null @@ -1,24 +0,0 @@ -PRINT 'Running ClearObjects script'; -GO - -DECLARE @Sql NVARCHAR(500) -DECLARE @Cursor CURSOR - -SET @Cursor = CURSOR FAST_FORWARD FOR -SELECT DISTINCT sql = 'ALTER TABLE [' + tc2.TABLE_NAME + '] DROP [' + rc1.CONSTRAINT_NAME + ']' -FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS rc1 -LEFT JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc2 ON tc2.CONSTRAINT_NAME =rc1.CONSTRAINT_NAME - -OPEN @Cursor FETCH NEXT FROM @Cursor INTO @Sql - -WHILE (@@FETCH_STATUS = 0) -BEGIN -Exec SP_EXECUTESQL @Sql -FETCH NEXT FROM @Cursor INTO @Sql -END - -CLOSE @Cursor DEALLOCATE @Cursor -GO - -EXEC sp_MSForEachTable 'DROP TABLE ?' -GO diff --git a/database/mssql/scripts/init.sql b/database/mssql/scripts/init.sql deleted file mode 100644 index 265eccc7ea..0000000000 --- a/database/mssql/scripts/init.sql +++ /dev/null @@ -1,12 +0,0 @@ -PRINT 'Creating default database' -CREATE DATABASE $(DB_NAME); -GO -USE $(DB_NAME); -GO -PRINT 'Adding default admin account' -CREATE LOGIN $(DB_USER) WITH PASSWORD = '$(DB_PASSWORD)'; -GO -CREATE USER $(DB_USER) FOR LOGIN $(DB_USER); -GO -ALTER SERVER ROLE sysadmin ADD MEMBER [$(DB_USER)]; -GO diff --git a/database/mssql/setup.sh b/database/mssql/setup.sh deleted file mode 100755 index b35a637ce1..0000000000 --- a/database/mssql/setup.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -# wait for MSSQL server to start -pid=$! - -echo "Waiting for MS SQL to be available ⏳" -/opt/mssql-tools/bin/sqlcmd -l 30 -S localhost -h-1 -V1 -U sa -P $MSSQL_SA_PASSWORD -Q "SET NOCOUNT ON SELECT \"YAY WE ARE UP\" , @@servername" -is_up=$? -while [ $is_up -ne 0 ] ; do - echo -e $(date) - /opt/mssql-tools/bin/sqlcmd -l 30 -S localhost -h-1 -V1 -U sa -P $MSSQL_SA_PASSWORD -Q "SET NOCOUNT ON SELECT \"YAY WE ARE UP\" , @@servername" - is_up=$? - sleep 5 -done - -echo "======= MSSQL SERVER STARTED ========" -# Run every script in /scripts -# TODO set a flag so that this is only done once on creation, -# and not every time the container runs -# for foo in /scripts/*.sql -# do /opt/mssql-tools/bin/sqlcmd -U sa -P $$SA_PASSWORD -l 30 -e -i $$foo -# done - -# Run the setup script to create the DB and the schema in the DB -/opt/mssql-tools/bin/sqlcmd -l 30 -S localhost -U sa -P $MSSQL_SA_PASSWORD -d master -i scripts/init.sql - -echo "======= MSSQL CONFIG COMPLETE =======" - -# Wait on the sqlserver process -wait $pid diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml deleted file mode 100644 index 03f701d712..0000000000 --- a/docker-compose.prod.yml +++ /dev/null @@ -1,25 +0,0 @@ - ## This docker-compose file is used to build the images for the backend, frontend services and a databse migration image (if any chnage). -services: - ####################### Backend ####################### - backend: - build: - context: backend - dockerfile: Dockerfile.ocp - ports: - - 8080:8080 - - ####################### Frontend ####################### - frontend: - build: - context: frontend - dockerfile: Dockerfile.ocp - ports: - - 8080:8080 - - ################## Database Migration ################# - - migration: - build: - context: backend - dockerfile: Dockerfile.migrations - \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 54de91405b..46bc16e0aa 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,80 +1,4 @@ services: - ####################### Database ####################### - database: - profiles: ['prod', 'dev'] - restart: 'no' - container_name: pims-database - build: - context: database/mssql - env_file: - - database/mssql/.env - ports: - - ${DATABASE_PORT:-5433}:1433 - volumes: - - database-data:/var/opt/mssql/data - networks: - - pims - - ####################### Backend ####################### - backend: - profiles: ['prod', 'dev'] - restart: 'no' - container_name: pims-api - build: - context: backend - args: - BUILD_CONFIGURATION: Debug - env_file: backend/api/.env - ports: - - ${API_HTTPS_PORT:-5001}:443 - - ${API_HTTP_PORT:-5000}:8080 - depends_on: - - database - networks: - - pims - - ####################### Frontend ####################### - frontend: - profiles: ['prod'] - stdin_open: true - tty: true - restart: 'no' - container_name: pims-app - build: - context: frontend - target: prod - dockerfile: Dockerfile - ports: - - ${APP_HTTP_PORT:-3000}:3000 - depends_on: - - backend - env_file: .env - networks: - - pims - - ####################### Frontend Dev ####################### - frontend-dev: - profiles: ['dev'] - stdin_open: true - tty: true - restart: 'no' - container_name: pims-app-dev - build: - context: frontend - target: dev - dockerfile: Dockerfile - volumes: - - ./frontend/src:/app/src - - ./frontend/public:/app/public - - pims-app-node-cache:/app/node_modules - ports: - - ${APP_HTTP_PORT:-3000}:3000 - depends_on: - - backend - env_file: .env - networks: - - pims - ####################### React App ####################### pims-app-v2: tty: true @@ -137,14 +61,3 @@ networks: pims: name: pims-net driver: bridge - -####################### Volumes Definition ####################### -volumes: - database-data: - driver: local - driver_opts: - type: none - device: $PWD/database/mssql/data - o: bind - pims-app-node-cache: - name: pims-app-node-cache diff --git a/frontend/.dockerignore b/frontend/.dockerignore deleted file mode 100644 index 3b118f0fb1..0000000000 --- a/frontend/.dockerignore +++ /dev/null @@ -1,11 +0,0 @@ -.vscode/ -coverage/ -build/ -node_modules/ -.dockerignore -.editorconfig -.gitignore -*Dockerfile* -package-lock.json -README.md -test-report.xml diff --git a/frontend/.editorconfig b/frontend/.editorconfig deleted file mode 100644 index 2de63be50f..0000000000 --- a/frontend/.editorconfig +++ /dev/null @@ -1,21 +0,0 @@ -# Editor configuration, see https://editorconfig.org -root = true - -[*] -charset = utf-8 -indent_style = space -indent_size = 2 -insert_final_newline = true -trim_trailing_whitespace = true -end_of_line = lf - -[*.md] -max_line_length = off -trim_trailing_whitespace = false - -[*.env] -insert_final_newline = false - -[{Makefile,**.mk}] -# Use tabs for indentation (Makefiles require tabs) -indent_style = tab diff --git a/frontend/.eslintignore b/frontend/.eslintignore deleted file mode 100644 index 80662a9371..0000000000 --- a/frontend/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -src/serviceWorker.ts -node_modules diff --git a/frontend/.eslintrc.cjs b/frontend/.eslintrc.cjs deleted file mode 100644 index a181bcae28..0000000000 --- a/frontend/.eslintrc.cjs +++ /dev/null @@ -1,59 +0,0 @@ -module.exports = { - globals: { - module: 'readonly', - }, - env: { - node: true, - }, - extends: [ - // By extending from a plugin config, we can get recommended rules without having to add them manually. - 'eslint:recommended', - 'plugin:react/recommended', - 'plugin:@typescript-eslint/recommended', - // This disables the formatting rules in ESLint that Prettier is going to be responsible for handling. - // Make sure it's always the last config, so it gets the chance to override other configs. - 'eslint-config-prettier', - ], - plugins: ['simple-import-sort', 'prettier'], - settings: { - react: { - // Tells eslint-plugin-react to automatically detect the version of React to use. - version: 'detect', - }, - // Tells eslint how to resolve imports. - 'import/resolver': { - node: { - paths: ['src'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }, - }, - }, - rules: { - // Override ones from the extended configs. - 'simple-import-sort/imports': 'warn', - 'simple-import-sort/exports': 'warn', - 'prettier/prettier': 'warn', - 'no-extra-boolean-cast': 'off', - 'no-unsafe-optional-chaining': 'off', - 'no-prototype-builtins': 'off', - 'react/no-unescaped-entities': 'off', - 'react/prop-types': 'off', - 'react/display-name': 'off', - '@typescript-eslint/ban-ts-comment': 'off', - '@typescript-eslint/no-inferrable-types': 'off', // ie. const val: number = 4; - '@typescript-eslint/no-empty-function': 'off', // ie. {} - '@typescript-eslint/no-non-null-assertion': 'off', // Allow use of non-null assertion operator (!). - '@typescript-eslint/no-explicit-any': 'off', // Warn if 'any' type is used. - '@typescript-eslint/no-duplicate-enum-values': 'warn', // TODO: Review whether we need those duplicate enum values. - '@typescript-eslint/ban-types': [ - 'error', - { - types: { - Function: false, // Allow use of the 'Function' type. - }, - extendDefaults: true, - }, - ], - }, - ignorePatterns: ['node_modules/', 'package-lock.json', 'build/', 'dist/'], -}; diff --git a/frontend/.gitignore b/frontend/.gitignore deleted file mode 100644 index 4dccf68551..0000000000 --- a/frontend/.gitignore +++ /dev/null @@ -1,32 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -node_modules/ -/.pnp -.pnp.js - -# testing -coverage/ -test-report.xml -cypress/videos -cypress/screenshots -testUser.json - -# production -build/ -public/videos - -# misc -.DS_Store -.env -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -jest/latestTestRun.json -package-lock.json diff --git a/frontend/.prettierignore b/frontend/.prettierignore deleted file mode 100644 index ebfc7b1602..0000000000 --- a/frontend/.prettierignore +++ /dev/null @@ -1,6 +0,0 @@ -package-lock.json -**/vendor -*.html -*.md -node_modules -build diff --git a/frontend/.prettierrc.cjs b/frontend/.prettierrc.cjs deleted file mode 100644 index 04a166cb70..0000000000 --- a/frontend/.prettierrc.cjs +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - semi: true, - trailingComma: 'all', - singleQuote: true, - printWidth: 100, - tabWidth: 2, - endOfLine: 'lf', - arrowParens: 'always', -}; diff --git a/frontend/.vscode/launch.json b/frontend/.vscode/launch.json deleted file mode 100644 index 0507f1460e..0000000000 --- a/frontend/.vscode/launch.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "type": "node", - "request": "attach", - "name": "Attach", - "port": 9229 - }, - { - "name": "Chrome", - "type": "chrome", - "request": "launch", - "url": "http://localhost:3000", - "webRoot": "${workspaceFolder}/src", - "sourceMapPathOverrides": { - "webpack:///src/*": "${webRoot}/*", - "/usr/app/*": "${workspaceRoot}/*" - } - }, - { - "name": "Debug CRA Tests", - "type": "node", - "request": "launch", - "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/react-scripts", - "args": [ - "test", - "--runInBand", - "--no-cache", - "--env=jsdom", - "--watchAll=false"], - "cwd": "${workspaceRoot}", - "console": "integratedTerminal", - "internalConsoleOptions": "neverOpen", - "env": { - "CI": "true" - }, - }, - { - "type": "node", - "name": "vscode-jest-tests", - "request": "launch", - "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/react-scripts", - "args": [ - "test", - "--ci", - "react-scripts-ts", - "--watchAll=false", - "--env=jsdom", - "--runInBand" - ], - "cwd": "${workspaceFolder}", - "console": "integratedTerminal", - "internalConsoleOptions": "neverOpen" - } - ] -} diff --git a/frontend/.vscode/settings.json b/frontend/.vscode/settings.json deleted file mode 100644 index cef1d40622..0000000000 --- a/frontend/.vscode/settings.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "[javascript]": { - "editor.formatOnSave": true - }, - "[javascriptreact]": { - "editor.formatOnSave": true - }, - "[typescript]": { - "editor.formatOnSave": true - }, - "[typescriptreact]": { - "editor.formatOnSave": true - }, - "eslint.alwaysShowStatus": true, - "jest.jestCommandLine": "npm run test:watch --", - "eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"], - "editor.codeActionsOnSave": { - "source.fixAll.eslint": true - }, - "typescript.tsdk": "node_modules\\typescript\\lib", - "jest.autoRun": { - "onStartup": ["all-tests"] - }, - "cSpell.words": [ - "bbox", - "Formik", - "PIMS", - "siteminder" - ] -} diff --git a/frontend/Dockerfile b/frontend/Dockerfile deleted file mode 100644 index e874393176..0000000000 --- a/frontend/Dockerfile +++ /dev/null @@ -1,69 +0,0 @@ -############################################# -# Dev Build # -############################################# -# https://hub.docker.com/layers/library/node/18.16-bullseye-slim/images/ -# sha256-8463e2d7bacf0cb576453a0ea8425f3b3c87fa9dd5c8a84ab1908cfd407f3edd?context=explore -FROM node:18.17.1-bullseye-slim as dev - -WORKDIR /app -ENV NODE_ENV=development -ENV CONTAINERIZED=true - -# Copy files, excluding those in .dockerignore -COPY . . - -# Install dependencies and disable npm progress bar -RUN npm set progress=false -RUN npm i - -EXPOSE 3000 - -CMD ["npm", "run", "dev"] - -############################################# -# Prod Build # -############################################# -FROM node:18.17.1-bullseye-slim as prod-build - -# Set the working directory to /app -WORKDIR /app -ENV NODE_ENV=production -ENV CONTAINERIZED=true - -# Copy files -COPY ./src ./src -COPY ./public ./public -COPY package.json . -COPY tsconfig.json . -COPY vite.config.ts . -COPY ./index.html . - -EXPOSE 8080 - -# Npm install packages. Omits dev dependencies when NODE_ENV=production -RUN npm set progress=false -RUN npm i - -# Build the project. -RUN npm run build - -## Stage 2: Nginx state for serving content -FROM nginx:alpine-slim as prod - -# copy custom nginx configuration from host to container -COPY nginx.conf /etc/nginx/conf.d/default.conf - -# Set working directory to nginx asset directory -WORKDIR /usr/share/nginx/html - -# Remove default nginx static assets -RUN rm -rf ./* - -# Copy static assets from builder stage -COPY --from=prod-build /app/build . - -# Provide nginx directory the required permissions -RUN chmod g+rwx /var/cache/nginx /var/run /var/log/nginx - -# Run nginx with global directives and daemon off -ENTRYPOINT ["nginx", "-g", "daemon off;"] diff --git a/frontend/Dockerfile.ocp b/frontend/Dockerfile.ocp deleted file mode 100644 index 5aea815cfe..0000000000 --- a/frontend/Dockerfile.ocp +++ /dev/null @@ -1,46 +0,0 @@ -FROM image-registry.apps.silver.devops.gov.bc.ca/354028-tools/nodejs:18.17.1-bullseye-slim as prod-build - -# Set the working directory to /app -WORKDIR /app -ENV NODE_ENV=production -ENV CONTAINERIZED=true - -# Copy files -COPY ./src ./src -COPY ./public ./public -COPY package.json . -COPY tsconfig.json . -COPY vite.config.ts . -COPY ./index.html . - -# Npm install packages. Omits dev dependencies when NODE_ENV=production -RUN npm set progress=false -RUN npm i - -EXPOSE 8080 - -# Build the project. -RUN npm run build - - -## Stage 2: Nginx state for serving content -FROM nginx:alpine-slim as prod - -# copy custom nginx configuration to container -# copy custom nginx configuration from host to container -COPY prod.nginx.conf /etc/nginx/conf.d/default.conf - -# Set working directory to nginx asset directory -WORKDIR /usr/share/nginx/html - -# Remove default nginx static assets -RUN rm -rf ./* - -# Copy static assets from builder stage -COPY --from=prod-build /app/build . - -# Provide nginx directory the required permissions -RUN chmod g+rwx /var/cache/nginx /var/run /var/log/nginx - -# Run nginx with global directives and daemon off -ENTRYPOINT ["nginx", "-g", "daemon off;"] diff --git a/frontend/README.md b/frontend/README.md deleted file mode 100644 index dfb06a2244..0000000000 --- a/frontend/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# PIMS Frontend Application - React - -This project runs using Vite for both developer builds and production builds. - -## Frontend Environment Variables - -The frontend uses a `.env` located in the project root folder. This `.env` is shared with the API and any Docker commands. - -Recommended values used in the frontend that match with the current API and Docker options are shown below. - -| Key | Default Value | Description | -| --- | --- | --- | -| API_HTTP_PORT | 5000 | API port used during local development. | -| API_PROXY_PORT | 8080 | Proxy port for API when using NGINX. | -| API_SERVICE_NAME | backend | Service name for API when containerized. | -| APP_HTTP_PORT | 3000 | Frontend port where application is served. | - -## Usage - -### Commands - -These commands are specific to the `/frontend` folder. For additional commands involving other components or Docker containers, see the Makefile available in the project root. - -The available commands for the frontend are as follows: - -| Command | Description | -| -------------------------- | ------------------------------------------------------------------------ | -| `npm run dev` | Runs app in development mode. | -| `npm run build` | Builds the app using Vite. | -| `npm test` | Runs frontend test suites. | -| `npm run coverage` | Runs frontend test suites and creates code coverage files. | -| `npm run coverage:changed` | Runs code coverage but only for files changed since the main branch. | -| `npm run snapshots` | Runs frontend test suites and updates snapshots. | -| `npm run lint` | Runs the linter. | -| `npm run lint:fix` | Runs the linter and attempts to fix issues. | -| `npm run check` | Runs a code style check using Prettier. | -| `npm run format` | Runs a code style check using Prettier and attempts to fix issues. | - -### `npm run dev` - -Runs the app in the development mode. - -Open [http://localhost:3000](http://localhost:3000) to view it in the browser. - -The port number may be different depending on your settings. - -The page will reload if you make edits. - -## Learn More - -To learn React, check out the [React documentation](https://reactjs.org/). diff --git a/frontend/cypress.config.ts b/frontend/cypress.config.ts deleted file mode 100644 index 553d1c74ac..0000000000 --- a/frontend/cypress.config.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { defineConfig } from 'cypress'; -import dotenv from 'dotenv'; -dotenv.config({ path: '../.env' }); - -export default defineConfig({ - pageLoadTimeout: 100000, - videoUploadOnPasses: false, - e2e: { - projectId: 'k7dkv4', - baseUrl: `http://localhost:${process.env.APP_HTTP_PORT || 3000}`, - viewportHeight: 850, - viewportWidth: 1400, - chromeWebSecurity: false, - experimentalSessionAndOrigin: true, - defaultCommandTimeout: 15000, - env: { - auth_base_url: `https://dev.loginproxy.gov.bc.ca/auth`, - auth_realm: 'standard', - auth_client_id: 'pims-local-test-4292', - keycloak_user: process.env.CYPRESS_KEYCLOAK_USER, - keycloak_password: process.env.CYPRESS_KEYCLOAK_PASSWORD, - }, - setupNodeEvents(on, config) { - // implement node event listeners here - }, - }, -}); diff --git a/frontend/cypress/e2e/disposalProjects.cy.ts b/frontend/cypress/e2e/disposalProjects.cy.ts deleted file mode 100644 index e6443c6218..0000000000 --- a/frontend/cypress/e2e/disposalProjects.cy.ts +++ /dev/null @@ -1,627 +0,0 @@ -const PROJECT_NAME = 'Cypress Test Disposal Project'; - -const inputs = { - projectName: PROJECT_NAME, - description: 'A test description.', - searchFilter: { - address: '1006 2nd Ave', - }, - assessedValue: '10350', - assessedDisplayedValue: '$10,350', - netBookValue: '23789', - netBookDisplayedValue: '$23,789', - estimatedMarketValue: '16465', - estimatedMarketDisplayedValue: '$16,465', -}; - -// TODO: Add cy.log to sections to detail whats happening. - -/** - * @author Braden Mitchell - * @description Tests the creation of disposal projects. - * @components ProjectDraftForm, ProjectDisposeLayout - * @page Disposal Projects > Create Disposal Project - * @route /dispose/projects/draft - * @tests Create project with DRAFT status. - */ - -describe('Create a disposal project', () => { - beforeEach(function () { - cy.kcLogout().kcLogin(); - }); - - /* --------------------------------------------------------------------- - TEST CASE: Create project with SUBMITTED EXEMPTION status. - * --------------------------------------------------------------------- */ - - /** - * @title Create project with SUBMITTED EXEMPTION status - * @description Tests creating a disposal project, going through steps 1-6 and submitting it. - */ - - it('Create project with SUBMITTED EXEMPTION status', () => { - /* --------------------------------------------------------------------- - CLEAN UP: Run before test. - * --------------------------------------------------------------------- */ - - cy.visit(`/projects/list`).then(() => { - cy.url().should('include', '/projects/list'); - /* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - If Test Project Exists in - Table Body (tbody), delete it. - * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */ - - const PROJECT_NAME = 'Cypress Test Disposal Project'; - - // Wait for page title. - cy.get('[data-testid="project-list-view-page-title"]').should('exist'); - - // Wait for the spinner to disappear. - cy.get('.table-loading').should('not.exist').wait(2000); - - // Search for project - cy.get('[name="name"]').click({ force: true }); - cy.get('[name="name"]').type(PROJECT_NAME); - cy.get('[id="search-button"]').click({ force: true }); - - // Wait for the spinner to disappear. - cy.get('.table-loading').should('not.exist').wait(2000); - - cy.get('.table').then(($table) => { - const secondChild = $table.children().eq(1); - if (secondChild.text() !== 'No rows to display') { - cy.get('.tbody').then(($tbody) => { - const firstTableRow = $tbody.children().eq(0).children().eq(0); - const projectNameCell = firstTableRow.children().eq(2); - // If table row for Cypress test project exists. - if (projectNameCell.text() === PROJECT_NAME) { - cy.get('[role="cell"]') - .contains(PROJECT_NAME) - .then(($projectNameField) => { - // Get the project number from the sibling table row cell that contains PROJECT_NAME - const projectNumber = $projectNameField - .siblings() - .eq(1) - .children() - .children('span') - .text(); - // Remove project - cy.get(`[data-testid="trash-icon-${projectNumber}"]`).click(); - cy.get('[data-testid="modal-footer-ok-btn"]').click(); - }); - } - }); - } - }); - }); - - cy.visit(`/dispose/projects/draft`); - - /* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - [1/6] Draft - * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */ - - // Stepper 0 btn (Step 1/6) should be selected. - cy.get('[data-target="stepper-0"]') - .children() - .first() - .children('.bs-stepper-circle') - .first() - .should('have.css', 'background-color', 'rgb(0, 123, 255)'); - - // Wait for the spinner to disappear. - cy.get('.loading-spinner').should('not.exist'); - - // Stepper 1 btn (Step 2/6) should be disabled. - cy.get('[data-target="stepper-1"]').children().first().should('be.disabled'); - // Input project name. - cy.get('[data-testid="project-name"]') - .should('be.visible') - .should('be.enabled') - .click({ force: true }); - cy.get('[data-testid="project-name"]').type(inputs.projectName); - // Input project description. - cy.get('[data-testid="project-description"]') - .should('be.visible') - .should('be.enabled') - .click({ force: true }); - cy.get('[data-testid="project-description"]').type(inputs.description); - // Next button. - cy.get('[data-testid="next-submit-btn"]').click({ force: true }); - - /* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - [2/6] Select Properties - * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */ - - // TODO: Test search filter, and Remove Selected button. - - // Stepper 1 btn (Step 2/6) should be selected. - cy.get('[data-target="stepper-1"]') - .children() - .first() - .children('.bs-stepper-circle') - .first() - .should('have.css', 'background-color', 'rgb(0, 123, 255)'); - - // Wait for the spinner to disappear. - cy.get('.loading-spinner').should('not.exist'); - - // Stepper 0 btn (Step 1/6) should be enabled. - cy.get('[data-target="stepper-0"]').children().first().should('be.enabled'); - // Stepper 2 btn (Step 3/6) should be disabled. - cy.get('[data-target="stepper-2"]').children().first().should('be.disabled'); - // FILTER BAR: Input address. - cy.get('[data-testid="address"]') - .should('be.visible') - .should('be.enabled') - .click({ force: true }); - cy.get('[data-testid="address"]').type(inputs.searchFilter.address); - // Search. - cy.get('[data-testid="search-btn"]').click(); - // Confirm search. - cy.get('.td').contains(inputs.searchFilter.address); - // Select property. - cy.get('[title="Toggle Row Selected"]') - .first() - .should('be.enabled') - .should('not.be.checked') - .click({ force: true }); - cy.get('[title="Toggle Row Selected"]').should('be.checked'); - cy.contains('1 Selected'); - // Add to project. - cy.get('[data-testid="add-to-project-btn"]').click(); - // Reset filter. - cy.get('[data-testid="reset-btn"]').click(); - // Next button. - cy.get('[data-testid="next-submit-btn"]').click({ force: true }); - - /* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - [3/6] Update Information - * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */ - - // TODO: Test... - // - Assign Tier dropdown. - // - Required fields. - // - Editable Fields in Properties in the Project. - // - Add More Properties button. - // - Remove Properties button. - - // Stepper 2 btn (Step 3/6) should be selected. - cy.get('[data-target="stepper-2"]') - .children() - .first() - .children('.bs-stepper-circle') - .first() - .should('have.css', 'background-color', 'rgb(0, 123, 255)'); - - // Wait for the spinner to disappear. - cy.get('.loading-spinner').should('not.exist'); - - // // Check Required Fields > Next button. - // cy.get('[data-testid="next-submit-btn"]').click(); - // // Required text should be visible. - // cy.get('[data-testid="error-message"]').should('not.have.property', 'display', 'none'); - // // Check Required Fields > Stepper 3 btn (Step 4/6) should be disabled. - // cy.get('[data-target="stepper-3"]') - // .children() - // .first() - // .should('be.disabled'); - - // Stepper 1 btn (Step 2/6) should be enabled. - cy.get('[data-target="stepper-1"]').children().first().should('be.enabled'); - // Stepper 3 btn (Step 4/6) should be disabled. - cy.get('[data-target="stepper-3"]').children().first().should('be.disabled'); - // Input accessed value. - cy.get('[data-testid="assessed"]').should('be.enabled').click({ force: true }); - cy.get('[data-testid="assessed"]').type(inputs.assessedValue); - // Input netBook value. - cy.get('[data-testid="netBook"]').should('be.enabled').click({ force: true }); - cy.get('[data-testid="netBook"]').type(inputs.netBookValue); - // Input estimated market value. - cy.get('[data-testid="market"]').should('be.enabled').click({ force: true }); - cy.get('[data-testid="market"]').type(inputs.estimatedMarketValue); - // Next button. - cy.get('[data-testid="next-submit-btn"]').click({ force: true }); - cy.get('[data-testid="next-submit-btn"]').click({ force: true }); - - /* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - [4/6] Required Documentation - * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */ - - // TODO: Test Exemption request. - - // Stepper 3 btn (Step 4/6) should be selected. - cy.get('[data-target="stepper-3"]') - .children() - .first() - .children('.bs-stepper-circle') - .first() - .should('have.css', 'background-color', 'rgb(0, 123, 255)'); - - // Wait for the spinner to disappear. - cy.get('.loading-spinner').should('not.exist'); - - // Check Required Fields > Next button. - cy.get('[data-testid="next-submit-btn"]').click(); - // Required text should be visible. - cy.contains('Required').should('be.visible'); - // Check Required Fields > Stepper 4 btn (Step 5/6) should be disabled. - cy.get('[data-target="stepper-4"]').children().first().should('be.disabled'); - - // Stepper 2 btn (Step 3/6) should be enabled. - cy.get('[data-target="stepper-2"]').children().first().should('be.enabled'); - // Stepper 4 btn (Step 5/6) should be disabled. - cy.get('[data-target="stepper-4"]').children().first().should('be.disabled'); - // CHECK inputs. - cy.get('[data-testid="taskform-check-0"]') - .should('be.enabled') - .should('not.be.checked') - .click({ force: true }); - cy.get('[data-testid="taskform-check-0"]').should('be.checked'); - cy.get('[data-testid="taskform-check-1"]') - .should('be.enabled') - .should('not.be.checked') - .click({ force: true }); - cy.get('[data-testid="taskform-check-1"]').should('be.checked'); - cy.get('[id="input-exemptionRequested"]') - .should('be.enabled') - .should('not.be.checked') - .click({ force: true }); - cy.get('[id="input-exemptionRequested"]').should('be.checked'); - // Type exemption rationale. - cy.get('[name="exemptionRationale"]').should('be.enabled').click({ force: true }); - cy.get('[name="exemptionRationale"]').type('testing'); - // Next button. - cy.get('[data-testid="next-submit-btn"]').click({ force: true }); - cy.get('[data-testid="next-submit-btn"]').click({ force: true }); - - /* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - [5/6] Approval - * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */ - - // TODO: Test required fields. - - // Stepper 4 btn (Step 5/6) should be selected. - cy.get('[data-target="stepper-4"]') - .children() - .first() - .children('.bs-stepper-circle') - .first() - .should('have.css', 'background-color', 'rgb(0, 123, 255)'); - - // Wait for the spinner to disappear. - cy.get('.loading-spinner').should('not.exist'); - - // // Check Required Fields > Next button. - // cy.get('[data-testid="next-submit-btn"]').click(); - // // Required text should be visible. - // cy.contains('You must confirm approval before continuing.').should('be.visible'); - // // Check Required Fields > Stepper 5 btn (Step 6/6) should be disabled. - // cy.get('[data-target="stepper-5"]') - // .children() - // .first() - // .should('be.disabled'); - - // Stepper 3 btn (Step 4/6) should be enabled. - cy.get('[data-target="stepper-3"]').children().first().should('be.enabled'); - // Stepper 5 btn (Step 6/6) should be disabled. - cy.get('[data-target="stepper-5"]').children().first().should('be.disabled'); - // CHECK input. - cy.get('[data-testid="approval-check"]') - .should('be.enabled') - .should('not.be.checked') - .click({ force: true }); - cy.get('[data-testid="approval-check"]').should('be.checked'); - // Next button. - cy.get('[data-testid="next-submit-btn"]').click({ force: true }); - /* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - [6/6] Review - * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */ - - // TODO: - // Test Edit button. - // Return to projects list before submitting and verify DRAFT status. - - // Stepper 5 btn (Step 6/6) should be selected. - cy.get('[data-target="stepper-5"]') - .children() - .first() - .children('.bs-stepper-circle') - .first() - .should('have.css', 'background-color', 'rgb(0, 123, 255)'); - - // Wait for the spinner to disappear. - cy.get('.loading-spinner').should('not.exist'); - - // Description Field - cy.get('[data-testid="project-description"]').should('be.visible').should('be.disabled'); - - // Submit button. - cy.get('[data-testid="next-submit-btn"]').click({ force: true }); - - /* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - Return to Projects List - * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */ - cy.visit(`/projects/list`).wait(2000); - - // Wait for page title. - cy.get('[data-testid="project-list-view-page-title"]').should('exist'); - - // Wait for the spinner to disappear. - cy.get('.table-loading').should('not.exist'); - - cy.contains(PROJECT_NAME) - .should('be.visible') - .siblings() - .should('contain', 'Submitted Exemption'); - }); - - /* --------------------------------------------------------------------- - TEST CASE: Approve project to APPROVED FOR EXEMPTION status. - * --------------------------------------------------------------------- */ - - /** - * @title Approve project to APPROVED FOR EXEMPTION status. - * @description Tests approving a disposal project. - * @components ProjectDraftForm, ReviewApproveForm - */ - - it('Approve project to APPROVED FOR EXEMPTION status', () => { - /* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - Select Project - * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */ - cy.visit(`/projects/list`); - - // TODO: Test... - // Required fields - // Edit, Save, Deny - // Add and remove properties - - // Wait for page title. - cy.get('[data-testid="project-list-view-page-title"]').should('exist'); - - // Wait for the spinner to disappear. - cy.get('.table-loading').should('not.exist'); - - // Search for project - cy.get('[name="name"]').click({ force: true }); - cy.get('[name="name"]').type(PROJECT_NAME); - cy.get('[id="search-button"]').click({ force: true }); - - // Wait for the spinner to disappear. - cy.get('.table-loading').should('not.exist').wait(2000); - - // Select Project from table. - cy.contains(PROJECT_NAME).should('be.visible').click({ force: true }); - - // Wait for page. - cy.url().should('include', '/projects/assess/properties'); - - // Wait for the spinner to disappear. - cy.get('.loading-spinner').should('not.exist'); - - /* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - Review Project Property Information - * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */ - - // Check project name. - cy.get('[data-testid="project-name"').should('be.visible').should('have.value', PROJECT_NAME); - - // Check project description. - cy.get('[data-testid="project-description"') - .should('be.visible') - .should('have.value', inputs.description); - - /* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - Review Financial Information - * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */ - - // Check assessed value. - cy.get('[data-testid="assessed"') - .should('be.visible') - .should('have.value', inputs.assessedDisplayedValue); - - // Check netBook value. - cy.get('[data-testid="netBook"') - .should('be.visible') - .should('have.value', inputs.netBookDisplayedValue); - - // Check estimated market value. - cy.get('[data-testid="market"') - .should('be.visible') - .should('have.value', inputs.estimatedMarketDisplayedValue); - - /* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - Review Properties in the Project - * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */ - - // Check properties. - cy.contains(inputs.searchFilter.address); - - // CHECK input - Project property information has been reviewed. - cy.get('[data-testid="taskform-check-3"]') - .should('be.enabled') - .should('not.be.checked') - .click({ force: true }); - cy.get('[data-testid="taskform-check-3"]').should('be.checked'); - - /* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - Enhanced Referral Process Exemption - * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */ - - // Check exemption rationale value. - cy.get('[name="exemptionRationale"').first().should('have.text', 'testing'); - - // CHECK input - ADM has been notified of request for exemption. - cy.get('[data-testid="taskform-check-10"]') - .should('be.enabled') - .should('not.be.checked') - .click({ force: true }); - cy.get('[data-testid="taskform-check-10"]').should('be.checked'); - - // CHECK input - ADM has approved the request for exemption. - cy.get('[data-testid="taskform-check-11"]') - .should('be.enabled') - .should('not.be.checked') - .click({ force: true }); - cy.get('[data-testid="taskform-check-11"]').should('be.checked'); - - // Type date - ADM Approved Exemption On. - cy.get('[name="exemptionApprovedOn"]').should('be.enabled').click({ force: true }); - cy.get('[name="exemptionApprovedOn"]').type('03/08/2023'); - - /* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - Review Documentation - * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */ - - // Check input - Surplus Declaration & Readiness Checklist document emailed to SRES. - cy.get('[data-testid="taskform-check-0"]').should('be.disabled').should('be.checked'); - - // Check input - Triple Bottom Line document emailed to SRES OR Project is in Tier 1. - cy.get('[data-testid="taskform-check-1"]').should('be.disabled').should('be.checked'); - - /* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - Enhanced Referral Process Exemption - * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */ - - // Check input - Apply for Enhanced Referral Process exemption. - cy.get('[name="exemptionRequested"]').should('be.disabled').should('be.checked'); - - // CHECK input - Documents have been received, reviewed and approved. - cy.get('[data-testid="taskform-check-4"]') - .should('be.enabled') - .should('not.be.checked') - .click({ force: true }); - cy.get('[data-testid="taskform-check-4"]').should('be.checked'); - - /* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - Review Appraisal - * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */ - - // Check input - An appraisal has been ordered. - cy.get('[data-testid="taskform-check-5"]').should('be.enabled').should('not.be.checked'); - - // Check input - An appraisal has been received. - cy.get('[data-testid="taskform-check-6"]').should('be.enabled').should('not.be.checked'); - - /* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - Review First Nations Consultation - * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */ - - // Check input - First Nations consultation preparation and due diligence. - cy.get('[data-testid="taskform-check-7"]').should('be.enabled').should('not.be.checked'); - - // Check input - First Nations consultation is underway. - cy.get('[data-testid="taskform-check-8"]').should('be.enabled').should('not.be.checked'); - - // Check input - First Nations consultation is complete. - cy.get('[data-testid="taskform-check-9"]').should('be.enabled').should('not.be.checked'); - - /* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - Approval - * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */ - - // Check input - - // My Ministry/Agency has approval/authority to submit the Disposal Project to SRES for review. - cy.get('[data-testid="approval-check"]').should('be.disabled').should('be.checked'); - - // Check inputs - Notes. - cy.get('[id="input-note"]').should('be.disabled'); - cy.get('[id="input-publicNote"]').should('be.enabled'); - cy.get('[id="input-privateNote"]').should('be.enabled'); - cy.get('[id="input-notes[22].note"]').should('be.enabled'); - - // Approve button. - cy.get('[data-testid="review-approve-action-approve-btn"]').click({ force: true }); - cy.get('[data-testid="modal-footer-ok-btn"]').click({ force: true }); - - /* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - Approved - * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */ - cy.contains('Approved for Exemption').should('be.visible'); - - cy.visit(`/projects/list`); - - // Wait for page title. - cy.get('[data-testid="project-list-view-page-title"]').should('exist'); - - // Wait for the spinner to disappear. - cy.get('.table-loading').should('not.exist'); - - // Search for project - cy.get('[name="name"]').click({ force: true }); - cy.get('[name="name"]').type(PROJECT_NAME); - cy.get('[id="search-button"]').click({ force: true }); - - // Wait for the spinner to disappear. - cy.get('.table-loading').should('not.exist').wait(2000); - - // Check project has correct status. - cy.contains(PROJECT_NAME) - .should('be.visible') - .siblings() - .should('contain', 'Approved for Exemption'); - }); - - /* --------------------------------------------------------------------- - CLEAN UP - * --------------------------------------------------------------------- */ - - /** - * @title Clean up - * @description Removes the test project. - */ - - it('Clean up', () => { - cy.visit(`/projects/list`).then(() => { - cy.url().should('include', '/projects/list'); - /* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - If Test Project Exists in - Table Body (tbody), delete it. - * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */ - - const PROJECT_NAME = 'Cypress Test Disposal Project'; - - // Wait for page title. - cy.get('[data-testid="project-list-view-page-title"]').should('exist'); - - // Wait for the spinner to disappear. - cy.get('.table-loading').should('not.exist').wait(2000); - - // Search for project - cy.get('[name="name"]').click({ force: true }); - cy.get('[name="name"]').type(PROJECT_NAME); - cy.get('[id="search-button"]').click({ force: true }); - - // Wait for the spinner to disappear. - cy.get('.table-loading').should('not.exist').wait(2000); - - cy.get('.table').then(($table) => { - const secondChild = $table.children().eq(1); - if (secondChild.text() !== 'No rows to display') { - cy.get('.tbody').then(($tbody) => { - const firstTableRow = $tbody.children().eq(0).children().eq(0); - const projectNameCell = firstTableRow.children().eq(2); - // If table row for Cypress test project exists. - if (projectNameCell.text() === PROJECT_NAME) { - cy.get('[role="cell"]') - .contains(PROJECT_NAME) - .then(($projectNameField) => { - // Get the project number from the sibling table row cell that contains PROJECT_NAME - const projectNumber = $projectNameField - .siblings() - .eq(1) - .children() - .children('span') - .text(); - // Remove project - cy.get(`[data-testid="trash-icon-${projectNumber}"]`).click({ force: true }); - cy.get('[data-testid="modal-footer-ok-btn"]').click({ force: true }); - }); - } - }); - } - }); - }); - }); -}); diff --git a/frontend/cypress/e2e/navBar.cy.ts b/frontend/cypress/e2e/navBar.cy.ts deleted file mode 100644 index 9113f4bb05..0000000000 --- a/frontend/cypress/e2e/navBar.cy.ts +++ /dev/null @@ -1,248 +0,0 @@ -/** - * @author Braden Mitchell - * @description Tests the routing of Nav Bar links. - * @components AppNavBar - * @tests Home, Administration, Submit Property, View Property Inventory, Disposal Projects, Reports. - */ - -describe('Navigation/routing of NavBar links', () => { - beforeEach(function () { - cy.kcLogout().kcLogin(); - }); - - /* --------------------------------------------------------------------- - TEST CASE: Home button directs to home page. - * --------------------------------------------------------------------- */ - - /** - * @title Home button directs to home page - * @description Tests that clicking the home button redirects you to the mapview. - */ - - it('Home button directs to home page', () => { - cy.visit('/'); - - // Go to another page. - cy.get('[data-testid="navbar-view-inventory"]').should('be.visible').click({ force: true }); - - // Wait for the spinner to disappear. - cy.get('.loading-spinner').should('not.exist'); - - cy.url().should('include', '/properties/list'); - // Click home button. - cy.get('[data-testid="navbar-home-btn"]').first().should('be.visible').click({ force: true }); - - // Wait for the spinner to disappear. - cy.get('.loading-spinner').should('not.exist'); - - cy.url().should('include', '/mapview'); - }); - - /* --------------------------------------------------------------------- - TEST CASE: Administration dropdown links to correct routes. - * --------------------------------------------------------------------- */ - - /** - * @title Administration dropdown links to correct routes - * @description Tests the routing of links in the Administration dropdown from the NavBar. - * Clicks nav link, checks url, checks page loaded. - */ - - it('Administration dropdown links to correct routes', () => { - cy.visit('/'); - - // Open Administration dropdown. - cy.get('[data-testid="navbar-admin-dropdown"]').should('be.visible').click(); - - // Go to Administration > Users page. - cy.get('[data-testid="navbar-admin-users"]').should('be.visible').click({ force: true }); - - // Wait for the spinner to disappear. - cy.get('.loading-spinner').should('not.exist'); - - cy.url().should('include', '/admin/users'); - cy.get('[data-testid="admin-users-page"]').should('exist'); - - // Open Administration dropdown. - cy.get('[data-testid="navbar-admin-dropdown"]').should('be.visible').click(); - - // Go to Administration > Access Requests page. - cy.get('[data-testid="navbar-admin-access-requests"]') - .should('be.visible') - .click({ force: true }); - - // Wait for the spinner to disappear. - cy.get('.loading-spinner').should('not.exist'); - - cy.url().should('include', '/admin/access/requests'); - cy.get('[data-testid="admin-access-requests-page"]').should('exist'); - - // Open Administration dropdown. - cy.get('[data-testid="navbar-admin-dropdown"]').should('be.visible').click(); - - // Go to Administration > Agencies page. - cy.get('[data-testid="navbar-admin-agencies"]').should('be.visible').click({ force: true }); - - // Wait for the spinner to disappear. - cy.get('.loading-spinner').should('not.exist'); - - cy.url().should('include', '/admin/agencies'); - cy.get('[data-testid="admin-agencies-page"]').should('exist'); - - // Open Administration dropdown. - cy.get('[data-testid="navbar-admin-dropdown"]').should('be.visible').click(); - - // Go to Administration > Administrative Areas page. - cy.get('[data-testid="navbar-admin-administrative-areas"]') - .should('be.visible') - .click({ force: true }); - - // Wait for the spinner to disappear. - cy.get('.loading-spinner').should('not.exist'); - - cy.url().should('include', '/admin/administrativeAreas'); - cy.get('[data-testid="admin-administrative-areas-page"]').should('exist'); - }); - - /* --------------------------------------------------------------------- - TEST CASE: Submit Property links to correct route. - * --------------------------------------------------------------------- */ - - /** - * @title Submit Property links to correct route - * @description Tests the routing of Submit Property from the NavBar. - * Clicks nav link, checks url, checks page loaded. - */ - - it('Submit Property links to correct route', () => { - // Go to Submit Property page. - cy.get('[data-testid="navbar-submit-property"]').should('be.visible').click({ force: true }); - - // Wait for the spinner to disappear. - cy.get('.loading-spinner').should('not.exist'); - - cy.url().should('include', '/mapview'); - cy.get('[data-testid="submit-property-selector"]').should('exist'); - }); - - /* --------------------------------------------------------------------- - TEST CASE: View Property Inventory links to correct route. - * --------------------------------------------------------------------- */ - - /** - * @title View Property Inventory links to correct route - * @description Tests the routing of View Property Inventory from the NavBar. - * Clicks nav link, checks url, checks page loaded. - */ - - it('View Property Inventory links to correct route', () => { - cy.visit('/'); - - // Go to View Property Inventory page. - cy.get('[data-testid="navbar-view-inventory"]').should('be.visible').click(); - - // Wait for the spinner to disappear. - cy.get('.loading-spinner').should('not.exist'); - - cy.url().should('include', '/properties/list'); - cy.get('[data-testid="property-list-view"]').should('exist'); - }); - - /* --------------------------------------------------------------------- - TEST CASE: Disposal Projects dropdown links to correct routes. - * --------------------------------------------------------------------- */ - - /** - * @title Disposal Projects dropdown links to correct routes - * @description Tests the routing of links in the Disposal Projects dropdown from the NavBar. - * Clicks nav link, checks url, checks page loaded. - */ - - it('Disposal Projects dropdown links to correct routes', () => { - cy.visit('/'); - - // Open Disposal Projects dropdown. - cy.get('[data-testid="navbar-disposal-projects-dropdown"]').should('be.visible').click(); - - // Go to Disposal Projects > Create Disposal Project page. - cy.get('[data-testid="navbar-disposal-projects-create"]') - .should('be.visible') - .click({ force: true }); - - // Wait for the spinner to disappear. - cy.get('.loading-spinner').should('not.exist'); - - cy.url().should('include', '/dispose/projects/draft'); - cy.get('[data-testid="disposal-projects-draft-form"]').should('exist'); - - // Open Disposal Projects dropdown. - cy.get('[data-testid="navbar-disposal-projects-dropdown"]').should('be.visible').click(); - - // Go to Disposal Projects > View Projects page. - cy.get('[data-testid="navbar-disposal-projects-view"]') - .should('be.visible') - .click({ force: true }); - - // Wait for the spinner to disappear. - cy.get('.loading-spinner').should('not.exist'); - - cy.url().should('include', '/projects/list'); - cy.get('[data-testid="disposal-projects-project-list-view"]').should('exist'); - - // Open Disposal Projects dropdown. - cy.get('[data-testid="navbar-disposal-projects-dropdown"]').should('be.visible').click(); - - // Go to Disposal Projects > View SPL Projects page. - cy.get('[data-testid="navbar-disposal-projects-view-spl"]') - .should('be.visible') - .click({ force: true }); - - // Wait for the spinner to disappear. - cy.get('.loading-spinner').should('not.exist'); - - cy.url().should('include', '/projects/spl'); - cy.get('[data-testid="disposal-projects-spl-project-list-view"]').should('exist'); - - // Open Disposal Projects dropdown. - cy.get('[data-testid="navbar-disposal-projects-dropdown"]').should('be.visible').click(); - - // Go to Disposal Projects > Approval Requests page. - cy.get('[data-testid="navbar-disposal-projects-approval-requests"]') - .should('be.visible') - .click({ force: true }); - - // Wait for the spinner to disappear. - cy.get('.loading-spinner').should('not.exist'); - - cy.url().should('include', '/approval/requests'); - cy.get('[data-testid="disposal-projects-project-approval-request-list-view"]').should('exist'); - }); - - /* --------------------------------------------------------------------- - TEST CASE: Reports dropdown links to correct routes. - * --------------------------------------------------------------------- */ - - /** - * @title Reports dropdown links to correct routes - * @description Tests the routing of links in the Reports dropdown from the NavBar. - * Clicks nav link, checks url, checks page loaded. - */ - - it('Reports dropdown links to correct routes', () => { - cy.visit('/'); - - // Open Reports dropdown. - cy.get('[data-testid="navbar-reports-dropdown"]').should('be.visible').click(); - - // Go to SPL Reports page. - cy.get('[data-testid="navbar-spl-reports"]').should('be.visible').click({ force: true }); - - // Wait for the spinner to disappear. - cy.get('.loading-spinner').should('not.exist'); - - cy.url().should('include', '/reports/spl'); - cy.get('[data-testid="spl-report-layout"]').should('exist'); - }); - - // TODO: Test Help Modal. -}); diff --git a/frontend/cypress/support/commands.ts b/frontend/cypress/support/commands.ts deleted file mode 100644 index 185259938a..0000000000 --- a/frontend/cypress/support/commands.ts +++ /dev/null @@ -1,107 +0,0 @@ -/// -// *********************************************** -// For comprehensive examples of custom -// commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** - -const base64url = source => { - // Encode the input string as base64. - let encodedSource = btoa(source); - - // Replace any characters that are not URL-safe. - encodedSource = encodedSource - .replace(/\+/g, '-') - .replace(/\//g, '_') - .replace(/=+$/, ''); - - return encodedSource; -}; - -const sha256 = async plain => { - // encode as UTF-8. - const msgBuffer = new TextEncoder().encode(plain); - - // hash the message. - const hashBuffer = await crypto.subtle.digest('SHA-256', msgBuffer); - - // convert ArrayBuffer to Array. - const hashArray = Array.from(new Uint8Array(hashBuffer)); - - // convert bytes to hex string. - const hashHex = hashArray.map(b => ('00' + b.toString(16)).slice(-2)).join(''); - - return hashHex; -}; - -Cypress.Commands.add('kcLogin', () => { - Cypress.log({ name: 'Login' }); - - cy.log('Keyloak Login').then(async () => { - const authBaseUrl = Cypress.env('auth_base_url'); - const realm = Cypress.env('auth_realm'); - const client_id = Cypress.env('auth_client_id'); - const redirect_uri = Cypress.config('baseUrl') + '/login'; - - const username = Cypress.env('keycloak_user'); - const password = Cypress.env('keycloak_password'); - - const scope = 'openid'; - const state = '123456'; - const nonce = '7890'; - const code_challenge_method = 'S256'; - const kc_idp_hint = 'idir'; - - // Generate a code verifier using a random string of 43-128 characters. - const code_verifier = - Cypress._.random(0, 1e10).toString(36) + Cypress._.random(0, 1e10).toString(36); - const code_challenge = base64url(await sha256(code_verifier)); - - // Make the initial request to the authentication endpoint. - cy.request({ - method: 'GET', - url: `${authBaseUrl}/realms/${realm}/protocol/openid-connect/auth`, - qs: { - client_id, - redirect_uri, - code_challenge_method, - code_challenge, - response_type: 'code', - scope, - state, - nonce, - kc_idp_hint, - }, - followRedirect: false, // Don't follow the redirect automatically. - }).then(response => { - // Extract the location header from the response to get the redirect URL. - const redirectUrls = response.headers.location; - const url = Array.isArray(redirectUrls) ? redirectUrls[0] : redirectUrls; - - // Visit redirect URL. - cy.visit(url); - - // Log in the user and obtain an authorization code. - cy.contains('idir').click(); - cy.get('[name="user"]').click(); - cy.get('[name="user"]').type(username); - cy.get('[name="password"]').click(); - cy.get('[name="password"]').type(password); - cy.get('[name="btnSubmit"]').click(); - - cy.wait(10000); - }); - }); -}); - -Cypress.Commands.add('kcLogout', () => { - Cypress.log({ name: 'Logout' }); - const authBaseUrl = Cypress.env('auth_base_url'); - const realm = Cypress.env('auth_realm'); - - return cy.request({ - url: `${authBaseUrl}/realms/${realm}/protocol/openid-connect/logout`, - }); -}); - -module.exports = {}; diff --git a/frontend/cypress/support/e2e.ts b/frontend/cypress/support/e2e.ts deleted file mode 100644 index 598ab5f0d7..0000000000 --- a/frontend/cypress/support/e2e.ts +++ /dev/null @@ -1,20 +0,0 @@ -// *********************************************************** -// This example support/e2e.ts is processed and -// loaded automatically before your test files. -// -// This is a great place to put global configuration and -// behavior that modifies Cypress. -// -// You can change the location of this file or turn off -// automatically serving support files with the -// 'supportFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** - -// Import commands.js using ES2015 syntax: -import './commands'; - -// Alternatively you can use CommonJS syntax: -// require('./commands') diff --git a/frontend/cypress/support/index.ts b/frontend/cypress/support/index.ts deleted file mode 100644 index 9b7b231b3b..0000000000 --- a/frontend/cypress/support/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/// - -declare namespace Cypress { - interface Chainable { - kcLogin(): Chainable; - kcLogout(): Chainable; - } -} diff --git a/frontend/cypress/tsconfig.json b/frontend/cypress/tsconfig.json deleted file mode 100644 index 422848c2ce..0000000000 --- a/frontend/cypress/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "target": "es6", - "module": "esnext", - "lib": ["es5", "dom"], - "types": ["cypress", "node"] - }, - "include": ["**/*.ts", "support/commands.tsx"] -} diff --git a/frontend/index.html b/frontend/index.html deleted file mode 100644 index 04d4a441bb..0000000000 --- a/frontend/index.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - Property Inventory Management System - - - - -
- - - - diff --git a/frontend/nginx.conf b/frontend/nginx.conf deleted file mode 100644 index 3dab2138da..0000000000 --- a/frontend/nginx.conf +++ /dev/null @@ -1,10 +0,0 @@ -server { - listen 3000; - location / { - root /usr/share/nginx/html; - try_files $uri /index.html; - } - location /api/ { - proxy_pass "http://backend:8080/"; - } -} diff --git a/frontend/package.json b/frontend/package.json deleted file mode 100644 index 5a5b48f0f6..0000000000 --- a/frontend/package.json +++ /dev/null @@ -1,217 +0,0 @@ -{ - "name": "frontend", - "version": "1.0.0", - "private": true, - "type": "module", - "scripts": { - "dev": "vite", - "build": "vite build", - "test": "react-scripts test --watchAll=false", - "coverage": "react-scripts test --coverage --watchAll=false", - "coverage:changed": "react-scripts test --coverage --watchAll=false --changedSince=main", - "snapshots": "react-scripts test --watchAll=false --updateSnapshot", - "cypress:open": "npx cypress open", - "cypress:open-dev": "npx cypress open --config baseUrl=\"https://pims-dev.apps.silver.devops.gov.bc.ca\" --env auth_client_id=\"pims-frontend-4391\"", - "cypress:e2e": "cypress run --e2e --browser chrome", - "cypress:e2e-dev": "cypress run --e2e --browser chrome --headless --config baseUrl=\"https://pims-dev.apps.silver.devops.gov.bc.ca\" --env auth_client_id=\"pims-frontend-4391\"", - "cypress:e2e-test": "cypress run --e2e --browser chrome --headless --config baseUrl=\"https://pims-test.apps.silver.devops.gov.bc.ca\" --env auth_base_url=\"https://test.loginproxy.gov.bc.ca/auth\",auth_client_id=\"pims-frontend-4391\"", - "cypress:e2e-prod": "cypress run --e2e --browser chrome --headless --config baseUrl=\"https://pims.gov.bc.ca\" --env auth_base_url=\"https://loginproxy.gov.bc.ca/auth\",auth_client_id=\"pims-frontend-4391\"", - "lint": "eslint src/ --ext .jsx,.js,.ts,.tsx --max-warnings 0", - "lint:fix": "npm run lint -- --fix", - "format": "prettier --write \"./src/**/*.{js,jsx,ts,tsx,json,css,scss}\"", - "check": "prettier --check \"./src/**/*.{js,jsx,ts,tsx,css,scss}\"" - }, - "dependencies": { - "@babel/core": "7.24.0", - "@bcgov/bc-sans": "2.1.0", - "@emotion/react": "11.11.1", - "@emotion/styled": "11.11.0", - "@mui/icons-material": "5.15.1", - "@mui/material": "5.15.1", - "@react-keycloak/web": "3.4.0", - "@react-leaflet/core": "2.1.0", - "@redux-devtools/extension": "3.3.0", - "@reduxjs/toolkit": "1.9.5", - "@vitejs/plugin-react": "4.3.0", - "axios": "1.7.1", - "bootstrap": "5.3.1", - "classnames": "2.5.1", - "crypto-js": "4.2.0", - "dequal": "2.0.3", - "formik": "2.4.3", - "history": "5.3.0", - "keycloak-js": "25.0.0", - "leaflet": "1.9.4", - "lodash": "4.17.21", - "moment": "2.30.1", - "papaparse": "5.4.1", - "polylabel": "1.1.0", - "react": "18.3.1", - "react-app-polyfill": "3.0.0", - "react-bootstrap": "2.10.0", - "react-bootstrap-typeahead": "5.2.2", - "react-click-away-listener": "2.2.3", - "react-datepicker": "6.9.0", - "react-dom": "18.3.1", - "react-draggable": "4.4.5", - "react-error-boundary": "4.0.11", - "react-icons": "5.2.1", - "react-leaflet": "4.2.1", - "react-paginate": "8.2.0", - "react-redux": "8.1.2", - "react-redux-loading-bar": "5.0.4", - "react-resize-detector": "11.0.1", - "react-router-dom": "6.23.0", - "react-scripts": "5.0.1", - "react-simple-tree-menu": "1.1.18", - "react-table": "7.8.0", - "react-text-mask": "5.5.0", - "react-toastify": "10.0.2", - "react-visibility-sensor": "5.1.1", - "redux": "4.2.1", - "redux-logger": "3.0.6", - "redux-thunk": "2.4.2", - "retry-axios": "3.1.3", - "sass": "1.77.0", - "styled-components": "6.1.8", - "supercluster": "8.0.1", - "tiles-in-bbox": "1.0.2", - "vite": "5.2.6", - "vite-plugin-svgr": "4.2.0", - "vite-tsconfig-paths": "4.3.1", - "yup": "1.4.0" - }, - "devDependencies": { - "@babel/plugin-proposal-private-property-in-object": "7.21.11", - "@babel/preset-typescript": "7.24.1", - "@cfaester/enzyme-adapter-react-18": "0.8.0", - "@testing-library/dom": "10.1.0", - "@testing-library/jest-dom": "6.4.2", - "@testing-library/react": "16.0.0", - "@testing-library/react-hooks": "8.0.1", - "@testing-library/user-event": "14.5.0", - "@types/crypto-js": "4.2.1", - "@types/enzyme": "3.10.13", - "@types/enzyme-to-json": "1.5.4", - "@types/geojson": "7946.0.10", - "@types/jest": "29.5.4", - "@types/leaflet": "1.9.4", - "@types/lodash": "4.17.0", - "@types/mui-datatables": "4.3.5", - "@types/papaparse": "5.3.8", - "@types/polylabel": "1.1.0", - "@types/pretty": "2.0.1", - "@types/react": "18.3.1", - "@types/react-bootstrap-typeahead": "5.1.9", - "@types/react-datepicker": "6.2.0", - "@types/react-dom": "18.3.0", - "@types/react-leaflet": "3.0.0", - "@types/react-paginate": "7.1.1", - "@types/react-redux": "7.1.26", - "@types/react-router-dom": "5.3.3", - "@types/react-table": "7.7.15", - "@types/react-test-renderer": "18.3.0", - "@types/react-text-mask": "5.4.11", - "@types/redux-logger": "3.0.9", - "@types/redux-mock-store": "1.0.3", - "@types/styled-components": "5.1.26", - "@types/supercluster": "7.1.0", - "@types/yup": "0.32.0", - "@typescript-eslint/eslint-plugin": "7.12.0", - "@typescript-eslint/parser": "7.12.0", - "axios-mock-adapter": "1.22.0", - "babel-jest": "29.7.0", - "cross-env": "7.0.3", - "cypress": "13.10.0", - "dotenv": "16.4.1", - "enzyme": "3.11.0", - "enzyme-to-json": "3.6.2", - "eslint": "8.57.0", - "eslint-config-prettier": "9.1.0", - "eslint-plugin-prettier": "5.1.2", - "eslint-plugin-react": "7.34.1", - "eslint-plugin-simple-import-sort": "12.1.0", - "jest-styled-components": "7.2.0", - "jest-transform-css": "6.0.1", - "prettier": "3.3.0", - "pretty": "2.0.0", - "react-docgen-typescript": "2.2.2", - "react-test-renderer": "18.3.1", - "redux-mock-store": "1.5.4", - "typescript": "5.4.2" - }, - "overrides": { - "@svgr/webpack": "6.3.1", - "svgo@<3.0.2": "3.0.2", - "minimatch@<3.0.8": "3.0.8", - "decode-uri-component@^0.2.0": "0.2.1", - "react": "18.3.1", - "react-dom": "18.3.1", - "@types/react": "18.3.1", - "react-test-renderer": "18.3.1", - "http-cache-semantics@<4.1.1": "4.1.1", - "webpack": "5.76.0", - "sass-loader@<13.2.2": "13.2.2", - "yaml@<2.2.2": "2.2.2", - "fork-ts-checker-webpack-plugin@<6.5.3": "6.5.3", - "nth-check@<2.0.1": "2.0.1", - "css-whatt@<5.0.1": "5.0.1", - "semver": "7.5.2", - "@babel/traverse@<7.23.2": "7.23.2", - "typescript": "5.4.2" - }, - "jest": { - "transform": { - "^.+\\.jsx?$": "babel-jest", - "^.+\\.tsx?$": "babel-jest", - "^.+\\.module\\.css$": "jest-transform-css", - "^.+\\.css$": "jest-transform-css" - }, - "transformIgnorePatterns": [ - "/node_modules/(?!query-string)/" - ], - "resetMocks": false, - "collectCoverageFrom": [ - "src/**/*.{js,jsx,ts,tsx}", - "!/node_modules/**", - "!/coverage/**", - "!/public/**", - "!/build/**", - "!/src/serviceWorker.**", - "!/src/setupProxy.*", - "!/src/setupTests.*", - "!/src/utils/testUtils.tsx" - ], - "coverageThreshold": { - "global": { - "functions": 40, - "lines": 50, - "statements": 50 - } - }, - "coverageReporters": [ - [ - "lcov", - { - "projectRoot": ".." - } - ] - ], - "moduleNameMapper": { - ".+\\.(svg)(\\?react)?$": "/src/__mocks__/svg-mock.tsx" - } - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "ie 11", - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - } -} diff --git a/frontend/prod.nginx.conf b/frontend/prod.nginx.conf deleted file mode 100644 index a4d87b0596..0000000000 --- a/frontend/prod.nginx.conf +++ /dev/null @@ -1,10 +0,0 @@ -server { - listen 8080; - location / { - root /usr/share/nginx/html; - try_files $uri /index.html; - } - location /api/ { - proxy_pass "http://pims-api:8080/"; - } -} diff --git a/frontend/public/basemaps.json b/frontend/public/basemaps.json deleted file mode 100644 index 258170a284..0000000000 --- a/frontend/public/basemaps.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "basemaps": [ - { - "name": "Map", - "url": "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", - "attribution": "© OpenStreetMap contributors", - "thumbnail": "/streets.jpg" - }, - { - "name": "Satellite", - "url": "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}", - "attribution": "Tiles © Esri — Source: Esri, DigitalGlobe, GeoEye, Earthstar Geographics, CNES/Airbus DS, USDA, USGS, AeroGRID, IGN, and the GIS User Community", - "thumbnail": "/satellite.jpg" - } - ] -} diff --git a/frontend/public/favicon-32x32.ico b/frontend/public/favicon-32x32.ico deleted file mode 100644 index 1365ff9b49616b27297cce0204100e89658f08ac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 951 zcmV;o14#UdP)_Ym+QkSpo|p3k7w{LONthrO*XuD`CjMkWi^2Qxvi=WGR0Es$TjYGR9|Y(ms*} z{rVfKb_~t~k zSdMV~Gp<_&02=^$9>WNla^)swx3eDir=;`*RR9C%j>{b~e!aWXkr!fin*cunSXE5b z#h*N;YhSg7-DH>u!(?6HP8bSP$9+Qukzp^4SATq3 zC)aPWA)O(>A)$n=06i|v7h1!927p|?%}J*c%~j)Y)qZ{1n*x6rU?n7q zOEuYQjf|Zit?Ot3TEp(}N~vvw@&UjShtHjqIxp;&#{_~Hu<=5&)#|ZvGV+Ed8(wXK zCnK<*^s6l%)Oid6MHps@dx$c0emQ|;t2H=3TBnIVxF>pTTruMeHP9ON zM8$YQjNJXV99O+c$_K(rP4?Is{c4K`Q?1@FF}G9zA(i2|PDaUjwV8Jh51N=#JwDF( ze1SoAMRyD&6@-lKnKbRB{^Y)kA-*dKZ46m zLXXQ%2qO@%l&2^5OC`CHi3jY86YBTxoTnXzgnZcvVNCQ1&&14G77hA74}gbcY0`1) z22esUNJTcDe<1QeLI`83GJGLesx4d?)fr&Q1A!noEE{tgA8mMrFxG@He0Se7KYntS z)#QzB7}2Vig)k~X#svBT%UM=_#_QUt3IizJ?^c+Oxkhc*r(#B-6T%3c%z?i}XXHnR zlW(qS3iUypv#h$@z&KP8!XSYAR#7|IYJW5LRK|qEfV#r+36$U*Qu1 Z@CW5q83AqrrfdKJ002ovPDHLkV1k_dshnTaJ9DI)aUyUX3? z&E=iUXs7?YH_6>S@ArM4XW!5JKF{qxyS2Tod3NRJD;b8F-P#i9K%Z6C|I8Wa{l?KN z0DWAYZ0R-_X3mS&f7!#!=PYCx>8#e-Wp)Ku%ZeU%0aXt{S0B9jD44>TPi z7|{~-&XN5GoDNN`cit)n`CzgUMzxkLDY$k^Tc@(6N0C(L3V)?9BclLuXaYwj9!nT< zrrw#2E2Hn$Fz0k+ry=J}BX(cMW^6QEx3yBg&o*kmdWk8Y> zTs&9GNmU9y$=*~fdugh|!5ECgglQl@p`>3js++nI)h9_=kS9%y_9PfAw>1lNKB_Y=V4ZSy|z^2V;DT_<3-qgay%^4TTQYO82n9(M2vy_}$_9*0b z$cNS{H>Myk^;D;>$Nafd);@;N(b#C6syfHgTeXC$r;TMk4tFW;cQG0a02BJ%yqjlv zk#&1Jd9N(i$u(YuqF7ipNl%)4G-_*tlxr|_CMGN18n|u+c34N z`jp#X?@<50Z77~%B?=M|sQS6F13We`wVliD=lIGR>pT-H(P#ZQ$*79ai2~W`5q#W) zv0~=j{4T2+W4+n=l7~kxPO#qdu67xB?Iye0W!$ysxh|oZes?|_Hf-~g4Q-8E|mdLp^ttgO?Wk z^^L#>YkvCJ)6v7%tbFv;-h%_Xe{=rip@G4hET`O;R z@R8@Y{}}zbzqmK?t<(27diOuTt|;5K?(U{w^EaMlwms7D%DFW^5O8nWyZOgkdnSrL@#;x+ucV_K5Htpqmy{Ar{`_-{&J5!sw z-@NAQzt(RlufDm$6B$0TuPQovZS>AXA4ax~e!Tp|FRyy}-V0wcZW(&=+Vw-PE*WWC z_c(uL=AO&jE9O=@oNPt;(YCAhc&6_(L&n7~Fa5`+StGwYcXHj}1MknB@%BU0E`0mX zPY2Ju<~#OG-@h;Q=(F^-$UAYd5^E_Q(gTR{v~w?RN*Sd+q!uAH|0Hz`TK~v&W`ahpNOMfzG`T zKK{a6Pc47-j^Db1UrXs6%gmd9zBO`r^*>z~zRE0H_@|3vbJjT!%$dLEBTQ8R9|wd3008in6lFF3GV-6mLi?MoP_y~}QUnaDCHI#t z7w^m$@6DI)|C8_jrT?q=f8D?0AM?L)Z}xAo^e^W>t$*Y0KlT5=@bBjT9kxb%-KNdk zeOS1tKO#ChhG7%{ApNBzE2ZVNcxbrin#E1TiAw#BlUhXllzhN$qWez5l;h+t^q#Eav8PhR2|T}y5kkflaK`ba-eoE+Z2q@o6P$)=&` z+(8}+-McnNO>e#$Rr{32ngsZIAX>GH??tqgwUuUz6kjns|LjsB37zUEWd|(&O!)DY zQLrq%Y>)Y8G`yYbYCx&aVHi@-vZ3|ebG!f$sTQqMgi0hWRJ^Wc+Ibv!udh_r%2|U) zPi|E^PK?UE!>_4`f`1k4hqqj_$+d!EB_#IYt;f9)fBOumGNyglU(ofY`yHq4Y?B%- zp&G!MRY<~ajTgIHErMe(Z8JG*;D-PJhd@RX@QatggM7+G(Lz8eZ;73)72Hfx5KDOE zkT(m}i2;@X2AT5fW?qVp?@WgN$aT+f_6eo?IsLh;jscNRp|8H}Z9p_UBO^SJXpZew zEK8fz|0Th%(Wr|KZBGTM4yxkA5CFdAj8=QSrT$fKW#tweUFqr0TZ9D~a5lF{)%-tTGMK^2tz(y2v$i%V8XAxIywrZCp=)83p(zIk6@S5AWl|Oa2hF`~~^W zI;KeOSkw1O#TiQ8;U7OPXjZM|KrnN}9arP)m0v$c|L)lF`j_rpG(zW1Qjv$=^|p*f z>)Na{D&>n`jOWMwB^TM}slgTEcjxTlUby89j1)|6ydRfWERn3|7Zd2&e7?!K&5G$x z`5U3uFtn4~SZq|LjFVrz$3iln-+ucY4q$BC{CSm7Xe5c1J<=%Oagztj{ifpaZk_bQ z9Sb-LaQMKp-qJA*bP6DzgE3`}*i1o3GKmo2pn@dj0;He}F=BgINo};6gQF8!n0ULZ zL>kC0nPSFzlcB7p41doao2F7%6IUTi_+!L`MM4o*#Y#0v~WiO8uSeAUNp=vA2KaR&=jNR2iVwG>7t%sG2x_~yXzY)7K& zk3p+O0AFZ1eu^T3s};B%6TpJ6h-Y%B^*zT&SN7C=N;g|#dGIVMSOru3iv^SvO>h4M=t-N1GSLLDqVTcgurco6)3&XpU!FP6Hlrmj}f$ zp95;b)>M~`kxuZF3r~a!rMf4|&1=uMG$;h^g=Kl;H&Np-(pFT9FF@++MMEx3RBsK?AU0fPk-#mdR)Wdkj)`>ZMl#^<80kM87VvsI3r_c@_vX=fdQ`_9-d(xiI z4K;1y1TiPj_RPh*SpDI7U~^QQ?%0&!$Sh#?x_@;ag)P}ZkAik{_WPB4rHyW#%>|Gs zdbhyt=qQPA7`?h2_8T;-E6HI#im9K>au*(j4;kzwMSLgo6u*}-K`$_Gzgu&XE)udQ zmQ72^eZd|vzI)~!20JV-v-T|<4@7ruqrj|o4=JJPlybwMg;M$Ud7>h6g()CT@wXm` zbq=A(t;RJ^{Xxi*Ff~!|3!-l_PS{AyNAU~t{h;(N(PXMEf^R(B+ZVX3 z8y0;0A8hJYp@g+c*`>eTA|3Tgv9U8#BDTO9@a@gVMDxr(fVaEqL1tl?md{v^j8aUv zm&%PX4^|rX|?E4^CkplWWNv*OKM>DxPa z!RJ)U^0-WJMi)Ksc!^ixOtw^egoAZZ2Cg;X7(5xZG7yL_;UJ#yp*ZD-;I^Z9qkP`} zwCTs0*%rIVF1sgLervtnUo&brwz?6?PXRuOCS*JI-WL6GKy7-~yi0giTEMmDs_-UX zo=+nFrW_EfTg>oY72_4Z0*uG>MnXP=c0VpT&*|rvv1iStW;*^={rP1y?Hv+6R6bxFMkxpWkJ>m7Ba{>zc_q zEefC3jsXdyS5??Mz7IET$Kft|EMNJIv7Ny8ZOcKnzf`K5Cd)&`-fTY#W&jnV0l2vt z?Gqhic}l}mCv1yUEy$%DP}4AN;36$=7aNI^*AzV(eYGeJ(Px-j<^gSDp5dBAv2#?; zcMXv#aj>%;MiG^q^$0MSg-(uTl!xm49dH!{X0){Ew7ThWV~Gtj7h%ZD zVN-R-^7Cf0VH!8O)uUHPL2mO2tmE*cecwQv_5CzWeh)ykX8r5Hi`ehYo)d{Jnh&3p z9ndXT$OW51#H5cFKa76c<%nNkP~FU93b5h-|Cb}ScHs@4Q#|}byWg;KDMJ#|l zE=MKD*F@HDBcX@~QJH%56eh~jfPO-uKm}~t7VkHxHT;)4sd+?Wc4* z>CyR*{w@4(gnYRdFq=^(#-ytb^5ESD?x<0Skhb%Pt?npNW1m+Nv`tr9+qN<3H1f<% zZvNEqyK5FgPsQ`QIu9P0x_}wJR~^CotL|n zk?dn;tLRw9jJTur4uWoX6iMm914f0AJfB@C74a;_qRrAP4E7l890P&{v<}>_&GLrW z)klculcg`?zJO~4;BBAa=POU%aN|pmZJn2{hA!d!*lwO%YSIzv8bTJ}=nhC^n}g(ld^rn#kq9Z3)z`k9lvV>y#!F4e{5c$tnr9M{V)0m(Z< z#88vX6-AW7T2UUwW`g<;8I$Jb!R%z@rCcGT)-2k7&x9kZZT66}Ztid~6t0jKb&9mm zpa}LCb`bz`{MzpZR#E*QuBiZXI#<`5qxx=&LMr-UUf~@dRk}YI2hbMsAMWOmDzYtm zjof16D=mc`^B$+_bCG$$@R0t;e?~UkF?7<(vkb70*EQB1rfUWXh$j)R2)+dNAH5%R zEBs^?N;UMdy}V};59Gu#0$q53$}|+q7CIGg_w_WlvE}AdqoS<7DY1LWS9?TrfmcvT zaypmplwn=P4;a8-%l^e?f`OpGb}%(_mFsL&GywhyN(-VROj`4~V~9bGv%UhcA|YW% zs{;nh@aDX11y^HOFXB$a7#Sr3cEtNd4eLm@Y#fc&j)TGvbbMwze zXtekX_wJqxe4NhuW$r}cNy|L{V=t#$%SuWEW)YZTH|!iT79k#?632OFse{+BT_gau zJwQcbH{b}dzKO?^dV&3nTILYlGw{27UJ72ZN){BILd_HV_s$WfI2DC<9LIHFmtyw? zQ;?MuK7g%Ym+4e^W#5}WDLpko%jPOC=aN)3!=8)s#Rnercak&b3ESRX3z{xfKBF8L z5%CGkFmGO@x?_mPGlpEej!3!AMddChabyf~nJNZxx!D&{@xEb!TDyvqSj%Y5@A{}9 zRzoBn0?x}=krh{ok3Nn%e)#~uh;6jpezhA)ySb^b#E>73e*frBFu6IZ^D7Ii&rsiU z%jzygxT-n*joJpY4o&8UXr2s%j^Q{?e-voloX`4DQyEK+DmrZh8A$)iWL#NO9+Y@!sO2f@rI!@jN@>HOA< z?q2l{^%mY*PNx2FoX+A7X3N}(RV$B`g&N=e0uvAvEN1W^{*W?zT1i#fxuw10%~))J zjx#gxoVlXREWZf4hRkgdHx5V_S*;p-y%JtGgQ4}lnA~MBz-AFdxUxU1RIT$`sal|X zPB6sEVRjGbXIP0U+?rT|y5+ev&OMX*5C$n2SBPZr`jqzrmpVrNciR0e*Wm?fK6DY& zl(XQZ60yWXV-|Ps!A{EF;=_z(YAF=T(-MkJXUoX zI{UMQDAV2}Ya?EisdEW;@pE6dt;j0fg5oT2dxCi{wqWJ<)|SR6fxX~5CzblPGr8cb zUBVJ2CQd~3L?7yfTpLNbt)He1D>*KXI^GK%<`bq^cUq$Q@uJifG>p3LU(!H=C)aEL zenk7pVg}0{dKU}&l)Y2Y2eFMdS(JS0}oZUuVaf2+K*YFNGHB`^YGcIpnBlMhO7d4@vV zv(@N}(k#REdul8~fP+^F@ky*wt@~&|(&&meNO>rKDEnB{ykAZ}k>e@lad7to>Ao$B zz<1(L=#J*u4_LB=8w+*{KFK^u00NAmeNN7pr+Pf+N*Zl^dO{LM-hMHyP6N!~`24jd zXYP|Ze;dRXKdF2iJG$U{k=S86l@pytLx}$JFFs8e)*Vi?aVBtGJ3JZUj!~c{(rw5>vuRF$`^p!P8w1B=O!skwkO5yd4_XuG^QVF z`-r5K7(IPSiKQ2|U9+`@Js!g6sfJwAHVd|s?|mnC*q zp|B|z)(8+mxXyxQ{8Pg3F4|tdpgZZSoU4P&9I8)nHo1@)9_9u&NcT^FI)6|hsAZFk zZ+arl&@*>RXBf-OZxhZerOr&dN5LW9@gV=oGFbK*J+m#R-|e6(Loz(;g@T^*oO)0R zN`N=X46b{7yk5FZGr#5&n1!-@j@g02g|X>MOpF3#IjZ_4wg{dX+G9eqS+Es9@6nC7 zD9$NuVJI}6ZlwtUm5cCAiYv0(Yi{%eH+}t)!E^>^KxB5^L~a`4%1~5q6h>d;paC9c zTj0wTCKrhWf+F#5>EgX`sl%POl?oyCq0(w0xoL?L%)|Q7d|Hl92rUYAU#lc**I&^6p=4lNQPa0 znQ|A~i0ip@`B=FW-Q;zh?-wF;Wl5!+q3GXDu-x&}$gUO)NoO7^$BeEIrd~1Dh{Tr` z8s<(Bn@gZ(mkIGnmYh_ehXnq78QL$pNDi)|QcT*|GtS%nz1uKE+E{7jdEBp%h0}%r zD2|KmYGiPa4;md-t_m5YDz#c*oV_FqXd85d@eub?9N61QuYcb3CnVWpM(D-^|CmkL z(F}L&N7qhL2PCq)fRh}XO@U`Yn<?TNGR4L(mF7#4u29{i~@k;pLsgl({YW5`Mo+p=zZn3L*4{JU;++dG9 X@eDJUQo;Ye2mwlRs?y0|+_a0zY+Zo%Dkae}+MySoIppb75o?vUW_?)>@g{U2`ERQIXV zeY$JrWnMZ$QC<=ii4X|@0H8`si75jB(ElJb00HAB%>SlLR{!zO|C9P3zxw_U8?1d8uRZ=({Ga4shyN}3 zAK}WA(ds|``G4jA)9}Bt2Hy0+f3rV1E6b|@?hpGA=PI&r8)ah|)I2s(P5Ic*Ndhn^ z*T&j@gbCTv7+8rpYbR^Ty}1AY)YH;p!m948r#%7x^Z@_-w{pDl|1S4`EM3n_PaXvK z1JF)E3qy$qTj5Xs{jU9k=y%SQ0>8E$;x?p9ayU0bZZeo{5Z@&FKX>}s!0+^>C^D#z z>xsCPvxD3Z=dP}TTOSJhNTPyVt14VCQ9MQFN`rn!c&_p?&4<5_PGm4a;WS&1(!qKE z_H$;dDdiPQ!F_gsN`2>`X}$I=B;={R8%L~`>RyKcS$72ai$!2>d(YkciA^J0@X%G4 z4cu!%Ps~2JuJ8ex`&;Fa0NQOq_nDZ&X;^A=oc1&f#3P1(!5il>6?uK4QpEG8z0Rhu zvBJ+A9RV?z%v?!$=(vcH?*;vRs*+PPbOQ3cdPr5=tOcLqmfx@#hOqX0iN)wTTO21jH<>jpmwRIAGw7`a|sl?9y9zRBh>(_%| zF?h|P7}~RKj?HR+q|4U`CjRmV-$mLW>MScKnNXiv{vD3&2@*u)-6P@h0A`eeZ7}71 zK(w%@R<4lLt`O7fs1E)$5iGb~fPfJ?WxhY7c3Q>T-w#wT&zW522pH-B%r5v#5y^CF zcC30Se|`D2mY$hAlIULL%-PNXgbbpRHgn<&X3N9W!@BUk@9g*P5mz-YnZBb*-$zMM z7Qq}ic0mR8n{^L|=+diODdV}Q!gwr?y+2m=3HWwMq4z)DqYVg0J~^}-%7rMR@S1;9 z7GFj6K}i32X;3*$SmzB&HW{PJ55kT+EI#SsZf}bD7nW^Haf}_gXciYKX{QBxIPSx2Ma? zHQqgzZq!_{&zg{yxqv3xq8YV+`S}F6A>Gtl39_m;K4dA{pP$BW0oIXJ>jEQ!2V3A2 zdpoTxG&V=(?^q?ZTj2ZUpDUdMb)T?E$}CI>r@}PFPWD9@*%V6;4Ag>D#h>!s)=$0R zRXvdkZ%|c}ubej`jl?cS$onl9Tw52rBKT)kgyw~Xy%z62Lr%V6Y=f?2)J|bZJ5(Wx zmji`O;_B+*X@qe-#~`HFP<{8$w@z4@&`q^Q-Zk8JG3>WalhnW1cvnoVw>*R@c&|o8 zZ%w!{Z+MHeZ*OE4v*otkZqz11*s!#s^Gq>+o`8Z5 z^i-qzJLJh9!W-;SmFkR8HEZJWiXk$40i6)7 zZpr=k2lp}SasbM*Nbn3j$sn0;rUI;%EDbi7T1ZI4qL6PNNM2Y%6{LMIKW+FY_yF3) zSKQ2QSujzNMSL2r&bYs`|i2Dnn z=>}c0>a}>|uT!IiMOA~pVT~R@bGlm}Edf}Kq0?*Af6#mW9f9!}RjW7om0c9Qlp;yK z)=XQs(|6GCadQbWIhYF=rf{Y)sj%^Id-ARO0=O^Ad;Ph+ z0?$eE1xhH?{T$QI>0JP75`r)U_$#%K1^BQ8z#uciKf(C701&RyLQWBUp*Q7eyn76} z6JHpC9}R$J#(R0cDCkXoFSp;j6{x{b&0yE@P7{;pCEpKjS(+1RQy38`=&Yxo%F=3y zCPeefABp34U-s?WmU#JJw23dcC{sPPFc2#J$ZgEN%zod}J~8dLm*fx9f6SpO zn^Ww3bt9-r0XaT2a@Wpw;C23XM}7_14#%QpubrIw5aZtP+CqIFmsG4`Cm6rfxl9n5 z7=r2C-+lM2AB9X0T_`?EW&Byv&K?HS4QLoylJ|OAF z`8atBNTzJ&AQ!>sOo$?^0xj~D(;kS$`9zbEGd>f6r`NC3X`tX)sWgWUUOQ7w=$TO&*j;=u%25ay-%>3@81tGe^_z*C7pb9y*Ed^H3t$BIKH2o+olp#$q;)_ zfpjCb_^VFg5fU~K)nf*d*r@BCC>UZ!0&b?AGk_jTPXaSnCuW110wjHPPe^9R^;jo3 zwvzTl)C`Zl5}O2}3lec=hZ*$JnkW#7enKKc)(pM${_$9Hc=Sr_A9Biwe*Y=T?~1CK z6eZ9uPICjy-sMGbZl$yQmpB&`ouS8v{58__t0$JP%i3R&%QR3ianbZqDs<2#5FdN@n5bCn^ZtH992~5k(eA|8|@G9u`wdn7bnpg|@{m z^d6Y`*$Zf2Xr&|g%sai#5}Syvv(>Jnx&EM7-|Jr7!M~zdAyjt*xl;OLhvW-a%H1m0 z*x5*nb=R5u><7lyVpNAR?q@1U59 zO+)QWwL8t zyip?u_nI+K$uh{y)~}qj?(w0&=SE^8`_WMM zTybjG=999h38Yes7}-4*LJ7H)UE8{mE(6;8voE+TYY%33A>S6`G_95^5QHNTo_;Ao ztIQIZ_}49%{8|=O;isBZ?=7kfdF8_@azfoTd+hEJKWE!)$)N%HIe2cplaK`ry#=pV z0q{9w-`i0h@!R8K3GC{ivt{70IWG`EP|(1g7i_Q<>aEAT{5(yD z=!O?kq61VegV+st@XCw475j6vS)_z@efuqQgHQR1T4;|-#OLZNQJPV4k$AX1Uk8Lm z{N*b*ia=I+MB}kWpupJ~>!C@xEN#Wa7V+7{m4j8c?)ChV=D?o~sjT?0C_AQ7B-vxqX30s0I_`2$in86#`mAsT-w?j{&AL@B3$;P z31G4(lV|b}uSDCIrjk+M1R!X7s4Aabn<)zpgT}#gE|mIvV38^ODy@<&yflpCwS#fRf9ZX3lPV_?8@C5)A;T zqmouFLFk;qIs4rA=hh=GL~sCFsXHsqO6_y~*AFt939UYVBSx1s(=Kb&5;j7cSowdE;7()CC2|-i9Zz+_BIw8#ll~-tyH?F3{%`QCsYa*b#s*9iCc`1P1oC26?`g<9))EJ3%xz+O!B3 zZ7$j~To)C@PquR>a1+Dh>-a%IvH_Y7^ys|4o?E%3`I&ADXfC8++hAdZfzIT#%C+Jz z1lU~K_vAm0m8Qk}K$F>|>RPK%<1SI0(G+8q~H zAsjezyP+u!Se4q3GW)`h`NPSRlMoBjCzNPesWJwVTY!o@G8=(6I%4XHGaSiS3MEBK zhgGFv6Jc>L$4jVE!I?TQuwvz_%CyO!bLh94nqK11C2W$*aa2ueGopG8DnBICVUORP zgytv#)49fVXDaR$SukloYC3u7#5H)}1K21=?DKj^U)8G;MS)&Op)g^zR2($<>C*zW z;X7`hLxiIO#J`ANdyAOJle4V%ppa*(+0i3w;8i*BA_;u8gOO6)MY`ueq7stBMJTB; z-a0R>hT*}>z|Gg}@^zDL1MrH+2hsR8 zHc}*9IvuQC^Ju)^#Y{fOr(96rQNPNhxc;mH@W*m206>Lo<*SaaH?~8zg&f&%YiOEG zGiz?*CP>Bci}!WiS=zj#K5I}>DtpregpP_tfZtPa(N<%vo^#WCQ5BTv0vr%Z{)0q+ z)RbfHktUm|lg&U3YM%lMUM(fu}i#kjX9h>GYctkx9Mt_8{@s%!K_EI zScgwy6%_fR?CGJQtmgNAj^h9B#zmaMDWgH55pGuY1Gv7D z;8Psm(vEPiwn#MgJYu4Ty9D|h!?Rj0ddE|&L3S{IP%H4^N!m`60ZwZw^;eg4sk6K{ ziA^`Sbl_4~f&Oo%n;8Ye(tiAdlZKI!Z=|j$5hS|D$bDJ}p{gh$KN&JZYLUjv4h{NY zBJ>X9z!xfDGY z+oh_Z&_e#Q(-}>ssZfm=j$D&4W4FNy&-kAO1~#3Im;F)Nwe{(*75(p=P^VI?X0GFakfh+X-px4a%Uw@fSbmp9hM1_~R>?Z8+ ziy|e9>8V*`OP}4x5JjdWp}7eX;lVxp5qS}0YZek;SNmm7tEeSF*-dI)6U-A%m6YvCgM(}_=k#a6o^%-K4{`B1+}O4x zztDT%hVb;v#?j`lTvlFQ3aV#zkX=7;YFLS$uIzb0E3lozs5`Xy zi~vF+%{z9uLjKvKPhP%x5f~7-Gj+%5N`%^=yk*Qn{`> z;xj&ROY6g`iy2a@{O)V(jk&8#hHACVDXey5a+KDod_Z&}kHM}xt7}Md@pil{2x7E~ zL$k^d2@Ec2XskjrN+IILw;#7((abu;OJii&v3?60x>d_Ma(onIPtcVnX@ELF0aL?T zSmWiL3(dOFkt!x=1O!_0n(cAzZW+3nHJ{2S>tgSK?~cFha^y(l@-Mr2W$%MN{#af8J;V*>hdq!gx=d0h$T7l}>91Wh07)9CTX zh2_ZdQCyFOQ)l(}gft0UZG`Sh2`x-w`5vC2UD}lZs*5 zG76$akzn}Xi))L3oGJ75#pcN=cX3!=57$Ha=hQ2^lwdyU#a}4JJOz6ddR%zae%#4& za)bFj)z=YQela(F#Y|Q#dp}PJghITwXouVaMq$BM?K%cXn9^Y@g43$=O)F&ZlOUom zJiad#dea;-eywBA@e&D6Pdso1?2^(pXiN91?jvcaUyYoKUmvl5G9e$W!okWe*@a<^ z8cQQ6cNSf+UPDx%?_G4aIiybZHHagF{;IcD(dPO!#=u zWfqLcPc^+7Uu#l(Bpxft{*4lv#*u7X9AOzDO z1D9?^jIo}?%iz(_dwLa{ex#T}76ZfN_Z-hwpus9y+4xaUu9cX}&P{XrZVWE{1^0yw zO;YhLEW!pJcbCt3L8~a7>jsaN{V3>tz6_7`&pi%GxZ=V3?3K^U+*ryLSb)8^IblJ0 zSRLNDvIxt)S}g30?s_3NX>F?NKIGrG_zB9@Z>uSW3k2es_H2kU;Rnn%j5qP)!XHKE zPB2mHP~tLCg4K_vH$xv`HbRsJwbZMUV(t=ez;Ec(vyHH)FbfLg`c61I$W_uBB>i^r z&{_P;369-&>23R%qNIULe=1~T$(DA`ev*EWZ6j(B$(te}x1WvmIll21zvygkS%vwG zzkR6Z#RKA2!z!C%M!O>!=Gr0(J0FP=-MN=5t-Ir)of50y10W}j`GtRCsXBakrKtG& zazmITDJMA0C51&BnLY)SY9r)NVTMs);1<=oosS9g31l{4ztjD3#+2H7u_|66b|_*O z;Qk6nalpqdHOjx|K&vUS_6ITgGll;TdaN*ta=M_YtyC)I9Tmr~VaPrH2qb6sd~=AcIxV+%z{E&0@y=DPArw zdV7z(G1hBx7hd{>(cr43^WF%4Y@PXZ?wPpj{OQ#tvc$pABJbvPGvdR`cAtHn)cSEV zrpu}1tJwQ3y!mSmH*uz*x0o|CS<^w%&KJzsj~DU0cLQUxk5B!hWE>aBkjJle8z~;s z-!A=($+}Jq_BTK5^B!`R>!MulZN)F=iXXeUd0w5lUsE5VP*H*oCy(;?S$p*TVvTxwAeWFB$jHyb0593)$zqalVlDX=GcCN1gU0 zlgU)I$LcXZ8Oyc2TZYTPu@-;7<4YYB-``Qa;IDcvydIA$%kHhJKV^m*-zxcvU4viy&Kr5GVM{IT>WRywKQ9;>SEiQD*NqplK-KK4YR`p0@JW)n_{TU3bt0 zim%;(m1=#v2}zTps=?fU5w^(*y)xT%1vtQH&}50ZF!9YxW=&7*W($2kgKyz1mUgfs zfV<*XVVIFnohW=|j+@Kfo!#liQR^x>2yQdrG;2o8WZR+XzU_nG=Ed2rK?ntA;K5B{ z>M8+*A4!Jm^Bg}aW?R?6;@QG@uQ8&oJ{hFixcfEnJ4QH?A4>P=q29oDGW;L;= z9-a0;g%c`C+Ai!UmK$NC*4#;Jp<1=TioL=t^YM)<<%u#hnnfSS`nq63QKGO1L8RzX z@MFDqs1z ztYmxDl@LU)5acvHk)~Z`RW7=aJ_nGD!mOSYD>5Odjn@TK#LY{jf?+piB5AM-CAoT_ z?S-*q7}wyLJzK>N%eMPuFgN)Q_otKP;aqy=D5f!7<=n(lNkYRXVpkB{TAYLYg{|(jtRqYmg$xH zjmq?B(RE4 zQx^~Pt}gxC2~l=K$$-sYy_r$CO(d=+b3H1MB*y_5g6WLaWTXn+TKQ|hNY^>Mp6k*$ zwkovomhu776vQATqT4blf~g;TY(MWCrf^^yfWJvSAB$p5l;jm@o#=!lqw+Lqfq>X= z$6~kxfm7`3q4zUEB;u4qa#BdJxO!;xGm)wwuisj{0y2x{R(IGMrsIzDY9LW>m!Y`= z04sx3IjnYvL<4JqxQ8f7qYd0s2Ig%`ytYPEMKI)s(LD}D@EY>x`VFtqvnADNBdeao zC96X+MxnwKmjpg{U&gP3HE}1=s!lv&D{6(g_lzyF3A`7Jn*&d_kL<;dAFx!UZ>hB8 z5A*%LsAn;VLp>3${0>M?PSQ)9s3}|h2e?TG4_F{}{Cs>#3Q*t$(CUc}M)I}8cPF6% z=+h(Kh^8)}gj(0}#e7O^FQ6`~fd1#8#!}LMuo3A0bN`o}PYsm!Y}sdOz$+Tegc=qT z8x`PH$7lvnhJp{kHWb22l;@7B7|4yL4UOOVM0MP_>P%S1Lnid)+k9{+3D+JFa#Pyf zhVc#&df87APl4W9X)F3pGS>@etfl=_E5tBcVoOfrD4hmVeTY-cj((pkn%n@EgN{0f zwb_^Rk0I#iZuHK!l*lN`ceJn(sI{$Fq6nN& zE<-=0_2WN}m+*ivmIOxB@#~Q-cZ>l136w{#TIJe478`KE7@=a{>SzPHsKLzYAyBQO zAtuuF$-JSDy_S@6GW0MOE~R)b;+0f%_NMrW(+V#c_d&U8Z9+ec4=HmOHw?gdjF(Lu zzra83M_BoO-1b3;9`%&DHfuUY)6YDV21P$C!Rc?mv&{lx#f8oc6?0?x zK08{WP65?#>(vPfA-c=MCY|%*1_<3D4NX zeVTi-JGl2uP_2@0F{G({pxQOXt_d{g_CV6b?jNpfUG9;8yle-^4KHRvZs-_2siata zt+d_T@U$&t*xaD22(fH(W1r$Mo?3dc%Tncm=C6{V9y{v&VT#^1L04vDrLM9qBoZ4@ z6DBN#m57hX7$C(=#$Y5$bJmwA$T8jKD8+6A!-IJwA{WOfs%s}yxUw^?MRZjF$n_KN z6`_bGXcmE#5e4Ym)aQJ)xg3Pg0@k`iGuHe?f(5LtuzSq=nS^5z>vqU0EuZ&75V%Z{ zYyhRLN^)$c6Ds{f7*FBpE;n5iglx5PkHfWrj3`x^j^t z7ntuV`g!9Xg#^3!x)l*}IW=(Tz3>Y5l4uGaB&lz{GDjm2D5S$CExLT`I1#n^lBH7Y zDgpMag@`iETKAI=p<5E#LTkwzVR@=yY|uBVI1HG|8h+d;G-qfuj}-ZR6fN>EfCCW z9~wRQoAPEa#aO?3h?x{YvV*d+NtPkf&4V0k4|L=uj!U{L+oLa(z#&iuhJr3-PjO3R z5s?=nn_5^*^Rawr>>Nr@K(jwkB#JK-=+HqwfdO<+P5byeim)wvqGlP-P|~Nse8=XF zz`?RYB|D6SwS}C+YQv+;}k6$-%D(@+t14BL@vM z2q%q?f6D-A5s$_WY3{^G0F131bbh|g!}#BKw=HQ7mx;Dzg4Z*bTLQSfo{ed{4}NZW zfrRm^Ca$rlE{Ue~uYv>R9{3smwATcdM_6+yWIO z*ZRH~uXE@#p$XTbCt5j7j2=86e{9>HIB6xDzV+vAo&B?KUiMP|ttOElepnl%|DPqL b{|{}U^kRn2wo}j7|0ATu<;8xA7zX}7|B6mN diff --git a/frontend/public/manifest.json b/frontend/public/manifest.json deleted file mode 100644 index 204263cc1e..0000000000 --- a/frontend/public/manifest.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "short_name": "PIMS", - "name": "Property Inventory Management System", - "icons": [ - ], - "start_url": ".", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} diff --git a/frontend/public/robots.txt b/frontend/public/robots.txt deleted file mode 100644 index 01b0f9a107..0000000000 --- a/frontend/public/robots.txt +++ /dev/null @@ -1,2 +0,0 @@ -# https://www.robotstxt.org/robotstxt.html -User-agent: * diff --git a/frontend/public/satellite.jpg b/frontend/public/satellite.jpg deleted file mode 100644 index 3d613d1c97726558c4e0ccf24c9e82947d3dec81..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4118 zcmbVNc{J4f`~PT$?3qH5t}!Uvn8iAS6f@SCY$=k)%wUXJ%nXLgEhRer=X-wV_nh-N=lyK2XL&!*`?LCVbqv^o=TQRzz|m0; zkOcmw)z<(77fzx@0b&4HB(?;A)iKbCU@n)1MIaa)Ln4_OKrtjS=?ET?g+Li15rCyN zk3}TWC|qa&C5Xzfg1u>Jg+ZxgE10*53(|#UO9`erM6)R#(XO7PXc`GahFR}~TJo?w zI*U%>5}`bLD1(FLS;4-6V@2mRF#-ntX2PXe!FI1jh3cMA6vfK&(5??t3f|X9fFSRAgkNVWg2E zlO2RWVK5j35{*Ek;UWt-CyK!(^56`P<_`oMg+pRfSzIcU0bN5R1~9|9RxnYf|1E*e za&h?y{IA`j)7R?yX3gQcQ~pllU#&TwQ7j6=ox)*;vq=<@x#kaNQSbhDpfy8LHdq3i zD!LS6D2_=Ar&AbQN1PQ*q%kB@$yjp}bEJu=Xt)sxZ45UyCz-;DNb^8=poy6|CeRo| zBAEpI!1*_SBeby@$_8y@hBLK6q435wD2(xLjH!_=&deB%G&ld@>&W16i3}3uM{KGn z_IF?O|MbP$vMEF^lkLf5hW?m>y}?W_lM~EjL2Yfn-8xjqg-D_@)`Yri7xmw|aTGQ+ zfIDL?`Y z28)9w#Kk3~Bt)N#q=bZ|jI6Y@jI^|@g6ua^kd@z{ut8pS(5`zHiAYveh*y=qX0RYy40MOr03Lq{4 z0_O*cbCaO*(-L=}Uq(?D(94MJ~P9Ry@SA~ggA0jz;5n;L39 z4b)_O?D->b9IrH*1lAdJ5lHaR0)>4K0Z>Lnqq^|;)L+R}IUUlL) zPpwJ!Ud6cN zzF)7S=_=4d2=2IX8q<`y7|bSrkpd?@izw`tR3+!|$NO2DlQ=}bi}K?e%RSd~e;MBo z6u;Y;zYm|yzhV|1;?%P2#a(P$>b3X+Ls@W(Ht2LHrkKtb{8{KJaOsaTIag;^JU==Y zfksBBl9h57y2Z|P{S@?X7kv^)Yx4z3%tsS<502S|HO5Rmut=A1 zw+uR?cJho2-9DZ?-SGUv-iiye%})0R=OS1u@ATxudJ|mo_^r)(c^v5JnR6A4KcpkVKrwp)*@s)T*9 zpp`x$6F!|V1@YD=*4nc-gTkKTrXX6riF%iO+$|30TTK;x2Z|i;Mv_^ZI z8&Z$m?+>RDa+&GUbVdz=bQ^O#5srG2d2hRup(%}AS|#(K__2OS{>@*?s#;2GrJII$ z{M(5Ve!`SQaE|~i%-8pS310>L+O$6$4e$26X5Ps#>4zG89HBisk~NJX)z|B6Pa3DU zhvSxKo^ULNP!`Xye21RJ-nI}@0Y6=G9vWBw>WJP#e@IqQTw-=S>aPKzjTRf#TYM&V zf?imt4l9XRoT#e%)reR-0QdC@)y3icUR}swF5Oa{zFTQ9pWCe!crigfJN44$b$u4!_Kj#-yBtPU#$5MpQfD4D=}Eq?JW`nWnq1y+?wUX|W$D4LBuj@hEQ;7kA0UKh)P-$WsgFHX z2+OwdnyB&|xZeKgcUwE{BM~fl{j*!`gzm*jPZMC;#U<_n%eoj?JSzzO=hLv#7e=Yn zg=QJD1VKfrP^Y2wfy*Y5yWH3)HOTH5Oo_i( z1#gJWt7>kTmN{^sCT}~cKuWvA?}1qMYYPQF-wLm&@B7SaUvg30{!|rp>auG^S7ur` zn*k|`(1l%~_or`ltHF(x`(={bw{=cEC0;+)SiW*M<5z_to+lh#CNC>(Z_6%;Nbr5a zHy-j1QJ`GzG>{EF!h7oKAe#(V-vv=P^)Q4M<)-^Zzx?XwLybW_H!!*zS30Nsa<$#W zz@56j`&t(9kg8gtu=266^U;@-MhU%zxqapuQGr3UB9g$*A-V=pHOne|dD)FL?ihEmbe$8#A?z0Mfy$h<)j2-Io z*cbSLt7LhD#3qnOuEscB$}>AS*_1SccNNWm>&J19<;m1%R;Z#Ytp3_?g#6#S7(;%GM&z)Uw+kmz~KJtdok@fQq{q1l{1Pl zy6q_ebrrf^b|-J@cGeN(4&;zPE-|EtTC-9dV{6CIyKcO&`goG*7);~Vu#%?@zYaXS zId++Lt;^R_`vr?7VdoFIBxPuskb*+y@93RSq&s+?0ap~YoxSTvJccr}vR8Z9sbxQA zM~DbkhBY~-x@}5Vms62CWrlSgI9fcu(Id+c9_#c}(BbA@I&-pq1Uoppu21-JO3~(P zbKn8#y7Qh6Nq6)@>jw$)9iLw{|Kitv$HUdJE7DFM#sKSVOvLwaGZa+nAbazT^pois z;RfDDa>+d}CNwaiykydeunLU|>5}54{EFmT>5i-`Ls3Tyr!GrAsIm*q8c_n{6%~s@ zPF4B{j@Dj1r(D|}vbZ$u9R1s-^bJE_-Xkw*crBb2{bGXT-xWM;c2-a;D5B>+EAOb= zmDSqeGX*+Vl5;0uOrcrs?DbqwaH5 zFTtQFIB+Zc)o)Zfw@$sRFvIHBA1yk;FLIToPUy+u`pHdtmX^j5`GQw9klQ;(iG0D; zU?G1D=9zUi7J`WL3ceKGVDLPXq_OkK;)4r82C9uuHSx$$JVGP%PwFI_#|v?(`1IB; za|9Q5rXblhpTg@3uXXg(DkxYE)twN)v)PoCjv}q%WX82jRoCn0buhO{=Ub_iT7t>A zX^4>{au7&S=$rI8=&H9P>63Sew{w?_xzbna#_Xk4;C1+N2|}Rjv#`9Pdfwlw&xEr@ z*4IE*>FBY#_Drf-Kt-vI4nIfTO5b13ugVV_@pb-HjA!mu*L`D7MW+XwO^**|?Zyl8 zEAdK%(Q^Hp>p$w>;Ka*)<+{g-oqipxs$WhxaOF?sxK=sDe%o|9MrQu`J!_0M*+J?a zeW6@R;h9cColSiU^H%CqW)AZDGP!`F5>{$or0t@emyYQU-p;Qroj#5&LJD(Q~-3^rrZ!pV}dmp13?g~R)Vxllfh zMCq4mFt-HIO{ENqlZ$EucHOKSbl76tdQPwkq#mmNFgvqy(I@6jTBHB!z<&U? C4e7W5 diff --git a/frontend/public/streets.jpg b/frontend/public/streets.jpg deleted file mode 100644 index a80065f411bb158606418a48151c38e12577ec0f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2883 zcmbVM2{hDe8~=|nV~H}MTeij|Nyh9mWSN)s18(8ci z=WzjG!v{%iKM$Qmp zaQ0XX;J8LEX0Z4i8IsA_%@aDI-c{d0A$e>kR1nDr>mzpKg!0z!m2d*~ZVF`W<+G@4 z)EZ}`qnsuehy@%O11T4T38gf-6Ka;62Ciq+7!-2WM8NwO!S zSy&tqNuk=~NMs6?Vu!?odkoeAgU6z=R2qpu!{U)&1OpUch4`rz?~E7OHxr$ zQT9;;dy!-}21lh*F<3kXk4J+RXlb-i#*m|h(q(fD?i?vg!V}AQA|Y~yk--#2$ed7M zq@Pm|h<$v%5`VK=0>MmPv({3XKj-f-zG*EDj23e+{v4?&Lc-#J=F8^5VD0|d(TpJ& z4Q;c82VM#z%w5Ea5O9RD4em}T@Wh_YW78Z+4p95RDMTU`&qjU0v;W@; zV!)s(3`)&V8MJnLqj7YLqjuDQ&Y30Uj?G2rKPW@ zzu3TFv57Il*yQWM|GH4u0tjuu3-E$M5P${(0!2X7zW|2;Km!VaK>mJHG+;mae#ke)t21;c3n4Hb4&w0i%KTYUx@K{Ffbg|vdo5ixftbf#55>;I=Rs~pb_;_c^p502CXpXG z*t4xAq{Do-YE5(1`O|(S6V3V=@vm>|CP?W_QcS!%Fl8Me?`bn@9dqhbyqvhW@^8 zsbFnLtjWo()RdLMhCxM?(vIE+A$-5ibsrkK+;Y0yY{ebBA=T9lEWG2K0BQoi` z;47_aYP@y+m8537eJ6LYBPzV_t?;|S^LpIKgPc>P#FC00Ro*UAr9id6Rps~Sz8rTZ z@L%f)Mf9V`9^PzE(0+QA{7zr6rTbD_pZ*Y1wW=jVhj!-svna06yE=Jcfsi#-oLr6R zg}0eh?i&&3gzAu*+E@06&`T$N+|uz~Q^oDE zPpxs*S=|qWeDUSWSB}^v0e&%m5=~l{3)Wp7HM(0Dog*wiRJ-0PeHVu7{8B%$F(4(g zCb+D$S-#4e(v|UAYOyIGy{5N#0g|%p(K@4&qT)8&)0HC$X$1;9TRQGIkOyeh9EZ{q zv~M_i!1JdoOovqzWJi0I_~-E{?!yzytCP!DPp7YcEw)@>A%N5 zkS??e=0d!a&Jj?t)v1OJAFJMF<)rlXx+*j?4U5(@{Xb9#{O)xH9Dj>Bk$SpSa>ydm zwx|Alk&?2+crmnQfSjSc2xcX5x2lis5Sw>ac@_D&0<(M}(n zY3FuHI_E~r6$dNP;nZxiqCT5gpYt1aidLi|#^tT+%=evqrsegfn0c#3>m*O2JCqgG zW$C`iWm691nyh`$oqUYGqZBx5w2;hyf-R-m#=6U`6L zR&BlgDLu|7x|%$u1_p0+DlfH7JEiOV`MN3HHsYbil0r*GU;;UB{`Ps{zqZ||s0$Hg z{}uK`YUOf(S1D0OQPn_7+g|VTvY&(Fw|EEAAXNcfzwcL8(FR9P9lhI7W87%seer2s zVxbGfIzC~^t_S#vQEX4e3)plKWF%I;Wqjn*##VOp#qi}y0VOf!*7o+7!R>`-muk4G zCc^s^&&#i48oNuo3rh-AMMbWM6^m6D=v_&))XP!rM+&LU1rsga)bQ~;l24ui|<%*Bl^aT;qsc+n!)1CKC?u3^k&MQ#Z3kOah!=VN`@BX=$tm6`+A)9&cU-pmsCz_JNOD`oj?7_Ag>k)0 z$3=^Ci)7swruKyU9J|*Y$SipoNoXP5^F3i|ZJxh$vtF;gRgPIAFoX%OP=-w9ZG1X{ zGo9Ss7&@`j@8D`($5StZ*TYVQI#s>DR$5W9e|hKSxU#*WXD^;iGUE5q(69Q$T_(p{ zbt5?CzlE;KJBx`pc14!D+3LmqA!#mxt%OYa+EqVOT-db%nReMfwi1=Gspec-9;r#_ zYjLjgqK9gA??6w0q6HVY>(2ELYT()9N9_;WU)QLf7mripV!&o9>)AH-x1 zg5=W3$EAM=?)SY_mKRi4HjLh!oZyRE#`lcexEIqdE>{D>>7ma4O3@E)A!+Bb7 { - const keycloakWrapper: IKeycloak = useKeycloakWrapper(); - const keycloak: Keycloak = keycloakWrapper.obj; - const dispatch = useAppDispatch(); - const location = useLocation(); - - useEffect(() => { - // Track page view in Snowplow Analytics. - // @ts-ignore - window.snowplow('trackPageView'); - }, [location.pathname]); - - useEffect(() => { - if (keycloak?.authenticated) { - getActivateUserAction()(dispatch).then(() => { - //TODO: Modify the "/activate" endpoint to return user agencies as well, thus removing the need for this call - fetchUserAgencies({ username: keycloakWrapper.username })(dispatch); - }); - getFetchLookupCodeAction()(dispatch); - } - }, [dispatch, keycloak]); - - return ( - - {(context: IAuthState) => { - if (!context.ready) { - return ( - - - - - - ); - } - - return ( - <> - - - - - ); - }} - - ); -}; - -export default App; diff --git a/frontend/src/OnLoadActions.tsx b/frontend/src/OnLoadActions.tsx deleted file mode 100644 index 783656af2a..0000000000 --- a/frontend/src/OnLoadActions.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import GenericModal from 'components/common/GenericModal'; -import useKeycloakWrapper from 'hooks/useKeycloakWrapper'; -import React from 'react'; -import { useLocation, useNavigate } from 'react-router-dom'; -import { clearStorage, isStorageInUse, PARCEL_STORAGE_NAME } from 'utils/storageUtils'; - -const OnLoadActions: React.FC = () => { - const navigate = useNavigate(); - const location = useLocation(); - const keycloak = useKeycloakWrapper(); - return ( - { - navigate('/mapview?sidebar=true&loadDraft=true'); - }} - handleCancel={() => { - clearStorage(PARCEL_STORAGE_NAME); - }} - /> - ); -}; - -export default OnLoadActions; diff --git a/frontend/src/__mocks__/popper.js.js b/frontend/src/__mocks__/popper.js.js deleted file mode 100644 index 81b984cd33..0000000000 --- a/frontend/src/__mocks__/popper.js.js +++ /dev/null @@ -1,15 +0,0 @@ -// __mocks__/popper.js.js - -import PopperJs from 'popper.js'; - -export default class Popper { - constructor() { - this.placements = PopperJs.placements; - - return { - update: () => {}, - destroy: () => {}, - scheduleUpdate: () => {}, - }; - } -} diff --git a/frontend/src/__mocks__/react-text-mask.tsx b/frontend/src/__mocks__/react-text-mask.tsx deleted file mode 100644 index 56c5a7b75f..0000000000 --- a/frontend/src/__mocks__/react-text-mask.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import React from 'react'; -import { MaskedInputProps } from 'react-text-mask'; - -export default function mock(props: MaskedInputProps) { - const { render, defaultValue, ...otherProps } = props; - - function setRef() {} - - const onChange = () => {}; - - const onBlur = () => {}; - - return render ? ( - render(setRef, { - ...otherProps, - onChange, - onBlur, - defaultValue: defaultValue as string | undefined, - }) - ) : ( - - ); -} diff --git a/frontend/src/__mocks__/svg-mock.tsx b/frontend/src/__mocks__/svg-mock.tsx deleted file mode 100644 index eb82a12875..0000000000 --- a/frontend/src/__mocks__/svg-mock.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; - -const SvgMock = () => ( - -); - -export default SvgMock; diff --git a/frontend/src/_variables.module.scss b/frontend/src/_variables.module.scss deleted file mode 100644 index 525eb92d2e..0000000000 --- a/frontend/src/_variables.module.scss +++ /dev/null @@ -1,32 +0,0 @@ -@import './colors.scss'; -@import './variables'; - -:export { - navbarHeight: $navbar-height; - mapfilterHeight: $mapfilter-height; - footerHeight: $footer-height; - headerHeight: $header-height; - - primaryColor: $primary-color; - primaryTextColor: $primary-text-color; - primaryLightColor: $primary-light-color; - secondaryVariantColor: $secondary-variant-color; - lightVariantColor: $light-variant-color; - darkVariantColor: $dark-variant-color; - textColor: $text-color; - formBorderColor: $form-background-color; - formBackground: $form-background-color; - dropdownBackgroundColor: $dropdown-background-color; - accentColor: $accent-color; - lightAccentColor: $light-accent-color; - tableColor: $table-color; - tableHeaderColor: $table-header-color; - sresIconColor: $sres-icon-color; - dangerColor: $danger-color; - lightDangerColor: $light-danger-color; - iconLightColor: $icon-light-color; - activeColor: $active-color; - completedColor: $completed-color; - filterBackgroundColor: $filter-background-color; - slideOutBlue: $slide-out-blue; -} diff --git a/frontend/src/_variables.scss b/frontend/src/_variables.scss deleted file mode 100644 index b8e2967fd8..0000000000 --- a/frontend/src/_variables.scss +++ /dev/null @@ -1,4 +0,0 @@ -$header-height: 72px; -$navbar-height: 45px; -$mapfilter-height: 76px; -$footer-height: 46px; diff --git a/frontend/src/actions/IAddNewRoleAndAgency.ts b/frontend/src/actions/IAddNewRoleAndAgency.ts deleted file mode 100644 index b9ba8c0cc3..0000000000 --- a/frontend/src/actions/IAddNewRoleAndAgency.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IAgency, IRole } from 'interfaces'; - -export interface IAddNewRoleAndAgency { - agency: IAgency; - role: IRole; -} diff --git a/frontend/src/actions/IFilterData.ts b/frontend/src/actions/IFilterData.ts deleted file mode 100644 index 6dbc0c5599..0000000000 --- a/frontend/src/actions/IFilterData.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface IFilterData { - agency?: string; - role?: string; - searchText?: string; -} diff --git a/frontend/src/actions/ILookupCode.ts b/frontend/src/actions/ILookupCode.ts deleted file mode 100644 index 5156b073ae..0000000000 --- a/frontend/src/actions/ILookupCode.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface ILookupCode { - code: string; - name: string; - id: string; - isDisabled: boolean; - isPublic?: boolean; - isVisible?: boolean; - type: string; - parentId?: number; - sortOrder?: number; -} diff --git a/frontend/src/actions/ISort.ts b/frontend/src/actions/ISort.ts deleted file mode 100644 index 3ca375b683..0000000000 --- a/frontend/src/actions/ISort.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface ISort { - column: string; - direction: string; -} diff --git a/frontend/src/actions/parcelsActions.ts b/frontend/src/actions/parcelsActions.ts deleted file mode 100644 index 69625752a0..0000000000 --- a/frontend/src/actions/parcelsActions.ts +++ /dev/null @@ -1,294 +0,0 @@ -import { PropertyTypes } from 'constants/propertyTypes'; -import { ILeasedLand } from 'features/mapSideBar/SidebarContents/AssociatedLandForm'; - -//Parcel List API action - -export interface IProperty { - id: number | ''; - propertyTypeId?: PropertyTypes; - agencyId: number | ''; - agency: string; - subAgency?: string; - agencyFullName?: string; - subAgencyFullName?: string; - latitude: number | ''; - longitude: number | ''; - name?: string; - description?: string; - projectNumbers?: string[]; - projectStatus?: string; - projectWorkflow?: string; - isSensitive: boolean | ''; - createdOn?: string; - updatedOn?: string; - updatedByEmail?: string; - updatedByName?: string; -} - -//Parcel Detail API action -export interface IAddress { - id?: number | undefined; - line1: string; - line2?: string; - administrativeArea: string; - province?: string; - provinceId: string; - postal: string; -} - -export enum LeasedLandTypes { - owned = 0, - leased = 1, - other = 2, -} - -export interface IBuilding extends IProperty { - parcelId: number | ''; - pid: number | ''; - address: IAddress; - buildingFloorCount?: number | ''; - buildingConstructionType?: string; - buildingConstructionTypeId: number | ''; - buildingPredominateUse?: string; - buildingPredominateUseId: number | ''; - buildingOccupantType?: string; - buildingOccupantTypeId: number | ''; - classificationId: number | ''; - classification: string; - encumbranceReason: string; - leaseExpiry?: string; - occupantName: string; - transferLeaseOnSale: boolean; - buildingTenancy: string; - buildingTenancyUpdatedOn?: string; - rentableArea: number | ''; - totalArea: number | ''; - agencyCode: string; - assessedLand: number | ''; - assessedBuilding: number | ''; - evaluations: IEvaluation[]; - fiscals: IFiscal[]; - parcels: IParcel[]; - leasedLandMetadata?: ILeasedLand[]; - rowVersion?: string; -} - -export interface IFlatBuilding extends IProperty { - parcelId: number; - address: string; - administrativeArea: string; - postal: string; - province: string; - buildingFloorCount?: number | ''; - buildingConstructionType?: string; - buildingConstructionTypeId: number | ''; - buildingPredominateUse?: string; - buildingPredominateUseId: number | ''; - buildingOccupantType?: string; - buildingOccupantTypeId: number | ''; - classificationId: number | ''; - classification: string; - leaseExpiry?: string; - occupantName: string; - transferLeaseOnSale: boolean; - buildingTenancy: string; - rentableArea: number | ''; - agencyCode: string; - assessedLand: number | ''; - assessedBuilding: number | ''; - netBook: number | ''; - leasedLand: { - type: LeasedLandTypes; - }; -} - -export interface IFiscal { - parcelId?: number; - buildingId?: number; - fiscalYear?: number | ''; - key: string; - value: number | ''; - rowVersion?: string; -} - -export interface IEvaluation { - parcelId?: number; - buildingId?: number; - date?: Date | string; - key: string; - firm?: string; - value: number | ''; - rowVersion?: string; -} - -export interface IParcel extends IProperty { - pid?: string; - pin?: number | ''; - classification?: string; - classificationId: number | ''; - encumbranceReason: string; - address?: IAddress; - landArea: number | ''; - landLegalDescription: string; - zoning: string; - zoningPotential: string; - buildings: IBuilding[]; - parcels: Partial; - assessedLand: number | ''; - assessedBuilding: number | ''; - evaluations: IEvaluation[]; - fiscals: IFiscal[]; - rowVersion?: string; -} - -export interface IFlatParcel extends IProperty { - pid?: string; - pin?: number | ''; - classification?: string; - classificationId: number | ''; - address: string; - administrativeArea: string; - postal: string; - landArea: number | ''; - landLegalDescription: string; - zoning: string; - zoningPotential: string; - agencyId: number | ''; - isSensitive: boolean; - buildings: IBuilding[]; - assessedLand: number | ''; - assessedBuilding: number | ''; - netBook: number | ''; -} - -export interface IParcelDetail { - propertyTypeId: PropertyTypes; - parcelDetail: IParcel | null; - position?: [number, number]; // (optional) a way to override the positioning of the map popup -} - -export interface IBuildingDetail { - propertyTypeId: 1; - parcelDetail: IBuilding | null; - position?: [number, number]; // (optional) a way to override the positioning of the map popup -} - -export interface ILTSAOrderModel { - order: { - productType: string; - fileReference: string; - productOrderParameters: { - titleNumber: string; - landTitleDistrictCode: string; - includeCancelledInfo: boolean; - }; - orderId: string; - status: string; - billingInfo: { - billingModel: string; - productName: string; - productCode: string; - feeExempted: boolean; - productFee: number; - serviceCharge: number; - subtotalFee: number; - productFeeTax: number; - serviceChargeTax: number; - totalTax: number; - totalFee: number; - }; - orderedProduct: { - fieldedData: { - titleStatus: string; - titleIdentifier: { - titleNumber: string; - landTitleDistrict: string; - }; - tombstone: { - applicationReceivedDate: string; - enteredDate: string; - titleRemarks: string; - rootOfTitle?: string; - marketValueAmount: number | string; - fromTitles: [ - { - titleNumber: string; - landTitleDistrict: string; - }, - ]; - natureOfTransfers: [{ transferReason: string }]; - }; - ownershipGroups: { - jointTenancyIndication: boolean; - interestFractionNumerator: string; - interestFractionDenominator: string; - ownershipRemarks: string; - titleOwners: [ - { - lastNameOrCorpName1: string; - givenName: string; - incorporationNumber: string; - occupationDescription: string; - address: { - addressLine1: string; - addressLine2: string; - city: string; - province: string; - provinceName: string; - country: string; - postalCode: string; - }; - }, - ]; - }[]; - taxAuthorities: { - authorityName: string; - }[]; - descriptionsOfLand: { - parcelIdentifier: string; - fullLegalDescription: string; - parcelStatus: string; - }[]; - legalNotationsOnTitle: { - legalNotationNumber: string; - status: string; - legalNotation: { - applicationReceivedDate?: string; - originalLegalNotationNumber: string; - legalNotationText: string; - }; - }[]; - chargesOnTitle?: { - chargeNumber: string; - status: string; - enteredDate: string; - interAlia: string; - chargeRemarks: string; - charge: { - chargeNumber: string; - transactionType: string; - applicationReceivedDate: string; - chargeOwnershipGroups: { - jointTenancyIndication: boolean; - interestFractionNumerator: string; - interestFractionDenominator: string; - ownershipRemarks: string; - chargeOwners: { - lastNameOrCorpName1: string; - incorporationNumber: string; - }[]; - }[]; - certificatesOfCharge: []; - correctionsAltos1: []; - corrections: []; - }; - chargeRelease: object; - }[]; - duplicateCertificatesOfTitle: []; - titleTransfersOrDispositions: []; - }; - }; - }; -} - -export type IPropertyDetail = IParcelDetail | IBuildingDetail; diff --git a/frontend/src/assets/images/PIMSlogo/favicon-16x16.ico b/frontend/src/assets/images/PIMSlogo/favicon-16x16.ico deleted file mode 100644 index 59b2102ef3a3dc63555b9a8faeaf1bc8f3b39ac6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 565 zcmV-50?Pe~P)n&E`BV9y0p_F zxY)_Tp;iZri?|eTsV#0U)!m^k7G12L7|rkGKAFq-|0kcp>>G z&-4EN9|_E)M51zkVr$g&1)VsfK_wD(0XS;13H#1ehN@v$lR>}~fK>pFmfmmRY=ZV^ z1HkgJcQDtGM2SRa0VLRMXy_v6X66zA3O{qEG6`oY<1i&rBGEE{^kVksw)^Hf*kfsv zZ9Jbm?GU$plQU!t0+3ng*s*s|C10~XWa#QLHmCk_vFT{?D|ZF|pS2~LMsnW!{r7Iq zS07E+kmPW9xXdo8Q@qb=QLP+DhEYbKDGeaN?WA&bBmmU1z;C`xbW(`#MX~v;!WTkb z#@=HNyAMP;q6@7Ld7c)@u%w~#d}ZBTl|}W~0gt`JDB_jSoey6v$&?P4x|{my*jo}~EHPF-hf=&DZZ zD=$$IMNAv3I&2H!aEKNcjTMq4aZHlLl3@r_fNgQDX#Q?V68{sJhAf1`L_$P*C0W2{ zl-2sNvXaPV)%$$DpzWBc41Wbop_{@rb*B%|Tmb$7=O>V@Y4mo$*Y3`K zJhMLuVS#0y`M;U@@66k0;_-Mq9*@W4@p!QL&c*-e)JC(IoB00C<=dq$A!PNWHq&?D zu&m&mKvNsdG9lz`ZhRtt`OeSuM^v1bgpjR^C{)gYV>oAOqq#)IA%x_)AJfNcgpg0A z_R(X@hiDvUB4}!(`3!^@k{h2O5J5qDgpl=<+DyyVv6{pQfu=T^+k}uM{%0`)F<5=- zm^emTSQTh$qnU@4Ru29yg+PoBMAS$MWlbP31KVNZ5HW!mEfA`Qd7QSfA`o+G0W{@8bL|4f zIkh;D1!7R4mb2vew5B-D3{wQu~O0RUJ8|ShPh@8mAVArU(kM2a8>29iJ9~ z(mJ&`3<<<=)|#UW6zr+VVpt&Jsx?Ow2+Y6>5vLZ11%Vhtp-yTuPS|r4fn=Rp92Ny) zIAP6|T^yK!_sCAIGx+PvEkekBs1G)vj&HlvKKf+S@hL^n)JBsY_#0WL76MH#>mQ#! z+2VgyY9AFLbv{D;TcTL$noA3W;nV`qH@^Jw>62I|RcaqGp=_e0eUyijX=BWijc4|^llLVwc zDwOG>u5AsKN+57*Z;;MV<)}%b)IKUhomwz#D$uQYqCkjFO-t0o0qKvK3X|!t2R*($ z)fb8t2+^r&kD4S(?V|+{%4GUew&sxnA@$UxqUN|#S-3Ga_Tu){EA);1k=t)8pNR}u zQ>__Jf6~@GPN27nXPa=;99Jquh}i1**ckcY>J|1Y`Widb+UEA#C{YOMZvn(ImHvdS zxekGZqvp6$Vb>6xudM_TS~Fk977oq3$r87c_GKs6S+JL=d1iAK#5^zc%@F$95l zP>qF-mJ*ggqES-?VTAKIvOo+}W5KnQl+z!EK&hh!>dXrj+p0+*9yDWt(NR|sD0S3` z)|ogA2*iVCEM(K4tUyE{YL+lp<%R`f^th-}G8UpOB^iOLAD=!+Jfon_tYJ4HEeXW4 z2T`Te2Ta>h7ZxZ9s55K2)&~v<#9+qaB|=m!K>GV%ZAKO7xKeqh`wAO}1mZz47GW(V z6oKd%0Nk1O?ysW)G5TBzlr|Q8NByKWb1UpQsRTN%RLUTXv0<0v0`Z_3i!fpZ0^5vv z6;En1BoGgZvEYdmC~6E~0Cq;U%H!8q3YdlHwRKggC}_qaP9W8ZswgyfrDQNyD+lVAtHc_MONI`*1@*<))(uD_!&KsU zI$VIS&|uLi5W6U%HGObkb#pGHkv+DnJ4@+Mhd{%NAWWn&S-|?X*zP?@hrD3UfGN-( z)R)ZNw~b4O!z7IC&UOANU0BS10MV?}HC^d2x8D})W=9Cr zfoMVLH689Q7D14Q!Bi3=P>_B=Fe|AQD;=r`#2nB%MjAWZUCeW$M4o{u1PY@Ak@k*$ zHyvexbXXO!^D+X_t3Ut5TJ0b1E=Eoh!;lmxNG~9m(J156;cU|T78VEtTI@Mdgo-PY zKw(&mGHCYBhowVf0tJh`?CWS0D2SCPgYL$8{mSjPNFQ`F*!r-Hf8W3xD zzmgV+EB0EpXjm2~NH5?RQT8LHL0F)}-Nhxyqgr>PIVMmT9hMe#Mp-I>z=6%1TuEm@ zpdebJEK(q>VlPVu1qwqs%Hn!)MlZ7(QL6m^aB#ZP4LHWcC^I#%^ZZL0zJ`~v4Nh13 zOt9SDSE0Aybm|khE+A~u8@XM_3*4p$qGY4`09jO&{kui$4qB%Ne=^ zSQ%RaoeRMp|N7hSVpo=)t`tGMJlAR(IT3XWq%1@fFeYH5g3t*sCnDk2BfoHw>H6iu zXaZ>yLWO{cp<{%>=?Wi#&WR{0kds2F0PPnhUgRujaJs_8W9jo|NQy-#P9WBj=z$O; z{eiMcaDzM%5hp^TQwS$N4S$pwoUW7u>2oMz?(VDm7yWzVA z`Q~Px%hTn!Tzz)-nLT8kU&cG`aTk71=@kl-BlB_5S_FE&xf#r}H@U~MQIQXb7g=;i zNmMC;o^Nile@<}S;Mxj4^P)xy1R_*1tYXG+O4PUrDq`IC?Sh~xYQIpJd=U2h$ZzNq!62Sy;VU891sKo_(X#M(95vj@uV1{h5^djmg2`ZDbr6)?A- zjCwulf=e@MjL-yvR?w(g?=6*fjS8q6xJIxZ4f~IDZDT5>1wr3oH$tNc)~>PoUUY4N z%=)N&9kX4df);@?T#x!`N71Ixwuv}{qX}*88Wpte^3Kp`VpV6mMgFA|fs3ZP_m;M(Y++A3 zOaiLwKf~~tdgnkE zuy(&V7)@Zef`oPsWC5!;^g|v^7#&5M!i767s*Wb4cMfC$>jEjZf|Pa+WC17cSt>Cq z&s4ic1!rz53-u^XaYx%ZkOf@3sVq%(pJG};nQYgn;M8rIW9pHXoda3Gx%*~^jLMxH zMPGPc@4kM2cJ_HBx&a=K$K&yMJRXn79S9-+0PnCpg9pTKfB*mh07*qoM6N<$f_`-7 A@c;k- diff --git a/frontend/src/assets/images/PIMSlogo/logo_with_text.png b/frontend/src/assets/images/PIMSlogo/logo_with_text.png deleted file mode 100644 index 13af663dc97622b950d75425c6c641880e1dd220..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5163 zcmZu#cQhQ#*G87;5@n-CiRfiF>LPmYokfxry>}ukAzJjBtllDe?}F7rl;|~t=w-3k z2sX;MzxVI&oVhb|&fIfn?%ZeYo%4Lq*Hxn+WhBMJ!=unpS2o1M!xzBKVZ=nZzBE~H z9ygG9szZJ7@W`nDC-~F9Lay=fXntuZD;U4YIm$(PSgKJENoWemSJ*J-3j)ONNd)i- z`I6G{a*}?hGqxdB4~X0!tR4^rPRF>Cw}bb^6ZSY>;DLL3UCEREQxqeIMZM`_+#{42 zF}L^!ClL&rsNv&(-!AeV4`1O$2%g<6wt58k+xz>^^TZbYzilfmsX=J&NKKD4f2FPc z;`BT_cV+}@z8qP^V?AsP`xWx%vu!-&c5Cp*#?XR?Zai2o0epnhP+mh6@hDW;nkcoh zKIdh!!44ug;3l9!W_p|P`M2B@aHH5FK+1THj%zB+fg zw}wx5JB-XTFA3tDoOvRO1h_wt2ta7|hT;iEm2BE*?MO5@DN%omxz(&AO%y%J7d)#2 z&bUjvi+JLOwHbksh35(;3EnRW7(WhRT;}xnQNK8aD|j@!W2&utwPBpr+nHX22;r_w zIciaj-zpQVwdcB6m#(yi7O)Cb`?Zs~wLO8L6;Z_PZT|)9fJw@`r3CiN>q&iL6{tK1 zSyi1#7=d1;^Z!6!9<6((2p^U}P@EzKxWnS`(? zMV=9Y2Ntj?ZCE-(yL>et@v}#0mCjl+ib(x*2)91$8-j#BSlT;0uw8TES+56vlJ14-Z4nx4P4>7PL))`Vi6 zPO+t-r+{UViHWAO&PP9ol)cRI=EYF1FyOu`7JvJ2(sjSch@ke zo^^5;DbL*H)GeX@HziSX!C+vGbG z;4>|+LRq>@hi;VkRdb20lDUs{vg`7)fbPO(+cGS4C4pl}BxWf~+k(9gR}(-3qg%#xLT!s1lAO|9QM3HSo3f^6Q)c?K8S3)p$r?b3tE zg&a>zJlgI0v%YFYrG&j8*A}8_WHym{T%wiAzvOK%^s(-&lflV6{ zeh}A7$K{sgTK2w0)b~$UDzVn<>bQI@(h?5D7d;)y7{0n3i;UgUw_WvKhxB&#+YMpb zt^5u%N18UcFpJ%E%1_}E4xHNR958qHS>A2jRNOUQ$1zy)NsH1%K(s8)WUOm?xsYs; zUTz|9jKQkDgMhx$ZK~7&3!lsIx`e<~v@|H2)zVW~Nq0+7${mnzBNsNu4-*hX#$AiRPEX|rTt zzRQ8}pbfK|tB{eKLnTm%8%&FrFB+gpYHoeMZlFB5ed={~Hpb(hoLBwn?NrQI6W5Z& zw_Ywl)`OeBHO3dDXd#Ja3NZ-r>labF`h*ngPaXB1PMS-w_|+4#NLC4-Fr#4cOcA=}~mgI+lj+L;DM691?79fy^y_rd7s%YaG;IvESu58(Xor59iL!}g4)>ThfCH5?}ptD z7bhIasA9rj!JF4_nESsb^X6|5X9*FzURAZT>B9^V1Vcto*D>qcJV)`W`o6QQ_aO&9 zx-5*e(TPpUj(zZG(pT>;^Scq)L1_60&)@kUe8vqCgyKc-6KXvnq*;YEOZ6;osMH>m zo(qL}=CN`8?i5a)?06>*DinWE>M^X5Xch5{%{u3J8*u0`o<4bnovWnc6nB!f%Yu4A z$kO`0hKN-a%SN9x1;ibYN1`R!JU==BE(RceajJt~473I|=%vIHLF?Y_s;;yR22K16 z|1d$dA;<)cH||*9#fOnknPYCj1s~#DB*k?h*9R`jjo-zr4;rb=@-PB@)U3V-yW=|4 zd&FEuAk8KzZ)n&njs*C9J7vaNr}QX85WN*KhX2M#)8ckmrpVEDk%i{`V=3t3iuqMc0{P+ppqWxKg~ zV`mCXg5_o!u$1h?aSLflht$86EMf zmCM63niS3IQv>HgJt0A%wc|Ps*%0!&pVXfT84spBq=tYx6ZWyC~kf=lvJN{ zYb*P90?giMXpqiKtp&Tm&ICMtV3-0|A|VwZ5iYq*03gOCc}EByTEMO(C!VAg^)!HC zBHlnjZG-em-2WqG_><#tWjx_WM@~q+zK*Y<_Y+ zyC(N$0JFH*m=(_fS!&ZqoJzPn%7GLkl|Iudap!aXxa$?YmG6I$ud;XeO0OcD_SC z02gsnA|xV^)>(`mk^=f^g75FkE5Ff8S@y@zQQb8welIU*i<|e-mQgGj#Udf{hLk}) z;oIyI4Q~_o@6h#zVTOHbTU|TX?Y>~wd?QVmOsURp`oR3ZoCBzTRNaM&kyG65DjfqP zprG50snJR@@7Lh-xChE%qtY@<-X_-2!1t!vWEwBX7lw6Y)RCif_D? z_SM$N=|56Ee%#G3{?U)x1ojQ6-6&sg)TR-hfxEdC*c;IfyQ$ThaQyUgu4{m#%aWJt zSy(0;!z#NYjZ~}~S)k2QLbgws)}8v&bj;GHX)njHAhz#s{_N_2U8T?I9ajhug*W^! zP>T*TmO#_CP>ul2n%0N2ep*}pu|aG1CS|xl>W|Y-Kx}QACy&FMK*xG3L>0bwub7=G zsR}3x|N2qY3{6a&Pk%rPNCmf;aQ%Q3$IF#_gaWTo5eDeEh2&h4&@_89<1o8D7768{mggd?pVq{vBq}N`SYnsNR5$h@@oLu$tuqfU zD`%CYH8ZOfoF*RzXm`Ib+@CsK^g~o%=DO{sDaeoC)PGZOUiN1}+f-hB0=f}QwB};w z&sg#{vs^vf8Mb`tAawpB32hfQKXyAb4$nmK*P*oRLib^hi-udZLVa3HSDa!3^rZ-B z8dSqKLn3Sw_tMh0w=di(gP=)wm@7f*dcyh5ex>Xu!A955X?Ax*fA348HmSYS=H^@i z6OBC-K~5BmmWwhwUWy7E2#nXUQH)pKsKZu~q|5vK^=@dd#-pWH&inPHoG}#~ASgCe ziqqKn_pU8Q*42Cpa1A#QC(@|yCiriY#|gKjS<@zxbxOaCh#}19YHa&n_RqA~hrGn> zKK@x8I<6{?QTLw~ zV_>iY&6W*#St8@F*vic0keu}a6jp3A4fwkQGJDG)D{~$q-?wq&K8W+r zDkuN$^!WNZN#J#%ZTOvTkJiv{g=K$?287>BT<7@gh0kSk$LnSP{jz{L?tn?g!;J67 zM!r4vUTbws9~tS}5+iF#QOjKBOV|7{$kXfY?*`oclJv;lEV0m4u}&`R3~0rMORb>i zZ5vYVWjK68Cd`xjN&b?&C<3&@=E35z>@Hhgmr6oxv{IDUIuIb{>dr*yDTyo|Jd(P< z`HgZwV96`?{f5aeiI@sRpbWuLi95vXSU_-DFq)dVU!>*tN}U^#PHz$YUahUEa5@!g z{Wj#{blrOSVT?Fh6bB@`u8;~1VI)(-=?U;$ZIYhCiQI2g0BY6tq%O*YNI~3lY>OPW z?9bqOF#VnTk4zAUidcZ`tm2UD&Zzoz+(N6{`Qz>G8W+F~&<>)Lec)_1OZRc;3%uCg zk?DldS5|g2LKK`mI5^?P-})!=RHU1Bf$^W!P_67`j=rL(;o#IzbaX$bDmz%~jfs_W zqK_oaaL7PG33ns4LuNvRPA-W`IsfoGX;ER5F4f$pEA;^4@h2~+O)+hF(v>9Pb>XpU zK7qj|j#iq_XkU*B36rNZh$YL7+8a&KoZ}EF?Za1f_WjF=pO|{%2G841tg0XGOHKPA zPo1WNna|$}zwD&HK`nd4H6o%GYS%!aUqhaZ?uvfSG&VJ>-FM6v@aSFphI(|T8*tK8 z6ARu!#+}tce$xX#3BRyRWRkRqrcVtlP|C`1HW_}u!={^CdSqj1+HJKHozx}FF8K8W zU35y}3|ukXdEeMU1*-hoffZ^QYKQG-AWy&ZtZ_|TnSa*!A4-OYr&%UW|80ktd^VsZRJUEoiT?M` z8>%$_X4Iv{7pQLl%pPdD!r^HR;l-fFJh)}P@cbG_uc*I$)t5_ddnNGU{8oWBA8o$Ai}@2EoJ1Forv0(auh; z>P0~n17O4$0LX4M5GUi1HQX*{tT*6~+z!;PRg_aCCu QIQ9=uLq%7)MiCbNe^B84a{vGU diff --git a/frontend/src/assets/images/SPP.svg b/frontend/src/assets/images/SPP.svg deleted file mode 100644 index 4e19e9850e..0000000000 --- a/frontend/src/assets/images/SPP.svg +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/frontend/src/assets/images/SeasideBlue.png b/frontend/src/assets/images/SeasideBlue.png deleted file mode 100644 index d060973ec9490b13911aa0471fbdf34fbd37b7ab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 777276 zcmV(&K;gfMP)yjJt;w3BR^#VT&@!@OB^;(Hg2vtPh==)uY8oM6)!(#ewIUQ zoJU@EHDsJkcBU;!Zx~~*Q)zu*b%+K}nI1VpJ5+EcJx^3_j45867g(NgiJ@0?nMYY> zTY#-7MM5x2O?Zl!I7(SJRYg8oQgDEbOJ_|KLxVF~idki8VG4{g001BWNklB0Gg@^da#R{mv-5U++%DW8*IXwSNz6(Eni= zQbLtSA({UYz&zF#!8F0#;7<8A%kZ_Ii_!)D$JH;BZg!8z0J`9k$lO5DgLCfM34bqm z%*BcE0rDYt&VBaTuZ{kez#p;yf`R<(3BPH-*S`Z`$I}5ui@~UJH3;Q?PV5m~(Z>qT zVZJK*1mQmo?DiM98|%M@P)A7uC#$dejwgl2b(B>s0a{O0?|5G-RPKqx@ymE-Lr#th z;!olX;(j_1c!{X-!L^_b4+_1SSzO$CLcMr-23sZ_q@aCuQobBPSTT{)i>_Y7mDcv3 zEz9|}546`_pQnHmwHk*-6WBDG)j`o(ZmXxbW>R{_Yj(mopwZ=In_`RR^)WDGF#0?`vQIJ z)bn=)uu~F!*(rcQ zQQ0FnT@$3XP9?CDvs!>v*L3w?SINGjDnY?%jpXFFrWYrL3g45g_9drP^Ys*N?j<+@ z6%UQ!8BLKgP2za2oKbZ+6WJ2y601{Bx^QQ~%?gjWu$U{Z7Byjb8%lQqK;#t#9AxQ* zO7+a2fp(3s8^U{iG=LA9i6!bOQyWrsC||X5v_F?FfW=TnlLCbCmrqo;K+iwu+uZ)BWD?%gOClM2Fc|) zgqd=vjCY)DuTQA~i~1U{@*#g4p|b*3BYo2&Ts*dRbX3U71zL4pPloYrtYj4)*H7at z6p(k!=ZRV-EHP6>me8vSK;3*|XGn(^0RMVYlcq>$%tmIQfHO_M={(mkp9tO=j;j!J zozsHJ=bC+#$eLW`tbjQ>!<=L>Lx@FMaViaiO7VEhO8e$pFIdn#)y!Ka@AX0JVIO?i zQf@b#PYK(FvBV=z0CPw>gL1H@VsF6lgtmOCXa9hotUpg&LM}2Ey;LKX7W#W8IH#z& zGaHlhoD67)O8d&3r!vqaAcKE5y!%cqvdh+^bk2Vm? z;Y+J^lHbBtve-rCTTLZg1z^<}bWZ0(lak&+to~KSU%ILQlNZienodfsPP#g^ipt6% zjupv`1h9iIC>19JgHIT(W`6yj*#(?~>z%8-lML4#D1W21x0bu5F`c~L4AWr8dNw-O zmP^J?n}t1ZV?PjENozSylqEAjBO`-&ULj7VGcV?|Hc9vTSP}fH0l$d)3$f1=KyoIa z4+xJS*6XR9;pnD_U+8^PS!15dI@Ri2X9X@aXFa@RA}cEFR%HM12s2%ssE;7?n(72q z0eAxK!4AsgHM=*KgD)Iw#M5XqZqda)bQ0&2Zv{0WP`^DygVG1gS0#jk6xZw=Y|=$S zn4rFnp8y4=o%2nE?+}5@8NP%fTbyTlV16<%pf4tY@P%E?H;To3?e*tDn~yw94Y;XY zwWf1Zx=jH;4T68I=lO_-I+nT`>r1*~DeH^FnhL|ZWKG}h^8G*+OtmeIeP=4`yxD_J z31zBoL|LOo_EJDFzOB={fy^O7m1@!yu^V_?m1wVY?6ubYjfqxQBPf9GEtM~Hq?4je zhA_-qp#xq&ddjgEvfwZSq&Z7F^$l}&pDD@cWE=B;LCKBTy*|f+RzBd$1F3^}a)9`R zp&VxO=n)nR%*OGfD9ombc-&KzK`goqOidekH5k&rk+9N_k-n>4MqE-ihLHo;>B7|} zK=A}sZ$cNnKgku2eMVf=f%En83&gC;u~t?0(F(n3BAy3KXR^17O>vo7o)?76;gd`> zo1X9&byQ4^k4o0N_^In3SCSRht3gK~|y3ch`e?@ViHX3CVLnxV8vZVG;L zZtHRNSI$-6>`ljhC*oYuoi!fi(aqD*Q&r*_MzKm%UvU_ZjAURP^Q18t;}@#vNbMwi zac@x+tO&deCAGaVgJ-GW%OM+GY1ycwIYq209A6%#OnfdJ>Am*)X&3ro-Dht?f3;HY zp-vCbJq>o>qPEN4MlkXA^Xt`5Zt<-qk)=cYc=_v};#tmmOMW?VjfLWTU zTr6KHH3s|OQj9iN9l(?!Pl(i@J{uHpF--#$j!`i;w@g)hTv4zqtwrD1G~r?%^3|=P zM1Jdg!qct_GrB6|ay4Nihnd+6+T}-&vFB8(d46Ny77BdPrf#K1alX#DXvU7;h zE0_4no4tE|B%U9x2Hfhk&rzb4^Iwy`2ab>Sq?epM`1~fbj92&Qv1l zTyHiWEpHn*+a!>$w~}AaF%kt?I0S&5nkr8i-&12AT&odrW!5hKO+{oc{#F@ zH&6Had5wE@(D1f8|HU%U+Z^Z9J?>4uN0X7XE85ga?Nru7<(>uLmd#QgFISe7n?j94 z45m+Ne%W`LmCDW~{W11Z-4H~V^D}6%i7D1@Cjn-pSBW#CLpN^#Y`yIgx-r_~D2?h0 z*VS>Wn!^THTb#BQNd zt)m@z&-XA}*wqWctiAU7zmWNHdDY{zphdglJ@hThn8P8>LKZd(SehPwaxV}cu5=g7 zjkPVr#d12<9m9%j;)__cF3VkAo4WCB#oWDlGkD}r^!XwL0-G4&G|FN${h2DJ#~~PH z*eXux02?UfAa)qvoEwd3ZZ@NB6V4$V>$5a?d7SgYeCJ8$(XA448tq)|;fse_`K%S* zP%v+21cz)eL2sF}0;Vj-(-;o0nPEN7s%-D&r5Y}8;_mhLrLmj^-MVt68Omp*Sz0u! zaroT{tb9Ig)!*huH$5zF630-+rdz4lkb%R{%0*V{1v&N4+0jxy0awZdvQ+gB(KH2p z5zqoC#4jWE@Qa2tmy@fo0;XB$3TK<6Azo}*SZz{N?f!dz;N%i@*YS$C`U7=eAcoIF zu;UlB0E1qoI3nYsdc>Q`d;PpW{g^n` zuXA5L?96?@MjLh2IeX~VBNlxO$qs|lC{*4Hcxpp059hd5`{lgX5Hy%mimKQo7mv{jF)H>kt86a20UD?iDGzVv z=pBcSVUK69V_~+JV+p%(y0P)h8>oAIcBEhb3ux_Tatv-HyM3$f3` zNPhOXm5dzpaiwRlo)N4A;eMxJ<4Yeg>NBaOY&I3n$n(~oYr28!srqS_v#L`%Lq$rm(kz!+6>V zu%79hkD<#2_7TH)74G?&>yw_g;If$p}s|UQ~(J1`Y&Ej_$`jEek zsL$3t^rGx>sN2o9z1J3mb@UCNHYejh*Gs+#9~ zzUT1?iV`j?8w>D+1&Zc!pQ3zF#%;#E<;rUw-(|;2NBdz#*_5>f*--c=F39okkEH(F`9Ck*f#yt%U(E4r#_Q}H zGOuN9CE*{)0GTQ1N)N6@{VNdWl+TuOw3uxbFZNmG1HU5K&VGM(vCom6O*t_wL&H;7 z(gZf><rQzdfN8gX9MUd zg-5;DC|Mr0ViT3_J28m4Ul+c58pmq8hI>W09e<9kl@y1yG+MxxuFu7=m4xwJVoc~k zWG8S|#HsfQ<@8+`C9F0soJ^D@%?W*@6146EFfl&I^$DKi+e9VM(A+YsZxe~eZLIkpjx>_p^n_cBdDB<2f!M~fT{v!w#7&-gtcRtez=Z(ISes}p zB}IkumL+9ZytKml(gkEESw8~uv;F^oE6K{o))_wT4!)0mP5S%Rir-*6neb%3m$krp zBd?bBUdDNy_BsQ0GHGmjvR=jPK=iJ#XCfy!N(E{reJ*7{lZ*ETFz!ltAtgKYMz1U1 z0~R0?J_w;I=ORY4@C;U#0nnG)E{By30T))m)NcJR9&qR_$juSKoCIpX)(p6%a( z+~YP_b(9=dzTk*`&VlFGm(4u7yl0j5+PEC#90^}AYBL+o1PVBdD(tRj(}w_1u*#&`gv$sfxQSqqtUV&_ z)X2@wEm4w6M4drCFnZipHVQv~I5kG9S1PSD20*Iu`Z;2_5HR8)2LfE-pDPfttD%T| zQ)z_!8!wc$V(!vBGLHLFA9BwN3znruwk5fn$n$>KQL8X7)jQHT#nqu*`(+eAcO3{Q ztv%dKU>FN`mDa{>J6LYYaDPoLzU!#-5f) zk#okxY1?7muKB-)Dp$-vGHgD5MDVFLaz&+CXv_|-S!iBlI# z*DYmNq`he-hp9l$8e4qDFvzz5 zjfBvVPpX%%rB)Xu7_I{Wmm9WY7G!Je%050-7n1MK z29%A6{j1x9#LxB{F}Oso+WkjIp`Az{yz9&J$_ll{esS3!Z4;X#c?CUXiq}ZE9XfA} z1lB+HCspTo`wpd~m$}0yya^XG+bbuuNXEXJ@}G0{X2tt*5s9BxF9nVQAEQt?aG35< z;CP|K$fZc5lqYq?Mirnz(dgJC*^f1NGxa&+Z+t$WgTn-KhcZ*LLB{Sp2LPNm!}Vl^ z)xo#L6D1^CZTU7814+eu5bw&eX@#n0EDt2>zPbqTd$|aNbxKXKQ6xUrpLxc zx?U=B8%n$BpHV#DPqTkF69p?7UF(WQZJ*Jkn`G&dHR|Mswb4eSD}QP}+4al(7GyrK z`fPs(ZI1i;uwkJ-lO3r)#b` zVy?Sd!8uG#iZW7>QAOYMnIMF0W4m1J3+la59>#GO`kn4W&!SjL%exA#uBsZm4)=3e z^M9xJs!#eRx@yqEwQFQbZmS{_VTMJ0;ZLy$(S+BtcIy4JC9?#-_Gn|tais`!!+P89 zk*(T1I$^ry&rJ{LwW270FCCzlY?Z7%HbzmbZ)XR}u7+ua-J5EE0~W=l++$&5L;F@4HQzF_6)*qY$8)IMVeDw4OU9uW8*vNDcKC} ztrfg|iP63l^tL-?7p*FAD?7V)j9m%u*o|AbX<#|pejR(j{4Rt(Q2T7Z7h{j|`dHlD zZ!T3YJ~9{|2EKNuuPG~=r0mgV8!D)1t2lKD4NY>b*uz*q;SJ#%2fBGw`ZUBjCpY$* zCOfG3bD3Oh)EHp_qc()xhMw&gv3#|b#3m@Sr!Zli5jJ2l_AWI^3|@lnU53Ww)*|`K zacd*5i_Be(XjO?_6t0{+JwRN+h&=7*sT{*CUPV&^=Jyj#fEK;&uvE20o%Ep7UvNy? zP9?{9B6a|8#$m%}k6FuzB|t&ziTaN0IfsQC4As*zUtA9N04bZs%5poTci)O~w7j+t zQ_0F^*8o=61fwd=vKNfI4D{HCO9o)o7#G?_Syaf)*c@sRlh7(A1ewU9J?y* zunzA9eOY&Bul4<5-mX>mlDqq&z$d`N2mw8t;#F7bEe$X2^}3>nHN%3_NFn8@YZ3{M zI+!dq*$OZCL;>W)REc{-GF17Glk!ycoEBe~4+D!9y-3tn1%yV)j!z1_kj1LOfS(rj zWkIyLkYd4#&94PVT29Se`)xFk?2I}u6o4KbJBG)jBhegbEoe~_Y~NIl35nHK9w~=~ z+m0H-Og7x!WG?raE;OT<@;~@cxKxDcE{?T!pv3?q`sgN zQUq!`W?RU47=mLamxsUb*YM=in7;3@@?*GkJOOepF!6ETWPw|0*}ATT@s|N~>xARJvO=lLQm= z%4Qg0(*|-EuUaEjjn^w5xN;%K|D;;?f!SyK^SHaC#G7s#Ykg4`pTqH0!TC52ZUk*8 z`~~W(p{}e3oK2IJV89teJfn4T*Q`sxp0Oe6<rb2 zB9;iVhLtXtpH9^;4kRNPza~Lf$nD4?O2mm!mh|0h5?3KQYrur0or~!dFpnH=F zovdPb&I{`W>>w{rvTMj^E*Uh0r;Dul7gB6mHj))vk6TCAnTEd`d*n8Ra7lQ$$(3YM>d z=Q0&=8M+|Ln8C4~k1%d~S;?Jpy_?(gY|r+uA@1=hRrL*l`3{DU{PWki zU;0JRaPQMG^4b1c*6R4|_ih_Z9`{RE7>=mbaU4|j zdqmOiapZ*78<@Y&)Qtk_?7|yvobtoMRxU)pedEhm@g&2+P*0+^fpJ=3JiTQJLzjrB zb?R8#V~ChC9zD1u{9u8%wsg>4iiaj0EFq`r(_Vd6sqB+dt|SYvrhVzFA-|>2XrzbA z3UmjnnLT5qQzMHtq+V*|R)WO(s)HH(ut+u~ph4BN-l0R=Oc@DQbW|Q1SnYEloEMi8 zBW-eJBs)B7FD8OB*vWZatoEDd)pB7H3e7G+{T7Nr=WcpqEsC?OgAB$xpJDNF<0c*a zCLCVyESCn!U2-M6ImSwOFMJRE#HEOBo=uDBTOKb;DBCG-<{eEouL{M|a1cZW0P>IKu z%d@gvL(2t2SM+5~I;~bXup{cA>oFEbny&H38Q^u|{qUbkUWY}zgike+?D4JvFE#Q5 zGjIiyinR*ZgzlKOAlbHE`dEpqnPpYHv*+tYQ-t|$CNHEJ1izb62}|V40KD3&n_^;T zz{-L<>o)tQrIHDR-lG}&P|&k&VYPJV_!N(l??diKLs!1(B0sqOY+L$DVdP)Xrf&`7 z&5{{YkAv_xaMv?dapZ94cZ37{V!-d5^V`*ZbKQwmKJ17&=V{)r9-LfR%YMyR^-P!3 z)zGae+AitD7d6c&4a=}h)5_$YJI`N_Z^lxblsOIllja%YW1ygG)tH66dbr^PG!G8k&3aRG!4#MOS@ELJu3s5JRR)8OfwH1m* zUn&Qd|FL&=Nsin&5S~|_fDw2hE>OJx@wP?cCjpYB(%9>@*V5S2tx~BZIb!!yCK7-> zpg)Vxz+$h-8Z8-2aHtf=fg0?RH{fLfrrX;i? z2WiUXFtbtK0p$@^rIg~MLpD~hqZ`U`ZQy*rn7*(q2%j^G7g}Os@Z2?0i9oMNR9~`H!1bmA%kb;Y7*_GM!V8w!n7MZ zOw}sDk-Zl%Sfnp`G1#lk-S-e#HrSF_SpJpfq>Ft-2u6x8-kQT~E;PgYCgchXptKQK z#=mP}>FYsln|}Qkg2kDokfPFNZ_Lt7vN!>3l7AQOsV~CDg(C^XH8bopGi{sg86$pYTg}G*Szy%QGBPA>%n@iYYP(2ngk!Zs_GS1 zPY(Z@oNY7ie9eG!XK|#}tQFSE!J&iOWpGuCxvT6W(~C1SJ==_3@G9tW?y}#x)HJ@p z21W&}hH~0oVCpjll;T*6K0BH{*9`*w(l<`LSi`g)Tp~>C6pY|J$2Y}+qRB+gr{|NI z)7OTmdDmNkp!4>0a*h^j$~8S4t!FK?7AgSh5>K{jta;3EH7Pgi1xVL5=ryc%Oxl4w zPbj+a!514%0D4!ly|%wUx0(xM=t^X63P|JQ=h@95YZ<3$=^@rOWb=nnipMjvY-Uuz z@?nn(cvGKEL!N27mVtJXmA2Qt*`Dxemic)J_zT^CEn44N#Lv&F52zZA<@m6h$k5fB z3caQPJ6idXh@(W@)(;S{)iK`Q`*=%Pf zyeCaVGTg&fC22i*Nhj-b%&3NLqHIjBjx@UrMi5%!D`{CSOAl_GD#ba7ETc$30JCMP ztpS(|;1wCD5BT>4d1A>nHV1Xj>OXI`{HF5pxe18MeiF!CqU#+iAFMk1GWN^b8?!jb z*`tYkI96|K#TmJ2jN~Q*ZSFF(^m>K2!my3_M>EmTiv)mvDd3@be^@)wDI=}g5V*2Y zmwgXmyUbCxDlyG9N{t}fBq-^U#nN;Z4ziHEu^QUeIE>2^_O#Ol5bFG1!6+6M+xr*1 z+TU~H^*|;&d#}Y{zSObyzG0Bp^8<61z*s5netv{*RId@2p?@jUmr~+u1Kw2@pYFNW zn~J;85L|NQ`1V#bQDqg~h3G|{NIf!377(}rNX6Q7A$H^+YTscmuE?z}mkeN3j9ZIrv?;%s! zWuI3@AEsi__QV@?{h1{G-u^F``)ClxyQ_RMK(gMGzwY{fvzHCK1nZi`0;QYix+vgq zvM69tdai&)(!L<}^M^)+k?7IhBk zY3SDFn7?N2a0)cKAUUSD4wNPR+Ms7#Fh~UOd9i-X&8UmW)GK<(NY0CQesWO28Lm6O zd2>sOcqfA2-OqA1o`l3L3t|^%n-{K^!{f2jxI+&Q<^rZf^RjIW?(_FKUAbSz;VFjY5!RMr)`?ndHnMME zxQuJT#J%7jiulE%sqA}@mkd#&j*Z9iSty8M!+DQNnT*?W5H|bNFIYa|@B0Gj%c!e2 z#a&*hyQ3tX!TS`g+Y1x=$7Op3E87C(v9*X8lF_V#s<<4{Uc+6RW<@Yvx>y$4wXTMlAVBRA)6CIdE-r|T z+mPN`0@cTr3C`&fjO;B%58iR!MEtIlOK@( z;fg$tOO-HP1uC}$=epFOl8dCEUm~~7Ebq_n0?-l18V$iy4R)2L-IfJ=&2<{rvt-Pp zWUN!6wd&hc-F6eNQ(O3vF7^p}^M&CYu@@;8YGe5rUd;?_wrQ8%^rWv= zIr_`VY$n7pTi1{}_Hfkko!o3YhgX}I*X0e%%w{^la+i^&ql^5sko$$~KN*$vzlhoT z^l9%0Sk+J7Ks}MZhJK>>pP`1`MNs=iimxrc)eqH}$U5A9P4Y?2w@LN1j|%6jGkB6! zSSnTCCQlf)ahr8x?iPDyxofK#w53TI=My~$qtk81ywHrkvQiaQ%FWuBdo!ysC4C+`fk-mHGu?JYc1wbmh#r7TfIgYxBUO0R%;{K5vy%EMG_7Uwb z5tZ#iQhHPfri@Vbd@{J$+T;tw3}I*|p<2p>sjd=_0ET^(X6pNewxvz*8I9yv7#5p1 zpS%6TFjK?yD{r0~sEob742dlFnO(}RnP@t2kTz9V+O9f!0?j<0YvWiyT9ov?{Tmc- zeFFLVDT?2oSU0ax&&A(Tf~rlrIj&BCAawGnEz@PZEfu6NHUO6j9Z1zu&`smXQ#;Cn zU^%MfvcrOWrX&>qk7d0n{$`^{6CYtVH~I2^z4R;k#Tv^x zPN-s0-X^ml6n!at%{w=%+f3=u45azyhE_7M=D_9Fq%Is3F_~2zr6aJOhN`jcN zI7`bwtO6Psjq3?bW+bLxa(se%=5GLbNus>O*Kq%tqS&PqkpA={QDC7gNCDLD~#%?M!ed`rwVa}05ifE`+;!_VOV+;XL6{1 z&YD;UaZJTGnaDN^t4qmOhFr-(2|Q12>*3+4ghg2P=>gjl%#pR}&_g``TvU?EHnMVx z+QDwpW~B=!d6?XtO-J+pyXQ-5xVbyvUWXgYR|@S8+}IWM-~Lt}9N8T$TSk|Zz+wnoc_R@A=h@akI7wk(v_Te;<_nKFXy=sC z(g^leBu7?;MxTd&pa87M=8%xCv9`-7cwHI0JjSscICm03$DWPO?(({ta4&)b59tjg z=~=mVQ!%Cw1o!v$&X=u^d3EdIemt&X*V1!7@_7Zg<}1~sCtXj)+T%OI&{R%W;ay8C zD`RWQS%o^TGCLT~iNonpA4NGaG>|zo?%=29iC^SuJY&$JcSl9{(u%P}o@dheYLcQB zS6dJ@x|`-$>8=ls3(c^x7MI1~)w=MMjLNYlR}^6_1e}wq<*MV7ja)X5`mA<4Q8ST? zvE?S9#mcS8?-17-KRP^!Md8$IWYuXux##D!Kc;B^E2O1o7_O%bbb3-fzMhYZ3|@7C z2_K%OE@1&8jMm@)+!#+zMPCCldk!iRmV6jin8<-@djIdJd(EiWG=ev=|kJwp%kJ|S*K18nSGsRmsS6O}U zxD8rnEoNjqbqx0W>p9ivt-U!yD}4hiUrUi7ay8cO&o3V5pFK7lqTK$~kkpehyP zYt~@R*i}<{aJ;izmPML+KpNzzJ`7@XycO0Vm^!FhuRL-TF;682YgWEh>6-*_fmOlLzqTRJ+MHxCM&V1aWU1J!=M9pnY|w}!pHt0uF^Ut^ zjF4RV<0uesZjvCQ;rQx#mmEc!j!Q}+*& zmj3a`to3hB@cKJwfApmK8Icc2fAt0R_e}z;ND6ui+nKlGCKIh>u0|VqEFE9fAiCV90-n;DRjW>EJ3Zw_W-(8XduUb( zWWBD^NR?|BhxX!764nWqQ@4%__9>*tR4(lmdOhC!DqWoF*l61&>D<(WcHIr)6>!_& z0^?~OdG3U!a%cPaO9437g1ZQNv!&nCR(`>M|0;1@O~%#-BHGTb+pgir?4W5O4-NOq z;$r&-rJ$K{rvk^epx_P56iZIZcfqV*w(@dpOZMXfNeq`YBpu<)CD6Gbfho+)LQ3+w z!eLkFT?c6JhJpOvn7&8mSNA>z;w^sXG5U751sru<>sv8{FcZ9BY68ntknv+v^ zu6SLZk!!>O(gD3SCa`?mWHz9E64sWmB_BvBXloSGqUcn+S65zGJjztCsO75-AWweJ z__LINMVJm!He0sv(zv34n<`*geI%P0y4PoE7I9@7CJ9_;`IxoJJg&%%wB*d8Dk}&7 zL*BJ4xsAiXz49{GuF?hg0rUSqZ(|Vv0T7hrsj1pzlSw?bEKByJYFhn3Q>5!%d(ozeUGrv2Rx8WLo$7)D(zV~FP zX5)^ksxd=E)BI)qE@tZhZ<-4?&>RsKvaE$#r=EN07%=Op6kc@>dAy6RKBop!Aj_Z(Rvc#SE8ZeX|9;ir-#$9#GsklU=`Dq353k8*ZzP>=-Y% zRCTGD>VeXZLP{RJ9tf;I8$Jo zeBugtH^_T@2W$Txj*K6G-zRhx--I_jNlxLLBKAUpVJjG{7ZJF~Q?1Jawq=ZHX^w0K ze5Q}$wP&=@6d7gc=<;F>H5b6!uEl5N(Eq$?p0rB#ff+|vCzzECi@iCWSb2pqPm&R) z0bdemCiQ@4jTPyX@k_kkK^PAkDwcmQo6Xf}-WNHKwOhV=EMn}%WSjOql-AlD@W@0f z{E{WP*)v@_Jfd}=l{1JEZsU`v6jDPi(_+=m*&?p6!g~c6@Kq zBW`i4LV6fuih{MhqD4C0cpH+c@OJ6v;8vk%Q^|RGFwNhV2yvJ!;;b>JzttCvfpV&= zba2R_hVp0?1mpgY`K1|TGld08PotK!8%v_k-Ga))YGxz7+TbyWw?XMifh|fr zJmxViC8=er+#*Hi@usbfLo8p?O98d6jluTA;Bpe(K7JAwLlc6&^h(dQqIfRsUm5!E%lxD?7WU^QwIY93F?)l+i^t@eEVXfKdjMgr6<*O-e9GI7s za068MtbqT;fs02di~{RTL??e?OyAEI=P+=b=FncCt7H}4R8x{9DZ56nbpi*BV% z>}hR&77qSx3nm&PMWK-i_ZEZ^9cUDht1!tM1n0mgc|PGvo{zwQIWXT@re(KQW{H;I zcNSD*t5^Sh*(m@OX~buk^r0Gkmkds><`&_e*u#%pBX){@-Y_GdFjmv zAG%&k5G#*PZ5VUBH*`$~cAI928c=4O9e2KTe&x^C27m|tyouj2i7L(3NE+OfT#d6; zTWKuIVofJIe#1}K_Q^qi2et~gl)f!-n@2EO^VjS~e3f$wu*iV2Bdq%G7*Q-YcuQ7y zsn--v685#uOzg_FUdl<8rz@DsPp12cBH}pX8&0iaGbL_&$Ak+s-r?%CG)2S-q zyF{~^ThAza!-z4h+~$0^g%=!9w}{A5p5_3VoM^2h#_Z(n`8&*|!P*36e@y-}NG^W- zAUD%5-=ed36c!)p;13x1CVZXqMvs>LLykP-lHh)xl&!E}=LkJ0BW>T);wJFBnyv}UbMa~wfeZwO;NLaa5{WUlTp zDSe==G*Z}UoHu&AtGe7vGqyWEOIb{&0$KOjEK2P65&Y5?eI5EyEkK`d4|12h2wj{T zreq_+a*JHp%wNZVo1Z(H<}vU3u)yo&kgX`Z1!zQ{H$<%5-m)7wK<}bRpHI6L6*x=* zhedul!FAAqj~IgHq!_oj0+L^gVZO@erBNKz18;PE*>h&j*v+du?53o4v%>$i9E~Tr zqK^-Nt?r836!N2CBivAETxrw$Re`qgru!cSKCzpZH?ls!ikYp>R^=uv6eS&KZP_s) zZBAl2LL8~LOdmNv*HPzC=L{fsJC~@N@>yRM1i$BiNjUI}G_XuI_tS?POTvNsoCy}* zEb(XMwwk17mn9yo^+gV{`l)eC3d`JK30<2-eCC7?Bf>I`ba)2*BITnJnm%ZPTDLCD zx$@Dd>oU8xb8*`bpH&uYmKYUB3_hla-4BY=abFNO+PHlMRm%LcgieZ}N|$={4xO<( z`WtCM73}BiGYqydpt?4XCjEHIo$u=Q-aiG#9MK z?!;p7{A$r0j&!&PSYauLUMeWrvs!jWaEM*`)(p;T|292SKC&JZEw1ix{?72!`TUf6 zWW28(T0n9K#@{2Af1G?>R5)TgjQW9?o$wj?_;>R^-(i&H0t1hyj#r|InpW?y9`!?{ zL*^eZkXZGlHeTl4^4pH7DO(({1!RrAk$%x%zld+!1*)$9eAV!Ku7)%_Cg0>yV^cEV z)74ld;yHR`?T|EZnXJ=F_L9|)NW)rPnW@^g%;X1$6;Ov2t>Zw$#y#0FIj(6-M5xhh z2Rytp-Q(^mAzLw*grDi?_T-EECOsATvE#{B-^D9rl4HiiA!|ih!d}WY>_URlM!tht zy4!@B3;zOBGM>vA;7TS$uK-JtMM=!P@7n z+(DW$Ttj(1V}sO_2SdL3D67p05H>hV@;#*N60 z$H6P?J`uKIYiuqes%~pMdK(B*G@<~G#UJ-*9`xlF>NYa1^_n)E_MC@}8h}iX3tax% zg|LRrD+9Vi-5r+hV7^D6HuvMFEFt~-a0NaN4aJ;~jnnVUlle8GRD*J67xDl1brdw5Oa%XzVqIK!K)d(7E*d`Szeo0_>F7+^2{nb zTh`w@f><4&M)S1To6sI1F@8n^g3n(xtQ8!Xh#YfVd_Sc0M-be_WW^m;q7-}a_!0n* zMs2Tw^bxG%HbjkLmIn{wV<@gnP*T_nJpqMzn<^mdVO>9+Tk>2ukoC(S_$=M@a#d}P zBfd*zvtMqZdSc!9@t-q5`PGrt2RM-|7|RpxsIv`8dr z;lM7<#8Qc6Qt&x#bZF4JYl?~lDJT7mpxU*txzD&%Scu8d&z@VWH2pN*8YOU=q351U zIml&%8muYz0?!r zWq=r#(Kf=!BI|M-21bf)X(txgOVXTLCo>3g;G2fJ4u!}5=Q}_{s+FGlH1yo*cWI7r zMWK;1>E+*t`j$Y5oR4ju0wol|gPP*1%>SAOg7xc6R(Ia$4bIX95mhWvSEZ-gQeqBn@ zB1ey%{t?qx5m+aT#*G5oMB8&hNhfa|4V~Gku5&`G?qD}&}`-OWUk6O*2a#OIo}lAQX1nWD*JibfXxZ6z&|nG68#)m^ouH|7H?&B`)XSY?T9AVY;ANpT7aL`;y75 z!=l|6Y;1Wqo=hU)(*ACR9b0<6DD`Em0j(?&Px(2tM5aros5r0X7=F&k*G76#d9J6> zHoa8VMi~v?mJ?U)S#$X_0v1%P=HRKr*$ex3g1?MilAxq+asyv(%#Uz$G<{{QDC z64~9=%Z%*zfW%2GX*7#%KsB{=F+lHOmok?br*HZ!jzH^RIL+2BIo9$HPV3>s=%HjE zbeX{GEcFcZgy59?W4Lno^^RvxrrG-y#k@5mi(USZeBSRB!E@Proai$4Iw@U|k+STZ zzZhsc!Yen?tq8C2bbL7EtvKx)GA-52?-xr#OJvy~sv9mtwx%rx*l@;8#1T0kjog^U z?_ttO$*42~?8CbV&aR_0yk*NS1H@nHES|u^3~^~t(yBd{Q(sq|5i`l(?CTotqDwHx zWf+3;`%P3AGbW^_enK29eIYIm%~o~`MQb9=!%#ax=FA{n=b2_UknMAJ(v0!{fviBh5_ck#GlLN;KZ7I%+`4~)kOSHCBDnYNU0Jem3rVG5l`c>;GLZ z25jT8%cD>l>vb@8!Py{bE7JyCXIZ3W`09GLMwRUSzPC8xT;%e;RBo{}wO<;`&+j8} zpT-RI)UVgETT{*6jIp>}V=-}M)w$relVM4Lt>xyhN!6>3MXl-y3%?>|4Wv(@D~TF4 zT`CGj8wTTSMlz}ouqIs`8^j@rL4z1K(uJX2TnSBuC2CtI2P<8x#ENS%0 znD7gT@%j<ie+|a?$uWV?UF@fuD2R& z5yP9TkTTJAd4&rNpc<)mNI)J>4cK(>U2qywPFcEGexw7Mez-&m%@=9=FOYMUjS7=s=ovc4r_Kg zj3w-lk)6sn1k)#s0FKQtlP15XNp*jaqc42OV+Ogzndcu9yPK9Ibp>_H|>k? z89WE=T!=1OBY39I`1ycC_*?kKhxo2_490FGjM#Zqg0&xV%0Iw(F>u zfC0tFMZrNl7{KV1c{IcqWw4*{?f?KF07*naRE)M(MK=C#Nh=fe4B=yn9rrsbl+q#! z9De4m=Ucc8Jy@Ybay$vk`m1hn5UWWl2zK{yN`J9>Ax2Gbv?3VN-Gia%lrWG) zIOZ`c`i;#fK1<-WqB}*En!nXvXDLj#!EZ-n_=#Z;6q7|~kT{72&0#@EcQ#aq_?Qw7 zGH*b(0GEI!k3&=og)xU9){Z$(%2UCGY!D5`@pMT=rt^fTRhjyw$Q1)Ed`bx=#s!`y z9wS=DVO?JeSygxVZncJ?RMcP^Hq8{qoHlsQ1E~jUH));3i-!*S;*GJ>KQp&fJHu#w8?j5vKFQ}V1ZO<7N#JMriyx$kP?==nv(ZpQsfP&Qhi1ZM^wM)Gu+>(ry6*v;l0;eGs^#8N3|PO#(WXN0R6~ zB6f~&xZB)RJb8{a4^Cc<-%#EIwU>RTap23xg1?gTYl3ewhDCG(S-xcFdMuibAr81Z z`ztGSNG*w{Fj!m!x=SHJ0{?q&n5>Auu0h0L+ulcXdmlvtz%FuCsS`_PSSNws<@<`= zR0y-qNG$_4C;ZKT7oB0LE^yo{jX|Xop>847dGegE&=W+3TEW*ytqnAZq3s4@6|9j} zX7K6_hlPU>bq3j&cNmeLM%Q*L)WP;0$)b(CIyuv5L}$YAI)p^LTGiy!*)f``4jnqW zS%Sec%O2rkE)81#Vc!z~7Kp-ecHs>8e46cx1BI}nW2|U?m@)&>QAKAc%YNNlBl~n!VVU3J4DLFmsVPD##*BejRaklzUCGP{B$%qSh#q)=|H#CQCq3} zH2jOF?J-}44%(ZsA=LION9&Oao`W)+?uAf`xS6(&ka14856Y-VnkyQJT~@pd(hac< zdFh|5uW;4x7yG~d+F`&9c$v+n1hm+^E_=2T`LFnj4KE;O@mZt8;*P4Y8M=Iq$9pdn zE!{0P9((?;`6wM&BK|3Uf{nZqJF1+XMsjQ-F&V)w9xr+#60~N?I7pY#qG$e=_-=;h zlEt#)3UgXJAv~Mx2LcJx2ShFEtYbw=ZuhrK;rI3Ivg3jDZV1G@X4q;=W+dyV67)hL z$o-Wr33KfRZnIh`*%i#-A}eJx>e>j8JY%3CKI3R z6F)8STC`L2FFa(FQ0I(tco(URKS{z!iJmNerjZzQ3)!OY%!sCCfQ;W&XoVjSwVjJc zTRXFKbgTcM6~)n|pHp}l9dpi8Kb)FMr-BEbeVK!@C&I825B26Ca%zSgwFq(mt)%=3 zNyjhk-hi%Gi^OpZX@CEU`KOqla^Mu^wdxt$V^V=tc2-Usg>4BIvFp(E~tc&Vk6hie6tB`5L&=e z&_Zg=O!;&YD%FjLJS-dmuEP!?2Cck!z!!)J-Il}kZk<-rdM$@xX!ivIHwJNNocHV4 z@llmehDzhk2Xar2`F%{hZwzqq$(S(it1XoN5)i!NGBUf>XoO}gP)N%>-~-thO~v$J zxqDf(bX3k)v^U zA1vOd>d71MjWH{I>GhEGXwN|(8Tuxd!1Ih4*Ff1_pWen*(yzwu|f> zS2o-Y4mXOnM8aIIs3G3jIWDkos7l`z*rDhRd!NFj0yy-L*d+QG!w_4!5K>dqBMk;K z9&)NHt^5#@%cM9vu-d@Xe*AuhTN&EBH!_@Ca+(;VVWARW)WP5w*HVpq7=P7#*9lY| z4Apu_M`XILqc!{2VW(3u*ct5!Lu*0DxzyOpVL|Ac)0vH8$;mE!T1TLd@1iXwY=ElK zm0JNgzN6*S@a}!?et5vnF(|uLEKL;O__hY5!^*pi^35<4K1R^m#q4i>Nr*E;=`Nv~ zu%k_+p<3+qmjuu)Pq{zR@bX|scntsh5ag$%a=5E#*6Gb=@xy9Gf7J5)lO)zf_OIjf z8=k+i-IbNWI6=KMMy&7!N_*Dy;!Vh^lHOtuCqyj+#Yz1JUj-~?rMx%+wkprC z?3BvP%7l*=4W{AqfG{Qnv}C{Yjk_}4I#v)?B^sSGn>(w(4IOgO(*}L3`pj%PGV6UC zP{w~FyoTU(KF;v*-^7nK(RGG_jlOQMJ{(wKcOHHDuvQhdp)6OQDAc>@3+vZ9a)4RKLy*1h3D&v zMz6Bt%b?i4f60UV+ytEoRM!@c{}Hl?Z!lL@4o*`xTJni!rpO0{gQmM85+7va9VIxs zLOgh7-FmhBmpCp1Xxv=cr|^mI3OJ-t;WTGdUu%blW{9YzOjp#=iP&1f2Hr@Cd@7G` z*@eK(Wd(PAQD57*3w_lh($?f*>8r4U5-8f0ny~C81xl%at^b$K-?euNj_G_I{#%by zd9HRp!!JQwEa~a?PdzhLmvDe_+HtgD zc1msLGC}@1iOmPYdNaXcu35-c$W5Df-1R@)jln!DfPm~rq7IOb5?YF;Z}+c9fO>_N zON8qXD@tQzyVPFu6b~gL$Vgv@mQmLd>Qwem^_giPs?pYwm$Yww87LX#VO=8}aH1NL zm`zSGtXSe4{!9kh$rVn0RfNrvHfMmnT{vO<0mW@ISTy__wgfpkgs|j|ruSdsWZ3!~ zC9vZlJL^$bG;PU6Uc!R3fuBM5d9y@dH&I({;$;`+;wj6hmc+P`9p-IqYRe_-1iJt6 z=2_wgAgOkoyh+CCPpKrwGYtU*!H%>m0UlOB9&{C<1Mol=(rvL>Vg9}W(I z5BbwOS0@mHqTi|sz2JZC&7&gerIKNcf`|+vXoV(0hb>Xw3Nh3sGw7^jE5b}D(ztyi zkumA9^}9;Z&_z~rSP6-`OZt6DA@VZF-eZ2`#N@H(2d4itZxn5j5R5;x%FwAeTWD~o z)lzaLXRq>$5sTpXA0_3_NW913jqEroHt0Cyt8m|u0ymDT4#ZkXaX|TX3fxwcbk~sm zOtHU{Y(if{(JLZCka=D%GqY6vkYoG824>su3d>fZx-UHT1G;{|U_$CKq_XrXQTOst zFqS~rTyPUnb*j7HZykURH@*vMb*#HlI;_(7<6R-$YpW0X;l1D_$}Zp++r++S9=e#ta8YSq{o{)bD8!*U3~cgN%3YQ z`yF!klIS=Vi7q0i(>W%>ffu4KZP6olKLWJ1{MxOAI0V}@q{l0SX&A;Zx@{-XRaRqC z3)l~F%PAlk3W7Bj2{Q;MPc(L!mL8SG)x*V@BTepZbw-k0Yx%c{$OP;i2c^YEA>6an z%ZB92D=ED~CfT6;By#&z>}!mP{Voiq1Cf=SZfO|u_`(FMypunfk|S4hMRjalgRg3J z{rR7&xPLI|ck?To+K;d=_x zns7gJvXB{T;BYWrf1t{`cpPlF{V-f-xmPhkKi{3!it-zB0_iORcSXq}CcnY;1mK4` z_#4i@q;;H;IY)O;RCddCa3fRZYZx&WEe>o`uA}}N3a>zRmUy){!l%*5jN_Ejob3!) zQ&-kQ;~_+anv4?%<3dh~%vPMXbvvoFvSKY~`Zd1zAZSX<_tQs5?nmbo!xh*YZ>Qzz zbig+~_z8ASr8xaxk#^;8TIDx$DNlUxJr(C*!e+#hSah-yEoYG`*jir>LEXvogu}YB zud0g5yZkyeF9|c!d|X5MdzfGVxy*t7OkgW@EQZ>l>8PVz4JGa|j=kfzH4Mpnk_OEy zkYrYY{jqIzl*npY{~vO$`Jg^GPpoEBkbT&OMmHzjrOeIeSbO-#ri#t6jYD8b+K z9sTJPU+gOaQF)gPj;I0~6Aoc|M{W2^gUyZw;N-yC9zV2E0izYb7|X7jIQYB~oYS_j z6|Ps?&KJV3;wkSfeSs#1Dm+)PPN{R_%b_&ekFF%m5!C@Wd=-yXby9WQoKg2PHoxHP zYdKf7~Q3HOy+$Cxk#kZ^B4QgjV?rp>HT>2g>xGX}fA+cm_n4Sc!l_&#; zb_|}aydRJ#@p|>uioOQMrd=}wJE3Mf1E(zAlMr^`6a2L5Cz0ROhmR148&G8mY)IL% zxUMK2N+zh2mRZceAnfQ8He#*Hx|lo*_anhfodT&cj7$=CPYc_nMiVs(vP){~Yq$D} zP-m@Rdyhyh(GChgaWr9`G8`#2K#~U1LsPFzs&PTlHL}%eqpBMWGV;qf-(MGWf6?x{ z8w3m2da2t;7=|C->v+7a4XIat4c@qzi#962OM5H3e(mMw#oS!IuB&Xux{|Ic)_wCy zWIXE)-cUORB)`(E6?h&NEHD2mmy0jJ(;Rq=%}m6NBS}j~%&eMqlGq>V?*O-L^}C&V zI20Zmwubu(JBih8&f$#)Ra$hycL@fZ0I3p%UuL_Vh=r6+ajki0Sl1^P7w+dK1mYEB`A+=N3s$Ns4P<;_rf~YJD+|Mi2 z={#~V13p;~b`kY%A)*nu>D%n)4wF#{sD!&|4wf-hI^7o?j=BD1g z+o<0yBu#Jc{Vj}mf5j{YqHQMF z`;qZsO^34^$Q(TZN!3@}r&94MF{slZWbY$?@C*B&QWL}iMP8lShG)wjue5x5 zLlL$_8E<~ru2W-^p2>729Z30c_vB|AlX?1G43MYNBCr=p}HGQS=Y0idB7vBeRyMBVy_3Nte z9vCl*(i^;3&;Yy>y7&F~>(W5q{6mQbKX0J7>LIodaJs(C{lWpTnk3l()gFc(93r>| zRv*3GZ*{pF%c1=WC^m1^g`%`l?uPo7frM9x(kDRuyz?_9!qox6?H<&3Pt3q3_qAnd$w4HcI0r)~O zK*|U?ssdKylT1w}L|ztpY3rn#AtS$dW>=l@y2_YYA+OLFqO?%RrLZh6UUFb@s~kgB zRCt{2L>GH!Zqb~pBFl4pR+)IaruZlD!VPJT^3JTwDc2P5xPHRE?xE_HWO)r^{y{cg ze@lAzAIZ&0aCyMOuC-nXkvX1G|1Z>kZxfcLVBDb?oXz>Cp=Ua@?4Yv%uafq-PDz91EgRNx{42tk{TgfWM+-jfA&g>qK!!w^s9Q zz1q5lHsS$U-^AzuUR21i_lFdm1rQwrYTcE2c7;x}wXTwLD80ksWpxT}w$pEFt zKerFcn#~|ZHk;L`O{+E{T-T91w2Y!5S|eyF05|EnIiE?Vt`wOJKg|Hunr8(^1eA*` zJ;;Up(a88E{jaj3ZAovG?k-zZFn%39zq-YEjmIqcXn$IhS8BcD=<0^3MdbhgCok^; zvIF$)+P%9uev-hsh|iG30dtT7lOGBCBJSH9(GFoiF)uwN7zY8iw=UqN*F$0reASo4 z!S;G8*P&NC@P;O?fv&)JPaf+k^rb*o6^U>nv|fO7=(O_t3eMxuQcXUy!rV}m$aHDR zW%_zf-DQC7IpG6P(s$jqh0Ne@)1*g-rB!Wwnm=UX%tIc4a8*XNj>(;s$(W_m>R_A61|LZuMjCMNsq zmA(=gR(bgPeY0@?4`^?yJS1Fb$Wc<>pu(#anltaimoPkM`>;e(?|Gxv}PaE5a7t;`_>Op7Bq426P;ai zPtsrgv;Ktx?=rxMx_vi4*6ak`;_5Enc@TEOtiy9tEE>wsSi5-4kO7Ld#&rd19e zp763B>jAak0@SF`$94i&argh0N^~xlfN23I`1c#Ze4PM4z-o-yDCozQXbGp4L9iR2 z9pw-^C2Pyul0M|=T=s)qVg@#CmE!MbYV>wHItS{CYt9PgUI%K&T*($BDQ&}AnXDqR z0{ZS&@6GS^q{y9E`~CcbjVt~v+*kx#j3P|K#}H-TumqWnin6yci4Q20=o}8ZESY3^ zI84w!uupb7H4d~&%cfvUl0bRU>|oSw!V)hNNwNX9l63*h z3qdsWX+mA#<`*7i1Qu=3z?p%acb5_&t@5x1Wj1^Y+#bc5gA)X|wxL!mo(sgPgBjTX z)gNzfD+0+F)MRJ7yvlf_4{DUyRPg+QS9{~6IOM9sxsaJ_yYo3N;keORVg!-HWb#78a^bf zVl+hyg09_43-)T$VQZnb1}6PS+Z7}?lEbjM>cW$&cobjI|9{?&-4Y3ql;cUVli9>> zOWp0M+Q0xokVg2jI<1)wGt6~FUP zK49O>#!EqWG*#A7WaapfGaAX^0BA$o_^EOFtT6O_O}AC1KcvA!f5Lgc9H$_)E(}ap zRobtDy3~;LazRJ_#wNNG3&PV;*q^EKeAX>I&SyQY_h!9wl(FJ{OW zpU(3{2-BHNhrJqV(vx{KR#KrRJSPHpBEYjN{x-E*BdxlYa@mkIH#W}6ymxWa*rUjn zU+ZMumbk?HYCD?2d#6r-;Fl3gz=C!E72k5FRW6FWz8QVcP}|7w>~I^Tc2Rgn+}1KE z2d+M^_hO9uP`t3KyZ2kzd-QpG+i&$!dBfnfD!bv4-c~FZmM6nxE)2iE3oF**CF8$L zd=qPB7!GlJ3C~kY5!k||rOs|?%^lo~(;3!+T_z4V_e?DXVL7< z(doFm*vz@U=nWpptlBl4jAra$$<)tXI9mEvN7h|cs}ZUEP9M3GwHqkg`kG3JQHe%p)cbxl%vTBe zg8{Es!J380ZeB=M~Xpii)y=A#6Z_x!PVw(R;@sN?{Bw zuIn%y>;1R!LC?53@nP(dLP;R{gE&daN^e@P;v8dDo5w zJ}4+ExZctE#=1p;1$i$qVD?8NGDpRX2MDX=UFv|n&@+|cRxH=yYnx%O}L2-tq zbckv{uBGMEe1a-9kJ8VILxH$8OFJX*IP|Qxtvkgmt(qHyNBU?eA4W}UgH%ATNsgBBuIqm*}rI*u5G6$$Y(2@CY)=rxLVqhwy5 zS7M^qq&jYb=|p!Cp)>l<47bdpCriv3qoI##wsqxT?Np_XhNB&=!Dgw*s6Uztt(C5*AwVO*E|D5OVdzayC2m0{oNQz6TubD2C9y37 zi!JZ;p7|TIhMl|Gx~i70sT&?$_l`2{eZ5`deZ3^>^MOv|qHq3k{JsVH=M`k*uaoQr zL1KiY#vIyjYGX35G{qnLreqncUI%3Z?+o_)YGxMT&X_-mrR1z8Lt2M+xs_KihDGpE_s3Yx`c+ZPWjjMcl-qcOU6n3j#B>s~#f zJyXma`lJn$)tb_HHZV6HWv*ut(Y%@NL4{Y?oknr)_wl_d-CuW~5_Wq)#KqEsS+G2?p-3W@9F>PEbM)>9ptT=~fD=}Xd(L*h^Q{`E! z7u$=sQyqSvn(o}glb(Mhzo>-cg{%eSmk8J9%4Yt+tEx8<$c?_O=9YP zv0HQAxTD)NcK`q&07*naRP3)f61!gQj;e)z?)RGOrG3ps>Nj+|k;=*G+zx5kq+Qq5 z3EsKS7>Vz5gD$mLmLiRa9@!roJf-AUG73j3R_R$%jO*ChSh=M*Jkh&>SC=6=CITZh z_BJKkt-MMx)CS1okIf0N_Y~udprwQ(H?|CvIfS9K=l1@e(bpzRD@p}-I$7MNs79h8@bVkDC)}8o^mNdM{WN=iSkqB)3sIJXfNSZn^ML+#B79%}j)` z#0z=Q?Aprz4cHdDoyVG&gu}|^W0%mL1u2wK=uPHXJLsCUwk~Z6ZjHPe{RCJV>YL$S zwe<16hpWRFopEe|O<+4Z+n8qm_DB5h>t!d2cznLAWHY~M(E9Ke#?KAMzrmh6UzOyz zD%EC=Q4N-)ov}Uj_ZI277_|!gBKy6Qur8pyNqD|U^F^R-3bI$jV;R36xb1QCU|_(H zi<^qjy;X$h$Cc!0R>n{Cm`HJSEM14SmT)%lTh^Tm11^d)(%{me<1g?g9#dd!1PT zWC?kVQFtBjzph=Y@mgIy#0gtxeJ*%po1CMl`}bHZkhNg0CM5w;{C>90S~<5v?gxuH zE5>oG12cQHuz6`fCoj0FMo!oY`Ps87*@mUgeF?77lbw(=pc{W7+9$0grVZU22f{Yq zfWc^NUgJ#(bu{vG3h!@XFLGsee2xm^tOCc9rUF`BreUGy>If@J8In zM&9e@!H@OI4aN`u=}b8@;j0kl0}Q8wF!=CdG`wc%L5g@SOSqXH&c^rLRDEYQXmQ(8 zkWb8mj3lcah(X3>o%8|0wt;FhOvwazzdjeO6?!8YTQsh+x{qY3*5R-=G;wi{)Phcl zzT(1NLwt@Vr;w$^&CZ*%x~wdBrC1nSZ_x8g$wbWbtvBI~^}PLNvEpsPva+<+b4?f9 zc>j{H7to6Nb~IB@a80XIWGMR15*)qImztA^0GkqsA}L0)>Gfk9jF7?442!sNzy|Bo zbk!O$tsq`2WrO73;>Kim{0o2-3>liwHhS z|D6keeVy@+>5gv^(eX_bm2WZTQ!*7|DphM!ScYOUB+Ju0#8=Zah2(wKYIYX>p{*G! zAoyzrT)kA)TXiK_`kGy*(vz=(ko`#P`PxSoB;$o17p{3s$K|W?-K#*b+ptRqQgksR z(&EJ7$wsV#(uSpAtE|;ZH&RLCGQv<}ZQCog!Hk73AIP}tr-kfq?kS`&NASjaLHz6j zmsDsvR_I&O^h0k$a$uc#0T?0o1*EPg`-Oo~14iGTtmmx?q+W)OES7h~Ng$JoFmt=4 z#bdP83d3$)Uj3ICegOw|fSs@ZZykEk9fh`QO=BDG>T-j&gL;1=bOZS;y1EzyaTEha zXc3JL12rIwX<@r|{w2vE?4y)g2huP4cKW2^4~5k6(alw&_{QrrK7ME8J8ydY^xsW> ziH;uEe^-2#x?PfASqW3~l%mXsCHt+&T?M7x+){*at7Wc{ls=;tgtf3>1mQm!Vz1oa zTM6;0&PzZFn(=11kDK`hnqE$Q@0YKK^W?2l!;5^q%7$A;-1ZJ6Ki^V!LsGGL}|G|-;#z&D+W(Lo@P^T7Za|Y*lcb4&{xAjBl{9)+R&s6N+>bU)B?f0Zz z_m(O>jXtc<5T`&3#PM5z@AKD(LK%vw<h7KwPRzBY8{ZKm`WV6WI%$A9}IMjS>cOzM)B_=#prug zzmjCzTJboQoj=Gr{vwF+XFxc<&8vSKb>-g^9LrFle*kZJbM=NJ7s5;i=&DE47+=vw zZx)_6h{FckbgTckySClPaUD4O7+_FO1oS9OmcQ`dV@)~Ez3?X z;Bs9^!IuFJ9G4kziDG32yw#xNUfpLxvS_|a6l#S+R8kUB*Bbi(>QJPlG&m9{XJ1!EzUT9dYy^+AacuB(BtBeObUR{h%Z)S)H$g!s-r2erAfXpq7&HeK z@KQL-uL7L}V`A7kteNkN-nn%p9A9adUoZTbz?kux9)`M@6AvQ1=thZSu$d|7{Cn=z zu34iok$q6-HWo-5?Trwu$h`Dv-`l(e$l9>(6I8#n2y$9=!8tPcgDcKs zCl$~4Jz{S`(u|JdC^G-OFT4ye-%3pXzh8MZdc!x|5m+2n{bQz?SZu<*1faVakk&3D z5{uX{Bh84Cph^aA22Y^Y`!WV+%G;h$;9vbffsYLM#FI;tD_Q2RJP_0=uuS+>I(+d! z4sGlUd^8*{#Y4(`v!D;`@|97ybi!mVfx!k5Q=Yj zp4r#@;A!L;r?<#_Hg{_Vc5Rvi6^=-pCFcs;pxkrl#*xa3*dgA;n;U~{+oJCM>(?#* zrsCf#yTnF@6(~Jubs0C-DkIg9$pe;2fejc%Q&-}g_@a2UP#uy1@~$y;?qu03A|G01 z-BRSIm^_|C^P$%0B^)QxiYuT8FVqQPc6vJ%6r$$ zqg$1dO5cs&^&~fu`yrD2S1@l>4LEnXNW?Szn-|bc6qZ2{Evv#QSCw4eLa>SY@)S5N zRD^ON$ZPnv@Gkb)*vZN#zjx~a#}-$W{$8mHn0_P=l%*GwRva2%g=LJyjb3qx7uB0( z>eG|#Ms-|vZuBh$zDZ!+Vez%CI(mT@AC2Pi!m*v3Q}q*1t==tTT}5qDn)mZz!+=4@ zwR}Wdn*)UBt3ccU15~gA4YGOBjdfbpk(MG2!++PI!7TUuiTglo)dns1vfLF|mPUrMh)LLe8osplvshn*lg>(YOv(NN0Q&$bD6iGu=3tPq!)n@!!uw|t=MqWPHd+3&~4qXX~Hza zGXpI4{8!oaqPqm_zS`mY&xf>Z67&pCFDICrU|C}hM`Vs*E$zDLfYm1p%8Hj-jk#Zq z;vPI)7l8-HMrBT#vGVQIK5L$Lqdxbf7LQDe_jhcJC^PpsWlO8hw4{drEDY|%SG+de z3mAp=_rCDOi!M^`_8UZ2p^;SL+;0k{7O3=J&fab-UT|gOEyI5hj~V9kQh_WYw?-x} zioR?mMu{y4gm&a@_uTjW_1jxfZj#MgQCcztFPa)xW)QqD3Wps1x#m3eD#}^4ZosD_Zv}p9P-WClWnXx%O*V)K@}fku*cmP zxxyW~R~z^V1BcG*V)k%N8Ocq?Dh8fx)+T_}9W75dCZC-xKQMPa5KuYNfa538VzqA{ z;&2FWDP$Yf1w($r`T>j4c*Lke-4a(OEyQ-rU9Bj+O9y4Q&{u(QpSJ~#U@bmu?WLgu zlqwI!I?OoOGN$4BG{Ytw{d%~!^?Wz&%kvtmuZL?J zZnL@AaI#`kZr51fqx9QnU>H9{N%6UJ;M53eKMb4P5~{4+4yCzhB|eNzhex!OsmhHl z@3$8sEevufvaA znxr!FYjAl@@DvJBU7T>fwDi}5%|e|wWEC>eF2!8+eHG!w8)pge=75ys9g8*P@-6d? zT!e8#@2^h)?$=*9f?OCO5r{u97vhHrjh%lr3DN<$AudK^qZ5;)jJS>e3lS|OhkDTA zE%?2Bp61zW`wU7`!zUQVofm2@tX8}Q6)3S#3^334`Xw;-CT)45t&`=MZ+^_Y-ZmIW zKlm{gXYF1X+)|57tzTMGJdU!|m8QTJN-rwe7t5VGwC!fD%e=EMurzyj)kHZBoeu>K z&C!272^g-Q6E|4rfde}ni#vgS4!@w@!~2V?#cjpTlzD9%UKF=r*C9A9{E9EL%1ilQ-d+qx8Pd3xD2cT6gAef-Kwv0dP%mUq_#BeLWHQlN0hlB%#8)U9u;(bG^_AGa;KK?f^nOs+r2(3ifcj7e2xN?s| z@|gk0a;2Uy7s260j|wwGFgp3MM4DSD6JDiAs{>Z|gtGzZu-vr4EjO5M2Hj(gvofNI zwn%)K^lLDQhT6dP^AM?3;GR*g#w~>XtAt8o<)~n2EFcV(j=)I`5!`5(a z>q_znO0_|wL;rG>haqoYsM(vQuNT}0oA_~xsXlXikerJNe7Iz-aO9DA5q#T*(;gA} zb1?dH*Wyw-`lZluS@iwSL&-R7LO|LQVJ^k8*ncH>PTR5hlTm`n>72!{EnOh(yK=KO zD%fd7qF~@6HMBZ_G?f>%*v_hD1)4PKtTgWs`4*dh@wOS> zi9_59rnl=i_1C!AM5aZO#43%9!cJk@AX=-0rxVNs*s$G<=>??1D0^AAEhE+RsGx(S zmwnXJI-uGgGv7ldDn_2=!CW8k$y#$9tKZOs-}ldkh97JhCd)@eo#SN3Z3T2PX2OiJ z$SEvmy67o`g`N(zJ*_i@um4(bc!#m%2L)w~I#n9^G0mwpTIBE#9&J-M{Tw{!<^LK^ z54d*Sm&y22PJt+`GD-n&ZaY<%_-nhx4{%R{5sG&k za(+4W&&XM<9B6J&OLt#;y>Q@fX225KM-~TI3`r*i_Fyv=>UN=CRz0r3AgT4U7_MDC z%GB1`!#Y!{w#>Cn#&0jTe=V6U&b#e!leR@k@Z%^-b6NV@VVFc}-qa%r{Q~Ijs)%4_ zE_%=BKt+5p%;llzj=ub)fbOdF93b#PM2myLyMRB-dV7p82UKNcBstTwKw}?RBUnpAhT$!|SBFW~mYat9wZxv+mU&Vv zm{%P2n&bz0?nGmUM!hg$&th9PY8WUh+OF8OLa!#S!S=7;C;P_UQvp09ncK`diLvg0 zdSxw|5g}v4i#BHF)(^#|DeyKlgjzs@&B}AH)ym?z-uqqFFrM+w?SsmbOToq?M_#25 zS&mK>K-k#rZKGya_)Kbb1W+sb1yKHnA}z_g`<07^4yLa!Aej3~CUdtPIBnbPde!>< z_;-20m&TngC7GAmtE=Ia_q-y|w3L(U)|alO;0b3Rs~|2Omb!R0p=E+Qt%hVH#X4@e zx-IDn#G}u~XfKzSy9> zoiG7fh%+0^eryi{wVrkH<1jaPSYp6P&kSr2mpUXAgPH4(LPrkYLB+;efdoZNSB|3r z{0L%YP;JR04jFEZUeQp>LU+SQhe?y7jZg>M_;E?Yv}!%Vi<-RVaOiITFi$k4>q$Ye zFxy0HA~c;?YS%ki_Ykv^-9ZU05Y}QbVKrApmE5{*aI;q6;4{aQ6+%`sI945PIKYFha2hwfhkml?J@}wQ+KN<1ls%wz}+vonq?VyJ0)9n^6r;dQ zV8zF~$E)x*cO?H;f+Nhbbf>qBkCGu(4$N12oGO^PVh7t<5GgLlo#R6Q=rO_Rrhpjx z1mcCpi~h<|s2A?)dlk9C&N4ILk1?{eX-EuX#g-l|l>Zjd8A)^AU@^t2BO{G4JN~8Z zT9Vtym7uwIb)A}vuUFQQ>nB7n868yRH0h&g z*V4Hq(Q3dKeS#QYrM6p!j&kZYWY!f&Me)9CfV#QF&0ll;*HZ%QZKK73R(5K0>^+n! zcL}MkGy_3K&IMHMVnpMTof=(BWH5AjJ)<8W?)V7~znlR7VZaz@s*RvqovA?Lh%kIjWa+O(5NhhK|VX(5OMqb(U>m%f>x z%2Hrk(LO0>Xl~4;X5E2cW>$UBmuRcRw_1;RQFOEvwBW+X^+y;r<&&TaozYpL^J~J1 zk(}%{Zq@ZruBB!lB7|8!n`7G(kXHoMu)g%P2JR*5#8VN z2?})~z}%}5?kD*klF(vxR#)(u zCJ9R^P!5Y$RPeh#nMCU$Q9jync~Yx~iQ4vQz_x55IU=lL7d=`TU_A*PaFrHR6dnf> z#ysZ6%xE)*#*9icW_;=pR62Dp?4|U45$_SKG(N5 z!qg?kL_+6$DSfvMfr&*;rc1LA(TqgCkYrDuNI_d%SX&kbhj(h3l+q#3*UxDw}6p7A^Fng>AI`kZrqht*l_eT3iAY8@L14vVwh?2x^ww?S7qMt%DYg zGpuHMIy%t2ER--(kz~Jk;8V5p_`dk;k6ttd{0D%=ja$zj8RNBCUQa#Cnu#?Fr?bSPV^1!#)U* zNUex$uW9gmu-((pBTNWaPI}R&3y)Q+xWU^o@x|8-h+BAfI!zDAU4~+!OUjDA1Flyq z!UCYgv<9U$p>;%SBdACJwhj>ZrpbcwCdcjs6CId_m=?7@4=~&;e)BFq4t%hifIGH# zShTt$HL(#PHSp%5L01Y34Qu9BI)%B+lqMp4>1)7vDokwVi^^1N?Jh>0#;T=F07{za zi zUCpED$qAYta#f@DOg`c*Z&Kp>3h?{dV@MlbMLdhO*w0;L-^vnRNFgq0L_RGkzq%F@ z$EZn;rbaAly3(bNRIye;dzxS^cE&|eX@f!zvF0C(tYG>|;J&M2#??w*X_v_;%L(bE zM>7^16wVy);=hBLwCu>1#q?lOo%yXDw|7R}*$rOJK7&4%zzI0NLF}`g`6cJqDC;+1 z76i3@1i8*5b$*m)$_mEHJkwH254dYPp&4!}>E}4MM7TT(erLYxL^Zg}I+8Oa|4$3XE1zD8&@)1j%fF0 zwl=+3E6RFLlRx#@@i1ai=ZQ*BQc3dUPNZ7PR6O4xXrt)X-7>M=!T{q^#nrxAQ_Y2D zI=IPv<2FQ$W@OiY=&qI`>*vVBT}?Kwst!f|=+?DI>VXcY#5K}fYcxi%Ys(Z;31bCa zIvdKl)M_+E8_k^`X0E>R>@Obw-FmZd9hG>{O5w|(cR9jR9?QW}qgWpBqCl3iTjS46 zot+4KpVrds*D&9A{{7%#yjN&@XZ{jO$LH#6ULMW}#RaRCu8PN~ z_6z3onJX*ScqQ432AQ~G681Sj_G38Vou62hG2#s{`wV0hJ1IWYcN1h!Vij~Pz>8ja z9`j0u)3-0xXWF?{nJw8gZ$fm?keMDkm!+;sa-UtGR@`M!{_x>(Hh!KrjoX;;5xn>9 zSwR@q=ymAs{{PVKvq^E5h^u9(&S>&Gaugk7M!f`v3+hY}*rIJ3+ViEjyQsg(%*V- zw-PsP#9~FXk%La7RhfPFIunGrA|N_u+muqpUudr^<6(uOe;U^Pm;adWz8VesrO*Ch zz_J`oHTUcl8f*`XEOEivJYU^6R&o$2UYw4W#k6@*aGB5LmM(d)AK+VxJRb=53EmaR zsyMejBv_$$W#n8lp(%s6RFtiu>7YL6q;$Ajxv?K6sIcv^C`77Fd%?wNag&$xS>O&2 zbA6ovQ|v1Owo215gjK;Bb~~-8L!p`xSXj`$6?x2Og&0lyWqw}Lt`STpnaAOD@vZ`8 zN>C4ucO@E3DJvA{CKFhJbP(g#-VcJXjgf@MAI!F0JUBh3IlTtw3cP;E2`wM&Z>_h< zNt$<13K@d^f;pQihi<8JG*$R0GHL2OdY&(7b43Z~fKCCvS&m&4J21-{yKXE0FR`UM z=hKfQx6w4T6ShF-1m_<)ejwnbZ=2s-5F$Fgzx)aSQb4W0OFMJRS3N;h7D31e8|pIR z3{miE>j?%@m^sWpA*s_{#yP6iWpUqsLEgA!I1azU9zF;Bf!56j&t0OaCmg)Q^xMUL zs88oEOA_mREt#{@Sip1g`bf(zG ztX)r_SEQqL7rQU5n_5)E@c@t=@4Yl8be?Wa%k~l33iM4}>M{%4`pr#?Vj5j8r61k; zw#g$MBdmj$7Y)jCJ^Jd)I(OBm-nn^s*pv@O_m_;$+igC#pov8BFZCu4x1vNI&5bx) zhj7#VNU4kYn@X>KPJAzU=if$PzlXxFCI+3%;a}cEY00RiRQI!0zilGC(fBlDxH}vo z$u`sL(?9D#_i|g-yx=&FvmD#!3~(_oAu7Z$@{NHuZR|RyY!40k!FkQ+z%ihw$ zax;k>m@mo}{(_wwDx4=ty;s;9zO- z&sQ9dBi1z|OOdfkD>DoDJa^NVU^(wAk?mf z!$4XwT8EJo_zBF92@IWy8b_X{NnTw(V#LJrgpDkNBh%p7;g05%HE4p2nZ03jb%E_g zz2!jt3~6*T>wL`UnA<3FX>1xszxrJ}V3aNF5@hO1F;iBGUN#q9Ag>4%R*z3}L+Fbh zn*puoOj9a^8r^CJt!InEef@N~X6h1VN~6A`Wu`S`6_x1vivQr{j%RFreM5LA<@psw z=fH+vn*obh3~M=dEoF>q42$v7^OTd`X=K$hR^kb+53LPJVnR|)e=Q0|EATFHR?W25 zg3dlGrQ^ekLRFF>v%}nmuSy`z(sJYmsHHu>?KvO&J`y5>r+}qB>dL*9+R7(8{kc^> ziXvN|ZB8%$-XR4W$EnsA-ZrtS+)y~yj26hi)@ErP9X=-%%(_qK{T}sN3?>D_1s?v< zz%lzFZ6#GimW=2bI?K#b=M+~YCWo2SZTha7vtz0?RjW*W(p7qhGVC!3d@VD5o(Id) zQ_nyFX`Prl{8w?CtYW%OPSu=2W5o8%?CS4F3#MbV0^u09@JzLLyU=a(v0&7Ot1g*M z*xSUkJ49_(?RiRCl|}bz>=_MK$E;W7(7El3yzFe0cMfhA5ysUqNSMkWt->JgLsYpa zCQ1KKB~?izPPyeAscO>A1HC7FQJVh`?(geTd-XdK;!=h6%PDU7wreRrTv(J(F6yeX zQCp(EOH)o1PxkN3l~ahBLRUgdL2wh5eK;r+M`616oRW$){4+(K8d|C`lb%d5D+1vF zvc^M0bZb5ocF3hf;}X_tQMV!9k{~yNYO$&PDgVjf0cbUSZQkgNKN*|Uke1Fh(H|45 z&jyEhRhGqDI}}(Y4m|CnaE=#~u_I2NH-Vn#21q94CJYriN}mBB)j3Xlw@T5zok27) zVwa!KALGJ#Z`qRa6+EB2`+0#aq2pcCbzV%hw z{-S|5Y9rA_jqV^8X$rU_ZVqc5s$C{ZdkUXNXh)5p-5pm>d}*yk1BtlIPa`F=A8c@f z#fzffEt)$L#5NC;wc9l~UQ)}og1IjK7yo$-TnB_|6LV_dxQ*`K5?ueIq5HaYO1`3? ztQ?uP{B8zXkUFbZ|0LPl?fFA7SF8GXrLJjsp(Q2x`uF^KkGJ#LmiL?QI|(3nHq> z=npXp{2y=Ew&OOk1LJpr4+8>x zWTvR=RzDVkF^`64eTe>apq>k4;LFh0WH;Gb^z#Efa2M1ZAq4*gZN6+f}ynQ1X{@Zjl}Ue^(}o& zRMsg4HDvIB2~?Y5WYZ?sx`!)SQxkRqyB@76F=@b7|Dx8ZDKn)4Qf6_%tz`NRpK(}@ zX^3@V05$g4dSZsj^;7yp&ts%fcc!^Yd9KR9+zTQ7? z7xYS0*M8}4z1;-Xx0gY(DZG5!nmA-#_c_H1uLE1k6{x9^1i~wW&Wf0-2+rWdR?T&7 zw`v8~)#ftj2#Hv9U8PEUaA@&2*5^TFjuD6xokpt{XPk_(E}RgbBTBrVMdV^IZ}Im- zQTe99zCy#A#les_Dsy!I-V33yoCZ0#8=G8zHobW(#?HV&o<>|XLTeu{7Vpo65;aqh zX)=s;s6`Q)2@T#zWs69yL2C_>;Xa=a=({y;iA=WwC(71NQ-$*4#C+XSokWvE?>dwT#i4}>lU!B-7lM&3>AeX>t z7De6m0k8YYp-npw+YKuePd&lC7s{*08>m8BMuZl3P2u%5Ee#FY6EQs% z)1o*wAPPZ0F%+c5g=$X^3Fp?GSWO^Y$1#a#04>hdry_7}Ji(mE8l2z#)HFM|Cg<*0 zU+$?KB_Vn0fvPODCXO8Gp>#@`4A&$zl41<)Ofv?$uq^Xj0Vz{$rBcwA9ySzhrOnVC zV7@-E5FJg+QrT=bLr)C&$;T{b5dPP4^D9+*U#zn~w== zaX_w>dKuWR<~HF4*t<9u>prH8z|3nh9Y^C(c%ec&cK8L`Gw|S$Oe6Rs8M8`^v*X>G zTu+*so9F(ZYJV!8=+rmd8FB;b!gaF%&6{U3w>D%(48G~@=DZZUn6E@?gVmZ`O_n|x z{Z2QGF&2vLDF6tpy|W54$K`wvZ36AxzCn!xywyQD4gh$%CEIWGfjgks3dl?Zf89sC z)l|(@Aid6}HHfs+;VAQR4cg$0vNT6>XywC0b8!&YN~0@UV`*2TKgoAkcqOGEONmOc zw&`j%J;}b#{%M3(Eu*pp8dNH)b2(0lCPU8D2zrQIkZJf$1KLWKrxquwgK29yw>rOC z>r}s+%xM*+Cnra75)~+>aatc0x&GJ#TU&#qclXpjpoGeuUehrya-7j8Rb!Dp4?&K@ z{bUTvc&-f}lbL^cX0QB9xPFzA@C&K%Yu9`2zw~C;fE`qWgf6Z>yuzThS95613(}{e zV7zIt=DPBN$V{zolm}xT&i&jlM`aJVfmhhyBVgb zI;nxUf_9x~Z9Q^ez*>MiT~_f6Ls6$zXmBD+^>F;8;+iR6nrNX;toYF*LkCOj!7e*a zR-Z8DkqMT%Vdd1bF^P_*q&5UVPBteCzmRz(d@-F#*M3C~j}9s95ru)_GZ%$cYCeUG zvh{GF2T)DqR%Tv$oK$o~#J`*&`8qhLUU;N;50zhOwnA_FMFM;md_Ro$roTpptq-`$ z&;@$|Qx`j?`mqhn${b?#t`hThYlDpBDV)|c{SM7Vs~km9OwjlYwG4% zXRwVqhgD#n+3-UI*66q98Mp&gxr*Lw(27^P@$}jU$k0&P1!srIH>O?6P(3EgiO47_Nl$|rI0RokBH z=O@{?3rG!$v%i6eEkcu5L)*4fooHu}9?-VnYOW|FoKuEhfm*Y7IBA3fYT#!^(B1y4 z#r!g5C3L{+y_zynr1oaOgIapV>Fr5Sm3d112rne_^w{92Bhk%;+KfqMS}l!DRR!2( zx&aLdVq;K~zR~b_JT9AUj89NbiV}vV*aCtqiOKf&;vvs~3j@ zF-}orXdGVXp9a$yWvlLEU2%ikpj80CXK7$TP?bMG< z)H{x7X4)>CZHh;^t6mO+RfE!YI4XRo?6m{3Ic2>{Bj98DbGcB4*3`P*g**-?}Wb#Xa6?vxif{5z=U!s~T?XwsE(97jv@O+s;SRqHdux3+i_X+! z>Ez`@X?KuE+nXW$6 zgNrk}#z!;*8BV8=cJ9dWglfl6A&N=D9;j!%c#T^g9!q+E7g25hDcpGO;_W4b@sa4U z)H)O$8e#1h{*SoqYb3X4QJPwbH~NU~t;-3m3CvdP4ZE}B?RCG#2|u9o2rSR72F%%k z<(ybK?^u}uJA5nFkc+I%=9h+kBXDVXD>4*>Re^2-p#=ZSjRKnaf(I%@tr6)~3t7hb)A-Y%|{?c+#V5K+8PJkrS z!b#N?8d|PtdMuh&wTGnfbos6)=yyuE|EB}%BnW@^{+sybSGQ?(25h^oz}D<=2Keos z=V(Bpn+ux@`i;F`A5{8U&<>0U3z{^L=FEHtG+vy8KK@7Dxh=VF>p*nt9mNM1s`$u1 z(Eoql*<+DFHvr0>TauG~i7nBxCzG0`ZZtrJ3!+>eklsD9U1<#iF$|r!*Wj7c(!Tj` z-cR97h`sZm?bG}=I5b!91#7~<5(Gns<8{yrHqvtk6goQs1Fk>+1}10L1OQe>(+R|zG3u;KP3mR z=mjcnh|+5Rw8zOEz20qZV{G;UbZK~hD0mj5v8sSkDW6-aDAz^epfu9}#$J6X)h$L$ zPi=Edz5Gz|`?R@GF~(~9EqpIc)jxe>*54Db{c~Nt2mL;RvOVf}^g7(1ze9KL61?C! z3-TD#&(pH@Q^(Z@{P^JDV>-`%E#-e(l@SF~S4?wKOcE)Wi7wG0Q0-mG}3&uD4Pu@DD@y{fZR zDh3z$WAUJbbE9X$HhzjfoHu-e7Cd}OA?fNLo&t(aLOwQX=5 z<5Iv^Nv{Th3$KcuOU&9bg(W%R1=`p=W_5pB1N`8zMt}LG0M4SdymXbN-YMu8ZekFl zH=?FG-?MH^A>0tjE;Vy8qoE#8Sasm^obgJEx2JyO-GruINzW{2d!b`{+kt-pSnRmt>o|c>Sz63&o@(){BsIn|zIjm#6)F|Md>R zpjP*sNeVj%X&RUFIs4Jj)TDSu(XCyU5lqH@y=q+wT)!8OPys_P1s}?KNl5Z`X^PmY;3+>0jmQ@fG^k zndT$60EZM-p?|}4$yxS2T6CWyc|#d^9)qW{6tMic%D#{J>v|N%Q3e;9^=xvT*;`I& zt2FYXp8hfH%%HuQPOk;q=7uNi;ABZ_ug1Osugln@jz_f9U-4gpd2KA;Uf@48*AW_)fRjr zF$*sR%&MoY{0UWjSKSq;ED6B^e3ylJQ79l!xQoVgv&0JSGN4WR4pA1rPsnM0UBoho zWf>X8#9#)Du=hYj_lTSqL;!`LpL@w*&1}IVG(L;OmGG1T)(kK zPLFq7=G8(#<0e^k#N$U5z7i_;!il4;ff_~1IoQnxRnI@qkyr5d(HzIewHwmosen~4`FjxbvQA`lWvBqk1zqm+L#7(6c2EieLo~KtwZd}fOzUYMa4JDu69a*%t8|iC7DGVqB9e4i-{?(|hSFNPmT-`P(^2*9dOGLY? zTLCM&DW9a2)l->L2umE%vR1FUuV^rwBZ)(y*p(*>Q#yLB5;n30Wvn=0r}53QSEgR} zOVc~d@mW?;mSsoFL~gLFBkFBm;*Ylmj+&LM2-Wqegsf#~lF+pk%V2m*#eGI`dA)c- zKIJTb0n+_z;;Y}4AU}71(7Afq@5`I54ko{?OLzDzslT7R(LZ}{^N-HDcvtb34Bp7# zW3#Rw_5Mat0H*;Q^TdX@jU_HCUqK)GSaUg!^y_)@&!p}$p`qc(>bH;8q~sy3#|%tg zXR}!yoav1MK0}9-&&Z0&E_gEdf?Ro?78n{5S9yUdZEHj$CP%<2 zNo<$~ov2!4xmYFsN3fBoWduunMRTbfms8YApaYmPTC46XVK4_+*n-xyps*HjoPB|W zg(iMwNL0B4pV`;FfGk*To+0MRR4L=nQVCzcDGBOLvH7FqD_AR*QPzJKki~cjkP9mI z`IQUU*_szADA`r-6)RNF**qk{mER5@3f8!Zw$x)R1+VodON70Zvn)QB=jrzt?{}z- zMP}-bjasz7^Y!(OTHRD*UkT^lUhUr3-}+4ZF5=%M?GXyGwZ=VG8u>;bAJquw%F7Pt zBzF29kabR4x1{kZ?NZg(+kHy{|NSL@9;yi5zmJ{`N#_#5A=i9KWd|&|*C!vq95gpK zrEGL)I#$?y0ram4Tokf4#&S@@(#g{=&QKlBCUP$I@{UHl$-$jg4#TfCtc;^Fb|Sd( z--0?rMrlq zua$nnSnfY^GxXi0^6_fYMPVFQ-MS$zb%bYYBqXcc1I4v0?5@tBHQCCU>JzPsWEBRi zSO8De>(e%7>+eBE^ap#V1wA$F(>m638PN}2$CpR_WG@G-rrC_I$%(7gVXRSD$Enk} zXk-D*Rpr40LV#>*|6fdHDUGm>I(3x$B0&AQ+Fh{HzM8szX&$uh!c<$4y8)`;BT0uO z9Hv5WqXICBMpf@KwkTHP{IX)88P4Ekq~v$AFV}w>P`+IVHprq&UFlb&|MG{g ztsR8p)bpHL!;{Qn?nPjRZ<~zurlLuC(!7##Sy!eSRr7iXT*c=EFEt=u9KSx4xRc%B zYGQJG@m1Fkm5Z@DQEZ$AA&hZsbD3+{DvRSlUU}P*{&z|6-n-th_swy}{a3%R{=5H~ z`u9=Gz}qtSMzj{H^x*&RvRO?zD)FVcgLl?_ujbxGQNihS?2hFOcxymOG zQ)Yo1)NbCSNfnWOYVO({nY3Z1#?Ugn2 zm8NG<+!-J(EYbZE0yhK3ZSOmpZgTEX5^II>aa}^d+J}Epw%Jy-J{HY~=ko zKBhbtdj~2IPw)DInOVn|jz-&h(NCe+s-t>eMoaLs(;|;( zuL}xtR6z^7MUoV93k2v~&_GYpl46Nis@hVhaNV29JdCI74#VbR^_BL#r+oafKBy z5D6*nRoq}2Hv|^#pmZS;b5{iJ>m>t|RQ9(76+FS{-Z4s5r>EegO0=*M=Vodc2qp8>uS-@UwO#&7XeaXJZa{l9%Wss!`^4!Wu7bt%w3TNK%oo1pDjhF@E7!P2nCz?LHvm9Vf|eW!Wh2cWzISt+spAJ@(0_~hUFkpGE@)Um~A zt2WWy@jB0dSsKt-0~0@&#l*1eGVNb2=rBcomRJ}%TQYg&u6)zrm-tEZ~gBsO#TG?1M!Sv_n!;?sv$ z`hLM9gL*`^D%6pa)*X?!qZmdN_AnYRTX`dU+pP~R@rls9jKZ82IuuID7@LC1GPDvm z5Twa(=4vrb>VVq;ccX)(^}I7l*@p2k_&V$~NL%qJw5XU_EhKU$mx;3r&0;lTFIdY; zG_OMOyd&_4_2TwZEVuO*F?$VOuyR|HD3)n2z~gGcW~O)@nfPsU9?8c?FsB*fRaWY~ zD$~*gr-G~nl>Ac4P+QZosbelkTfIBU+#o#|!h)ye|ByaE{;B$Z;;Sd@NqevB=l4Gh z6>%fNW&P`#hjBFg6MEpRrd7o{rE6>~gh?a19Je$6fuP0XXvb zOx;Bzp>l-dL(51O1*1pJ(~)IwD-%=l#!=*7Fs&PT&y7Y@;m{7@My3W`!sHK2suyGC z8f7fhe4nTq*UCm8Q-IiH7<(=F)D}m(xqhBu#nJN$GHn&yl{FP(jvUo~O(GW}2 zMqj82!Jal6nJiN6a9Smaa<12VB~Qr9OZqDDJ%H^q2EQ1vWq9vxs2Vo?9k)H$6JBA! zE4(y~J#z|JW$WQa>H3c@hIB=ot-)8zEiYbdnASWBvh|(ea%Q?4pI*UGRiAk(w7Q;n zaj(!d8>wE825%n)TSh^jyDaTXTkaknX3krmTW z(uC!eMt1C6r^$?XpJ*3=l;ur*(x<-S$e7kBfSRX+VhoY1kAgFT$+}RZk>vwRgkg(Wx*V_z_*eg0c8VngE|fq5}$ zrM~KM7X(#QPThYcvOn23WfU%XyvL%%!@m=;_AuG)YCM|r#So{nGe{0J|H0}Ib zRq>yfid*GbE>b~V7-%n78LC+|3Y2frP5>vw6fKe;Uob7#ZIQLOESO6S7>ukC^Ou0D z5MVC3O6Z&6_}zrH5!T>v&2(?GK@S`4zMyxGy<<)%%q~4|5VzHZ$DN(e<3xb(8H+gX zbAI?PBx5S$SuuBJ2*!7ytA9UoVtOp}*q(RB>i0(%4colV)7!C@Ky4_x!JW)mhW8yb zzXfUAeG=U6i86EF>F?NW4(y0OjgCg<+_CRm$<3hic%2qmNR9OBF5WGFFnb6y5ra;V zVWrcGhp6~3bcl?Tefm!a906b7Da%J>#lcpk`*AQ~;lPQJ6HGAdO-L7-v6MvjXobR5m<>Z`C;^Tlb9{cF zz7IH@9(;4GVPOx-GfUL0E+;7UL(FNl023|*+o3yl^!^`xi{D0*7r!?3`TfvbSzv>d zL;=+3Ur6czVokO_nImw0r*WSpW)0^1c{ ze?yz`NV^eeZ(!^?y8dU$;;jz8wrAp6YS8uKKV?%?alwOaIg?$KU|*;Xt#eE$j3*jt z*8VldD&}DKmn8vVGv9cCWqLaYjGEm7a9dR`1HFX+{rLAKMZYNWuO_TDmEJ$6c+_P=Rf+f|BswOV7FL=+Yg1RQDO=uTsOlQod;Z zrm-&$c#2Oo&dA_gQDDKzbh@lvc)|V6B@*`p>`7=AMjP-pJHzA#8H>eC{lIe*%pU3S z+DAMX2CSX9uZDxM51O1ig2$OKZPe?9Tb2!;nrd>|>*N{l`7OHjf2<>X1dKh?o!HG> zd-%MrC5&~(d2W%N=zeAywg|HJWVVP@y}<-ILv5HTBSWo#B?B$O9_UN47_3V;tN;@Q z14b~6Ats`N^X!jt?h?T81&Kv}tg)z3wmk^C--7xnJXDrOwkj6fG&RJV!nrw<)b;mL zet{&s+k5@1e8>?M|8MYzm1_tZ)Aj?k{gMrzxv(+d+rzx~Bxm&86&)7zoz9L8j0aa< z?PjgX4O+&A?=!g4uA2WAn0ZNh_;QYXX{h+tG4K3LYJWm$e#Y187}UAn8mUnc;8=~N zt{Z^%y z^LW7~;d5W&GnR82-Z%|cnT1UgZDpTV@gm|v^?vu@gWh|M z_ufvG6T4c?3=Q)}Jl>o)E}igTY{qBS3-Mmzjlk_qgWG#O;O$;s9x124-l(yszce3q zh#kAga=Ec4r;cQ~g*%0R>jf9;pspo@J#pJ7HMvC43e_Jlnzy?E4RD9n zwrV-*`tWvb>re*VUwNsC4ZntS>nd+_v?j@opq=AV*n5^e$~&#yEw%^JL@HHxW@{L~ zfp?GCxk`S9E`m;P3o^L%0Ktjlmo*`^Fb(z37MAR<0?L1M ze|tEx6)WdGkyXOERz!;0Q$5CUz1+joR+KLj5}wnCnXcKLCkfQ6-O83vnz!eIy%?HD zzgz`PB^_ZAq}U@}YScXERsZr`yOD3TPThYRw0?$N)NHq$^o~^VOrOjar-fG=76n>U zU*inXAm8gLibpl7hpBT!i5zym5x2X6e)VKvr+LI0Mh`oxSM8E^X3Wp}4iYMKLc z%ZCM#U`-utl!i@#4NO4-vb(vK;A}Q(=iNS`b(*{)$7azkB{n;IZi~^-GyHzaeO`DT(MO9(ufvDXQ%- zil??TV}4rOwjI~DZ67^XjY)OAPHrpwQ{{RG@y@ME05|)_nyCN~PE5<&hn~l(c$tZ> z{iFkVCES(KEV7|0q?Y!-onhGEl&hR^EVBAwv~oPwBle^1f?m+Mz}8&NZj2st*Hex~ zk{wmYiWb@G41+{!4+M|9j{63W^Ic|hU9Jnta--WWG#($t%TyI32m)Iqh_g@9=BdBNFUw>w5Qv*^yBW_pTS=u zszQupKIU}|^5{h0&;ibBQ(^O(>H-M%Ddey&w8IL&bJUB7$F%1yKli0YznZYdF2S-q z(Teacm-E<7S3@eCH{5!Chb~H3fUQh=Q)Ol0j1tZI(tbq`6qr#tvcq^4l4gB$8MiZCb=xdz)`=2eTX6%N8!uYcggFW14G{+$G)-yK z_fi{`JuZZh*==cn5PC5hoB2u&xwc9b?HHmYd)2a&U+!(DuZAqkX&D8QoR4c49dP@Z z6=!~owi$5y&#?ZgVFO;90b3{5@N|)B&tpz^Ko6>*+GQ7OCqFm)dlsAX%g7!9Vl z2CW9TZ}z;n>n6^_H?8{+p|-oe_rRER#NGFnwe@}M-thj<_O3&pF?oNaiLj~9`J)Sv zcTYGu>+Q~eMSEV;*afn7sLz(Mvq(tcq3Ihzit}{1q)D=vPMiVE6Z51iA2{%nBF(R{ zvpplNORE6NRg0j+_oL7h;BVB`6;L{*c zn<5>afx^lBah{7WX)fv=Xk^0L`J-jQdOd#UfcL7tT4*(_cVqa7cZ2lU4A>jAd|ASK zUu$^fRiwbTgoHhrl;^*R(Yl%WKBDUN7$y2k*zP>|mc3_#XSy4_2X{;sdh`%lt5Kk7 z*bIf^^}fJVUDKH7;-gD(-iT^MmjHQ~>&g^sIGNpW{REFv}G#hzJPV$ zi_p==?12hs_tkKmAEUH$L4!#k9ojt8eX`fs!cE;JKKZAp&XFmU;g;s=W7(EX2> z9f<(C0Z{fN$$B%kUUobwxBG$S&2GJg+A-B&G!oJK6q)2ho4g!9HjRB$=@=~b+?H^k z$I5ZgC4KlRMwRM^XE(+nc{Zridz-5i`?(6slA_j`zjk9z4QwYfIrGnC?jw`xg9od&WV4Ets_jm!h&#p(i>t*ozliva9wJy4TSn?v3KBJLo^6s=gqt(oa1e z7gQPHS2CqdL>M7c_64K>v++^`$osEuL>4;>d}Mm4M22nSLLgSUJcXp6@Rw`|cXU>N zpebV&TU6{gK?xf;Fd(BsKug2kEjWCWVq@9j*2td?8jmyLWkRB}(K@~fJ)ahtKhEh&8RZ>_sY1pwg^Im9 zd8CHW@o?TIDCh4f`_%ka?*A1hB!nsXoVqM{G`ATKBC>muoF`kt98=E9v0xE~(Aq@N z%nb7Lue+?im7DKV{V{+oZ~FPi7%*ZmdB2N=UZr?ThkqrQB-&J_Q9q*jkCYYWK%%npVC!AhdDI*0WrawMV`6I>INO^-Fw ztMHO^MdWE!zg6Mk!(Kyw4y)GTck@;7XbopUK~@Sx8S=8KjJYicc?ldN6ys7u&k~PT zfM`vBo0wLUm(E}u>1LLxS!#CoHh8csB)+nMJg>mir$1{!U|HO+UA}&zt>h3ZKR5vv z0rglS&$ZxlY{@(z?<@n8OU}i(Wo)T+?oPD^Zx#2w{+#G=t7~`kynK;Jxz{p}8}hRd zDhoiBohk|O+9iKxt(FiX*~#XWg8>X@3za#JLbHeIJ(M{1EVyS#{`W`+>kZJla4DtbWzp&@D_wo_WUa6I z4m_{_Nlh-ms&DL8=@7-$i`?slD`_KJE1vf-Nyp{vCP#Wp(A#}v3d4C_M5DK$4Cbr> ztU5R=hq5$;Uv=X+fYR=1GJqp|rIBwA^7~+;-M78Ljl)?EC`D?FkV_y%cchc-=}Po-!rm%o07o~+ z;!fQ3DLL_Du3JsXJ_-97OeqnlJS9|TIup%pEnV)=m)2qI-C&WNxROS>9&^^AtTekU z)Q*uztQ^}aW&zk_$wpbnXmid|Rw)R=D>XzdW!iaADoUC{m59p$*fzQZBX_0E<(peA zykL$!=vxlY%7s=e>B~aEY0T`Fx(uYZn7T@J&TkY~${tucp#p6)h7=y}>9#Xi_m7_x z^yP!V-fzWh*QDd%!_TMsUkKh~NQ%L%%N{=yOJ?$Fnl4fhsL>COnrUOm{i+SuvBl$h z$K6Z6#Nezs7iBqM))7$Q09TJ4D-8!7rX#bZaSNs_&1=%7!D?X^=+T@FWmO@jY|PbT zQ%Xa-PIwi^f*dzR5slRoS(|@8KNOu|5}sun!|)WCpIRUu3uLhrIrA+jD=X0XCt@x$ z=58eEc~V5;&LIYpOmLjgITn6EP8`v!Ea-+M8h;naR5-xf+TCd2j@1h!g^yPD%qtoyr?^Sgop zhZ&5IkO40`VRi_s;4p-m7DlCrziMoWD}+gGlf3}RPH(B%%3WF<9dg75w^xI(szthV zp*bCr^ya`$i?yi3%zzDA)kc05(47L+#BT8~?O1}U^}ZQqLdJ`DFze1mr(PWBO7Lu+ z?Gl_-3d>mQM*vsrA2;(!LZh}6xAt{q>GceYE3+p% z=B(5cN*r;VMw;XJ?SwBuH09I6Y^`-9tr));Nv?Us4D@ix1?nQxP*HMy1@z^8SVv@! z_N{#A%=o@z<9Ql^&4MATF-ApYqrLl{A@I$Bt#A??;8>T?Y4BoF?9)k+jE?P=(gG0k zuB`}YErlKrUr9-$0MmP>vtLZm3-C>}SdsBw2aWj&e(7&SXol$qw-w{fis-BC`zC!@ zg9-;h1`K!XjnFf6W$dFp(5z9Qq1)t*4y#2LuoGUTAzYP3p{j*byclQ(s0?jd9O%&~ zMsSUo^K+h7e(Wl=3Z=JLbuL!07Chdvbxv=kICRF?)-Yztx-e{{%pz&Q;whA|o&q^4 z;Z`5JpjA0Xcx$6Kbz$P?-~x!onAUP9+S;~qvqx5z1#2}y4!^1~XSOxuN5h@Id(fK{tsC~u#ugxwr^-=SIR>8G6J5zh@Heime8S<%fD;9# zxRnQ@pFhNa<<4*ac)&a094;@2!)*HQrGSz2Zf*Lq(cTMICtTM;hD;RLm1bK{NqwUD z3Jk&-V+YE3vcO?=wBDFyTv}1=Rkmp_t#lU-P()M`h!<@KRNam$>=S%Kfvi;ku0iL% z6AJ;WkKC#a4VkX2L0|okEa=CuZ1oLl)GGC`VxiKjEjN1@S|gYhmTnlie#!L%nhzzG zAhGTdYr;{@87vP#+Y3UF)i9NlVT||uBCri-h=B&z!QclX3vUjCx%^ls_!SYUXg+<1 ze;NfePs)2y2efrWN0XJOvtp(QgVHX3&pj$NJ+I}f1^Y+gV&@H~lrYF8JbrnowSOt+ zts|Ys)#HRj%jzK>*|_8m>ytw*hbI4;Jey5OJQtMA**$+M0%=+p2YI=|8>T5g*;#Xa}Nh^3Vi?T&jJV7k;ie^wPu59w1pvoWwGa2)zG5Q zn>>5aDwY$5v&{U}<;9j403yz z5t{`<%NuAHdc)!OYBW|oo76yCX{=X+K0i>W(c7V-sA7wHu1g?rr4V-_;}?``uiN0c zUPo$K4+N_KFs^u%)M!B4v@=6(1fokD2T@@Qb77DxcEJI@!^P+ngzlDqD2EVx78pdD zF^z<4A5J93OUge>fV%n-Gj>f+Tm`BkAfs>{%Qt}np85~?(=_;V>-369CqhoidS(Zl zgsulEl)*U{=+723&U8B$Cv`1L8Jk|sZ187$al6z+z_hVc?rB#XSqiA8clu8~d@o_Y zH&|+ir*C#{<4TmKND_>t{Pz>b6<2L@1}ZtW!W6YBqIz$~_%DM+BB!-`0cM4(t-uRL z4oqjMLM722zkGSbY9LyA^u0@}5zLkUHlDmy#vxb8}$N-4Y*K`Te)FvS{Jr5a2KG23Dd z3nq?){AODdF&?f!XA$s!kr0c(z%lsCP#418(~QvE1Xz}g<6VKXgnrUsC4j`x#FK zA;IRSgBhV_Eg|gdm_d4H7o2(n%a<0b;g@`yHTq?XB$Hnp@2!Hg9RTjHRN#Ghu-Ixy zG*85k`tum(f*(~=HI7&=L+_gbkvggd8QvncAvgng1XoW+L+zsy%I^#_ypaK>8_f5w!ETny zl6~~njxAs1RCXcj+qp6vS zw>!U$^j43LVJBSXZ=;`#Ue*;M5&1WNYARX2o8xWi?HuC+66b2G47fjdi}OhGOdAdR z>EOG!{lV3L7xr*O$a&v_|89MF!yCk)V<5>9ks75hLeq;Fv@b2Z={DjgpzXB?6E$Em z!eS<)BgHLaRQr2Fuw%L+;WKjN#Yg@_+Zil3(%dk3`_7sJi@E-fp!a{gWUXlu0NEos zmDszoH0l{?eb`R`LH1x$laxlf-sHtM^uEdM5F9#*iiif7HF#OW4D()M@CNMu-Qd)X zH*Vucc*4F#PFoMvehYU+_r90jH8VV*mYc+e0ay0-6C29aP{cL~d{DmqJ06a8-rfN$ ze0U#pgO(|?EFgmojpS{^FUJU0&@H>w7inN?PvMqKxr;Fy)zF4ak{2B5NrnrEG>2-G z2qSh0qX&+e4Q)cEeMIt~eWUZ_tX|XpbavWG$N1F2wKj}weP!~F+VMJ$Cu!}pG-7c= z{xl&&gUKw-hYjhqo5y;SkYHSTfsoc*M6S;b#^a`F1W8l0yvc43DtY#W4L8>PFrsL+P8{zVFu2P_Su6m*3d29@lDz6DJiqV8 zhVjN1R-AzHEK}fkvpQp*L_cM^%CIGBU!$s|sv5L>lg3rMQ?@ z`78CL@dgxUn3+bWbBrZj3uWq6R1UfegFf(6Ko0&OrArhx9(aisbJ%5iCW+s342R^Z z$pP`GFPj5E{ap1ytzUc+uun&<0zQ)Wy0j|(0Oa12b*ON+nDQFR=ueH;yL+ntLZ}2! zW1}vZAH|(N`@tpim6tXHU2VgIy;m-tvZlhVJ-Wox6ZVTx)G1nJzacG3<{{gB9B_3P zcGpee)V1O<<0Gg5lM?=ujk~x5VHwa_0CwN5a!uXXM5}*)clhtdvoHLlu}_fhx9dxT)NAXzESO zme{(i&XJ@VM=X?Rw-?>>8?~ zXX!Yd5cMo94PK`8WRbs_*K(n5G#1LJtrEn**T6wqCc$YG)dJ`SQfo=;`HRJHFj}=a zlgh|6qFPO4>qXp_qHdFbRbjW5Uz!_n^;#v0|5lsk$^J$I3>z*{%5&BEu^LMnw;}wZ zp-;Taz}18&gH)9~q?$mp%Fgq&84!_vk$GH-mPRYvr3P~!!OU4F8IEBmk$UP1ddN)K z@A6WK!X=M32y%_LcR*O&f%=P@_6_4 zmK$9sz0#hJ7wFO>xGlJO2?uGc2c`l45iws)4i9+`Fn7n2SSSt%|0@# z*rufQ+aBHmOItZ75lqbX!e)>Z-3NY7%uH4Ox{`=EnSe6Bd*wcIQ!QrS$K1vW zFatDZ_)>v+;B{!N*bA#UsDqx3CVqLxhmA>OwDti@*2=eW4VX3&rmTo5Jsk>I5yB0- zG6Q6%op}*#dQ7$BAgav6pxjgo70DEo0G+Ci*xOn)C7g0Kh-0 zQXQUeA^$|ayC(^(_2Q1*;oAkY_AII!bpf%p5YkTgX~H}^jJ&#hYm`+!+?Pn5>>I+C zk72G=#hf#HRpG57EA{ObZ?)cQpq59R7HNO}jLQV+$MSE?W#4>(kg?J`Y(+o)=A~0) z3mygv<}g&mAguwpXiQD7L9z^hop{K>?OI+Q0w%$KHoo7;U zzF5b~_H(4Gi6bs zvw$_~umv@2Ji+1}L)MzAMwLt28htRCvreRor-q{af*gkKhlPFi%P!s3`haL+b2q75 zhRWzy16%Z7qH+Rnj;MFot>B+$XZ13Gq7aKWtQG=tz(w<^;|s*vSZSrj zSF@z2My0D=tRZ-?q18$rUs4jjT3$BXQg*Qd7AIQv?lD?treW$G!3etpfoifw{7*zWZ!{lAk->FyC4m9kEvSLKv~l>%#fDX$32A2xxJtJ_OI8qNNy{oSXMm#Z z+#wv(>TgjTQt}m9OYOn$mpfj9ENjFs_bquta@Kvpxfa!&jHNoWB(g&B+GAZnPjlPo42o&o43HN6mqZ*MIReoZCC1S*$b3{Y#1cA$pz1MbZf~Z_2%AK(ItT!kAWJZO}>$=D`{pDBTaMF1+~~crV`!GMvP2JVmQcsjMlR z6(3_<4~}$0??~J6@zrpxrt_%D=WFIre#JBmX(IjCCl%fd-gU|Wo)~zNt@6q$z2Sn<8FA8*m?~0X;{Stw)fgGN|t^>qfL@uK>sIpMP5Y7utPs@|EPVq7qrL zr$%QEtM&kH0qYj#!loO^RK3t!-rY`7+@)4z2MBN7+BjD|NmAe4@O|`<8Q1DRyM(vf zG>tN~+X921z6-GM@a_zPI`G>PM!EY&-AYVnblP_xu5YJ0(Fg@y{gYMSzZbnv9^B@B zb2y|bcOA8F$7(!5SkAhC&X%=e7@h2vj&|r8RtLKMMP_e!;=W6?(v6`@SFY>DEP$ic zed8I#Vc&dR_J91+w3VHW>iNxZE6pX^5TH0vi?Ys(z2#mOUe_o&u@>DgbhYVIOSWWK zEnf_^)8>v_3lyV6jbSKz?2MXY`D8o;b|-t;Bw5A2^R}N?U$qt+(w4R3KRc_;8w|q84eIhO|2II%5`r+M?A$Aa zrnKic52}H_ylTFi*&&@pPO=|6#)yl8mI>?9Tx-M>u^Y;dbgx`)(xEy3i zMP-EQ=Co7R3es8x%P<%ixeaGEi?z5*FkVf?vg54Ux&e7HXwP1>(=6%lz8{ovAN2v; zbRDL3Di^nICW>@H0t*lenzz7Ozy&ZjymrPO`;dZODQu?iBZK4rLfroX@wFhu;`(sr zCYS)#PR%QO+2W?0VSN>45|XDK0_=!Ed!ABprqkEKV*4tKY`VqYFQ!>M zWTz~nP;E^~UfJ9pg{raF46Ct-Tuw5MtLjrFOYJV&u9usLtk-!b*xEwol3o@C{MUm1 z=Y@2goMsxr5h#$UV2n*jAZ8hNo2IYypSKMyBQr)FnFF%2Be_px#eDEoHHU%WCd= zc=;`b7cE>rbZt$*@9#zIUJT+v1h21PJ7uuek;sS4)&aQM608~*)oGxht+irlBW+de zio*;Lzr$Jjx;{D0zb0t>Psn?HV(N81a5Y!CFJ4DAjk?xwdPEg;?KH-}Mil2(JoaIB zKVD6PSWEW(u>*C#*%`pTqVG4f{kqA=4g(xHOZ?<3+Yl^14&Y$F*>Y-QX~?SL7F*K? zo*4bUks%q^S{%z_0er1t+XPg=s(eqXSAteh@df`m)o#b{TLE)r^;VSSGvhSM2ntNU z_EcyeI)I%q$wlTjZEr-?eNIBZ5WO$QS(1smo}YSk`qDlNFCK68ni%}SiT*ge*|lEW znu(?eGpWpRg=iVW&5s{2qmB9blTrBpS_sD zi-q#{a<>HakcU<}53%WDrT5*DCP585Cw05qg~4u=bw=98W-332)4QxSNriP#yGi}J zt%yeUF0W&JcADW4{}cE6IvdlyjJ#3Ta$VT*x^(Nh3mS?@WY&JPg4+)cZu4`kTwen3 z9NcQ%JD<6DSzBaE`U8jUla8Lww0^Fw@uSO=+BIdiTxv6Q+DXWkP1CH5H#f2=?+h2l z7qgPhcHv}>aStO?t&GVlgVtSa^d%JApnzEb(;N=I{ew-j#9^0_9GQr&i5q^_h{aP1 zVxe2>*krU*Q(bM{9|R|% z41Xsz^_|L_V)y`0pW)Qf*!2@n)WC^ za_It=jP}l-0uf^|aoN2fu4G*Ar9r)P_Ttr&6FJpyi;gS~XJNbSb}qJPs3ILTU@q=* zkJ0XGHkN3t=nCFzx&@iDNYK_%2ug6{aF%wH4Lij{S7mv{Q__5eT{ng}s&S_#SUwVA z2G;?By(Mw+A|pO4@sgDEZ2ACmb65AYDrXJ%IwY!dYSP!^4gs;3RI0FL;okcD^>CuH zXa(YcVTMeQ2n}z5hk~#~gVTtGwGcm0qVJ0wbDbD*RopMvs%ztQm;6v`oxS$KTRz7O z%09TL|Na5bREjci0HzmUzgNJEh|S@cCRbtUTGjD);L4XlSxW3&mf&B7>h0gLcn$E| zz9m(EQVa+~^!;i-wjm~nuJl^y)fmxfL3pbY?C>Q{mrR5CkhMjx^@v|IVPnJrJgY8wvg8`P7g!tqorE+#HM7sgw;SlP5y zl1vBOhUEq4uaB%y{P+7PNbCcG783l3u&BrIpL(;NKg9#tjm<3o-q`y@FKrsBV{azM zzMTVazinmhayfoNo*$)Vdx}N22M?5$S%5v>LMypuRY4vjm5Jfn(wy` z+a>kZK}5#9IR2(^?=G^YEbwk(Qy!wLp7(OSw@fnG?~$l znP3%tK|K6u5n{i;2I_du`eUJ+6>80lPTe^;>13&5DqMY5=bJod{~W0?sLZvV`*h-H z9}Czf^_U3rVyh-{wWn)JTu}M$M%q1BF}lWM4;YCpdx;1_FLb;im|u-|EJ}>)>#-Ib zMmn?=sT*E=SO~aAW6E=i)*C6 zh>=xP=!U($18RgxAE8m?W~^&rt-Zfd_<(0fkc;E%5rTfShr;Q*l}0<;NFHcgg?f>?gL# zu-xJ=R-f#|inkJRac`Sin-`2`o3H@)*7$4SCEKB!YZ|qZ+xYL;#oHj*#7kv^wF;d9 zi&0B|{W)1^X1$qa`tDxmF+?{~^!B<;I=aUwQU3BcLY@ih&TU7`V$Wu5=IMbAeV3K_ z)98f>drQmHAS>@Pp)EyfF6WMQVPno(SZ$c3Z;;)c;5M6#yf~^@R;~;J`^F#5sSfg*5JFe7N^Xmb? zx<{+P@8J0ocvT;?393#Y+?eUbp z0xJ3?D7St*bs1j57L&gRytT%AD?(4Kv1`_;Qa3Bt+X1$pA{ReJJ>~O8J1pPnn@(AE zEK#1tC~3DI+|iF^-7RbwC1|rpnYxVA-7?Z*D+e~tpQ7lgsOXkDZArpdUy$Z$NG$W` z|4{pRD|;<4DyWR7V^6>SkZzng%dtmdr>g3lc^1X_aw5^S48Ai zf%j6Gk6RsH7g;K?CpQh=8WOacv95gq(}B`Ng%_Tu=zK878!O)o&UR5(HFKdLD~h=M zXu&!b;kBf=Lan(5jChYCVDmCcmo8OYU$oSwsXr-wTmqxQexs;; z7jm(_6WGFO4|MZV@J< z6TsOcjkZT6IB=ozOjCHY#8|5-64nO)nDBQt40rQz8%$tt(j2!%BPVy2X@8Gcj=3WU zD9u94_!JS!o8a!CFmEUgwj1upE*Sr99Q%W4;kvU?M#k91Yr=1f`?;>*Fsr6pql{XZ zf7u%bEWuN!Q=ap^=qs(#gvM!&W;y!|27I!f%@=4jQl7A|Q#@9$^#=QWmW9u1UEar} zj<;^-5)`se`B!4}ZqV*&sFE#$q6<`yIp&dxM6R9KPC0pNI8tMfDVK2$e>=ui4 zgEqV{olIPRZ&uHB6XNTl9~)g76_Oc`4{SEm(sCM~yf2-{F08v@ARMczwvHnK#$c3%}>?l<~=cU&C! zYGM*_56nbTW;ZSnYehFW?;&r&MP3%Np~YfUvWz%(6r=Rv#CuUhZR_pDYO0QN!UA1G zI~-$R$dZS{bX*v@GT^ModNn5#h&drU^M3ld_4@3MUgA+U#!|tNgnJN>nTSIHRm4GB zqetmSXJf~T-3WcQi`r{9TB{Na+P|c9bz;EPBHR&H8eg`m<#y7_%ezkfu}Ez1{8iTO zGZ5EW8J)-IYBqCi>y>_4>X}v7GykC?uNk;O_xs(o%QRktZ)FxE5Q>(t6|5Yv*YfoI zccAcVgXwBX+35CYn7Euv&#$#Iu+`W}n?d*wPc~9Ee7ej+y4dgcYwFdkQwtz7nxBL) zbWP5Ab`HE$)Yd4yg6v%+ZM#{8VX5L_sCVbCg$C&Y$@$kO9%$rza-TNjzFqi?Wr0RmZOR&h{$Omrk` zvNlCfBvuawDdVoy7Gp(V)gA;s4coQaykp#h8+h2mB)5XTH5pP|Tr{&_6J(|Sp2(-9 z8t`CDE?l^zQWan{%)ybBy|&|49n3?m_j8r^Qw>-K>8>j9SCyh)Fz}TvN-wbc(j=^F zpTCv`Jm->JSFo1`LC`z}BE#q7;Gxr{T)g{0aciT{yN2D#)m*B*J=vLIbZ2B$%(WOU z7>7zB*T|BknUT8`d-F7?Lz+b5Jf7PG)YqFsomdygJ-83}utjBGhwRXnqzvi6a(LY@ zaIOd2V%7+34=0zHn4wWy2brCZXcm_KHn71Q&;eWy_@=4$_bT953?(Vo2|AeAX7?%-- zO3h1PW0oRptNda>MVR#<`yyl)!b0M*!njt2(e`9$M}n^Sl#Jj|FhiMXN6^lItpMRB zsGPPTdyJ{d4>!_e5@}6(RvE0VKOl^aNJ%~;pn|TJm#;%~-%LC(3B1UmLK1fo)9qU# zV=b+2s3B7ffmqP z{o20@7{6Y=F*QBV-w=E6V1#v76LgKL%$Gd}46jZmBGNR?A(J>H*@K&hRj&4`LUZTT z2(hzAd9RSF(NzqqHH5>5s4peXYHwyx+`X>p_25Qz>tZ6t=oDD`b8ig35;zWu**FNL zlP^>Hb0GDhlvdh#4^@^q@L5`u?BFO5F8ZdN9H485BzLHfi(OktC0h%)0mv+2zeMTR zwc)MYODtD?)DUBJR%g{44ed|5KUbKY6VW{lP;t}y`lPAbcbPjuHQd}-ocsPkCrtk) z)kGPIV7iiD)vk%=qGa>I+9^z4(V$!OX0p^2<}PRJrPYd+%vPa2eOh(hKr4;3?ao-4 z(;BKg+dW{4@4;8&7D9UsljHaXM4KU;8K_1+)j@u5EY8!6Tq}NMTR!4#B;C<-yS)Tu zNws3E+)xZt&)8?BXe%1Bn4Lv9hPLc#-)_zcWRM-8wVSDiF5nGg6H>4G{+t*8SwQ$b z)c(TEuRTcc*9)D`1;f|tE;i{ec2#{}#IKXIBrFholH!~;>YW;q`Ha)m_w^5NSF+@` zk^_x7BY3DFuKWc4|L48eEG&tIa=XVfZCfpIliGGDl?$>?IQIr<#N`U1h&toxIXl3G z73XaUf>-f+i!$AB^S#QFYm%9Vcr&lcdy5?HoK(^r(L&r@2C;j`rn8VlW`|qluHe}! zp_NtTVLyTbm+eLwZ!|y4N?J69O^gPwq51~IV7vPo0P2e9o`RxCNc%6t#bCq=?Gz{F zs5J!#T$ptVc{&1D&rv6F25XNS8=DRcCded*?7Rx~bcvndHgG5~TT@!`widj1zm&a4 zc!$O81W#@gZzLzgV851U#x~yjlePO?;kJHHG#HzOGLF~dIu=vbrioK(ISsC)L{_NM zfvhch(^lx=k}l2@u?)%HsgVgk2RtOTFzCEGJe4ks5Ok{(iOlezvWjk92guOPr*WVv zc_`w@u_&GyFp%87;!p~G@i1r$mi;h%`?Br00M?;vn!B3}5@Oa}{j8A*%It|2nUXsH>D;u9aFRSEb81h;$=6 zKl3VytK7*2(|07VqwNbG6gl}sWUIyi03ZNKL_t&o{HC>tSE0U{0mnr-vFA{rxj}S6 zTYfWksmjf|OW<%vVTwYj1j=RTh;R!G9w~&f%>(-%PK{WYsxsYpZK#(rJS^D+PJ>J+ zF?+iPF-|aTR`_g`_c#{_SkhpLxKBj~gj(g=7D71;QB#*2n*X^7G)Kye40- zO`K04u;*$zHC+Ep&xY|Vbfxnb3@fiPe~g*0GNKHXUTJ-ZJ40+qTEX{o0Lu@LMhe^{ zX6`c1;4E)yNR)X<{Tda3HA}t=+ zQXmz$#h5ce$Qh|Idz3o0U-^rLfHZAAnF6?IZFF+^nF6AT%Y-oK&K7v07-%BrvYy}K zP{~30RzI2j`u1$k8KRk}fc5QiYnqH!FjKLl78&(5TAJ*$MF}%4f9B6h<7(oB@GBi$ zi5ZJ{Rd?Tsp?3H^TX6bDsJd}6VgR$MR|is}NS%H*1l-aug6i@)VBuMl%pITm z?(XJ}B6L@ssrkGpBNNQz2AkD~0_H8{5Oj20J>Lb-mfW`i_N{o0ma}Lmri8eZ$GK2Z zmW^N%N;Hk|tB9@G%y4AVmCdmwycow3RNE;jd}C4SjGph;T_R`JaUi45YuYYq-VvGh zP&9E;uia9%!QL2XBB#J1J^NA0j6?PI?3Q9Wc{w(up(CqR-u9NCPWm^3w0BJlo_6`T zO2_j;sjreEUV$qun)K}XdOT;m(n~$!jH4vCbCU!2+6?e~OJu7#tBHJaM(^sWVqUpW zSHRV*fA{ADtCawZtE8PW#Kv+u$ zzSCZrX)tapGPJL-up~>(fW5My0E;|@-M0U(S&bI8bZH5F%(+Wu!9bte0z)}oEs=50+j z&H@RQUgpmbj3UoaDw$bvD|P0X-@YfU{)#F5Yp0s`^iYt?D+8kgu{AqhddvgHmnX3N z_TB>ZzFZw0MrHXf47ju9HQ2kg@FQ{J^BNjKhD)X+YLCdbzCMZ3pT78o8{>=+!Y{e% z%(0sm%MV6cB3RtHPhAI{Id8q9v+c7Hgu5F0MFmYbaFsi8x zj|n2o#F+PrFq6f)LnE${D>PjFrGYNzdu_9TgX_%p+3zT>F)T?jW_X_xwjY@6ye-?) zs>(Dx9!l+hM}+&nsp)7Iv57`q`tvVNB5tIaizI#|$C#o^>A<~dKov%2y?3dmwhrRV zjnSdBoYmniO@VC~onoqM<;FJL&ZWvRXMGc2#YtcIQHUu%PM|PAAX=xXU3{*_RrCLf zmWSdY=hPJEvL7*jP|I9p^821*<{{Gj*DT*T1${-L`7v@!IBgm8C*-VD2?_ws&Wz;|fYcLmeCBYDT$x9#gA&YnNQ;Lk2^ z0A&JcFT_ARO`+##wm{yCvU2i#6;RO^76tvVeSNgoCV>fY*KZz*3?VH$1`^Sd0GgJM z`ikSFP(Fkbi4D|khruclPK+7lcUA|PV4^sQxL5=N)mpmWBF*mo5~uPG0)2Vm+Dq;l zFEf1EJYEi(DteqK52j^67c|y(bArSWt0`Xl0D0amvOj;23h<7v{$9J|3wOsUp{f?23I;v-WOvz)1T&6IgnXv~XVA16Zdh1di{-vf5X|;^GySm(lYcmjM zf}CT}xMOJLXg6*3qZxboFT*a*0fU}=rx5gpUxng_>ALp3)E~Z|v##a)Phh*}bD68K z)aRhnl3n*zbI(_*xvcnl55%@0XIGzRG`+t?dCzYHYn7YN@1ZUYlSrUEzk)Qa%!94) zLe|ROuvTgaT=M}`8~hcJn`NQeD@u>WS+Cwm2+)qrUb5i`Y0MWciX|Eac@be*69FH}SzzgB+#bN*|`K3CAA7A0BFSnd`FT2@O`ETDMmw|Cs)_P#b4 zHL&e5E1EZr%?)GJOHIyCfIY;rsZB%iG%s_MBo?Q!UtF_xdW8-R2lv{<`7aPsT&Wj} zQFTol`e(3|IL?FJ2cR(H)nhe!n$|%Wmoq4~>97PsQGz=%7a5xJ$AQ;MDt@WFNU%)f zt9)t7_@B%k6$X5LG1!fL*I8s^jWa{!>N3t8lflW(-TZi8E9=);M7}C$-kU|M=Ugj1 zdfs^=%Y#)sQr|b`yWZ63bN!I$o}WeN&x9DGQwvuGEWYlOEZ)dymTuHp>1m)h5BxR; zgB@l`50Bmr1V-NjKqoeG^w__mU@U4M2X#goD=|XM@MK7B1#q{J}vK#MZ0Q5 zyA7n3VLvZQ{1>3kGRo?#b$LcwW8p!zV~>OGg11nW%T?C)_pOyENs$}*U8K(Aok%&e zZOFqA$_)3l)aW-%d6L7KM{Iiw55;^FrH(5e#$kE>v5pD-k5=B%v8NAr7Ak@b}s%xjQ#bJyc`UF-z-FV-c<_qLpb)pU3~C-K z@o4N8;i2HMc0zu$viX=hBL7bu_?L>v8+yIhY75fWX<=w5yFpwZcwSXRe&E{h=-zts zxdD2)ysd0IQ{pdt)>4q?NjFwr=eY1gXxaY4?g>TVj7uk%{}@uwAHy(@;_?UZrFM`d zlHpPkTV(-k>VR#esn|7V;T86-1M-8I#c)!>4OZOE{&9s& zDUA5fej&QqjgBpC7PO;o;%OZF`4n|dn|831Y9@^D8lQ%V>C;S=-~VnPmOp`i^$NdP zQa>Iysn1C}p4*hU1Mz+N1$Pi-8rba^FyaBuTS)20jm`J8SHB<){?JB^-GjipVe0ON z=-qYUlf|AGnN?_g+APorj+@Hat8ii$o(+wIonnais5eVmmRFSE66pnQ8ae&-)?d1KMDk6p& z#Igksx60lZPUM!Z_D-KPG&xS?V?9aRcjbPE20x>GDR$)IA*e%$yM+ejzk;EIiYp2a zAl>^hGKHOd&OCwmBjM$r0NnAR7d-iK&0ZCH_tFD(^EQ@AJiq@&+qg)0w4itnVt`~#Hc>!cc z7E9s!f_X7N)glVHJN(ZM(&zu-;d6F%8|CC>+O;WU{<=8{ec0TWeBe^HD2F~17 z&_TJt2`sZW2(nh=cpLerd z?U%I~%vRRz?38!gVN4s{8~aMq@BnkV=0T6kRn*zJoLZlQ9;bavFao|-CG11%F z6>7H(yT@%EM7ik{_KaHEElVyt$E?xY+ zq-N^XA(FK2@+R?e3g)@IcgyIov0buzPKjM?UIub;CVO0vw_aB3z~t+7&Z`+|xSvLu zs~f7~-SCQNhr7<~_A>!vG_r@)C`dJDwVpukVUcdzAsVY1Mr^s~dh=n=q_HZ*ckVL2 zN8a>G?if!**(82X^6#YVr(fRemMcwB+!WkCwXNcEI$iq%oaEj<`@J!4B}nWdEc!6=E0GlrDOq1@O6j^5zI_A4ji-#-LZ=C|q)dhpTf{u;Wr4GvXl#$~0JbxJFud0KMjU zp3!wK;=dn%jt=hLx_HM+?|VSHG)x_(zxg+ToGZFtbWr0teRshK;nZ`y!)p7%zsy7v zd+uD;exE<<9wYvi2dd3}pH0kv$yW73j0Na@QF~A!_%vaef%&j%E5qYcaz0K%YfAHe z?2$y;b$08(YYa6oYfmt?>$goSw3d~298kw$s~u7~^w6XQ!t_?-Mt5D!clo2Om3{n` zAMzwUOENoCn*g`g$kge)U^gIRcVwQK!mMr zXql$G!NJd($G_ZMU=pO*Qcfp(u3Xom!6L|pP0$VD7&FJ_#ag*lD@~E@X@&dA2xf@s z$si}C{_=Q(5TeihO)<%}A2B=*v{e9AiXHANd$*Vh`?UBv2L7H9M}-KD2m2+_X1j*S zViz;Rb15MbGgVWhta{#(X=w9pjSKgyZ(1WEkA?jc9~_Bm+e&-0R$$!jJ`3>U28t2h zX&(8GlK$KeN;Ge+&$vERPF1$by*ZhyGCU0#K8dD%x}#G$<&3H)GC5lrfG~A6FQ+%!y@8de>od4hrq( zroerzyl@yd6Q-vM3~#CCISrQqjQ6dkgWJa8pJlqg*nS06wIi~Wdw{Mu7!K+SteI9c zZA2GjqPc|pS4tt4PlipjP3*P}d6V8P)h^}ov7nWzCV&6KNlH^-VMX>6X-Q|n5*(V9 z^y;a_Q5ThOInB=`l0E^Il@3FaNg@_2D)@?zk;QasXRLM_r1*i_=^)PMRU{8mYo6$E zb7gfpo;m4luw!MfKw;@3#DX>{g;?OpOFKHu1Lkh4^EZL~J>m+w;I)Ry*DKb2cP`iK zdY#8{zg?uwhm~~CJ9q|KcVqc|V^W%QaUNOsNcr!&Nvc3U8NT_(u9jB_QQ@;go79sM zO>K7pøUW0~m^|8;PL6V2Hy!WX2X0rR&+B9A>+}^@;7IXXD4q86oq=N8OKh&|BNb3Xfrr_k_Zw?fLgVdwDc>6j zdixQ3i(B{|*A)y6R;gw-g@sL(HqHXFbvXW#i8IFY{ zzY>gDEIqHpD-Vjr*|u0GR!TNGGB14-aaY#LV4df?7Y-Wee%Da#h2l0$_pb zUhjo?yY%BIpIt){(IR+Lct^>=%msPJYjM3j3!p<>W)gdE8WE=zJRJ}#Fy9Ne%##7F zOt@?As4kYjbA$Il&p^5ZrQ2wk=HI{s!8~<;)Jlt9*UZjqZ#LaGNakjK>O{2nw`zQa?8fc$gX{{e_z0hKXmN6A1Xa-vql7sHl@E?bVGaS$hBuHzw!{0yO)pM zXmh+?i?VhN5N+PL)e=LOn7jk-=becqM0AY%5svo_lz)Nz@~WfTPH$J43QOIFM0F4> zQ8$UX;2_0brvX`ARw&DKmKM@la6CEC8Xk*c>YW3cT9a1tMTaactKTAVrCS{5uVo5# z9xP$zLhdVeQ(x*BdZJ<;tS;d+t!;zlgvk0pD8&9C9<)43d#+)WJj6A=NDj1GCjz`z zkYM|)_$0Afx(S|eiZ&9Y!;3(sjxWafl_4hvoWF+b?{wE$stABaAKuk(S)jz zC$6;|fWp+0#MQqn+H)l^8s@x5CuU+(91y`)Yy<$ zG9S(ZXR7AsQ*fO=M#La7 z3k-@WpjED0_P*lajilGko;2}5VnW)?H-^{2Puo+Sk8nJChbCH?p=dG?Q*X(*-8X+< z+SN-DdGL}ISd0p)x;lv4uKAH0SL=Ag+$QVak@I4EswErU_VkpuW!SV2%n5Ua49V{8xax zm?aYE+=wwTm9C9UcBP|qP5eq3>jq7hVx*Gcl@6j>q9salFG76zoMSTV`n92dK(HYw zeAhwp*Yw!nI~c9eXGumbNh9J=yY1)ooG*c}4Gg}`D5^@_2ra>bMG?|SDMGMI)rz6e zPNnb~5ng*zK{JcdApE*ROOah?ycZRB6kbSj!NsNA+f37n=>E;I8wbD)z{>)aS&>n) zi?I5%d(vp!3Cs2Ak*>AD^Hi%b39?MJNRxG`hrLkzt6*_y_Pw!~TPzLvjZ2EIvOEe)<2VzM119+TyXVE>V9N z{9Y5_J$4~^ce69#W1)9h)#yvA-oq!gudqAsM+npKE}1MJaZjtIHPCBAX&dSq?M?&W z!waDC$qcLeGYB4kM|egqn{N}=Iyah|7_cB2#?~u|=Os!fqo=u4S*;AS$ytTCx{{_W zKJ?XBh4|aJFS}#f^1h&ABVj$^Rs!Dxu~i0E)Vf~&1*qpclLvv@#73QF9ftUJH-x^v;O zghfjnJ4Mgrm@N&1UHEqJb6nO_OT0z=3s`CLweY{pol9@y$PR@=tqUEbCIpgA0r4h_ z2K4`b-c2k%4p}VO>6?BeJ(*aNW%n%R^C1rpr;2l^dOIS6fX1t{jfa<0B#nwDB$a82 zsiD|1QK^hAywN%>8q8%uJHKvQ?f#jpM#W~Kwe+k~qKexUw(~-Hr}uxdfv;L(Pxp|q zE!kB=*D1P>q@-wDJ@498!hm?o!U^?!AwB2Jd+~xM4 zn=`suhUUdK298cFhAY!rK!b5yEEsXf9k(WMEC#!8IS5{{KCz!-f1=US{*WqW5=83- z$8E^2WPcgJJ&Du#=q7R+g zai9s(xI{gJEN*wxaHSBWwv0P!CBBOkh}5#AdSh%m?}L_m zd+HR8W!ZX$d=Ax|X+0-R&F?Oa2bKS2%KAVU99r3{+Kthm^ZDEMHL3bfb$hp2>~0f! z=RWY3Mt=RkhK8(-EQsS+cEWO}v8O=jsrkZxh)}-+=p5EV|UdP8TwTI@EH%&4(VK$F+0tw7vO<9d779bD@9qR@|)H|H)Yw#?~6^>U2q zApbn!)-QLQO?uZ`*QTQT?RH?xA}qB*TM?U-6z~*hOf*Ly7XIWabRq|NO?#k<%{{FS zdCCP}sjS>1lrfarSg&zd>qhPgamVS|Uy{4H(+C7Em*Yt6`xZDAqe*g}88bKtyw99- zD7pB~MD6T)l;@L3UIr=KIjdp6q$~P>x}8yd+pUgLGZ0$f=`T)-UnZ*=E3&kMOxz9S zQj0btwG0&8_|exWUk^gY%%nV;HLDCw`HdyWrRmq}vp z7qi{c0BaYMqEHCh0IaTI*{jjrio&dAV|L^7!ALgYODg99%W8i%+%^V7l`NiPCQ9N>Izd3etqt34Sy@ev4XTI(gpmR>joqnlyude;;mF0WJjka89jt1u~u2F4|Vpm! zn$1q_^=|T95BDAGs4$^3i$S)AxGihqx>$ySvg+J!$y}O5%}82js-07qH@H})mLj7C z^6XgF%go1hkWyH0A33Do>;5o%mfb*kE5yL+h9lW$XXRGUb+VqZs$m*C7n4 zL)pqJ=1J8&G+Zd)xwV{c&`!L)$@|o5JJiJbSVMQPl_JT#(lAP4)v3*R?@^S~fsz412SYb@SVn^`xg!s0kl8vop%+n$$ zL;E3Dx=BeGp(EwMlPoYa~M-*}KV&Z}k={cU9FVZd066 z-grQ(KI$|#Rm?(By@K|{Cso8#EOjx}A;_(?f-iOh-GjQKZCpM1NBOkB+{N9_^zAl< zF)z|J(&ZV;Tj9KdJH$#e-X@dyK`>~mZh8Xl{@r**&4(q zN>Qj&ybW1A7vlp176{fr)pWj*sr-7p{?`j4c)FV_inDsW+sdm zQBndk?V=gI4Bs89%M8{m7~4e-+I>m7yQ+hczTF$hQBgzxwwX9)4+RNRzlp9z8QQZt zxbZK^r{!o%;oPmpREtc-s-B(F9ZQ|LBJ6t4M76)RofL9s|8g;zREW~D4Be>G{)@_xHk(;|)CisTb1(XI!o6x(>qW5^X(c=4|TT=5yW_3L~S^K|NgY$TK zvbytQX73|BJj&4TZ*QO7VBdA93U?2~!^fVa=NzSBW$WRdXKm~H(%%u;YO}`BGS2PX zaihgMD$QF#_EL%8cz{o=R$Ly2>T@t(g-fWA$=oB7XCkLE^E8E&i_R3SR#0>{U$f5O zihU~jv2==vP~!?ReI22*`?#;)jImR!KIuahi}@Ldd0ZsHlcs>(>a4R#a!MP??0sc} zpxlt9crDz6GsG@b59S%7Ssl>Yg+AUU1#>gwEo}G)Z`|>`4=NFS81VA2PZJTt4}dlZ za(H?tjtW(yJp68qGrq>=pl0>;S_tQ0m=b2l_Xv8KPrAYURqif*Jnhy^+9abFDT@Ve z+X8yk>ZMsswow4;@3l$Z{=-RBM8&x6hBQu1+H~Ox;GsIb)yC(F z#8LFlP2=dsdax+yAw}WcOwP)nmvMNV<5z{>$B5y#G3+)t{ySvY_}R~?Cf*11n!BwZ z#?%g!%`tjf9{3iCW27I~8gBZ9Hv%jJ0*swxIF0Ee$!@{jE6?Ng=R3Ns9)Y=`0R1>uq%Q;d z$iw$34H!Wh9a!&zSL)*h4TXOVpJ747#qNEG8J8DA9*-F}uD1tAiPOMeInS0s! z<($>Q@hLnlKZ-gx?efjm=eZ{wEYCL08xhQCl)_Z#9_NN5x-~lLx<)}~gxJ%bb~p>oa`e4_@6sy zM5A(#Wn-{SXAulPDHNQ;4a^s9QhA~{IH}@8MvawCW?#vyhCg)43bT4ODT#VJ1RqAu%E<^5f zE?2`WFbDA)+QA`>gG&S>V&kD{#t2k14h&JagyQfK&hEzYvkPPLEk+7o)uAy&nx!@@ zp5|bIHk@Kh7$wSEr zIDWgPMYyuxEKGI>7Qpf9P`_q0eNBgBS_db*hpTAfej+U2Uv>Uf1hiWk z^5n{#lTirORvE5ZZ8WyyKh74)x0=T7=DZNy7nbqev~0hf!J)5Oc73-Aw<&e`boyvZ zNs*z9P2~`8GFWZPf!}opSWH+}a2DIuwN0zY9Q(`b#Mk-ju_W@x*N1d|dw=^3=lE|( zHyHfQ16;`??@RDFtrVjb0xuosva-pdyyks~b&+{YmyFccJ;Sb^uc9?BP>_x#<&w}m zv6%A^aK+liz!5KM(!HSZqHcC#^e zq^p51^D}|ltI(*lqfaYHT23l<@dM;6&n4`hE{N2H=_M-k?rAl;INA97D1CcXZ2KPQ zoOr?L#AEffSG(V=_HVaw@3k|}8ZP5c{?p-k`W}cBzx97v)++Cc1bFgG(PlG1cM|s1tENkNsI8^>u7 zQzh|NsfO&(R6;OM-%tRytWg`Yv=^%GdUX}v2 z4q=E%i@(msRvOu%Wq5W9Yll8xODWq%2O2DGNhdY*k{+KbT3v_&f;;KkSnO4Rv5FQ7 zS~8t&@xz1gomDjRoR3VE7e=&7rFScL8Y{y)N=L;Eb>khR_2<>ut^+mhyp7?fynpG> z0sB8A8~^8^`Xjcogav+*wwyN&#%;$NXW(DBc2W(wN zCO$v;IPRI}@3FWWb6EV`n^%Kp82a4~51J>9iR0Tr31(Vpv?ft6Jl|kd62f%tN1Ql5 zdX&LO-?-C9hWD6<G!tqjbKxlLz~D^0qXVp$}?f6?u7#@QEz@6%fB^N!ccpMm7%r(SaTT@c)ghFwW9 z;>N~w+j!5_s)VF;MdISX)ZN?CWUKb%SAExU{^$dC>-To7^63Sq}JBnIxIA?gx zcBGLSX|=*UdnC76Ln{%kFiLBW&dla$JHrly!fEb+U5z^lHJQ+G7LJcLAd5rMinrl= zfVhX<$=-JN*{Zz?E0t87xC^=-$T9}H1jd0~E5QXznjl~e&N8N;m3VBQ#Md5r4Y)(H zSuuCz*!R+KD)OeB*2}*@IVTclcm^(KIb2nfv&7Y8X2*iC0;~2wM`Safe?vklXe$Ey?9HcR7Ncyy_NHTFI_PSDF3i z1YCB{GVmPKZ07S@sPUfSwz&U(|22;vQ=(n!&djwd;|~+yJ+v6v zXsi!t^X23+rMtpxjUx`XO5XGEyRqhb6dE|@qqFZkxQIMft#~}rS~1tP%gb_9!eFFVfXcLb|P13DEx%lbFj zN#tir_;MnVw|e)i#2kykctWFK7R{ATY8QK!WHUku1E@O)!ozb}8m4j#wwwvOikasO)_p(Gvjo-&LE{|CgvUbH2AMn`6Ms_RDItnO zh1GD4(2o*XxTp*`6re0lnl$2i6xm2F(9dLA)Vh{d>e`nI+vE>Z?_FWplA3EiujVhz z{xhYy6+rA^F3LM=QRk&}^~QA8l#z2X|AHDxP(Mn5mm@8gPgfT3d5Pl+h z^_TPEH><7w;s6U`{eHbp0s{;Uy2mYu(nmM)Qpzl8*AR}i76}m@ z% z_PDNB$zqNwIc2eMd~;IM!DF_`lmtozhIh+k*+ZgFZj!z*s4HW|uLp~Y;8fdeOqiJk z5oDVzt*{kQRJ{~D$A-A&tS++ICr0{0;n`@t{;vVO(UI0f?j1&Va20*! zYZ4aDgNE5$(5LK;NrAFBaEtFiXzTIcC^hh5+&qk-Q|BH)RLowDPzE0UA`;1@q7}Q6 zbkXi6`Z#ga>UWdGQmrOib)IXL16ACJMEs)TAb@E-q2Tj$qM6d%*+dOWE-TfC zWC_-rmu7~gN%XwK*O4m;+~SO1VJ;WLYkuT>%H3g@>7m|YY%@JnG1w*DKY<|VZEDCW zW0SU}3|B%nYWfgp)>Ga4OyJh%Xe+y z(y5gz{{EGMz5FH7F%1~h`T6~nM}QnSIaKD_D2 zAC795%1bzN46EgG@zdg={zWLh{2m&16E|*od~yBCmUGH^hft8G62xnG8|HNB92eTR zZCvd}=R^!Y8yM-4sa6$sqp~Hpnf>O7=Ba?)0G@SM$UmRE&@bE`*u6fiXrlSIum75I z*oEmwsM{VswF>fDw`ehcFl7%U@6mCS@tv`rpE|7F2*y1Ru#QIzKZifTWFCm@h19_% z;Kvhce)Q-xufvCW0CHo8(Gx8^weq-QW08xhhCX1lnPIM^7j1)) zjajPDe{5~TQdNHwTe0itgvQWw9%I>W*I`1kMyyO?BN~Xj);x zo_Gr^R?W|g)UVtprJpj`dFprV0&Shs?#BzV{;Kt#SBjUe)%BB*+1#AY^TcLOw_!R> z^=+lO`OoduPM^A=R;o#ir;WNfR4ggn#Nw8>2<6;VDC0`CTsPNhQ-dzCy6WLA|JqfC z+j-V1n9x+}b%uiiUNzv4+48d{KVPp;srwwwZ_eL{-zkXiXM7viu^`Mdqd&Y9To0_G zbrH;7N^BK77>?BP8)fbY72*-K@5mdFMko!B4mDuot7&1jx2c(TJup}%Pm+S-JsD}0 zO1wQ+cY6w8X$&u?;8xKK97k|i6H=L}R*5Q^IN3FXue~7L3;YVTO?iD504qJ&>2|uW z5C%!UwmUf3yLk4iW5v~5nxLlZ6T4g_le$&mF9oQ80r^2ThagrU_%^;3A1Z)+u7mxc zLFyS2(E6Zr1NFO@+oVFWrbP~9SA*-^=y3gn*3)&bQV%Wse*tUyin9G?Qf`^&+*FI$ z%)9rZB4q&_##u;MklUnMB@`~dTW_C>y!)JTjnnW%VKrwjIV)l!urW5-&#jceO931E z?xUZ-ztnK_k^;Wo|GOqj`fZ#j8&1nh!}25PUjFg@)5 z0#g*D1ddvFq|sOFF{K)D9O8k3c+m98LBD~z&Rv?+F;12Xj(WPYCfVC#>31@3)J5J- zVzlRHJ5Q`Eq$s#6AO(CtCi#=U?=O<~ z?L`av4+LMozsHB)XHZ-Gn zcw~8mxmE)Ou;r?T+0Fw?#Ko3{!80hQkqk0;*Y%s&Ylp)DJ>t~K&u14)M-O8-3JF@w zrwl4H_BbI|`$p2nd6x7UDZ$M5D5~{5AUokhNPBIr{OcWZ)a zC*xUsyAugsjm~$F#R=Re8hB%SODimCBPU#EvbI5u7heP7w>4I~EfJX;g|VRtD$91S z`BaaFG;SWpZsmyngyHu0V{nPrV3L+!9@0?7R;$|5X^y*atJSzkN=mirKIEQT-bbH$ zjH+{5Tm!h-9#kRo^qlpMh1T7=)jRTrGO%oOSI${!5y%p7E!Kv_{_{`Vc5T2JxE{)a z$NqTRZ`WhoHR*w$$m_h+C%kqe9XLsA4aK_QG^~Rn(7@IQZ;y_;c7VM+xV1M_g3Ao_ z-~_ZOUWIh@1Sp2A%xYeQMlNFp+WUr?ykqqlEzXi6j+>9{{s25K_zox3SWp@or$;Ad z_6nRZ%c_V!r#Y8#{R6{vPwAH)23&(A#W9vNXCuk!4n*v!5)0*JYU}k@B(BgZz#JrQ z5q~bk>l6M~9`n9GxTS-caCW5f3rzrPTXkS$unFZQYgr(xi{D14S=rb1aIstOyuFNQxjU}qr17Y_KvPZJ=@wg?{K|(nFk0RWKR;aK*siXz z%}r}_a4|9%s<9Oc(3))qUSlUxEr4|spH3j^5ZqkR_pU{01#gtPbZ0u#;u)7nr~<2uA*MR=(ex7C@^_@LR*RxW;JFZ2Dt*#s>+!m{1OqE-I(>!|7D zL1!g3_2VQ@APaItvkh1azhR)3%3iVzRuVM*jBmk9Y}vv(@7B`&)TWs2eZVr^W}GOo znA5^(9QCw*4_a~D@j2=ANtfoDz4Ok_4FZS77Eywi{~pf?D1vYm!y`o4&^X` zt61@62{iFEp`imwtHn;6UaFR7sdqAlMdP}^$&DSGv!NWJR-CMG$W7>X{N(z!@q82I zD(f^?=v;Dxvs!$rBfI?qx#moqm(UGe9AL*mx#BU{Aog!OmUcp zmVD*=p=mEq4$BMt^_{zneOppwIQPj3iq0;+vqjH39N? ztjd(+t(2nIH6)ajwAC!<()c3}(Rc1INrT20aEbbphUwh2ub28u5*4ie&VPhuU9#r1 zo@nqu=Uz6WsGzwxj9Dltt89$OpP*%eno?`{zN$>6WUm|>Zz)8P{I3srA)BJI^#drp z!cCSEWV`0m5y_cloMSmvu!|(qyFIu+F5*60&2ezEYT@jx>otn$D%bB@QUt>!ta`5g z-Hzk?`0lPnzHhja4c$QdIw)AL>cb*csF&2kgb+aaQU>3Igs@$E1b3cjmDH$E-3#n|5(s8W~r z-SR=&4!-eB!q=c?QcE$dbl@m60@+5jTOEA+~*#?N- z>Q-6}sao)MIeB+--6dp3NP_MS5}3@zA$Cq78muIw*zUUPH<`nvzR5Ip;W_pyU8pYLoB=cQ*RDkz1$oQ-j^qVq*^7dyFU`jfKR9D-PR3mHT;@TPy; z%^ ze>;!jjX@XXzJtdknA1J;!SrTP*%wWbGhVwLd681i!+!*vbh8o zIvCLoz`t*=i@(bt^F_$%Pm6a9&^1IphQWLy7ycdFcxFGl^?=qmeI5K7TKPmU^VyRW zwkCZ#1-u6Zyqi#T-OX4_cBNq%xdBTWTqw&;->9ZK%-Hb@^Q$06#TK|`q_d9Pkkt(6 zGBd=i;2%n1j##b@lU5R)62&__XLX?mH!Cot}QLza}(h>?R^P5xT{sv=G3&kNR(_ zfR&gRf#pF*@Npo2#biFje!d*#fmtQ((MNMkZ+g^-`wL&kUR&=*Qk;J7v*XAltCAvc ztoNEdNRzjsbax|SeMj&f#&2*isKsr@a5FHO8;s^?&@7ArXF#-1H$$&)bN6Rs63b+b zA$-Mo?$@#(hb7SEVN-LH^$jL`#UY(#&!`m*G_OCZ!`8p1YyUtA=hC;_e;XzLK1-^8 z!@1J36-~lcsnQAtHG)M3!cB~10PQf1ZI5z+`Y{!wfCnd~Vmu9G>_C!WGlERENMmVdqZ+)PW8U$T%{xc?n}@7}anVQhqMZ2w(wwcLQXNL`oAQzce~?8P49?jTFz ziHwy^;7P0bOj-+8WjYn`{0>MIFf|ajqXVfkUNrTf=J2`YS`w^6D6DH|Nl42_xAgvs zwpATWZf*z2WQbP7#Ew9tM(I`@O7_E(%VY%<(>fRJR`F5V>=OdmnF991m9rCJnZXL7 zi<7w|P3C3XFQ1PCGM?cZOyXx|r&>2IBYJ0o1|=r7?=d15t}2$GX(9Iw!am$SULz)T z82PF>Wxy{U>Xx$6$10*PL~mC~_jPtRz0`-k-t2qZG@aEctS|mO5X@sTcb+3F*s|zP@zZ9cu2G zWoS^sQ5vFvVd9l(1{NE-HIdC1a4Yj=J%pa4!Dy~Yyh@&4fx8bqMm4nf)^>Un6#@LCKfg3~Rx)i8B{fsy@_g&KF2~O+1r&+fxBg zY?GSPB-HJU74fZ8I7H#LUis}1msuUuWGEIWW|7Gj8LhZ^T8L*;19oOJy3|VroK=6R z(i2K?4?-nEtF~9C+gnt_+#>S(ogv7WG*6j@>9S&*n1pM1HP=}v#F>8Dk-m03 zwCnt33}ww=v@$o$yaG>}XNS>+!QY@9fh(5Gvn(8BkiV7P%x4xDw7s+;glj8 zFVM$?1z;%El47-x_}SAwF6t;t^jW?PcbjH4R}xr&9F`d&Z@#NbIdXap=+CfO^vsNF5q`> zKfC$@a96b7he=6I;kzA&Vsp@TI|8;3ECEY>_jTfzum3NqiVoi9f!C-K|BtzI+ie_I zqUex6Ajkk8^ddln06*ye|L=&b3+qPNndzCFB%Q>vckyW90^hLEfR-d``b1DLD8yDI=!(F$$uREq{pn$-w-u9J5~+`=<;s+9n45&c-? z9(VZOM{0Xsa^rBQ@;3N^3*Y&N<$t4=I60zCS(vTErPrCL$5 zO-d@W0nNI1Bz*|tiq`>WJ~9}b8Oq4uewL(k5+&!X!z=aQU-F?ttF(yZs}eAw48oL< zdQod|i0WXMZM0d)Skdtr(aeu;gv!s$YaatC=G*m*i#(%c3b)J88Jr)+ZIkV3j!U_| zGHe$5c_>EVR5Ku_C{!awX&EUP6iNonKT^KwD*&SbJ&a_2yT%+ZG54YZZkMgYqL#x) z;<~1N$%fuQ@AiwaIJ|*PjdkMw*rQi$O+f;*^*s*nO^4rd{3 z#it}n)m>B*PAGhb-eq`lRal$}h2u;XGfH5xr+JQPsAdt~;llL=e6u)3y0}?RF@4M# zp63<^S;yJ!w)LXfJG^Pu2o=A58Bh_=>P{1&ru+5$b+HtkqBDgh+dK=anx#t_4*NAj z)>?KgRXJzR++-~0FvV&fn(+s@Yb%cJn6EuEbho~K+5MH?p>q4*+ zh!MK0@TI}2MmE3Mp01#OJKApo(+a|uZOt-`&vO5-+D=&Ya-btbaSqjY8w49U8$9pdoL+*_er@e|cCOo|5QUtf@fZ*-$p0kMDC>r)s z1Q(-gIXnwzkqTFZv$;uM7jT?eDVG7{lGVxZtLS9 zpA)2#Oh=q2Cr|g!erkc56=!FIvq9X`Poty4Rq|FQr~FXGHC@CLW7=KrVl9$&nT@(N zc^kgoo2Ko_=_y3=Gmrn~%U>%?V4;Aa8+p6H9lqfxrEo_k6>e9$SVT;A_P!C&@cEk< zT(K{@1wL<^z%m@~u)f;iYvn5Qy6(Ff@-@xTGB>LQTa%96MYQBD!P&%J)7Ug=B>m`D zAAqXLZmuIox|;P2)g)Gy>MF{^PL@4cRm?0^*1khEQxO-qDfdsYQl%S9lcqq`?lRw( zC@A+Yfsb>o2V`!q{Qz88SAL}axW|p(2HpGA6+d0@&I7@Yl3P&krJAa_5?sSxXqjyp z4kc-?`w6Y}U&ik%{e2pzr)DdU+JQRtK6CH0s0rs%+`&-+)-pON2RfO@<4I!eDYJ~# zXZBIwA|{9PI3bfW%`7fu)Od-$1Hr?KMiTdjXS>?i(E#LRv@x-qJG8JmENaJsi6xrA zna|0(xTko@yUVVMI++6-JL;*LDRh6$hop)W_yHd{o1QALQ-S+@{=6z2+uTN%n&c^0 z=nV_CDH;SyAxP5`Uek1-H~k?L|J4b5X$AZixsX)8-A3hir1L#^H%H#v6(X}FL_Gsom2#580w+*IBB`;EzX5r(;dOD6ILY^Gr()k#fO^cytryM;_P;8JZE`?D&(g0P1B z#?oN0!l?+l`=005m{)4Hb%ReMaP3mILfurM6wc{luy!l@CJgK&ZmenaIzV$XzYRRA z@}CWItJwm~z~vyTv9iJRT@}@i1!o9v_&sE(Qo)4acXO#*Nni!8zE{~UeT;Jte0p`@ z!yRZm_vbomSG`?EuLr`mJwdtuf9~_~?Kn=HTWYle8X|7b71|Z}6hbCuy&}3Q*SR{| zI^t{f+W1#p=AR+hkaglVn~HEzx-?rnDiW*iXh~tg`D}WI2C2+~smM(mWn{O&vM|((MqkDm>aT8bY&OK6~>eL<5!08z&Z+4 zMlhfsRBDj9(ZLJwq{}eN5}JM?RSVAOGd!zE`r7;G>)|56;1{vOkIzC`VAF|X?MK>#m!-_kYk{d?vIfRC_|xj$in z-&@5Mk^KPtn(ynd>Rh2Zd~7hE#E9?st_4>t@p^{(QcH(tqej&U+7A{p{ETPu4ch-d z;@5sEm8mTPXEP3bMg-3a<+<3K=7#gN35E{U(oPQP+dpLeR6w3BFLL(~U!4~%JEz&P z=D8)Y$zgO;lPbnOYVimHzJzn8GLJevOv$=Mw>g-z&B<@+ixVxrUXb_D;hdvbsvPA} z&G!CG*5W3y{wD=13nqb7*lE%Q_ zjh8d^g~E^y4G6A#;6Y=zv{*CT>&8`VSAssK6=s`saCO5rH5pl;Em#rl-m2U08)Z^f zrIAO6v~1!UyMUDyUHH!4nT!}@NG^-{w!-iD4f1{gq1&H)wBN%apJQ|d+}OGfTB9tM zZUH#W^bQWlyUt!5?xkWNJbzpFyM0IUyTE9-YuH-VVY*g;={@iH``{&~d53d2 zI}|LpS1L6{u5b_#X=v+urfdl~(y`&vzaV7tA4FyR+X}eXWj9d3-FwC|C@J8|vqar9 zW^l^(snMaOLa{i|V-=%G>xKwM%HuGn`yWig3>*g9Dfoq>JX66nFj0oPx@m6u~7``8H(cjOqHu4{+ zhAY|7FR@;@>O@Q*aj6(Pt@fTnB_gouFZ4#o@XfO`PRm>(Y^T^juXv18{J7Z^iye(8 zAG6lm!Dv$st!HzV2d@G0cta(eM`#wE$n8^u#Uzs1T25Ii;GD#?F;RBhUG!i4B0Xu@ zSuGEi$?B(ebj<~tXhd!EVAg^_e>l`#B2Pc{b zb=}Cxe?dRkJE!Qk2>y>ze73g}0Ni?^FcBKdzxxLE>#&Cb#>09hWBOvqu@r`mERiiq zjx-aP%Dzq0HsEjAja325y^rc*ICfZ*O6Da=Q1fjJUuQccV9;rUiP;s*(G6EZyx$}F zx|`Pb(WQU3fP}_;ukixvyN2|wHgZEzRrO(!$khYElEIyBP@{bZDt9qFo+;rza1>qI z??C=GK6iNx`j=I(eR&ar^~+8j<*0{8jk>`YXQvJrU9$06uTbn(!Q2{H(A9#s>Jx<| zKF5*sUx9G?35~OSs&I-Mxe!oKLuLdX0yhsd7rNy1KC{8Hts+|m?3=T+f9w>mYsvN~ z&c12dzv)h`f`2DD|07d(Ga-2JRXEjzWf}ZY1X@)!SqSJdY15kJCr;hr4>8M6y7;k+ zDu*eKvn0mYf@U@7qbb6&ZZsa`HR?2Hc`}`=+3lEUcix8x{tU@*8N$h#5T z&4Nb3+X;M8U0+u7*&nTG6qYTY@5^AKuUL>3S9F~l6 z;8!`-6b)TR;v|XRLt|6uTuWcykTv}1pn-b5R%*kl2;Bn@90%X?)eGoiss`N8qK*X^ z3=LbT(+{X87ZYSzbfWj%xY&6hsE4!?o>FG6NOrROo5!oFwfhVZ80`{Oy3wi33@cc zxUNQP`>M@Cp^0S8lWq4dnd(=G`aOA1A}`+hi>tmcQM5HTnrpqCwfq05ySCNHktH~) zA28J*SiJ~TB9(klPmH`b$R08LZft0$K*JiOEUfSpumKB+OSz3u=QX&pj+r_^c? zvdl7nA%`}7!Q7F5QQe#-ghh1?ORqN+`Cv0W1ArHGlq(=)w9pKT?C1zJd7o zIF*?4KbC@Tb-WiZAQ#455>)!$14}9PR`>GhZ3T%EgyQ%=L_w#o{|utR{ah8Axr57W z&1mXE;OF-RR*2bVH5xoC2Dt@T?1mORTK`gDsoW^fdgEZQa;mf;ufI^7C=D^bRP6p9 zgm1iBV?K#tweSN&h#kR5jv+iik^3qJ>xpX=si*0%%PN^U%b)3Sz*(q+CE9)&uMU5U zpB>N0ti@dqiP-m2@?92cZfyP@YR4j|GWRz=u-~^m%E@$giO%6jfHQ_%%AJBe@YgJn zyOdaK6}9nM@&1Nzyd+2e7|D4CVrIY{SPAzU!W6Fw6xA8YFM%JP<-NS;?U* z$z5-1&JC@941#rcu!67FU>OI-M`VB1&H{9Q8F)_~H6!G+WR1YE?ec;iP^!O$XgYB2 zue%=1fG;=vCF~^%jF+lu(Ki_Eyuz=09QM5(8SzC~c1z*6W)PbUd+&exgDJEDEG}b4 zc8U?LDgWPwb84Pb-hY^F2?WRK`3U>8SsZQ=~cI5=Rm;<26tHXa56XoYNW;T-%p)09PVF4!&Aj#<1}6kHu?jCGbQv!x_LUn1 zzGvl6Wf$}6pqrIJIm69-%2O+Ie1|a2faAuYgt^X!=Oqp1{uqOoe@$&Rri}Zv%Gu($^^+}>SL78Ffp(2DjuUPQ~ngbIU>PQ#?_^8Hz!82fJ z!vXKrQqR^(DX0#UUwFzdrMGzCeG%Fb#U&t*rHO;J+Eufc6f1#3*j1_c3W10td zNanj+Son9*VfYqSJ9;}aU@$#6U@}CN+D^8au#sX|6&vMt(D89GUJZI9cxF!Diqcws zRn8s;jK@HGPDFg1-SgOaLMHJ{QEG`?&{&FC#gp9++zd+33)wHr-1v&|Jp$Uj?bV%?5VtA=?&|A> zOl;u5l&dBA?u3q=2Yp3hxt;>SJ@#A= zn#Ug=Tsbp@<&%|A_yecF$Bh9?*l%q?On>b|Y6+V@+ra?I=X4mw;d1}l0Tt`D4u02g zaIqKuAo3!4nhQ-BGtj@*VQ(F}?d$6j;E#hi4gFf}Q(_1!j{l#)3qBqNIhBQpCxeIN zNSR@swQ4ZHEharXmTlMzgPj^y7N8AsgZ2!jQbY0HuYO%l;oB5?mGCkU^9_R5rbn*< zVtr_-xYffxIn2L=S7F99;&r{2Dr+x}LW?0RgT2+6vu5N{pn3@C<^pic?@Z?6G$R|d z*&BpS-OTeg`g_w-kad?yA)YERmbnk(W`o~SVh}j7NiFYtF#ed3?hjK%&SM4sV3Ixp zb3wDeO3;yA(T!W6y0Z#>SR+JkqB_?Rg}2Qk9B)}t1D3Q;O8u3FjyY09ixkv`g;F@< zZA1FIE0Au)h9dxBe>6VXPT?xz)Kc=%=mpAlV-?D2vBXKEYV~T{k|#2f3AiB|)2Xz! z$*p}zr088Ey@VtJ{FkndNIr?UP?kC{$001BWNkl;vKqxZcN>X#P!$E?&Zlsb*w#4<;-CRY0o0wm+|wY7zny4@Tvh z#=R_-6F2SvEBK4oKk$`{nfuVsN;Bi1=8;}MLSDFM!jKSSM>7*{>sjrHtK-+zlV5L% zRy)1J>VFD}FA*iV9O zbz-r-N{e}`r(O*{L$EyQMqZtkz0NKtS6J~J!X3Ow>As+RcTju-5J#yg4yW%2Vk^{A zO5zK9j?e~7pDoHGmHk%K_H9Ua$+jOX{~>w{SHc8$Ug^Fg;>~K~+ST~Xz-th^;}c{2iOpIF!8Siel{_HPwf%)d zY{Kly4VLKPlGjkVHbfR0SJ9q{6Dv?%VG4X&HJ5uz7ubm|X!?%mD-e6}rU`=JdO9Yo z7j-?d-f&#!_2e|m3pfV&JU2g*g9huC-DjcxOIrJ0JUa zcy&#iFXh9Hmm8D%y>U_3LG53{adBi^ktp}Gpfc(rb0!cz4m!@DO^4Xg)e-oyp(D(O zU;j*R9`#}KjLE^KNZNwlOpb1#b0A^B1G9DL4I@y)0Nx%vJ(*VZIRfs$cRkb+`ThFF zN0ior@>`e~uz0rg&c=Dc4Te2DTe4{hIBi&}zpPhdx{HU|vHsFDX>WwKW)Anr*-rY$ z_N;Ux(0%*VO~+N%02xT`okuv^)c3w|@us-Sew=C%V6BIiW@x{<&{i*4hIr?2F+C=3 zQuq`e{L+DN(^gD!Veh;XfT}qf$A!IB$`kC3UdhG}p#2{kqZ;ptI4k9ihgDCceGlM{ z9GEgzo_XS#WTo2MYuLTS+N;yO#bkYP$_SsGuAe%3mVHnTm$4>f>hJ1G@Hmw79nj7(jOSU`Lj)Sgb|(^Mk3wDWigJ{l zL%bIfr?cnCpxl?P{^E(RW_vewS8X^BCIc47fYl03SbM4JZ1OcTW4}1q8JRat{_dOt z=8sSR<&%-voLRf`YHhRyk$hs!qte$i?c;VObbSfjH`cRlc|@gz6nUYmAul1H?qs@j zuf!>96??+zuS+J#v|55fIQ$2TE9noHgn2pm#Hy02{STn7f+ zA^b1_nnY-loehoMhhnV2CduENJaW{2Cc!{wRr6AjFN@@Jp4w{97TqQ0ued3iFji!G zejyCr^meO>D@?wg><$y%nkzNsn$&Mf$L6VaZtx}2?WeGt?@V-%4za6x7{xY9NGTCj z@(Jtsr;YrU54BN)j(1uuBMd>lj@WFZ7ksb@9&orQ;T@D{Jw`Dk`@R|%X0X-!7v(%Mot~GNQ7B3}KVrksic081H)zFPQ>o%18P%@R~fF7J+ zq4hCVNu^8smTbq*l9fItgWBa5oij((dFA`U3N zh+|WpN(kFF^F?nO7qTp{oBKAmqQM~?8M1tbG?}h8%QiJrpFdwFK!5HkOTWY%-6V_5 z!(0s_lQ+4qG^W?Z`6!$n*Rv`fSDpp46PgwklLbq%%9rzLSIGkng_@_S&~!ezrqNc0 zHJSQ}*APKAA+e-vIsV(6*w15~><*c|pv;5`pNspbF^CYn#X?{)aFZ>^#1 zs*0{m;H#5p7ngbsao^eg%%*7cR5^FqfkOAlse2KJaNkvT7_&u-_DA&p`09!*dE|W9 zq?kv(hYMMW-ptgBe46}4#L zvQlU@q>BG0@5*)@$C2QWKVVP*fzgWq5d`!g!2kbw+h$&oNvf*5cOPbY>u~vy?W%t0 zP-MnoSz1};)M4V8{6^WP%@zI+1ynbb49yU0gq$8)C08t+w5y?WUZqJcvoap`rr!1& z;dZg|oho&|bmKnfKt7MT)32I!|5=mes9^41bcNK`IgdPR?lFTykNHa=mUu0Xn2G;7 zUy@uBydB1v+l~>H%!VOz<8#|89w5`hcE9fdxy*py2SqtJ7Hl%;;}8$Bh@17qf$}uR zs97%PWIz;OyQ9D+&*pvXEnqs(gE{>L_$y=QUDQ~b?lsV|je6mO@s~iDh@E6)GylEF zaLgAMrf%FfAh1EOfhl%Pgy)X?&x=qQpBI>~O0RMK%iNb1ygX)RXVh6@_+$`db)?3{ zK$sA?SvE!kO7>iM#oxj6CJRD5=E)d^!D)B96!88$}z+>!wpEQXc4&)M-!0j1I zeGxX@n#SHBM-2w zZq8xkJbh+{URVP=fi(R;!#tP=&?<)JM9W@%G)Ilt8@q-hNW&^QxzYzgXqTadu&W#4 znx=%tQ0z0UaO>0D_#1}1jDuX|EH6w;Qxj17(k8oh&93!T-@xq8L1g+bp8Jnn>rT+S zV!$&BcL=-kh}%&HtpI%N95r=_8EHrUD=5f9ECOpur98AML1^#|1%`$9$c({iaEj?7!S&PQ0f+)U~oyXM0Y9Rveud+Fh}}UcyR{TTck){l4WA-lQzAV`J+BBciuGR zKJ|Pe=1l_r7CJ*{One;@TOHFUSkm=M}yFap95|@xw1;qy2 zU5)h8@Q}{hEJ0XB&{hp_hXlM;J<@Bdf*uQLbdIzd*2xirUF0-7esNgcZR_i4aiGXz zPeRX9X4)$QYt?$?X}Rm<&nbuKtegYGoWTke7LlX|bjKJ~k@-t3mb)xScueBf@r6IL}_BA2$Ga zqYa6Cz=t}Kw0*GcSc@bFXdWadH@m}jO^USgLZQf>Oq=a@Q~vu_9rPR5z?;p-KNOaW zk#wxx7~m;_`o2qndI*p`|M(=$mW`m*YP9RJRl>R$LU&bd3t;LctF|t6IZKf-!4;$M z5IBwgdSlp}`9bm11i$5)b0_Z;*U>1V9swa^2wntkZH|4)C)Y2uWJaQ{Y;K3d88RNpf|UhjpIJQ+f>#QDc^X7_#6GR2R~x zjh#C~u$N|e8J6GpPG;i1Jcb@HaE<)eQ(r~ho>`>@Sj-r#J7C*2+a!8`aaJzu2hWyN z=~6pf>yqcoShQq~OBpd2z@kPguYqg@?H2YNF6^>t5yQAjaGVP2(;7=t6e)l8>J#!k zQP8xexalX+GyUsP_Ltyy=DppcaP;-&?BRHxLwf;MCuk-H+!#6!;j2O;h0}VFHJZ$W z;az6a$FXZ;LlO9mAzPcj^0%;FUHlF*%s9-{TjH|@;nqM)IbA5$UPxvtA-CX=+IKYs zn@-!vvJqqUT#b;bF;^B2d>aZ&z_kG7Ei_#GzJpnkXuBP@$>oEkE2>Bb#D$R`ywc_0 zM&S3x%kwgP9`Jnzkr)1j=y76tD^lgszOGpyJF>CzSds)`BO9kO^M_87H}V&49<(=B zK-bnFD4U1U18A@D-aZ_f1ZAhKg7Iq%zIm5S6j(u+Pew-a2Z@wTue{>Gtu6>~^B2DL zP+qm0;JH`Lq3&`NdXp*zif}z7Mqm#`ni1y4_^WAQuZ#EM9;SPA24kq!WGePx+yj13 z`B)jiR)M((>MIY=3|MTz{GX8oMoU;_mE|x9r$Vz~m_i4z2EH%>U+qSv?#I1cQ*y|rZTIIc`h$} z-vO83c!PYsTuZzQ;l0H!HMX@%fQRIGd}vWI0j+c&HoJ4TW@5aLR@9B9+l3KW!YgkI z*kt1{GGIpQA&91HjpSpj#~v!ITc*#2mC)?h4IKEMB~v@lbOL_EbBcN9SG!4dRif}p zsIP5%8;_uuC`{^OZDl&ekLy8tTRu-s!A`toSdDyH`jNRHxxvVsV795-cZjQuA-nN2 z?VV4qo46EwFB(7-Pwr(2u1gBsR%_sS1}(ND21~+V5Jop?kLV3dzynWTP$oIFVxk=T z{B?}11hJ*jANJBz@E^B3EQ5QESy_=4FBq`16-Nx7cfRsNu{dswCj!j7-<)%tPpii% z%Sbv`a4^-V!SeKY+6u3<)D?j`McI`}v$Rh*8F;%Dbjnj=)Uv2(F~NO`d-QOb)&Ws5 zZ+TkXrpIOLTKklK7d+Gd0mF^(8g^mYUH5znEw1FT4V>$405R$T~RrMp-V`I0JQPT(30 z6{9gB6iaiwu!dOY<>o%NFlonsdHziLDb;&ZMAuP>`Hu4fF)I^@Qxx;5fm;{d0u}VF zBv_WXJBz^_4K_Y4%IcHgS6oaNDyN&ES@VIH;6Wm)dTfhUh_lRfjO`J$nZR0v$A$>J zSv2LQ1h{${y;W3O={(#{CYr34B@W9;u*N4fQBV@+C2^c5hlg}F0|`v_rPgX`QEE|# z)%_y4nb(&`%%a7T19-*DEdL}xeXXjk2!boAwwoOL!hYz_-$kl7k!JZ|jy}n#q0tcO za9_=;GX`=*3lc&xuwi@@09W)}49U5oby(uFcqXk)OWNd+!??L3;wH2$`HzbGUX*ib zJ0WuBlu@#UP|GP>vrcLqv>2grmK#S6^8++~$AM=})i3L!9vr@Z;z$4PQ74)5PwK02 za$jwIyHC6dd^bw5x~ZVGT*22O3Bc{D6E5Nx<`ArAnOO}N#S`ip@1@ByGhhPRxAz|5 zn3@*8oZGQ8yQP)~itYN~+(>X9)k!y>E>OgkGbHbt{9$Ts>Uf|)>d}nAsaqWQLECGp zrQjF6t!Gj5M)cgIaqiYmFU2hj2b1(-hhMjvk}g$c3A%Gk)`9~Y0TzR=e&71|xp<-j zW5eI#6R;MUl;hNfJA`$*Jp*u26EEXA!}Qhwbvc9sICHhcFxOnsW61R49eE{u$u?LO zSog`D#>4DIj9DhsofY1^u+0uO0}lJab9*!bHxOV^SaoaIp2*Bs-Mn3v+^;cI@SrOE z_Qhq^t?^cyartG3zie_{h$hSa`N<=^a4Gdki#1E4ga7D*wK{%wi{Wu^rf)q~G|*iV zu)1Jt%=;h#wZuht$7As_rb#cf(bcJ>vsYpvrB+XprA5!OrMk$ysD@Ql7se@&-1LR6 zIIWht3w&Sid(%(S*7QeBjlW0IuUKxMJ-a>Hgo0_PM=R=M(^w<+m@axI0d49J*fW7~SK$4fe19mT-F%z$4 zvi=$CDgh>)((S^n$}Y)UI(4QnOo-gl{4MSzZX810Xz#4sU&yzO^=uoLX4N7_fj4A?FY|y_&NK41v$rWtA1Zi#lW$6;j9qg zr;u^&oWo#p(!@!D-|A>_Oz`~iQO(}eCE=qRvmWTi@4^I_Y)`ZRz6gSOfIT8PDV&m4 zz++V1R7xxmI@DRctqs9#@(lNhBg;LV)!Nii%)ja&sFgj)5|jD))qY?wY1&`Pd|wK~ z17ELEFA?h~Ur-ixoqfgYH~g^i4)o`srEl zpGsOE;kP>!b}Fc6pzf>44CK5{>+EAB7q8!^ZEp{5qXp#!>T6$r9Y%p?sj}@{dE`s} zB4(f(f3<6L$Kwa1?pu7me8*dyzYNYBBx5NJwpeh>Utv!Dy4YkjR9ntNJm+JrNU@(+ zx2Wcdz&io7aNaP4o(}KJ(R2pT=X_|6rp($q+^4c6zXf&#*ymnFFrLL*7Tn>WwpuMA zW<*;x@sfh3IqKrK7OTI&Skv#n%fHf=8$*_t+gNwqG0%s>gb+^EpVU`9+I!>fw@>hE z&**OLtHWoy@|TUA#fOArXff^Z`g92dW|^nHII_;YRhdlM|i^bHpV zt((~b9Y$L9aEns=gN8YWzB7JmuZTS8$an%X&-Ogvqre3<21 z^hCZK_ZA*YVS|XlRPqDo&^L4n-ok^QnC|lwk<|!PSV2W?-BHy>&;w){8^=4IiowNaVlvc@)h`OOmVf*vk~b_`*gwn1*)8 zT(?gp)V$76uGBn1i}KcZ0=aM3NS~&!I>a|L!f#bmX9QN-8MewkkzNB4c08W-Ca;n5 zw#H-661SL*b?c_rKBxw?x+0o&CXEg8eVQ(TI}Pr2!u?EQtqxX{W*VY6BrDQN76kU? z)IMF74*-37|GK|^;iIU*IuwI}y*`(9I{wR(P5m~%V z^R#TuJ4Igc9Bn+?@n$4eh$TG8v*>{=$BYi7Q7)(*c4Xu&@!KuCggH5q)Y7!*%$l<# zYa5`t#&mpTUc5!KQlzw-i={_xRH|tDE$n^$2g2n4rLpn{*iGi0Vc1-i$@R1X!TA-I zK~gnP-{Kyc1X$KSL7#)gQY3OARN`5WZqc4bk@@%_d!oC=N4^29XH&3U&H@5bFP9s6yr?eJ> zh2I#guo)d*&URnpxOsxlugHM!PZ=}=Ryd_@fQD4se$b$5-lo7QzX`ZYVfPEKR30-| zkyd!kB`UNqe^$RRY)FE^7*V4(DS$J>Q>?(O444gu!GV`0G!!qqE#t0ubHLjQW*0Et zGCEFjxE}mJU;lWT`d1<^PpB_158)U5d>W_Tzlj-WGQ;K}Gb1aShcmGIeF9xa+;Ygz z`JsxbUG+&hHiLk9+M(NZLV~}+8%)o`=dkRR;j>_Ghu@!q${n2546L(iVVt`*A1T+3 z-AmX!lO|){W+i93!JsP^A?qSO0`;}TNQ7=-Aa3$2FyNcUik+yVnsg63jfRNJ!Pf`T zhXr(i35)zo>mH551~u3nu2hspC~^la_G4PdKBthHg&i8J@Ls=T@;RrX^olr9Nf7Q7>T zW)KaOLG_7z4rQke#F%vo%{ra7%*=k!`yRvxblRx-46}ptk}2~W8Zc+UVnJ%5Fk(dA zcjdby7{6c{K4r+=L`fEcD{DZ;<1 z+YxUy@7Wa64y2)jsj9YMY2pRpA0WsM!P{Um-ZJ`ax$~jgo0b80f0wKL56MXWQ<%EU zRKt^DGf&T*OO$zdDy1+#F<>5SLRGfRgAS|W?BYoq8D$5&&68(izz|{W-p5c=tKb9D zP^Pd7ZkMfp4ZQbJcZEsw4YL1Q4T9G&kdB#G-@|)ftwD$tdWUytn7ujJLML?#Y?N_t z4!^ebrI|=ur_f4u)uVJE^IB%d%JsdU*dYDZ83ocD1z64G)^1Qz0xeqU`;^^7sV|JE zDJ+0JlPYMf_Q+=&ilQ1xL-8I)(UiVhmU>anz7Wy#r4_^JdTKE{+93E{8xBoNwdV4L zh{59!nxK7-nb9dmS|C`~wS8qQYh&FK7fS59XHpj2VVPPIYB^8FDw}n`tEpT9iA5@cRE>e`uJTIq2A=o9Hi(7NVMkG5)FET&}$L@%l-E z)foC*z|~RIk4|RJw(ZUOD_r&CgK~NO8I;J%c;Nuj1*`{2PgGaNe!nyHhDEU1ffM$A zn*~XBzm}1)!$af&TO`?-0iC6(xW$@caWWmWyUi#-XSFTYhz=`16fJe+zD9mmmrn;? zj1l!gfp)0LP=Nq}tHvD8T}x*wGCsv!IXN;VyE>&n>H%&9`c0w$*zo0h)i z8R5_O4RP0*btc@CEIm%TYll5?c-vOn)4e5B8AtQHV zzqIae7kX(a9f;pZ*MA4}4Wg?IzkvoneEGn+AuHsVEOPgw<$~f4!I#gh1MpfSlV9Eg zC-**E#`;$yIM6H{x|iG<9H7>(>KNt=?R>pN_Yjbu7wK+)b$~BR6v*7rPX^6 zZ_P0#-1;&CajdVriEUWXuAkWnFl!~Dd6AlLis^(9>z-8$a$B$#_O!bC6}GFK*NTTj zSH#&fGfvo!xv9{Ly8^r8B)d)OJdHLd$8WSBy@DUxox=L2HcP)B@%if69Kz#6p~J(2 zkD6!fe;r3DZ+kI*w&k!3vh4cBIrCx!cqv5Kac!vFLuI7<~$0YiUz()duUuhJ+akFD2#@y$gM{=bP@sOo4&m5 ze_cj(g!QfNc#qts=)dR)uhGfvQODI`b?gjSVkcFg(+MGK|zqc}Hw{yIuR_ruwfN zdR1+W6>|6i9oB2M?hOawVAA#PTiLm2yddrFVlarN2$`6ifp@SUnaV0K-Rj$k-i0L@E?%G#nkX+dq0xrDu+7*Z=h@a8O+{bGA;Cjqu~Rm|fwdYb|A z@;UHh5;Fbwj+Wxeb@>loKA9@>%n8K58C%b{uJiVxN=ui~Q#9NF51=pbS)|R&9Dy@Z z*GD{?MW-JE;&lW)@L&O38|8{F`ifGhT@o(#y8SKIqjC1UhB}6_n_aV8HvoJVT3c-( z?oCS)$)K3x1r*`e&BkU8ata)82NQ3yz3>s#(N29=ya!p-M_G}xzscX(^;ijFO(<=dmTF#-U-GFyH^Y7Y%m%+?TVYUs5i;R&QsN9{RxekA z?%1O=gaCJrY~$yky;jk)j?GO5tzM+^ZM);w7ZDT_SK2EI8NqaFC5fa14jn%;_M#-+2nal& zs9hM{Loq-)lG-}kE@4%`))W)E*at0e; z1_(Pqv(y*9g93{LCb7CbtrH48%OT}MYZ488*;UnUpaKIvML%XkWAAf1UA&c9Z=k+h5Vcr~RaC}fi(U}=XJ5n$i zVMZK^lF*2VcuGV?TZ5q?_Ga2>Ww!{vv=|Qvv>0fuDD6}UiY-=b<#~|Shp+8V&3Knd zPSa;F{0y!!)KS6p#n#mrC2EI_aZaik#UsHnO(tH^%NQ{I*taKzsVzD|2HBD?43+eKG; z12jip%E^$Y`w5x;?#N327V9;mhheAgo|+;kK5IV^xtp|q#H zFTj^@BvNCSOlw+)5MgM#rJDHCbmrDAM<#f-?|)NvWjk&oF>s(C7__hgqL&8LAmE1p z{{PS0s7V%&rksfk#!(4WDkyJ`ECpA@GcDf3WFyYXp~ho#c1ZWpQ$hs zr2(#ee1PD`+fm^>q|OjD0sARBo?!qsVof%zo}Ba=7fjG|p^MOt!3*O_U3sG`)k-h3 z8n>u7W4ZJt)LX~SWbli}s>>EOu>V@*r;MKAMvfsLBFb{_BjtwHy)dEzYh<4< z_^|NXL20!+fW-#XjvoV)kBqw^sslbG3ySuVD%YIEMj|D+n_NY}8NAu>8iQwr+runR zCc@I-j{_MVInwZ`vF)G_zh zGC)(|Gos}Ww?O@Kyv4Q%r>QFAUAQY%hTJf0rVsimdYB$lgyKS1Wt?|gkb6b&dju`X z5|)4^i0ma$4t^mm<{)NsAteaj^AZCRcN) zV_m4Lns8>F8(-3U)Z7{5cE1NlNW1JSA-H#OlIWvUXiWmrmrAZ)sF;aw9@Reg0+UA8U@-JPi)vIxFuFrPwA7_JsG zm^zCLZ)H?Hv2!?N2E-0eb<^6{5#eD!9O1NMsZsJ8FtZ}bMp(Hlj6{dZn*~mzqU*3n zcAEZ3asF^@$jrjh!la2G21ss14JXqo(JlD!QG+-YO5Uw7+B}olYHD0~Xde{CTk5dg zo{+QBQ_&LPNY7Ulv_@tm39;j%MD&B~#wVB0a|q;;Kvicp7jxv#@a#_`N>H2kz(hpZ zj06U}eQD7yV=kP(7PHX|d)*OvAQ6=3>i=C-&_G|HaQ{{G54vUWo{#s$M}e;>VNwP^ z%Hj1M(=Pp@nHjJYIou35!S%kFh7q16d|rpuO2B>SN8SO8Iy!8JK}{8)9RpS%o?>W? z%R1YzuHpO9g1_DUCS&QL6KQ^*eg2Ypu@`80S@Wr5;0dTbuXDQx<351Uvf1T#{lJ@B z>@~EcNgHnymcy=7k=S6{bjs@n!ENXe8m~l=0ZWIHj+m#u+?pHaIZeDwFP2!nK$2l< z5^EDawtS-bWONV{?8t!0YZ&#t;z}4QtA+fkN?Z5RxDL7L?$8SW2H#tkr332u^20{Z z1Mn-5Is{w|el6X~i0q)LvX;aT#oFfP(j#E6abZ8&4r}0ppp5pW-;`LXLTB>?LmDln zU)r!4hP7D6&4RdO(r5%u%V^t55FI8RrVSHDOluG^1-%yiWr4aTELJJRl)HGgs4`mn z-YHVvttfr3*0_srHlI?#b!;CfQlnO{Z&^)^F#OduO%e?FoF=2+V*Wwvy<@=8UKRUaXrQCdx7Yyp=__ing=r76 z;=ayQb9qtp@#^e1VC9~>7IgmncCR@!@o@%fMY!JM2N7Tv3jOw<8im6Gqe^Z8ggdPU-))99gtX)mNYowLZH zZ@J7hS(l(W-{BV*z=h$c|I-B8K-dL-2-6){u8IbWXVB!z6}57(siuoure%|bF+4#p z_4-0u#jwh;&(n~_6KE4zHBej9luP-qk+_b@48~2@!wjF~Qz@Hin4>6~WzMg}eL2W$ z=yd`oYiZXoXKgwJzC@KZgS}**JC4ngpohY3!-zRE(g6~CVdbE z+8aploIyGl(-ArGrU91DqO@76vsEaW%GnRDrGH7?Pm}oHf2VgZB%tLWN1yT9htXii zfa{|5BaDQPBEdgRWh3ExkQ+tf7}0v&nWnwyw)E^R%Hg~>O(XHuJzG&+su^y@LK7yg z$;hl22sC1;cJ*6gK{R-)&O|=3jhI3-B8Q>y!(Id zePkMcYq5sD%b#<9SzFS3ccSNap?K;sjnb`m0|Ry~55sMa#qWh?I?@B#+oF(3apsdb`QaVx9}b*2H&r(cQL~L!Hv=oTF1~Khq?{#P!^Jm zXh~;vCL~GEh-a=-Fa~^UpnqSca8~;;UQZlHArTwl&Mdgnln;W~E5u!0g0S=0@PSx- z4M2?2WWii!6&7!?V%@N9FAvpu6)h!-q?>8=Hmd}yh2*Po2m@9z)!m)g3^~Dohav4H zk=KI26OX^|%0-B+9Rv^mAWojK1&#rincPD~4e54mudHC5mI z;dPb`9M&nJL`i#KMY4y|W!*sog$?-BlT2l|0IgZaRKyY&I8D_gn@T$^t(6ApLljV6 zjH~mzQ(@&@81UyMY}s31D5h%IEby&D;RV~h|ECDmScz|y9~lPC6sFUOnLBj#PjrZD zKcDx%k_Cx(sHYU}o(RGSW?P>@xg=mYqi-U^-j-xpSJFW|p?~zSe2s-fK@YXBk9R*V zep?!*GF0^*?;Y^Fck~e2KpXGo%MxYTs~~(I7;kklza2#$u4owIF!$+~ZE$zNS&+fWt$RDiv^L#VZ*(QvwI$9iX7qGIp??hXpv=s4_bu>mu;okQzO z`kWdQVb5hT>DCG-y?q1VN$^;bsO{NMN-L`#!J3qVEB#2?M$Jyi978++-56VIu(WG? zpmw)IzGg+_tckoacu*4N9N0lS4c7+E7DmrjsYD0h*VfB`q9f-;JddmCu^AwUl?unr z69Zn|y2Vm?vDU6}5&oT?jInJ8%!N8{Ki> zu7`yI@BivXYU_O&H4E&Lxsz05!h-&+79w=wXO$RdsJAS)3 zeKYVD)VWe%7%VKbDZ{|gE zwALtD%2ksDD+OV7?Z%Q{Wx)T*<-yw+FMs|B!T2UP%M2W;Tm$;6Zi1^0H zqZY8}emoT>kbgz9@;uY$nS(6m^>rYiibM zXbjlNtB@Fp>2T0&9j2=~f^>^9`Mv~E$OQ(^`>Dz)g5N?RBtZvvRc&J`0oJye& z!gnn)uGg#I?IBpA>W!^HIcGM~Rs-~^3x0@yTKI5YNY|dCQr1+?qaQOHD^$z%K?!9a z81FKu4wXgqTDOAqtst@yT(>k--Xa-}tU11gowP<#o)*91lvvh?1On`DzdY}aYha&v z^#+{j$~mFyxgzN~QaHz+{YY57^2w6OF?wiV@VwSfm-n93**iEdvvv=`dgKqnO``cu zVypn=2E1S>k0Z>Sn#gED}ap8 zsqkwT9hI+F)zXTdjJ=Au-IXbHU+*iZK6V@yr;}mt9`F8SB^*6cp&UYezRV?sm3lwZ z@jqu*vfD_m1pDy^4024sybvgYfDaA$|3B|_F}FxEOLn)sX-cJ%W)2gI%vd%Kyw<=& zvGq5OnAu889Mi%%M@g(V`^Z&mky&PAX6T>XS|e5t>@G0^Lr5J zT|fNj1qmL0Eu4ayh-&{cWA_s3p{ZJlo=Gq8_U5Rs{JM-XR|un4##-mTF0DvJ8M6`N zssWXE|4O9DW4P0|*4KT69Z}@N>l*Y6JiNfSGU5k?)pwT-rpKE*Ct|?K&vl)ODv~#C z>(^sRd#IbEUZQzSjSp^F5F`J&d4v5i8NiQo7({uzIr^q;?FT``1T7 z2*x!q!S8>JWMo2e0_cH_2?IV6C^;Ud7Z(^XhjNe?sWne~iw&W_P!)~8ZP@%(Is)z& z>9vX-*Xi_^jh2h&!NX0X)hOJw!)Rpo_xjvQn@bb^c1L;zhP$%hEDx`12;+S}Tu4Uo zZT4*Pu`xy@9%J!TA2@xMq)WNXK)$Qj9=u{UKd?cr%gQP->dwOt41_mqO+tm%_Ut;0 z16NxD8w0kPGB0mwG%VVwj7#I|GIbSHTPWAAmHQy33l35D5hhSF>hX4$>Foi!ctj{M z4W5^;XrZYrc^QUH9mUkRikJ7w8cH&$Z$fh}ofvuvx)_uVekG5Z(2Q)$I*1knvd*M0 zqR^Syw#>8@qjSbV^kTr%I)tUnA;D%?I)2se>sp8fiRXe}$rN)m_|JHN*C;xGvYxI`&-12ap0>O*g4k;hxhX}j{f|m`LPLoOXq-$nX zSJ6iSCdO+_K#0Bg>a^}A4y5L!u0PLwJ0{U9R+GSv>zW998II@7W@%Dmu@0jjixMl= zIH1VdOR8`7F7V550tV2Z*A!@n)+C|6Oj&(uv|=wNN7rKu?D%s6TJ7ww=aM#zhS*o4 zKl(}$yf{evMnLtD8s+4~X>a>UuX^{=JQkyA7cCtd*YI9)S25j}oD+Ig&~{VSw- zI))tR?w8m&{j1v!)4%$Gz#4*ud04;k*w6*=jbTPC@9&S|L$5x{M>$Ivip{$RAph7d zPFc_7lVY?6%4`k1H=g-ejuAPCrLIV0mL=cfW!Pod1yLeI-_o;q@Qgi7lJIOx-_B(U z7>ZROuXzuN)(kCqI76b=mV(u-mbY6iL*ZA@4Xy~6EwIwO!i&f9p`l~uUK|51DCmL| zOrAy4+}c~2wx)&hjJ}4l+4UvqKTSNuh8{!bsvums`j9E`ss;YMQ#Nb^JT=gR5~f_T zrR01_!t$+^p6XW4F2s7exatX@KFzC4y$PV^l6r}$zU8W4PV}ruPv5|mWi0K^CcLdx z_Pz|))KaJc(wDiLRHQW&k0+DatmKyL(}2Ef@q01c5&q#UdLb`SaPKOnIkj5_Cu6v{ z(K+0PXe5xYei$?8Nuy#Y#!A1 z$te^3W!<7S zC=qH{)8xXRt;LAk!o}xv$X#H=*xP`?nDY0id*C(&LR;8ZBi?q8o?Szv$995)So&qc zX9Z;013S%CpuH-tf}sW*;AuiDg4$_eSsb#=inL1tG>2txRM}Q93d|5JMGWglMQj-A zd=W;P%F0|ym*#Xz1_y6tr`mw0xP>o?u-3SZW&SmhvoK*MtVUA_cWWK^r7U=Y4w_+> zpD|KpS}a&v`L-^tK~~E!%=_+ZZelHkVUa`+9x-bt)0=b>f4cEBH#fd1HfNngFE%~1 z2jEMF(>36-UTfubSjNq;`*1G)EA)4v?*($KTZ5GeZl`IubP$dBT8#+XvN%Dh5*m=S zg=x#QvNVrKVEhzhJj1G;9|RP~)dVq34ruE`zikN0Pqjd4bLvFK-9S%#u1(W{j0lzw zagmX)cg8Qf>$G2OYtswtO>+h;*}e4h&5xj)MN+6K$#l_J0NgNsqjv|v0=PPk-V>q0 z4#ZyKA+zt?kX?g2nY(`pXd%E#cgf^U=DyzHCea1sDCsHL3Z2%to%1)CfDasEH!cJg z*p%KwgwxER+Cdc7u?SHCoj*eWX$5vZKs2U9=LTt6RtVT3#d4tZd#C~%f~D1k%#S-4 z(w^2)09`%qn&PS)LTWivkIVTGq1AsXeSRUw%2vOC(&tOL>*aDN8H0;(U?#zAmd)7$ zI5OvEiG*1WTI}SQRz!GZ(@HrpcGjF}4y_!^$_tpz5WJcm<^@sFnk}u@HItF5tYo~* z7@2_S^0~FjABJIp-%4|3Es|h@%V`{UUPrCNFn055or z?xiuAT$OlTZ=W85F`gq$@b+%NE5DA>v@&3xj=wPhCInt6yk4$K$J1UQz@sr2Wk6Bt8RlLJG0qM)p9aw~8U_ZOIrmy3v75FFcc~NR)MomiKz+kq z#mkL!$oIuM#%pYzUPjAqu_7Hc(@>D0!&+$H?PFk(QilUwW10sbGtHIdltQPNbV{p& z5BR11@jD_g3#(2G@qPR1@91tC?gR*+>}VY>|A4!uvXW^tkDkF5q;e@EmN)vET>B3W z7kC4j|0wxcETuVL?2JCh{NV;buf zr8AIV!ci4M3w2F(8U!!kPL&RoN+rNU=x@eEEwLS`n@MOd{#*I9OiHP~Kt-*1{H8@t z>K^8l>PsR!*3TP(BSZ29v6ODStl*nes8#o9EyHAv_96!U_USBA>-Y`8f+STlv8oqC zDYk+D%L<3RD%mwF;%2u-1@JTS;hy!gkNeCJQ`2G2IV$8s(i)g|=9UL}=zb#+@{x6% z4#o2;Jd2<$z{PX|@ezq}x}A0gyepMYO#Ts)roTG;0)QLrU=M(63UX#c>K=a`1CCmd z+*G>v5QAyGOW)vd8VA~r)_p&qZVx>d8vp-hPy zDqt!3#Wts*Dy&6-c?MmL>MEWh)T^ghY`JDZo}ibO*l1|5P!uK<8`|vv@zFC|oYrE( znPt!f!GgeZAeb5to*6Q*fc@GpV7&yt|0`9e(nBR$!|iz$e>Lz!KaAY4#(hW^=Vx7# z9`Y#_PJ+i~{b2x}_GMBmwki`nrcTAWk=x|&o;%=*ky`v*dIRJ*V%YT>u?g~OYbkWq z4~D~5lvIzj$co%KMI}P>44X<(@Z!-a8`*OXQS-B7_UW+);jss~buUHoqSK@E0KYFx zv*&E~;mrL%(exh>B6Dtvlu##XM=Rg-6Ch1Lf!M#o;9m`-SFMF*ysex0h~>}CZ-2iq zg|a~Km0tq;1+YVT_yF*t54fEwC|wP=?iRBE$3+cD8ruQ$?kuplrq|XoLHg__bqchI z)=@Hl8c-Pj-I{a&!#Wn;(X#q>X)tP%-kkRY=suqR@ua{Q_W@Cs0Ntd2>ON4Cax^HN zsvB)xjF!y9>)y?W6=uJRkX^b@Cl$*25cmab?%G0VL+I{0g11(OZ{b(mN5(pVP$CgV z$_$1xO5)iW#{a7>&p&uq%%Jdm{V`!b%W&R)rP`EO=m1Np7w@^ z_8Rf37fJ9y)32gvRXJ6Cb^8OqHv*fKq8mL@hSUXpCh;JX0#^9|ru z#90fL-((HUpgk3Bd8ADb>RVwN?!W%9`1{BEgF?l2fIx5d~y`W}wuYKgee(B{)?);kUhQt1|2MVM-)s%$&tPCH;RTe0_v5E*GT zQ(*yN)i&=@AyRGB>|E7iS*c(f)?(;D*NLE?0otOf42-*96p!vs=$mX>P0;u4oesTo zcGey0@kO{>ZVdh^cI%k8VKjOa-v63yVom6DUP2#04#)^QQzg|z5Tj>!@NoO%0* zHju33VQ|nEA#l}FM8Al1^U?{!6%s3l8MhoaW(oY5W8a1QG9zEq-UT|rP-XY5G-*$$ zSTZAh7M6~LgYDie5F!j}T(sm6gcn*FW;}+1@@55IXR?7Kd6B9e(gh6!E7+!Be42LH zPBHqW5#xL?Hn4Mk5_Ap_c^ja7po_ni@^3==fj>) zV0z}DNLec4EhQVR>gR|KG0`t;5H#o)Hx*YRs&dRfq9L$EWSkA#1~qx>=H5huwM+si zu!daA$tQTL42mTQA`({>T9Z=Nglh}*nD2gpV7C>lPUwNE^REMny%T-! z+dl}0N3CMw%EJw=5rp%AU`%TV?iN)|W@e4$xGb3RQ>@XSX4E3tnNy{QMn+4})~q}1 zyp5CzSUZ#l!&g=OCHCEyOzF`nqKn!h4)cK79GKUTtXRnsG;HxH0UjseyCcDtlEim# zXeNw&9SeS52ueFS-Sy!>@)ZlWYej&*frsVT$GPt265f-iV#Rx`)wpZ=@wWIgV)N1i z=}fz+I9SmQfIYp3;N7ttv+?wAA@ogskHivmoCz73r20;PSycXTZfA^qp8r2@8baBM zwGmpK(ivm$mOW{&TC72#6MbJYpkw=0;Vor>PqAM^X|Mk5WGGfsct4lHa)-%uzMrQz z^)(k;z4he^q-kT@0)%aBfcxfvhEz5+T&?!3?vHBauwgp@G42-;xc>S}iI$AGG9YHt z)z78luz>nplmQzFwrV7W+O~mj`Sw&euPE&L3MFw%IC*6l?uGnV4r_~9wFtk64U5}Z z5f^0P4vbhn5nwG+w&W^~nVe{TnT*?c18Iqy6m&&e3npiQ;acG@65y`W-%|hg3w@af z+s=}M-+rMd%en{$B5*g}tEI!k(kV%T{)F0wPYB!ai%2>T=B22t)K|I;s}?F$@K`}G z)=)&vDn;Md7s<~V^R_$+i^t1xL~IwXC^rwrYFqdnd-^g~H~cQJ>PrIjnhcTF4V@I) zp!PhcZFZU7i>yK2UI3$MWx#(n8cm_#{PwBRs<`OOCLXEnIne&ptRr|!%ksB6ZyvGv*?i5c zM>oIu+p*ioC4N{C)rO!OuAU*tFnxVLxEvunFD~8_+K^o8L9C;|g6p!?f2Mq}iDFwcFz~GKC(S@iZ z;I+LnnUCcL+o^@+4kgNYsG>cxcXAJlc~PbN@O@1Kn~*-Wr9qjn6esCxToT9uxs<~|ztTR`#YkK= zD7tPr9398H+?;rc1N!ck6q(!NKJ3=8y?*6n7K8Q&2vTp4Vv~f-6Q;Koliv?R!H(qV#V* z3;dfnOTG2j`ylSs(8aV&RN!po#j}{6|%ad z)g(PM=X$X4T!jFm%8cDd2(pH~1@0_A`2mw)2&p6|)D%{~Tm%!}gppUkfInxTbnmiJd~y6_zP5`vz$Uh%TCDk3S`AEB zbWz?cTgJk;)0Pw5CC@r79rO?N2Og2=&h;J@whh>{6y2qO?7kCPpO|Kp8yRrb6q=;c zyE$(9KG#jpcC6?}DMsJ)4`A&t-a4u4m+9`W|M>7-AI#T(MbLZl4Oj{8k^5@NypqAM zvtX6KS3%l*S#R`aE9)&`p&;MI4+T9AgpP^{{dvVx=CeDI8K$i~vTa+(U=ajcu~>Tv z4P;ktDNod4;|JVT-M@imqIJ{wEZgj5V{;Gm=jOQYiG9C5-UDtG<;TlLQZs`zQC^x7 z6HP`&4C$5DpLAQM4ep>H31YJthwFP=)>smu7xJtI=whUn3GvjTIhmvKq;&$6054PF z`5h9dy00~~(Je0|<WbE!Yr zh?U1S0UmjgoA+U`H8eUEnn%Ie^(9%$aJGprQC=0HnFTWjXYMSV^Xx%>F@Rgge+dRx zd}Y5iS+EZEUmddPG#E#_lr~85L&BzEhdld>*uFD; zE)@@+9q}|60}CxayEjLBkQMcr`ytL%ndfyZ2@LCA!B$&z^MbVhAmIB7h3^)K#B#Wd zZ(NjT@o#0w;ox`ADBO$dR&drV=~$w&Lj&bC+GE*ya+|^i#N@+zkzu+h2;-Wtgn78; z!d_%c8PT>F4_zf`I-@SlMo$-p$fEwM4$^Zi*q&H9qf)af8L-(Z%_Lc0RoQHX@?Y$4 zVkCtDZm-qhwOFBPKX{1m z_Jjn9dHWZJ!Q9U{SCkBaM;7-LJE>K2&PIr{-5>@mo@eO~_6@)`CGNv57unh`Zvayo z=1PDkI40g{V%j^jaTxZQ=BsJs^aTWb zuf@a4YcLFcFd@C?o#`ukLd(+9*qz1c9gz)%_3{)hRK|pj89y4 zKFYIOc`E&W|DnV87rUURh53cLv$~>z0tdrkRH1&}Lm@hJK z>j7y#A=NT`2x9TseV)~cuH&w8n7yF#eZQl7!ME{RQgaThjv<;vnxV89Ln*fiEF1c2 zAZ5RsBphNQ>vbRshNqLwNhcg^I2ER2oUfeqsOD)|w1)w5$N4WAsN1XfS+L!LeWYTb zZ1uvs5FJR;Wh)x2Zk8)8OU3Rp+E!f!?h3wih+J99m(iq!q}L$0Dg-eSXvb3A z#BS}uyF|`SHI@w|cT->%WM&%kippHPCE7O!S8A)z)JzDx*TA>BG%Us1OWGK?V({Wb z5e=H;qoPdD?@~ydhk|ft88}#4j$NhbQlDS`g}>{ zVKS^`Qar?zouvZmf*vK*)sN$lr*<6qfbW2pBW$1D;rD*%A#a|(>F;sSs~$@fa#TdH z5aoB^b9_bj-L1o4TB%KscH{5R;&0L5^aq38Wk7p`G63*gp~L88rUUXwzD=hY_dUoq z$1fptcuLSlW0=#{0gwR1)i)DtOa|>Zolz92l_LRL#-wDS~OPi3Ot_9 zF6ALuDJ$<;iNdR0iD%o$u94jC4zgW5!-|oHT&}jQj+xMUOmiereeR2w+BYRN>q)Y_ zizSkyQ}xn0|46g2$dTM$0V=c!(cOqIhjs8a(a=icW%gU0^9nffMU4&Y;LhUP z8rTHPC{4oi1(n2LtP3>LXTaEY zW%jLZG(l?0wWeN)3$T2!z78U{CSP*6=5fUs91MOh(YZM%^AkTj%-6nukwc#73gVK# z#qbiK{zP^67QZR`?kmITABnQ~!r2G^IrKwB`Yq*t^IC~X>OB8ohRQruK6MOi;f={Q#o?oJ=kuM9_Fqp7twdpZ~>vwEex(m;R?4Ft+ z-ND!Vu;>g1Xa;GQg?X;2kIlzh`cd-)wX;cORAbv#2Yc9}^)5XMZ2@PYyY})ohz4S@ zFx+*e$>6hTf#D6Zeqp$E!Cu?znYT~dck+8o*jea|Sdt%&PHG-@c4;V&tRIeK2f>Lm$cQMtO_%RD(iuD~kuX@Ov&y+y9*EZ3!!gbB|%^n}xO?pv`=SQ03Cikk^=>2U<$(kpSv zS{2%=FST4zaAzB27D6_3imxg0-bhYhVO}=WE9opihvHlzi9)kbcJX_9E-9rVj zn%j$tmoi+W_{IoH0Y3%CstmSz>*1w9d0FnV6&Vr~ALbWshYo{5Z-oF$s#hDgM`WfV za>dk`iL)7}8}B_+_=aMnsLYm4SfcbWkK9?o#t*I0U#G?YZ9zf8eEvf@;J8{x-RN6C16ca&~IM(#$Oa9 zN&Hnvxq72tdVfPBp-yg9bw2vjKix4}4bnW})fW(8ZM5u5czl})x#OD+y{gE-&ps}K(KQE^IgMKx&shFRAsFm~4xJutWlUl* z#?5QY7Va@av`>*ePLw3?vDU(W;%{JY3i%W&ChGL(u7!FyZ%eqZuxsflr0M=n` zRt8(0LANI8TLl(t+k!05f8%D+*halnZWc2&@}p_|+p4ui2;T-vkADs&j0`=e|k9Kf|Tn4ivm0)O?-a3Jyu z&>9z)`W+e@gj<8(j+{(Ac}psB^O~~9OtJ!P6%0*5%fmZtd5LXO0w-F4cz|eT;=gai zO9SVT$8|)6oH_8+eZ(eHHe%$(;}tq&I*uZjZ}-KNClF zwVUtcaO8B-k3QLzCn^m8GWcv>*>Lv(G59dJ?HsXU+*p-!9QbD+y|E-gQyc}VlYTk5 z{igIRhpau5)5xwW!ki7=+RcW(CS>(5ItV4w)ujX0Jng<6vZ*ECDkzE zb?-Apa6r9Q9^Hy7(9zB;=sOViXo`_=VgadnP&;8U$_XXQ1Jhp4bd<9m%7E#<@msZ^ zsc5b)y7mN$it3|s0b^BWzIf610e#mbj-*z zcM%@V)`+yrk5+@v#+3-gQ>CfK*IZV(x2X2K(&mW+7o8IaTy8q-wQr4gl0qtFSVw9W zNU8OM1Ae({Ng-H46un1QqY(R)TyU1hC|~1{v2IKL+KIuH9M1~GraI#&>pZ#vEzKd= zOwcl;%^3P-Q@JM!EIUZ2TCd>2QXlkg2>kHXX9c=*#+E}a(05w(&2G;UC3>(|hWTN% zet(?k9fQc3@h;Rf9FWo;D(?&ge*e+#eiK{%;XL-krY>RccwZvTGp`jEtGctj>iAEa z?MG&x)xcRIzmCPhhPAxkr^cwov6WNY+6}wC^o$(F#b##?&mcvfAI+Ev2jXrF*wp7` z68j?CRaIR&ref8VHb3*;sXzF8GJP!>79p9c)wP;o#YyUBu;Fk8p>37g27{p89wN5d zl2*xyk{dBPsM0O`D`Qd|XqKxIgCOl+%CXYx1_2iNxH=p47Kcq=uvQcrGqr*7(X_$1 zdb&rohTWz(Y-F1QmTmML9a+qP=gbe4pRYnQU_keeWM`iFo@+Ws`Nul2FB!WqeR5g{ z4(#3r+%?{^Tfb7bmL+*W%LUuPX;;w*O-5?})jkhc3Kz^(Eub)9xSejh(gARDKeQ9$ z7=jgqaPI_;`@kT`9pAKbC{kd;+CvtXxPI}DF6zTwRxma!a3b7pCqgsoqZkQOUk$*vvMr2Bq)2j|qgu>3Lr^=Nx!#&N=)wvf%xI)@;o8lj41Y z-ZJm)6N2}Q*}Yw>2+(=v{cD|aU+8b*e5>?eMKcB*z1Pm5Q^>w@GxT&^4$ketfM4Zv z4kcIi#&N2*Dg5i{F^ZW|q%V-*6{*>Y4BV$nYH|1r_4%?Yh4GvQGHjiTSM_G2Rlkm< z!q=P`iEPRN?uFAROANAZbNq&_EM3+aY{T9X*z}wY89E6Kg9kuf2Q%PVc7{c|wrg!= z5DrZgc+lI*K^^*CQTH$hb=*%z+d`RP*R!-BQy2X{VQ2ZL0{sBAXMFtJ_Zt3c)NGl} zk}R!IdxV@z)cuYU1^OHIWh0rq)19l1cpw~TGi@N5kvTR2$BFOBD0_xmvP=ACpIBIO z2yP-Yt1rsN$A-Ofr{{4{A_qLk0#z6T1Ak9{lKk#4`fRW&Fl zwxA4iCsXyHVCc=eO6r&%Ye<0s8~7fVCTpevjYfU1gt7XMag#l&r{~ zH%muZVfTb?r661`)Crb3V59g`%Dh>$(B0}N+*Y_2 zixwupXc#nU`jK!i(z7FT6?<2W)eK$|QKqCT8tpdtoEeQ<2$XJD41cB+km~EaCLz1a z8X+Aq$P z^pq5RZt?hR9|EL7Zdr8KbY}2gD-w2uwVI`dyl2y(JMKQf5knf5hh!mn1H@U2f4S{w zmw|P*T@=T(931RiY?|&6lbQW`M{qk+3nSt%SvD{|IT`xs+!bsC;oJG|KJMYe>}mK>fopCnGBp9^Hc713l2=ps0MHDWVgw z-foy?_m#mf-FGkuk9MR+`PPoX*{^Vu=0Qp_)?%=7v}8>M1Wwy8qWBQICs8|pM#0rW zrSO}(VsQ9K(T4ynW8TeDl)j^drf-nL^+c_`mk0PVv?dzEkzoHpy3CVh`kR4I@`*II7!K|I)`??-8 zqNkT4I)2smkO1u;6RK?^X?Ni!u95}h$(wZneW74m=;YFVRIU|-?WCR!E$Ned0VUS@ zZc2Y)>QYN|>}7Cg)U^uHbhd)njR2;;MLgZb;g{DOAq|u-F;HunM^EL0fY8gF)1OSw zAt0LbvdZT`N&;WQQq`6%L>jkHsH7WOhrzGa8(F_^wQg7m zJ)HaREIa@A$5HC5!H}wTe$4;?AOJ~3K~$&r{k}0bnHJ4ql+8iJqN@76D}G>L3^cjx zse!dN>L!ufm12Tj+Eohon(B;+FGyvxY6lD5Iwjos?v_gJ+sW`y59^g}@mgJkLd>b% zhv~#zGTHDmC2C^&0KjuR$d41Urkz-!f%wEAo@ZZty1Pxa_i8hUdD`2Ox5{*;6L(_5 zThPw*=>=Q8^yYSw@bXz8Py0=IdVw5G+vLdJZDpk%d3o0;%GX}_{Yf5Vutz@|p1-Hz zFW-7iW8%US;4E)jY|uB4M= zBE5u)?3?nWD^0G1n+iiRx{2 z8>Du}(dyDO`ugfFfo=)Ts%H^7jAVWJnf~ei2wH`k)${s@_pp*d<-V4nJTYL!@tJ&g zg5Sfy8uh^1($IYjy~66rJHo(U#YauoNaJ_2R1pu}eQ}W1bmUO2(;&{^vq|=ndVpcD z#9MZMWye-X?fWSKd=+;8x(1!5$71kCqhA|}k;d&CErTus^S03;TSc16bw^rxSSQ1Y zF*4-m2oz%M*8krhtg90G&c12jZ-}-;%ycp+y=jj*TB9}2!yiZv9SI!RfsiC-zrhIn zcOydIGGV=Y|L5{idYl3e&Z~s0nJw$tQUBYHj_iYC_&39@b;;X zP<+U2T$MPh82=TF<0w^i&PC>C;25|86xdFwQt3*ifUpH-N?bRC@(pt~LKfzN_97nZ zcDCe+rxx@Y6~x$$nxq3WreW!@`3X>&omp$*Wv`&H{=@9fMq7u|s25JotDAA@@v>Ol^u*P!;_4IunHX3k^s z3}&r6vFfMIi<$JUtW0UOL zIg3<^EhDW`?Zh$_FU8CdqQc@#SjZAg(`K0a8srsvRBvd~rNjn?I-;M&TaT!hus|4e zac&FCW`x%&(|$LQ;2J2fO0Aug&#xY;X@%Ax(b@=U;j$4bFL%IJ5e)c>5R04Oj?X>e z3ME#$wFT`}vqRa{(1Cu3Na)4`=f+q(Y`EB~bRL?uoJSv*#PY0;<0Jek{N)!pTsNu` zHVJcQ!x?l~+}vQD#yc8{7C)T<-&|~^60GC9f|`Iu`xo{dVzETcz_g|9Jhy?<_X+c9 z9YPN{#7HU`KxyzRP0Jt}x|4EnE9K^#nZvXiTbt-ixBz}G-AT9xCOPoV65fzNnfg3> zTq5qaL4jMqk!PFd!Ye*H-gULgR3`caVH8dVI3y&s;ETPKR^MkhzQ>L5w`Qp@l3$!| zZFe5errIY8$cl)2Z(vA9eb{FZ{+T3KCrjYR2^^ON3O_#c;TH+CP$vC~fW2K6Gt7`b z5KR-XL_NVWZfhuswj=w?=7BgGz%Wvk;|jk)@F z+6rU(mFzH!K19rYB;5{foa_t?%(@@e$ud_qbcOVIf4jDLjTX`?K`V{4*Ma!vBj=kk zV6z!H`%UOM!VqY2qwZ5p$I3+&xB6_^Yn9wg^t8KUY0TA29pl7-DUaxCM$+t%m;=lP zGqIVZ5QN8XlUi^Gleigt!R+Sc{p-^wtNUuv>$p3>8Pvc2`e!>$KTe$2dc0+7i%)`X@PxG62W7T4}@P0?D&)3=onTNcla*oayDV`{y(LeS9~1 zeuO~E-vnj3LdzTO;re_QeFmSy{5ynL!ZDiq;5&!C^xZl!X0aF`;)eQaFX z!17yT*O5RFhj3n{%bqLp-f*ch*^D|VKH{BCB`uZufU9R!XGQ5;Il&`}y5{IB=Za@mGT3o%HJ(r_7 zpySjVY`;x0HkLQ+kTku^vKn;zWtb2YUqaa4za>`s&B zoB?!I%&bw8V--CS-+s9n0xR%J!};^BUkDBoydTmfS0syxi^nAVsrzRuQy9Q3Ub6%x z57xlsR9U(ptBay{m@_xu56cQxfdJF7ya40~v&=rDK)J=#EXelvLAqyFDXq$Rv7CwK0jEmq`zdQ~ ziD9^qNQsuY_qQ4YuI3!lc0ip* z>r5Jy(SEYyK@P#PvrVCrk?ax;CTDSMKe8}NkG`@e7AP<(ffM_RnEkyBp&p(EqUYk; zW;gb};a5wKDh{mcs1O{zM}WPFJ6z7Y5-wa=Z;^rGD#r!; z(11!s%(Kz48J6tRG(Cqs?pkK0!CBFl`Ric3ZDlW_2IDcA#sx2jRmPwVl^ZvExdZeO z{V2N!UHM{qpUA60G<=Y75O%%h_qC5%X*wNE$c)4?L9RNOtZbt94<}B}IEe9h zbA^WIilpuYG6_bx46~rLn$%Y*)*qgt4kaeTR|cly{g7#`+8iZqu^X#T@U8m#e)fda zrnxd0eGNYCYeaGr*Bq=#r;X+)eLV}P)9T~hSI#Yp%DMpHFbO_j^MB`2RsgFdCP}Zd zIerViSF&VK7@z91Kru`}#k=F8apPmyY-E^=enqJHceErdz!$Ggx5Y_T!%Ni8H^BaHqu}Y| zGEjH4H1vnG_xH_ebrfxFz|D#bGgkV7C0RLb2YZ_(quJ<~hLc6sM$Fj(b{L`jfjmL6 ztch=P{qw$p-+`2Sn!`Hc^4QR!4Pv`5#?Rx*PJB5$bwUk@wel6Sp1853+ESU%#>45C zUBFlK;g!#M>Sjty4Kzu>CPthZMn(}f^by@*?&NFR{RjO6MEX!0sN+mZbdwvJ#357s^O!VwAmm`cLNcwL|HrB4 zg98NG17(L9c({NEW*q@xe}VG$7bkDKI(ySN$Fr@oAx(}oSnvLRb-&GN#|Ql0QbJ%! zE7r>>LkK(tD>KT|r+c0jBc6poezG3lucgfdzqG04ys(cy7<4jewoYaU-$Z7A`dt$N z@GF>gFYxj4sPA~-KC3Pd=nLkc%1|ciJFwgfVql^ zrzN!gu1+k@Ts>t{=gAwDHo&Br{lQ{Ay0Y0*rc92aFkE4zTm>qD4Wo-?RUVEd@e*G& zC;2qGSo9>=g6n8b=)>o_X`RAoHma_OA}HRbB{AR0XVldZPIt8wzIDxdec(L1eVuCu zVm!Ntv+J@(a8=IM#n7X$nh|6RmNYER?n&Z}FXVCTEQM}lTW*k!wN8d+0t_=_ap#cJ z-f@t)Z;$L6C4zvgS@*r&+Jsq@(sCSD%SZGLPTz!{Uu;Km9&7x7)yAguJsf z=?)URxqNRxbVCfsEk!-mB|GFDa;OZNP%llN^CJKHn~m@NT>0ECQ?6}k4Xq3OJt8`y zfB&;+N&Y3NzryFA_4xO-g2_kC&;N4YjXugV|GoJ*5-6PjKMJN`5OO*V-uMBI-Po?Z zzn6%;ed$=zY!1|EQQJZcsj9IF$)3)h<&B83_Tnn+iUmN|TIpf?^io3?uqmnv#B9_6 zzK*X&f`_U24te3_Er{Di^Pge;D^?RRItHtVlHtMC^|VI;;rP3Gmts9Z&5Ep7h`|~L zXKjJFLSJ$Ztq>Rv`b60Sv1~%!%s!lr0JnhH!wyV)Vlx)`c>!4gdnpZ??%Hz}kh{d- z$bbiJZo{^VYhU~m2yUL9;ADAkt97t4S4rL;7>CjBFG>!+5DMK8g%7zlbP(DG*hbKK za7F{Z-Pru@0a*sGsbjiAaMDe4@_5U!d+i+ceeHQ0Pun0TUi$7tWm}^Ui^O_|f%V?- zCTw;O5__QU`=2*F>>7IYWFAhlXy<6VBJh|;Bi!tEfJ2wgSl*5CY2`?YO6zt)fiH45 zJ_7Omdv@uhKkAfGZH>Qe`zQGQN4#Ai?^p}p2LpbY;>mB*Jo(K>irI|b8sa~H z{_7P9kI{DU7nJ`L9!MV^-^Z7`-hcnu7>aot>l10hS~)QwZ6QihC>+a=ITQ<7ee1lr zR_=?D(7I?<_?;ZWy~5Zg(A{K3b%UjPVWAS@3;^r%X1*~L(AlNX++H|_&s~AF=~s%5 zyF-Os%^@^$p>^c4zkG%_*a#dGX*$yy4#AWUf z0hy7^YOIDpZ0(*kiCeqL^QQYNBxU}}BD4s}ORJ!XxYYo>3jM9de?OSX;|s$>U|z<3 z;*~0Y0Gm#69DGTZf6$QAJI41D2LJOj1}9w5U8;^ec_VnRUeW#4IKGFN^!`5~IDrBm zLRFT3hCdex8P0&09Lf7}e%Z|vbnhqr=7GD9lMK%a_Y;%9zXt-#amRU*^NYdem!{~y z^iETwU+~`7_r|OZ1j-mir{LR$-iC0Q9@nzy;F{YDLA zGaQ8twHf&C1d&%9LPl@}xdrak(3Jo5tH)8R! zT4Y(x{v00y_b?i^D;;sSyQ8Wr1MXLkK;pBXq5Gl|Jxrx#PQ!Tb z-rt2u(zQ>EwwZH@ljQ=^a#@RyJXAw*HMTCGCAt_-F2U;@gRo*A2T6fbgAs4D32ltk zfTo6+q!mPHS{bnR{t5}c%R14Ww$n2iE?g*Fq(z~`aw8zQs=XKgQIaf7ZmE~5+VI$6 zTBg3hZ!PenQv~T8gPeQyS6pGX%AL+ft=>pSv{d)ZE3HD(B0~w3Mq=!AS;C?Pe&=$s z0xL{`<+b=hvQ!S;F3JHiDb8!F?GRNXfdG(D&fqN z+tx0$v?7QqC7ur}M%EPIH(ltsb!E?0ldoz>-{?SSd9=J15pGPkx_t!)?b`Xa*zW?j|xmJY*i)o-} zdlGBV=d}|+Pue6fI>7IKv?G6gGYo&7$a`K)4t!JKE&695@Ok6`uTjc^wCA}MuSMv7 zy=}~qRCf=BM(Y$oV6?cL=_-Oa1JIkq>}$csjH{t!Hd@SiS9xqIJv61u@~lV!mjJ$W8a&^PtpHJwij#P=&|f9* zM!`3+g==E%P=?v@Ea;m+rA~~w)s}wexOY-uRg){Mu+~MZb_lLv9DC8f&|?e3#}xx! z&^H1pWT3lfm#89;d+l5R-U81L+<|FQ+S!wqmTS2 zJ9p}vXA80T;-BKrQc(0firsiJ{5}sFWR@lxpG^1|FlijLO=I)`;O|L(zrP2{j^ii! z{bV#{P^COD`gWTF^;}3=NH86O+im`LUT&jQMQUE^g*_s3erec-jHNm2%2Ti|J<}1n zX(78W_KbiDuR)V?Zz2t?;t8(}jSWZjBZ7Fbgg1j{OX;%~A*rrSP)gVn>?xUlS~`(t z5rdU7JSL6JKo!JNd zVKL5tOSL;?UgY2f9vpXpr`9M>BNA+`;1Bo?1UUH)(@zD5zg3`p82b0JZdzhULcuS3 zx6_KhKwlRrI0ScW=Z$*yf}}6OG)8rYL(;1Ts6QieYrgNkxtV&Zvo ztUh0Cn6d{>LG}kEf$)udHx#xlsaG;IwHSO^e8s7()~XU5Ty){filo_@c5xzHUZh8l z4uy<~SKc3S(GTo*`Fz*&pzlbT@7QUm`gC^Yi%8h8Gmvi-pY+fpPc z&<$aZ84iYEO1)8QAi~bhag{e-?IBpJh9gAX zzDe`2s$#IZttgoXI%GwMEaHaNGfdPu` zvqRnmZCgI7?zs{HT23Uiwwpal9~6x=gB>UckIj1VGsD2v{q>6XL}lOvVctUp4&}Pa=>uT$D9h!!7v9r&H3;A z@85r2d}i&LY4E3D@X3O|PEvZvxOqH2sPL>qn!m+Q$~|0L@Em@31S)dAi^WSYS%61- zf^&YH2u))}s*y!sWyua96r~Bgy80)b&4Cvt*g#;32tV$Q~=?*6Wn#lNJy|2GQc~w#w06W zf;OeTIKi+QxEj(`S?Z;i`$U%Tq1_EenB%T)Ajw%ue7Q*Rp;zRaEbdC_qA&W`I5-&y zORTgM2vUXYOA=o*nNONs&V5>dRg zX(2uyp*y@%AnLDm_~i+Iz!2qzDH+`k^qp*$f1gZR+MYy*Pj<%>Zz2|-pRA9g`Op_m z_4#x>o$~cpa}mi0^)qw6L9V%*@KIhIYlm$p|g{0&Vq-MeJf*J&7Tm) zYKAcyJc&IO?w=X8T zu=Gp8EghZIaZC5bmjdo6yXUdAOUH(qW~7#Vv}lQ~b4ftHSjg|3xQY^hrzJ_DKzoan=xcqbfT;7 zU~dR6enmTsf>dq!SVD1&zk~dksGE<+gKop5cmAVf?M-4hyItRxHT6TQJ42D88Mp%L%%|utD zGE!XIb%^dBCMhe!0c~x*n?#`|IKl_N$&x|bi)H8>w|3qAOt$;0x-wq`0XdLg<*X)J zGsAO=E3$O_bzWES1W5PoU(MYx0$f+hyIG_o8?G-CCl*`w6$e~Na1US|$zn>2wRoSf zUbE`-0)emE6w(6h+o&~Ng*eCZhO|~E^>?Wp@p2KIH|2W^5ncRbg8@$&_o+BGpzKgs zEegp4zs%LlVOCG&rKLsY{K>~~rlaGi{w&Y9oFuUP`2>J2@y_uo`b@##o4&!%iOWqN z81HK`%RHypyfrgUFp-@E-T00rg%D<2mul2{dl>tiX+{j9KwgBn`J zwjdN+aajV^&Y^1YhRadclmG)laEr=Wo6_!9O1peHyl0SxZ2f6NHyAF-Mf77845Z8@S`8eUTc$G_mn(jRO7gTA9 z=n#+zY#kh~7G71Q-j%N8QwZy-(|? z^>zOA1%myJ>27S%k2{`bOO%#ytHUbEo_h<0Rkke2(Z>Np3$IPGa^$8(WbF~;H2+N4ujP=`K>H9Jc(v@B6Kvvn$g zjX7g_R?FFyd7T^`JT?bu25x#F>kDR%+SF9d4;@Bm=a2<*<+WY&Tn4U~%mI$+L1B&B z2JS&ZG|!W{iu#nK=h$=Fmd!}Dsp$srS7lVA*YYAjNp2x{0-SN2z*N}XBJI0K#%c1< zI&t?6lI=EcFSgwJv%=3wYs>e- zd^qZxjZ$%`^6g~lxy!?fF5uZuS(q}Xu^#O5pd;X}EIM_Ki=<>XG{-)6bmA)w9um*C zyaTgfvY0Ks!%zYqKpQXWYnOApQ6zYeM6}0QK;pp3IPqs^ZuWX~^-gFQf<)!t$o~cV zEnT02?#5|Pj_q2Xlez=?Hji<;{^F}($>Wvp3P&3r3+rt&70$fN!EI0nEqWe=z_oe^ zHV&+Yt3ycdVL;s^yL!}t+cdOLGq#imLz;)Dv^)aI#a@C(dp15(RT*-w1hu8@2W?z* zh+~}eWNsv4BGNr4QMU9Y6`L%;gNv@Bm-#C zA;ZK4kih*2M2M6Qi0Q$kXUd}e93E4UTQ3a_GF zi%1;ZQfID8@G7aVs-8fT4Xu-GoBWD+Dkcvc>O&!(^y7Cue3d7~Xo&;6L_M?U2B@(# z0fYCx=ek1i)|Q2+41;|Uz8&}q{FYOAFws!br3G~9q@Xk4I6%>g(KG|0GVIrbaFc9I zRk^Th+a;=>nC~aLPiZ`--3C0DRt1hDcL-JQzA8wGO;|3_`5RpzM~wq@}E0Ohz0=5n+`F&V3KeW zk=0E-Y7GjW7(FVuz%bvGoOiiO+xNLqou-?~V_fD)EhIxeT(8BQlyP&OkX0@+8(mwuT z$3~~lq8}vZ_7kDEW-Z5n-E1aXw==ZKl8>n*i;8qKMjT0#1_2s08x=c% z!NrVi!K-uHxt(chqSS*KU3E1}`UJ;<&g3zRwBf+Zf>R4=+E9niE=LcDmK_*6wFS6K z7Xxg0gR>G7W-K0`hCWv5h+Lw403pf)>g!WaAc$&5m7a?wK{M@*Y?MmAJwIX7EpRE&a&QOI){yF*-c z7Z#LEU*~hr0aphL)s>+RBc+YZ!sJ32Tv%~np`9;4+iF2a6q68k^BOfJdiq#gPm(fFTRYyKSAD zq#N99cv8sO;+q5U->k9F8m$R99tgB=egxA9x{yN(-u47$esMGTSQ>_XDVW|DdzZBP zmw9lLs%*>V$yKwn{s>F$xG^&xRo^Cp@#t6rvo!x=XXeN@ez#N7ZH`O z%TcIp3i^i#qeOaEDqR@PSccUq?J0y6=PFE&Xs1I*#z!zc4}4SfEh>WxqUlPi_cA`x zov6e@pOr0>icE;v{|(ZB>T(JSvwqB4FC8n<1i@ZmO@j%KwP}D3U218dQZqTd_8S;9 zHi#N8>0DP5I4NCJLwQaByd6;W*#Kh2T|ryL-~7ZZlrWO@o^;+Q!LON`)tbUpyUE!kmknL{Jz^1oieD4sPhyf@1e1iltT_;;wWQ2~iQIfNP zib+>OgA0rej-LA}q9!A@$aj_ZD*4r0QfTh_H9=+)`~+MjXcfTaoGrMF?%o`;LuuOM zg5GwFS5fFEuRf0Q{OnBjI{T=UNXD={_SNhR;J+p`OW#pFrqPAc?~Cjmf~S`0N7=+< zFHFzzlk98e=am1*wbk>T;tB<8s(3wCn^ z13_?>(TF)`oO=Y3&j7svTa3Vx6(&fYW&>+ZbcUuQhWMbw)(Xaet$VbcjLL25UGeO-YmgR?7x-nB{!~tVUs=37OAy%|8lL_)eybg)_&3_dzA%Rwj6fi zYla!ZKa8$#D?NRKyEtrVTKuvF`S!C5EVQNGyCT~f;1&KHg7@7?t3vMn#a~r`mxK7m zXJWuB>Uv1tGT`K$%3Cy!0NvC2C>pm|zyN*;1q$z%7Fl~LL`OI9flIroSi*-?e!2Ra z^gJQ)TSPuD;9uxsdw^-C&8;(?T zutKN4$aNoSEP$&(@MFeeg$R;V%xT_4rF5Jb*Y?1Lazk74!az&^goL zvheF%Kc9l}N7cQ@SC;ui&HJd@frFG7hqWy2Xsk1ewdxe;MyNRp)6JEoxxGjlhcCd@ z0m6-+WpQ=M<#=}deSUs^e}8vj{b`14_%b>(NkTqYiwL;q5+3=hwp5p=D*`-<=CP(m#3;?#p`A(eiBLooCm-xqvXS(=j?@ah2J zAG%q?rAl8V9>mJQq7xf}@`nwm$mXU8F}#tZpr;Fb(ru2dyn$pqA?1Q!Erj-S-;N?K zJXsI^_saCzg7kCs_76II-=15vmwqyrpS9+PIRflbLlnF}kmtrdggS`RT#VC|f|Eim z0CsXMz^AIe#iMAnR1eg#i?eUV|Iv1Cy^Z5Y6pr{T^dL1Pu$u>KV(_*3|9{?^tlKG) zN~dRb>`2j6Fi)-Uil>m&cPWZhq`QqbCxLeW@I61S`sAr$>cs?oB7I53aJH)lR=|&^ zDCSXs-0P9s^Idv_pZ|S-eIJk6ktBuJ@ksd zr7>c)y3u8U+UL-PRD9ZkaaJ8SKow8USQTiBOcnK1AaA(!l#KPW3Q`Rw$ND0`YnrSu zHU`EOS^eG6Y+a@>)jJh@gqZf<#qJcq4lPPIJgu8Pr|;_DmFa8Yb})$!E|^=JXl!qu zCnNU5-X>9soZLY82G2`mITl>4p=ygG`x{NP&cMURE_r zxr4h&_{$LXdnzW6t7enmhx~sZ?MSZ;B(14F*<7C5P;}*OeI#~eR#szyWSHJoT0;YV;)G$Y=rhiz`T({IZ(lll1JD|NS2%Cm9 z;dG~Oe)jrZmyLQWlS!{|W&d>;bPEFA?bRUm} zc#><{V#noiMKWrcYR>|9L4;>I`5g|%@X4n*NZD;%9u6eELVEP6t7?`Opt4B;`xBp! zBobHTw~&yzDxbh{%a6ynO6YY-qzahK#j&%Eo}YinbwZWtOH`&}sohdlAK#!hm|<*K zo&tTH$`)t#X~OdhQ^2n^Jrz*Gj^QKNZ=^X5oRUv#@I-Kc@KXjU>1+k-+eQ0kt0|7N ziINA3wM|!1>H*%`KV6QyF^K<0FH}wSE`q)MvP)M{-4%b;jT@&-C(hT;*YdUmd_j#a>ECEtwFz0% zjnZArDrwfqd1DwIT9HXTs55KzZ1Lks_6G90P{!@lJSps#1_t3Ak0sa^{4})q%DQ|W zfxj9ff8@w#z-MHsk~eduv&4V1XJtJ)t*^-l{cv0xa<^IPnTxFKVuKZ=Tzq6jTkA@- zYuBMzv7zYF)NY;%n0e=%^UW%G^Qvh9#8Xf@fOp+R1^n>WJ zG~hf#RJjxU%z>aUk?45NuT#kzoOb5Ejo*>q=omk$P)DEfh#tT9Iw#V3gQA@|IKGHX z^I2w<`DDEM9>woL2h(<}aZxuNO6G%i8HJg|<2R>bRPJp0#CWwV{miAGqkLznvs6x| zYWG=SX!M2YgU=FpsMG(d*GUyO-m0bEig{^I@y-TY%2u!H28ry>nOU|F zKt5b>*p80b49&K1%QqT%Ca}k;383v(8qI2?GpOT9F*j%Ppott!L>4htk19j&*mDV8 zm7L8<+Kjo}#XI&k#ccCUq0&l2(_Vn3=CncJ zX2Eb(kvv|KGn4epm4OvG={`+!9da&mKHEht87rIMNkDM6;7#ONB~>? zRSlZ5z$jqtMAFk*x;Cj<1_)q{B6DR{0UJpTC%bo+^)*$P${=1HMLniVsxEL{KEoiP zgnk{>(QDnrL0lJ=n(IK_8V1zYx*LlWg3mZOVa~MvyOtim6Yk#i8O1{iV3s+k>Rrh{MQGbA<@?0n-nAKniD?#j)vIf$k#$dzR2y@si#A z3gX)U-j*4+&Cn}tx>;B|&^eyVzDokpMr96APpnjUw#;;PHJoF+?{!@}_IjT8+C9!d z4!ZbG4~M!f1|n<6>?~%t%uY@{D2oi%eZG;YddicI>5~R-8M};Q=JV@>gUPDCA!lq# zv@6y^RALyJpSeJPj*PG9WjSmBmxb;*9$qMZJ+ED?_YEh*oFmRvOT4=kXsy=c)ZeY5 z;!RBT!m795NL{HUq&-l4*lw__+A89Dlk}bao*{6pBNx)M*hC3yNh+8DhNSVX=V;sZ zYZ>5#wOrNvk$}VQz>zFk?ajanUJ=7)@mxH(>~n{qcNcB7)WumzUM&n=!k4(`ZHswX z-YB#wFBy#!0|?eBLIBF$RG*Cz=48fPZ|atvNniOr*7WPT=HEl@@r7l`vCje5DDC4+ z;CYIo$0nvp$2U_c>UsV3!Swxb1-zS3gmug7xP<%#nL*u#W?u+%lcIRj^AtOqrZGrZ z_}siCn%kG8Th(EDh7YZ8p~6Q1reAdalE| zO9VS-Z#E))Wy_BZfv=D+&PHAuaqID92-wchbLd`{u_ptUkj^TN!ydu#$*=1q=4W}V z5J8?e!k84tme3t#%kS^3klAJ9bF8UG?hF>`dko@o%$r0NA0}ZrbF3g|;&-v2F z<24+!X2DAwgw`s`;O`Om*mf5mQ%%=#>q(K$*9-z!fI5|rZjgU}@3nB!eDVz3G>4`~#=C3Z6!N^$mm}6eL;1AhcQxPG zjYHBog(;=Um17M+mt=E*H3l6A96`;KW_=4xaxm*=_k6AhTBxjs`M)?7zStMPW{=er zs|M^=Puu!9;@Px#rL2CqI34+yklq!Ff#3saTw_f3s~V`;VdNX-+Q+Rm<`HYMx2~Df zpsCeRqo(a+-4tKV?pyG;$Uj~B3WeY1fxUUIiNYxe8$XOql9$Xx>j8z%k0^7Y?P;>0 zZrBz)Cy5CI%ShUX4TXSyWsDtX7r-&?OLI!ts7=A2lf14w+tmTJP(O{$O|oWC&TYyK z(~h#Y}-<{M?(1ikF~SeaU{oq z@JeUF3kVdjsDrb+kXPsXKi;;*zaXV_*Dj{qQ)OpnIeX?XpCcF~&4jL4=jEXwe-7#@ zq<~^n!DnhmT7_^Dz)&Xkbw~MOEk&MsmemRZ8^Z=@;6mY2 zL$JESrv&q!S=I7_zTdx_h;p(*6ux=llf3LhB67~=3>GGP$)o=XuuUm!tLqYrun~w~gPX{ATw0uT| z{0vP^{lcE#r$I8Y_gaK7ZcXyPLJyxK`UQeH9}7`uT7)qcnmx&du5)B=n7-9h+c6*( zp$RGG;8eR7#)K6mFWWC9mB46#OXP}iYvo@5mmpgTD3}Hf>_y!}b61{{mI^Hvdr6{L zITL-@B8Ff>$2MRe!4XGFQy?=Ig_HUGNM`i|Rj>7zL%XoK64L~Zaw7r8{Y$|`|X)5 zU$1nA$sTn-ow5$x^H5`X__QHe6-g|T_e{%{YE2V9bT4uBV3kq!^aPe=tY#pL8Oxtt zYT>W>a|9w6%`uk&qdrF1+$Vnv1L5#skc!%W|Bh>qwN8D8>uNe#&kySWs-z?<7s}PICZ7$tWI7kxer??3g&}9?HWKZt3Rt^-xdePk z0899MnY_FduHrS@oQ>m%N4zshee6SDMYT(qgw8EWVHz~i(#k~PuyQwqqK{AlPI0XV z7l;p$yp6p43&L0hu%2j+WvwAg61s^BCae0AN#JhKZe~=oKqfui6t@Oli!K}PaLB0u z03ZNKL_t)7jjn>)Hz3<=J_=Y3u$4!_7w^~jM)Od4qZJVB?sb{xK=CSU=P`d-*pHrC zSnxa%3}U!wLzA-@H!z&3lXzBs$9FWJ#dtm~7hUx++;AVJ1Dn@_9g{tZslRHKDf_L4|*-c0@Mz&UblVD~T-rQ@r8G;@T&8 ztACX8m_JxD-+0Z#%e5b6aE;&2b=m!i6SHj7Z{lp;QVf1`nDm%tVK3;#s_!1c2;civ z%Xd;Yb@Qe~Tl@3>mS4aAK=%06YWi$)Hf=gG1gi!PDQLROL(|%#8%A)XvhVdFJ>B!P z>2?3YQ*+YK*jXHm@bnR3nK&6#GY;v%{MF(#cW*3?Wnc_Y(>h9vp!2u~`sQk|Dr5>Z z+$BM^X14Ungr-(@Ne@J$8C!jG)6u1lvlMdafMV_?ok%)E@)BM%oVBE@)nva8uuIq4 z54@?{-p$|$)!QQ^oY&A*7Qhcwy2+VV6WZSI0V>$A+BJ~{*=Nzhf>Ms*pvU|hd>f+ZJzrS!|s!>BC@L;FRpP=lF$r*_BKtz}qT z>(eo8BeV){GSnF#EJ%mh#aU4^EaB_@tM50OhlRO=|3B^Mt%_g#QVfUlOc}wpgIa!p z7cHK0L*KM85AuO^rI1gKuHMZwG#7?*r&A1iORr@$k>sPZSL>zMWz^JO3rC=DjOWB# zto)Y0518J4jz~>fXPU+}KSIoz8VuR@j{~ll^EO=bYW_-J{%g<5{-ZEfo}v}!Dd!ar zn@N_>&~4N|+_FazZUHL_mEwTg4sY56o_ijJ84w%>Qg$51;crPPLrpNe!*Ps!7G`Q7 z3QTI+2bfI>yBH=7Q$t<3r`}#eZKy)ajV?`KN%xWJTb0KS-MN$3FwGTU^`dpNAo$ZD zlQGBT9mM)u>OkX8hJ7#a5oTZIp<8z8V>3JJ5x{GteeA2mFu{Wy#NE8oHN2P|V+o#xF@&ir@Vm7Qz$nk&8kGwSn~RdkK5@3iy#@bUF}eSINz zzn}iM^DH#4(U%h^71fVe)ofxSWxU2zHlz0zW(2u7D38zj2`gj{ffj zjlla)bqj)9aMIS~yAFH8EC~`v)7|Xa2yYfE>*arl*9wCuM$HNXkGLFrPcJwxX z*(4rKDsRcM)7_ho$cx4uQE7;jVsUE<>~8wh=X(fK^|#=S;Hf>}sbRMz1KPM7Lt4Vt zA%I0EdWe|yvqLgns)0>F&kH%*r8adJ?JFE+_)c}rBH7!I>i3D0p2df@vCwtcDu(aV zrdKk+P*7LcdpJb4TGA>`$=Y@(Ejt^;*_L}$bJg{!9;rrPV{&0@dGKG*{-#v{oryaZ z`MUwHOJSGUD1gN7X+$ zwIfOS&27&$I3~RP^%B0mzTPI@uh$n8cf%7in!mjH=mj?P*VnEF{9()$MUAZ!D>< zo~~^sfN5=8YTi9eNL#ye14X>@Sbqc!yb;1)6rRL&aV(%7!0Q0&N!WJ{y0O$Pn#6J` z+}zV1%4Wr|o|vw7o`R)|l)iD;RcJ@5V?f$^%JX*=Os(Faht)b(C%NKYh?;j4y9s?( zpYY*tQ&}o9Yz4HD#J$O^fJ=&J9b*Jjf#>d8>sJj61&UHxDlrTicRUcQxY7 zq%O={(ZPY(r72Z=X=YW69nFES!q8P}^P_10?{KSm4A{qz7euh<%947bf4JLSP!bn# zp81uK5^BHB>{{|3L(E-?mW5AbVsfA{4K%G4 zki2rdmdI_8+11={2tMV9HB*I2QsZYNzPqZP>jI|K{_}VKu2tXq3IFo494vg3*?cd2 zUs&^n^VW#;cLn^jujeO)n`zr`W=_-Xi+;~|TDeO*R)%xP~G4;E=nzt`M@y z(dqzmN?V=604F3tNCq}#|jH0G6h>M_es>ekP1bX%Isx73V zwIqA#_-8V;dr8DfXnGx1{q<&}17=ZPDFclIosW>8icDTcL8s0lAHd<|-X((-5q#)n z?eNU>VO(WwH;R%tR&`Mfw;+ju)h#^7W9nU7zi_j(m+4!(8Cuj?{{Hac2!>8!|2Cw; ztFdXjpkSPGkh+%o?Wo?hY`Cr{pRrO5+(k=S|J0#y9S%9YuE4obJ{rw8Un5qKgKxZHXSM1r z#Ho|tToJK&Szz!aC)_DzvhyRQwoN1Jo+KG9GU`f79hLQ230IGQdAE~#+>6fsu<__; zP0n)BXvgd8wbQgHZ=(W6nVilCA^iFW0Q}e3mYdg4u(AIGiyeA$jANEL48uqYTccdG zQN@0wr?DQpMytfkIEpJQQly31b50aIoUGy1d%NEO-}UQ&`yQ8^a&U%guNRu}-F;;T zHVo&QcRd2^30sm(;T{mfQZDOMXmOlf0K261;FTHGJ{T(}qOn&P+L3iGCUhk4tmh?< zmB&)%-utPJLv3vf?eOOeIA1~U|9*Q1U+B(tJU}RAA%C%)nKeCV#TwT z5hHTfAeYTdJy4o5qjO$)4{bm45JgWGp-P_L!|obHR_|7!P@c@4?4dwOhsmTg|dln^=DaDR^i9! zq;f?3iYr*XRc4qPEXxO=6i6N>9GSV_pqFj}&v(a`0nzs%>QOd_WH3tQ1%c}ox3N+= zh-oN^Qf4a{5rIcCa~;0+5*nhH)Yc-ky!1Na(EBktvV*ZX5E%MoL^Up!=Ti3C1|>Vn zUKGPEDc}|v9U%Tk3iu}b`;Z3PnRH0b-tft*wd`@eit3z zuk5}~YZR+Kb)9OWwJ%%G>JWvnkhgR5d7b^wEf{TA)nCV{$Ih^CyZ*x)7&`l#R3mhC zJOjXO!p;Y(eALx3vgwo(b+!KUj%w9W85@9B6Ycszbkig<@~_cp z6-4meSqfacQLQ8?-{*v|IgFf-C7&}uxM3MmdrsrPi zb{js&jM@7&$t3R()*TYSkTk9;Peb7N2H}Wb)0;5+v~M25Nj?1L?Mw0MAL>oF_uh-W zwU0et&(A&t+tX&h&-JUkr@uM=9<0XX#A)3qh*>xX40{yZzbSM){Clfs{5@mRDpcGKDl z#HckgUA9o>B*@iCX@ENM;bd`9=MI?`oi18Itn}6JGZoXeB+h3Z<<=l2>f+4=F_^Q= zGrd_9TNagYgVmh6DUN&u1$<9d|pSR$a8zU~6Us;tns z5;|ptGw1|8d+s%1G+Lg+>u0L{eMTk^acau}KZJM>;A#KS16k;fn+WKedp_{v%T2K(tvpsX^#UT~)7gcX>w<+Sj7 zY7_ESrgIfRjOgzl{%O>0hFyLyy`cOqEQf4lKJ8W2uL)K2&F7ojj^H!?#(>?*W}R~y zgb~#a;tO`PXO^pF4|YqRYRxxSXEdy7_z{_P+*@am9$?++wz*l$z0&KXMtJ7N>L*v> zZdJ;zLq!u0tUO%DQsfmv;cM_wQwn<<{*}Ssd!%J<>Yj!BM>1N$oPc1)XLnl*+52NR z8B1_7RwN6er9w#(%N(HI)HA=v}Bvt zlBD&LoZw~b<7s5IUn3cWfyZ9U?3VBMiV2`|U;i9KfH_wkJwGVm(T6qUjU@-%oU|Zk z9lVeC;Rinj=tX@T;>nLu&5n$niQo3|Nj6DHx1_0W>Hf{vgmZd=#)D6tW9Sw9_DS^} zS$@JH;?5$AN*9pC zgym2jg~YzCjYJC{ie%}W={7A*7#FW^5}uNVxrOBvRj{aSX;U(R>M_XOgyjLk^kYQ3 z4Eg7;1@v-1wv_pHc659sp<42Du3`##=2S!FZ%iIJ80=+Bm}B7<`OCPut!E2WMD={8 z9B}kL=fb0u^Br1p#5gqMfFDlG2fvUo^g}YfrU)NQ=02$B0D~Fge3D;hz_4+2LdCnV zbP~R1=eh-+ui(5TYx;SNk&w;S;s4GOyg}GL63kU6qSaS}_* zOzoU$S!ta}hR}i%Jc876#HDlIDyX)IRG>GNkuCqf+cHZAk9Ee-lPlIHhiviCYHP;e zSdJXJU@y~nIfdU5O}T0*4q!0Mk0-3>KhLSX3Tu6XhE3hAVyTf!-iZQE5dX#n{jdK` zrEuos6`Wj|ohoXtY@TiqA#M}LSh^k(9pl(;?z-ZPF=LH7SCulplXIJ;Y4|$O_i8_- zoyhs7?yOV2&`nja(Dt&-Z)L-lT>3D~SN(#}PDSy>>1W2PB#@sxwQA1_3+>-;h-nsP0zXBn>ZRkqD>mUaiYV$U;{D^0?+P&`_$owQK~3$2B!JMeYaJ=lSbP7_oUd9t}+)2+k$UqbG; zSPodcUNWR1>KC{V?_dh!D-fH0^slS@Ew2ITxMe@l*TO z&#`MpOz;kEHQH?#%0U3Pd{s;j^ZsA1TUoqX+0bP|_Kjdww!UpX&3D@sW*X5RAXkBw zEzon0=kX}8`G<0*=u=ML2I@zf)^+8qF>m*OJi>YtnvNA(%16_4T5^4vgX>In!SxDq z)U&zoD6=`NxH-qauh)P6mt?N>?B->{u6<*exuHAD&}kX*bF5m*(dOu&t|`!*-OyEY z%7M9cIHI1d(=QYjb+W|oWh*erXx-!A!*NLi5ieQFOA(vv`8f7Ht~Tt=xdO3C@w>sD zudzWe8kR(?safV4wixuDt^9xphCU${oW@!xf^J*gfu)Ehdv@aP!Kk%n@f(_Zj211F ztQ(<1zF!o=pG;G4;h>-%+jQ-iJ2rybcLEdQdgdmC)m9&zJ*HsFwss%pER&3|{d-VV>+4PREkU-|082-TQMMt8L)n`4$n zWj#?H8nAcO+Kw4$s|%U))j?5r-)z4QB_bn9Hoe*cJwf3rE16f`4y*CzZhX;}-Hsn; z3xq3Fud4Oh#s}H_1-Roo7nr9EwdQn?O|A}g;H%V^| zUcK*DlVz%Mt2*0Li(5ta{rbfB%gPQe=)PGSuMb3ScdMiY!Ef&AObBUInU`U?)(0=L zyVkJCvz`WiuoHQDE#~P(a{ML%6!%Wn?&W-^iOaZQ2Pf_o+5Nn3%{~>-^H6nNulD-m zdeCqi!7pFletNt&mg+B61#%P3^@sY4sjljr)&9i4ov4&=XDX&@V@D!3J$9*o{qOrh z|MhoEo$Z2o=I-=#S@1s&&uwVQ+Ro#iJ}RPBZx0U6tuNKi>)>X71vrk;yu}sudeU zGV41x>OUg*@tv1Gi&vPb=ApyeFhY}EKc>{D)IrDLDnsoQtu!Z{-D9i8xzm|X0l!~syxRvv7MgK+vn-7KFJ|Q%-neQl zCzH+X^zko_(gq8?&ZNq(D{u+riELR84HVzHiY%@#u2j*~VuH2D#b-lkFVhr;?4lxN zY1=8ab&{EuDzZpPk)2Gal;#HdtJLmOJ(K25Rk}2H-*o{$gETkbIA?0^kknHDLWATC zIwq1b6O|vDQ4`7d*D-~LH=KC&neyhZ>tMp1e&xXsMrgb<@IeCbe&eqJM=p52a{P^A zoL&QM?Cp)mJBMR%&5en)3a7vB>-4wki$!^c<$*xyxTjKCohDHN6OtQwyN|w@d+%LTq3-xMCf$6AZ zru0$ST1n1ZWf|vN{*CfR0#Y7;B(N{nngg8?F94YUbO9oE0eIMLNXH&g82~ki9iUAP zkehO!fj|%(h01}485?_1w-5$;B@pjYBGkfxkd=c&^euVP5XCu&-GsFEoS9+jQK%eS3YqeSW$N0M1MIdhI-SU9O?mVAy)N8HqX>sG#j) zQXSqu?=HIN)ON85ad>3(+u+=y0*epUY{$s@?c_v6s%nnqr_nZJ*=75xUDi~;r+U_y1}FQXbDO;Q@+R@q zmjz-evCt!0p9&r7grwS!Dm_h-F*SLUepGPr)k|iXYC?2XOw%+qf|H4A3zMs(?S739 zzrG{O$z|iwr0;rL`==o|;`Dz!hTlmVYN`YWiPZDp%MDd-a4{1UVT(X)K4tE@SA(C- z=k6c$yW4?sw?p)L+%aq2dv~ek)OA3hv7<;J(v4_?rW3*tB7nZYd4L>(s~DI^Rz%JH znG{qkH4^){3eYAIlvo-l3aVs+7Bi@l39C$f2!;&8iGq;XQpxDpQek5uDXWP>Aiy$& zyACg4>pGp6hJNSd>QDaY?aNMz-rf*wkfWaAXrMP{Yk%+_oGRhR)7cU#$L`z5?c-~{ zU2dbM;-6yQ@h1n|U%k@Q<$yzu`=x`wicUUn52*eg!nmI-XE*Aqv~Q2g=SI6n{zY@q z>%tcJvhoTk@hw}`X>HNL0`ZyGYT>!8=CDQ^muQaomC-IiLqVwk03ZNKL_t(xvT#dY z+wF2sIl;fBu-)!>6>tOY-xB__N;o=r7w7Wr@e;bstESlz9sRx+1^i5LaRo0tHXzTn zWu=wdD@JGPQsp&A9B}|qs zJ@lCtf|pNfYv#--5>ufs4o>u?Em1s5fYK!;PFx2U-~f|0GG^nX)q!Y?DnU}Q4j)Ri z;eY^CK&!v>0pF8egSLeguvna^BU99<)?ggR#ORV@Y>2O{FADtV`Tz7NM{EzjH3S%@ zGM^nMCg`<6^M1y6eew{7Ge76`WE0A|rw3@j!XBkv6IA5UJM`|r-}B5r<{}Ilsj(m= zL#I^Hx0Uw2Yc&aEt8S?o4ek1tjz(d@r}42j0V~v7SeqZm-0zv&*9t1T-3XxO`ub~j z?L<>+kN2b7k|!#f2#9@@z!vnC%*5H&X9=@IFhjxZ+7Wht)3jOIvmI3Lz^vm z(|#y{-9>djcW9^1*NwIG$M@R{+O5a?{rmlLzXu*o+2Za`eh&2e__&ScW5*t1tEtI4 z-A-G7%(|9%QKPzWmT_v{+q`gDHr$-e@p~0lan*|-A0HRMZo)w#02rqU!k91LXk3-C zJMYZ-$K~Vxf@*Ogn3k1bin_eK2%?4KEJUBO8k`lx#mYd5nW};yAy=xxD10;qA81Vy zu?mVJR;?ytJ9mT5#q|p+sHrT4UB!5z+@b}j361inELgnI$4(wYvz{bp_Ng^+AlF>} zt7G1kf*%`guj$rYJL>x|E0p7m5RLS+i9i4I4yCilCSE>1Uk7c$4R7P@QEFg>HZcdk zIiO&i>x<&CX!b0*6q`*}nuwM{^fKtqF)HV0gRx-O^5*DEak{3J=qMhelWq{tUC=6{ z#H}qBZ-xbW#Zr^{b1-vXLN`*7O7Dt ze`!n+rPbyKHK=%tL_^>8WR>p8Lw=8Qz{mV`=LdbTLpN)Gy|8G&20#Z!!(!ha$-uZj z(vjP}s;SAb(K9nSOK)#XHJLz2&Sopx;ArFpqN zox+g2I+6)~1bU)@I`Jq5E$e+i>wE42hPfYkvK)==WGPN~Ld!$$UjKc&{KycIN=d<^QRLTc4TLL?A=)OsPeLsGpL)D(p7~xA=g4tV@h#Ni@TcSYhQi)nia;gLb(-) zZE`D6T0sjsz{hwlqg4sci&j@pI_ePK7uTMS4hGkb3>u`+Y;djyfOxPO#OQ|vaoUYLa<%*MD1Q>u!eC3lxFP&D7s0zno%_M_m6*m zjQ?TpOuHOcjWA3G%aUN6X}8^ut+s4U(kI{0|NnWZDz+-Xz2x4TOzw$#(E>=w+rwK6 z#v4KR1^^g68YklcyxNl+yaFEF?Yu_;tYTg@DD*Rb}y3TAO+FbPmPOyDAPhFXzm zgyNM`j?NL)YpS0~I5{SvJr3~nyyR~6CuCO_AMI`#R+#`vJsG#|#NrQNP^uoxgrk?5i6Pl$ZJf2G+h9g!A#hv zWs6#p7V$tCqP(H08XJj9?gnP#0NG!zV2l2yI~3PT(AC0du4S*%$RaV;GP^c6)#p)& zv};ohfG0t8hLy3s?fc$@BXe)H?V-e=zRiy9^z2{(v;x-7eQ)ErmG26msz)}1EVjO9 zJ#n^Wn8pI%OZO??u`%ykxW8Cy!1y^J=b_t?_rqLo=PSGjH@;6Nx&f%Aymj4Xp>A}) z|Hq{>UIE(+DqujdI(P+aVd!zaot%Sm0Pqz6Y}Nt&{Tj8uL$2SOeoVHTXW$)2Jr8;i~^F$L`~7gKYk*B-ETbiSE`R6w3F(66fHTGCyDHW$M<_p z{QAtJY+3e?7fV);Qw?t^=f?)o#b}^m3TR38O3*)4_V1Oqix&Ewf~!7S@57OCiEf2) z9C_rxgneYf)W5-4xA9mKr{~(9GOz+K%8%U?lGh zLQ)}cp@?`4A{b6O{}WLRM|FP0a!=6N3rG9p^o_&b6}WC zR%@e^Sz0?&*s0&~Cl7fev>TYjj-`X&!Ww>KD24&5x4YZzc39Et3>&N2UX=x^s%tk8 zd=q|Y8@2cTaOrR)f)Q2(U`)HZf)ZA!v90Y6hZDY_54Q^d*eEZ3>HY^YbuT_-e?k@_ zKoPM=Lg^X^>wJ7a?w~ApX%#sfw!&)i7>@r$-hKWTSLq!nj{41FY~1>3jGx1w|Co?( z^Kv{c{ZMT?n=5DanM&(f-JkkH>yOmG!2<23|JE}8UJZ)l$Cu~h_wS3ht8>}{6CE{ z25<88&6<};j4=XnM))-(B624sU7D#4>zQd@6Zp2- zZ1|u;irs8@wwZJBB&tVKvhgLzNqo4r2GsCuFoMk>d=aIl8uMT;14k`0YU6d#9E}fs z-*u>s5#&7@xv7#>CK5L%Rsq=t%lj%~)xIKWxsHy6b?Ib&%h`C)X$g6RutLN9uIp9b zoe$7|+jn>)a4UE_15(%zCoDXAhYsbx#eIE%jZ?P+&?24H3gX{%KlbzC1{lA>Fa;Gb zrHFZs2ehtXJ)E2iz#YQY>gl>ZulpNpzr4M?!Rq<#?d>_h6_ytl$-TIAh9w=$e)il)hvHhhn0vLg^(@|H!3yg?dnvEMqY)hX2EsE$B}z5t=|_6;qKFvU;YqN z_!rJP{z^lGu`C;#VqKDWlwN*B4i*^X`uGoiCo zBJMOca%{2z_U1)J!Sh4S;w!02_Y^eyqIRk`&K2{EN!V_Tm za(N1 zI{%0{)*b34b>4RV4!m3krtWkEF)STmd54?xOyOs6gMAO+?qC%H(yr)4?+%@r51@l* zfOH3AlDX?nL~vy>&JB~uPbY^iXR9dJ9H(5tz%sS$ifny0|msD`c=xFkOht(N)g0-^U$I{wWMlxYpYYO|RXzVHnSxY^CAoSY+ zZ%%gqV6NV!a_RkvmvQ+dj{nwh(~qBOI#v$w+Ac5D@EC>sSXL6EeW@=vw(S48-ooWL zzd(qQFP-2l)<5LT@k#IEge@!O{?mj#A-#ZJU-xg%G~M6Jw`cSZ!0YPnGZh?81B6xX zOL#FJ?>-LFzq2dPkPo{&x~aBEsXA^se(+nv)hM?wGlsBaqgVSHVuSKWd!=8^gR~?m zG>wr?Xl6UErJ>;+irw+H*wUlS(w2k|SZ6G94>kU6QpdK}{pIJ6pZml0pjqsg)}7T_ z(9Sz;HKiZRaYdfiBl>o&-r5;uE0J?1d$NBNQ@1pln5~&RCG6>ez{p)?DLyLx}p0W;Ha;xm-NI1kziG+u`YWQN~B-XNX_Pw6$)%Uf}0YWyW1Geb0^cQCZ3 z+9j>s#EwtZ=>@>EjoVe~xG^knta6*%AEPt;d%r~q{9>-4%BUv?2GaHBrlyP!Klgj< zqNRh|JxEOXAE)y#-IH-?*v*?v9;Z4`zEtJaCB~1eDoYNT_iV;_VUf?Ua}3kS)6~8s zm&3Qe9K!_nZV41dJM)odAjTOJzP;SzD{D#LCrpw#eM11eBA*H6a0ah{H;EARxkg*? ziT-LykJyw=R0bz;bYmnh2w-E(1J|);p;3I<A+q8xeS&C(p=^SMMk_Y{m|r z6C4O+{Kt0;UA7Y8LJg-2Z?w|e?%cuep|gq)6U_e5UA5ls4*4`@8w}04?>#~mXrU7% z5x(@W_4CeGMqe;lmC2M(y@gHKfC6+6zb5R4%VYF3Ho+LI+2%VyG-+jQF-r+XeesDq z!j{eaO&VQV)}uRi;QnH0zHw=v)>O{J)rKl3I*o)Xce8B_18f+W_-2-po>g5bnA+0@ z+&WsGd(T`Lo*;DP%j0~rQY1eZiGgBkZin7X9R_1pA2u|HJ&v^D3=k#2b+Vh z(qO=^ZOI8s@)aGv#vU#^MB@2yzMRjdQ~BPm*X#M(9j;1WZ}7Rk4g5o55#>X7Y)m1- z#}rM?eMm0~VbGv(pJ8tM?`lTje1Nc+3f<(T=bP4Qo z6yTafFYx`qgY8@?!xOOc7~?Uxi{Lit(|btm=^d}SYsTqJf32?j?<9%+fBBEnfALXU zfyRsX45vA0*F3@b_rJW*@*HMHkN^Ewwx+LpK@^9KQm=lI53e?H@~N2Qk$YbSAH&X* z)!S_=o=UKE6F8cHngJYCskKH1TL*2UD1Rp?HN@8Is~;|KYFclJ)tUt)(>dVyHrb~$ zqPX;Dv0P*Z22_HU(p!7`dB%dv4QGSgUqGO4Jl{9FGc1>@?tkw02SBmEEIpE8Fo3pI z^j^*(eEDDOT?>!1xD};!Y>+Lw&ZdnB#PiTJh?%dR|NrxPA2zYE$;@git@i7ZnIsS} zk3<}wbI-jtD2&2fI1w~nxyi+8tw3TzuO62CLzoz6WzMqhSDc4|8LzX1J@ zoBU%(A6E5wereKb%H|HbFlYHy;S#I2d^eAf<_SB8T-VO3bpWOzII#%WY#Fhp9hw9N zk}d$^?S#Zs*~8>+w;KQ#P!xxwFu^_40Gqo^R328fTa%r@w9-3M8as zcNilkR!mP_^8jP_=fAVf_olH5y#>u3AM9hSb_2$p&Bu(~rwqTMw2y`8UQ+II@n+4@ zSJ;0+vtRPqcwI(+h{$_s)Ma?vk9%?Nt>di{2hW1jzM8bU$(kv0#J=l!t0&Ra$H)B| zcK*WsZ%<8Dhw^?eQ6gxtrQ7&W7>lyXlY!83whpzF`JQHH10^$Aj2PB#q~;CM`(q05 z#!c2}J1rj{^X)cG0A1WO&|Id;YE*I&!xV|sto{ZTNohWSK(67u+bBeWK0OkU!uMa#}Ulh zy%8ZDD(mGW#l}(5pxYJwd?ukWuqEPBIf4l?vg*VY{ED*m4 z<7TufA%aY$`1q=fJDqv};8Q=G zw6J!$0H?j4%yj_DdpNzmUQO2`A4g0@m{VNr6|LH6y52yx!0&BnVcyheO1DwRjV6{7~pUfRc4({J}HPA;?7y>ad;EZJACYe zS-az%wHx&9GBF(vT(;7+B;@0tM&xz42pMlfc+1a@_%iZjnxP~qjwiU;HQ_@k9j`u< z9lK$Vwx9x{jsH2O-%r`c-?p2vuEO6fVl|pQz7!pTv5NSmc)o$`v9zF%o1i+SvHYVJ z-Tp?f*zdvgi?7r^+b`2nNA9eEiZ8uvJ4}8kxC(`D!f0$_JJorV(; z)}F4+_1GRLOihtiv*zv^JyEy78Eujh)<}Dy*8pslrT~R_)93SLFf@T!;x=yeZfm6x z+JkWz&b9|Q7R+Xivj;Pnq>^?|_AFq}s=u~)X=BTYjXa!jzc`Z&FcCj6vD2V8GIcsg zg$W2IPmyAq)KO>R_6*YzV#V5AX}>NYSmeWDapRu1=^`JF>Bu2JIjwz$7gL&qE7N*D za^)_tWGwSRRYI`WLW#x*$n2n|Uloebb|}3C!3!4z?jEg*vIR!=384cH4CA7%i42(y|K&v{a?TOQpesp z&5Igo1!=Fd>naI<@!R#rQs6H6^d3d`kK)a{fS#|n7nn{1@HN|cl>k?D>+Ntul^Pd& zj(K0HCR6d)l}5Oo%2g$|uNA=ZUn=o=x1kC3l+Xw?P3Sm6RTSfkckNdZQf0jNu)gvL zJ0{YgK~8`oHw0h{g!E=f0r+wm26r;j^j04MfCnuvKUy`gO^PV9vylV_pVsu=i0D&jax9)AQdc_&p6W&Vd zSpht+2~KI2H~Y>Oyj~(703%(~guEaTOMT^G>F`t$dDFZn6EekEiWf~tGfK#Jz{|X9 zNkX`Fnj)PU!^|2(7NSJ#Sc8N{hF%$TW~A>j*f-q&Vb7Hb5IRfLrU`Q!6F9G7gmn>< zi7eBw8Tg|@gvQ7+(qPiF8NwSHY+H9Y9+f|z5ls1U#&Iby{|O!)j-N$KaSV$tU5C*3 z-@GtGWS-SOE1UifJ0ADi8}|~vQWyF*HH_x}Sz6I5k?)F;I}2ow`6^pBKEiH(%}wz+ zxxZ7^aWCV0oh??ci`g}KyGqn6IKQW;?}C55plOQKTV7w5dZ~;qR1Q*<>Fir&yaK32 z?0ZkTFRH3n3c>j8kViGOJuGUX(~9nQljcEhEHcj!kcAub0@!Eq{ow#usaR!Z_?1X5 zfv}Rl2eo8_`7|H@dB0gT0sdNw$U>tQ023H2-LDvfjeCPzKG8b0s-eul07xfifg`%5 zweI7CV!rS1@Ph9Uf+rH75BiGjO*-Tu$E2Q#ZN;*ex@~PR3R}5ce!TT8<-)#RPZn`l z5%DwFM+o&V`W}`d7-IFn=tGo=r&wHz|6}(<>I@qQq{}W0DSOg-9 z2pDoUsHDfhGalmtoOO1S6=o)1nIf+eg%?Po)^1np zI$@)t?h1Ty)7&ppICcySTw7|G__s4wB08JAUUp~*z+dQObjDann!MNn`mkn~pk*c@ zuCY2skfQf9io~^v=+E^=*4i6JXQ|j3cA9Lw=9DCFtW@>FUm{_+SYHdBQ`^E^v9Q-R z3;7LjD03s5xfL;7fy4wR0G1BM@NDdzz^*C}DORxG>7nScj8qlVZt_^XKUk z{?4CQczlNc^R){z*LC^*71lkUXjACOd(u{w;ezGuo!30>5|TGAMuI) zbzCuW@2*P2KYufTzI^^~;QMpW8lQ0&rL1j#dS50@)zZxN zDy9@QO}Ba46~dfBbYT<6$KPtU^Y4~m*&?%l5H7A37JpDzr6lG#eAjEZ`4VIOPQCOB z(SG2;^L0+{w@Ko@YGLy!16D+E$pL*2)dJ#~u)pZg@o8kw&uoY}TwE09&}(%8-)_)R~4W zK*}i&(jfB%V(D&pgKXiT$h-xo4R_4xzr0M*S) zj%pfiy&yl9iopjO7!X9a4pDk-Cw&vHKqjeR7N8ZOO6Hds!I)bsZ6XX~L@`ApQkM?& zM6>~7Zi#Wz@CkYKB*?Pcn%!(OZ_cuEV7`pO`9eiAD;q1LY_YN>JDZ7-W_GCo&z7Ze zlk?@awbOa=MqgzritaL~ovqb2X|9t;^@GtnbwfO_n@lLN=A?DCX(RU1kEBfEzNY7q zWsfPfofktw^N|NHwI$R`k=Kz+&E&*$_1nP=DkDZQ>APmEQL^yT%_JuR{EX;IqF?rg@~ zjZ4`s)SX0X+x=`H`q<&+fM*|8Wk0V0+fIEWXgl^weNhZ{Y@YhUQuRq#{u_tXO z4kwRog8C?deNfE4@`7g7Fz}ZE7587Fb3N|m%-9@Z1@T|!2!x5al|v6eyf@AQkbw)h zBQ|Z53zIf*$Z*ZAZ*D_QT#dfQO^bPHL`8Zp3H(3=W7rsw#16b27#@KpO7CD_Hex2f! z#|&*o10p)Lp}+TEJ*UT^b*hXCI<7`Dz$b&QCt_Ml16K`$g;)cw6gH{ zQWI}haiFyx14zs{QgxLv^Hj0U+h&Pfp9O#wYLBq|L{d7{r*PADkejZ~LgEmOoS`OKO+^8kOoWb|GN(ozwM2XQ z7vd(yi0*>;aU3vq^c*9Vm-qMhe7rB83D;-5KCcqss{s5n93TIO@$&kx>gpx8UL*G2 zo$M$qz9G~r&z1V|EZJRey+tRS{qu;QZ(`&1<^b!*6F2ici$CZG_Sl)Myz(ml-o*US z5ADaUsfT`RYwh-CJa8NeKdARQSYW4Kn<=nj>kRtShI6zIA}CGBmm|u{3a9&>`0%}F z0(xgqz~r6av%K}rn@ULN@-AC zrbZ5VU&OTAa%ig?p&ROrz8Lfgc9BzN0d&T?YmjO-#A>h@3Xue8iZ;fOB_vKy$71PL zH+(}R@H%Chh7e8)Kjkc-rnRcplr$2+ z`S&Px#~ zZDJEdyDmgN&#s+@`y|FPCDCIc|H92BY3goz)<3r@)+pilQ`#7QTw0dvhgjVN9xSS9 zQB-4D@L~LK^fWY6_-{o(*S%*TyPi?9OSp=uik3~EnG<_KaG&V$5{SF>X+mQDsvGC; z)3@CMu;o2rZ9?q{du3{zH;i>FI=C)vA%eCn6Vh%4m<8vTTbZ$ZoG5(y6K2j|#a97! zMDG)dPXPX4GJakK&i{){^m@+k@%LYm&faWvKTJ5N*Z$*=$ycr3U~c`)oaHI$-+P=M zA#r`ckvASH>q@cR@Iv6`&-G|yv8QcT{E#Q_Pv@L8I#InWF@x7B1r*>#^%ihUtl2?J$(cpm1Jh)i3@;VS(A;L*BKR!x&_}lGf zkOXd>zjS3`t4o!s5C&a#A^3rde{d2Aq!S-xc8PmxbqN;0%TaWq-Pk!_(UjWOnzxUj zZx!@S^QH`L#7Kh^E!Nsd{Zqyw^c=T(1LoVb2u2{|Yb9ju@|ISnv&wq9HX6f$s%nFg zTRRw7d7Ut;szP9u*eQ}=WRM-ao!TpnZXBH|4P=Z&vc*LV701!1#Ac9n>zkoHf>|Tn zL1*t%VpbWgQiyhT@MuepV9z}hm%h^0mkO~7LN)2_TTbQ9(Z36LsHJKui}*X&3NIP4 zoeirNEhgZ6Vpbe@_Be;ePuf=4RBEgyqpYc=v6`L4vgpcXVM@sd3Z;9jG6MK&aTqN) zhe1D_sH3AkIt84Kw3$@M2e(qQ6lGhHNL!Ida}9ASZ$gN=haiA^OoUKm@1D7^H#T&Y zpC1Ht!jc(@tC8^-^JFezGG2h<0K_W6uuSp_qrAl#e&lV%@4E=)BQF7Lty1Wl=Z*_V zpLsYsJujhoM*A6OmtT(S#b8b59_g>Y~TLeXC#FRC+%n`bTN(eWbm9?4)FmJ+SX=Qumnr zETX;M<-WbxlO>N}`^c?zzt>HO{cuwU0{|Y0)XODR&iO}H`Q$la8}9gd-V?hWi1ZK` zAOsCQduK2J{5B3R5D_&oQJfmB5 zsxo4ir6USCx)`PJZRSve=4~#3WgBBBBt#WAMk+Kc84zY4q%c{D>`O(*WaxvHG&qb| z9vf1oB)O}i-{}a zuZRy=md6YvmXaiw)*kHoqQ)(d(n2} zS$h0948Eq*3Yw#w7#;B_UwLl!|OyDdFV+ zsbfx!TrW@^DO@Lhhqkq;MM065Z*PEY|Mqshls)7{eZxR+oTmHeznQxh-MDciNI)VP zh#(?`3quc5dp^O6HbEx;|998bO=UZ`}cAW#A^e_QL52>8VSq@5%S<|1A{VL?&FK)2GC zK3Q55*m_8z@o3PLxPUmzzbdXuWmY=s&{!h5kP203&F9(x4H^RzuQiCk(nDssI3Xu8 zm#g@>unj$XxH{<;0Gts2M~EMPFao0lb&AzUZr4W{3lb&Wp!QfHLMSo>B~ZdzFJ$4}uC1bzvZhRp;bK)OyE%R3CRxbf7Sh#_ zJ28NALLjB&b~XbpzSb8MWwV&dDS>(;&K%NQiA^hWsuz|U;<>S=eyfbNGp)6BlEPs@ z<&@TvU`A@JVGxHFH; z-j%qnj9JL)iM-}8_WpH1W~qh@0e0Vb$f0N0&D8mTt=ryyV;rvsoW6R7=p(^C zk>LxH$2A5Xwp8^N?9NiPuw|~HH$z=m4sU<-`rz}&A4h;`+>@NUdnskvZ10SXNKER-gfW^UA8KLF$HVDP0Z3p?1sVyK(Y3PvZVVRbJvHY($ zTq3(&$>}(*T=NoPCZb(=7rXBh=F@0X&=q?(L#p)sd)IaJ?|U*8ftOQFN4L=t0GqP; z9AW)Y;>wK=c4{UXmZfL(mi_tqr7-%ADuuCSLQY8hl%ubmsN>5?zLLl<0xn7AbWNdP*!f|i%0GID$MseL3iV5g0A+LANCrfp(HoB`h$_ z40z7a%c}&Z#7T?u*NXlQLG)s5ZPkWdG`bBtU_HHk^Ln%^Mc&J`ww&XlvY+4X@FKdJPS_g)zA88Ocg{RpR{FULOaDfO0E-ag2Q=@oO=r1Q8x zc7m=2b(>pOzWgr)VSoPl-#du)f0v*4zcWVvtE_o{(wW_ui(Y`fzj~hB zUR8gQi(fis-*D(VQTwS{`?jg)du_h@%aY)O4E1f6z5k)6ZwPb>mt^hKz#(TYc*Ha; z8_44hnVH(;XF`NG4p(zzn%E(O3=+Xr0oM!=Y7{HsRT4{vH0y1k&BAJEZJ8UZ7FlM1 z4t*EmW=MT!Iu{YUwoSmNfvr3Ufzr%nz%&Li@L7yL>P)i1=3o+C5GpP*c&QXlX51K{ z)Z%*I($IXFn9RY`gWh&7RF2qeJ5SA5#GUD!2IWvb(9~^%cPPfH!9MGX=$R(S>u9j1 zb4Y2=bd@o5-V=<08&=wP6DpmO*X(VjKL=~poFzCj3POnz4Tdn>8Q%oYoL4&=y{Cs5 zT4KIIeNxUO^fs)@0wpsv4tn7#!w6)m5IicYl9sTi6Du#|V++We3YQj`Z3FwyZok*+DaFcF}VnxUh@-7TI^( zZQY-X&D^vA&o!dcR$?!v*ywHb`w(EnLJ+GWZnz)~F|;f|4*1IoYL$z9b80se;LUhr zw$H*hi7j)<_F%!%#fuVoUyXVtmu<78@e)=BSd$8?cB?pAMxE^%opw&pH|x95B|`D) zrwGm-@%74IH_mx@>$$&ejNvGhJ_m?TBR)6V$L<8}DxF*@l#D$44A z5x>5Qz53ruclW<;2G;+$;n=5Yt3S>?Id1B%k6R~uv5O`6k87>F611FM;k$ z0R2Yet%ygyv5L1w3YZIjIK0d>lxGy}+4lk1#F(tbWomf)HWOyE_=@eV48aCbLJZ`1 ztqlCm(3NCXpQSq{uG3r_DXsjS&LgLv~#1U?~ie&gJ8 z#X)b-bi}x`sg~i0C)@ZAP!Q8_F>={!XkSD3+H}n;@y9WGs{n%F=QaCYdslc+T7&^; zS%J8_4jSEg4fMvQuCt-X5Mo6vRM&yvqO0=GSbRb%uz*8$a4zsLv(YgS`4?=Dh z-7@YFnM@%2@WrILvn2-Gc6bOCs4 zDk(koz~mx~m3sl_)u^G;5u}&Mb#eZIJhLDOcAMav6NeJce=+l!G`WsgcJ|7D*Q{2lSa z4>()7jG+}h$FzEOSk#OwCFM^b?Ma+3neB3iVlBX%xQpUbqlFEosKg~C^|9=m98`bXLZPwNQxHPt0)8PGW zUDiQl{R{4VIbVN0Y5(I|Z+()CpId%iS@0!nePr57IB&hytU~65Vjl)%6yPuxSy0uA zmCQrMa;lQxP&hJ+&C3o%hPspLZ8+Iv%H>uDn=D+W{n%{7~LAh2whPtk4%P()=B#8C0|HI%XGx(0b# z-S~kfb(XSvk8&N~MNXO;UJ@(`tQ{gWBzfz08fLCE!l{Pjr$Iz%cJ!`Bw(P6Mj%^y8xd6C0l196 zPIseM4qUc2sR=~23qp6+YY7e@mYOUPak^*1&fuisgDJf>mDfdSiN@1~;FgyGg}k+` z5kmD^aapT@vkL$6W79^Y&z1MY^a+)@OOr(eKTK)yW%b%Lp034nl9tfTijoR2O>o}Q zHE51MSg+mFbJ^xFaP{mF8R=IHq*`dM2H%IU+%A4zP<{j-u+1bAT`%0)Ac_;k?AF2y zK8YI_bl%Z>)>9#F!6u`~xYIpy`)KJm$yrp1=(F6L9%5)Fgy$_$eXrMcNV`_bYOQ2u z-5IlJi8wHQ1__;AHXdh2jI=+}wM2hmBEx=@iC0KWl(n?b5Svp;|2l4F2!m?N7Ow1# zl|$Vus+OWBCAiFqYhWrZmyWpGv*2sF>%VKp`SC@LH=%B@g&O&!j-yR~O$$dN)qi;a( zLC)nt5mgDOPC|>L{1#-;GQBX}fUvOga>=a2^_X24&~fV&NO}}rHg=7wVq%@qvl;ho zA1JqyJ31WEI06v0WVbKGqg$CcY;6XcFw66%9vccWgM78jTs-C+x`>wL%0VRMf)sms zfXT{L$d{E6+Xq@PR4&sY90*~Fra?;$64uUT-AN>+SK&+qcte>E3w#Yj=`+*z|GTZO^~B91B*~ z&HR7S(sd)XcefKV5SHLrs8a;8MF>{N2rK(u+~7N z+C;lRO!ag@OW*Igf{5j^S<5q$!n6toSAupZB+8D9J-hqL$On-%W4KKDA;S!)>Wt|a z$Q7;|9HYy)&_&y2nQ7}0)j#=&Yn<#XlvFOke+x25 z1AwU*rFCb~8V7Ab*L-I@bjyn@0BV$@A-UZvH1Ng&Wp zxdf>cbGPwq>C<7Yibw*pe{;`}tg$FF&dsER{0ajX>K8SY#0U)IMzqY6CIpvJoNRPd zcEsaG!7`dpByEE-ReS~SDE2_uI(Z<30H&Ap;RNxxY13q(M4*oua^gi)O+ZWv4V@Sb zZ((mSwdNt(lw-CHT-b7h3Al~*(BbDFLWi9Hn5>t_k#oDqIs0S7r!(qQy}6KN(b@Ld zknEafDy^ZThmms_;TbKgnW(iy<{&AUG~r_r*&mDCcD^a0*>+k zihT^5v8Ja75?!)j3bolvk{~>0D3&cunJ&=Ki?icK$#3IBIJ$0LS?_Y;!%fV2XQKU*d)Es%yMyOjWFG!@e!RXf3|oI~gY}i_ zsnjtZTT(4&(sPas_ zA-QCUuVZD8&{Nj~x*&vRzXRruTi1{N6prVkrN1q5w}1XIqqvyEIyJ?xV3cF1^yC0^ zLe*GJjH$iQW@Va~Tt|OmsGi5JXJk9kfRXg9gAz+4#4BW6s3BwB`5d`dkb&Y?NUx=K zYzec4Hd@Yy%Hbs&h)hg6&&U)9p~z9@7f>U2o%Y5ly;RTTlx??Kw`8qX;tDFXz(XOG zMyrSp(y&V|L4FdD&L&6@%fUp@fS6P|j%!_a^R7wL@VN}T;Pb&R; ze*V)gmTD``O%QZ&w6PxT<~jwti`2rVFzMjTNl*}c(6S@d@u<5}@ijJ4z8|Bsd_Mw| zjXnSt&(R}cM!;*%W})F8)M^mvM+Wg^H$)55oi33@Q*!9!9qPKz`L8xp_nm<>t;7InjLI-+|U0K-!W$ZpLgno?R_v;=;1M?BH6|T7X`7oFl;x z)jKx3q|A#8B*XNI5$1902VEc+S4s=btqzJto3s#NKtUCKG}~ceexM8DMPFg8KwjLS zufErXn8EJ4NA&yU{f28f!0N9DuMiv8?bO?6r?Ss_V~<&)yj%R&GXz`!RY0o0PP4|N z|0zOzLv`y_th<|A<9;b-3S2RLI~~_=NMCRIy8c!K9pi3~m_0Rj|Lqs(%uN)gli zL}(61lT<(>JP(S@n+6oZt{KgufHv^x;s=hq(eMjAnWa=MDy9Xcoz*Rgdg*4-jl3)d zF*S{$lXlYu0rKPz^L+XK3^5dB+JYx6Db>g|dLfFbG+Bbi*I3iX#sq5uwYLH{9(>t& zm0Kx59;HWhh@G5I`LpkIlOMJqQXG33-GlXh(a1>4>u~n?vMhoCNUZ{%1-OrbVF4L@ z*PLQ4(?!{f_J<)y+}SB9Id2AU{5Nn_yMWgNV33t>*?MF2 zhXbm`fJJRpYZ=O$gAicrRd1su7GeOEWwK;t4_;ey)^g`Ur_VC0^6{V%E+2*g>EvML zH;A}&lgo&6D7l1}xrW})O<9eKafH?zr8XHD?MR9b7sA3>rmPVGN9=f{={S|utT-}P zi;Yx@dq=Zecm!5H>6}4k@S3C+Ee}Tqm)mw=zSj^_5mHwVRmY8M9>|mheH#`E=dz?6 zG;eaZ25W%`{<_Gubs;x)DF0WO4StWRR}{a8^0>p@c(YCI6_HESXnnEYVBHbmxCiSs zUa9u}V5_g}mq!iP6V#mxP_MCWx#24yaf9x)_N^%4=@LH9O)V;VS7CF_5yx5$T)~*z z?qK(H1>eeqvwz1!E=?MMMZ*mY|G0tQ{2FgjcG!2RxLe#K@^D4tYe;*)>h`lc5!j0` z{_r2b=$q23|78%JEc26``xo_Sa4_3tz}eO7>nB3$vOl{avCS?6v_KwKB|!+?gJ`%~ znd_G0{2XRMi3tH$l(fLDP8Ea0mLXaMW=B~`haed&&arD)0faF-gDcXUi}Er=D}(_{ zz7t?!QZ`NOQLI#IMSJG>I>tRUb;+qONCsXFaa0l(=n(F8A-0;yXQ5NNLyWn{ydVlg znwKd>sL1Av6$Fk-IA|jb7#xJmN4K>>mO-y$npjXAZIXG92pF(kl$)Lr zP^S|K-AUNY7g}vtMvqel;)x9h1u!vIoWn_&cL>2ap`~&V8SI@xmq57zn`RG}%Sp)e z0?IToYK`7gl(;$5BlX>Nx%epdT_X%sqsAEDoH+%LfOQMkr(B>VL{_e__s2t{&la(U z2E|KIjg4>!i8{*tpz|`q6lM%^Ecw);`Wkv`!MVmT%-}8CUu5d}7i-s|+bXgI(d99S z(I~KUgg^||Iw(FQt8oAS?`~K13lHO!g^dEL-gg%lUY zUyR6Vgp}Io=qQ(=uLUNY$1h{XarBwI{jk0khz4wcLdsrdypEw_R1r_a+%1Am5w7y` zd3h*JBF?+3>$1?xTL(j_>u8L>0;;QW?BwjSo0LsjSJgd-ma4hTbO0%4F5&MrQ|6m< zL@qI0wsN_<$V#1AQlnAeZ;Y2p!N3-ZyB75xST|>RbjPB&Yo2tJNCoPunT7#36FYN) zsWmFWisG`U^P;91@1m{Q4E20*I=Xp( zpyrowXS8=}olrI&-XdkbpK05%J)CiPPmb^jl@Aw*d@J}Su#c7Kctz?r??4;lsC+o` zV1z<48WM*t2!@Kmk7r2z$bgTRkC_tnrv&&j?5sb2SAQn#svl05&ecCcaR1)_dL+Ja zoT@+I?e-Nh?mu$o{wD~({f)EdSJmoY|C(O^`p>WL9(Iew{m-wl_oo|zKhLZfXZ#gw z1Y5?&FJ1qm*(AkNz!#3t{KNN3R;1F6$Vb=+1w)SM+@2wlZ7zV zdV_iWD4ZK5XhPA<%pqv0o4F~3L($x-v;^lBYn<TQ; zNNlKz5;}0S$nhGW<&B_Yd48+Fr}I#vvA&FkcY{HyO1CV0C{>D2Eyrm(p_m;%hESHu zjxcU3|H|hIW>*dirFRP=C?Ge7Z+1&diQx*FPzj$6{Fx{R9nRTYBz<^Z){%)JVzCF6lFx(UzlxZ>?QXX&oN zhO%s1&;!x2U%a)HI_sP-Wm_8i#JTE*(?d3r;i$6CwAO4=(c7xSc3x*`f;w^CI)+K8 zAd7cI>o^nMkKJALfQDHczgxm0klS?vyK=1>W9^cyAb{PCbdlzWuKa05LG^IGvMm9l z>1%hl&Z4i@1=kG3$)S@Q@*CctW|=$PCW4nPgah&_w7Upr_qzAaq<1!aEO&>UB%hdd zI>CXxhWnAdwoTks3_aG8j~JXv$}tWy6`$|5W-T;_a5&H5vyTbQ$b*Q(NgCEz$B%p7 zvSur1^}XF&zaLW?>kqZ-bAR~2anCpXq-}hvT%Ygt{#iG=S4c_??fw9s{SjjObZvjU zQGfI!>EGW^mSO!F!T+Iq*gx`D14K9GdU;r^vf?Hv4EAOu;{L0h@p~!-aFDz_N95iMnS{}rJ z_p%}lWJMpcqR1-6-l4Hb_X=b)VLu=b5A|{7U_1FL=VruEgh@1$rx~^ss2W2I3PJ8| zDvS$GmECeelee^YvXvX15$a242s8~F*1oF>mBp;Y^KI$g1lHo6Aj|ZUEJ)xBNe83p z_5#$B4MF26@0NA70x;)hf|awo(Va>?syWys_}#RIZB|4JUx%`9s)^P|sPWHJF=PEg zT*H7(O+cChR_NBPDBatkXnKS3SZglGYx3hPAa2TXAkzgDw-&JtEBv(7M2o^^&~$lr z%L-c&WpFFDPLOvwBQF?8(qH2^`?*pLFE$KJh8#lf=|G$_)S1n4sGd=d7_OeOrc4$% zgLeZ~DzltfUcwN7i~yxP7bI5GWj~-WT`3x^lWPV)>j{yqvl*jKp0xi~<*fp8?jGXrH=n$iFjpls`InqWPb7$!5a=b`=zCZi}eV|&D>Lpe0eU2dyer-mk31YAsc zsojQ&=}V|9myKd=rUh}$Vj`g0NN08WsowJ^)WH+D%c=tBwi+7)9f8TU0Np2*U@7vfGn8^Eq5Dv5BO{mtmQgEcEQ>4?xGP67Fo_k z;Kj9J35-G7!y>@LyD^b(YypO6c~m@#KcOwD_;Bi6>*w~+!VWw3eqh*pt9nZ$eT&h` zgFPWG4hh@?fJU( zkL&qxC7^|KvhYM6)a}!NaxKNdgABUzXD+sVCIYo#A2RSeMqXjb<2dZsI0WX#6EeR3+@V_I6ELlxWJUO>=0nLksIM^ zltIhWqLakx90R9lm68kS7xuZ&1kMd)YJ&&S%tIM$Bb>+OnvDSQG{%zWMJW6#03{nB zK>ob=#i7$+OMqw)0Pgz+o?n?2R_O&rE?6b)2xvglBFh}-jAU1WTq*e*LO}zri%=>x zLmBNi@&QfWtT0iB%yBf?E#`>6ycb|(cLEg_aE`_smX@Eo%ggdo#p%Yh9#hbQT^Xx4(_U`sKkb`6U5b2rAutRI&xY$Tll0kEdP&Sz$jA(dEC3lN33Qm;-zvo9|ePC zi7adNIH766-Th;`f1?fU zZO7pqixc~e)#rXcYl3lNF)H-aiE_xK8Si-ABnD3t{+R*_4@-@9#vfRBLS`t z%=!IeeY<}@wWc5H+wTuO+~Y6OpYgbUEHK|G@gJ816eoDqi}XA94^;X@ko#{zwf}5W z@c$N>Z9mY8Z(n@anbtGshIEi9eo4njvj&LFYx4hi!!T$f>U01ao5}1|V>@LG*fMEjTa#dGXpYdLV z9lJ-Xmt_Wr;hA$8fR(ovZ8;y^=WdxcPl9^DcJMHHx?|Vcrp2UUTA|y5*V?qiiN%lH zu&mRkn{gU`fMt@e-aJ28-c=C1C4Yks%o?xv3SgkIH)7^e(6YcFr0f9|ixTEk=dc8(r1}%V(y{yjLJ7??xGCB;6_3?WY6lv!nQ3i2g>Ves^Dg_9VZxLw(%o(H>o5 zM?`!MDQtM%zF>C$s0Z9UD&UVd(Eh;JHxjL=7Cy?^;rsISx0UIgH2(Z7ZU?P-e_(9* z!$6HPL+cZRpZc|(Ywh_kXVx|=)_akwB>y}N!|QsBI@jNU3V&GAyo^4bu$G(T91!}AZ zlM=MGX|i=RF8ORhGo0e+SdbR52hnbHbaGV*Y+nY{>15pp@{HIo$kUdG=+4eBy1IbG zciu)>vSw6bYuOuksPw&{q`+!yI>N4OOQL5^CS2Kq`f+YJfzd+kG+|_8khdtfa!WhJ|P2xfC_&Rcj7x zWmde5F-;A#tp$^l@c5M47QSOdhr7;C$V2H6!-bK;w}_>m)yzTm1HHUyD~R60wh{IP zl#n}}&uc>?g1i{ksVfZp4eFWk-Dl4=!|bvuLhxRHJ+>8W>4t6i&ia* za&za<0_2rd>RA!)J59xWHOT7=lDr_GHEx7;n81mDTtJ1r!ZI=Y#%i)aI&Y(chYyr9 zGgwr5y@GKuaxHXs6}MI-{iR+lxS3(HDAgP47OPl#YYZ+#IxVr>bjeSHI*J;}ly#>~ zuvX}e>1f(2VOA+a>9Z)^nd?5scklRC^$nZ;9G)9dCbxYxDkTNqLWM)d>7;NRwhHtH z(czg<8dRAV`6C6Y*nurh(5?&Uh4%6J=M$mdonDW(lJY^=Za?_&5%t?GQ=@(Jer1NN zG+8KoY|_|K?xp9SlKBdjRs?_eGNOr?(p!?%^+ z!)=}i1K0B($kGNNOY$?@UKVguGZ_l$&vVYW?K90}oF11T^c;EwF`pRmGpELROzg4t zCg?k3hM25ta0@r7XG^cP0(Z^V*M9|Ebru6kl{(+yJU7-U49eO@>H401VL8NuQy2Is z6%e>a)tWHhbJ~N--|%V)6tb3`hf2t^uI-YlWQ99$UZO1aqd)=Z!l};F160JNE)Fjd zz_-TcfkTZM`%z4*xQH4o36qaDu zow`2xlMX9T>vsbn?&%6g>9t23W8ZPiAs!6GOecEaK-ZyE-~RToj~G%hw22*MiZIaZai2~$Gphj9 z+~f6CQC*Lf7#-p zPs>`F9Ie`5jw!(-XY!m&69N#&O;NaT8qeou))))H`YFyoV(ps9`o(N376CkNN|5x3 z=5Css>=rb2%Bb9Ys__108p2hfKy(7}c_(%@!wf zo^`Zv{-)auOMc(a=UGcg~M-FM?lrdj?A8v_l&>Y8qPzkv`n0bOg*YcE32LW zKnSwavDjD`zw72D>=hL_p-7vEs)@XK$*S};EE7}*@XX6ZqaXwb#;6lW{muow>j)y0 z6Amv?7%E_WnJ(Fh<%@LeNj3S1af8y7==~zI9<}J4W$KLKn=|_b_T#RDD$CD_dxc1< z&i%pW#D4Mb&7}Q&N!7X6_f`AN#FikeTL*rnsOb3y;q||;eJ-HQBSE2^pPuJ`aqxZ$;5dKQJx9a-W zPWcW8mAn9JkX7baoTfQE-WsCIJp}{*{hz=7_1x3m=dpBM9yol+-3Q{kW4cFy{F_7H zk?8Qrs>9*$0odE{+*hvO`1vfxLFR}Y<~TD1Avi~LqD9@4VF zv~t*(YJ(I_Va1iZT3bb!%mjf1Yn@2}gl`nU83zdVwqnXg#}+3G^Az0VjHv>e0|&Z# zoPaCx!_p-$G#Twc43x&Xysui$J@<@2g#h6?1eW!AO7EOIkrZ_`E7E0-X>uH;$?`8| zOq5Ek-pFKIl&Lf{_>x;B>c zpd9=Q#$dS%ZSGdGkX4rJ^(qwd`Z7V$S~Y$cr&6|Q#aOPZKCQs!3EB#ts3n)C;tb>Q z)h0yR8Bs#sdX7Pai|sjT4=)^CVBTAqId2cJ4Z!9Az#J1x%)H|;Ea@_BLUG)la~$_g z%o&@90o#D|`XMJczTy4$%J1V+o=Uk_u|KC0d3E$;?f)LG?yAKhy~@a0z%EX#LUJ=n zE+DKhx&g03F8}T>^1pmMWTm?NCm-1GmluUE=UXTqZ&!$T?E#hBk8qHqw)}YWREK99 z_6&IU)qRm#K3#`t`uo?f-@kuN>lhyI1o|D_3!Q%)Dg0jf-r%=$;nJ11BB2g`Oi z!gctjnEXkFzvsZu>-G6rqYmF{;^9~&KB(yjzKlB zI#h~?ZFU%n3-fZv!3S=*Tt>Kd?zuut6V}fjDl{9L?!r>;?8qSr1X#t%R%Q}7s2P9> z-YaKAn{Anvrq*7 zNeWfv79iK>>9`tLeOfM;AJdO%RL;+VyH?IQ;dAXzdGCW(T7tiB2zpdFVWCF4w2wD* z(hg&nb3JOcjBA%P6Q&&Pw3@d14b8}L!6_OJLlj_+6&*9t#e-xalEKOwRCH*vLX(egoZ6f*bP0sk8pKUdhp#3KO*)MUfl!Ta{9Ktx%mTDH`Ipd* z>;>`bMz#f~PND1fA=ns#ZDwb8b{0OM@Ky!GEY%gOjH4tA zbrma9dr-Sgc2d)>Ld`>3qnqJn)zoq{;AAXQt0i@cYRZJ_5Llt5tP;*|@bQvx#sqnr z!y*%7n_+8RqKrTEwrTA{5DK9iXB8UFzYfv7A|t3n2D-y;w=u*Hq6B7m(0WJ&A0$=@ z*Pz}XmDwt&xyWpXjk#{f8gh(g2w*oYmN4vCWL_4DnMQ~YWfdBgSwdbkZLK-*?I^={ zRw9b60^kscIYoMQTG_SlA0Lm$BNnb*)?jpi+jqY7&c#>P+xzre(o-uG`*;4hjT^_D zwU75J-Hliq;WiQFl&X%*d4GhD3|fhEL}|Y*g&dR0r%hY+cR<94spZL zjC-G`u3tW!_go6lKmY(B07*naRPT3&^#0%FQBg_gfz0lxJk~_ zAeU_4RiqOZTy?Q0N;diLzfZ15uPThC<~j~yZ*H7DC}d8Emyyrf2l{b^N)HcoT@=FU zM@>fporrA3h*=8UYjiqf*D+ZyCIiu3kk?y;9S&u1U?3QLK=!sDQPf)hTDz{Vm!%>c zqHvlIKI2%Y*x;Fgs{}W-wsdX~9Sf z*g_XZh{QVglHIstjsuM(KEV4P0E`hE z!pjjz!bw$y#&EEXhTIyPH3@HN@<|I9970uY%C1sX(elT&+5**-dvf`X1hF-()^0IB zqEr_wVSzJB%)^4|NM>DE&ii%qtOFkl+HzvDgdNy&HG^XMz_EhcD1opKDTp?XyYJM+ z`*}FYpyC3#>@c{EcxKy%)b~4Xh)z{hda9vc#;w_C95QusiUtPOptJs8#l)B*->R+$ zF*CcSuy?`gKBczv;&YN{MG3cA9dwQ#4++8W%OmEQ-*euq@( zjb+}TD~O{h5uJ2fNqZHO&=I-ga)@vl63tD_I4Zi{DPg_+mXLSbD1G_&zOdnM*cT)E z?!@}bU((iJr<$>lPA``~i*{xo720P3S1y&l2jRcJL4wz{NKod_1p6!uJ9a;x?MeK; ziN7{F-*X(zu-c!KP-4MQezR$jLOxdI~)O)HO8 zVCG;2=!d(~6eSv8w4&Kiu38ILFa^ubqfUK4Af!?gNsJvP{yqhOkyWhF#X7rC8@cWW z;d62YbBi&h1P?Q* z-#=GO!~+|o+-hQ~w2`w!YYJw|F^C>XXCbj2dH!vhUNaK2&~U3)SeyK)P);}VYn>gX zNkR@yRR=rK;9DN?>LeJVwoH&}Mnkk*VaKw7nZrXkiCh#ZH_6r5ag&FD(OTDAyI*BH0fb*rnmAwLW_~Axa-+qq;S)W z^1cccMC)Eb?yh)PHgUc~gB1A<6@kjKZlQZY15vFLl8otUBcxhlD~yqV#7d}o;;TlD zq$>;%Y-Tpnak6kVs}&YYy0gmjHf&{DV?$wha$sL=v0592e7=B3c|%()NaU(bVn7(b zb9e@VJzaBGMFE}=aTh*F2ri6UZCjML*;d9*HEli1y08NZvzj!v2E^B&-K8??=J(z# zbaie{GZC_>!14}}vpxprzGuJ*jdP>utl?+N2gmztIQdGu5W?kH!=6zN`=O`DEkoE= zDZFkbo139k2E9RpfXBzjW0X&7V82k7aK( z-rI!VyDi7gsCQx;w*~$=pLUTwK=E{k%?Rr64N^n)bBEouZs)>LRUMbN)f*On#cXx# ztjT0or-gTrND%XE?1~c?v)!sjO&VB|CVOwKm8?l zT}<F8Nuxg#9(5oHAb>II2?#`-7 z=C~!4Q<2rJbS5mjeW=8emGG{hQHQWA&L8SpPEndZpX8dK%v6(W(%lah9=PJ0fWb+% zB`C|2+R)E8h_i8s0{UcbD@wVa>=@Q@utYz~bsO8>n)-dcFW3^>wli)a=AEm2UG?$X$>)Hy9Zvy7=$!EhpoJ1I*;0TXuZaQEXm~#^)#{$AGP^1i(E+#$X$htNS ze2~-kivtu|jtQK}UztCy=e9iF?$}Sc_2}vx!O}cqb8%x@8%j<{1^~-TV%M%QxJW@v z1@7KL&rIjs1g{#;_5+rI>FF^wD{EhK%_E>reVCzbv4sRt=U{<VzTchSzPPSM+=kV z{r59$`$zcR3+sUGQ52?&Uq3z`64l{`ACGgP*&mC`eurZJ^<4$}fXMhR(0NnXV40QW z<@JV2?31GwNTYxZ1+GvkU4~i(Q|w#PJeDm{4W<&Ad1ZF&b^xm?8hmt9%*K)!Dmm1i zqe^>!+m%*XxT~!j^`S=Qm@F8nXka^~P%r9brnz_Xqzx}Bpb=QoO=Kf<@Sthf(h7Hl zxx}PX7AlI1RCdKGAcyNABZ|=3&gystwXu3ZtCzF-2|^P7sc<`gGAM`)y}PxrU`j*e zTR19}>W!f-Ld~pm8>iILtmYXVhaNtEq8SUQ4Di>X6g23RFhIC!iD8jbjqMHFWKgH< zI+#8)x8B*Iau`;KqAjjI7!cGHx0@iHz?6VnNBOmos!DcLVd6bS?G?r#HFApVtpFla zLJB-?cl5-Y?~_?{go4y#Px z4+Td-aYBLcTco-ri~*BxJ4>*I|8mhrNmC^O5sJuy=#eeL-z+0AMbp) zG}>vEvL4BBlG-f}3bZdkGG+Q@>MliIlX~K4^EgfY#r~}O!R_N7e6a{5u z!Gu2AcXlJHf8KJc8_stHh0zf4b#-w~IDv9PaDB}2&i(s;j9m?Hqq-JEBE|^hTe7Y! zqL}QawAtuZN&o-9yJzMYFeG_;X`7|wdz&zxbLPy%+?ONvi$|o7|LbdG4E_AV?as{( z_P$R0J(|*eva8NJ#Ixo*?;WpBVU{x|P!9K)!EbW15@7ZVMNT-Jioj`lciI~^sJv`v z7tVUA`*Kl;A0K)rsks|dfq4SfFav6s%(oU*)&i&#@=l~T2j6=L`48Ez!Y{xkY+))d zOoRV1Cj{sGx2F2f1YMmtRp;UR+6(ahJ^U3C{4@Ui{PaFN(|*klunmxy$CK)3ZeXk7 zsHbk5^=qHW$>}71hQ$~3Nk~<;00`>5A^$@W`oY7Q0DL}#urcy_1+ewnuX8KXny;;~ z-Zfbs3~HL)uH*>oK%Zi3g>yw}BruG@G2N!B=D8w4FC5<8$uq-+00*^mOFQJG?K8UGd&`3HTIWCUI^dEa1@K$m!n(}1y#*@6EfZ%sMZny?v+)7 zv2wNtB51aP1btn@bfSitcE=R5fEs(nIQWKndrm9tts919_)&2#sjG;XD$*uJ;_tL~ z{<`R(v3hiZa}V0DgtX}h5%$35Hj4R76l@w!EGJntWm(PTs3xG`=V&2+T|kw|kd=uK zUCMpL4+drjCPGlYL_ZWbS0_~G?2I6)BO=-U&B0XDg2~z5HxQF2uz-mPk^$t%-U+tG zA-0I>bH_@3L}dNNa4Xg)EV#ONDDzsuLo;w%cj|f~l@CExc&RN@9s7}9phOKVHgl;X z>jG24iCS(Cd#VxuJa`umwu~h5MqoT(Dft8ZuKAQrn)c&KLye{zj9C%NDUv ze5s735+rvK%$L4ZEv+$ZOsR&9Ct|G}asn=2Qoz#Wd)bt(cYbJNr$Ja(KVfRWpH8ST zNBEXwIi-51eobNfmz37`o8E3*8!gZ9Ir>d=IIaQ+=dgxU8XmVCd+prJZ`f6C9&eh+ zeFdzWkcODwV9mATX(7nTD=Tx8Ue%d>4!HLjUsH*Bt~Ad`I~Rc`9(&K&@C307Ar3h^ z4pR|$LA)4dzM0|heL-Nk`@XO5q4sk*_Y|KXcYfpLbPKP3nXb3xyYueb{9DpVqaD1A zF@j(a-1@F)M(^Wuz zE^hMxAHXxmF67O-|5`LFYrqH z;3IqrnG>Ng5!6ZpXmQ|oBc#!C=md~)oEOis)j%8^Mj2WQwXT2??4XW{uxNDyIy>!T z4}%U9YYrh`Ttj=+-AaQim_ev=WU8K9nkgT(f()fCjI8lk_*VIIm&T1zA}7X9itiM7 z*y#WmA$8hEG)A%nke^w-^p74?$t6Gx2a*=p+*Yn{n}hM*kg67yK)%W z^~Y2)DzUKE}36ZF+?= z%Do|vGAIsQiJ%0x!_W73fAVgBV4h(+P|Ga1xN`%p+oY+gQgeXinWMknG2IDE6IO_g zcGBgoyer&LamiyS=awgoBa6JjjtzD;#ef+uyy=ZLhEZD36(AH{T|Def84+gG$)ZI| zL-LZTh!f@p>W29|pg)_Kb`f{=ELd!tlB)LvvFp(am?Ga zn*uWu91gu-#UHG~1mg;Av%Zn}IcL$UCZBuOh}&dnl= zU})4&1g0MY>%GKIm0VfGXIN8 ziG_np)wrfJ>br=X3sn&Ba3g^_ujXvF??xwd-D*MM@N@Wq&@bf}*~HPCy&l9^bv z!=x3%FOPOW(VNrV++&&UOC{T2I!KYN66V3EAza&BM|gQauZ2o?@)`%;cP*_K4<~E; zYmdzA!TN-^f8~VF?l-~#Jxb;vxWTALB${ayEh~4UlzCD#(G^0!{43h~f1J{l6n2;4 zq*G$x<0Hf6j8DIb363jJUC$QxD}~nsxs5YKpZW}`H$b|rP$v#<+}hhJt{cKWx7S$9 zoqbM&qncaJ969T*GE&<8WTA3^b z{8^Co%u2+KtBmY*e#GMN_O>Si%e4fC&%WLobJj0rsOk;<56jr|d~wm*p|a|AW0{{@ zM&o-q-mnY2;|PQX7iqGuK`Rm-7q+QokuQgU@j%~vv1Qzh=&rg(MFE1?4leZh0B%T#74(nX(g3Z*~))Y_FvT{ zU=b8kdWq^WyfB1ow{#WxN*t3F-j3--ka8V~UASp8MfegD6DTUoQ^7@hj}+065~PM{ zk{D)Em=$4*SMw@bY+T@v1YW)e7)em5&xn17k}xm*G^2i7F4zXraI8Isv}rZF@OdwBF0M*m+thp5G4p zi0-jfJwsFMeIuA2OH)j9-)8(*byKVZCpQf38Dp>(E+P=4brd>tno8c-jKP4r>h%a+ zI~FRf!NhK=5$_N3%XrnOgKxoGd|L6(H;@`^&sXrI?le$ddG3PdR(*QRh4^DL$C06ab)hZ4B`bk z59vAgEAz?8Ib)l1w4Of7P}HwBHm%>d_*?m<-<#3mtoS@5=R|z-!J>PN8*V(`Ag=4x zODTCq;z_Ed)#m6zJe`C|ew^jCzP-J<)<3B%*9n!Ej%8g>Khut9mXuF7mhTLKU-V`- zcSQq^@K6t4m|}g)*>z&rkF&i`E6XpQfBxJaDf%rhEZ6l54OzYA%lG#`fByXQ`=9ss z-@o5~{rV+LG^IwyQ`8)k>D|B&qWsAB=?v^80K@qQMscUrR8>6%HG~%oxW3)OL;TbN z%>{=OuR~|NL7T8LMJ(t*L0(Cd1SY~&I`;{R+6}V82NA+}zDM6u_H{$I1J8n}<*M^S z=`>KtPSa!oTnL$Unnw{h4feQ^!wU{!EEScg)vo`KwX0!H99M!|0XDItoQby-vzEBs zbA_;>4FCV%z3CoFmJQjv_v$&D@M$1~b*pE3x(!egV=AFnERVmX^>WjwP#MtmPAF{9 zmDS>}c9GR48v5Kd!+N9sxZ*c)5BQ*f*R$o<)KotA3bRcj#H6ZN9T1?az)r)aL%)1? z7?Rkq1FTYKKw4z!V5>E~O=@{pVcgZzVVi_r&W7PzW@ta!1D)TxLw7k`Wc&HS z?dQiHmo5a{L)z$k0i(w-93!XJx{T8*=WS!4UeGVM`DD-auF3oR7VsBaEJJ7Y-w3M1 zTo&yf2&LOOiS1_my32~wi)!{HiJA$X-Ga8Zixw__4E)EKLzj&QFLwRSHiuX@2iRP` zocD>Xbq}Dnb#sxlyYCPugl=tS>8vQcb+Q5j_+qkI``YX+V!~yc>$6g|SA*^g`JhnYp&x0&8Is*0LiM_i0N!z#_ z20#;EW)&lR2-pToXhB*I8-ISn02A1xCD)Dcn1b+t#k>VW#B~YM+)l|>YGc{by zMT%|ZRB{GfH+)altQdz;qClqE%4Uy}O9U8I!w#eO5p{cI%@tplZ{nT|3g(4%L;Um! z(wp@3A^Y{%TTf~%)N_B)}sr&*`EWh2-bOCKnAOGA;-2{w;) zuNEZ+Z3HOQN<$5@5ei&(;HjuWQ!ZUoI8}7VwQFlk=?*B0Y#OF1`Jxs0^3-;K7oR;p zPgE|iIr=N`hTsL*w5^PTw40hiHlJnxRkEcLl&vuh#JV#KGh(=qaA02wv4xn>Z;|8J zAo>xmTk<=0`_7-`zsiMZt5|!usCH@($=@OTK=MI%JPJZPQ(}FKPw&=bv#1It*Cg3h z)SWcE>hlC+s0r)32Q}v|G2z?S1?iw>9)44<4wjW&7e|~@{duO+O0{XXltH(X+jKk4 z_s$J7(uE-h+t$tcx8dTTmj?H*H@j&0+PMJBX4)&4ORw^)?5zE}xGD}ErSFOM&bq;w z=-EZVG)vq_h6I~B9{0kzV6lz#Wp)<-EK?0vYtHPrj#f*~Hlb}`e3t)qnrCR0p=#4t z?-HX8=frsoyH29x2|{gF1-|=Q@ZUH)8+qqX# zxyvL~Gx|QCHO})K=M0!vteg;QS%M+q2T%fWQb8Ll>VdV#wW%CsR~xuf99p5torBRp z*A2sV8P5t)R8Mr6LUt3RrJ^xE;K+Yynd3uCL}rQW7pckE)0L&$_xEOQ(74A zfVGJ%c63>w(zROfvs}}X`aQDZo@AM?D)2|)^#b24b5PM18s;Rb=oT}Uw=x}}utw*h zrrNl4ow`qzY$ziNng!y@pCO16PK+wJ{7%Lr(Gj9&9Y(_fpui0r_~k5;VD-?ikzwQ^ zQ8wkO3SmWcvenqEA!fi<(y^)z(Yx|#IXWS_undDjYF!BS!d-aZnKOom1bgB0b2*R! zALR4`my=dLp@4s#$*}STmbSnf3;2a&jFP6l#kox z&ETvko#uXrIP){ir+|ih#wTZ}?H7YS|B|2nzcxErYh-;{JO42oDVjHNXJ?iItJ#Fn zQmdScu;P5K%N&~Bk>;7s43`e2&ExTBR(;+D)EyOq1BwxbRcaMwQDcB= z0<2|UR?kJ#su}X`@(T7OLYnAv&YQy%W_&bupY1O4+}LnVawZ%5)B0NUWXxWEs;$TQ z5dZ)n07*naR8~*2vT>4**<3U>&I;SEHV$5+szERnXsq? z-F+2YetrGpkLTx?x0h!SiJA3i-$x|XHp_`g-CCZ|a2`BVLq=Dyr z6YLOp4(-p{2p|gj$SY)~-=YvT(se)yP4t3A-x2 zq9O~|ti#lh2PpMDjIP&=S5(n+e9!s-Uz|Fkgql=6aA7b$A)PRE2I#>(%=a8%g&vDj zR_qouYkl)Uv*mYXV0@3LjnhddkM)W0`~cGukw}g2Y5-k8qQC9i_YG!%LFs`_&6Y0L z9JnUvqU_sXFquMYR><)n)Y+-sbr|4kl;6|sAJyQM(XrXC?AdLF-$wL*q)eT9XPu@U zxGIBE-NOsp%O4!V0(q5W-2tW)QO8nc&vV>8n16 zxu?2!^mkr~{$lLNH6&bS*4cP#A0nn9MXY6|7)0vhl6``$7(57Om@NbNuoUIJ>u6B$UAFH^hjEGsM zd(1A3G3RO8b4-u33-(*N_K0UR&9d3hs-*im*CJ?MAauIlZ zYXQpgfAXMVml#*l?LkJvtmrYdqt9r~#@x-mxLY6c#L|A~;Z|ch@kc+uyPkqObpz3C ze|rBV&y4CRGwg+W%Mln9GWang%t3*=pGJ}}+r$SD3A-DQ6|IA|NV64GUlD8)Qnnc8WY$t7Cvk$1Ez5n^TdUR4b-~y#6k|m z0_&?fdNyikV6Dq7Qe(7J{TWl%jGpl5EMV5B)Iu<(#rbDlRVll#=1WoQ41ha4O=N}A z%lnGb3hLx#S@xXTk#`nqvW9v$n4qoX?sR_yQ?E3}Vxx0&^cF$NV%x&g@u1emgNJG% zgn;1=gK%6@-2LV9^L*Z4U@P$P!M^Uth_5@d#9E`3@f5Vg+ zo8`Snd&Jy*_}b=u(rd!wJ30)yd%LSAcgOCaFE^;1U93X4u^t`3HuJGk;yVnH0S}6% zQyDnJ*X$O(o0;RK$xZ_1Iupz!jmxis%~IUS>OO6}R~xa~nTU_ZW+E!%w8~&?UV%0l zkJbIqdNs?svhHL}ZY{L{-H4o-1;=9YDBEFqzszeRuw!tr0}lCT?{zQ@WhX>*ZdUex z-9v52eajw@MA6|QZKA)|cTHRy*WYgW!Z8K;M zzq1uuy&sJ?{BVRKL6eA=?Hj1 zql{%lmv}X{r_1AsDN>|^{RNa!X8a4nDWkjwwJYL|7JLjp${p8-r6!H3Nw8u zVm#h|Q&G&!EU9;%x*V5}PM1%FcM(}ez83h2s5fhHg}?CN>IxfxILA0T002Q>6^ekt zd8TXj&G@(=v51bsWJ@AyIcc#w1498BquhmBAsA`q1z(|Tuu3%ZVR=@w78)sMEDsG} zFPyML{gP3_Ako@HS5#tm>-fwP4`RF-+4zwr+2(0M)mNeJg)EN2w`mHnqZI2n$WBZH zBnCw{={5&u>~_SLjrB}3gxnZD<}W6tCLZVX{X|0r*4K_^I|e;8Vc0Au*gOI$X##J9 zX%~OeDHx1(#Lbi~YyCj=N8L;Ely}y*kDU_W&YXW8u#o zT3-(E31@!dlv1+C^G%&q0xdOq)0OG9?8=mV5{t}(i~m?XXf2YtL|kd7JjEr{lH=Cp z6~#lIJbwITqN*D6!Q%lXL{%JUT>Tn?NxzxMq%cD4Lb9-!7l-qoLAhoG(^=+cjdaOCmj|yR=O_tP8b`}R6}9I z*(zQS5bPpsE^n<%>e`Xlt}IuBy4Fxs27mId#YmMk! zuEvr(`2C6jyFY?tt84p}EDUw)z0F8B#q+yo z!$|X2<2)@tLvT!f17tnjebVnw5r-GhsL5}?!`_EI_PaE%fw4Wd z!IQFYEzG=vZh+b{gqXFlj~H*iqqzMG(RJL*t;ib4t_7A|06b^x)rGB2+gy@d*t;+- z*{4Xd@ha?HF~bh@vvu1lA}mZ^YI?-s&o?Q6dFx0(XsjC=x_w%kQ8fH7* zeT~EZ-Lmk~pQzqVW;dRn^ZXoB*MDS%^(RPs0^oCXW~95kF_3MwyX6Z!E*oAfUynWS zfpy+HZ#}zDSJpKmvf~PvwQL+!#+dP^o@02QU*p;_rG5&2KcV&V&3q!9RL2vkz8?u} zWDkcex<~B@uCC|sUY1!M9{;o8w_++;#-Ov>IID-S*4Mo&TUiW{52u_gGEa)4y|zcu zU@IURr>$HlLRss)XO%LY70pT#i)%L#Ns2D|HlkXSM9`BJ=(YO$-Q(Xdjp#&=i!@-H zt{I9`i?tSz+fEaeOi=ioZkIBnB9=J9`0q)XTlRrKDH7TvFlycq0nveBRQJAS98R7z z4ZjC!s+zHoUA4ccqc<*rPl|6^T>CekDFClpC;xBMOQIyYpk}Ke4`lD6A`}dD8x&_v zs6nCu7E`UOn+E{7F#4Mb5Vf0Xm^O0E7K3bMk%hhlkb+Ud4cJ528gI%vJmE=va7!W= ze0NB>4-$THMj(GI;JtFpr=#kp$$Kr!EseJoTw$63PmerH`V=pA3Vz76+dR@A9Ic$- zDMbUW{D)O10ffsO2U=YgrM}`o!lG?{&8ivXL#R$hK z1kW&+8vHD6QZ|CjxSRS%eeE4RoIIX-Y72a&1IDL-_VTHfzb>p90`g+hr%W<{Yzf`V z4s5l1PC^TL7f_O>8Hz)%Si6`hzIB|lq;C}?vh7<&M#ak(FRsfQVKyeW^%pfn&spBb zhP{2vbVJ;^)kDbJ_92cOQQUqHuZE(w1UT(?@Vd{%uB_Kssw=~$ii{I?&S272VP8ID zyXY|2LMWcL7tc#PH)($+9IOt=TZMSF1*%1oEtV|ho879FK07T{j6>@+L)LiRIsCdE zgzm<3w$;6cef_57E!-y6pRV>?Xqjxp{B8NCRQCLyUJ<;WW4$o|Lu5q&UP@$yf3@uy z4QBj=@;m%qp>25rw-wLkw{wO)-n}s0<#moRx9foOGoPNHS@rysWoBoms*0l2^X|Py zVd7=`MDrU=j)U?zEi48u6~Ho)Rcx@mJcrj$gD0`tqC=Y0YP6iEQpQe41=y_P(714sglN|rpNRph33Fd{`IY8){rA5nJHV8sDF+2}@;Gi1w7y8~tuOj{R9_k!udCU98Ax zXxv%rCBU221#{;{5p3F3tNu0*>=%SHZ4`l~nIde!)PqS)Ac*4wS@0_JCd@-S1}2WO zUo6NOI+Ghnvj(7v*#U?>=B3=daHXFxG3ky|WCcChsYx3UV6xr=a`)^ibd{N9homkz zsGmsr!BWVf?>*#tnjrbn|9(9BduJVYA+Tx+Wrg+xW8ke?9yY04O@VXk{m$)m!O8_(!4ZtQoYX>J+Klq1B>T9BLE|&=-`PHftuXQmn z3V$)0UZ*NufaA7`_E}Y0A?It4Zi^%91y%y|hQYQm4|Y-HIU>gi){>W_-Tyd{e11cX zXJgLo4iTSmdMR)I2Rf`9OO#>Q20`}E59L$lofv9)$9%t@BP?H%?>T0p%ex@=ynBHd z>EF`(JudGc`^C?5jY=<1LEt$?@>!dAQSHUpY5-gQPhU92HikRfeI>rDe`p45+6TJ0^Oi&-r+4ON^lu9WY7KX)yR*h)Z$V6NthX_V74oB*MVi&5NjgQu!%v08#O#f9Qnl+r zU1u}eK6j?ag4?v(Hmwxa+&zwk8V?s%dn|LUW_6sD8wP8WC2A_<8+|098%R7cGdN0U z3~viyaE9&BAftX4<{Z}9(aK!O(ix@Ceq=#5O(nNxBgFLMi7$u|QSK%C(42+E$6y3< z1|TTku4%X6*HDcPh<-}#RIeN zy88o>;=fVDEw{@bFytQnxyRH8HN0%2QKZnh)4$pbBT-Uyr-1B--;TN5)FtI#S5@X- z#bwdJ4RG zTXT#$hT+F|l|>Q1HMCVC*Rr?!n=`QG;|8tap@vDHROTwT z1O}S4iHo=>CpG$Nlf=H~FP{9~(2&est~bBO4fCaI?T`+(5tB+s@&TO)b##JP z4#;Vo*a=|6y~uDIFxUk|j^0I51?aS41HIm!4`er~_Hk=xVElx+ZX?VVGv7G&zhSoj zdhhwX-v?LwU!d6M^TDi~@%QYZ_@}klE8WLOef}Cb=kJoh&oT4)IhFe=%zBPJ?+%RF z<(qWxJ2;L(cz%^nzk%pEro_Ab=4!7tn|H#l4aB1!7fXcp%ZkSMY^}c;j?Wva6O=;; zn-F}sl=&fqoW*#jwTx&8L1)yOAW`X3T%j9EPgC>IP)Tf~$|b}Xf#B_}#x+*yV%bgz zh0N>1W0v7B8o|S$kIUV3M}T@7@2Ht6=>L@FCn#wD%iPuOCJt*sq+o&)Sq(Q*XPdu4j(zIDvLQbbnmhvJe6d&}BSx=FBM=3IV4SduX9OR}820pVXt97Go2* z=WxBk^30G&=4<%t!@eQ@Ug3~tT-C%XFZ-1C{qgo zsGBezX$W~-0~u^3EjaZ6wYF)bTj?6ZEw9(uXf#3+t{eKbE6Mo?_VWsTR3X(1uvX5yOZBqT=8ohUpc+U&*t=dWCNXv~q@7ahpd_c6t>g${a&McQj@OOS5tzjZbW& zl2rm3XD!nk{p&nAt~F?h(pDBG5R*r?X(L3`oHPorvj<_*dXDSdq$Oj6V~2(bZ|^jU z#o52d!eO1`x}f$ew_*DA)33dlJX&d8Vu3S$IAZijpEO-}V?9m&I9O=E`hA*WROVfh zF$luFfpWTFn!_ns$|$VZI8e%8Io> z)ko+Jisjq*mE6igWD}=dTclup(#aY{a_TY=O^~{5vpLDd6BUJb0n_*uL6*9)&UM?> z7h0xeKSe(>ZQ;Nw@MT4i1O#`ou~RBwQrcJ=f0wf=%ZrEX)&p^`RO#L>W>$UKCG1jN z1j%qu6(6w+Te{_HK+y2E`sWx~ae!c(VP?4VQN>@O(h4k++wiE}@&}~zGuOYH{W-pCG9^kJ(0pRfG z_#fOf(0nz8W}=C7)*nHfs(7f%eGywx`GbyK%%`E?e7>AICSubFbzrBDi0?#F22=%H z#R{XM4o#@62BFc*(4%R|kq*IE(AoK9+3rhfiVi6`f<_P+rO}bGAk7tEG>{mF*@Vpc zit04eR0=x3z>B#eDJ00V7Q2>kWJXto6wSk)snT#gGk7{2ZNZ)?(rX!bpeMS?;8h<> zv}^kpPJzXbid4L+%mt?A#-s97_8$D*SQ<6djQoUjJh|)WQTBk9LOV`+)~ew)%+b>R z4`^^7KZn6_gVN)Gwzme7brn_&RdHz>E5Ck3)9$swc#5K)`(S4NgzWsloLH0<{U@f! z*&`~tOrYPHW}ZZZ;*#YM0%KpMmhIL~9co2ji3NwBEoj9|i*@0$6iD6}W1^ zFz{_*$Wqv~0f3|E0C3jj*#od?Po~ENRR8hO%kcA4Z_X<0sWS??pkeqrrp78tVn!&GQ#Bz%l9XxU2eW*%}@!57qfO! zrFXj_n4G8Jib)Quq#dKk$Xv$*OO?z4rnWqfvkuYD!JFmJJ#X1zf_POZNhmoRuLg(knUJkwL&?U%+=rA_U(uejCsDIdQ6!c zJv!(s_9!*c_@w3s;2bI#LGrHg0JkPnxp}ji0sf>{qUS$8ikP*iBV1yJ8lMQ z#RvL>MYNuN{rV6OS|L;C8yc^0*n1kPDhzZk9g40E6TlESLa3w{s)@6lD8YJ8cBl*wz!yS2O-hx?38`Ycd*ZR;c>;I(yl* z(FbLnlxIC)lCnl*v~FF9jo_NxO|fRXI^|b8tvATo+U16LvCGutcv&ZnnJLxFjw*q3 zz|Su3tO8{g1z1YLnCv9eofO4qm4Fv|az~&RI*cD1HDG_U)4g`{$-h-+|6{0)BK!W* zpDrhz06p=`z<@LS1$nh<*&q-Z*8p8s+}&8L1OTPFoIqBmhgk{AIos}(>K34W@=<5O zSStdoo($3Xw1#z0@9}Rn>90=i@%dO9YaYFsOJxmS-?vi&VEb?2`nx@E-R~wGuhH1P zvVq^f{T=sB?ReS$wk{~&H%hn7$nO2VZDG2v9w+Y`x_uEOBKmVQIj>6e@k!c<=Zg*8 z-(y#zv4eJ)IY(XT(w%7%lFpoi4Df{w21IwE$xwPFTM@1+d+w!O;#jp9QAhyiOd{#; zso1kZcFQOtmS6pc^`5!Pp>8}gPH8$BQz49MVB3;>3K#p(t6a90(L@OHZ~L;5SZEF= zjGaIsJp-2Oz)vY3H>39OzXv_^*abKA{An)!BMbRU77q#J)#nyLhJJz2Vd!OD>aqy! z*n7rYkg*ccG24OJk|>AMmo)^VGy}E{V8RE{0Z4zj??^btGn0snAkw2E{^346F3)H> zmD(;=4G!y^U)1J@*|SLLkYafjUN6vSj(G6Q?J^k5Rk_zur-0&DVIW4P1ClSslpN ziz<9zoc&_n;8S5l<=RW4IUI<8kr^g0o`OX~INu3J;|7KayBtA1M~{t83g=i~XrR+Pu%{q6njv%g&W z@_*_MJN_k-uc+|-+qUDUTI}jBw-+Ak+sjt2b@tX%6?jzwzCR!CZCy%!LCtTucRW^q z*F-s7+QH$nghkFF067~*z`h^=LphBwSm`j=C{%Y*zKyBMtk1Q!(8ixt)lqr0qMHXw zG3u%SBusTJOM7l>78nnVutHjqNU0U;!5$d2LuWEn>M#Ham19_>>H#Z(vhUBv<1|uv zPbK_VVKOkq))ea4458L4`Y`cO0Gw9jM$G_VSb5MB<##yL7(@)Q95_OU#b8x>Z)$demwUr_ks>tq+9&aLFuO zc=!=Za~8q`K-5f)e8)F3n)_3x9>-d)FTvv0As}HpVCm>+-^EXn$Q> zic{G&Z4_UV%|Uq0YP%=kU*Yf~8t+(~Jna6T zPWM-EeE<8$xIYo{4YB<%b64A=s?r2WbihC+iyHJ@l-Cmf_bw zrhW!sL=VkV18&b|#38(Nlr^D7x{V;Qn(bpCDd1vR8+LaW+#L0U!BVup*x3TfI*l} z0w_aL?QRr2_w%~qFB|)v&S%m^EkN#39*lT+mY2RMI;3vH{`jee7quVHoM{YBYmn%* zgsd|)+(3SLdT7aXA(kPOJPB0hu=nh*tez<~j8A|@%VHHe4=~5LjPf{n@bAaSg!N$h zb1Tf61TJM^@zwQ;&Qsb)xv6rQ7%)gKAX(8^neFELlaS{P%*_y{m>g?$`+}i`D-1aW zgZnM?OA{j62#F&qe!0pjK5`Fn)UeI{ILTK*7_fsIMh?X{UJBkqb^54jtbJnnHv-q} zuaptDmTqFA( zKbq!aUu5zTppS0`QFJEcsVNR$Y?h$Q;p<=~$Sec?>^^C8g|2|a-=NXx7)X9BmQt3( zjRm%kXdI=#nv~zhpV7)?V|ba@#Dg&;E>SCmlv+H^xz;B@b_-}S^y}83YFKEdK1PY> zyIqtVyBIE>#Y;q25>;oCDTUU!_!&Xv%G{{&*?C{R$*ZDj1|mb-VCVA7`Bo|{jSt(6 zt{j@~>x(!bUr!cqcN!O!NmU?ERvzefPm5cxfa1Q{C*9xJvoolUuxFZQw{ZBFwskY5 zb8T!V0Q~<9PT^k}IghnlC8(Exvqi8&XqW1zr--$GTdees(5iIpZ}&^$xDkM_kKaFm zaQlD0yiHKw7o5AN*EZedwd(l(j$|jGy`+lQ-247U)qQ_wOS0BzukzSQN?FgD3DN6D zv}UatEoMb1R8UuIBB+ZxK$9xN^%+@UWstc?lo2xMIzOTERM2#j$yjM4Zdt~bO8FpT z>7nt3Yal2pY4lHFbk42`fGZiQ2e<#CESi#OhNt0`DUTlom_`p0T)V+_GOT8qoc-{5 z0Mkah-dJyof*%zqYhPY#pA~#{!W?dYp;fEeU>2$#%&obk)-k8{iGqnV>9RnC1{_OoO(_8Q@bD{JmiE zgxu}W*neymzT6Da)38t+k+ZzvP%V&$#o?!IQ?rCR~)uvAKQ53NjxK_clrFSia%iHB2XU1u1icgxcV@og?1M>E50u#*TO27;}W@j)mdb`(x#R>7P>AZ$s8@?zxbVWR^c!ClM`> zUuf@ndhjy+83X>$a?*brr@sA=Xuc;7Ti;Jr-U!EDP&drN;@gW|b*Zu~qB_Aw+G|1z_A+rPaMQUx4JRKQZ-O595?WrBxMhV7|zihK;7tA(*0H zb|rufRoLLs_KCE@8LCA>-whqczK_3Ogh zG%@V`qL_+0D!1I}V)C~2PqFLZjS4I7%I_v(bBs&}-rl%XgxR|ou~tY83RWg-=G~T& z)juSPhM$(K-Pv}wm-nJ#Nk1zhs!fI3-{wP$t7Pg{#K?18vSziutYpj9H^4aGpDmBm z8+B7N%`u<6D3hCrsJjH>Tr&25f7S$h3%|aC{VCr3&*5FpW630yQ*y3{lmiLR|0GAONX|3_nA5QfSKe&Ggq`MsJDX*o~}ZR01nP9bXDgGEnS5P)t2&}!~WM7 zjd}xn-my&Sj3J*&Vyjb{`cB4T`S0%pfSZDzPV8A|hR$->iAa;rof9Y*rqrvfCN;B! z3cJ*zAi*7kny=Rpnr&*N&yNRA1)z&ES zJ;5?jK^rX*kV!q)6}8~%VF??}NuF!YX-VJXZ2ly%wMG|6b=m-ZW!uK_+KlM00lTCQA@8efUBSWm3z2ZOB{zri4h;#w zERj-;T?@Ww@Yo5eXs!4eJw)Jza_$+QU>JRxe8H#T1)_&WzDEuIld;qag_Clk5Mg-bim?cuoq@AuaToB8XCqIj7*S=`&rB}-av18 z@aeTl>!BM9>zk6t-kxnho1it$#`P@4)hq?q?0Xo_e!$0g}}xp?RD_7+BAx zPpfV13HS#H{jyUu5V`$}2=%Lo>z;tFi~=u#>HGWR+}A4WXBfUe#k@(S!$PIQBEVYt zh@`F}YX&Ui^OjQ~`SN=hb;pwsHaL3)!Hq0hDL0V`LDCEHC0Q-rkPjr0rf)N2+4AqK9!_j%l(QeM3X(b9#_U0M%rxpg&?F0<5Esh5 z$h&hyUKyIk41gVhLbGqGf(DfGjtOs6*_oh?HG-fC7YT03$a zYY}t;Mu7LsK(W<)Q8Ic7y*2<{n}AB}|AO89MAVH%-<1&tCE zgyF)2fQ<~Xj0_8GUY!nsG%MWtfmHRanu9h5B`VY?JO`&u8lSc9u0;B z)`r7W?+sc%7$N>e6K0t!9bv(I1mqqg3aeyl|HYW`{_7XNQ@HIw+&?s4pu3T27ENqU;W2fF=v#UENfo%8-YU)5 z1-qZs4g?}^cCD)-%jmm_8JXjFf14_gUYLjNdlao@zNq6k76*89>2>Z#S?SS#7M=u7 z6Z*kH*!wPI_IB{0&U0zw2FJeoT@ltsWey^)I8}l%gCX2ApX;Hr;9cEosSA(ut=fsIn(09-0PRwz7|GftoF~tk?I* zX5TMd?12-6wuQ|s`kojx1b-_1sT=z91!p;9nu;Z4hAGsohfLO#hfO8<0ajOFZhk*IyzBH*1v}7VzYgt= z)=VRjn9tS33@Xgu30dVrRvmVVdPTXl;b zOR2`ydCftRK#zJz(1zAUK!?Kr@0B6fqA2Z&Nv~2(rp=WO8G{lY4<3NKFf^LS!Y!OE za>fEzGN|mYxtB|u9WsA7U^0w3p)IWHOK$&x^QIWnWhs&+$wNg`Dq+DG;L%bsUb&xY zqS^_(u$Mf>il&upb~>IoU<;t-EEKl6dV3o+1c`8aVz|R7^<*)uJf8Z~fDUfJs~iU8 zn4z9!oau-*H2Qdw_U0$;$Oe$M@4#Pi?b1eW&H~RKn0m3i>?hH-3GUG`rJC=92Ly&$ zqH`Sx3qe_sRw%HvVvWpe;Aj(e`oFFNK{cL2PVPk`g~Z`8;Al&~DYiptZ!vCp0?aWa zd?(7HRErCdViAWugk1Tx?PYDB1-VLd-QAAlhIqTpY4wPzhnTci4}tUo|0EKq9(D*-P>$#N%Jiv@J1w$GH0OYO{}8qGUIQZ6|RZ4( z@L@L9hfS&-3rt6`SDr4RtNz$4oAb~%$C8*o_%%ObqQPx3tlcz^0&-EeJJHo7#|QuG zsrhdYTIs86zRRVXj|Y(C5kSMkfMxrFOIX;X55ZZ$aovW9h3Ea)Z(81No(cjhEku|- zSB}?^=Pm2D!~=qJxF@C7=LaZ%n$z$^qpvRx#g6yaeFNLa>OGxiLVWx=+1^9-cGUT? zZfrcyIMS>FYAJU39M!Cp7^7NwvONcG6es!MJ11A>c`A{34kM)A+UY*Sh!|kst94w9}x;#-lrkkTq)6(k07VvT|FYN{U z*=r#hF}34rtTf+&9R{2>nizX1UDY&_JSasbO)k)Eb-Ufl)>B;c1;3#zn)Q-Zge>`k zOw-c!sTZdWh}bfkjAS9PrAA*DtuU)7e4k8}iAR?w{+xyO&!1;_i{L;&bE1Mn7*&D^ zS+`Yz?jSmIjF=9ZWOP_PGbT-bn#ImTtfnoK|1cemxm*@DK-Koh>?n|}i1bVSd z;dZ6FLm<3m1X>}wu}!O7f1|PFu=nb4`yQ>qZK-Xv&%$ROl=(GBS7A15R*y